mirror of
https://github.com/mpv-player/mpv
synced 2025-01-31 04:02:06 +00:00
Simplify predictor updates
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27152 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8532066166
commit
9f941c8a00
@ -150,16 +150,10 @@ static void decode_nibbles(unsigned short *output,
|
||||
|
||||
sign = delta & 8;
|
||||
delta = delta & 7;
|
||||
delta = 2 * delta + 1;
|
||||
if (sign) delta = -delta;
|
||||
|
||||
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;
|
||||
else
|
||||
predictor[channel_number] += diff;
|
||||
predictor[channel_number] += (delta * step[channel_number]) >> 3;
|
||||
|
||||
CLAMP_S16(predictor[channel_number]);
|
||||
output[i] = predictor[channel_number];
|
||||
|
Loading…
Reference in New Issue
Block a user