shithub: dav1d

Download patch

ref: 8fbd87e5041a340a30c20428f4caa540cb931550
parent: 8fac3029f1d1268ecbf6d047813c9f8c608e7982
author: James Almer <jamrial@gmail.com>
date: Mon Oct 29 16:44:19 EDT 2018

obu: fix parsing film_grain_present and num_operating_points in Sequence Headers

Fixes a regression since d8996b181d2013abd01a2e9f5dceae5e09b3afda, where
the relevant fields started being written to and read from the wrong struct.

--- a/src/obu.c
+++ b/src/obu.c
@@ -102,7 +102,7 @@
 
         hdr->display_model_info_present = dav1d_get_bits(gb, 1);
         hdr->num_operating_points = dav1d_get_bits(gb, 5) + 1;
-        for (int i = 0; i < c->seq_hdr.num_operating_points; i++) {
+        for (int i = 0; i < hdr->num_operating_points; i++) {
             struct Av1SequenceHeaderOperatingPoint *const op =
                 &hdr->operating_points[i];
             op->idc = dav1d_get_bits(gb, 12);
@@ -246,7 +246,7 @@
            (gb->ptr - init_ptr) * 8 - gb->bits_left);
 #endif
 
-    c->seq_hdr.film_grain_present = dav1d_get_bits(gb, 1);
+    hdr->film_grain_present = dav1d_get_bits(gb, 1);
 #if DEBUG_SEQ_HDR
     printf("SEQHDR: post-filmgrain: off=%ld\n",
            (gb->ptr - init_ptr) * 8 - gb->bits_left);