[FFmpeg-devel] [PATCH] AAC encoder: improve SF range utilization

Claudio Freire klaussfreire at gmail.com
Mon Nov 30 17:21:21 CET 2015

On Mon, Nov 30, 2015 at 1:04 PM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> On Mon, Nov 30, 2015 at 4:50 PM, Claudio Freire <klaussfreire at gmail.com> wrote:
>> On Mon, Nov 30, 2015 at 12:27 PM, Rostislav Pehlivanov
>> <atomnuker at gmail.com> wrote:
>>> On Sun, 2015-11-29 at 16:54 -0300, Claudio Freire wrote:
>>>> Before pushing this, I'd like some feedback,
>>>> especially about
>>>> the implementation of point 3. I'm not sure the AAC encoder
>>>> setting the cutoff in the encoder context like this is legal or
>>>> desirable.
>>> I think setting the cutoff is necessary. You can't avoid holes and yet
>>> keep a full bandwidth as you decrease bits unless you like the sound of massive quantization errors.
>> My point was more about whether a codec should write into the context
>> struct like that or not. Basically an API technicality that's unclear
>> to me.
> It seems slightly odd to write into that variable, since thats the
> cutoff the user requests.
> Maybe you can use/write into a private variable instead? ac3enc seems
> to use a private variable for similar purposes.

I tried, but it gets very invasive and dirty, because the one that
needs to write is the coder in libavcodec/aaccoder, but the one that
needs to read it is libavcodec/aacpsy, which are abstracted from each

That is, aaccoder has no access to aacpsy's internal state and
viceversa. Doing the above would imply making one of the two able to
access the other's internal state, which seems dirty.

Alternatively, I could add the cutoff to the FFPsyContext struct and
write into that instead. That seems like a cleaner approach.

I'll look into that possibility.

More information about the ffmpeg-devel mailing list