mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-08 13:38:07 +00:00
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)
|
||||
{
|
||||
int lim = rice->k ? (1 << (rice->k + 4)) : 0;
|
||||
rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
|
||||
|
||||
if (rice->k == 0)
|
||||
rice->k = 1;
|
||||
else if (rice->ksum < (1 << (rice->k + 4)))
|
||||
if (rice->ksum < lim)
|
||||
rice->k--;
|
||||
else if (rice->ksum >= (1 << (rice->k + 5)))
|
||||
rice->k++;
|
||||
|
Loading…
Reference in New Issue
Block a user