[FFmpeg-devel] [PATCH] AAC decoder

Robert Swain robert.swain
Fri May 23 11:51:57 CEST 2008


2008/5/23 Robert Swain <robert.swain at gmail.com>:
> 2008/5/23 Robert Swain <robert.swain at gmail.com>:
>> 2008/4/2 Michael Niedermayer <michaelni at gmx.at>:
>>> On Tue, Apr 01, 2008 at 04:56:48PM +0200, Andreas ?man wrote:
>>>> Andreas ?man wrote:
>>
>> [...]
>>
>>>> +static inline float ivquant(AACContext * ac, int a) {
>>>> +    static const float sign[2] = { -1., 1. };
>>>> +    int tmp = (a>>31);
>>>> +    int abs_a = (a^tmp)-tmp;
>>>> +    if (abs_a < sizeof(ac->ivquant_tab)/sizeof(ac->ivquant_tab[0]))
>>>> +        return sign[tmp+1] * ac->ivquant_tab[abs_a];
>>>
>>> What is the point of the sign splitout? it seems that it would be simpler
>>> to have that in teh table as well
>>
>> Kostya is in favour of removing the ivquant_tab table because it
>> caches only a small number of possible values and its general impact
>> on decoding speedup is not obvious.
>>
>> Attached is a patch that removes the ivquant_tab table and simplifies
>> and moves the ivquant() functionality into the calling loop and
>> removes the ivquant() function altogether as it isn't really needed to
>> wrap pow().
>
> Oops! sign * pow(abs(a), 4./3) != pow(a, 4./3) . Fixed patch attached
> with bit magic returned.
>
> I'll do some benchmarks too, just for good measure.

Actually, I won't. abs(a) is normally <16 but can be up to 4351 (if I
understood the escape sequence decoding).

http://article.gmane.org/gmane.comp.video.ffmpeg.soc/2002/match=ivquant

Andreas just did another benchmark and this has a large impact on decoding time.

I'll look at merging the sign into the table as originally suggested.
I suspect the table size can be reduced to 16 (vs 256) with little to
no impact on speed. Ignore the patch for the moment. Sorry for the
noise.

Rob



More information about the ffmpeg-devel mailing list