[FFmpeg-devel] AAC encoder questions

Alex Converse alex.converse
Fri Apr 24 09:07:18 CEST 2009


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?
> ?? ? ? ? ? ? ? ? ? ? ? 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;"
> ?? ? ? ? ? ? ? ? ? ? ? ? ? curbits += 21;
> ?? ? ? ? ? ? ? ? ? ? ? }else{
> ?? ? ? ? ? ? ? ? ? ? ? ? ? int c = quant(t, Q);
> ?? ? ? ? ? ? ? ? ? ? ? ? ? di = t - c*cbrt(c)*IQ;
> ?? ? ? ? ? ? ? ? ? ? ? ? ? curbits += av_log2(c)*2 - 4 + 1;
> ?? ? ? ? ? ? ? ? ? ? ? }
> ?? ? ? ? ? ? ? ? ? }else{
> ?? ? ? ? ? ? ? ? ? ? ? di = t - vec[k]*IQ;
> ?? ? ? ? ? ? ? ? ? }
> ?? ? ? ? ? ? ? ? ? if(vec[k] != 0.0f)
> ?? ? ? ? ? ? ? ? ? ? ? curbits++;
> ?? ? ? ? ? ? ? ? ? rd += di*di*lambda;
> ?? ? ? ? ? ? ? }
> ?? ? ? ? ? }else{

Any explanation would be appreciated.

Thanks,
Alex Converse



More information about the ffmpeg-devel mailing list