diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2015-09-06 15:07:29 +0100 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2015-09-06 15:30:26 +0100 |
commit | b9b1fd118347746c87a2be372757a30dc1700a6b (patch) | |
tree | 3c241d2b1444c73c6191093b8620dd4e4bcc7590 /libavcodec/aaccoder.c | |
parent | 92aa3e7fb21a4b0764ac8a0348a5bf84badee216 (diff) | |
download | ffmpeg-b9b1fd118347746c87a2be372757a30dc1700a6b.tar.gz |
aaccoder: use roundf() instead of ceilf()
The specifications explicitly state to use roundf() which
also rounds half-integer values away from zero.
This does fix a few IS artifacts.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r-- | libavcodec/aaccoder.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c index 86d598f021..f265103173 100644 --- a/libavcodec/aaccoder.c +++ b/libavcodec/aaccoder.c @@ -332,11 +332,11 @@ static void set_special_band_scalefactors(AACEncContext *s, SingleChannelElement start = 0; for (g = 0; g < sce->ics.num_swb; g++) { if (sce->band_type[w*16+g] == INTENSITY_BT || sce->band_type[w*16+g] == INTENSITY_BT2) { - sce->sf_idx[w*16+g] = av_clip(ceilf(log2f(sce->is_ener[w*16+g])*2), -155, 100); + sce->sf_idx[w*16+g] = av_clip(roundf(log2f(sce->is_ener[w*16+g])*2), -155, 100); minscaler_i = FFMIN(minscaler_i, sce->sf_idx[w*16+g]); bands++; } else if (sce->band_type[w*16+g] == NOISE_BT) { - sce->sf_idx[w*16+g] = av_clip(4+log2f(sce->pns_ener[w*16+g])*2, -100, 155); + sce->sf_idx[w*16+g] = av_clip(roundf(log2f(sce->pns_ener[w*16+g])*2), -100, 155); minscaler_n = FFMIN(minscaler_n, sce->sf_idx[w*16+g]); bands++; } |