From 14e53a7ca2c599fc7bc5aed4f7ae8225dfef50d3 Mon Sep 17 00:00:00 2001 From: ChristianFeldmann Date: Sun, 6 Oct 2024 21:11:22 +0200 Subject: [PATCH] Add missing default value for sh_collocated_from_l0_flag --- YUViewLib/src/parser/VVC/slice_header.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/YUViewLib/src/parser/VVC/slice_header.cpp b/YUViewLib/src/parser/VVC/slice_header.cpp index 69b52c3d4..762dfe211 100644 --- a/YUViewLib/src/parser/VVC/slice_header.cpp +++ b/YUViewLib/src/parser/VVC/slice_header.cpp @@ -32,9 +32,9 @@ #include "slice_header.h" -#include #include "pic_parameter_set_rbsp.h" #include "seq_parameter_set_rbsp.h" +#include #include @@ -43,11 +43,11 @@ namespace parser::vvc using namespace parser::reader; -void slice_header::parse(SubByteReaderLogging & reader, +void slice_header::parse(SubByteReaderLogging &reader, NalType nal_unit_type, - VPSMap & vpsMap, - SPSMap & spsMap, - PPSMap & ppsMap, + VPSMap &vpsMap, + SPSMap &spsMap, + PPSMap &ppsMap, std::shared_ptr sliceLayer, std::shared_ptr picHeader) { @@ -205,7 +205,8 @@ void slice_header::parse(SubByteReaderLogging & reader, { if (this->ref_pic_lists_instance->getActiveRefPixList(sps, i).num_ref_entries > 1) { - this->sh_num_ref_idx_active_minus1[i] = reader.readUEV(formatArray("sh_num_ref_idx_active_minus1", i)); + this->sh_num_ref_idx_active_minus1[i] = + reader.readUEV(formatArray("sh_num_ref_idx_active_minus1", i)); } } } @@ -242,9 +243,10 @@ void slice_header::parse(SubByteReaderLogging & reader, if (picHeader->ph_temporal_mvp_enabled_flag && !pps->pps_rpl_info_in_ph_flag) { if (this->sh_slice_type == SliceType::B) - { this->sh_collocated_from_l0_flag = reader.readFlag("sh_collocated_from_l0_flag"); - } + else + this->sh_collocated_from_l0_flag = + (this->sh_slice_type == SliceType::B) ? picHeader->ph_collocated_from_l0_flag : true; if ((this->sh_collocated_from_l0_flag && this->NumRefIdxActive[0] > 1) || (!this->sh_collocated_from_l0_flag && this->NumRefIdxActive[1] > 1)) {