---
 libavcodec/rv60dec.c | 54 ++++++++++++++------------------------------
 1 file changed, 17 insertions(+), 37 deletions(-)

diff --git a/libavcodec/rv60dec.c b/libavcodec/rv60dec.c
index 19cd0f2861..a54980f131 100644
--- a/libavcodec/rv60dec.c
+++ b/libavcodec/rv60dec.c
@@ -862,50 +862,30 @@ static int get_skip_mv_index(enum MVRefEnum mvref)
     }
 }
 
-static int mvinfo_valid(const MVInfo * mvi)
+static void add_if_valid(unique_list_mvinfo * skip_cand, const MVInfo * mvi)
 {
-    return mvi->mvref != MVREF_NONE;
+    if (mvi->mvref != MVREF_NONE)
+        unique_list_mvinfo_add(skip_cand, *mvi);
 }
 
 static void fill_mv_skip_cand(RV60Context * s, const CUContext * cu, 
unique_list_mvinfo * skip_cand, int size)
 {
     int mv_size = size >> 2;
 
-    if (cu->xpos > 0) {
-        const MVInfo * mv = &s->blk_info[cu->blk_pos - 1].mv;
-        if (mvinfo_valid(mv))
-            unique_list_mvinfo_add(skip_cand, *mv);
-    }
-    if (cu->ypos > 0) {
-        const MVInfo * mv = &s->blk_info[cu->blk_pos - s->blk_stride].mv;
-        if (mvinfo_valid(mv))
-            unique_list_mvinfo_add(skip_cand, *mv);
-    }
-    if (cu->ypos > 0 && cu->xpos + size < s->awidth) {
-        const MVInfo * mv = &s->blk_info[cu->blk_pos - s->blk_stride + 
mv_size].mv;
-        if (mvinfo_valid(mv))
-            unique_list_mvinfo_add(skip_cand, *mv);
-    }
-    if (cu->xpos > 0 && cu->ypos + size < s->aheight) {
-        const MVInfo * mv = &s->blk_info[cu->blk_pos + s->blk_stride * mv_size 
- 1].mv;
-        if (mvinfo_valid(mv))
-            unique_list_mvinfo_add(skip_cand, *mv);
-    }
-    if (has_left_block(s, cu->xpos, cu->ypos, 0, 0, size)) {
-        const MVInfo * mv = &s->blk_info[cu->blk_pos + s->blk_stride * 
(mv_size - 1) - 1].mv;
-        if (mvinfo_valid(mv))
-            unique_list_mvinfo_add(skip_cand, *mv);
-    }
-    if (has_top_block(s, cu->xpos, cu->ypos, 0, 0, size)) {
-        const MVInfo * mv = &s->blk_info[cu->blk_pos - s->blk_stride + mv_size 
- 1].mv;
-        if (mvinfo_valid(mv))
-            unique_list_mvinfo_add(skip_cand, *mv);
-    }
-    if (cu->xpos > 0 && cu->ypos > 0) {
-        const MVInfo * mv = &s->blk_info[cu->blk_pos - s->blk_stride - 1].mv;
-        if (mvinfo_valid(mv))
-            unique_list_mvinfo_add(skip_cand, *mv);
-    }
+    if (cu->xpos)
+        add_if_valid(skip_cand, &s->blk_info[cu->blk_pos - 1].mv);
+    if (cu->ypos)
+        add_if_valid(skip_cand, &s->blk_info[cu->blk_pos - s->blk_stride].mv);
+    if (cu->ypos && cu->xpos + size < s->awidth)
+        add_if_valid(skip_cand, &s->blk_info[cu->blk_pos - s->blk_stride + 
mv_size].mv);
+    if (cu->xpos && cu->ypos + size < s->aheight)
+        add_if_valid(skip_cand, &s->blk_info[cu->blk_pos + s->blk_stride * 
mv_size - 1].mv);
+    if (cu->xpos)
+        add_if_valid(skip_cand, &s->blk_info[cu->blk_pos + s->blk_stride * 
(mv_size - 1) - 1].mv);
+    if (cu->ypos)
+        add_if_valid(skip_cand, &s->blk_info[cu->blk_pos - s->blk_stride + 
mv_size - 1].mv);
+    if (cu->xpos && cu->ypos)
+        add_if_valid(skip_cand, &s->blk_info[cu->blk_pos - s->blk_stride - 
1].mv);
 
     for (int i = skip_cand->size; i < 4; i++)
         skip_cand->list[i] = 
(MVInfo){.mvref=MVREF_REF0,.f_mv={0,0},.b_mv={0,0}};
-- 
2.45.2

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to