mirror of https://git.ffmpeg.org/ffmpeg.git
Correct wrong lower limit and condition used in APE decoder
Originally committed as revision 15396 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
f26be47740
commit
e774c41cab
|
@ -358,11 +358,10 @@ static inline int range_get_symbol(APEContext * ctx,
|
||||||
|
|
||||||
static inline void update_rice(APERice *rice, int x)
|
static inline void update_rice(APERice *rice, int x)
|
||||||
{
|
{
|
||||||
|
int lim = rice->k ? (1 << (rice->k + 4)) : 0;
|
||||||
rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
|
rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
|
||||||
|
|
||||||
if (rice->k == 0)
|
if (rice->ksum < lim)
|
||||||
rice->k = 1;
|
|
||||||
else if (rice->ksum < (1 << (rice->k + 4)))
|
|
||||||
rice->k--;
|
rice->k--;
|
||||||
else if (rice->ksum >= (1 << (rice->k + 5)))
|
else if (rice->ksum >= (1 << (rice->k + 5)))
|
||||||
rice->k++;
|
rice->k++;
|
||||||
|
|
Loading…
Reference in New Issue