[FFmpeg-cvslog] g723.1: simplify scale_vector()

Mans Rullgard git at videolan.org
Tue Aug 14 15:39:45 CEST 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Mon Aug 13 23:50:10 2012 +0100| [0d230e9312a676266bd6fa3478032db4860221a7] | committer: Mans Rullgard

g723.1: simplify scale_vector()

It is impossible for bits to be 15 here so the special case is
not needed.

Signed-off-by: Mans Rullgard <mans at mansr.com>

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

 libavcodec/g723_1.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index fd03ed9..793b2d3 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -283,12 +283,8 @@ static int scale_vector(int16_t *dst, const int16_t *vector, int length)
     max   = FFMIN(max, 0x7FFF);
     bits  = normalize_bits(max, 15);
 
-    if (bits == 15)
-        for (i = 0; i < length; i++)
-            dst[i] = vector[i] * 0x7fff >> 3;
-    else
-        for (i = 0; i < length; i++)
-            dst[i] = vector[i] << bits >> 3;
+    for (i = 0; i < length; i++)
+        dst[i] = vector[i] << bits >> 3;
 
     return bits - 3;
 }



More information about the ffmpeg-cvslog mailing list