media: visiting YUV tiled formats
Subsystems (7)
v2 cover media: visiting YUV tiled formats
This series started with the addition of the V4L2_PIX_FMT_NV12_4L4 pixel format.
Researching about tiled formats, we realized that V4L2_PIX_FMT_SUNXI_TILED_NV12 is actually a simple 32x32 linear tiled NV12, and also that so-called "HM12" is really a 16x16 linear tiled NV12.
Therefore, I decided to tackle the big picture as much as possible and aim at cleaning all the NV12 tiled pixel formats.
As you can expect, the current pixel formats are kept for userspace compatibility, but considered legacy in kernel code and deprecated.
The new nomenclatures for pixel formats is already being used in GStreamer, it's cleaner and less surprising.
v2:
* Also take care of HM12.
* Fix missing description for NV12_4L4.
* Clean V4L2_PIX_FMT_NV12MT further.
Ezequiel Garcia (4):
media: Rename V4L2_PIX_FMT_SUNXI_TILED_NV12 to V4L2_PIX_FMT_NV12_32L32
media: Rename V4L2_PIX_FMT_HM12 to V4L2_PIX_FMT_NV12_16L16
media: Add NV12_4L4 tiled format
media: Clean V4L2_PIX_FMT_NV12MT documentation
Documentation/admin-guide/media/ivtv.rst | 2 +- .../media/drivers/cx2341x-uapi.rst | 8 ++- .../media/v4l/pixfmt-reserved.rst | 22 -------- .../media/v4l/pixfmt-yuv-planar.rst | 50 +++++++++++++------ drivers/media/pci/cx18/cx18-ioctl.c | 4 +- drivers/media/pci/cx18/cx18-streams.c | 8 +-- drivers/media/pci/ivtv/ivtv-ioctl.c | 8 +-- .../platform/sunxi/sun6i-csi/sun6i_csi.c | 10 ++-- .../platform/sunxi/sun6i-csi/sun6i_csi.h | 2 +- .../platform/sunxi/sun6i-csi/sun6i_video.c | 2 +- drivers/media/v4l2-core/v4l2-common.c | 3 ++ drivers/media/v4l2-core/v4l2-ioctl.c | 5 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 2 +- .../staging/media/sunxi/cedrus/cedrus_hw.c | 2 +- .../staging/media/sunxi/cedrus/cedrus_video.c | 4 +- include/uapi/linux/videodev2.h | 19 +++++-- 16 files changed, 81 insertions(+), 70 deletions(-)
Signature · 1 line
2.32.0
PATCH v2 1/4 media: Rename V4L2_PIX_FMT_SUNXI_TILED_NV12 to V4L2_PIX_FMT_NV12_32L32
The V4L2_PIX_FMT_SUNXI_TILED_NV12 format is actually a fairly common NV12 tiled format, with 32x32 linear tiles. Rename the format and move its documentation together with the other tiled NV12 formats.
Keep V4L2_PIX_FMT_SUNXI_TILED_NV12 for application compatibility.
--- .../userspace-api/media/v4l/pixfmt-reserved.rst | 14 -------------- .../userspace-api/media/v4l/pixfmt-yuv-planar.rst | 13 ++++++++++--- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus_video.c | 4 ++-- include/uapi/linux/videodev2.h | 9 ++++++++- 7 files changed, 23 insertions(+), 23 deletions(-)
Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +0 -14
@@ -246,20 +246,6 @@ please make a proposal on the linux-media mailing list. It is an opaque intermediate format and the MDP hardware must be used to convert ``V4L2_PIX_FMT_MT21C`` to ``V4L2_PIX_FMT_NV12M``, ``V4L2_PIX_FMT_YUV420M`` or ``V4L2_PIX_FMT_YVU420``. - * .. _V4L2-PIX-FMT-SUNXI-TILED-NV12: - - - ``V4L2_PIX_FMT_SUNXI_TILED_NV12`` - - 'ST12' - - Two-planar NV12-based format used by the video engine found on Allwinner - (codenamed sunxi) platforms, with 32x32 tiles for the luminance plane - and 32x64 tiles for the chrominance plane. The data in each tile is - stored in linear order, within the tile bounds. Each tile follows the - previous one linearly in memory (from left to right, top to bottom). - - The associated buffer dimensions are aligned to match an integer number - of tiles, resulting in 32-aligned resolutions for the luminance plane - and 16-aligned resolutions for the chrominance plane (with 2x2 - subsampling). .. raw:: latex
Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +10 -3
@@ -254,14 +254,16 @@ of the luma plane. .. _V4L2-PIX-FMT-NV12MT: .. _V4L2-PIX-FMT-NV12MT-16X16: +.. _V4L2-PIX-FMT-NV12-32L32: -NV12MT and MV12MT_16X16 ------------------------ +Tiled NV12 +---------- Semi-planar YUV 4:2:0 formats, using macroblock tiling. The chroma plane is subsampled by 2 in each direction. Chroma lines contain half the number of pixels and the same number of bytes as luma lines, and the chroma plane -contains half the number of lines of the luma plane. +contains half the number of lines of the luma plane. Each tile follows the +previous one linearly in memory (from left to right, top to bottom). ``V4L2_PIX_FMT_NV12MT_16X16`` stores pixel in 2D 16x16 macroblocks, and stores macroblocks linearly in memory. The line stride and image height must be
@@ -276,6 +278,11 @@ If the vertical resolution is an odd number of macroblocks, the last row of macroblocks is stored in linear order. The layouts of the luma and chroma planes are identical. +``V4L2_PIX_FMT_NV12_32L32`` stores pixel in 32x32 tiles, and stores +tiles linearly in memory. The line stride and image height must be +aligned to a multiple of 32. The layouts of the luma and chroma planes are +identical. + .. _nv12mt: .. kernel-figure:: nv12mt.svg
drivers/media/v4l2-core/v4l2-ioctl.c +1 -1
@@ -1282,6 +1282,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_NV61 : descr ="Y/CrCb 4:2:2" ;break ;case V4L2_PIX_FMT_NV24 : descr ="Y/CbCr 4:4:4" ;break ;case V4L2_PIX_FMT_NV42 : descr ="Y/CrCb 4:4:4" ;break ; +case V4L2_PIX_FMT_NV12_32L32 : descr ="Y/CbCr 4:2:0 (32x32 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12M : descr ="Y/CbCr 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV21M : descr ="Y/CrCb 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV16M : descr ="Y/CbCr 4:2:2 (N-C)" ;break ;
@@ -1415,7 +1416,6 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_SE401 : descr ="GSPCA SE401" ;break ;case V4L2_PIX_FMT_S5C_UYVY_JPG : descr ="S5C73MX interleaved UYVY/JPEG" ;break ;case V4L2_PIX_FMT_MT21C : descr ="Mediatek Compressed Format" ;break ; -case V4L2_PIX_FMT_SUNXI_TILED_NV12 : descr ="Sunxi Tiled NV12 Format" ;break ;default :if (fmt->description[0 ])return ;
drivers/staging/media/sunxi/cedrus/cedrus.c +1 -1
@@ -282,7 +282,7 @@ static int cedrus_open(struct file *file) ret =PTR_ERR (ctx->fh.m2m_ctx); goto err_ctrls; } - ctx->dst_fmt.pixelformat =V4L2_PIX_FMT_SUNXI_TILED_NV12 ; + ctx->dst_fmt.pixelformat =V4L2_PIX_FMT_NV12_32L32 ;cedrus_prepare_format (&ctx->dst_fmt); ctx->src_fmt.pixelformat =V4L2_PIX_FMT_MPEG2_SLICE ;/*
drivers/staging/media/sunxi/cedrus/cedrus_hw.c +1 -1
@@ -99,7 +99,7 @@ void cedrus_dst_format_set(struct cedrus_dev *dev,cedrus_write (dev,VE_PRIMARY_FB_LINE_STRIDE , reg);break ; -case V4L2_PIX_FMT_SUNXI_TILED_NV12 : +case V4L2_PIX_FMT_NV12_32L32 :default : reg =VE_PRIMARY_OUT_FMT_TILED_32_NV12 ;cedrus_write (dev,VE_PRIMARY_OUT_FMT , reg);
drivers/staging/media/sunxi/cedrus/cedrus_video.c +2 -2
@@ -56,7 +56,7 @@ static struct cedrus_format cedrus_formats[] = { .capabilities = CEDRUS_CAPABILITY_VP8_DEC, }, { - .pixelformat = V4L2_PIX_FMT_SUNXI_TILED_NV12, + .pixelformat = V4L2_PIX_FMT_NV12_32L32, .directions = CEDRUS_DECODE_DST, }, {
@@ -124,7 +124,7 @@ void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt) sizeimage =max_t (u32,SZ_1K , sizeimage);break ; -case V4L2_PIX_FMT_SUNXI_TILED_NV12 : +case V4L2_PIX_FMT_NV12_32L32 :/* 32-aligned stride. */ bytesperline =ALIGN (width,32 );
include/uapi/linux/videodev2.h +8 -1
@@ -627,6 +627,9 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4')/* 24 YUV444 planar */ #define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2')/* 24 YVU444 planar */ +/* Tiled YUV formats */ +#define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 32x32 tiles */ +/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1')/* 8 BGBG.. GRGR.. */ #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G')/* 8 GBGB.. RGRG.. */
@@ -734,7 +737,6 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ')/* Depth data 16-bit */ #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1')/* Mediatek compressed block mode */ #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I')/* Intel Planar Greyscale 10-bit and Depth 16-bit */ -#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2')/* Sunxi Tiled NV12 Format */ #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4')/* Intel 4-bit packed depth confidence information */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4')/* BTTV 8-bit dithered RGB */
@@ -2615,4 +2617,9 @@ struct v4l2_create_buffers {#define BASE_VIDIOC_PRIVATE 192/* 192-255 are private */ +/* Deprecated definitions kept for backwards compatibility */ +#ifdef __KERNEL__ +#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2')/* Sunxi Tiled NV12 Format */ +#endif +#endif /* _UAPI__LINUX_VIDEODEV2_H */
Signature · 1 line
2.32.0
Re: [PATCH v2 1/4] media: Rename V4L2_PIX_FMT_SUNXI_TILED_NV12 to V4L2_PIX_FMT_NV12_32L32
Hi Ezequiel,
Some comments:
Quoted 83 lines · Ezequiel Garcia
The
V4L2_PIX_FMT_SUNXI_TILED_NV12format is actually a fairly common NV12 tiled format, with 32x32 linear tiles. Rename the format and move its documentation together with the other tiled NV12 formats.Keep
V4L2_PIX_FMT_SUNXI_TILED_NV12for application compatibility.Signed-off-by Ezequiel Garcia <[email protected]>--- .../userspace-api/media/v4l/pixfmt-reserved.rst | 14 -------------- .../userspace-api/media/v4l/pixfmt-yuv-planar.rst | 13 ++++++++++--- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus_video.c | 4 ++-- include/uapi/linux/videodev2.h | 9 ++++++++- 7 files changed, 23 insertions(+), 23 deletions(-)Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +0
-14@@ -246,20 +246,6 @@ please make a proposal on the linux-media mailing list. It is an opaque intermediate format and the MDP hardware must be used to convert ``V4L2_PIX_FMT_MT21C`` to ``V4L2_PIX_FMT_NV12M``, ``V4L2_PIX_FMT_YUV420M`` or ``V4L2_PIX_FMT_YVU420``. - * .. _V4L2-PIX-FMT-SUNXI-TILED-NV12: - - - ``V4L2_PIX_FMT_SUNXI_TILED_NV12`` - - 'ST12' - - Two-planar NV12-based format used by the video engine found on Allwinner - (codenamed sunxi) platforms, with 32x32 tiles for the luminance plane - and 32x64 tiles for the chrominance plane. The data in each tile is - stored in linear order, within the tile bounds. Each tile follows the - previous one linearly in memory (from left to right, top to bottom). - - The associated buffer dimensions are aligned to match an integer number - of tiles, resulting in 32-aligned resolutions for the luminance plane - and 16-aligned resolutions for the chrominance plane (with 2x2 - subsampling). .. raw:: latexDocumentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +10
-3@@ -254,14 +254,16 @@ of the luma plane. .. _V4L2-PIX-FMT-NV12MT: .. _V4L2-PIX-FMT-NV12MT-16X16: +.. _V4L2-PIX-FMT-NV12-32L32: -NV12MT and MV12MT_16X16 ------------------------ +Tiled NV12 +---------- Semi-planar YUV 4:2:0 formats, using macroblock tiling. The chroma plane is subsampled by 2 in each direction. Chroma lines contain half the number of pixels and the same number of bytes as luma lines, and the chroma plane -contains half the number of lines of the luma plane. +contains half the number of lines of the luma plane. Each tile follows the +previous one linearly in memory (from left to right, top to bottom). ``V4L2_PIX_FMT_NV12MT_16X16`` stores pixel in 2D 16x16 macroblocks, and stores macroblocks linearly in memory. The line stride and image height must be@@ -276,6 +278,11 @@ If the vertical resolution is an odd number of macroblocks, the last row of macroblocks is stored in linear order. The layouts of the luma and chroma planes are identical. +``V4L2_PIX_FMT_NV12_32L32`` stores pixel in 32x32 tiles, and stores +tiles linearly in memory. The line stride and image height must be +aligned to a multiple of 32. The layouts of the luma and chroma planes are +identical. + .. _nv12mt: .. kernel-figure:: nv12mt.svgdrivers/media/v4l2-core/v4l2-ioctl.c +0
-0
drivers/media/v4l2-core/v4l2-ioctl.c static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) · line 1285
Quoted 4 lines
drivers/media/v4l2-core/v4l2-ioctl.c +1
-0@@ -1282,6 +1282,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_NV61 : descr ="Y/CrCb 4:2:2" ;break ;case V4L2_PIX_FMT_NV24 : descr ="Y/CbCr 4:4:4" ;break ;case V4L2_PIX_FMT_NV42 : descr ="Y/CrCb 4:4:4" ;break ; +case V4L2_PIX_FMT_NV12_32L32 : descr ="Y/CbCr 4:2:0 (32x32 linear tiles)" ;break ;
This string is too long, more than 31 characters.
I suggest changing this to "Y/CbCr 4:2:0 (32x32 Linear)"
Quoted 82 lines
drivers/media/v4l2-core/v4l2-ioctl.c +0
-1case V4L2_PIX_FMT_NV12M : descr ="Y/CbCr 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV21M : descr ="Y/CrCb 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV16M : descr ="Y/CbCr 4:2:2 (N-C)" ;break ;@@ -1415,7 +1416,6 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_SE401 : descr ="GSPCA SE401" ;break ;case V4L2_PIX_FMT_S5C_UYVY_JPG : descr ="S5C73MX interleaved UYVY/JPEG" ;break ;case V4L2_PIX_FMT_MT21C : descr ="Mediatek Compressed Format" ;break ; -case V4L2_PIX_FMT_SUNXI_TILED_NV12 : descr ="Sunxi Tiled NV12 Format" ;break ;default :if (fmt->description[0 ])return ;drivers/staging/media/sunxi/cedrus/cedrus.c +1
-1@@ -282,7 +282,7 @@ static int cedrus_open(struct file *file) ret =PTR_ERR (ctx->fh.m2m_ctx); goto err_ctrls; } - ctx->dst_fmt.pixelformat =V4L2_PIX_FMT_SUNXI_TILED_NV12 ; + ctx->dst_fmt.pixelformat =V4L2_PIX_FMT_NV12_32L32 ;cedrus_prepare_format (&ctx->dst_fmt); ctx->src_fmt.pixelformat =V4L2_PIX_FMT_MPEG2_SLICE ;/* drivers/staging/media/sunxi/cedrus/cedrus_hw.c +1
-1@@ -99,7 +99,7 @@ void cedrus_dst_format_set(struct cedrus_dev *dev,cedrus_write (dev,VE_PRIMARY_FB_LINE_STRIDE , reg);break ; -case V4L2_PIX_FMT_SUNXI_TILED_NV12 : +case V4L2_PIX_FMT_NV12_32L32 :default : reg =VE_PRIMARY_OUT_FMT_TILED_32_NV12 ;cedrus_write (dev,VE_PRIMARY_OUT_FMT , reg);drivers/staging/media/sunxi/cedrus/cedrus_video.c +2
-2@@ -56,7 +56,7 @@ static struct cedrus_format cedrus_formats[] = { .capabilities = CEDRUS_CAPABILITY_VP8_DEC, }, { - .pixelformat = V4L2_PIX_FMT_SUNXI_TILED_NV12, + .pixelformat = V4L2_PIX_FMT_NV12_32L32, .directions = CEDRUS_DECODE_DST, }, {@@ -124,7 +124,7 @@ void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt) sizeimage =max_t (u32,SZ_1K , sizeimage);break ; -case V4L2_PIX_FMT_SUNXI_TILED_NV12 : +case V4L2_PIX_FMT_NV12_32L32 :/* 32-aligned stride. */ bytesperline =ALIGN (width,32 );include/uapi/linux/videodev2.h +3
-1@@ -627,6 +627,9 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4')/* 24 YUV444 planar */ #define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2')/* 24 YVU444 planar */ +/* Tiled YUV formats */ +#define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 32x32 tiles */ +/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1')/* 8 BGBG.. GRGR.. */ #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G')/* 8 GBGB.. RGRG.. */ @@ -734,7 +737,6 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ')/* Depth data 16-bit */ #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1')/* Mediatek compressed block mode */ #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I')/* Intel Planar Greyscale 10-bit and Depth 16-bit */ -#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2')/* Sunxi Tiled NV12 Format */ #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4')/* Intel 4-bit packed depth confidence information */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4')/* BTTV 8-bit dithered RGB */
include/uapi/linux/videodev2.h struct v4l2_create_buffers { · line 2621
Quoted 5 lines
include/uapi/linux/videodev2.h +2
-0@@ -2615,4 +2617,9 @@ struct v4l2_create_buffers {#define BASE_VIDIOC_PRIVATE 192/* 192-255 are private */ +/* Deprecated definitions kept for backwards compatibility */ +#ifdef __KERNEL__
Should be #ifndef
include/uapi/linux/videodev2.h struct v4l2_create_buffers { · line 2622
Quoted 1 line
include/uapi/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2')/* Sunxi Tiled NV12 Format */
Why not define this as:
#define V4L2_PIX_FMT_SUNXI_TILED_NV12 V4L2_PIX_FMT_NV12_32L32
That way it is clear that this is an alias.
Regards,
Hans
Quoted 4 lines
include/uapi/linux/videodev2.h +2
-0+#endif +#endif /* _UAPI__LINUX_VIDEODEV2_H */
PATCH v2 2/4 media: Rename V4L2_PIX_FMT_HM12 to V4L2_PIX_FMT_NV12_16L16
In reply to Ezequiel GarciaThe V4L2_PIX_FMT_HM12 format is actually a simple NV12 tiled format, with 16x16 linear tiles. Rename the format and move its documentation together with the other tiled NV12 formats.
Keep V4L2_PIX_FMT_HM12 for application compatibility.
--- Documentation/admin-guide/media/ivtv.rst | 2 +- .../userspace-api/media/drivers/cx2341x-uapi.rst | 8 +++----- .../userspace-api/media/v4l/pixfmt-reserved.rst | 8 -------- .../userspace-api/media/v4l/pixfmt-yuv-planar.rst | 6 ++++++ drivers/media/pci/cx18/cx18-ioctl.c | 4 ++-- drivers/media/pci/cx18/cx18-streams.c | 8 ++++---- drivers/media/pci/ivtv/ivtv-ioctl.c | 8 ++++---- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 10 +++++----- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h | 2 +- drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- include/uapi/linux/videodev2.h | 3 ++- 12 files changed, 30 insertions(+), 33 deletions(-)
Documentation/admin-guide/media/ivtv.rst +1 -1
@@ -159,7 +159,7 @@ whatever). Otherwise the device numbers can get confusing. The ivtv Read-only The raw YUV video output from the current video input. The YUV format - is non-standard (V4L2_PIX_FMT_HM12). + is a 16x16 linear tiled NV12 format (V4L2_PIX_FMT_NV12_16L16) Note that the YUV and PCM streams are not synchronized, so they are of limited use.
Documentation/userspace-api/media/drivers/cx2341x-uapi.rst +3 -5
@@ -7,9 +7,7 @@ Non-compressed file format -------------------------- The cx23416 can produce (and the cx23415 can also read) raw YUV output. The -format of a YUV frame is specific to this chip and is called HM12. 'HM' stands -for 'Hauppauge Macroblock', which is a misnomer as 'Conexant Macroblock' would -be more accurate. +format of a YUV frame is 16x16 linear tiled NV12 (V4L2_PIX_FMT_NV12_16L16). The format is YUV 4:2:0 which uses 1 Y byte per pixel and 1 U and V byte per four pixels.
@@ -34,8 +32,8 @@ second line of 8 UV pairs of the top-left block, etc. After transmitting this block the first line of the block on the right to the first block is transmitted, etc. -The code below is given as an example on how to convert HM12 to separate -Y, U and V planes. This code assumes frames of 720x576 (PAL) pixels. +The code below is given as an example on how to convert V4L2_PIX_FMT_NV12_16L16 +to separate Y, U and V planes. This code assumes frames of 720x576 (PAL) pixels. The width of a frame is always 720 pixels, regardless of the actual specified width.
Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +0 -8
@@ -48,14 +48,6 @@ please make a proposal on the linux-media mailing list. - ``V4L2_PIX_FMT_HI240`` - 'HI24' - 8 bit RGB format used by the BTTV driver. - * .. _V4L2-PIX-FMT-HM12: - - - ``V4L2_PIX_FMT_HM12`` - - 'HM12' - - YUV 4:2:0 format used by the IVTV driver. - - The format is documented in the kernel sources in the file - ``Documentation/userspace-api/media/drivers/cx2341x-uapi.rst`` * .. _V4L2-PIX-FMT-CPIA1: - ``V4L2_PIX_FMT_CPIA1``
Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +6 -0
@@ -254,6 +254,7 @@ of the luma plane. .. _V4L2-PIX-FMT-NV12MT: .. _V4L2-PIX-FMT-NV12MT-16X16: +.. _V4L2-PIX-FMT-NV12-16L16: .. _V4L2-PIX-FMT-NV12-32L32: Tiled NV12
@@ -278,6 +279,11 @@ If the vertical resolution is an odd number of macroblocks, the last row of macroblocks is stored in linear order. The layouts of the luma and chroma planes are identical. +``V4L2_PIX_FMT_NV12_16L16`` stores pixel in 16x16 tiles, and stores +tiles linearly in memory. The line stride and image height must be +aligned to a multiple of 16. The layouts of the luma and chroma planes are +identical. + ``V4L2_PIX_FMT_NV12_32L32`` stores pixel in 32x32 tiles, and stores tiles linearly in memory. The line stride and image height must be aligned to a multiple of 32. The layouts of the luma and chroma planes are
drivers/media/pci/cx18/cx18-ioctl.c +2 -2
@@ -276,7 +276,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh, s->pixelformat = fmt->fmt.pix.pixelformat;/* HM12 YUV size is (Y=(h*720) + UV=(h*(720/2))) UYUV YUV size is (Y=(h*720) + UV=(h*(720))) */ -if (s->pixelformat ==V4L2_PIX_FMT_HM12 ) { +if (s->pixelformat ==V4L2_PIX_FMT_NV12_16L16 ) { s->vb_bytes_per_frame = h *720 *3 /2 ; s->vb_bytes_per_line =720 ;/* First plane */ }else {
@@ -470,7 +470,7 @@ static int cx18_enum_fmt_vid_cap(struct file *file, void *fh, .index = 0, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, .description = "HM12 (YUV 4:1:1)", - .pixelformat = V4L2_PIX_FMT_HM12, + .pixelformat = V4L2_PIX_FMT_NV12_16L16, }, { .index = 1,
drivers/media/pci/cx18/cx18-streams.c +4 -4
@@ -133,7 +133,7 @@ static int cx18_prepare_buffer(struct videobuf_queue *q,/* HM12 YUV size is (Y=(h*720) + UV=(h*(720/2))) UYUV YUV size is (Y=(h*720) + UV=(h*(720))) */ -if (s->pixelformat ==V4L2_PIX_FMT_HM12 ) +if (s->pixelformat ==V4L2_PIX_FMT_NV12_16L16 ) s->vb_bytes_per_frame = height *720 *3 /2 ;else s->vb_bytes_per_frame = height *720 *2 ;
@@ -155,7 +155,7 @@ static int cx18_prepare_buffer(struct videobuf_queue *q,/* HM12 YUV size is (Y=(h*720) + UV=(h*(720/2))) UYUV YUV size is (Y=(h*720) + UV=(h*(720))) */ -if (s->pixelformat ==V4L2_PIX_FMT_HM12 ) +if (s->pixelformat ==V4L2_PIX_FMT_NV12_16L16 ) s->vb_bytes_per_frame = height *720 *3 /2 ;else s->vb_bytes_per_frame = height *720 *2 ;
@@ -287,7 +287,7 @@ static void cx18_stream_init(struct cx18 *cx, int type) s, &cx->serialize_lock);/* Assume the previous pixel default */ - s->pixelformat =V4L2_PIX_FMT_HM12 ; + s->pixelformat =V4L2_PIX_FMT_NV12_16L16 ; s->vb_bytes_per_frame = cx->cxhdl.height *720 *3 /2 ; s->vb_bytes_per_line =720 ; }
@@ -733,7 +733,7 @@ static void cx18_stream_configure_mdls(struct cx18_stream *s)* Set the MDL size to the exact size needed for one frame. * Use enough buffers per MDL to cover the MDL size */ -if (s->pixelformat ==V4L2_PIX_FMT_HM12 ) +if (s->pixelformat ==V4L2_PIX_FMT_NV12_16L16 ) s->mdl_size =720 * s->cx->cxhdl.height *3 /2 ;else s->mdl_size =720 * s->cx->cxhdl.height *2 ;
drivers/media/pci/ivtv/ivtv-ioctl.c +4 -4
@@ -339,7 +339,7 @@ static int ivtv_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f pixfmt->colorspace =V4L2_COLORSPACE_SMPTE170M ; pixfmt->field =V4L2_FIELD_INTERLACED ;if (id->type ==IVTV_ENC_STREAM_TYPE_YUV ) { - pixfmt->pixelformat =V4L2_PIX_FMT_HM12 ; + pixfmt->pixelformat =V4L2_PIX_FMT_NV12_16L16 ;/* YUV size is (Y=(h*720) + UV=(h*(720/2))) */ pixfmt->sizeimage = pixfmt->height *720 *3 /2 ; pixfmt->bytesperline =720 ;
@@ -417,7 +417,7 @@ static int ivtv_g_fmt_vid_out(struct file *file, void *fh, struct v4l2_format *f pixfmt->field =V4L2_FIELD_ANY ;break ; } - pixfmt->pixelformat =V4L2_PIX_FMT_HM12 ; + pixfmt->pixelformat =V4L2_PIX_FMT_NV12_16L16 ; pixfmt->bytesperline =720 ; pixfmt->width = itv->yuv_info.v4l2_src_w; pixfmt->height = itv->yuv_info.v4l2_src_h;
@@ -917,7 +917,7 @@ static int ivtv_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesstatic const struct v4l2_fmtdesc hm12 = { .type =V4L2_BUF_TYPE_VIDEO_CAPTURE , .description ="HM12 (YUV 4:2:0)" , - .pixelformat =V4L2_PIX_FMT_HM12 , + .pixelformat =V4L2_PIX_FMT_NV12_16L16 , };static const struct v4l2_fmtdesc mpeg = { .type =V4L2_BUF_TYPE_VIDEO_CAPTURE ,
@@ -944,7 +944,7 @@ static int ivtv_enum_fmt_vid_out(struct file *file, void *fh, struct v4l2_fmtdesstatic const struct v4l2_fmtdesc hm12 = { .type =V4L2_BUF_TYPE_VIDEO_OUTPUT , .description ="HM12 (YUV 4:2:0)" , - .pixelformat =V4L2_PIX_FMT_HM12 , + .pixelformat =V4L2_PIX_FMT_NV12_16L16 , };static const struct v4l2_fmtdesc mpeg = { .type =V4L2_BUF_TYPE_VIDEO_OUTPUT ,
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +5 -5
@@ -61,7 +61,7 @@ bool sun6i_csi_is_format_supported(struct sun6i_csi *csi, || sdev->csi.v4l2_ep.bus_type == V4L2_MBUS_BT656) && sdev->csi.v4l2_ep.bus.parallel.bus_width == 16) {switch (pixformat) { -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV21 :case V4L2_PIX_FMT_NV16 :
@@ -124,7 +124,7 @@ bool sun6i_csi_is_format_supported(struct sun6i_csi *csi,case V4L2_PIX_FMT_VYUY :return (mbus_code ==MEDIA_BUS_FMT_VYUY8_2X8 ); -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV21 :case V4L2_PIX_FMT_NV16 :
@@ -269,7 +269,7 @@ static enum csi_output_fmt get_csi_output_format(struct sun6i_csi_dev *sdev,case V4L2_PIX_FMT_VYUY :return buf_interlaced ?CSI_FRAME_RAW_8 :CSI_FIELD_RAW_8 ; -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :return buf_interlaced ?CSI_FRAME_MB_YUV420 :CSI_FIELD_MB_YUV420 ;case V4L2_PIX_FMT_NV12 :
@@ -311,7 +311,7 @@ static enum csi_input_seq get_csi_input_seq(struct sun6i_csi_dev *sdev,return 0 ;switch (pixformat) { -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV16 :case V4L2_PIX_FMT_YUV420 :
@@ -526,7 +526,7 @@ static void sun6i_csi_set_window(struct sun6i_csi_dev *sdev) planar_offset[0 ] =0 ;switch (config->pixelformat) { -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV21 :case V4L2_PIX_FMT_NV16 :
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h +1 -1
@@ -105,7 +105,7 @@ static inline int sun6i_csi_get_bpp(unsigned int pixformat)case V4L2_PIX_FMT_SGBRG12 :case V4L2_PIX_FMT_SGRBG12 :case V4L2_PIX_FMT_SRGGB12 : -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV21 :case V4L2_PIX_FMT_YUV420 :
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c +1 -1
@@ -48,7 +48,7 @@ static const u32 supported_pixformats[] = {V4L2_PIX_FMT_YVYU ,V4L2_PIX_FMT_UYVY ,V4L2_PIX_FMT_VYUY , -V4L2_PIX_FMT_HM12 , +V4L2_PIX_FMT_NV12_16L16 ,V4L2_PIX_FMT_NV12 ,V4L2_PIX_FMT_NV21 , V4L2_PIX_FMT_YUV420,
drivers/media/v4l2-core/v4l2-ioctl.c +1 -1
@@ -1274,7 +1274,6 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_YUV410 : descr ="Planar YUV 4:1:0" ;break ;case V4L2_PIX_FMT_YUV420 : descr ="Planar YUV 4:2:0" ;break ;case V4L2_PIX_FMT_HI240 : descr ="8-bit Dithered RGB (BTTV)" ;break ; -case V4L2_PIX_FMT_HM12 : descr ="YUV 4:2:0 (16x16 Macroblocks)" ;break ;case V4L2_PIX_FMT_M420 : descr ="YUV 4:2:0 (M420)" ;break ;case V4L2_PIX_FMT_NV12 : descr ="Y/CbCr 4:2:0" ;break ;case V4L2_PIX_FMT_NV21 : descr ="Y/CrCb 4:2:0" ;break ;
@@ -1282,6 +1281,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_NV61 : descr ="Y/CrCb 4:2:2" ;break ;case V4L2_PIX_FMT_NV24 : descr ="Y/CbCr 4:4:4" ;break ;case V4L2_PIX_FMT_NV42 : descr ="Y/CrCb 4:4:4" ;break ; +case V4L2_PIX_FMT_NV12_16L16 : descr ="Y/CbCr 4:2:0 (16x16 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12_32L32 : descr ="Y/CbCr 4:2:0 (32x32 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12M : descr ="Y/CbCr 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV21M : descr ="Y/CrCb 4:2:0 (N-C)" ;break ;
include/uapi/linux/videodev2.h +2 -1
@@ -601,7 +601,6 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1')/* 16 Y/CrCb 4:2:2 */ #define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4')/* 24 Y/CbCr 4:4:4 */ #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2')/* 24 Y/CrCb 4:4:4 */ -#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2')/* 8 YUV 4:2:0 16x16 macroblocks */ /* two non contiguous planes - one Y, one Cr + Cb interleaved */ #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 */
@@ -628,6 +627,7 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2')/* 24 YVU444 planar */ /* Tiled YUV formats */ +#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 16x16 tiles */ #define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 32x32 tiles */ /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
@@ -2619,6 +2619,7 @@ struct v4l2_create_buffers {/* Deprecated definitions kept for backwards compatibility */ #ifdef __KERNEL__ +#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2')/* 8 YUV 4:2:0 16x16 macroblocks */ #define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2')/* Sunxi Tiled NV12 Format */ #endif
Signature · 1 line
2.32.0
Re: [PATCH v2 2/4] media: Rename V4L2_PIX_FMT_HM12 to V4L2_PIX_FMT_NV12_16L16
Hi Ezequiel,
The same comments as for the previous patch apply here as well.
I also think it will be good if v4l-utils is updated to use the new define rather than V4L2_PIX_FMT_HM12. A patch changing that would be useful.
Regards,
Hans
Quoted 330 lines · Ezequiel Garcia
The
V4L2_PIX_FMT_HM12format is actually a simple NV12 tiled format, with 16x16 linear tiles. Rename the format and move its documentation together with the other tiled NV12 formats.Keep
V4L2_PIX_FMT_HM12for application compatibility.Signed-off-by Ezequiel Garcia <[email protected]>--- Documentation/admin-guide/media/ivtv.rst | 2 +- .../userspace-api/media/drivers/cx2341x-uapi.rst | 8 +++----- .../userspace-api/media/v4l/pixfmt-reserved.rst | 8 -------- .../userspace-api/media/v4l/pixfmt-yuv-planar.rst | 6 ++++++ drivers/media/pci/cx18/cx18-ioctl.c | 4 ++-- drivers/media/pci/cx18/cx18-streams.c | 8 ++++---- drivers/media/pci/ivtv/ivtv-ioctl.c | 8 ++++---- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 10 +++++----- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h | 2 +- drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- include/uapi/linux/videodev2.h | 3 ++- 12 files changed, 30 insertions(+), 33 deletions(-)Documentation/admin-guide/media/ivtv.rst +1
-1@@ -159,7 +159,7 @@ whatever). Otherwise the device numbers can get confusing. The ivtv Read-only The raw YUV video output from the current video input. The YUV format - is non-standard (V4L2_PIX_FMT_HM12). + is a 16x16 linear tiled NV12 format (V4L2_PIX_FMT_NV12_16L16) Note that the YUV and PCM streams are not synchronized, so they are of limited use.Documentation/userspace-api/media/drivers/cx2341x-uapi.rst +3
-5@@ -7,9 +7,7 @@ Non-compressed file format -------------------------- The cx23416 can produce (and the cx23415 can also read) raw YUV output. The -format of a YUV frame is specific to this chip and is called HM12. 'HM' stands -for 'Hauppauge Macroblock', which is a misnomer as 'Conexant Macroblock' would -be more accurate. +format of a YUV frame is 16x16 linear tiled NV12 (V4L2_PIX_FMT_NV12_16L16). The format is YUV 4:2:0 which uses 1 Y byte per pixel and 1 U and V byte per four pixels.@@ -34,8 +32,8 @@ second line of 8 UV pairs of the top-left block, etc. After transmitting this block the first line of the block on the right to the first block is transmitted, etc. -The code below is given as an example on how to convert HM12 to separate -Y, U and V planes. This code assumes frames of 720x576 (PAL) pixels. +The code below is given as an example on how to convert V4L2_PIX_FMT_NV12_16L16 +to separate Y, U and V planes. This code assumes frames of 720x576 (PAL) pixels. The width of a frame is always 720 pixels, regardless of the actual specified width.Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +0
-8@@ -48,14 +48,6 @@ please make a proposal on the linux-media mailing list. - ``V4L2_PIX_FMT_HI240`` - 'HI24' - 8 bit RGB format used by the BTTV driver. - * .. _V4L2-PIX-FMT-HM12: - - - ``V4L2_PIX_FMT_HM12`` - - 'HM12' - - YUV 4:2:0 format used by the IVTV driver. - - The format is documented in the kernel sources in the file - ``Documentation/userspace-api/media/drivers/cx2341x-uapi.rst`` * .. _V4L2-PIX-FMT-CPIA1: - ``V4L2_PIX_FMT_CPIA1``Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +6
-0@@ -254,6 +254,7 @@ of the luma plane. .. _V4L2-PIX-FMT-NV12MT: .. _V4L2-PIX-FMT-NV12MT-16X16: +.. _V4L2-PIX-FMT-NV12-16L16: .. _V4L2-PIX-FMT-NV12-32L32: Tiled NV12@@ -278,6 +279,11 @@ If the vertical resolution is an odd number of macroblocks, the last row of macroblocks is stored in linear order. The layouts of the luma and chroma planes are identical. +``V4L2_PIX_FMT_NV12_16L16`` stores pixel in 16x16 tiles, and stores +tiles linearly in memory. The line stride and image height must be +aligned to a multiple of 16. The layouts of the luma and chroma planes are +identical. + ``V4L2_PIX_FMT_NV12_32L32`` stores pixel in 32x32 tiles, and stores tiles linearly in memory. The line stride and image height must be aligned to a multiple of 32. The layouts of the luma and chroma planes aredrivers/media/pci/cx18/cx18-ioctl.c +2
-2@@ -276,7 +276,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh, s->pixelformat = fmt->fmt.pix.pixelformat;/* HM12 YUV size is (Y=(h*720) + UV=(h*(720/2))) UYUV YUV size is (Y=(h*720) + UV=(h*(720))) */ -if (s->pixelformat ==V4L2_PIX_FMT_HM12 ) { +if (s->pixelformat ==V4L2_PIX_FMT_NV12_16L16 ) { s->vb_bytes_per_frame = h *720 *3 /2 ; s->vb_bytes_per_line =720 ;/* First plane */ }else {@@ -470,7 +470,7 @@ static int cx18_enum_fmt_vid_cap(struct file *file, void *fh, .index = 0, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, .description = "HM12 (YUV 4:1:1)", - .pixelformat = V4L2_PIX_FMT_HM12, + .pixelformat = V4L2_PIX_FMT_NV12_16L16, }, { .index = 1,drivers/media/pci/cx18/cx18-streams.c +4
-4@@ -133,7 +133,7 @@ static int cx18_prepare_buffer(struct videobuf_queue *q,/* HM12 YUV size is (Y=(h*720) + UV=(h*(720/2))) UYUV YUV size is (Y=(h*720) + UV=(h*(720))) */ -if (s->pixelformat ==V4L2_PIX_FMT_HM12 ) +if (s->pixelformat ==V4L2_PIX_FMT_NV12_16L16 ) s->vb_bytes_per_frame = height *720 *3 /2 ;else s->vb_bytes_per_frame = height *720 *2 ;@@ -155,7 +155,7 @@ static int cx18_prepare_buffer(struct videobuf_queue *q,/* HM12 YUV size is (Y=(h*720) + UV=(h*(720/2))) UYUV YUV size is (Y=(h*720) + UV=(h*(720))) */ -if (s->pixelformat ==V4L2_PIX_FMT_HM12 ) +if (s->pixelformat ==V4L2_PIX_FMT_NV12_16L16 ) s->vb_bytes_per_frame = height *720 *3 /2 ;else s->vb_bytes_per_frame = height *720 *2 ;@@ -287,7 +287,7 @@ static void cx18_stream_init(struct cx18 *cx, int type) s, &cx->serialize_lock);/* Assume the previous pixel default */ - s->pixelformat =V4L2_PIX_FMT_HM12 ; + s->pixelformat =V4L2_PIX_FMT_NV12_16L16 ; s->vb_bytes_per_frame = cx->cxhdl.height *720 *3 /2 ; s->vb_bytes_per_line =720 ; }@@ -733,7 +733,7 @@ static void cx18_stream_configure_mdls(struct cx18_stream *s)* Set the MDL size to the exact size needed for one frame. * Use enough buffers per MDL to cover the MDL size */ -if (s->pixelformat ==V4L2_PIX_FMT_HM12 ) +if (s->pixelformat ==V4L2_PIX_FMT_NV12_16L16 ) s->mdl_size =720 * s->cx->cxhdl.height *3 /2 ;else s->mdl_size =720 * s->cx->cxhdl.height *2 ;drivers/media/pci/ivtv/ivtv-ioctl.c +4
-4@@ -339,7 +339,7 @@ static int ivtv_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f pixfmt->colorspace =V4L2_COLORSPACE_SMPTE170M ; pixfmt->field =V4L2_FIELD_INTERLACED ;if (id->type ==IVTV_ENC_STREAM_TYPE_YUV ) { - pixfmt->pixelformat =V4L2_PIX_FMT_HM12 ; + pixfmt->pixelformat =V4L2_PIX_FMT_NV12_16L16 ;/* YUV size is (Y=(h*720) + UV=(h*(720/2))) */ pixfmt->sizeimage = pixfmt->height *720 *3 /2 ; pixfmt->bytesperline =720 ;@@ -417,7 +417,7 @@ static int ivtv_g_fmt_vid_out(struct file *file, void *fh, struct v4l2_format *f pixfmt->field =V4L2_FIELD_ANY ;break ; } - pixfmt->pixelformat =V4L2_PIX_FMT_HM12 ; + pixfmt->pixelformat =V4L2_PIX_FMT_NV12_16L16 ; pixfmt->bytesperline =720 ; pixfmt->width = itv->yuv_info.v4l2_src_w; pixfmt->height = itv->yuv_info.v4l2_src_h;@@ -917,7 +917,7 @@ static int ivtv_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesstatic const struct v4l2_fmtdesc hm12 = { .type =V4L2_BUF_TYPE_VIDEO_CAPTURE , .description ="HM12 (YUV 4:2:0)" , - .pixelformat =V4L2_PIX_FMT_HM12 , + .pixelformat =V4L2_PIX_FMT_NV12_16L16 , };static const struct v4l2_fmtdesc mpeg = { .type =V4L2_BUF_TYPE_VIDEO_CAPTURE ,@@ -944,7 +944,7 @@ static int ivtv_enum_fmt_vid_out(struct file *file, void *fh, struct v4l2_fmtdesstatic const struct v4l2_fmtdesc hm12 = { .type =V4L2_BUF_TYPE_VIDEO_OUTPUT , .description ="HM12 (YUV 4:2:0)" , - .pixelformat =V4L2_PIX_FMT_HM12 , + .pixelformat =V4L2_PIX_FMT_NV12_16L16 , };static const struct v4l2_fmtdesc mpeg = { .type =V4L2_BUF_TYPE_VIDEO_OUTPUT ,drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +5
-5@@ -61,7 +61,7 @@ bool sun6i_csi_is_format_supported(struct sun6i_csi *csi, || sdev->csi.v4l2_ep.bus_type == V4L2_MBUS_BT656) && sdev->csi.v4l2_ep.bus.parallel.bus_width == 16) {switch (pixformat) { -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV21 :case V4L2_PIX_FMT_NV16 :@@ -124,7 +124,7 @@ bool sun6i_csi_is_format_supported(struct sun6i_csi *csi,case V4L2_PIX_FMT_VYUY :return (mbus_code ==MEDIA_BUS_FMT_VYUY8_2X8 ); -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV21 :case V4L2_PIX_FMT_NV16 :@@ -269,7 +269,7 @@ static enum csi_output_fmt get_csi_output_format(struct sun6i_csi_dev *sdev,case V4L2_PIX_FMT_VYUY :return buf_interlaced ?CSI_FRAME_RAW_8 :CSI_FIELD_RAW_8 ; -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :return buf_interlaced ?CSI_FRAME_MB_YUV420 :CSI_FIELD_MB_YUV420 ;case V4L2_PIX_FMT_NV12 :@@ -311,7 +311,7 @@ static enum csi_input_seq get_csi_input_seq(struct sun6i_csi_dev *sdev,return 0 ;switch (pixformat) { -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV16 :case V4L2_PIX_FMT_YUV420 :@@ -526,7 +526,7 @@ static void sun6i_csi_set_window(struct sun6i_csi_dev *sdev) planar_offset[0 ] =0 ;switch (config->pixelformat) { -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV21 :case V4L2_PIX_FMT_NV16 :drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h +1
-1@@ -105,7 +105,7 @@ static inline int sun6i_csi_get_bpp(unsigned int pixformat)case V4L2_PIX_FMT_SGBRG12 :case V4L2_PIX_FMT_SGRBG12 :case V4L2_PIX_FMT_SRGGB12 : -case V4L2_PIX_FMT_HM12 : +case V4L2_PIX_FMT_NV12_16L16 :case V4L2_PIX_FMT_NV12 :case V4L2_PIX_FMT_NV21 :case V4L2_PIX_FMT_YUV420 :drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c +1
-1@@ -48,7 +48,7 @@ static const u32 supported_pixformats[] = {V4L2_PIX_FMT_YVYU ,V4L2_PIX_FMT_UYVY ,V4L2_PIX_FMT_VYUY , -V4L2_PIX_FMT_HM12 , +V4L2_PIX_FMT_NV12_16L16 ,V4L2_PIX_FMT_NV12 ,V4L2_PIX_FMT_NV21 , V4L2_PIX_FMT_YUV420,drivers/media/v4l2-core/v4l2-ioctl.c +1
-1@@ -1274,7 +1274,6 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_YUV410 : descr ="Planar YUV 4:1:0" ;break ;case V4L2_PIX_FMT_YUV420 : descr ="Planar YUV 4:2:0" ;break ;case V4L2_PIX_FMT_HI240 : descr ="8-bit Dithered RGB (BTTV)" ;break ; -case V4L2_PIX_FMT_HM12 : descr ="YUV 4:2:0 (16x16 Macroblocks)" ;break ;case V4L2_PIX_FMT_M420 : descr ="YUV 4:2:0 (M420)" ;break ;case V4L2_PIX_FMT_NV12 : descr ="Y/CbCr 4:2:0" ;break ;case V4L2_PIX_FMT_NV21 : descr ="Y/CrCb 4:2:0" ;break ;@@ -1282,6 +1281,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_NV61 : descr ="Y/CrCb 4:2:2" ;break ;case V4L2_PIX_FMT_NV24 : descr ="Y/CbCr 4:4:4" ;break ;case V4L2_PIX_FMT_NV42 : descr ="Y/CrCb 4:4:4" ;break ; +case V4L2_PIX_FMT_NV12_16L16 : descr ="Y/CbCr 4:2:0 (16x16 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12_32L32 : descr ="Y/CbCr 4:2:0 (32x32 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12M : descr ="Y/CbCr 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV21M : descr ="Y/CrCb 4:2:0 (N-C)" ;break ;include/uapi/linux/videodev2.h +2
-1@@ -601,7 +601,6 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1')/* 16 Y/CrCb 4:2:2 */ #define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4')/* 24 Y/CbCr 4:4:4 */ #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2')/* 24 Y/CrCb 4:4:4 */ -#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2')/* 8 YUV 4:2:0 16x16 macroblocks */ /* two non contiguous planes - one Y, one Cr + Cb interleaved */ #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 */ @@ -628,6 +627,7 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2')/* 24 YVU444 planar */ /* Tiled YUV formats */ +#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 16x16 tiles */ #define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 32x32 tiles */ /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ @@ -2619,6 +2619,7 @@ struct v4l2_create_buffers {/* Deprecated definitions kept for backwards compatibility */ #ifdef __KERNEL__ +#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2')/* 8 YUV 4:2:0 16x16 macroblocks */ #define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2')/* Sunxi Tiled NV12 Format */ #endif
PATCH v2 3/4 media: Add NV12_4L4 tiled format
In reply to Ezequiel GarciaThis format is produced by VeriSilicon Hantro G2 and VC8000D cores. It is a simple 4x4 tiling layout in a linear way.
The pixel format was introduced by GStreamer using FourCC VT12, so let's stick to it.
--- Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst | 6 ++++++ drivers/media/v4l2-core/v4l2-common.c | 3 +++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 4 files changed, 11 insertions(+)
Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +6 -0
@@ -254,6 +254,7 @@ of the luma plane. .. _V4L2-PIX-FMT-NV12MT: .. _V4L2-PIX-FMT-NV12MT-16X16: +.. _V4L2-PIX-FMT-NV12-4L4: .. _V4L2-PIX-FMT-NV12-16L16: .. _V4L2-PIX-FMT-NV12-32L32:
@@ -279,6 +280,11 @@ If the vertical resolution is an odd number of macroblocks, the last row of macroblocks is stored in linear order. The layouts of the luma and chroma planes are identical. +``V4L2_PIX_FMT_NV12_4L4`` stores pixel in 4x4 tiles, and stores +tiles linearly in memory. The line stride and image height must be +aligned to a multiple of 4. The layouts of the luma and chroma planes are +identical. + ``V4L2_PIX_FMT_NV12_16L16`` stores pixel in 16x16 tiles, and stores tiles linearly in memory. The line stride and image height must be aligned to a multiple of 16. The layouts of the luma and chroma planes are
drivers/media/v4l2-core/v4l2-common.c +3 -0
@@ -275,6 +275,9 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) { .format = V4L2_PIX_FMT_YUV422P, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 2, .vdiv = 1 }, { .format = V4L2_PIX_FMT_GREY, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .hdiv = 1, .vdiv = 1 }, + /* Tiled YUV formats */ + { .format = V4L2_PIX_FMT_NV12_4L4, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 2, .vdiv = 2 }, + /* YUV planar formats, non contiguous variant */ { .format = V4L2_PIX_FMT_YUV420M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 2, .vdiv = 2 }, { .format = V4L2_PIX_FMT_YVU420M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 2, .vdiv = 2 },
drivers/media/v4l2-core/v4l2-ioctl.c +1 -0
@@ -1281,6 +1281,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_NV61 : descr ="Y/CrCb 4:2:2" ;break ;case V4L2_PIX_FMT_NV24 : descr ="Y/CbCr 4:4:4" ;break ;case V4L2_PIX_FMT_NV42 : descr ="Y/CrCb 4:4:4" ;break ; +case V4L2_PIX_FMT_NV12_4L4 : descr ="Y/CbCr 4:2:0 (4x4 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12_16L16 : descr ="Y/CbCr 4:2:0 (16x16 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12_32L32 : descr ="Y/CbCr 4:2:0 (32x32 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12M : descr ="Y/CbCr 4:2:0 (N-C)" ;break ;
include/uapi/linux/videodev2.h +1 -0
@@ -627,6 +627,7 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2')/* 24 YVU444 planar */ /* Tiled YUV formats */ +#define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 4x4 tiles */ #define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 16x16 tiles */ #define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 32x32 tiles */
Signature · 1 line
2.32.0
Re: [PATCH v2 3/4] media: Add NV12_4L4 tiled format
Quoted 58 lines · Ezequiel Garcia
This format is produced by VeriSilicon Hantro G2 and VC8000D cores. It is a simple 4x4 tiling layout in a linear way.
The pixel format was introduced by GStreamer using FourCC VT12, so let's stick to it.
Signed-off-by Ezequiel Garcia <[email protected]>--- Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst | 6 ++++++ drivers/media/v4l2-core/v4l2-common.c | 3 +++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 4 files changed, 11 insertions(+)Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +6
-0@@ -254,6 +254,7 @@ of the luma plane. .. _V4L2-PIX-FMT-NV12MT: .. _V4L2-PIX-FMT-NV12MT-16X16: +.. _V4L2-PIX-FMT-NV12-4L4: .. _V4L2-PIX-FMT-NV12-16L16: .. _V4L2-PIX-FMT-NV12-32L32:@@ -279,6 +280,11 @@ If the vertical resolution is an odd number of macroblocks, the last row of macroblocks is stored in linear order. The layouts of the luma and chroma planes are identical. +``V4L2_PIX_FMT_NV12_4L4`` stores pixel in 4x4 tiles, and stores +tiles linearly in memory. The line stride and image height must be +aligned to a multiple of 4. The layouts of the luma and chroma planes are +identical. + ``V4L2_PIX_FMT_NV12_16L16`` stores pixel in 16x16 tiles, and stores tiles linearly in memory. The line stride and image height must be aligned to a multiple of 16. The layouts of the luma and chroma planes aredrivers/media/v4l2-core/v4l2-common.c +3
-0@@ -275,6 +275,9 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) { .format = V4L2_PIX_FMT_YUV422P, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 2, .vdiv = 1 }, { .format = V4L2_PIX_FMT_GREY, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .hdiv = 1, .vdiv = 1 }, + /* Tiled YUV formats */ + { .format = V4L2_PIX_FMT_NV12_4L4, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 2, .vdiv = 2 }, + /* YUV planar formats, non contiguous variant */ { .format = V4L2_PIX_FMT_YUV420M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 2, .vdiv = 2 }, { .format = V4L2_PIX_FMT_YVU420M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 2, .vdiv = 2 },drivers/media/v4l2-core/v4l2-ioctl.c +0
-0
drivers/media/v4l2-core/v4l2-ioctl.c static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) · line 1284
Quoted 4 lines
drivers/media/v4l2-core/v4l2-ioctl.c +1
-0@@ -1281,6 +1281,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_NV61 : descr ="Y/CrCb 4:2:2" ;break ;case V4L2_PIX_FMT_NV24 : descr ="Y/CbCr 4:4:4" ;break ;case V4L2_PIX_FMT_NV42 : descr ="Y/CrCb 4:4:4" ;break ; +case V4L2_PIX_FMT_NV12_4L4 : descr ="Y/CbCr 4:2:0 (4x4 linear tiles)" ;break ;
To remain consistent I would also rename this to "Y/CbCr 4:2:0 (4x4 Linear)".
Regards,
Hans
Quoted 16 lines
drivers/media/v4l2-core/v4l2-ioctl.c +0
-0case V4L2_PIX_FMT_NV12_16L16 : descr ="Y/CbCr 4:2:0 (16x16 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12_32L32 : descr ="Y/CbCr 4:2:0 (32x32 linear tiles)" ;break ;case V4L2_PIX_FMT_NV12M : descr ="Y/CbCr 4:2:0 (N-C)" ;break ;include/uapi/linux/videodev2.h +1
-0@@ -627,6 +627,7 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2')/* 24 YVU444 planar */ /* Tiled YUV formats */ +#define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 4x4 tiles */ #define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 16x16 tiles */ #define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 32x32 tiles */
PATCH v2 4/4 media: Clean V4L2_PIX_FMT_NV12MT documentation
In reply to Ezequiel GarciaAdd more information about V4L2_PIX_FMT_NV12MT and V4L2_PIX_FMT_NV12M_16X16, so it's clearer for driver authors and users.
Also, group the two pixel formats with the other tiled formats, for clarity.
Unlike the recently introduced tiled formats (V4L2_PIX_FMT_NV12_4L4, etc) these formats have remained Samsung-specific until now. Therefore, and although the NV12MT and NV12MT_16X16 nomenclatures are less clear, we are keeping them as-is.
--- .../media/v4l/pixfmt-yuv-planar.rst | 25 ++++++++++--------- include/uapi/linux/videodev2.h | 6 +++-- 2 files changed, 17 insertions(+), 14 deletions(-)
Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +13 -12
@@ -99,7 +99,7 @@ All components are stored with the same number of bits per component. - 4:2:0 - Cb, Cr - No - - 64x32 macroblocks + - 64x32 tiles Horizontal Z order * - V4L2_PIX_FMT_NV12MT_16X16
@@ -108,7 +108,7 @@ All components are stored with the same number of bits per component. - 4:2:2 - Cb, Cr - No - - 16x16 macroblocks + - 16x16 tiles * - V4L2_PIX_FMT_NV16 - 'NV16' - 8
@@ -267,17 +267,18 @@ pixels and the same number of bytes as luma lines, and the chroma plane contains half the number of lines of the luma plane. Each tile follows the previous one linearly in memory (from left to right, top to bottom). -``V4L2_PIX_FMT_NV12MT_16X16`` stores pixel in 2D 16x16 macroblocks, and stores -macroblocks linearly in memory. The line stride and image height must be -aligned to a multiple of 16. The layouts of the luma and chroma planes are -identical. +``V4L2_PIX_FMT_NV12MT_16X16`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores +pixels in 2D 16x16 tiles, and stores tiles linearly in memory. +The line stride and image height must be aligned to a multiple of 16. +The layouts of the luma and chroma planes are identical. -``V4L2_PIX_FMT_NV12MT`` stores pixels in 2D 64x32 macroblocks, and stores 2x2 -groups of macroblocks in Z-order in memory, alternating Z and mirrored Z shapes -horizontally. The line stride must be a multiple of 128 pixels to ensure an +``V4L2_PIX_FMT_NV12MT`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores +pixels in 2D 64x32 tiles, and stores 2x2 groups of tiles in +Z-order in memory, alternating Z and mirrored Z shapes horizontally. +The line stride must be a multiple of 128 pixels to ensure an integer number of Z shapes. The image height must be a multiple of 32 pixels. -If the vertical resolution is an odd number of macroblocks, the last row of -macroblocks is stored in linear order. The layouts of the luma and chroma +If the vertical resolution is an odd number of tiles, the last row of +tiles is stored in linear order. The layouts of the luma and chroma planes are identical. ``V4L2_PIX_FMT_NV12_4L4`` stores pixel in 4x4 tiles, and stores
@@ -309,7 +310,7 @@ identical. :alt: nv12mt_example.svg :align: center - Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks + Example V4L2_PIX_FMT_NV12MT memory layout of tiles .. _V4L2-PIX-FMT-NV16:
include/uapi/linux/videodev2.h +4 -2
@@ -607,8 +607,6 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1')/* 21 Y/CrCb 4:2:0 */ #define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6')/* 16 Y/CbCr 4:2:2 */ #define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1')/* 16 Y/CrCb 4:2:2 */ -#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 64x32 macroblocks */ -#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 16x16 macroblocks */ /* three planes - Y Cb, Cr */ #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9')/* 9 YUV 4:1:0 */
@@ -631,6 +629,10 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 16x16 tiles */ #define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2')/* 12 Y/CbCr 4:2:0 32x32 tiles */ +/* Tiled YUV formats, non contiguous planes */ +#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 64x32 tiles */ +#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2')/* 12 Y/CbCr 4:2:0 16x16 tiles */ +/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1')/* 8 BGBG.. GRGR.. */ #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G')/* 8 GBGB.. RGRG.. */
Signature · 1 line
2.32.0