>>>>> "S" == Segher Boessenkool <[EMAIL PROTECTED]> writes:

    S> Calculate i = floor(pow(x, 0.75)) as usual. i is integer.

    S> Now:

    S> if (x > pow(0.5 * (pow(i, 8.0/3.0) + pow(i+1, 8.0/3.0)), 0.375))
    S>     i++;

    S> and i is the quantized value.

    S> Rationale: minimize the quantization noise per sample. The iso
    S> formula merely minimizes the average case, and not really good
    S> either.

Wow! this will bring us a big quality improvement....

    S> Hope you like it,

Yes, but I don't like there's "if statement" in a loop :p.
My implementation is this.

Old formula is
            *pi++ = (int)(istep * (*xp++) + 0.4054);

And I changed
            x = istep * *xp++;
            *pi++ = (int)(x + adj43[(int)x]);

And adj43[] is a lookup table, building up like this.

    for (i = 0; i < PRECALC_SIZE - 1; i++)
        adj43[i] = (i + 1) - pow(0.5 * (pow43[i] + pow43[i + 1]), 0.75);

    adj43[i] = 0.5;
--- 
Takehiro TOMINAGA // may the source be with you!
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to