Commit 36373cde authored by Loren Merritt's avatar Loren Merritt

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
parent 2784ede4
...@@ -517,7 +517,7 @@ static inline int APESIGN(int32_t x) { ...@@ -517,7 +517,7 @@ static inline int APESIGN(int32_t x) {
return (x < 0) - (x > 0); 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; int32_t predictionA, predictionB;
...@@ -578,17 +578,16 @@ static int predictor_update_filter(APEPredictor *p, const int decoded, const int ...@@ -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) static void predictor_decode_stereo(APEContext * ctx, int count)
{ {
int32_t predictionA, predictionB;
APEPredictor *p = &ctx->predictor; APEPredictor *p = &ctx->predictor;
int32_t *decoded0 = ctx->decoded0; int32_t *decoded0 = ctx->decoded0;
int32_t *decoded1 = ctx->decoded1; int32_t *decoded1 = ctx->decoded1;
while (count--) { while (count--) {
/* Predictor Y */ /* Predictor Y */
predictionA = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, YADAPTCOEFFSA, YADAPTCOEFFSB); *decoded0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, YADAPTCOEFFSA, YADAPTCOEFFSB);
predictionB = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, XADAPTCOEFFSA, XADAPTCOEFFSB); decoded0++;
*(decoded0++) = predictionA; *decoded1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, XADAPTCOEFFSA, XADAPTCOEFFSB);
*(decoded1++) = predictionB; decoded1++;
/* Combined */ /* Combined */
p->buf++; p->buf++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment