From d4a2b75da69da1891682fa40ec9e1ca99d3cf950 Mon Sep 17 00:00:00 2001 From: David Conrad Date: Tue, 7 Jun 2022 15:18:04 -0700 Subject: Fix checking the reference dimesions for the projection process Section 7.9.2 returns 0 "If RefMiRows[ srcIdx ] is not equal to MiRows, RefMiCols[ srcIdx ] is not equal to MiCols" dav1d was comparing pixel width/height, not block width/height, so conform with the spec --- src/decode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/decode.c b/src/decode.c index 35937e8..90cb0e4 100644 --- a/src/decode.c +++ b/src/decode.c @@ -3743,9 +3743,10 @@ int dav1d_submit_frame(Dav1dContext *const c) { if (f->frame_hdr->use_ref_frame_mvs) { for (int i = 0; i < 7; i++) { const int refidx = f->frame_hdr->refidx[i]; + const int ref_w = ((ref_coded_width[i] + 7) >> 3) << 1; + const int ref_h = ((f->refp[i].p.p.h + 7) >> 3) << 1; if (c->refs[refidx].refmvs != NULL && - ref_coded_width[i] == f->cur.p.w && - f->refp[i].p.p.h == f->cur.p.h) + ref_w == f->bw && ref_h == f->bh) { f->ref_mvs_ref[i] = c->refs[refidx].refmvs; dav1d_ref_inc(f->ref_mvs_ref[i]); -- cgit v1.2.3