[FFmpeg-cvslog] r15396 - trunk/libavcodec/apedec.c

kostya subversion
Wed Sep 24 14:45:28 CEST 2008


Author: kostya
Date: Wed Sep 24 14:45:28 2008
New Revision: 15396

Log:
Correct wrong lower limit and condition used in APE decoder

Modified:
   trunk/libavcodec/apedec.c

Modified: trunk/libavcodec/apedec.c
==============================================================================
--- trunk/libavcodec/apedec.c	(original)
+++ trunk/libavcodec/apedec.c	Wed Sep 24 14:45:28 2008
@@ -358,11 +358,10 @@ static inline int range_get_symbol(APECo
 
 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++;




More information about the ffmpeg-cvslog mailing list