Skip to content

Commit

Permalink
[Encode] Limit Avc DirectMode State Cmd to B frame only
Browse files Browse the repository at this point in the history
I & P frame does not need  DirectMode State Cmd, so limit it to B frame only.

Change-Id: I36b04070216ee4f6efc7f6f4675dd653226e8a26
  • Loading branch information
Jabin_Wu authored and intel-mediadev committed Sep 5, 2019
1 parent ab3c3c6 commit a60a5e8
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions media_driver/agnostic/common/codec/hal/codechal_vdenc_avc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5793,17 +5793,20 @@ MOS_STATUS CodechalVdencAvcState::ExecutePictureLevel()
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_mfxInterface->AddMfxQmCmd(&cmdBuffer, &qmParams));
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_mfxInterface->AddMfxFqmCmd(&cmdBuffer, &fqmParams));

// Add AVC Direct Mode command
MHW_VDBOX_AVC_DIRECTMODE_PARAMS directmodeParams;
MOS_ZeroMemory(&directmodeParams, sizeof(directmodeParams));
directmodeParams.CurrPic = m_avcPicParam->CurrReconstructedPic;
directmodeParams.isEncode = true;
directmodeParams.uiUsedForReferenceFlags = 0xFFFFFFFF;
directmodeParams.pAvcPicIdx = &(m_picIdx[0]);
directmodeParams.avcRefList = (void**)m_refList;
directmodeParams.bPicIdRemappingInUse = false;
directmodeParams.bDisableDmvBuffers = true;
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_mfxInterface->AddMfxAvcDirectmodeCmd(&cmdBuffer, &directmodeParams));
if (m_pictureCodingType == B_TYPE)
{
// Add AVC Direct Mode command
MHW_VDBOX_AVC_DIRECTMODE_PARAMS directmodeParams;
MOS_ZeroMemory(&directmodeParams, sizeof(directmodeParams));
directmodeParams.CurrPic = m_avcPicParam->CurrReconstructedPic;
directmodeParams.isEncode = true;
directmodeParams.uiUsedForReferenceFlags = 0xFFFFFFFF;
directmodeParams.pAvcPicIdx = &(m_picIdx[0]);
directmodeParams.avcRefList = (void**)m_refList;
directmodeParams.bPicIdRemappingInUse = false;
directmodeParams.bDisableDmvBuffers = true;
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_mfxInterface->AddMfxAvcDirectmodeCmd(&cmdBuffer, &directmodeParams));
}

m_osInterface->pfnReturnCommandBuffer(m_osInterface, &cmdBuffer, 0);

Expand Down

0 comments on commit a60a5e8

Please sign in to comment.