mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-03 10:40:34 +02:00
mediafoundation: Fix the frame number validation logic for motion hint
The external move region frame number was continuously generated. However, the current POC was reset based on IDR. Modified the logic of validation and logged a warning in case of mismatch. Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40756>
This commit is contained in:
parent
bae86c3118
commit
aa5398689b
2 changed files with 14 additions and 8 deletions
|
|
@ -426,14 +426,17 @@ CDX12EncHMFT::PrepareForEncodeHelper( LPDX12EncodeContext pDX12EncodeContext,
|
|||
uint32_t current_poc = pPicInfo->pic_order_cnt;
|
||||
|
||||
// Validate frame number first
|
||||
if( moveRegionFrameNum != current_poc )
|
||||
// Due to the way the move region frame number is generated, there can be cases where the frame number doesn't match the
|
||||
// current POC. In those cases, we will log a warning but still try to use the move regions.
|
||||
if( m_uiGopSize > 0 && ( moveRegionFrameNum % m_uiGopSize ) != current_poc )
|
||||
{
|
||||
debug_printf( "[dx12 hmft 0x%p] MoveRegions frame mismatch (MRFN=%u, cur POC=%u), ignoring\n",
|
||||
debug_printf( "[dx12 hmft 0x%p] WARNING: MoveRegions frame mismatch (MRFN=%u, cur POC=%u, GOPSize=%u)\n",
|
||||
this,
|
||||
moveRegionFrameNum,
|
||||
current_poc );
|
||||
current_poc,
|
||||
m_uiGopSize );
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
MOVEREGION_INFO *pMoveInfo = reinterpret_cast<MOVEREGION_INFO *>( m_pMoveRegionBlob.data() );
|
||||
uint32_t maxRects = m_EncoderCapabilities.m_HWSupportMoveRects.bits.max_motion_hints;
|
||||
|
|
|
|||
|
|
@ -434,14 +434,17 @@ CDX12EncHMFT::PrepareForEncodeHelper( LPDX12EncodeContext pDX12EncodeContext,
|
|||
uint32_t current_poc = pPicInfo->pic_order_cnt;
|
||||
|
||||
// Validate frame number first
|
||||
if( moveRegionFrameNum != current_poc )
|
||||
// Due to the way the move region frame number is generated, there can be cases where the frame number doesn't match the
|
||||
// current POC. In those cases, we will log a warning but still try to use the move regions.
|
||||
if( m_uiGopSize > 0 && ( moveRegionFrameNum % m_uiGopSize ) != current_poc )
|
||||
{
|
||||
debug_printf( "[dx12 hmft 0x%p] MoveRegions frame mismatch (MRFN=%u, cur POC=%u), ignoring\n",
|
||||
debug_printf( "[dx12 hmft 0x%p] WARNING: MoveRegions frame mismatch (MRFN=%u, cur POC=%u, GOPSize=%u)\n",
|
||||
this,
|
||||
moveRegionFrameNum,
|
||||
current_poc );
|
||||
current_poc,
|
||||
m_uiGopSize );
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
MOVEREGION_INFO *pMoveInfo = reinterpret_cast<MOVEREGION_INFO *>( m_pMoveRegionBlob.data() );
|
||||
uint32_t maxRects = m_EncoderCapabilities.m_HWSupportMoveRects.bits.max_motion_hints;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue