summaryrefslogtreecommitdiff
path: root/libavcodec/aaccoder.c
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2015-02-20 01:35:35 +0100
committerLuca Barbato <lu_zero@gentoo.org>2015-02-21 00:54:40 +0100
commit9abc80f1ed673141326341e26a05c3e1f78576d0 (patch)
treeca91fca7b76eec0d98a2b420f0220ec0df13a239 /libavcodec/aaccoder.c
parent76ce9bd8e26dcb3652240a1072840ff4011d7cdc (diff)
libavcodec: Make use of av_clip functions
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r--libavcodec/aaccoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index 35b98a9ae2..ee89148ef4 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -161,7 +161,7 @@ static av_always_inline float quantize_and_encode_band_cost_template(
di = t - CLIPPED_ESCAPE;
curbits += 21;
} else {
- int c = av_clip(quant(t, Q), 0, 8191);
+ int c = av_clip_uintp2(quant(t, Q), 13);
di = t - c*cbrtf(c)*IQ;
curbits += av_log2(c)*2 - 4 + 1;
}
@@ -191,7 +191,7 @@ static av_always_inline float quantize_and_encode_band_cost_template(
if (BT_ESC) {
for (j = 0; j < 2; j++) {
if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) {
- int coef = av_clip(quant(fabsf(in[i+j]), Q), 0, 8191);
+ int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q), 13);
int len = av_log2(coef);
put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);