libmfx hevc level defination is same as h264, not level_idc of SPEC.
Signed-off-by: Zhong Li <zhong.li@intel.com>
return MFX_PROFILE_UNKNOWN;
}
+int ff_qsv_level_to_mfx(enum AVCodecID codec_id, int level)
+{
+ if (level == FF_LEVEL_UNKNOWN)
+ return MFX_LEVEL_UNKNOWN;
+
+ switch (codec_id) {
+ case AV_CODEC_ID_HEVC:
+ return level / 3;
+ default:
+ return level;
+ }
+}
+
static const struct {
mfxStatus mfxerr;
int averr;
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id);
int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile);
+int ff_qsv_level_to_mfx(enum AVCodecID codec_id, int level);
int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc);
enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type);
param.mfx.CodecId = ret;
param.mfx.CodecProfile = ff_qsv_profile_to_mfx(avctx->codec_id, avctx->profile);
- param.mfx.CodecLevel = avctx->level == FF_LEVEL_UNKNOWN ? MFX_LEVEL_UNKNOWN : avctx->level;
+ param.mfx.CodecLevel = ff_qsv_level_to_mfx(avctx->codec_id, avctx->level);
param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth;
param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;