> 
> Just to explain a little more what Segher is writing about:
> MP3 uses a nonlinear quantization of the MDCT coefficients.
> Let x = an MDCT coefficient after all scalefactors have been applied.
> MP3 needs to truncate x^(3/4) to an integer.
>
> As an example,
> x=1.80
> x^3/4  = 1.55
>
> two possible integers: i=1 or 2
>
> Take i=1:   1^(4/3) = 1     error:  1.75-1  = .80
> Take i=2:   2^(4/3) = 2.52  error:  2.52-1.75 = .72
>
> So i=2 is the better choice.  The iso formula says to just take i =
> floor(x^3/4 + .4054) = 1, giving a sub optimal answer.  I never knew
> where the .4054 came from, but it must be (as Segher mentions) optimal
> for a typical value of x.
>
> The midpoint (in terms of the error) is:  .5 * (1 + 2.52) = 1.76.
> So if x<1.76, we should take i=1 and if x>1.76 we take i=2.
>
> Segher, shouldn't the formula be:
>
>> if (x > (0.5 * (pow(i, 4.0/3.0) + pow(i+1, 4.0/3.0))
>>  i++;
You should decompose (x^3/4 + .4054) = (x^3/4 + 0,5 - 0,0946)
0,5 is for rounding to the nearest integer and 0,0946 = (2^0,25-1)/2.
I don't know if this formula is bad but in your example, you take x^3/4 =
1,55 and then you use 1,75 to make the test!Of course it doesn't work.

Lionel
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to