[FFmpeg-cvslog] avcodec/snowenc: use av_clip() instead of nested min & max

Clément Bœsch git at videolan.org
Sat Jun 6 13:18:36 CEST 2015


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sat Jun  6 12:56:57 2015 +0200| [533c37db8ddba7e698f79b7d2e5918f18a7b39e2] | committer: Clément Bœsch

avcodec/snowenc: use av_clip() instead of nested min & max

Note: AVCodecContext.refs is an int field.

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

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

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 88965e4..5c5cc66 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -81,7 +81,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
 
     ff_h263_encode_init(&s->m); //mv_penalty
 
-    s->max_ref_frames = FFMAX(FFMIN(avctx->refs, MAX_REF_FRAMES), 1);
+    s->max_ref_frames = av_clip(avctx->refs, 1, MAX_REF_FRAMES);
 
     if(avctx->flags&CODEC_FLAG_PASS1){
         if(!avctx->stats_out)



More information about the ffmpeg-cvslog mailing list