* rocDecode/HEVC: Fixed a few issues in reference list setup. Also looks like we need to use VA surface IDs on all buffers including the reference (need to confirm with VA driver team). (#61)

Esse commit está contido em:
jeffqjiangNew
2023-11-14 11:42:13 -05:00
commit de GitHub
commit 3357aba104
2 arquivos alterados com 26 adições e 21 exclusões
+21 -21
Ver Arquivo
@@ -337,7 +337,7 @@ int HEVCVideoParser::SendPicForDecode() {
}
for (i = ref_idx; i < 15; i++) {
pic_param_ptr->ref_frames[ref_idx].PicIdx = 0xFF;
pic_param_ptr->ref_frames[i].PicIdx = 0xFF;
}
pic_param_ptr->picture_width_in_luma_samples = sps_ptr->pic_width_in_luma_samples;
@@ -432,34 +432,34 @@ int HEVCVideoParser::SendPicForDecode() {
// Ref lists
memset(slice_params_ptr->RefPicList, 0xFF, sizeof(slice_params_ptr->RefPicList));
for (i = 0; i < m_sh_->num_ref_idx_l0_active_minus1; i++) {
for (i = 0; i <= m_sh_->num_ref_idx_l0_active_minus1; i++) {
int idx = ref_pic_list_0_[i]; // pic_idx of the ref pic
for (j = 0; j < 15; j++) {
if (pic_param_ptr->ref_frames[ref_idx].PicIdx == idx) {
if (pic_param_ptr->ref_frames[j].PicIdx == idx) {
break;
}
}
if (j == 15) {
ERR("Could not find matching pic in ref_frames list.");
}
else {
slice_params_ptr->RefPicList[0][i] = j;
}
}
if (m_sh_->slice_type == HEVC_SLICE_TYPE_B) {
for (i = 0; i <= m_sh_->num_ref_idx_l1_active_minus1; i++) {
int idx = ref_pic_list_1_[i]; // pic_idx of the ref pic
for (j = 0; j < 15; j++) {
if (pic_param_ptr->ref_frames[j].PicIdx == idx) {
break;
}
}
if (j == 15) {
ERR("Could not find matching pic in ref_frames list.");
}
else {
slice_params_ptr->RefPicList[0][i] = j;
}
}
}
if (m_sh_->slice_type == HEVC_SLICE_TYPE_B) {
for (i = 0; i < m_sh_->num_ref_idx_l1_active_minus1; i++) {
int idx = ref_pic_list_1_[i]; // pic_idx of the ref pic
for (j = 0; j < 15; j++) {
if (pic_param_ptr->ref_frames[ref_idx].PicIdx == idx) {
break;
}
if (j == 15) {
ERR("Could not find matching pic in ref_frames list.");
}
else {
slice_params_ptr->RefPicList[1][i] = j;
}
slice_params_ptr->RefPicList[1][i] = j;
}
}
}
+5
Ver Arquivo
@@ -204,6 +204,11 @@ rocDecStatus VaapiVideoDecoder::SubmitDecode(RocdecPicParams *pPicParams) {
switch (decoder_create_info_.CodecType) {
case rocDecVideoCodec_HEVC: {
pPicParams->pic_params.hevc.cur_pic.PicIdx = curr_surface_id;
for (int i = 0; i < 15; i++) {
if (pPicParams->pic_params.hevc.ref_frames[i].PicIdx != 0xFF) {
pPicParams->pic_params.hevc.ref_frames[i].PicIdx = va_surface_ids_[pPicParams->pic_params.hevc.ref_frames[i].PicIdx];
}
}
pic_params_ptr = (uint8_t*)&pPicParams->pic_params.hevc;
pic_params_size = sizeof(RocdecHevcPicParams);