From 431f8683ad36ee19adbdbf7f9aba0961093e1317 Mon Sep 17 00:00:00 2001 From: "Yao, Leyu" Date: Wed, 7 Feb 2024 09:21:42 +0800 Subject: [PATCH] Fix functionaly of vp9 icq Signed-off-by: Yao, Leyu --- .../mfx_lib/encode_hw/vp9/include/mfx_vp9_encode_hw_utils.h | 2 +- .../mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_vaapi.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/_studio/mfx_lib/encode_hw/vp9/include/mfx_vp9_encode_hw_utils.h b/_studio/mfx_lib/encode_hw/vp9/include/mfx_vp9_encode_hw_utils.h index 5804a77da3..ca12f21f8b 100644 --- a/_studio/mfx_lib/encode_hw/vp9/include/mfx_vp9_encode_hw_utils.h +++ b/_studio/mfx_lib/encode_hw/vp9/include/mfx_vp9_encode_hw_utils.h @@ -57,7 +57,7 @@ namespace MfxHwVP9Encode #define MAX_IVF_HEADER_SIZE IVF_SEQ_HEADER_SIZE_BYTES + IVF_PIC_HEADER_SIZE_BYTES #define MAX_Q_INDEX 255 -#define MAX_ICQ_QUALITY_INDEX 255 +#define MAX_ICQ_QUALITY_INDEX 51 #define MAX_LF_LEVEL 63 #define MAX_ABS_COEFF_TYPE_Q_INDEX_DELTA 15 diff --git a/_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_vaapi.cpp b/_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_vaapi.cpp index 0ec4c45875..b68d34ef93 100644 --- a/_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_vaapi.cpp +++ b/_studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_vaapi.cpp @@ -58,6 +58,7 @@ namespace MfxHwVP9Encode case MFX_RATECONTROL_VBR: return VA_RC_VBR; case MFX_RATECONTROL_AVBR: return VA_RC_VBR; case MFX_RATECONTROL_CQP: return VA_RC_CQP; + case MFX_RATECONTROL_ICQ: return VA_RC_ICQ; default: assert(!"Unsupported RateControl"); return 0; } } @@ -419,6 +420,10 @@ mfxStatus SetRateControl( rate_param->rc_flags.bits.reset = isBrcResetRequired; rate_param->rc_flags.bits.temporal_id = tl; } + else if(par.mfx.RateControlMethod == MFX_RATECONTROL_ICQ) + { + rate_param->ICQ_quality_factor = par.mfx.ICQQuality; + } rate_param->rc_flags.bits.enable_dynamic_scaling = 1;