[FFmpeg-cvslog] g723.1: deobfuscate an expression

Mans Rullgard git at videolan.org
Fri Aug 10 16:31:45 CEST 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Fri Aug 10 00:13:46 2012 +0100| [e141cf2c5794cd9884f2806b7766a1e0bb47ebe5] | committer: Mans Rullgard

g723.1: deobfuscate an expression

(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 at mansr.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e141cf2c5794cd9884f2806b7766a1e0bb47ebe5
---

 libavcodec/g723_1.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index bf753ab..c337deb 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -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 */



More information about the ffmpeg-cvslog mailing list