Skip to content

Commit

Permalink
vp9d: accept MFX_FRAMETYPE_IDR and MFX_FRAMETYPE_REF
Browse files Browse the repository at this point in the history
MFX_FRAMETYPE_IDR or MFX_FRAMETYPE_REF can be ORed to
mfxEncodeCtrl::FrameType for other codecs(e.g AV1) when calling
MFXVideoENCODE_EncodeFrameAsync(), let's do the same for VP9.

This makes the below command work fine.

ffmpeg -hwaccel qsv -hwaccel_output_format qsv -i input.h264 -force_key_frames:v source \
-forced_idr 1 -c:v vp9_qsv -f null -

Signed-off-by: Haihao Xiang <[email protected]>
  • Loading branch information
xhaihao committed May 23, 2024
1 parent 4ad0d7b commit c06e465
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions _studio/mfx_lib/encode_hw/vp9/src/mfx_vp9_encode_hw_par.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1850,9 +1850,14 @@ mfxStatus CheckAndFixCtrl(
checkSts = MFX_WRN_INCOMPATIBLE_VIDEO_PARAM;
}

if (ctrl.FrameType > MFX_FRAMETYPE_P)
if (ctrl.FrameType & 0xFF00) {
ctrl.FrameType = (ctrl.FrameType & 0xFF);
checkSts = MFX_WRN_INCOMPATIBLE_VIDEO_PARAM;
}

if ((ctrl.FrameType & 0xF) > MFX_FRAMETYPE_P)
{
ctrl.FrameType = MFX_FRAMETYPE_P;
ctrl.FrameType = (MFX_FRAMETYPE_P | (ctrl.FrameType & 0xF0));
checkSts = MFX_WRN_INCOMPATIBLE_VIDEO_PARAM;
}

Expand Down

0 comments on commit c06e465

Please sign in to comment.