summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 ae73799..72151b4 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;
OpenPOWER on IntegriCloud