Browse Source

Correct wrong lower limit and condition used in APE decoder

Originally committed as revision 15396 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Kostya Shishkov 17 years ago
parent
commit
e774c41cab
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      libavcodec/apedec.c

+ 2
- 3
libavcodec/apedec.c View File

@@ -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…
Cancel
Save