From 6676f7652249bb20ad51d229012f8a6ef26f67b0 Mon Sep 17 00:00:00 2001 From: gfxVPLsdm Date: Tue, 21 Dec 2021 10:57:56 +0800 Subject: [PATCH] [RT Decode] convert AV1 mfx profile from MFX to UMC parameter (#1802) Issue: MDP-67712 Test: manually OSPR: Auto Co-authored-by: miaoshiw --- .../decode/av1/src/mfx_av1_dec_decode.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp b/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp index 335221792f..ffbeadd163 100755 --- a/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp +++ b/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp @@ -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); @@ -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);