[FFmpeg-devel] AAC encoder questions

Kostya kostya.shishkov
Fri Apr 24 15:34:16 CEST 2009


On Fri, Apr 24, 2009 at 03:51:13AM -0400, Alex Converse wrote:
> 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:
[...]
> >> > ?? ? ? ? ? ? ? ? ? ? ? rd = INFINITY;
> >> > ?? ? ? ? ? ? ? ? ? ? ? break;
> >> > ?? ? ? ? ? ? ? ? ? }
> >> > ?? ? ? ? ? ? ? ? ? if(vec[k] == 64.0f){//FIXME: slow
> >> > ?? ? ? ? ? ? ? ? ? ? ? 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

Well, my logic was:
* we have coefficient t
* dividing it by quantizer to compare with codebook vector is equivalent to
 multiplying that codebook vector by quantizer and we don't have to scale that
 difference back
* 165140 ~= pow(8192, 1.33) - maximum value for unclipped output coeff
* t >= 165140*IQ should mean that clipping will occur with that value of quantiser
* if clipping happens, we will get maximum value instead of real one, so it will be
 always 165140 which is used in calculating difference.

(hey, I've understood it myself!)

[...]



More information about the ffmpeg-devel mailing list