[FFmpeg-devel] [PATCH 1/6] lavu/pixfmt: add new pixel format ayuv/y210/y410

Fu, Linjie linjie.fu at intel.com
Wed Sep 11 06:19:55 EEST 2019


> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
> Of Carl Eugen Hoyos
> Sent: Wednesday, September 11, 2019 03:25
> To: FFmpeg development discussions and patches <ffmpeg-
> devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 1/6] lavu/pixfmt: add new pixel format
> ayuv/y210/y410
> 
> Am Di., 10. Sept. 2019 um 18:08 Uhr schrieb Linjie Fu <linjie.fu at intel.com>:
> >
> > Add some packed pixel formats for hardware decode support
> > in VAAPI and QSV:
> >
> > 4:2:2 10 bit: Y210
> > 4:4:4  8 bit: AYUV
> > 4:4:4 10 bit: Y410
> 
> Please add a short explanation (either in the commit message or
> only in this thread) for which kind of samples these pixel formats
> are needed.
> 
> Or to say it differently: Why is the hardware outputting planar
> formats for some samples and packed for others?

I kind of remember that it was discussed in previous patch thread:
Previously, media driver provided planar format(like 420 8 bit),
but for HEVC Range Extension (422/444 8/10 bit), the decoded image
is produced in packed format. And the reason is " because Windows
expects it" as you have pointed.

It could be updated in the commit message if this is good enough.

> I see you added LE and BE versions: Why are both needed?
> And if they are needed, why is there only AYUV and not AYUV
> and VUYA?

I noticed LE and BE versions are added for some of the added pixel
format, out of the compatibility for big-endian and little-endian(IMHO).
And that's the reason I add it for Y210 and Y410. 

I'm not sure I understood it correctly, LE/BE version is necessary for
newly added pixel format right?

> > Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> > ---
> >  libavutil/pixdesc.c           | 62
> +++++++++++++++++++++++++++++++++++++++++++
> >  libavutil/pixfmt.h            |  9 +++++++
> >  libavutil/tests/pixfmt_best.c |  1 +
> >  libavutil/version.h           |  2 +-
> >  4 files changed, 73 insertions(+), 1 deletion(-)
> 
> > diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> > index d78e863..0176a2a 100644
> > --- a/libavutil/pixfmt.h
> > +++ b/libavutil/pixfmt.h
> > @@ -348,6 +348,12 @@ enum AVPixelFormat {
> >      AV_PIX_FMT_NV24,      ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1
> plane for the UV components, which are interleaved (first byte U and the
> following byte V)
> >      AV_PIX_FMT_NV42,      ///< as above, but U and V bytes are swapped
> >
> > +    AV_PIX_FMT_Y210BE,    ///< packed YUV 4:2:2, 32bpp, Y0 Cb Y1 Cr, big-
> endian
> > +    AV_PIX_FMT_Y210LE,    ///< packed YUV 4:2:2, 32bpp, Y0 Cb Y1 Cr, little-
> endian
> 
> I believe they are 16bpp.

Thanks for pointing out this, and since Y210 is a 10 bit 4:2:2 format, IMHO 20bpp
is expected information. (see AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp)

Regards,
linjie


More information about the ffmpeg-devel mailing list