git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0f6118c
)
avcodec/mpegvideo: use av_clip() instead of nested min & max
author
Clément Bœsch
<u@pkh.me>
Sat, 6 Jun 2015 10:55:20 +0000
(12:55 +0200)
committer
Clé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
patch
|
blob
|
history
diff --git
a/libavcodec/mpegvideo.c
b/libavcodec/mpegvideo.c
index
d4a84d4
..
57d9620
100644
(file)
--- a/
libavcodec/mpegvideo.c
+++ b/
libavcodec/mpegvideo.c
@@
-2776,7
+2776,7
@@
int ff_mpv_lowest_referenced_row(MpegEncContext *s, int dir)
off = ((FFMAX(-my_min, my_max)<<qpel_shift) + 63) >> 6;
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;
}
unhandled:
return s->mb_height-1;
}