From 0023a97576b7c4152a55befaae8cb2545b8bb6ca Mon Sep 17 00:00:00 2001 From: "Pohsiang (John) Hsu" Date: Fri, 6 Jun 2025 11:40:12 -0700 Subject: [PATCH] mediafoundation: Disable level check to unblock 8K x 8K HEVC encode for now. Reviewed-by: Yubo Xie Reviewed-by: Sil Vilerino Part-of: --- .../frontends/mediafoundation/encode_hevc.cpp | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/gallium/frontends/mediafoundation/encode_hevc.cpp b/src/gallium/frontends/mediafoundation/encode_hevc.cpp index 58eb76e9b19..a49903ee04d 100644 --- a/src/gallium/frontends/mediafoundation/encode_hevc.cpp +++ b/src/gallium/frontends/mediafoundation/encode_hevc.cpp @@ -837,31 +837,11 @@ CDX12EncHMFT::CheckMediaTypeLevel( { HRESULT hr = S_OK; UINT32 uiLevel = (UINT32) -1; - int maxLumaPs = 0; - const int minCbSizeY = 1 << ( encoderCapabilities.m_HWSupportH265BlockSizes.bits.log2_min_luma_coding_block_size_minus3 + 3 ); - const int alignedWidth = static_cast( std::ceil( width / static_cast( minCbSizeY ) ) * minCbSizeY ); - const int alignedHeight = static_cast( std::ceil( height / static_cast( minCbSizeY ) ) * minCbSizeY ); - + uiLevel = MFGetAttributeUINT32( pmt, MF_MT_VIDEO_LEVEL, uiLevel ); enum eAVEncH265VLevel AVEncLevel; CHECKHR_GOTO( ConvertLevelToAVEncH265VLevel( uiLevel, AVEncLevel ), done ); - maxLumaPs = LevelToLumaPS( AVEncLevel ); - - // TODO: add more checks according to A.1 - if( ( alignedHeight * alignedWidth > maxLumaPs ) || ( (double) alignedWidth > sqrt( (double) maxLumaPs * 8 ) ) || - ( (double) alignedHeight > sqrt( (double) maxLumaPs * 8 ) ) ) - { - debug_printf( "[dx12 hmft 0x%p] CheckMediaTypeLevel failed: alignedWidth, alignedHeight combination exceeded max luma " - "sample constraints " - "(maxLumaPS). (alignedWidth = %d, alignedHeight = %d, maxLumaPS = %d)\n", - this, - alignedHeight, - alignedWidth, - maxLumaPs ); - CHECKHR_GOTO( E_INVALIDARG, done ); - } - if( pLevel ) { *pLevel = AVEncLevel;