rocDecode: Added error handling of missing headers in cases where they are not parsed but referred in the frame decode process. One example is when frame seek is performed and the target picture is not a random access point. (#335)

* * rocDecode: Added error handling of missing headers in cases where they are not parsed but referred in the frame decode process. One example is when frame seek is performed and the target picture is not a random access point.

* * rocDecode/HEVC: Added some missing error handlings.

---------

Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
Этот коммит содержится в:
jeffqjiangNew
2024-05-03 15:18:08 -04:00
коммит произвёл GitHub
родитель e2b9e7197a
Коммит ba36534f1f
4 изменённых файлов: 43 добавлений и 14 удалений
+8
Просмотреть файл
@@ -1180,9 +1180,17 @@ ParserResult AvcVideoParser::ParseSliceHeader(uint8_t *p_stream, size_t stream_s
// Set active SPS and PPS for the current slice
active_pps_id_ = p_slice_header->pic_parameter_set_id;
p_pps = &pps_list_[active_pps_id_];
if (p_pps->is_received == 0) {
ERR("Empty PPS is referred.");
return PARSER_WRONG_STATE;
}
if (active_sps_id_ != p_pps->seq_parameter_set_id) {
active_sps_id_ = p_pps->seq_parameter_set_id;
p_sps = &sps_list_[active_sps_id_];
if ( p_sps->is_received == 0) {
ERR("Empty SPS is referred.");
return PARSER_WRONG_STATE;
}
// Re-set DPB size.
dpb_buffer_.dpb_size = p_sps->max_num_ref_frames + 3;
dpb_buffer_.dpb_size = dpb_buffer_.dpb_size > AVC_MAX_DPB_FRAMES ? AVC_MAX_DPB_FRAMES : dpb_buffer_.dpb_size;