]> git.sesse.net Git - ffmpeg/commitdiff
g723.1: deobfuscate an expression
authorMans Rullgard <mans@mansr.com>
Thu, 9 Aug 2012 23:13:46 +0000 (00:13 +0100)
committerMans Rullgard <mans@mansr.com>
Fri, 10 Aug 2012 11:18:38 +0000 (12:18 +0100)
(x << 2) - x is just an optimisation of 3 * x the compiler is
perfectly capable of doing on its own.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/g723_1.c

index bf753ab18234e5b22cd34dd2a83dd766b7fd3923..c337deb8818b99fd8373aedc491c50cd13a8fe2b 100644 (file)
@@ -974,8 +974,7 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
         if (temp) {
             temp = (auto_corr[0] >> 2) / temp;
         }
-        p->reflection_coef = ((p->reflection_coef << 2) - p->reflection_coef +
-                              temp + 2) >> 2;
+        p->reflection_coef = (3 * p->reflection_coef + temp + 2) >> 2;
         temp = (p->reflection_coef * 0xffffc >> 3) & 0xfffc;
 
         /* Compensation filter */