This repository has been archived by the owner on May 17, 2023. It is now read-only.
Calling ConvertMFXParamsToUMC will may change av1's crop size potentailly. #2978
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ConvertMFXParamsToUMC is called by VideoDECODEXXXX::init. It will convert user's params to UMC params and use it to init m_decoder. But it makes clip_info same as disp_clip_info.
Then usually user will call MFXVideoDECODE_GetVideoParam to synchronize params. Different formats of video will call their own GetVideoParam. And GetVideoParam will call their own FillVideoParam as well. Below is av1's.
MediaSDK/_studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp
Line 1101 in 03dd2cc
It will call ConvertUMCParamsToMFX to convert umc params which is saved by init function to mfx params. And let's take a look what ConvertUMCParamsToMFX does.
disp_clip_info will assign to crop directly.
Now I will fully describe what happened.
First, user call MFXVideoDECODE_DecodeHeader to parse bitstream header, and return params to user. DecodeHeader will call
FillVideoParam, so the mfx's height and width are 16 aligned values. And crop size is actual size.
Then, user call init with params which is returned by decodeheader. Msdk call ConvertMFXParamsToUMC makes clip_info same as disp_clip_info with asigned values.
At last user call GetVideoParam, he get a 16 aligned crop size.
It only happens on av1(maybe mpeg2 will). Because this value in other formats is calculated.
My purpose is that report this issue. So I just committed a simple solution. Actually I don't know how msdk defines clip_info and disp_clip_info.