]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mpegvideo: use av_clip() instead of nested min & max
authorClément Bœsch <u@pkh.me>
Sat, 6 Jun 2015 10:55:20 +0000 (12:55 +0200)
committerClément Bœsch <u@pkh.me>
Sat, 6 Jun 2015 11:18:28 +0000 (13:18 +0200)
Note: MpegEncContext.mb_{y,height} are int fields, as well as local off
variable.

libavcodec/mpegvideo.c

index d4a84d43e38595b9d53028b3d968a516583a3b29..57d96200622ff110a9bae50e6abcf6dd4d9e681a 100644 (file)
@@ -2776,7 +2776,7 @@ int ff_mpv_lowest_referenced_row(MpegEncContext *s, int dir)
 
     off = ((FFMAX(-my_min, my_max)<<qpel_shift) + 63) >> 6;
 
-    return FFMIN(FFMAX(s->mb_y + off, 0), s->mb_height-1);
+    return av_clip(s->mb_y + off, 0, s->mb_height - 1);
 unhandled:
     return s->mb_height-1;
 }