[FFmpeg-devel] [PATCH] h264/get_lowest_part_list_y: remove unneeded operations

Michael Niedermayer michaelni at gmx.at
Wed Jan 16 01:38:27 CET 2013


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/h264.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index d5f4760..883d594 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -309,13 +309,13 @@ static inline int get_lowest_part_list_y(H264Context *h, Picture *pic, int n,
                                          int height, int y_offset, int list)
 {
     int raw_my        = h->mv_cache[list][scan8[n]][1];
-    int filter_height_up   = (raw_my & 3) ? 2 : 0;
     int filter_height_down = (raw_my & 3) ? 3 : 0;
     int full_my       = (raw_my >> 2) + y_offset;
-    int top           = full_my - filter_height_up;
     int bottom        = full_my + filter_height_down + height;
 
-    return FFMAX(abs(top), bottom);
+    av_assert2(height >= 0);
+
+    return FFMAX(0, bottom);
 }
 
 static inline void get_lowest_part_y(H264Context *h, int refs[2][48], int n,
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list