diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2016-03-30 00:58:28 +0100 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2016-03-30 01:04:43 +0100 |
commit | c0918613a0ecaac6819409c64107583eebc0ccc2 (patch) | |
tree | c1d986354cda91822c1fb433e0dc52485747d316 /libavcodec | |
parent | bf1495d9a991dd13e382a4c1871d96708fdec4e7 (diff) | |
download | ffmpeg-c0918613a0ecaac6819409c64107583eebc0ccc2.tar.gz |
aacenc: use av_clip() instead of av_clip() during quantization
Seems like clang might be miscompiling it and causing a signed integer overflow,
making a FATE test fail.
Doesn't seem to affect performance, it only runs on the ESC codebook.
Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aacenc_quantization.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacenc_quantization.h b/libavcodec/aacenc_quantization.h index 425040748c..106e632d05 100644 --- a/libavcodec/aacenc_quantization.h +++ b/libavcodec/aacenc_quantization.h @@ -141,7 +141,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_uintp2(quant(fabsf(in[i+j]), Q, ROUNDING), 13); + int coef = av_clip(quant(fabsf(in[i+j]), Q, ROUNDING), 0, (1 << 13) - 1); int len = av_log2(coef); put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2); |