shithub: dav1d

Download patch

ref: 79c4aa95cd1f0fd849e130aa282c632d51fb70da
parent: acad1a99eaaeefacadbd1756c80365665bc7570a
author: James Almer <[email protected]>
date: Thu Sep 5 20:50:32 EDT 2019

obu: fix deriving render_width and render_height from reference frames

Both values can be independently coded in the bitstream, and are not
always equal to frame_width and frame_height.

--- a/src/obu.c
+++ b/src/obu.c
@@ -298,9 +298,10 @@
                 Dav1dThreadPicture *const ref =
                     &c->refs[c->frame_hdr->refidx[i]].p;
                 if (!ref->p.data[0]) return -1;
-                // FIXME render_* may be wrong
-                hdr->render_width = hdr->width[1] = ref->p.p.w;
-                hdr->render_height = hdr->height = ref->p.p.h;
+                hdr->width[1] = ref->p.p.w;
+                hdr->height = ref->p.p.h;
+                hdr->render_width = ref->p.frame_hdr->render_width;
+                hdr->render_height = ref->p.frame_hdr->render_height;
                 hdr->super_res.enabled = seqhdr->super_res && dav1d_get_bits(gb, 1);
                 if (hdr->super_res.enabled) {
                     const int d = hdr->super_res.width_scale_denominator =