[FFmpeg-devel] [PATCH] avutil: Add NV61 pixel format and enable IO support for NV16 and NV61 pixel formats
Cristian Bicheru
c.bicheru0 at gmail.com
Fri Jun 19 21:11:44 EEST 2020
On Fri, Jun 19, 2020 at 12:53 PM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>
> Am Fr., 19. Juni 2020 um 18:42 Uhr schrieb <c.bicheru0 at gmail.com>:
> >
> > From: Cristian Bicheru <c.bicheru0 at gmail.com>
> >
> > NV16 and NV61 are interleaved 4:2:2 8-bit formats. There was some internal
> > NV16 support prior to this patch but the pixel format was not publicly accessible.
>
> > diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> > index a46acf3..24b053c 100644
> > --- a/libavutil/pixfmt.h
> > +++ b/libavutil/pixfmt.h
> > @@ -199,6 +199,7 @@ enum AVPixelFormat {
> > AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0
> > AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0
> > AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
> > + AV_PIX_FMT_NV61, ///< as above, but U and V bytes are swapped
> > AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
> > AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
>
> You cannot add a pix_fmt in the middle of the list.
That makes sense, I'll fix that if it is agreed that the new pix_fmt
is necessary.
> Please explain (as thorough as possible) why the new pix_fmt is necessay.
I mainly added the new format for completion; I figured if we had NV16
we may as well support the swapped version. However it is a pretty
unpopular format so I can understand if it must be removed from the
patch. The VideoLAN wiki states that it has some uses in "funky cheap
camera circuitry" and I found that the .NET Core IoT libraries support
the format. But, it doesn't appear to have much use in comparison to
the rest of the NVXX pix_fmts.
> Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
On Fri, Jun 19, 2020 at 12:53 PM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>
> Am Fr., 19. Juni 2020 um 18:42 Uhr schrieb <c.bicheru0 at gmail.com>:
> >
> > From: Cristian Bicheru <c.bicheru0 at gmail.com>
> >
> > NV16 and NV61 are interleaved 4:2:2 8-bit formats. There was some internal
> > NV16 support prior to this patch but the pixel format was not publicly accessible.
>
> > diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> > index a46acf3..24b053c 100644
> > --- a/libavutil/pixfmt.h
> > +++ b/libavutil/pixfmt.h
> > @@ -199,6 +199,7 @@ enum AVPixelFormat {
> > AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0
> > AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0
> > AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
> > + AV_PIX_FMT_NV61, ///< as above, but U and V bytes are swapped
> > AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
> > AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
>
> You cannot add a pix_fmt in the middle of the list.
>
> Please explain (as thorough as possible) why the new pix_fmt is necessay.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list