Skip to content

Commit

Permalink
[Encode] Add perf tag for rab frame
Browse files Browse the repository at this point in the history
Add perf tag for rab frame.
  • Loading branch information
bai-isaac authored and intel-mediadev committed Aug 28, 2023
1 parent d9a78ff commit 23bb40c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ MOS_STATUS HevcVdencPkt422::PatchPictureLevelCommands(const uint8_t &packetPhase

ENCODE_CHK_STATUS_RETURN(m_miItf->SetWatchdogTimerThreshold(m_basicFeature->m_frameWidth, m_basicFeature->m_frameHeight, true));

SetPerfTag(CODECHAL_ENCODE_PERFTAG_CALL_PAK_ENGINE, (uint16_t)m_basicFeature->m_mode, m_basicFeature->m_pictureCodingType);
SetPerfTag();

ENCODE_CHK_STATUS_RETURN(AddForceWakeup(cmdBuffer));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ namespace encode

ENCODE_CHK_STATUS_RETURN(m_miItf->SetWatchdogTimerThreshold(m_basicFeature->m_frameWidth, m_basicFeature->m_frameHeight, true));

uint16_t perfTag = m_pipeline->IsFirstPass() ? CODECHAL_ENCODE_PERFTAG_CALL_PAK_ENGINE : CODECHAL_ENCODE_PERFTAG_CALL_PAK_ENGINE_SECOND_PASS;
SetPerfTag(perfTag, (uint16_t)m_basicFeature->m_mode, m_basicFeature->m_pictureCodingType);
SetPerfTag();

auto feature = dynamic_cast<HEVCEncodeBRC*>(m_featureManager->GetFeature(HevcFeatureIDs::hevcBrcFeature));
ENCODE_CHK_NULL_RETURN(feature);
Expand Down Expand Up @@ -1656,15 +1655,22 @@ MOS_STATUS HevcVdencPkt::AddAllCmds_HCP_PAK_INSERT_OBJECT_BRC(PMOS_COMMAND_BUFFE
return eStatus;
}

void HevcVdencPkt::SetPerfTag(uint16_t type, uint16_t mode, uint16_t picCodingType)
void HevcVdencPkt::SetPerfTag()
{
ENCODE_FUNC_CALL();

uint16_t callType = m_pipeline->IsFirstPass() ? CODECHAL_ENCODE_PERFTAG_CALL_PAK_ENGINE : CODECHAL_ENCODE_PERFTAG_CALL_PAK_ENGINE_SECOND_PASS;
uint16_t picType = m_basicFeature->m_pictureCodingType;
if (m_basicFeature->m_pictureCodingType == B_TYPE && m_basicFeature->m_ref.IsLowDelay())
{
picType = 0;
}

PerfTagSetting perfTag;
perfTag.Value = 0;
perfTag.Mode = mode & CODECHAL_ENCODE_MODE_BIT_MASK;
perfTag.CallType = type;
perfTag.PictureCodingType = picCodingType > 3 ? 0 : picCodingType;
perfTag.Mode = (uint16_t)m_basicFeature->m_mode & CODECHAL_ENCODE_MODE_BIT_MASK;
perfTag.CallType = callType;
perfTag.PictureCodingType = picType;
m_osInterface->pfnSetPerfTag(m_osInterface, perfTag.Value);
m_osInterface->pfnIncPerfBufferID(m_osInterface);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ namespace encode
// Inline functions
MOS_STATUS ValidateVdboxIdx(const MHW_VDBOX_NODE_IND &vdboxIndex);

void SetPerfTag(uint16_t type, uint16_t mode, uint16_t picCodingType);
void SetPerfTag();

MOS_STATUS SetSemaphoreMem(
MOS_RESOURCE & semaphoreMem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,12 @@ namespace encode
ENCODE_CHK_NULL_RETURN(brcFeature);

uint16_t perfTag = m_pipeline->IsFirstPass() ? CODECHAL_ENCODE_PERFTAG_CALL_BRC_UPDATE : CODECHAL_ENCODE_PERFTAG_CALL_BRC_UPDATE_SECOND_PASS;
SetPerfTag(perfTag, (uint16_t)m_basicFeature->m_mode, m_basicFeature->m_pictureCodingType);
uint16_t pictureType = m_basicFeature->m_pictureCodingType;
if (m_basicFeature->m_pictureCodingType == B_TYPE && m_basicFeature->m_ref.IsLowDelay())
{
pictureType = 0;
}
SetPerfTag(perfTag, (uint16_t)m_basicFeature->m_mode, pictureType);

if (!m_pipeline->IsSingleTaskPhaseSupported() || firstTaskInPhase)
{
Expand Down

0 comments on commit 23bb40c

Please sign in to comment.