Browse Source

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

Originally committed as revision 20729 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Loren Merritt 16 years ago
parent
commit
d09f65c7ec
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      libavcodec/apedec.c

+ 3
- 8
libavcodec/apedec.c View File

@@ -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;



Loading…
Cancel
Save