mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-08 07:30:29 +01:00
mediafoundation: Disable level check to unblock 8K x 8K HEVC encode for now.
Reviewed-by: Yubo Xie <yuboxie@microsoft.com> Reviewed-by: Sil Vilerino <sivileri@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35413>
This commit is contained in:
parent
639d7946c7
commit
0023a97576
1 changed files with 1 additions and 21 deletions
|
|
@ -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<UINT>( std::ceil( width / static_cast<double>( minCbSizeY ) ) * minCbSizeY );
|
||||
const int alignedHeight = static_cast<UINT>( std::ceil( height / static_cast<double>( 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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue