[MPlayer-dev-eng] MS-ADPCM/Stereo Works

Michael Niedermayer michaelni at gmx.at
Fri Dec 28 04:26:20 CET 2001


Hi

On Friday 28 December 2001 04:05, Michael Niedermayer wrote:
[...]
> ... cool, we r trying to optimize a adpcm decoder wich needs perhaps 1% of
> the cpu time

that following could be replaced with a simple look up table i think
    sign = delta & 8;
    delta = delta & 7;

    diff = step[channel_number] >> 3;
    if (delta & 4) diff += step[channel_number];
    if (delta & 2) diff += step[channel_number] >> 1;
    if (delta & 1) diff += step[channel_number] >> 2;

    if (sign)
      predictor[channel_number] -= diff;
...
    step[channel_number] = adpcm_step[index[channel_number]];
----------
diff= lut[delta]
...
lut= adpcm_step_lut[index[channel_number]];

CLAMP_0_TO_88 could allso be replaced with a look up table

Michael



More information about the MPlayer-dev-eng mailing list