Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Ramiro Polla <ramiro.polla@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 1/7] avcodec/pcm: Remove always-false check
Date: Sat, 15 Mar 2025 03:14:54 +0100
Message-ID: <a507a648-2d97-422d-8a5a-4ee482761b4d@gmail.com> (raw)
In-Reply-To: <AS8P250MB0744AB018F8859A608A641C88FD32@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>


On 3/13/25 06:49, Andreas Rheinhardt wrote:
> Patches attached.


[PATCH 2/7] avcodec/pcm: Cache sample_size value

> diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
> index 5d8dcb8ff0..620acf0f46 100644
> --- a/libavcodec/pcm.c
> +++ b/libavcodec/pcm.c
> @@ -328,17 +335,14 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
>      int buf_size       = avpkt->size;
>      PCMDecode *s       = avctx->priv_data;
>      int channels       = avctx->ch_layout.nb_channels;
> -    int sample_size, c, n, ret, samples_per_block;
> +    int sample_size = s->sample_size, c, n, ret, samples_per_block;
>      uint8_t *samples;
>      int32_t *dst_int32_t;

Could you put sample_size on its own line? It gets a little confusing 
with the first variable being initialized, but the subsequent variables 
being uninitialized.


[PATCH 3/7] avcodec/pcm: Remove duplication from FFCodec define macros

> diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
> index 620acf0f46..6c1feecca3 100644
> --- a/libavcodec/pcm.c
> +++ b/libavcodec/pcm.c
[...]
> +//       AV_CODEC_ID_*       pcm_* name
> +//                 AV_SAMPLE_FMT_*               long name
> +PCM_CODEC  (ALAW,         S16, alaw,         "PCM A-law / G.711 A-law");
> +PCM_DECODER(F16LE,        FLT, f16le,        "PCM 16.8 floating point little-endian");

The labels don't align with the fields.

And in the next patch ([PATCH 4/7] avcodec/pcm: Don't allocate LUT when 
unused), with the introduction of PCM_CODEC_EXT(), the alignment of 
PCM_CODEC/PCM_DECODER/PCM_CODEC_EXT is lost.

Ramiro

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2025-03-15  2:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13  5:49 Andreas Rheinhardt
2025-03-15  1:10 ` Andreas Rheinhardt
2025-03-15  2:14 ` Ramiro Polla [this message]
2025-03-15  4:55   ` Andreas Rheinhardt
2025-03-16 13:24     ` Ramiro Polla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a507a648-2d97-422d-8a5a-4ee482761b4d@gmail.com \
    --to=ramiro.polla@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git