aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qsv.c
diff options
context:
space:
mode:
authorZhong Li <zhong.li@intel.com>2019-04-28 17:15:55 +0800
committerZhong Li <zhong.li@intel.com>2019-05-07 11:00:14 +0800
commit94ab39ec78c536703f77821fc039fee649105aab (patch)
tree9cc4c7aaa94af6f8277ed634d6242b777e46420d /libavcodec/qsv.c
parent48627aaf646270a8c98337ee208574543e499bfd (diff)
downloadffmpeg-94ab39ec78c536703f77821fc039fee649105aab.tar.gz
lavc/qsvdec: fix hevc level incorrectly map
libmfx hevc level defination is same as h264, not level_idc of SPEC. Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/qsv.c')
-rw-r--r--libavcodec/qsv.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index bb0d79588c..4d3fbafe04 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -83,6 +83,19 @@ int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile)
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;