[FFmpeg-cvslog] vp9: fix mvref finding to adhere to bug in libvpx.

Ronald S. Bultje git at videolan.org
Fri Jan 24 12:38:02 CET 2014


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Sun Jan 19 19:04:58 2014 +0100| [bd01412313c728400f1fc5448ede0ad8b51da0d1] | committer: Anton Khirnov

vp9: fix mvref finding to adhere to bug in libvpx.

Fixes a particular youtube video that I unfortunately can't share.

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavcodec/vp9mvs.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vp9mvs.c b/libavcodec/vp9mvs.c
index 2f37755..1f65aaa 100644
--- a/libavcodec/vp9mvs.c
+++ b/libavcodec/vp9mvs.c
@@ -191,9 +191,13 @@ static void find_ref_mvs(VP9Context *s,
             if (mv->ref[0] != ref && mv->ref[0] >= 0)
                 RETURN_SCALE_MV(mv->mv[0],
                                 s->signbias[mv->ref[0]] != s->signbias[ref]);
-            if (mv->ref[1] != ref && mv->ref[1] >= 0)
+            if (mv->ref[1] != ref && mv->ref[1] >= 0 &&
+                // BUG - libvpx has this condition regardless of whether
+                // we used the first ref MV and pre-scaling
+                AV_RN32A(&mv->mv[0]) != AV_RN32A(&mv->mv[1])) {
                 RETURN_SCALE_MV(mv->mv[1],
                                 s->signbias[mv->ref[1]] != s->signbias[ref]);
+            }
         }
     }
 
@@ -204,9 +208,13 @@ static void find_ref_mvs(VP9Context *s,
         if (mv->ref[0] != ref && mv->ref[0] >= 0)
             RETURN_SCALE_MV(mv->mv[0],
                             s->signbias[mv->ref[0]] != s->signbias[ref]);
-        if (mv->ref[1] != ref && mv->ref[1] >= 0)
+        if (mv->ref[1] != ref && mv->ref[1] >= 0 &&
+            // BUG - libvpx has this condition regardless of whether
+            // we used the first ref MV and pre-scaling
+            AV_RN32A(&mv->mv[0]) != AV_RN32A(&mv->mv[1])) {
             RETURN_SCALE_MV(mv->mv[1],
                             s->signbias[mv->ref[1]] != s->signbias[ref]);
+        }
     }
 
     AV_ZERO32(pmv);



More information about the ffmpeg-cvslog mailing list