[SCM] libav/experimental: 1-13% faster apply_filter, 1-3% faster ape decoding on core2
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 16:55:30 UTC 2013
The following commit has been merged in the experimental branch:
commit d09f65c7ec0339bcf3b1a3c579e42a8133740bbd
Author: Loren Merritt <lorenm at u.washington.edu>
Date: Fri Dec 4 15:12:09 2009 +0000
1-13% faster apply_filter, 1-3% faster ape decoding on core2
Originally committed as revision 20729 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 3a0d172..b8d1e9e 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -678,14 +678,9 @@ static inline void do_apply_filter(APEContext * ctx, int version, APEFilter *f,
/* 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;
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list