ra144: factor division out
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 23 Sep 2012 16:30:41 +0000 (18:30 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 23 Sep 2012 19:12:23 +0000 (21:12 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ra144.c

index c54be50..aa68378 100644 (file)
@@ -1566,8 +1566,9 @@ int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx)
         if (!b)
             b = -2;
 
+        b = 0x1000000 / b;
         for (j=0; j <= i; j++)
-            bp1[j] = ((bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12)) * (0x1000000 / b)) >> 12;
+            bp1[j] = ((bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12)) * b) >> 12;
 
         if ((unsigned) bp1[i] + 0x1000 > 0x1fff)
             return 1;