[FFmpeg-cvslog] hevc/mvs: simplify derive_temporal_colocated_mvs

Mickaël Raulet git at videolan.org
Tue Jul 22 14:16:57 CEST 2014


ffmpeg | branch: master | Mickaël Raulet <mraulet at insa-rennes.fr> | Sat Jul 19 00:51:42 2014 +0200| [560b0253ff2b1a040a2e688bf5c81265a61c1c2d] | committer: Michael Niedermayer

hevc/mvs: simplify derive_temporal_colocated_mvs

cherry picked from commit def7db60966765f4687250d766b40dbcf0f7e503

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/hevc_mvs.c |   27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/libavcodec/hevc_mvs.c b/libavcodec/hevc_mvs.c
index b1a1ffc..1cdc0bd 100644
--- a/libavcodec/hevc_mvs.c
+++ b/libavcodec/hevc_mvs.c
@@ -209,20 +209,21 @@ static int derive_temporal_colocated_mvs(HEVCContext *s, MvField temp_col,
         return CHECK_MVSET(0);
     else if (temp_col.pred_flag == PF_BI) {
         int check_diffpicount = 0;
-        int i = 0;
-        for (i = 0; i < refPicList[0].nb_refs; i++) {
-            if (refPicList[0].list[i] > s->poc)
-                check_diffpicount++;
-        }
-        for (i = 0; i < refPicList[1].nb_refs; i++) {
-            if (refPicList[1].list[i] > s->poc)
-                check_diffpicount++;
+        int i, j;
+        for (j = 0; j < 2; j++) {
+            for (i = 0; i < refPicList[j].nb_refs; i++) {
+                if (refPicList[j].list[i] > s->poc) {
+                    check_diffpicount++;
+                    break;
+                }
+            }
         }
-        if (check_diffpicount == 0 && X == 0)
-            return CHECK_MVSET(0);
-        else if (check_diffpicount == 0 && X == 1)
-            return CHECK_MVSET(1);
-        else {
+        if (!check_diffpicount) {
+            if (X==0)
+                return CHECK_MVSET(0);
+            else
+                return CHECK_MVSET(1);
+        } else {
             if (s->sh.collocated_list == L1)
                 return CHECK_MVSET(0);
             else



More information about the ffmpeg-cvslog mailing list