aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/g723_1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-13 15:18:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-13 15:18:47 +0200
commit603221ebd03348c2cabe9516c60bb6ef183a3880 (patch)
tree087b06f62512b5d2f65de3c96642c42f5ca1b259 /libavcodec/g723_1.c
parent20035fa24103da9199de3515ca75ba1f6bb275aa (diff)
downloadffmpeg-603221ebd03348c2cabe9516c60bb6ef183a3880.tar.gz
g723_1dec: inline normalize_bits() in scale vector and optimize it.
many branches and cases of scale_vector are irrelevant for the case here and by inlining they can be reliably removed. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/g723_1.c')
-rw-r--r--libavcodec/g723_1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index ae7379917e..72151b43d9 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -257,7 +257,8 @@ static int scale_vector(int16_t *dst, const int16_t *vector, int length)
for (i = 0; i < length; i++)
max |= FFABS(vector[i]);
- bits = normalize_bits(max, 15);
+ bits= 14 - av_log2_16bit(max);
+ bits= FFMAX(bits, 0);
for (i = 0; i < length; i++)
dst[i] = vector[i] << bits >> 3;