codecparsers: h264: Fix default ref list size

The default in PPS was not applied properly. The default does not apply for
I-Slice and l1 default only applies for B-Slice.  This fixes the slice values
for num_ref_idx_l0_active_minus1 and num_ref_idx_l1_active_minus1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1238>
This commit is contained in:
Nicolas Dufresne 2020-05-13 15:32:44 -04:00 committed by Nicolas Dufresne
parent 28e30c8493
commit d062677b3f

View file

@ -2253,8 +2253,17 @@ gst_h264_parser_parse_slice_hdr (GstH264NalParser * nalparser,
/* set default values for fields that might not be present in the bitstream
and have valid defaults */
slice->num_ref_idx_l0_active_minus1 = pps->num_ref_idx_l0_active_minus1;
slice->num_ref_idx_l1_active_minus1 = pps->num_ref_idx_l1_active_minus1;
if (GST_H264_IS_I_SLICE (slice)) {
slice->num_ref_idx_l0_active_minus1 = 0;
slice->num_ref_idx_l1_active_minus1 = 0;
} else {
slice->num_ref_idx_l0_active_minus1 = pps->num_ref_idx_l0_active_minus1;
if (GST_H264_IS_B_SLICE (slice))
slice->num_ref_idx_l1_active_minus1 = pps->num_ref_idx_l1_active_minus1;
else
slice->num_ref_idx_l1_active_minus1 = 0;
}
if (sps->separate_colour_plane_flag)
READ_UINT8 (&nr, slice->colour_plane_id, 2);