aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-05-17 16:23:41 -0300
committerJames Almer <jamrial@gmail.com>2024-05-18 11:35:27 -0300
commita48203d51aa4836150f9379448f6b2a1d5ca9d36 (patch)
tree96a33dba610649209932496c064b5b906ae6e64f /libavformat
parentf121d52b3535278fe1bd406c4dc4797b11b96ddf (diff)
downloadffmpeg-a48203d51aa4836150f9379448f6b2a1d5ca9d36.tar.gz
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/vvc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index 09a4aa52e8..b147f44683 100644
--- a/libavformat/vvc.c
+++ b/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
}
}