Skip to content

Commit

Permalink
[HEVC VDEnc] Fix reference frame intra refresh location programming f…
Browse files Browse the repository at this point in the history
…or ACQP / BRC(CL#762321)

Update pic params rolling intra reference location before ACQP / BRC prepare SLB.

Change-Id: If7a40a705931663e18414cbf1f1ab1c41a112dc4
  • Loading branch information
thomasli21801 authored and Sherry-Lin committed May 2, 2018
1 parent 0d96156 commit ab264dd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions media_driver/agnostic/common/codec/hal/codechal_vdenc_hevc.cpp
Expand Up @@ -1280,8 +1280,6 @@ void CodechalVdencHevcState::SetVdencPipeBufAddrParams(
uint8_t scaledIdx = m_refList[refPicIdx]->ucScalingIdx;
pipeBufAddrParams.presVdenc4xDsSurface[refIdx] = &(m_trackedBuf->Get4xDsReconSurface(scaledIdx))->OsResource;
pipeBufAddrParams.presVdenc8xDsSurface[refIdx] = &(m_trackedBuf->Get8xDsReconSurface(scaledIdx))->OsResource;

m_hevcPicParams->RollingIntraReferenceLocation[refIdx] = m_refList[refPicIdx]->rollingIntraRefreshedPosition;
}
}

Expand Down Expand Up @@ -1717,6 +1715,19 @@ MOS_STATUS CodechalVdencHevcState::ExecutePictureLevel()
m_refList[m_currReconstructedPic.FrameIdx]->rollingIntraRefreshedPosition =
CodecHal_Clip3(0, rollingILimit, m_hevcPicParams->IntraInsertionLocation + m_hevcPicParams->IntraInsertionSize);

// For ACQP / BRC, update pic params rolling intra reference location here before cmd buffer is prepared.
PCODEC_PICTURE l0RefFrameList = m_hevcSliceParams->RefPicList[LIST_0];
for (uint8_t refIdx = 0; refIdx <= m_hevcSliceParams->num_ref_idx_l0_active_minus1; refIdx++)
{
CODEC_PICTURE refPic = l0RefFrameList[refIdx];

if (!CodecHal_PictureIsInvalid(refPic) && m_picIdx[refPic.FrameIdx].bValid)
{
uint8_t refPicIdx = m_picIdx[refPic.FrameIdx].ucPicIdx;
m_hevcPicParams->RollingIntraReferenceLocation[refIdx] = m_refList[refPicIdx]->rollingIntraRefreshedPosition;
}
}

// clean-up per VDBOX semaphore memory
int32_t currentPass = GetCurrentPass();

Expand Down

0 comments on commit ab264dd

Please sign in to comment.