Skip to content

Commit

Permalink
optimize choosing primary_ref_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Raju Konda authored and zlatinski committed Nov 21, 2024
1 parent 579000e commit 283c843
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vk_video_encoder/libs/VkVideoEncoder/VkEncoderDpbAV1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ VkVideoEncoderAV1PrimaryRefType VkEncDpbAV1::GetPrimaryRefType(StdVideoAV1Refere
return GLD_FRAME;
} else if (refName == STD_VIDEO_AV1_REFERENCE_NAME_BWDREF_FRAME) {
return BRF_FRAME;
} else if (m_maxRefFramesL1 > 0) {
return INT_ARF_FRAME;
} else {
return REGULAR_FRAME;
}
Expand All @@ -431,6 +433,14 @@ int32_t VkEncDpbAV1::GetPrimaryRefBufId(VkVideoEncoderAV1PrimaryRefType primaryR
refBufId = m_primaryRefBufIdMap[primaryRefType];
}

if (refBufId == VkEncDpbAV1::INVALID_IDX) {
if (primaryRefType == INT_ARF_FRAME) {
refBufId = m_primaryRefBufIdMap[ARF_FRAME];
} else {
refBufId = m_primaryRefBufIdMap[(m_maxRefFramesL1 > 0) ? BRF_FRAME : REGULAR_FRAME];
}
}

return refBufId;
}

Expand Down

0 comments on commit 283c843

Please sign in to comment.