summaryrefslogtreecommitdiff
path: root/libavcodec/apedec.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2009-12-03 17:44:08 +0000
committerLoren Merritt <lorenm@u.washington.edu>2009-12-03 17:44:08 +0000
commit36373cde20957b621aaab4779b36ee87096e5e93 (patch)
treec80ad77660402ae1d1974d920cc89340372685c6 /libavcodec/apedec.c
parent2784ede40aa76e89ec46a323631040f6f23f10aa (diff)
inline to allow constant propagation
50% faster predictor_update_filter, 1-10% faster ape decoding on core2 Originally committed as revision 20719 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r--libavcodec/apedec.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 20ebe9ed67..fa8f654199 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -517,7 +517,7 @@ static inline int APESIGN(int32_t x) {
return (x < 0) - (x > 0);
}
-static int predictor_update_filter(APEPredictor *p, const int decoded, const int filter, const int delayA, const int delayB, const int adaptA, const int adaptB)
+static av_always_inline int predictor_update_filter(APEPredictor *p, const int decoded, const int filter, const int delayA, const int delayB, const int adaptA, const int adaptB)
{
int32_t predictionA, predictionB;
@@ -578,17 +578,16 @@ static int predictor_update_filter(APEPredictor *p, const int decoded, const int
static void predictor_decode_stereo(APEContext * ctx, int count)
{
- int32_t predictionA, predictionB;
APEPredictor *p = &ctx->predictor;
int32_t *decoded0 = ctx->decoded0;
int32_t *decoded1 = ctx->decoded1;
while (count--) {
/* Predictor Y */
- predictionA = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, YADAPTCOEFFSA, YADAPTCOEFFSB);
- predictionB = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, XADAPTCOEFFSA, XADAPTCOEFFSB);
- *(decoded0++) = predictionA;
- *(decoded1++) = predictionB;
+ *decoded0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, YADAPTCOEFFSA, YADAPTCOEFFSB);
+ decoded0++;
+ *decoded1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, XADAPTCOEFFSA, XADAPTCOEFFSB);
+ decoded1++;
/* Combined */
p->buf++;