From bcae92f46257b77643ffdf7681d76b81963265f6 Mon Sep 17 00:00:00 2001 From: WalterBai Date: Wed, 6 Dec 2023 16:13:00 +0800 Subject: [PATCH] [Encode] Add Y210 support for VDENC_REF_SURFACE_STATE and refine ENCODE_CHK_COND_RETURN for message printing Add Y210 support for VDENC_REF_SURFACE_STATE. Refine ENCODE_CHK_COND_RETURN to take variable arguments for message printing. --- .../codec/hal/enc/av1/features/encode_av1_basic_feature.cpp | 2 +- .../agnostic/common/codec/hal/enc/shared/encode_utils.h | 4 ++-- media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_vdenc_impl.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/media_softlet/agnostic/common/codec/hal/enc/av1/features/encode_av1_basic_feature.cpp b/media_softlet/agnostic/common/codec/hal/enc/av1/features/encode_av1_basic_feature.cpp index 8a93aece2de..9f97819f30c 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/av1/features/encode_av1_basic_feature.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/av1/features/encode_av1_basic_feature.cpp @@ -727,7 +727,7 @@ MHW_SETPAR_DECL_SRC(VDENC_REF_SURFACE_STATE, Av1BasicFeature) params.uOffset = m_rawSurfaceToPak->dwHeight; params.vOffset = m_rawSurfaceToPak->dwHeight << 1; } - else if (m_reconSurface.Format == Format_Y216 || m_reconSurface.Format == Format_YUY2 || m_reconSurface.Format == Format_YUYV) + else if (m_reconSurface.Format == Format_Y216 || m_reconSurface.Format == Format_Y210 || m_reconSurface.Format == Format_YUY2) { params.uOffset = m_rawSurfaceToPak->dwHeight; params.vOffset = m_rawSurfaceToPak->dwHeight; diff --git a/media_softlet/agnostic/common/codec/hal/enc/shared/encode_utils.h b/media_softlet/agnostic/common/codec/hal/enc/shared/encode_utils.h index 8e15162b310..dd479c68337 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/shared/encode_utils.h +++ b/media_softlet/agnostic/common/codec/hal/enc/shared/encode_utils.h @@ -67,8 +67,8 @@ enum HuCFunction #define ENCODE_CHK_STATUS_NO_STATUS_RETURN(_stmt) \ MOS_CHK_STATUS_NO_STATUS_RETURN(MOS_COMPONENT_CODEC, MOS_CODEC_SUBCOMP_ENCODE, _stmt) -#define ENCODE_CHK_COND_RETURN(_stmt, _message) \ - MOS_CHK_COND_RETURN(MOS_COMPONENT_CODEC, MOS_CODEC_SUBCOMP_ENCODE, _stmt, _message) +#define ENCODE_CHK_COND_RETURN(_stmt, _message, ...) \ + MOS_CHK_COND_RETURN(MOS_COMPONENT_CODEC, MOS_CODEC_SUBCOMP_ENCODE, _stmt, _message, ##__VA_ARGS__) #define ENCODE_CHK_STATUS_MESSAGE_RETURN(_stmt, _message, ...) \ MOS_CHK_STATUS_MESSAGE_RETURN(MOS_COMPONENT_CODEC, MOS_CODEC_SUBCOMP_ENCODE, _stmt, _message, ##__VA_ARGS__) diff --git a/media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_vdenc_impl.h b/media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_vdenc_impl.h index e4262a1bd8e..adb83962f7b 100644 --- a/media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_vdenc_impl.h +++ b/media_softlet/agnostic/common/hw/vdbox/mhw_vdbox_vdenc_impl.h @@ -125,6 +125,7 @@ inline SurfaceFormat MosFormatToVdencSurfaceReconFormat(MOS_FORMAT format) return SurfaceFormat::p010Variant; case Format_R10G10B10A2: return SurfaceFormat::r10g10b10a2; + case Format_Y210: case Format_Y216: return SurfaceFormat::y216Variant; case Format_Y410: