aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-11-09 10:52:49 -0500
committerClément Bœsch <u@pkh.me>2013-11-09 21:31:06 +0100
commitdd3d0f46bdb0b9bd204159c67f522cd6f3db7e7c (patch)
treee1c04134a64f75517696c189e95cd64043de3670 /libavcodec
parentf5bffd3a1a1aea5d478161b86ce2029179282d6c (diff)
downloadffmpeg-dd3d0f46bdb0b9bd204159c67f522cd6f3db7e7c.tar.gz
vp9: fix mvref finding to adhere to bug in libvpx.
Fixes a particular youtube video that I unfortunately can't share.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp9.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 3539a548ef..d26f122b81 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -984,7 +984,10 @@ 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]);
}
}
@@ -997,7 +1000,10 @@ 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]);
}
}