1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

g723_1: make scale_vector() behave like the reference

This commit is contained in:
Kostya Shishkov 2012-08-02 07:50:49 +02:00
parent 8772d2511a
commit 8ddadea171

View File

@ -282,7 +282,8 @@ static int normalize_bits(int num, int width)
*/ */
static int scale_vector(int16_t *vector, int length) static int scale_vector(int16_t *vector, int length)
{ {
int bits, scale, max = 0; int bits, max = 0;
int64_t scale;
int i; int i;
@ -293,7 +294,7 @@ static int scale_vector(int16_t *vector, int length)
scale = (bits == 15) ? 0x7FFF : (1 << bits); scale = (bits == 15) ? 0x7FFF : (1 << bits);
for (i = 0; i < length; i++) for (i = 0; i < length; i++)
vector[i] = (vector[i] * scale) >> 4; vector[i] = av_clipl_int32(vector[i] * scale << 1) >> 4;
return bits - 3; return bits - 3;
} }