Skip to content

Commit 166aa3c

Browse files
huige0901intel-mediadev
authored andcommitted
[Encode] Add Reference Surface Dump for HEVC
Add surface dump
1 parent 4968c07 commit 166aa3c

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

media_softlet/agnostic/common/codec/hal/enc/hevc/pipeline/encode_hevc_reference_frames.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,53 @@ MOS_STATUS HevcReferenceFrames::SetSlotForRecNotFiltered(unsigned char &slotForR
493493
}
494494
return MOS_STATUS_SUCCESS;
495495
}
496+
#if USE_CODECHAL_DEBUG_TOOL
497+
MOS_STATUS HevcReferenceFrames::DumpReferences(CodechalDebugInterface& debugInterface)
498+
{
499+
ENCODE_FUNC_CALL();
500+
501+
auto sliceParams = m_basicFeature->m_hevcSliceParams;
502+
ENCODE_CHK_NULL_RETURN(sliceParams);
503+
504+
const CODEC_PICTURE *l0RefFrameList = sliceParams->RefPicList[LIST_0];
505+
for (uint8_t refIdx = 0; refIdx <= sliceParams->num_ref_idx_l0_active_minus1; refIdx++)
506+
{
507+
CODEC_PICTURE refPic = l0RefFrameList[refIdx];
496508

509+
if (!CodecHal_PictureIsInvalid(refPic) && m_picIdx[refPic.FrameIdx].bValid)
510+
{
511+
// L0 references
512+
uint8_t refPicIdx = m_picIdx[refPic.FrameIdx].ucPicIdx;
513+
ENCODE_CHK_STATUS_RETURN(debugInterface.DumpYUVSurface(
514+
&m_refList[refPicIdx]->sRefReconBuffer,
515+
CodechalDbgAttr::attrReferenceSurfaces,
516+
("RefSurfL0" + std::to_string((int)refIdx)).c_str()));
517+
}
518+
}
519+
520+
if (sliceParams->slice_type == encodeHevcBSlice)
521+
{
522+
const CODEC_PICTURE *l1RefFrameList = sliceParams->RefPicList[LIST_1];
523+
for (uint8_t refIdx = 0; refIdx <= sliceParams->num_ref_idx_l1_active_minus1; refIdx++)
524+
{
525+
CODEC_PICTURE refPic = l1RefFrameList[refIdx];
526+
527+
if (!CodecHal_PictureIsInvalid(refPic) && m_picIdx[refPic.FrameIdx].bValid && encodeHevcPSlice != sliceParams->slice_type)
528+
{
529+
// L1 references
530+
uint8_t refPicIdx = m_picIdx[refPic.FrameIdx].ucPicIdx;
531+
ENCODE_CHK_STATUS_RETURN(debugInterface.DumpYUVSurface(
532+
&m_refList[refPicIdx]->sRefReconBuffer,
533+
CodechalDbgAttr::attrReferenceSurfaces,
534+
("RefSurfL1" + std::to_string((int)refIdx)).c_str()));
535+
}
536+
}
537+
}
538+
539+
return MOS_STATUS_SUCCESS;
540+
541+
}
542+
#endif
497543
MHW_SETPAR_DECL_SRC(VDENC_PIPE_BUF_ADDR_STATE, HevcReferenceFrames)
498544
{
499545
ENCODE_FUNC_CALL();

media_softlet/agnostic/common/codec/hal/enc/hevc/pipeline/encode_hevc_reference_frames.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ class HevcReferenceFrames : public mhw::vdbox::vdenc::Itf::ParSetting, public mh
165165
//!
166166
bool IsSameRefList() const { return m_sameRefList; };
167167

168+
#if USE_CODECHAL_DEBUG_TOOL
169+
MOS_STATUS DumpReferences(CodechalDebugInterface &debugInterface);
170+
#endif
168171
MHW_SETPAR_DECL_HDR(VDENC_PIPE_BUF_ADDR_STATE);
169172

170173
MHW_SETPAR_DECL_HDR(HCP_PIPE_BUF_ADDR_STATE);

0 commit comments

Comments
 (0)