diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-05-16 11:03:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-02 19:41:48 +0100 |
commit | 3d7b7e533138ff435bad20615870d31687388834 (patch) | |
tree | ea079fa82ddc2ba39c1e6fafdf5f8feb019db9b9 | |
parent | d418ca3786b18f9a1b3c0879fd8572e1bb01e3ec (diff) | |
download | ffmpeg-3d7b7e533138ff435bad20615870d31687388834.tar.gz |
avcodec/aacdec_fixed: ssign seems always -1 in noise_scale(), simplify
(cherry picked from commit 3d5863d73915748013975cac8d2148c5fc3d01c3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/aacdec_fixed.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 3ba4cc0016..ebd0f60da7 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -194,12 +194,12 @@ static void subband_scale(int *dst, int *src, int scale, int offset, int len) static void noise_scale(int *coefs, int scale, int band_energy, int len) { - int ssign = scale < 0 ? -1 : 1; - int s = FFABS(scale); + int s = -scale; unsigned int round; int i, out, c = exp2tab[s & 3]; int nlz = 0; + av_assert0(s >= 0); while (band_energy > 0x7fff) { band_energy >>= 1; nlz++; @@ -215,7 +215,7 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len) round = s ? 1 << (s-1) : 0; for (i=0; i<len; i++) { out = (int)(((int64_t)coefs[i] * c) >> 32); - coefs[i] = ((int)(out+round) >> s) * ssign; + coefs[i] = -((int)(out+round) >> s); } } else { @@ -223,7 +223,7 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len) round = s ? 1 << (s-1) : 0; for (i=0; i<len; i++) { out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s); - coefs[i] = out * ssign; + coefs[i] = -out; } } } |