HEVC: Added bit depth change support in decoder reconfiguration. (#527)

* * rocDecode/HEVC: Added bit depth change support in decoder reconfiguration.

* * rocDecode/HEVC: Removed a comment line.

* * rocDecode/HEVC: Updated change log.

* * rocDecode/HEVC: Used the reserved space in RocdecReconfigureDecoderInfo structure for bit_depth_minus_8 field to be backward compatible. Added bit depth to the new sequence file name when we dump output in decoder reconfiguration case.

* * rocDecode/HEVC: Added bit depth change support in decoder reconfiguration.

* * rocDecode/HEVC: Removed a comment line.

* * rocDecode/HEVC: Updated change log.

* * rocDecode/HEVC: Used the reserved space in RocdecReconfigureDecoderInfo structure for bit_depth_minus_8 field to be backward compatible. Added bit depth to the new sequence file name when we dump output in decoder reconfiguration case.

* * rocDecode/HEVC: Changes based on review comments.

* * rocDecode: Fixed a bug related to 422 surface format assignment.

* * rocDecode: Fixed build warnings with some sample apps.

[ROCm/rocdecode commit: ab7546930f]
This commit is contained in:
jeffqjiangNew
2025-03-13 09:29:25 -04:00
committed by GitHub
parent cd98621eb9
commit aacd035b6d
11 changed files with 76 additions and 23 deletions
@@ -1566,7 +1566,7 @@ ParserResult HevcVideoParser::ParseSliceHeader(uint8_t *nalu, size_t size, HevcS
}
// Check video dimension change
if ( pic_width_ != sps_ptr->pic_width_in_luma_samples || pic_height_ != sps_ptr->pic_height_in_luma_samples) {
if (pic_width_ != sps_ptr->pic_width_in_luma_samples || pic_height_ != sps_ptr->pic_height_in_luma_samples) {
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
@@ -1579,6 +1579,12 @@ ParserResult HevcVideoParser::ParseSliceHeader(uint8_t *nalu, size_t size, HevcS
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);
}
// Check bit depth change
if (bit_depth_luma_minus8_ != sps_ptr->bit_depth_luma_minus8 || bit_depth_chroma_minus8_ != sps_ptr->bit_depth_chroma_minus8) {
bit_depth_luma_minus8_ = sps_ptr->bit_depth_luma_minus8;
bit_depth_chroma_minus8_ = sps_ptr->bit_depth_chroma_minus8;
new_seq_activated_ = true;
}
// Set frame rate if available
if (new_seq_activated_) {
@@ -26,6 +26,8 @@ RocVideoParser::RocVideoParser() {
pic_count_ = 0;
pic_width_ = 0;
pic_height_ = 0;
bit_depth_luma_minus8_ = 0;
bit_depth_chroma_minus8_ = 0;
new_seq_activated_ = false;
frame_rate_.numerator = 0;
frame_rate_.denominator = 0;
@@ -138,6 +138,8 @@ protected:
uint32_t pic_count_; // decoded picture count for the current bitstream
uint32_t pic_width_;
uint32_t pic_height_;
uint32_t bit_depth_luma_minus8_;
uint32_t bit_depth_chroma_minus8_;
bool new_seq_activated_;
// Decoded buffer pool