[FFmpeg-devel] [PATCH 16/17] hwcontext_vaapi: Move better-matching surface formats earlier

Jun Zhao mypopydev at gmail.com
Fri Nov 24 10:28:52 EET 2017



On 2017/11/24 8:51, Mark Thompson wrote:
> In particular, avoid selecting YV12/YV16 when I420/422H are available.
> ---
>  libavutil/hwcontext_vaapi.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
> index fcff25dc9b..2f47162a0d 100644
> --- a/libavutil/hwcontext_vaapi.c
> +++ b/libavutil/hwcontext_vaapi.c
> @@ -99,15 +99,15 @@ static const struct {
>      enum AVPixelFormat pix_fmt;
>  } vaapi_format_map[] = {
>      MAP(NV12, YUV420,  NV12),
> -    MAP(YV12, YUV420,  YUV420P), // With U/V planes swapped.
> -    MAP(IYUV, YUV420,  YUV420P),
>  #ifdef VA_FOURCC_I420
>      MAP(I420, YUV420,  YUV420P),
>  #endif
> +    MAP(YV12, YUV420,  YUV420P), // With U/V planes swapped.
> +    MAP(IYUV, YUV420,  YUV420P),
> +    MAP(422H, YUV422,  YUV422P),
Can we give a flag or other field to identify the map priority, not use
the hard code array index order ?     
>  #ifdef VA_FOURCC_YV16
>      MAP(YV16, YUV422,  YUV422P), // With U/V planes swapped.
>  #endif
> -    MAP(422H, YUV422,  YUV422P),
>      MAP(UYVY, YUV422,  UYVY422),
>      MAP(YUY2, YUV422,  YUYV422),
>      MAP(Y800, YUV400,  GRAY8),



More information about the ffmpeg-devel mailing list