[FFmpeg-devel] AAC encoder questions
Alex Converse
alex.converse
Fri Apr 24 09:51:13 CEST 2009
On Fri, Apr 24, 2009 at 3:16 AM, Kostya <kostya.shishkov at gmail.com> wrote:
> On Fri, Apr 24, 2009 at 03:07:18AM -0400, Alex Converse wrote:
>> Looking through the AAC encoder I see two things popping up over and
>> over again and I'm not sure if I'm misunderstanding what's going on or
>> something is a little off:
>>
>> Through out?the AAC encoder there are blocks of code like:
>>
>> > ?? ? ? ? ? if(IS_CODEBOOK_UNSIGNED(cb)){
>> > ?? ? ? ? ? ? ? for(k = 0; k < dim; k++){
>> > ?? ? ? ? ? ? ? ? ? float t = fabsf(in[i+k]);
>> > ?? ? ? ? ? ? ? ? ? float di;
>> > ?? ? ? ? ? ? ? ? ? //do not code with escape sequence small values
>> > ?? ? ? ? ? ? ? ? ? if(vec[k] == 64.0f && t < 39.0f*IQ){
>> Shouldn't this escape stuff check for cb==ESC_BT in addition to vec[k]==64.0f?
>
> No, that value can occur only in escape codebook (for escapes).
>
ok
>> > ?? ? ? ? ? ? ? ? ? ? ? rd = INFINITY;
>> > ?? ? ? ? ? ? ? ? ? ? ? break;
>> > ?? ? ? ? ? ? ? ? ? }
>> > ?? ? ? ? ? ? ? ? ? if(vec[k] == 64.0f){//FIXME: slow
>> Ditto
>> > ?? ? ? ? ? ? ? ? ? ? ? if(t >= 165140.0f*IQ){ // clipped value
>> > ?? ? ? ? ? ? ? ? ? ? ? ? ? di = t - 165140.0f;
>> Shouldn't this be "di = t - 165140.0f*IQ;"
>
> I don't think so - it means quantised and unquantised value (like in else below)
>
The numbers just seem really strange...
let's say Q=0.5 this implies IQ = 2.0
now lets look @ t == 330200:
the if is false -> c = 8190 -> di = 27
@ t == 330250:
the if is false -> c = 8191 -> di = 23
@ t == 330279:
the if is false -> c = 8191 -> di = 52 //Clipping is occuring here too
@ t == 330280:
the if is true -> di = 165140
@ a t == 330300:
the if is true -> di = 165110
[...]
More information about the ffmpeg-devel
mailing list