[FFmpeg-cvslog] avcodec/opusenc_psy: use av_clip_uintp2()

James Almer git at videolan.org
Sat Sep 23 19:24:36 EEST 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Sep 23 13:23:27 2017 -0300| [e4fd7b1fea7e2d3306f159d285ea420a1f250dcc] | committer: James Almer

avcodec/opusenc_psy: use av_clip_uintp2()

Fixes fate-source.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e4fd7b1fea7e2d3306f159d285ea420a1f250dcc
---

 libavcodec/opusenc_psy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/opusenc_psy.c b/libavcodec/opusenc_psy.c
index e6858f1856..bb673bef68 100644
--- a/libavcodec/opusenc_psy.c
+++ b/libavcodec/opusenc_psy.c
@@ -299,7 +299,7 @@ static void celt_gauge_psy_weight(OpusPsyContext *s, OpusPsyStep **start,
     }
 
     tonal /= 1333136.0f;
-    f_out->spread = av_clip(lrintf(tonal), 0, 3);
+    f_out->spread = av_clip_uintp2(lrintf(tonal), 2);
 
     rate = ((float)s->avctx->bit_rate) + frame_bits*frame_size*16;
     rate *= s->lambda;



More information about the ffmpeg-cvslog mailing list