Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

[Decode] Enable HEVC CSC via sfc pipeline #2795

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions _studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ mfxStatus VideoDECODEH265::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1 *
return sts;
UMC::Status umcRes = UMC::UMC_OK;

*surface_out = 0;
*surface_out = nullptr;

if (m_isOpaq)
{
Expand All @@ -1069,10 +1069,27 @@ mfxStatus VideoDECODEH265::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1 *
MFX_CHECK(surface_work, MFX_ERR_UNDEFINED_BEHAVIOR);
}

sts = CheckFrameInfoCodecs(&surface_work->Info, MFX_CODEC_HEVC, m_platform != MFX_PLATFORM_SOFTWARE);
MFX_CHECK(sts == MFX_ERR_NONE, MFX_ERR_INVALID_VIDEO_PARAM);
if (surface_work)
{
bool isVideoProcCscEnabled = false;
#ifndef MFX_DEC_VIDEO_POSTPROCESS_DISABLE
mfxExtDecVideoProcessing* videoProcessing = (mfxExtDecVideoProcessing*)GetExtendedBuffer(m_vInitPar.ExtParam, m_vInitPar.NumExtParam, MFX_EXTBUFF_DEC_VIDEO_PROCESSING);
if (videoProcessing && videoProcessing->Out.FourCC != m_vPar.mfx.FrameInfo.FourCC)
{
isVideoProcCscEnabled = true;
}
#endif
sts = CheckFrameInfoCodecs(&surface_work->Info, MFX_CODEC_HEVC, m_platform != MFX_PLATFORM_SOFTWARE);
//Decode CSC support more FourCC format, already checked in Init, skip the check return;
if(!isVideoProcCscEnabled)
{
MFX_CHECK(sts == MFX_ERR_NONE, MFX_ERR_UNSUPPORTED);
}

sts = CheckFrameData(surface_work);
MFX_CHECK_STS(sts);
}

sts = CheckFrameData(surface_work);

sts = m_FrameAllocator->SetCurrentMFXSurface(surface_work, m_isOpaq);
MFX_CHECK_STS(sts);
Expand Down