1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-10 09:31:06 +02:00

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>
This commit is contained in:
Michael Niedermayer 2012-08-13 15:18:47 +02:00
parent 20035fa241
commit 603221ebd0

View File

@ -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;