[FFmpeg-devel] [PATCH] libavcodec/dxva2.c: fix dxva2 does not support H264 baseline profile

Hendrik Leppkes h.leppkes at gmail.com
Sat Oct 14 20:10:43 EEST 2023


On Sat, Oct 14, 2023 at 6:02 AM xyz1001 <zgzf1001 at gmail.com> wrote:
>
> dxva2 fail to init when decode h264 with baseline profile becase `prof_h264_high` does not contains `AV_PROFILE_H264_BASELINE` and `dxva_check_codec_compatibility` will return error
> ---
>  libavcodec/dxva2.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
> index d7bc587562..e6b83f89cc 100644
> --- a/libavcodec/dxva2.c
> +++ b/libavcodec/dxva2.c
> @@ -61,7 +61,8 @@ typedef struct dxva_mode {
>  static const int prof_mpeg2_main[]   = {AV_PROFILE_MPEG2_SIMPLE,
>                                          AV_PROFILE_MPEG2_MAIN,
>                                          AV_PROFILE_UNKNOWN};
> -static const int prof_h264_high[]    = {AV_PROFILE_H264_CONSTRAINED_BASELINE,
> +static const int prof_h264_high[]    = {AV_PROFILE_H264_BASELINE,
> +                                        AV_PROFILE_H264_CONSTRAINED_BASELINE,
>                                          AV_PROFILE_H264_MAIN,
>                                          AV_PROFILE_H264_HIGH,
>                                          AV_PROFILE_UNKNOWN};

Baseline is not compatible with main/high profile accelerators.
There is only one profile defined by DXVA2 that supports Baseline
completely, and I have never seen a GPU expose it - and we don't
support it.

- Hendrik


More information about the ffmpeg-devel mailing list