Commit 603221eb authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 20035fa2
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment