diff options
Diffstat (limited to 'libavcodec/qsv.c')
-rw-r--r-- | libavcodec/qsv.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 5f7653a3bf..aac6ce6d30 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -1,20 +1,20 @@ /* * Intel MediaSDK QSV encoder/decoder shared code * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -54,6 +54,22 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id) return AVERROR(ENOSYS); } +int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile) +{ + if (profile == FF_PROFILE_UNKNOWN) + return MFX_PROFILE_UNKNOWN; + switch (codec_id) { + case AV_CODEC_ID_H264: + case AV_CODEC_ID_HEVC: + return profile; + case AV_CODEC_ID_VC1: + return 4 * profile + 1; + case AV_CODEC_ID_MPEG2VIDEO: + return 0x10 * profile; + } + return MFX_PROFILE_UNKNOWN; +} + int ff_qsv_error(int mfx_err) { switch (mfx_err) { |