1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Broadcom BM2835 V4L2 driver
5 * Copyright © 2013 Raspberry Pi (Trading) Ltd.
7 * Authors: Vincent Sanders @ Collabora
8 * Dave Stevenson @ Broadcom
9 * (now dave.stevenson@raspberrypi.org)
10 * Simon Mellor @ Broadcom
11 * Luke Diamand @ Broadcom
13 #ifndef MMAL_ENCODINGS_H
14 #define MMAL_ENCODINGS_H
16 #define MMAL_ENCODING_H264 MMAL_FOURCC('H', '2', '6', '4')
17 #define MMAL_ENCODING_H263 MMAL_FOURCC('H', '2', '6', '3')
18 #define MMAL_ENCODING_MP4V MMAL_FOURCC('M', 'P', '4', 'V')
19 #define MMAL_ENCODING_MP2V MMAL_FOURCC('M', 'P', '2', 'V')
20 #define MMAL_ENCODING_MP1V MMAL_FOURCC('M', 'P', '1', 'V')
21 #define MMAL_ENCODING_WMV3 MMAL_FOURCC('W', 'M', 'V', '3')
22 #define MMAL_ENCODING_WMV2 MMAL_FOURCC('W', 'M', 'V', '2')
23 #define MMAL_ENCODING_WMV1 MMAL_FOURCC('W', 'M', 'V', '1')
24 #define MMAL_ENCODING_WVC1 MMAL_FOURCC('W', 'V', 'C', '1')
25 #define MMAL_ENCODING_VP8 MMAL_FOURCC('V', 'P', '8', ' ')
26 #define MMAL_ENCODING_VP7 MMAL_FOURCC('V', 'P', '7', ' ')
27 #define MMAL_ENCODING_VP6 MMAL_FOURCC('V', 'P', '6', ' ')
28 #define MMAL_ENCODING_THEORA MMAL_FOURCC('T', 'H', 'E', 'O')
29 #define MMAL_ENCODING_SPARK MMAL_FOURCC('S', 'P', 'R', 'K')
30 #define MMAL_ENCODING_MJPEG MMAL_FOURCC('M', 'J', 'P', 'G')
32 #define MMAL_ENCODING_JPEG MMAL_FOURCC('J', 'P', 'E', 'G')
33 #define MMAL_ENCODING_GIF MMAL_FOURCC('G', 'I', 'F', ' ')
34 #define MMAL_ENCODING_PNG MMAL_FOURCC('P', 'N', 'G', ' ')
35 #define MMAL_ENCODING_PPM MMAL_FOURCC('P', 'P', 'M', ' ')
36 #define MMAL_ENCODING_TGA MMAL_FOURCC('T', 'G', 'A', ' ')
37 #define MMAL_ENCODING_BMP MMAL_FOURCC('B', 'M', 'P', ' ')
39 #define MMAL_ENCODING_I420 MMAL_FOURCC('I', '4', '2', '0')
40 #define MMAL_ENCODING_I420_SLICE MMAL_FOURCC('S', '4', '2', '0')
41 #define MMAL_ENCODING_YV12 MMAL_FOURCC('Y', 'V', '1', '2')
42 #define MMAL_ENCODING_I422 MMAL_FOURCC('I', '4', '2', '2')
43 #define MMAL_ENCODING_I422_SLICE MMAL_FOURCC('S', '4', '2', '2')
44 #define MMAL_ENCODING_YUYV MMAL_FOURCC('Y', 'U', 'Y', 'V')
45 #define MMAL_ENCODING_YVYU MMAL_FOURCC('Y', 'V', 'Y', 'U')
46 #define MMAL_ENCODING_UYVY MMAL_FOURCC('U', 'Y', 'V', 'Y')
47 #define MMAL_ENCODING_VYUY MMAL_FOURCC('V', 'Y', 'U', 'Y')
48 #define MMAL_ENCODING_NV12 MMAL_FOURCC('N', 'V', '1', '2')
49 #define MMAL_ENCODING_NV21 MMAL_FOURCC('N', 'V', '2', '1')
50 #define MMAL_ENCODING_ARGB MMAL_FOURCC('A', 'R', 'G', 'B')
51 #define MMAL_ENCODING_RGBA MMAL_FOURCC('R', 'G', 'B', 'A')
52 #define MMAL_ENCODING_ABGR MMAL_FOURCC('A', 'B', 'G', 'R')
53 #define MMAL_ENCODING_BGRA MMAL_FOURCC('B', 'G', 'R', 'A')
54 #define MMAL_ENCODING_RGB16 MMAL_FOURCC('R', 'G', 'B', '2')
55 #define MMAL_ENCODING_RGB24 MMAL_FOURCC('R', 'G', 'B', '3')
56 #define MMAL_ENCODING_RGB32 MMAL_FOURCC('R', 'G', 'B', '4')
57 #define MMAL_ENCODING_BGR16 MMAL_FOURCC('B', 'G', 'R', '2')
58 #define MMAL_ENCODING_BGR24 MMAL_FOURCC('B', 'G', 'R', '3')
59 #define MMAL_ENCODING_BGR32 MMAL_FOURCC('B', 'G', 'R', '4')
61 /** SAND Video (YUVUV128) format, native format understood by VideoCore.
62 * This format is *not* opaque - if requested you will receive full frames
65 #define MMAL_ENCODING_YUVUV128 MMAL_FOURCC('S', 'A', 'N', 'D')
67 /** VideoCore opaque image format, image handles are returned to
68 * the host but not the actual image data.
70 #define MMAL_ENCODING_OPAQUE MMAL_FOURCC('O', 'P', 'Q', 'V')
73 * FourCC values copied from V4L2 where defined.
75 /* 8 bit per pixel Bayer formats. */
76 #define MMAL_ENCODING_BAYER_SBGGR8 MMAL_FOURCC('B', 'A', '8', '1')
77 #define MMAL_ENCODING_BAYER_SGBRG8 MMAL_FOURCC('G', 'B', 'R', 'G')
78 #define MMAL_ENCODING_BAYER_SGRBG8 MMAL_FOURCC('G', 'R', 'B', 'G')
79 #define MMAL_ENCODING_BAYER_SRGGB8 MMAL_FOURCC('R', 'G', 'G', 'B')
81 /* 10 bit per pixel packed Bayer formats. */
82 #define MMAL_ENCODING_BAYER_SBGGR10P MMAL_FOURCC('p', 'B', 'A', 'A')
83 #define MMAL_ENCODING_BAYER_SGRBG10P MMAL_FOURCC('p', 'g', 'A', 'A')
84 #define MMAL_ENCODING_BAYER_SGBRG10P MMAL_FOURCC('p', 'G', 'A', 'A')
85 #define MMAL_ENCODING_BAYER_SRGGB10P MMAL_FOURCC('p', 'R', 'A', 'A')
87 /* 12 bit per pixel packed Bayer formats. */
88 #define MMAL_ENCODING_BAYER_SBGGR12P MMAL_FOURCC('p', 'B', '1', '2')
89 #define MMAL_ENCODING_BAYER_SGRBG12P MMAL_FOURCC('p', 'g', '1', '2')
90 #define MMAL_ENCODING_BAYER_SGBRG12P MMAL_FOURCC('p', 'G', '1', '2')
91 #define MMAL_ENCODING_BAYER_SRGGB12P MMAL_FOURCC('p', 'R', '1', '2')
93 //14 bit per pixel Bayer formats.
94 #define MMAL_ENCODING_BAYER_SBGGR14P MMAL_FOURCC('p', 'B', 'E', 'E')
95 #define MMAL_ENCODING_BAYER_SGBRG14P MMAL_FOURCC('p', 'G', 'E', 'E')
96 #define MMAL_ENCODING_BAYER_SGRBG14P MMAL_FOURCC('p', 'g', 'E', 'E')
97 #define MMAL_ENCODING_BAYER_SRGGB14P MMAL_FOURCC('p', 'R', 'E', 'E')
99 /* 16 bit per pixel Bayer formats. */
100 #define MMAL_ENCODING_BAYER_SBGGR16 MMAL_FOURCC('B', 'G', '1', '6')
101 #define MMAL_ENCODING_BAYER_SGBRG16 MMAL_FOURCC('G', 'B', '1', '6')
102 #define MMAL_ENCODING_BAYER_SGRBG16 MMAL_FOURCC('G', 'R', '1', '6')
103 #define MMAL_ENCODING_BAYER_SRGGB16 MMAL_FOURCC('R', 'G', '1', '6')
105 /* 10 bit per pixel unpacked (16bit) Bayer formats. */
106 #define MMAL_ENCODING_BAYER_SBGGR10 MMAL_FOURCC('B', 'G', '1', '0')
107 #define MMAL_ENCODING_BAYER_SGRBG10 MMAL_FOURCC('B', 'A', '1', '0')
108 #define MMAL_ENCODING_BAYER_SGBRG10 MMAL_FOURCC('G', 'B', '1', '0')
109 #define MMAL_ENCODING_BAYER_SRGGB10 MMAL_FOURCC('R', 'G', '1', '0')
111 /* 12 bit per pixel unpacked (16bit) Bayer formats */
112 #define MMAL_ENCODING_BAYER_SBGGR12 MMAL_FOURCC('B', 'G', '1', '2')
113 #define MMAL_ENCODING_BAYER_SGRBG12 MMAL_FOURCC('B', 'A', '1', '2')
114 #define MMAL_ENCODING_BAYER_SGBRG12 MMAL_FOURCC('G', 'B', '1', '2')
115 #define MMAL_ENCODING_BAYER_SRGGB12 MMAL_FOURCC('R', 'G', '1', '2')
117 /* 14 bit per pixel unpacked (16bit) Bayer formats */
118 #define MMAL_ENCODING_BAYER_SBGGR14 MMAL_FOURCC('B', 'G', '1', '4')
119 #define MMAL_ENCODING_BAYER_SGBRG14 MMAL_FOURCC('G', 'B', '1', '4')
120 #define MMAL_ENCODING_BAYER_SGRBG14 MMAL_FOURCC('G', 'R', '1', '4')
121 #define MMAL_ENCODING_BAYER_SRGGB14 MMAL_FOURCC('R', 'G', '1', '4')
123 /* MIPI packed monochrome images */
124 #define MMAL_ENCODING_GREY MMAL_FOURCC('G', 'R', 'E', 'Y')
125 #define MMAL_ENCODING_Y10P MMAL_FOURCC('Y', '1', '0', 'P')
126 #define MMAL_ENCODING_Y12P MMAL_FOURCC('Y', '1', '2', 'P')
127 #define MMAL_ENCODING_Y14P MMAL_FOURCC('Y', '1', '4', 'P')
128 #define MMAL_ENCODING_Y16 MMAL_FOURCC('Y', '1', '6', ' ')
129 /* Unpacked monochrome formats (16bit per sample, but only N LSBs used) */
130 #define MMAL_ENCODING_Y10 MMAL_FOURCC('Y', '1', '0', ' ')
131 #define MMAL_ENCODING_Y12 MMAL_FOURCC('Y', '1', '2', ' ')
132 #define MMAL_ENCODING_Y14 MMAL_FOURCC('Y', '1', '4', ' ')
134 /** An EGL image handle
136 #define MMAL_ENCODING_EGL_IMAGE MMAL_FOURCC('E', 'G', 'L', 'I')
138 /** ISP image statistics format
140 #define MMAL_ENCODING_BRCM_STATS MMAL_FOURCC('S', 'T', 'A', 'T')
144 /** \name Pre-defined audio encodings */
146 #define MMAL_ENCODING_PCM_UNSIGNED_BE MMAL_FOURCC('P', 'C', 'M', 'U')
147 #define MMAL_ENCODING_PCM_UNSIGNED_LE MMAL_FOURCC('p', 'c', 'm', 'u')
148 #define MMAL_ENCODING_PCM_SIGNED_BE MMAL_FOURCC('P', 'C', 'M', 'S')
149 #define MMAL_ENCODING_PCM_SIGNED_LE MMAL_FOURCC('p', 'c', 'm', 's')
150 #define MMAL_ENCODING_PCM_FLOAT_BE MMAL_FOURCC('P', 'C', 'M', 'F')
151 #define MMAL_ENCODING_PCM_FLOAT_LE MMAL_FOURCC('p', 'c', 'm', 'f')
153 /* Pre-defined H264 encoding variants */
155 /** ISO 14496-10 Annex B byte stream format */
156 #define MMAL_ENCODING_VARIANT_H264_DEFAULT 0
157 /** ISO 14496-15 AVC stream format */
158 #define MMAL_ENCODING_VARIANT_H264_AVC1 MMAL_FOURCC('A', 'V', 'C', '1')
159 /** Implicitly delineated NAL units without emulation prevention */
160 #define MMAL_ENCODING_VARIANT_H264_RAW MMAL_FOURCC('R', 'A', 'W', ' ')
162 /** \defgroup MmalColorSpace List of pre-defined video color spaces
163 * This defines a list of common color spaces. This list isn't exhaustive and
164 * is only provided as a convenience to avoid clients having to use FourCC
165 * codes directly. However components are allowed to define and use their own
170 /** Unknown color space */
171 #define MMAL_COLOR_SPACE_UNKNOWN 0
172 /** ITU-R BT.601-5 [SDTV] */
173 #define MMAL_COLOR_SPACE_ITUR_BT601 MMAL_FOURCC('Y', '6', '0', '1')
174 /** ITU-R BT.709-3 [HDTV] */
175 #define MMAL_COLOR_SPACE_ITUR_BT709 MMAL_FOURCC('Y', '7', '0', '9')
177 #define MMAL_COLOR_SPACE_JPEG_JFIF MMAL_FOURCC('Y', 'J', 'F', 'I')
178 /** Title 47 Code of Federal Regulations (2003) 73.682 (a) (20) */
179 #define MMAL_COLOR_SPACE_FCC MMAL_FOURCC('Y', 'F', 'C', 'C')
180 /** Society of Motion Picture and Television Engineers 240M (1999) */
181 #define MMAL_COLOR_SPACE_SMPTE240M MMAL_FOURCC('Y', '2', '4', '0')
182 /** ITU-R BT.470-2 System M */
183 #define MMAL_COLOR_SPACE_BT470_2_M MMAL_FOURCC('Y', '_', '_', 'M')
184 /** ITU-R BT.470-2 System BG */
185 #define MMAL_COLOR_SPACE_BT470_2_BG MMAL_FOURCC('Y', '_', 'B', 'G')
186 /** JPEG JFIF, but with 16..255 luma */
187 #define MMAL_COLOR_SPACE_JFIF_Y16_255 MMAL_FOURCC('Y', 'Y', '1', '6')
188 /* @} MmalColorSpace List */
190 #endif /* MMAL_ENCODINGS_H */