* rocDecode/HEVC: Added in stream DPB buffer size change detection and handling. (#482)
[ROCm/rocdecode commit: 5336913a09]
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
af9338cb65
Коммит
6bcc0a4067
@@ -1530,9 +1530,6 @@ ParserResult HevcVideoParser::ParseSliceHeader(uint8_t *nalu, size_t size, HevcS
|
||||
if (m_active_sps_id_ != pps_ptr->pps_seq_parameter_set_id) {
|
||||
m_active_sps_id_ = pps_ptr->pps_seq_parameter_set_id;
|
||||
sps_ptr = &sps_list_[m_active_sps_id_];
|
||||
// Re-set DPB size.
|
||||
dpb_buffer_.dpb_size = sps_ptr->sps_max_dec_pic_buffering_minus1[sps_ptr->sps_max_sub_layers_minus1] + 1;
|
||||
dpb_buffer_.dpb_size = dpb_buffer_.dpb_size > HEVC_MAX_DPB_FRAMES ? HEVC_MAX_DPB_FRAMES : dpb_buffer_.dpb_size;
|
||||
new_seq_activated_ = true; // Note: clear this flag after the actions are taken.
|
||||
}
|
||||
sps_ptr = &sps_list_[m_active_sps_id_];
|
||||
@@ -1551,14 +1548,13 @@ ParserResult HevcVideoParser::ParseSliceHeader(uint8_t *nalu, size_t size, HevcS
|
||||
pic_width_ = sps_ptr->pic_width_in_luma_samples;
|
||||
pic_height_ = sps_ptr->pic_height_in_luma_samples;
|
||||
// Take care of the case where a new SPS replaces the old SPS with the same id but with different dimensions
|
||||
// Re-set DPB size.
|
||||
dpb_buffer_.dpb_size = sps_ptr->sps_max_dec_pic_buffering_minus1[sps_ptr->sps_max_sub_layers_minus1] + 1;
|
||||
dpb_buffer_.dpb_size = dpb_buffer_.dpb_size > HEVC_MAX_DPB_FRAMES ? HEVC_MAX_DPB_FRAMES : dpb_buffer_.dpb_size;
|
||||
new_seq_activated_ = true; // Note: clear this flag after the actions are taken.
|
||||
}
|
||||
|
||||
// Check and adjust decode buffer pool size if needed
|
||||
if (new_seq_activated_) {
|
||||
// Check DPB buffer size change
|
||||
uint32_t max_dec_pic_buffering = sps_ptr->sps_max_dec_pic_buffering_minus1[sps_ptr->sps_max_sub_layers_minus1] + 1;
|
||||
if (dpb_buffer_.dpb_size != max_dec_pic_buffering) {
|
||||
dpb_buffer_.dpb_size = max_dec_pic_buffering;
|
||||
dpb_buffer_.dpb_size = dpb_buffer_.dpb_size > HEVC_MAX_DPB_FRAMES ? HEVC_MAX_DPB_FRAMES : dpb_buffer_.dpb_size;
|
||||
CheckAndAdjustDecBufPoolSize(dpb_buffer_.dpb_size);
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ void RocVideoParser::CheckAndAdjustDecBufPoolSize(int dpb_size) {
|
||||
dec_buf_pool_size_ = min_dec_buf_pool_size;
|
||||
decode_buffer_pool_.resize(dec_buf_pool_size_, {0});
|
||||
output_pic_list_.resize(dec_buf_pool_size_, 0xFF);
|
||||
InitDecBufPool();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user