avformat/vvc: fix parsing some early VPS bitstream values

vps_default_ptl_dpb_hrd_max_tid_flag needs to always be set, and
vps_direct_ref_layer_flag needs to be read even when
vps_max_tid_ref_present_flag is false.

Signed-off-by: James Almer <jamrial@gmail.com>
release/7.1
James Almer 6 months ago
parent f121d52b35
commit a48203d51a
  1. 7
      libavformat/vvc.c

@ -252,6 +252,8 @@ static int vvcc_parse_vps(GetBitContext *gb,
if (vps_max_layers_minus1 > 0 && vps_max_sublayers_minus1 > 0)
vps_default_ptl_dpb_hrd_max_tid_flag = get_bits1(gb);
else
vps_default_ptl_dpb_hrd_max_tid_flag = 0;
if (vps_max_layers_minus1 > 0)
vps_all_independent_layers_flag = get_bits1(gb);
else
@ -260,10 +262,11 @@ static int vvcc_parse_vps(GetBitContext *gb,
for (int i = 0; i <= vps_max_layers_minus1; i++) {
skip_bits(gb, 6); //vps_layer_id[i]
if (i > 0 && !vps_all_independent_layers_flag) {
if (get_bits1(gb)) { // vps_independent_layer_flag[i]
if (!get_bits1(gb)) { // vps_independent_layer_flag[i]
unsigned int vps_max_tid_ref_present_flag = get_bits1(gb);
for (int j = 0; j < i; j++) {
if (vps_max_tid_ref_present_flag && get_bits1(gb)) // vps_direct_ref_layer_flag[i][j]
unsigned int vps_direct_ref_layer_flag = get_bits1(gb);
if (vps_max_tid_ref_present_flag && vps_direct_ref_layer_flag)
skip_bits(gb, 3); // vps_max_tid_il_ref_pics_plus1
}
}

Loading…
Cancel
Save