diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-20 14:03:21 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-26 16:25:06 -0500 |
commit | 954d94dd5e13ba7a5e9e049d0f980bddced9644c (patch) | |
tree | 87451e73dada8b00012e03e27c0e5c1aa6f8a53d /libavcodec/adxenc.c | |
parent | c52ddc60241229af198ac03c8d86d219e7d5942a (diff) | |
download | ffmpeg-954d94dd5e13ba7a5e9e049d0f980bddced9644c.tar.gz |
adx: use 12-bit coefficients instead of 14-bit to avoid integer overflow
Diffstat (limited to 'libavcodec/adxenc.c')
-rw-r--r-- | libavcodec/adxenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c index fde0b8239e..7225c3159d 100644 --- a/libavcodec/adxenc.c +++ b/libavcodec/adxenc.c @@ -48,7 +48,7 @@ static void adx_encode(unsigned char *adx,const short *wav, s2 = prev->s2; for(i=0;i<32;i++) { s0 = wav[i]; - d = ((s0<<14) - SCALE1*s1 + SCALE2*s2)/BASEVOL; + d = ((s0 << COEFF_BITS) - COEFF1 * s1 + COEFF2 * s2) >> COEFF_BITS; data[i]=d; if (max<d) max=d; if (min>d) min=d; |