[FFmpeg-devel] [PATCH] aacdec: padding skip improvements

Cosmin Stejerean cosmin at cosmin.at
Thu Oct 5 20:22:43 EEST 2023



> On Oct 4, 2023, at 7:37 PM, Lynne <dev at lynne.ee> wrote:
> 
> 2048 is just more widely encountered. I'm posting these patches
> to get an opinion:
>  - do we cut nothing at all (currently)
>  - do we cut 1024 (required by the standard/algorithm, and currently what our AAC ENcoder outputs)
>  - do we cut 2048 (what is most widely expected)
> 
> My preference would be 1024. Note: this is only for raw AAC
> streams outside of a container. Streams inside of a container are currently
> correctly cut, with this value being overridden.

I think it would be good by default to have the ffmpeg encoder and decoder roundtrip correctly, and then leverage an option to specify a different padding if a different encoder was used. I think the important property is that if we take a PCM input, encode it to raw AAC with ffmpeg and then decode it to PCM output that we have the same number of PCM samples and they're all properly aligned. 

Since we can't correctly handle unknown encoders (that might be using 2048 or 2112 priming samples) for the option to override the priming samples should be used in that case (which could also be set to 0 if someone really wants potentially distorted output before the decoder was properly primed).

- Cosmin


More information about the ffmpeg-devel mailing list