mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
WMA: fix loop unrolling in decode_exp_vlc()
The count can be a non-multiple of 4 after all. Originally committed as revision 20081 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
a7adcf29cf
commit
0e71841b05
@ -330,12 +330,12 @@ static int decode_exp_vlc(WMACodecContext *s, int ch)
|
|||||||
iv = iptab[last_exp];
|
iv = iptab[last_exp];
|
||||||
max_scale = v;
|
max_scale = v;
|
||||||
n = *ptr++;
|
n = *ptr++;
|
||||||
do {
|
switch (n & 3) do {
|
||||||
*q++ = iv;
|
case 0: *q++ = iv;
|
||||||
*q++ = iv;
|
case 3: *q++ = iv;
|
||||||
*q++ = iv;
|
case 2: *q++ = iv;
|
||||||
*q++ = iv;
|
case 1: *q++ = iv;
|
||||||
} while (n -= 4);
|
} while ((n -= 4) > 0);
|
||||||
}else
|
}else
|
||||||
last_exp = 36;
|
last_exp = 36;
|
||||||
|
|
||||||
@ -352,12 +352,12 @@ static int decode_exp_vlc(WMACodecContext *s, int ch)
|
|||||||
if (v > max_scale)
|
if (v > max_scale)
|
||||||
max_scale = v;
|
max_scale = v;
|
||||||
n = *ptr++;
|
n = *ptr++;
|
||||||
do {
|
switch (n & 3) do {
|
||||||
*q++ = iv;
|
case 0: *q++ = iv;
|
||||||
*q++ = iv;
|
case 3: *q++ = iv;
|
||||||
*q++ = iv;
|
case 2: *q++ = iv;
|
||||||
*q++ = iv;
|
case 1: *q++ = iv;
|
||||||
} while (n -= 4);
|
} while ((n -= 4) > 0);
|
||||||
}
|
}
|
||||||
s->max_exponent[ch] = max_scale;
|
s->max_exponent[ch] = max_scale;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user