# HG changeset patch # User lorenm # Date 1259862248 0 # Node ID 79f3ead3ebc19e96b59d98e5bc09c8b315f0aef6 # Parent 84cca0a953c506a0d48324c769fb9ad113be2e24 inline to allow constant propagation 50% faster predictor_update_filter, 1-10% faster ape decoding on core2 diff -r 84cca0a953c5 -r 79f3ead3ebc1 apedec.c --- a/apedec.c Wed Dec 02 23:51:15 2009 +0000 +++ b/apedec.c Thu Dec 03 17:44:08 2009 +0000 @@ -517,7 +517,7 @@ 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 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++;