From 7cf22e5920908d9d2d0672852927bf64a35e1610 Mon Sep 17 00:00:00 2001 From: jeffqjiangNew <142832361+jeffqjiangNew@users.noreply.github.com> Date: Tue, 26 Mar 2024 18:53:42 -0400 Subject: [PATCH] * rocDecode/AVC: Fixed the decode failure of the conformance stream MR2_MW_A.264. (#297) - We should always clear the number of short term and long term references in DPB buffer structure when IDR occurs. --- src/parser/avc_parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/avc_parser.cpp b/src/parser/avc_parser.cpp index e1bf7cabaf..89ba3b7d7f 100644 --- a/src/parser/avc_parser.cpp +++ b/src/parser/avc_parser.cpp @@ -2113,17 +2113,17 @@ ParserResult AvcVideoParser::MarkDecodedRefPics() { if (FlushDpb() != PARSER_OK) { return PARSER_FAIL; } + dpb_buffer_.num_long_term = 0; + dpb_buffer_.num_short_term = 0; dpb_buffer_.dpb_fullness = 0; if (p_slice_header->dec_ref_pic_marking.long_term_reference_flag) { curr_pic_.is_reference = kUsedForLongTerm; curr_pic_.long_term_frame_idx = 0; - dpb_buffer_.num_long_term = 0; max_long_term_frame_idx_ = 0; } else { curr_pic_.is_reference = kUsedForShortTerm; max_long_term_frame_idx_ = NO_LONG_TERM_FRAME_INDICES; - dpb_buffer_.num_short_term = 0; } } else { curr_pic_.is_reference = kUsedForShortTerm; // 8.2.5.1: 3.