aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-06-16 16:55:33 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-07-01 13:02:11 -0400
commit8b7b2d6aaee8cef0051beb3a4cf3e1c5a87cf40f (patch)
treec0d0baec39a96c4ee2ec165a706fdb795f355695
parent523b7eba19590652b7ba19c5bdd85dd257bfe4f7 (diff)
downloadffmpeg-8b7b2d6aaee8cef0051beb3a4cf3e1c5a87cf40f.tar.gz
ac3dsp: simplify extract_exponents() now that it does not need to do clipping.
-rw-r--r--libavcodec/ac3dsp.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c
index 8ce5f8d2c5..98c73573cb 100644
--- a/libavcodec/ac3dsp.c
+++ b/libavcodec/ac3dsp.c
@@ -164,21 +164,8 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs)
int i;
for (i = 0; i < nb_coefs; i++) {
- int e;
int v = abs(coef[i]);
- if (v == 0)
- e = 24;
- else {
- e = 23 - av_log2(v);
- if (e >= 24) {
- e = 24;
- coef[i] = 0;
- } else if (e < 0) {
- e = 0;
- coef[i] = av_clip(coef[i], -16777215, 16777215);
- }
- }
- exp[i] = e;
+ exp[i] = v ? 23 - av_log2(v) : 24;
}
}