From cb6d1f0d963b178b58df4b2b369705fe48754a1a Mon Sep 17 00:00:00 2001 From: "Han, Longfei" Date: Tue, 19 Nov 2024 17:53:06 +0800 Subject: [PATCH] Revert "[VP] HDR Tone Mapping Curve Change on 3dlut kernel" This reverts commit 8a867fa6fc5f7c49c7a267050953fee77a24e176. --- .../agnostic/common/vp/hal/vphal_render_hdr_g11.cpp | 11 ++--------- .../common/vp/hal/vphal_render_vebox_base.cpp | 4 ++-- .../agnostic/common/vp/hal/vphal_render_vebox_base.h | 4 ++-- .../gen12/vp/hal/vphal_render_hdr_3dlut_g12.cpp | 10 +--------- .../hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp | 10 ++-------- .../packet/vp_render_vebox_hdr_3dlut_ocl_kernel.cpp | 9 +-------- 6 files changed, 10 insertions(+), 38 deletions(-) diff --git a/media_driver/agnostic/common/vp/hal/vphal_render_hdr_g11.cpp b/media_driver/agnostic/common/vp/hal/vphal_render_hdr_g11.cpp index 7f0c7370a70..7e42d4f59a0 100644 --- a/media_driver/agnostic/common/vp/hal/vphal_render_hdr_g11.cpp +++ b/media_driver/agnostic/common/vp/hal/vphal_render_hdr_g11.cpp @@ -407,15 +407,8 @@ void Hdr3DLutGenerator::InitCoefSurface(const uint32_t maxDLL, const uint32_t ma { CalcCCMMatrix(); MOS_SecureMemcpy(ccmMatrix, sizeof(float) * 12, color_matrix_calculation, sizeof(float) * 12); - if (maxDLL > 800) - { - tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2H; - VPHAL_RENDER_NORMALMESSAGE("Change curve, maxDLL %d, hdrMode: %d!", maxDLL, tmMode); - } - else - { - tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2S; - } + + tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2S; oetfCurve = (OETF_CURVE_TYPE)OETF_SRGB; tmSrcType = (TONE_MAPPING_SOURCE_TYPE)TONE_MAPPING_SOURCE_PSEUDO_Y_BT709; } diff --git a/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.cpp b/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.cpp index 9621a1fec07..d27aba82216 100644 --- a/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.cpp +++ b/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.cpp @@ -5299,8 +5299,8 @@ MOS_STATUS VPHAL_VEBOX_RENDER_DATA::Init() fScaleY = 0.0f; bHdr3DLut = false; - uiMaxDisplayLum = 800; - uiMaxContentLevelLum = 4000; + uiMaxDisplayLum = 4000; + uiMaxContentLevelLum = 1000; hdrMode = VPHAL_HDR_MODE_NONE; return MOS_STATUS_SUCCESS; diff --git a/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.h b/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.h index ef68b8b910e..ce5a15f34ab 100644 --- a/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.h +++ b/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.h @@ -687,8 +687,8 @@ struct VPHAL_VEBOX_RENDER_DATA bHdr3DLut = false; bUseVEHdrSfc = false; - uiMaxDisplayLum = 800; - uiMaxContentLevelLum = 4000; + uiMaxDisplayLum = 4000; + uiMaxContentLevelLum = 1000; hdrMode = VPHAL_HDR_MODE_NONE; m_pVeboxStateParams = nullptr; diff --git a/media_driver/agnostic/gen12/vp/hal/vphal_render_hdr_3dlut_g12.cpp b/media_driver/agnostic/gen12/vp/hal/vphal_render_hdr_3dlut_g12.cpp index 4a01b9478eb..ef76b6055c7 100644 --- a/media_driver/agnostic/gen12/vp/hal/vphal_render_hdr_3dlut_g12.cpp +++ b/media_driver/agnostic/gen12/vp/hal/vphal_render_hdr_3dlut_g12.cpp @@ -372,15 +372,7 @@ void Hdr3DLutGeneratorG12::InitCoefSurface(const uint32_t maxDLL, const uint32_t CalcCCMMatrix(); MOS_SecureMemcpy(ccmMatrix, sizeof(float) * 12, color_matrix_calculation, sizeof(float) * 12); - if (maxDLL > 800) - { - tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2H; - VPHAL_RENDER_NORMALMESSAGE("Change curve, maxDLL %d, hdrMode: %d!", maxDLL, tmMode); - } - else - { - tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2S; - } + tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2S; oetfCurve = (OETF_CURVE_TYPE)OETF_SRGB; tmSrcType = (TONE_MAPPING_SOURCE_TYPE)TONE_MAPPING_SOURCE_PSEUDO_Y_BT709; } diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp index c03eab72fcd..3863482937f 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_kernel.cpp @@ -389,14 +389,8 @@ MOS_STATUS VpRenderHdr3DLutKernel::InitCoefSurface(const uint32_t maxDLL, const { CalcCCMMatrix(); MOS_SecureMemcpy(ccmMatrix, sizeof(float) * 12, color_matrix_calculation, sizeof(float) * 12); - if (maxDLL > 800) - { - tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2H; - } - else - { - tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2S; - } + + tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2S; oetfCurve = (OETF_CURVE_TYPE)OETF_SRGB; tmSrcType = (TONE_MAPPING_SOURCE_TYPE)TONE_MAPPING_SOURCE_PSEUDO_Y_BT709; } diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_ocl_kernel.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_ocl_kernel.cpp index a803f7316b9..0243ff1eeed 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_ocl_kernel.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_render_vebox_hdr_3dlut_ocl_kernel.cpp @@ -453,14 +453,7 @@ MOS_STATUS VpRenderHdr3DLutOclKernel::InitCoefSurface(const uint32_t maxDLL, con CalcCCMMatrix(); MOS_SecureMemcpy(ccmMatrix, sizeof(float) * 12, color_matrix_calculation, sizeof(float) * 12); - if (maxDLL > 800) - { - tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2H; - } - else - { - tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2S; - } + tmMode = (TONE_MAPPING_MODE)TONE_MAPPING_MODE_H2S; oetfCurve = (OETF_CURVE_TYPE)OETF_SRGB; tmSrcType = (TONE_MAPPING_SOURCE_TYPE)TONE_MAPPING_SOURCE_PSEUDO_Y_BT709; }