Skip to content

Commit

Permalink
[RT Decode] convert AV1 mfx profile from MFX to UMC parameter (#1802)
Browse files Browse the repository at this point in the history
Issue: MDP-67712
Test: manually
OSPR: Auto

Co-authored-by: miaoshiw <stella.wu@intel.com>
  • Loading branch information
gfxVPLsdm and stellawuintel authored Dec 21, 2021
1 parent 8ad5e51 commit 6676f76
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions _studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,22 @@ VideoDECODEAV1::~VideoDECODEAV1()
}
}

inline
mfxU16 av1_mfx_profile_to_native_profile(mfxU16 mfx)
{
switch (mfx)
{
case MFX_PROFILE_AV1_MAIN:
return 0;
case MFX_PROFILE_AV1_HIGH:
return 1;
case MFX_PROFILE_AV1_PRO:
return 2;
default:
return mfx;
}
}

mfxStatus VideoDECODEAV1::Init(mfxVideoParam* par)
{
MFX_CHECK_NULL_PTR1(par);
Expand Down Expand Up @@ -226,6 +242,7 @@ mfxStatus VideoDECODEAV1::Init(mfxVideoParam* par)
m_core->GetVA((mfxHDL*)&vp.pVideoAccelerator, MFX_MEMTYPE_FROM_DECODE);

ConvertMFXParamsToUMC(par, &vp);
vp.info.profile = av1_mfx_profile_to_native_profile(par->mfx.CodecProfile);

UMC::Status umcSts = m_decoder->Init(&vp);
MFX_CHECK(umcSts == UMC::UMC_OK, MFX_ERR_NOT_INITIALIZED);
Expand Down

0 comments on commit 6676f76

Please sign in to comment.