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

lorenm subversion
Fri Dec 4 16:12:09 CET 2009


Author: lorenm
Date: Fri Dec  4 16:12:09 2009
New Revision: 20729

Log:
1-13% faster apply_filter, 1-3% faster ape decoding on core2

Modified:
   trunk/libavcodec/apedec.c

Modified: trunk/libavcodec/apedec.c
==============================================================================
--- trunk/libavcodec/apedec.c	Fri Dec  4 16:01:58 2009	(r20728)
+++ trunk/libavcodec/apedec.c	Fri Dec  4 16:12:09 2009	(r20729)
@@ -678,14 +678,9 @@ static inline void do_apply_filter(APECo
             /* Version 3.98 and later files */
 
             /* Update the adaption coefficients */
-            absres = (res < 0 ? -res : res);
-
-            if (absres > (f->avg * 3))
-                *f->adaptcoeffs = ((res >> 25) & 64) - 32;
-            else if (absres > (f->avg * 4) / 3)
-                *f->adaptcoeffs = ((res >> 26) & 32) - 16;
-            else if (absres > 0)
-                *f->adaptcoeffs = ((res >> 27) & 16) - 8;
+            absres = FFABS(res);
+            if (absres)
+                *f->adaptcoeffs = ((res & (1<<31)) - (1<<30)) >> (25 + (absres <= f->avg*3) + (absres <= f->avg*4/3));
             else
                 *f->adaptcoeffs = 0;
 



More information about the ffmpeg-cvslog mailing list