[FFmpeg-devel] [RFC PATCH 1/3] aacdec: always skip the first 2048 samples if there's no side data

Lynne dev at lynne.ee
Tue Oct 3 07:09:13 EEST 2023


Sep 12, 2023, 23:25 by tfoucu at gmail.com:

> On Tue, Sep 12, 2023 at 9:25 AM Lynne <dev at lynne.ee> wrote:
>
>> Sep 12, 2023, 09:43 by andreas.rheinhardt at outlook.com:
>>
>> > Lynne:
>> >
>> >> For some reason, this was never set, which meant all **raw** AAC in ADTS
>> >> streams, except faac, had extra samples at the start.
>> >>
>> >> Despite this being a standard MDCT-based codec with a frame size of
>> 1024,
>> >> hence a delay of 1024 samples at the start, all major encoders,
>> excluding
>> >> faac and FFmpeg, use 2048 samples of padding.
>> >>
>> >> The FFmpeg encoder will be modified to also output 2048 samples of
>> padding
>> >> at the start, to make it in line with other encoders.
>> >>
>> >
>> > Does this also have actual advantages besides "being in line with other
>> > encoders"?
>> >
>>
>> Not really. I don't have an opinion on this. 1024 is the natural
>> delay of the codec, so maybe it would be best to leave it at that.
>>
>>
>> Note:
>>
> Not all encoders add 2048. Another version of the Fraunhofer encoder will
> add only 1600 samples
>
> and for HE-AAC of the same encoder will add 3200 samples.
> Should we not then have an option to set it ?
>

That sounds reasonable, I've resent the patch.
Do you think it's reasonable to go 2048 samples?

It does cut off the default AAC decoder, in case the FIL extension
has been stripped.


More information about the ffmpeg-devel mailing list