* rocDecode/VP9: Increased DPB buffer size to handle streams with the maximum number of the reference frames allowed. (#488)

- DPB buffer size was set to NUM_REF_FRAMES(8) which can not handle streams with 8 reference frames. We increase DPB size from 8 to 10 (same strategy as AV1) to be able to handle these streams.
Este commit está contenido en:
jeffqjiangNew
2025-01-07 20:43:49 -05:00
cometido por GitHub
padre 888940f52c
commit 9c113d5ee9
Se han modificado 3 ficheros con 22 adiciones y 21 borrados
+6 -6
Ver fichero
@@ -49,7 +49,7 @@ rocDecStatus Vp9VideoParser::Initialize(RocdecParserParams *p_params) {
if (parser_params_.max_display_delay < DECODE_BUF_POOL_EXTENSION) {
parser_params_.max_display_delay = DECODE_BUF_POOL_EXTENSION;
}
CheckAndAdjustDecBufPoolSize(VP9_NUM_REF_FRAMES);
CheckAndAdjustDecBufPoolSize(VP9_BUFFER_POOL_MAX_SIZE);
return ROCDEC_SUCCESS;
}
@@ -352,7 +352,7 @@ void Vp9VideoParser::UpdateRefFrames() {
void Vp9VideoParser::InitDpb() {
int i;
memset(&dpb_buffer_, 0, sizeof(DecodedPictureBuffer));
for (i = 0; i < VP9_NUM_REF_FRAMES; i++) {
for (i = 0; i < VP9_BUFFER_POOL_MAX_SIZE; i++) {
dpb_buffer_.frame_store[i].pic_idx = i;
dpb_buffer_.frame_store[i].use_status = kNotUsed;
dpb_buffer_.dec_ref_count[i] = 0;
@@ -391,12 +391,12 @@ ParserResult Vp9VideoParser::FindFreeInDecBufPool() {
ParserResult Vp9VideoParser::FindFreeInDpbAndMark() {
int i;
for (i = 0; i < VP9_NUM_REF_FRAMES; i++ ) {
for (i = 0; i < VP9_BUFFER_POOL_MAX_SIZE; i++ ) {
if (dpb_buffer_.dec_ref_count[i] == 0) {
break;
}
}
if (i == VP9_NUM_REF_FRAMES) {
if (i == VP9_BUFFER_POOL_MAX_SIZE) {
ERR("DPB buffer overflow!");
return PARSER_NOT_FOUND;
}
@@ -422,7 +422,7 @@ ParserResult Vp9VideoParser::FindFreeInDpbAndMark() {
}
void Vp9VideoParser::CheckAndUpdateDecStatus() {
for (int i = 0; i < VP9_NUM_REF_FRAMES; i++) {
for (int i = 0; i < VP9_BUFFER_POOL_MAX_SIZE; i++) {
if (dpb_buffer_.frame_store[i].use_status != kNotUsed && dpb_buffer_.dec_ref_count[i] == 0) {
dpb_buffer_.frame_store[i].use_status = kNotUsed;
decode_buffer_pool_[dpb_buffer_.frame_store[i].dec_buf_idx].use_status &= ~kFrameUsedForDecode;
@@ -1112,7 +1112,7 @@ void Vp9VideoParser::PrintDpb() {
MSG("DPB buffer content: ");
MSG("=======================");
MSG("Current frame: pic_idx = " << curr_pic_.pic_idx << ", dec_buf_idx = " << curr_pic_.dec_buf_idx);
for (i = 0; i < VP9_NUM_REF_FRAMES; i++) {
for (i = 0; i < VP9_BUFFER_POOL_MAX_SIZE; i++) {
MSG("Frame store " << i << ": " << "dec_ref_count = " << dpb_buffer_.dec_ref_count[i] << ", pic_idx = " << dpb_buffer_.frame_store[i].pic_idx << ", dec_buf_idx = " << dpb_buffer_.frame_store[i].dec_buf_idx << ", use_status = " << dpb_buffer_.frame_store[i].use_status);
}
MSG_NO_NEWLINE("virtual_buffer_index[] =");