shithub: dav1d

Download patch

ref: 81b10e8c9bda866ec5f3520e788932b75d019af5
parent: 70dc7bd5a4a33ce88e3aee291177b3c70476cf2a
author: James Almer <jamrial@gmail.com>
date: Fri Nov 23 17:26:08 EST 2018

obu: fix temporal/spatial layer checks when decoder model is enabled

--- a/src/obu.c
+++ b/src/obu.c
@@ -411,9 +411,9 @@
                 const struct Av1SequenceHeaderOperatingPoint *const seqop = &seqhdr->operating_points[i];
                 struct Av1FrameHeaderOperatingPoint *const op = &hdr->operating_points[i];
                 if (seqop->decoder_model_param_present) {
-                    int in_temporal_layer = (seqop->idc >>  0 /* FIXME: temporal_id */ ) & 1;
-                    int in_spatial_layer  = (seqop->idc >> (0 /* FIXME: spatial_id */ + 8)) & 1;
-                    if (!seqop->idc || in_temporal_layer || in_spatial_layer)
+                    int in_temporal_layer = (seqop->idc >> hdr->temporal_id) & 1;
+                    int in_spatial_layer  = (seqop->idc >> (hdr->spatial_id + 8)) & 1;
+                    if (!seqop->idc || (in_temporal_layer && in_spatial_layer))
                         op->buffer_removal_time = dav1d_get_bits(gb, seqhdr->buffer_removal_delay_length);
                 }
             }