pixfmt: Add gbrap10 pixel format
[libav.git] / libavutil / pixdesc.c
CommitLineData
9b61d838 1/*
e0cffbe7 2 * pixel format descriptor
9b61d838
MN
3 * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
4 *
2912e87a 5 * This file is part of Libav.
9b61d838 6 *
2912e87a 7 * Libav is free software; you can redistribute it and/or
9b61d838
MN
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
2912e87a 12 * Libav is distributed in the hope that it will be useful,
9b61d838
MN
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
2912e87a 18 * License along with Libav; if not, write to the Free Software
9b61d838
MN
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
47bfd50a
MR
22#include <stdio.h>
23#include <string.h>
d2fcb356 24
d2962e9f 25#include "avstring.h"
d2fcb356 26#include "common.h"
51135d1d 27#include "pixfmt.h"
9b61d838 28#include "pixdesc.h"
7950e519 29#include "internal.h"
f47a7cb7 30#include "intreadwrite.h"
19e30a58 31#include "version.h"
f47a7cb7 32
a6842670
LB
33void av_read_image_line(uint16_t *dst,
34 const uint8_t *data[4], const int linesize[4],
35 const AVPixFmtDescriptor *desc,
36 int x, int y, int c, int w,
4a59eca9 37 int read_pal_component)
f47a7cb7 38{
4a59eca9
TB
39 AVComponentDescriptor comp = desc->comp[c];
40 int plane = comp.plane;
2268db2c 41 int depth = comp.depth;
4a59eca9
TB
42 int mask = (1 << depth) - 1;
43 int shift = comp.shift;
2268db2c 44 int step = comp.step;
4a59eca9 45 int flags = desc->flags;
f47a7cb7 46
e6c4ac7b 47 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2268db2c 48 int skip = x * step + comp.offset;
4a59eca9
TB
49 const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
50 int shift = 8 - depth - (skip & 7);
f47a7cb7 51
4a59eca9 52 while (w--) {
f47a7cb7 53 int val = (*p >> shift) & mask;
4a59eca9
TB
54 if (read_pal_component)
55 val = data[1][4*val + c];
f47a7cb7 56 shift -= step;
4a59eca9 57 p -= shift >> 3;
f47a7cb7 58 shift &= 7;
4a59eca9 59 *dst++ = val;
f47a7cb7
SS
60 }
61 } else {
a6842670 62 const uint8_t *p = data[plane] + y * linesize[plane] +
2268db2c 63 x * step + comp.offset;
4660143a 64 int is_8bit = shift + depth <= 8;
f47a7cb7 65
4660143a 66 if (is_8bit)
e6c4ac7b 67 p += !!(flags & AV_PIX_FMT_FLAG_BE);
4660143a 68
4a59eca9 69 while (w--) {
9525243f 70 int val = is_8bit ? *p :
e6c4ac7b 71 flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
4a59eca9
TB
72 val = (val >> shift) & mask;
73 if (read_pal_component)
74 val = data[1][4 * val + c];
75 p += step;
76 *dst++ = val;
f47a7cb7
SS
77 }
78 }
79}
80
a6842670
LB
81void av_write_image_line(const uint16_t *src,
82 uint8_t *data[4], const int linesize[4],
83 const AVPixFmtDescriptor *desc,
84 int x, int y, int c, int w)
f47a7cb7
SS
85{
86 AVComponentDescriptor comp = desc->comp[c];
87 int plane = comp.plane;
2268db2c
VG
88 int depth = comp.depth;
89 int step = comp.step;
f47a7cb7
SS
90 int flags = desc->flags;
91
e6c4ac7b 92 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
2268db2c 93 int skip = x * step + comp.offset;
4a59eca9
TB
94 uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
95 int shift = 8 - depth - (skip & 7);
f47a7cb7
SS
96
97 while (w--) {
98 *p |= *src++ << shift;
99 shift -= step;
4a59eca9 100 p -= shift >> 3;
f47a7cb7
SS
101 shift &= 7;
102 }
103 } else {
104 int shift = comp.shift;
a6842670 105 uint8_t *p = data[plane] + y * linesize[plane] +
2268db2c 106 x * step + comp.offset;
f47a7cb7 107
9525243f 108 if (shift + depth <= 8) {
e6c4ac7b 109 p += !!(flags & AV_PIX_FMT_FLAG_BE);
9525243f 110 while (w--) {
4a59eca9 111 *p |= (*src++ << shift);
9525243f
MR
112 p += step;
113 }
114 } else {
78b19cf0 115 while (w--) {
e6c4ac7b 116 if (flags & AV_PIX_FMT_FLAG_BE) {
4a59eca9 117 uint16_t val = AV_RB16(p) | (*src++ << shift);
78b19cf0
MR
118 AV_WB16(p, val);
119 } else {
4a59eca9 120 uint16_t val = AV_RL16(p) | (*src++ << shift);
78b19cf0
MR
121 AV_WL16(p, val);
122 }
4a59eca9 123 p += step;
f47a7cb7 124 }
9525243f 125 }
f47a7cb7
SS
126 }
127}
128
2268db2c
VG
129#if FF_API_PLUS1_MINUS1
130FF_DISABLE_DEPRECATION_WARNINGS
131#endif
2f8cbbc9 132static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
716d413c 133 [AV_PIX_FMT_YUV420P] = {
bcbd9a14 134 .name = "yuv420p",
4a59eca9
TB
135 .nb_components = 3,
136 .log2_chroma_w = 1,
137 .log2_chroma_h = 1,
9b61d838 138 .comp = {
2268db2c
VG
139 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
140 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
141 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
9b61d838 142 },
e6c4ac7b 143 .flags = AV_PIX_FMT_FLAG_PLANAR,
9b61d838 144 },
716d413c 145 [AV_PIX_FMT_YUYV422] = {
bcbd9a14 146 .name = "yuyv422",
4a59eca9
TB
147 .nb_components = 3,
148 .log2_chroma_w = 1,
149 .log2_chroma_h = 0,
bcbd9a14 150 .comp = {
2268db2c
VG
151 { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
152 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* U */
153 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* V */
bcbd9a14
SS
154 },
155 },
8b17243d
VG
156 [AV_PIX_FMT_YVYU422] = {
157 .name = "yvyu422",
158 .nb_components = 3,
159 .log2_chroma_w = 1,
160 .log2_chroma_h = 0,
161 .comp = {
2268db2c 162 { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
2268db2c 163 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* U */
e336c51e 164 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* V */
8b17243d
VG
165 },
166 },
716d413c 167 [AV_PIX_FMT_RGB24] = {
bcbd9a14 168 .name = "rgb24",
4a59eca9
TB
169 .nb_components = 3,
170 .log2_chroma_w = 0,
171 .log2_chroma_h = 0,
bcbd9a14 172 .comp = {
2268db2c
VG
173 { 0, 3, 0, 0, 8, 2, 7, 1 }, /* R */
174 { 0, 3, 1, 0, 8, 2, 7, 2 }, /* G */
175 { 0, 3, 2, 0, 8, 2, 7, 3 }, /* B */
bcbd9a14 176 },
e6c4ac7b 177 .flags = AV_PIX_FMT_FLAG_RGB,
bcbd9a14 178 },
716d413c 179 [AV_PIX_FMT_BGR24] = {
10151b13 180 .name = "bgr24",
4a59eca9
TB
181 .nb_components = 3,
182 .log2_chroma_w = 0,
183 .log2_chroma_h = 0,
10151b13 184 .comp = {
2268db2c 185 { 0, 3, 2, 0, 8, 2, 7, 3 }, /* R */
e336c51e
HL
186 { 0, 3, 1, 0, 8, 2, 7, 2 }, /* G */
187 { 0, 3, 0, 0, 8, 2, 7, 1 }, /* B */
10151b13 188 },
e6c4ac7b 189 .flags = AV_PIX_FMT_FLAG_RGB,
10151b13 190 },
716d413c 191 [AV_PIX_FMT_YUV422P] = {
bcbd9a14 192 .name = "yuv422p",
4a59eca9
TB
193 .nb_components = 3,
194 .log2_chroma_w = 1,
195 .log2_chroma_h = 0,
9b61d838 196 .comp = {
2268db2c
VG
197 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
198 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
199 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
9b61d838 200 },
e6c4ac7b 201 .flags = AV_PIX_FMT_FLAG_PLANAR,
9b61d838 202 },
716d413c 203 [AV_PIX_FMT_YUV444P] = {
10151b13 204 .name = "yuv444p",
4a59eca9
TB
205 .nb_components = 3,
206 .log2_chroma_w = 0,
207 .log2_chroma_h = 0,
10151b13 208 .comp = {
2268db2c
VG
209 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
210 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
211 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 212 },
e6c4ac7b 213 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 214 },
716d413c 215 [AV_PIX_FMT_YUV410P] = {
1e896640 216 .name = "yuv410p",
4a59eca9
TB
217 .nb_components = 3,
218 .log2_chroma_w = 2,
219 .log2_chroma_h = 2,
9b61d838 220 .comp = {
2268db2c
VG
221 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
222 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
223 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
9b61d838 224 },
e6c4ac7b 225 .flags = AV_PIX_FMT_FLAG_PLANAR,
9b61d838 226 },
716d413c 227 [AV_PIX_FMT_YUV411P] = {
10151b13 228 .name = "yuv411p",
4a59eca9
TB
229 .nb_components = 3,
230 .log2_chroma_w = 2,
231 .log2_chroma_h = 0,
10151b13 232 .comp = {
2268db2c
VG
233 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
234 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
235 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 236 },
e6c4ac7b 237 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 238 },
716d413c 239 [AV_PIX_FMT_GRAY8] = {
382cb115 240 .name = "gray",
4a59eca9
TB
241 .nb_components = 1,
242 .log2_chroma_w = 0,
243 .log2_chroma_h = 0,
10151b13 244 .comp = {
2268db2c 245 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
10151b13 246 },
78b4bfdb 247 .flags = AV_PIX_FMT_FLAG_PSEUDOPAL,
e0d73fda 248 .alias = "gray8,y8",
10151b13 249 },
716d413c 250 [AV_PIX_FMT_MONOWHITE] = {
382cb115 251 .name = "monow",
4a59eca9
TB
252 .nb_components = 1,
253 .log2_chroma_w = 0,
254 .log2_chroma_h = 0,
10151b13 255 .comp = {
2268db2c 256 { 0, 1, 0, 0, 1, 0, 0, 1 }, /* Y */
10151b13 257 },
e6c4ac7b 258 .flags = AV_PIX_FMT_FLAG_BITSTREAM,
10151b13 259 },
716d413c 260 [AV_PIX_FMT_MONOBLACK] = {
382cb115 261 .name = "monob",
4a59eca9
TB
262 .nb_components = 1,
263 .log2_chroma_w = 0,
264 .log2_chroma_h = 0,
9b61d838 265 .comp = {
2268db2c 266 { 0, 1, 0, 7, 1, 0, 0, 1 }, /* Y */
9b61d838 267 },
e6c4ac7b 268 .flags = AV_PIX_FMT_FLAG_BITSTREAM,
9b61d838 269 },
716d413c 270 [AV_PIX_FMT_PAL8] = {
bcbd9a14 271 .name = "pal8",
4a59eca9
TB
272 .nb_components = 1,
273 .log2_chroma_w = 0,
274 .log2_chroma_h = 0,
9b61d838 275 .comp = {
2268db2c 276 { 0, 1, 0, 0, 8, 0, 7, 1 },
9b61d838 277 },
e6c4ac7b 278 .flags = AV_PIX_FMT_FLAG_PAL,
9b61d838 279 },
716d413c 280 [AV_PIX_FMT_YUVJ420P] = {
10151b13 281 .name = "yuvj420p",
4a59eca9
TB
282 .nb_components = 3,
283 .log2_chroma_w = 1,
284 .log2_chroma_h = 1,
10151b13 285 .comp = {
2268db2c
VG
286 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
287 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
288 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 289 },
e6c4ac7b 290 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 291 },
716d413c 292 [AV_PIX_FMT_YUVJ422P] = {
10151b13 293 .name = "yuvj422p",
4a59eca9
TB
294 .nb_components = 3,
295 .log2_chroma_w = 1,
296 .log2_chroma_h = 0,
10151b13 297 .comp = {
2268db2c
VG
298 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
299 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
300 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 301 },
e6c4ac7b 302 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 303 },
716d413c 304 [AV_PIX_FMT_YUVJ444P] = {
10151b13 305 .name = "yuvj444p",
4a59eca9
TB
306 .nb_components = 3,
307 .log2_chroma_w = 0,
308 .log2_chroma_h = 0,
10151b13 309 .comp = {
2268db2c
VG
310 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
311 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
312 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 313 },
e6c4ac7b 314 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 315 },
716d413c 316 [AV_PIX_FMT_UYVY422] = {
1e896640 317 .name = "uyvy422",
4a59eca9
TB
318 .nb_components = 3,
319 .log2_chroma_w = 1,
320 .log2_chroma_h = 0,
9b61d838 321 .comp = {
2268db2c
VG
322 { 0, 2, 1, 0, 8, 1, 7, 2 }, /* Y */
323 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* U */
324 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* V */
9b61d838
MN
325 },
326 },
716d413c 327 [AV_PIX_FMT_UYYVYY411] = {
10151b13 328 .name = "uyyvyy411",
4a59eca9
TB
329 .nb_components = 3,
330 .log2_chroma_w = 2,
331 .log2_chroma_h = 0,
10151b13 332 .comp = {
2268db2c
VG
333 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* Y */
334 { 0, 6, 0, 0, 8, 5, 7, 1 }, /* U */
335 { 0, 6, 3, 0, 8, 5, 7, 4 }, /* V */
10151b13
SS
336 },
337 },
716d413c 338 [AV_PIX_FMT_BGR8] = {
10151b13 339 .name = "bgr8",
4a59eca9
TB
340 .nb_components = 3,
341 .log2_chroma_w = 0,
342 .log2_chroma_h = 0,
10151b13 343 .comp = {
2268db2c 344 { 0, 1, 0, 0, 3, 0, 2, 1 }, /* R */
e336c51e
HL
345 { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
346 { 0, 1, 0, 6, 2, 0, 1, 1 }, /* B */
10151b13 347 },
e6c4ac7b 348 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
10151b13 349 },
716d413c 350 [AV_PIX_FMT_BGR4] = {
10151b13 351 .name = "bgr4",
4a59eca9
TB
352 .nb_components = 3,
353 .log2_chroma_w = 0,
354 .log2_chroma_h = 0,
10151b13 355 .comp = {
2268db2c 356 { 0, 4, 3, 0, 1, 3, 0, 4 }, /* R */
e336c51e
HL
357 { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
358 { 0, 4, 0, 0, 1, 3, 0, 1 }, /* B */
10151b13 359 },
e6c4ac7b 360 .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
10151b13 361 },
716d413c 362 [AV_PIX_FMT_BGR4_BYTE] = {
10151b13 363 .name = "bgr4_byte",
4a59eca9
TB
364 .nb_components = 3,
365 .log2_chroma_w = 0,
366 .log2_chroma_h = 0,
10151b13 367 .comp = {
2268db2c 368 { 0, 1, 0, 0, 1, 0, 0, 1 }, /* R */
e336c51e
HL
369 { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
370 { 0, 1, 0, 3, 1, 0, 0, 1 }, /* B */
10151b13 371 },
e6c4ac7b 372 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
10151b13 373 },
716d413c 374 [AV_PIX_FMT_RGB8] = {
10151b13 375 .name = "rgb8",
4a59eca9
TB
376 .nb_components = 3,
377 .log2_chroma_w = 0,
378 .log2_chroma_h = 0,
10151b13 379 .comp = {
2268db2c
VG
380 { 0, 1, 0, 6, 2, 0, 1, 1 }, /* R */
381 { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
382 { 0, 1, 0, 0, 3, 0, 2, 1 }, /* B */
10151b13 383 },
e6c4ac7b 384 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
10151b13 385 },
716d413c 386 [AV_PIX_FMT_RGB4] = {
10151b13 387 .name = "rgb4",
4a59eca9
TB
388 .nb_components = 3,
389 .log2_chroma_w = 0,
390 .log2_chroma_h = 0,
10151b13 391 .comp = {
2268db2c
VG
392 { 0, 4, 0, 0, 1, 3, 0, 1 }, /* R */
393 { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
394 { 0, 4, 3, 0, 1, 3, 0, 4 }, /* B */
10151b13 395 },
e6c4ac7b 396 .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
10151b13 397 },
716d413c 398 [AV_PIX_FMT_RGB4_BYTE] = {
10151b13 399 .name = "rgb4_byte",
4a59eca9
TB
400 .nb_components = 3,
401 .log2_chroma_w = 0,
402 .log2_chroma_h = 0,
10151b13 403 .comp = {
2268db2c
VG
404 { 0, 1, 0, 3, 1, 0, 0, 1 }, /* R */
405 { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
406 { 0, 1, 0, 0, 1, 0, 0, 1 }, /* B */
10151b13 407 },
e6c4ac7b 408 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
10151b13 409 },
716d413c 410 [AV_PIX_FMT_NV12] = {
bcbd9a14 411 .name = "nv12",
4a59eca9
TB
412 .nb_components = 3,
413 .log2_chroma_w = 1,
414 .log2_chroma_h = 1,
9b61d838 415 .comp = {
2268db2c
VG
416 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
417 { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
418 { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
9b61d838 419 },
e6c4ac7b 420 .flags = AV_PIX_FMT_FLAG_PLANAR,
9b61d838 421 },
716d413c 422 [AV_PIX_FMT_NV21] = {
10151b13 423 .name = "nv21",
4a59eca9
TB
424 .nb_components = 3,
425 .log2_chroma_w = 1,
426 .log2_chroma_h = 1,
10151b13 427 .comp = {
2268db2c 428 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
2268db2c 429 { 1, 2, 1, 0, 8, 1, 7, 2 }, /* U */
e336c51e 430 { 1, 2, 0, 0, 8, 1, 7, 1 }, /* V */
10151b13 431 },
e6c4ac7b 432 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 433 },
716d413c 434 [AV_PIX_FMT_ARGB] = {
10151b13 435 .name = "argb",
4a59eca9
TB
436 .nb_components = 4,
437 .log2_chroma_w = 0,
438 .log2_chroma_h = 0,
10151b13 439 .comp = {
2268db2c
VG
440 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* R */
441 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
442 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* B */
e336c51e 443 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
10151b13 444 },
e6c4ac7b 445 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
10151b13 446 },
716d413c 447 [AV_PIX_FMT_RGBA] = {
1e896640 448 .name = "rgba",
4a59eca9
TB
449 .nb_components = 4,
450 .log2_chroma_w = 0,
451 .log2_chroma_h = 0,
9b61d838 452 .comp = {
2268db2c
VG
453 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* R */
454 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
455 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* B */
456 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
9b61d838 457 },
e6c4ac7b 458 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
9b61d838 459 },
716d413c 460 [AV_PIX_FMT_ABGR] = {
10151b13 461 .name = "abgr",
4a59eca9
TB
462 .nb_components = 4,
463 .log2_chroma_w = 0,
464 .log2_chroma_h = 0,
10151b13 465 .comp = {
2268db2c 466 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* R */
e336c51e
HL
467 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* G */
468 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* B */
469 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
10151b13 470 },
e6c4ac7b 471 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
10151b13 472 },
716d413c 473 [AV_PIX_FMT_BGRA] = {
10151b13 474 .name = "bgra",
4a59eca9
TB
475 .nb_components = 4,
476 .log2_chroma_w = 0,
477 .log2_chroma_h = 0,
10151b13 478 .comp = {
2268db2c 479 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* R */
e336c51e
HL
480 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
481 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* B */
2268db2c 482 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
10151b13 483 },
e6c4ac7b 484 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
10151b13 485 },
7471352f
LB
486 [AV_PIX_FMT_GRAY12BE] = {
487 .name = "gray12be",
488 .nb_components = 1,
489 .log2_chroma_w = 0,
490 .log2_chroma_h = 0,
491 .comp = {
492 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
493 },
494 .flags = AV_PIX_FMT_FLAG_BE,
495 .alias = "y12be",
496 },
497 [AV_PIX_FMT_GRAY12LE] = {
498 .name = "gray12le",
499 .nb_components = 1,
500 .log2_chroma_w = 0,
501 .log2_chroma_h = 0,
502 .comp = {
503 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
504 },
505 .alias = "y12le",
506 },
716d413c 507 [AV_PIX_FMT_GRAY16BE] = {
bcbd9a14 508 .name = "gray16be",
4a59eca9
TB
509 .nb_components = 1,
510 .log2_chroma_w = 0,
511 .log2_chroma_h = 0,
9b61d838 512 .comp = {
2268db2c 513 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
bcbd9a14 514 },
e6c4ac7b 515 .flags = AV_PIX_FMT_FLAG_BE,
e0d73fda 516 .alias = "y16be",
bcbd9a14 517 },
716d413c 518 [AV_PIX_FMT_GRAY16LE] = {
bcbd9a14 519 .name = "gray16le",
4a59eca9
TB
520 .nb_components = 1,
521 .log2_chroma_w = 0,
522 .log2_chroma_h = 0,
bcbd9a14 523 .comp = {
2268db2c 524 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
9b61d838 525 },
e0d73fda 526 .alias = "y16le",
9b61d838 527 },
716d413c 528 [AV_PIX_FMT_YUV440P] = {
10151b13 529 .name = "yuv440p",
4a59eca9
TB
530 .nb_components = 3,
531 .log2_chroma_w = 0,
532 .log2_chroma_h = 1,
10151b13 533 .comp = {
2268db2c
VG
534 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
535 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
536 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 537 },
e6c4ac7b 538 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 539 },
716d413c 540 [AV_PIX_FMT_YUVJ440P] = {
10151b13 541 .name = "yuvj440p",
4a59eca9
TB
542 .nb_components = 3,
543 .log2_chroma_w = 0,
544 .log2_chroma_h = 1,
10151b13 545 .comp = {
2268db2c
VG
546 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
547 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
548 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
10151b13 549 },
e6c4ac7b 550 .flags = AV_PIX_FMT_FLAG_PLANAR,
10151b13 551 },
716d413c 552 [AV_PIX_FMT_YUVA420P] = {
10151b13 553 .name = "yuva420p",
4a59eca9
TB
554 .nb_components = 4,
555 .log2_chroma_w = 1,
556 .log2_chroma_h = 1,
10151b13 557 .comp = {
2268db2c
VG
558 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
559 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
560 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
561 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
6d5600e8 562 },
e6c4ac7b 563 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
6d5600e8
LB
564 },
565 [AV_PIX_FMT_YUVA422P] = {
566 .name = "yuva422p",
567 .nb_components = 4,
568 .log2_chroma_w = 1,
569 .log2_chroma_h = 0,
570 .comp = {
2268db2c
VG
571 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
572 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
573 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
574 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
6d5600e8 575 },
e6c4ac7b 576 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
6d5600e8
LB
577 },
578 [AV_PIX_FMT_YUVA444P] = {
579 .name = "yuva444p",
580 .nb_components = 4,
581 .log2_chroma_w = 0,
582 .log2_chroma_h = 0,
583 .comp = {
2268db2c
VG
584 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
585 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* U */
586 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* V */
587 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
10151b13 588 },
e6c4ac7b 589 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
10151b13 590 },
7658295b
LB
591 [AV_PIX_FMT_YUVA420P9BE] = {
592 .name = "yuva420p9be",
593 .nb_components = 4,
594 .log2_chroma_w = 1,
595 .log2_chroma_h = 1,
596 .comp = {
2268db2c
VG
597 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
598 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
599 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
600 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 601 },
c7ed26ad 602 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
603 },
604 [AV_PIX_FMT_YUVA420P9LE] = {
605 .name = "yuva420p9le",
606 .nb_components = 4,
607 .log2_chroma_w = 1,
608 .log2_chroma_h = 1,
609 .comp = {
2268db2c
VG
610 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
611 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
612 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
613 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 614 },
e6c4ac7b 615 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
616 },
617 [AV_PIX_FMT_YUVA422P9BE] = {
618 .name = "yuva422p9be",
619 .nb_components = 4,
620 .log2_chroma_w = 1,
621 .log2_chroma_h = 0,
622 .comp = {
2268db2c
VG
623 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
624 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
625 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
626 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 627 },
e6c4ac7b 628 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
629 },
630 [AV_PIX_FMT_YUVA422P9LE] = {
631 .name = "yuva422p9le",
632 .nb_components = 4,
633 .log2_chroma_w = 1,
634 .log2_chroma_h = 0,
635 .comp = {
2268db2c
VG
636 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
637 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
638 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
639 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 640 },
e6c4ac7b 641 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
642 },
643 [AV_PIX_FMT_YUVA444P9BE] = {
644 .name = "yuva444p9be",
645 .nb_components = 4,
646 .log2_chroma_w = 0,
647 .log2_chroma_h = 0,
648 .comp = {
2268db2c
VG
649 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
650 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
651 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
652 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 653 },
e6c4ac7b 654 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
655 },
656 [AV_PIX_FMT_YUVA444P9LE] = {
657 .name = "yuva444p9le",
658 .nb_components = 4,
659 .log2_chroma_w = 0,
660 .log2_chroma_h = 0,
661 .comp = {
2268db2c
VG
662 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
663 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
664 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
665 { 3, 2, 0, 0, 9, 1, 8, 1 }, /* A */
7658295b 666 },
e6c4ac7b 667 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
668 },
669 [AV_PIX_FMT_YUVA420P10BE] = {
670 .name = "yuva420p10be",
671 .nb_components = 4,
672 .log2_chroma_w = 1,
673 .log2_chroma_h = 1,
674 .comp = {
2268db2c
VG
675 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
676 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
677 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
678 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 679 },
e6c4ac7b 680 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
681 },
682 [AV_PIX_FMT_YUVA420P10LE] = {
683 .name = "yuva420p10le",
684 .nb_components = 4,
685 .log2_chroma_w = 1,
686 .log2_chroma_h = 1,
687 .comp = {
2268db2c
VG
688 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
689 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
690 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
691 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 692 },
e6c4ac7b 693 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
694 },
695 [AV_PIX_FMT_YUVA422P10BE] = {
696 .name = "yuva422p10be",
697 .nb_components = 4,
698 .log2_chroma_w = 1,
699 .log2_chroma_h = 0,
700 .comp = {
2268db2c
VG
701 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
702 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
703 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
704 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 705 },
e6c4ac7b 706 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
707 },
708 [AV_PIX_FMT_YUVA422P10LE] = {
709 .name = "yuva422p10le",
710 .nb_components = 4,
711 .log2_chroma_w = 1,
712 .log2_chroma_h = 0,
713 .comp = {
2268db2c
VG
714 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
715 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
716 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
717 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 718 },
e6c4ac7b 719 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
720 },
721 [AV_PIX_FMT_YUVA444P10BE] = {
722 .name = "yuva444p10be",
723 .nb_components = 4,
724 .log2_chroma_w = 0,
725 .log2_chroma_h = 0,
726 .comp = {
2268db2c
VG
727 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
728 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
729 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
730 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 731 },
e6c4ac7b 732 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
733 },
734 [AV_PIX_FMT_YUVA444P10LE] = {
735 .name = "yuva444p10le",
736 .nb_components = 4,
737 .log2_chroma_w = 0,
738 .log2_chroma_h = 0,
739 .comp = {
2268db2c
VG
740 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
741 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
742 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
743 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
7658295b 744 },
e6c4ac7b 745 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
746 },
747 [AV_PIX_FMT_YUVA420P16BE] = {
748 .name = "yuva420p16be",
749 .nb_components = 4,
750 .log2_chroma_w = 1,
751 .log2_chroma_h = 1,
752 .comp = {
2268db2c
VG
753 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
754 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
755 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
756 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 757 },
e6c4ac7b 758 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
759 },
760 [AV_PIX_FMT_YUVA420P16LE] = {
761 .name = "yuva420p16le",
762 .nb_components = 4,
763 .log2_chroma_w = 1,
764 .log2_chroma_h = 1,
765 .comp = {
2268db2c
VG
766 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
767 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
768 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
769 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 770 },
e6c4ac7b 771 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
772 },
773 [AV_PIX_FMT_YUVA422P16BE] = {
774 .name = "yuva422p16be",
775 .nb_components = 4,
776 .log2_chroma_w = 1,
777 .log2_chroma_h = 0,
778 .comp = {
2268db2c
VG
779 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
780 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
781 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
782 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 783 },
e6c4ac7b 784 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
785 },
786 [AV_PIX_FMT_YUVA422P16LE] = {
787 .name = "yuva422p16le",
788 .nb_components = 4,
789 .log2_chroma_w = 1,
790 .log2_chroma_h = 0,
791 .comp = {
2268db2c
VG
792 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
793 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
794 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
795 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 796 },
e6c4ac7b 797 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
798 },
799 [AV_PIX_FMT_YUVA444P16BE] = {
800 .name = "yuva444p16be",
801 .nb_components = 4,
802 .log2_chroma_w = 0,
803 .log2_chroma_h = 0,
804 .comp = {
2268db2c
VG
805 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
806 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
807 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
808 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 809 },
e6c4ac7b 810 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b
LB
811 },
812 [AV_PIX_FMT_YUVA444P16LE] = {
813 .name = "yuva444p16le",
814 .nb_components = 4,
815 .log2_chroma_w = 0,
816 .log2_chroma_h = 0,
817 .comp = {
2268db2c
VG
818 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
819 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
820 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
821 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
7658295b 822 },
e6c4ac7b 823 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
7658295b 824 },
716d413c 825 [AV_PIX_FMT_RGB48BE] = {
1e896640 826 .name = "rgb48be",
4a59eca9
TB
827 .nb_components = 3,
828 .log2_chroma_w = 0,
829 .log2_chroma_h = 0,
9b61d838 830 .comp = {
2268db2c
VG
831 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
832 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
833 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
9b61d838 834 },
e6c4ac7b 835 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE,
9b61d838 836 },
716d413c 837 [AV_PIX_FMT_RGB48LE] = {
bcbd9a14 838 .name = "rgb48le",
4a59eca9
TB
839 .nb_components = 3,
840 .log2_chroma_w = 0,
841 .log2_chroma_h = 0,
9b61d838 842 .comp = {
2268db2c
VG
843 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
844 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
845 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
9b61d838 846 },
e6c4ac7b 847 .flags = AV_PIX_FMT_FLAG_RGB,
9b61d838 848 },
1481d24c
JF
849 [AV_PIX_FMT_RGBA64BE] = {
850 .name = "rgba64be",
851 .nb_components = 4,
852 .log2_chroma_w = 0,
853 .log2_chroma_h = 0,
854 .comp = {
2268db2c
VG
855 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
856 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
857 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
858 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1481d24c
JF
859 },
860 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
861 },
862 [AV_PIX_FMT_RGBA64LE] = {
863 .name = "rgba64le",
864 .nb_components = 4,
865 .log2_chroma_w = 0,
866 .log2_chroma_h = 0,
867 .comp = {
2268db2c
VG
868 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
869 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
870 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
871 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1481d24c
JF
872 },
873 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
874 },
716d413c 875 [AV_PIX_FMT_RGB565BE] = {
1e896640 876 .name = "rgb565be",
4a59eca9
TB
877 .nb_components = 3,
878 .log2_chroma_w = 0,
879 .log2_chroma_h = 0,
9b61d838 880 .comp = {
2268db2c
VG
881 { 0, 2, -1, 3, 5, 1, 4, 0 }, /* R */
882 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
883 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
9b61d838 884 },
e6c4ac7b 885 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
9b61d838 886 },
716d413c 887 [AV_PIX_FMT_RGB565LE] = {
bcbd9a14 888 .name = "rgb565le",
4a59eca9
TB
889 .nb_components = 3,
890 .log2_chroma_w = 0,
891 .log2_chroma_h = 0,
9b61d838 892 .comp = {
2268db2c
VG
893 { 0, 2, 1, 3, 5, 1, 4, 2 }, /* R */
894 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
895 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
9b61d838 896 },
e6c4ac7b 897 .flags = AV_PIX_FMT_FLAG_RGB,
9b61d838 898 },
716d413c 899 [AV_PIX_FMT_RGB555BE] = {
10151b13 900 .name = "rgb555be",
4a59eca9
TB
901 .nb_components = 3,
902 .log2_chroma_w = 0,
903 .log2_chroma_h = 0,
10151b13 904 .comp = {
2268db2c
VG
905 { 0, 2, -1, 2, 5, 1, 4, 0 }, /* R */
906 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
907 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
10151b13 908 },
e6c4ac7b 909 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
10151b13 910 },
716d413c 911 [AV_PIX_FMT_RGB555LE] = {
10151b13 912 .name = "rgb555le",
4a59eca9
TB
913 .nb_components = 3,
914 .log2_chroma_w = 0,
915 .log2_chroma_h = 0,
10151b13 916 .comp = {
2268db2c
VG
917 { 0, 2, 1, 2, 5, 1, 4, 2 }, /* R */
918 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
919 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
10151b13 920 },
e6c4ac7b 921 .flags = AV_PIX_FMT_FLAG_RGB,
10151b13 922 },
716d413c 923 [AV_PIX_FMT_RGB444BE] = {
2b7cf167 924 .name = "rgb444be",
4a59eca9
TB
925 .nb_components = 3,
926 .log2_chroma_w = 0,
927 .log2_chroma_h = 0,
2b7cf167 928 .comp = {
2268db2c
VG
929 { 0, 2, -1, 0, 4, 1, 3, 0 }, /* R */
930 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
931 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
2b7cf167 932 },
e6c4ac7b 933 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
2b7cf167 934 },
716d413c 935 [AV_PIX_FMT_RGB444LE] = {
2b7cf167 936 .name = "rgb444le",
4a59eca9
TB
937 .nb_components = 3,
938 .log2_chroma_w = 0,
939 .log2_chroma_h = 0,
2b7cf167 940 .comp = {
2268db2c
VG
941 { 0, 2, 1, 0, 4, 1, 3, 2 }, /* R */
942 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
943 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
2b7cf167 944 },
e6c4ac7b 945 .flags = AV_PIX_FMT_FLAG_RGB,
2b7cf167 946 },
716d413c 947 [AV_PIX_FMT_BGR48BE] = {
73389754 948 .name = "bgr48be",
4a59eca9
TB
949 .nb_components = 3,
950 .log2_chroma_w = 0,
951 .log2_chroma_h = 0,
73389754 952 .comp = {
2268db2c 953 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
e336c51e
HL
954 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
955 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
73389754 956 },
e6c4ac7b 957 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
73389754 958 },
716d413c 959 [AV_PIX_FMT_BGR48LE] = {
73389754 960 .name = "bgr48le",
4a59eca9
TB
961 .nb_components = 3,
962 .log2_chroma_w = 0,
963 .log2_chroma_h = 0,
73389754 964 .comp = {
2268db2c 965 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
e336c51e
HL
966 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
967 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
73389754 968 },
e6c4ac7b 969 .flags = AV_PIX_FMT_FLAG_RGB,
73389754 970 },
1481d24c
JF
971 [AV_PIX_FMT_BGRA64BE] = {
972 .name = "bgra64be",
973 .nb_components = 4,
974 .log2_chroma_w = 0,
975 .log2_chroma_h = 0,
976 .comp = {
e336c51e
HL
977 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
978 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
979 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
980 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1481d24c
JF
981 },
982 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
983 },
984 [AV_PIX_FMT_BGRA64LE] = {
985 .name = "bgra64le",
986 .nb_components = 4,
987 .log2_chroma_w = 0,
988 .log2_chroma_h = 0,
989 .comp = {
e336c51e
HL
990 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
991 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
992 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
993 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1481d24c
JF
994 },
995 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
996 },
716d413c 997 [AV_PIX_FMT_BGR565BE] = {
10151b13 998 .name = "bgr565be",
4a59eca9
TB
999 .nb_components = 3,
1000 .log2_chroma_w = 0,
1001 .log2_chroma_h = 0,
10151b13 1002 .comp = {
2268db2c 1003 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
e336c51e
HL
1004 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1005 { 0, 2, -1, 3, 5, 1, 4, 0 }, /* B */
10151b13 1006 },
e6c4ac7b 1007 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
10151b13 1008 },
716d413c 1009 [AV_PIX_FMT_BGR565LE] = {
10151b13 1010 .name = "bgr565le",
4a59eca9
TB
1011 .nb_components = 3,
1012 .log2_chroma_w = 0,
1013 .log2_chroma_h = 0,
10151b13 1014 .comp = {
2268db2c 1015 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
e336c51e
HL
1016 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1017 { 0, 2, 1, 3, 5, 1, 4, 2 }, /* B */
10151b13 1018 },
e6c4ac7b 1019 .flags = AV_PIX_FMT_FLAG_RGB,
10151b13 1020 },
716d413c 1021 [AV_PIX_FMT_BGR555BE] = {
10151b13 1022 .name = "bgr555be",
4a59eca9
TB
1023 .nb_components = 3,
1024 .log2_chroma_w = 0,
1025 .log2_chroma_h = 0,
10151b13 1026 .comp = {
2268db2c 1027 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
e336c51e
HL
1028 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1029 { 0, 2, -1, 2, 5, 1, 4, 0 }, /* B */
10151b13 1030 },
e6c4ac7b 1031 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
10151b13 1032 },
716d413c 1033 [AV_PIX_FMT_BGR555LE] = {
10151b13 1034 .name = "bgr555le",
4a59eca9
TB
1035 .nb_components = 3,
1036 .log2_chroma_w = 0,
1037 .log2_chroma_h = 0,
10151b13 1038 .comp = {
2268db2c 1039 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
e336c51e
HL
1040 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1041 { 0, 2, 1, 2, 5, 1, 4, 2 }, /* B */
10151b13 1042 },
e6c4ac7b 1043 .flags = AV_PIX_FMT_FLAG_RGB,
10151b13 1044 },
716d413c 1045 [AV_PIX_FMT_BGR444BE] = {
2b7cf167 1046 .name = "bgr444be",
4a59eca9
TB
1047 .nb_components = 3,
1048 .log2_chroma_w = 0,
1049 .log2_chroma_h = 0,
2b7cf167 1050 .comp = {
2268db2c 1051 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
e336c51e
HL
1052 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1053 { 0, 2, -1, 0, 4, 1, 3, 0 }, /* B */
2b7cf167 1054 },
e6c4ac7b 1055 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
2b7cf167 1056 },
716d413c 1057 [AV_PIX_FMT_BGR444LE] = {
2b7cf167 1058 .name = "bgr444le",
4a59eca9
TB
1059 .nb_components = 3,
1060 .log2_chroma_w = 0,
1061 .log2_chroma_h = 0,
2b7cf167 1062 .comp = {
2268db2c 1063 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
e336c51e
HL
1064 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1065 { 0, 2, 1, 0, 4, 1, 3, 2 }, /* B */
2b7cf167 1066 },
e6c4ac7b 1067 .flags = AV_PIX_FMT_FLAG_RGB,
2b7cf167 1068 },
d264c720 1069#if FF_API_VAAPI
716d413c 1070 [AV_PIX_FMT_VAAPI_MOCO] = {
3fa70a3b
SS
1071 .name = "vaapi_moco",
1072 .log2_chroma_w = 1,
1073 .log2_chroma_h = 1,
e6c4ac7b 1074 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 1075 },
716d413c 1076 [AV_PIX_FMT_VAAPI_IDCT] = {
3fa70a3b
SS
1077 .name = "vaapi_idct",
1078 .log2_chroma_w = 1,
1079 .log2_chroma_h = 1,
e6c4ac7b 1080 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 1081 },
716d413c 1082 [AV_PIX_FMT_VAAPI_VLD] = {
3fa70a3b
SS
1083 .name = "vaapi_vld",
1084 .log2_chroma_w = 1,
1085 .log2_chroma_h = 1,
e6c4ac7b 1086 .flags = AV_PIX_FMT_FLAG_HWACCEL,
3fa70a3b 1087 },
d264c720
MT
1088#else
1089 [AV_PIX_FMT_VAAPI] = {
1090 .name = "vaapi",
1091 .log2_chroma_w = 1,
1092 .log2_chroma_h = 1,
1093 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1094 },
1095#endif
716d413c 1096 [AV_PIX_FMT_VDA_VLD] = {
ac3dbb4d
SZ
1097 .name = "vda_vld",
1098 .log2_chroma_w = 1,
1099 .log2_chroma_h = 1,
e6c4ac7b 1100 .flags = AV_PIX_FMT_FLAG_HWACCEL,
ac3dbb4d 1101 },
716d413c 1102 [AV_PIX_FMT_YUV420P9LE] = {
42239ced 1103 .name = "yuv420p9le",
4a59eca9
TB
1104 .nb_components = 3,
1105 .log2_chroma_w = 1,
1106 .log2_chroma_h = 1,
42239ced 1107 .comp = {
2268db2c
VG
1108 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1109 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1110 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
42239ced 1111 },
e6c4ac7b 1112 .flags = AV_PIX_FMT_FLAG_PLANAR,
42239ced 1113 },
716d413c 1114 [AV_PIX_FMT_YUV420P9BE] = {
42239ced 1115 .name = "yuv420p9be",
4a59eca9
TB
1116 .nb_components = 3,
1117 .log2_chroma_w = 1,
1118 .log2_chroma_h = 1,
42239ced 1119 .comp = {
2268db2c
VG
1120 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1121 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1122 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
42239ced 1123 },
e6c4ac7b 1124 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
42239ced 1125 },
716d413c 1126 [AV_PIX_FMT_YUV420P10LE] = {
42239ced 1127 .name = "yuv420p10le",
4a59eca9
TB
1128 .nb_components = 3,
1129 .log2_chroma_w = 1,
1130 .log2_chroma_h = 1,
42239ced 1131 .comp = {
2268db2c
VG
1132 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1133 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1134 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
42239ced 1135 },
e6c4ac7b 1136 .flags = AV_PIX_FMT_FLAG_PLANAR,
42239ced 1137 },
716d413c 1138 [AV_PIX_FMT_YUV420P10BE] = {
42239ced 1139 .name = "yuv420p10be",
4a59eca9
TB
1140 .nb_components = 3,
1141 .log2_chroma_w = 1,
1142 .log2_chroma_h = 1,
42239ced 1143 .comp = {
2268db2c
VG
1144 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1145 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1146 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
42239ced 1147 },
e6c4ac7b 1148 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
42239ced 1149 },
85406e7a
LB
1150 [AV_PIX_FMT_YUV420P12LE] = {
1151 .name = "yuv420p12le",
1152 .nb_components = 3,
1153 .log2_chroma_w = 1,
1154 .log2_chroma_h = 1,
1155 .comp = {
1156 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1157 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1158 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1159 },
1160 .flags = AV_PIX_FMT_FLAG_PLANAR,
1161 },
1162 [AV_PIX_FMT_YUV420P12BE] = {
1163 .name = "yuv420p12be",
1164 .nb_components = 3,
1165 .log2_chroma_w = 1,
1166 .log2_chroma_h = 1,
1167 .comp = {
1168 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1169 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1170 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1171 },
1172 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1173 },
716d413c 1174 [AV_PIX_FMT_YUV420P16LE] = {
35f6c154 1175 .name = "yuv420p16le",
4a59eca9
TB
1176 .nb_components = 3,
1177 .log2_chroma_w = 1,
1178 .log2_chroma_h = 1,
75801da5 1179 .comp = {
2268db2c
VG
1180 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1181 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1182 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1183 },
e6c4ac7b 1184 .flags = AV_PIX_FMT_FLAG_PLANAR,
75801da5 1185 },
716d413c 1186 [AV_PIX_FMT_YUV420P16BE] = {
35f6c154 1187 .name = "yuv420p16be",
4a59eca9
TB
1188 .nb_components = 3,
1189 .log2_chroma_w = 1,
1190 .log2_chroma_h = 1,
75801da5 1191 .comp = {
2268db2c
VG
1192 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1193 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1194 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1195 },
e6c4ac7b 1196 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
75801da5 1197 },
716d413c 1198 [AV_PIX_FMT_YUV422P9LE] = {
dc49bf12 1199 .name = "yuv422p9le",
4a59eca9
TB
1200 .nb_components = 3,
1201 .log2_chroma_w = 1,
1202 .log2_chroma_h = 0,
dc49bf12 1203 .comp = {
2268db2c
VG
1204 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1205 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1206 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
dc49bf12 1207 },
e6c4ac7b 1208 .flags = AV_PIX_FMT_FLAG_PLANAR,
dc49bf12 1209 },
716d413c 1210 [AV_PIX_FMT_YUV422P9BE] = {
dc49bf12 1211 .name = "yuv422p9be",
4a59eca9
TB
1212 .nb_components = 3,
1213 .log2_chroma_w = 1,
1214 .log2_chroma_h = 0,
dc49bf12 1215 .comp = {
2268db2c
VG
1216 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1217 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1218 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
dc49bf12 1219 },
e6c4ac7b 1220 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
dc49bf12 1221 },
716d413c 1222 [AV_PIX_FMT_YUV422P10LE] = {
5c511ad4 1223 .name = "yuv422p10le",
4a59eca9
TB
1224 .nb_components = 3,
1225 .log2_chroma_w = 1,
1226 .log2_chroma_h = 0,
5c511ad4 1227 .comp = {
2268db2c
VG
1228 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1229 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1230 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
5c511ad4 1231 },
e6c4ac7b 1232 .flags = AV_PIX_FMT_FLAG_PLANAR,
5c511ad4 1233 },
716d413c 1234 [AV_PIX_FMT_YUV422P10BE] = {
5c511ad4 1235 .name = "yuv422p10be",
4a59eca9
TB
1236 .nb_components = 3,
1237 .log2_chroma_w = 1,
1238 .log2_chroma_h = 0,
5c511ad4 1239 .comp = {
2268db2c
VG
1240 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1241 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1242 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
5c511ad4 1243 },
e6c4ac7b 1244 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
5c511ad4 1245 },
0aebbbd0
LB
1246 [AV_PIX_FMT_YUV422P12LE] = {
1247 .name = "yuv422p12le",
1248 .nb_components = 3,
1249 .log2_chroma_w = 1,
1250 .log2_chroma_h = 0,
1251 .comp = {
1252 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1253 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1254 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1255 },
1256 .flags = AV_PIX_FMT_FLAG_PLANAR,
1257 },
1258 [AV_PIX_FMT_YUV422P12BE] = {
1259 .name = "yuv422p12be",
1260 .nb_components = 3,
1261 .log2_chroma_w = 1,
1262 .log2_chroma_h = 0,
1263 .comp = {
1264 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1265 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1266 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1267 },
1268 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1269 },
716d413c 1270 [AV_PIX_FMT_YUV422P16LE] = {
35f6c154 1271 .name = "yuv422p16le",
4a59eca9
TB
1272 .nb_components = 3,
1273 .log2_chroma_w = 1,
1274 .log2_chroma_h = 0,
75801da5 1275 .comp = {
2268db2c
VG
1276 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1277 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1278 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1279 },
e6c4ac7b 1280 .flags = AV_PIX_FMT_FLAG_PLANAR,
75801da5 1281 },
716d413c 1282 [AV_PIX_FMT_YUV422P16BE] = {
35f6c154 1283 .name = "yuv422p16be",
4a59eca9
TB
1284 .nb_components = 3,
1285 .log2_chroma_w = 1,
1286 .log2_chroma_h = 0,
75801da5 1287 .comp = {
2268db2c
VG
1288 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1289 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1290 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1291 },
e6c4ac7b 1292 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
75801da5 1293 },
716d413c 1294 [AV_PIX_FMT_YUV444P16LE] = {
35f6c154 1295 .name = "yuv444p16le",
4a59eca9
TB
1296 .nb_components = 3,
1297 .log2_chroma_w = 0,
1298 .log2_chroma_h = 0,
75801da5 1299 .comp = {
2268db2c
VG
1300 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1301 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1302 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1303 },
e6c4ac7b 1304 .flags = AV_PIX_FMT_FLAG_PLANAR,
75801da5 1305 },
716d413c 1306 [AV_PIX_FMT_YUV444P16BE] = {
35f6c154 1307 .name = "yuv444p16be",
4a59eca9
TB
1308 .nb_components = 3,
1309 .log2_chroma_w = 0,
1310 .log2_chroma_h = 0,
75801da5 1311 .comp = {
2268db2c
VG
1312 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1313 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1314 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
75801da5 1315 },
e6c4ac7b 1316 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
75801da5 1317 },
9bd6ea56
LB
1318 [AV_PIX_FMT_YUV444P12LE] = {
1319 .name = "yuv444p12le",
1320 .nb_components = 3,
1321 .log2_chroma_w = 0,
1322 .log2_chroma_h = 0,
1323 .comp = {
1324 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1325 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1326 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1327 },
1328 .flags = AV_PIX_FMT_FLAG_PLANAR,
1329 },
1330 [AV_PIX_FMT_YUV444P12BE] = {
1331 .name = "yuv444p12be",
1332 .nb_components = 3,
1333 .log2_chroma_w = 0,
1334 .log2_chroma_h = 0,
1335 .comp = {
1336 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1337 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1338 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1339 },
1340 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1341 },
716d413c 1342 [AV_PIX_FMT_YUV444P10LE] = {
103278f7 1343 .name = "yuv444p10le",
4a59eca9
TB
1344 .nb_components = 3,
1345 .log2_chroma_w = 0,
1346 .log2_chroma_h = 0,
103278f7 1347 .comp = {
2268db2c
VG
1348 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1349 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1350 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
103278f7 1351 },
e6c4ac7b 1352 .flags = AV_PIX_FMT_FLAG_PLANAR,
103278f7 1353 },
716d413c 1354 [AV_PIX_FMT_YUV444P10BE] = {
103278f7 1355 .name = "yuv444p10be",
4a59eca9
TB
1356 .nb_components = 3,
1357 .log2_chroma_w = 0,
1358 .log2_chroma_h = 0,
103278f7 1359 .comp = {
2268db2c
VG
1360 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1361 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1362 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
103278f7 1363 },
e6c4ac7b 1364 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
103278f7 1365 },
716d413c 1366 [AV_PIX_FMT_YUV444P9LE] = {
103278f7 1367 .name = "yuv444p9le",
4a59eca9
TB
1368 .nb_components = 3,
1369 .log2_chroma_w = 0,
1370 .log2_chroma_h = 0,
103278f7 1371 .comp = {
2268db2c
VG
1372 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1373 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1374 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
103278f7 1375 },
e6c4ac7b 1376 .flags = AV_PIX_FMT_FLAG_PLANAR,
103278f7 1377 },
716d413c 1378 [AV_PIX_FMT_YUV444P9BE] = {
103278f7 1379 .name = "yuv444p9be",
4a59eca9
TB
1380 .nb_components = 3,
1381 .log2_chroma_w = 0,
1382 .log2_chroma_h = 0,
103278f7 1383 .comp = {
2268db2c
VG
1384 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1385 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1386 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
103278f7 1387 },
e6c4ac7b 1388 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
103278f7 1389 },
d8039ef8
SL
1390 [AV_PIX_FMT_D3D11VA_VLD] = {
1391 .name = "d3d11va_vld",
1392 .log2_chroma_w = 1,
1393 .log2_chroma_h = 1,
1394 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1395 },
716d413c 1396 [AV_PIX_FMT_DXVA2_VLD] = {
92c6a099
LA
1397 .name = "dxva2_vld",
1398 .log2_chroma_w = 1,
1399 .log2_chroma_h = 1,
e6c4ac7b 1400 .flags = AV_PIX_FMT_FLAG_HWACCEL,
92c6a099 1401 },
e96c3b81
VG
1402 [AV_PIX_FMT_YA8] = {
1403 .name = "ya8",
4a59eca9 1404 .nb_components = 2,
4744f896 1405 .comp = {
2268db2c
VG
1406 { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
1407 { 0, 2, 1, 0, 8, 1, 7, 2 }, /* A */
4744f896 1408 },
e6c4ac7b 1409 .flags = AV_PIX_FMT_FLAG_ALPHA,
e96c3b81 1410 .alias = "gray8a",
4744f896 1411 },
e9abafca
VG
1412 [AV_PIX_FMT_YA16LE] = {
1413 .name = "ya16le",
1414 .nb_components = 2,
1415 .comp = {
2268db2c
VG
1416 { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1417 { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
e9abafca
VG
1418 },
1419 .flags = AV_PIX_FMT_FLAG_ALPHA,
1420 },
1421 [AV_PIX_FMT_YA16BE] = {
1422 .name = "ya16be",
1423 .nb_components = 2,
1424 .comp = {
2268db2c
VG
1425 { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1426 { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
e9abafca
VG
1427 },
1428 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
1429 },
716d413c 1430 [AV_PIX_FMT_GBRP] = {
bd97b2e1 1431 .name = "gbrp",
4a59eca9
TB
1432 .nb_components = 3,
1433 .log2_chroma_w = 0,
1434 .log2_chroma_h = 0,
bd97b2e1 1435 .comp = {
e336c51e 1436 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
2268db2c
VG
1437 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1438 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
bd97b2e1 1439 },
e6c4ac7b 1440 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1441 },
716d413c 1442 [AV_PIX_FMT_GBRP9LE] = {
bd97b2e1 1443 .name = "gbrp9le",
4a59eca9
TB
1444 .nb_components = 3,
1445 .log2_chroma_w = 0,
1446 .log2_chroma_h = 0,
bd97b2e1 1447 .comp = {
e336c51e 1448 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
2268db2c
VG
1449 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1450 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
bd97b2e1 1451 },
e6c4ac7b 1452 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1453 },
716d413c 1454 [AV_PIX_FMT_GBRP9BE] = {
bd97b2e1 1455 .name = "gbrp9be",
4a59eca9
TB
1456 .nb_components = 3,
1457 .log2_chroma_w = 0,
1458 .log2_chroma_h = 0,
bd97b2e1 1459 .comp = {
e336c51e 1460 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
2268db2c
VG
1461 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1462 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
bd97b2e1 1463 },
e6c4ac7b 1464 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1465 },
716d413c 1466 [AV_PIX_FMT_GBRP10LE] = {
bd97b2e1 1467 .name = "gbrp10le",
4a59eca9
TB
1468 .nb_components = 3,
1469 .log2_chroma_w = 0,
1470 .log2_chroma_h = 0,
bd97b2e1 1471 .comp = {
e336c51e 1472 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
2268db2c
VG
1473 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1474 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
bd97b2e1 1475 },
e6c4ac7b 1476 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1477 },
716d413c 1478 [AV_PIX_FMT_GBRP10BE] = {
bd97b2e1 1479 .name = "gbrp10be",
4a59eca9
TB
1480 .nb_components = 3,
1481 .log2_chroma_w = 0,
1482 .log2_chroma_h = 0,
bd97b2e1 1483 .comp = {
e336c51e 1484 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
2268db2c
VG
1485 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1486 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
bd97b2e1 1487 },
e6c4ac7b 1488 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1489 },
1e93aa69
MN
1490 [AV_PIX_FMT_GBRP12LE] = {
1491 .name = "gbrp12le",
1492 .nb_components = 3,
1493 .log2_chroma_w = 0,
1494 .log2_chroma_h = 0,
1495 .comp = {
1496 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1497 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1498 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1499 },
1500 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1501 },
1502 [AV_PIX_FMT_GBRP12BE] = {
1503 .name = "gbrp12be",
1504 .nb_components = 3,
1505 .log2_chroma_w = 0,
1506 .log2_chroma_h = 0,
1507 .comp = {
1508 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1509 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1510 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1511 },
1512 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1513 },
716d413c 1514 [AV_PIX_FMT_GBRP16LE] = {
bd97b2e1 1515 .name = "gbrp16le",
4a59eca9
TB
1516 .nb_components = 3,
1517 .log2_chroma_w = 0,
1518 .log2_chroma_h = 0,
bd97b2e1 1519 .comp = {
e336c51e 1520 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
2268db2c
VG
1521 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1522 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
bd97b2e1 1523 },
e6c4ac7b 1524 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1525 },
716d413c 1526 [AV_PIX_FMT_GBRP16BE] = {
bd97b2e1 1527 .name = "gbrp16be",
4a59eca9
TB
1528 .nb_components = 3,
1529 .log2_chroma_w = 0,
1530 .log2_chroma_h = 0,
bd97b2e1 1531 .comp = {
e336c51e 1532 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
2268db2c
VG
1533 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1534 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
bd97b2e1 1535 },
e6c4ac7b 1536 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
bd97b2e1 1537 },
0e6c7dfa
PM
1538 [AV_PIX_FMT_GBRAP] = {
1539 .name = "gbrap",
1540 .nb_components = 4,
1541 .log2_chroma_w = 0,
1542 .log2_chroma_h = 0,
1543 .comp = {
e336c51e 1544 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
2268db2c
VG
1545 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1546 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
2268db2c 1547 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
0e6c7dfa 1548 },
592a0405
VG
1549 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1550 AV_PIX_FMT_FLAG_ALPHA,
0e6c7dfa
PM
1551 },
1552 [AV_PIX_FMT_GBRAP16LE] = {
1553 .name = "gbrap16le",
1554 .nb_components = 4,
1555 .log2_chroma_w = 0,
1556 .log2_chroma_h = 0,
1557 .comp = {
e336c51e 1558 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
2268db2c
VG
1559 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1560 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
2268db2c 1561 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
0e6c7dfa 1562 },
592a0405
VG
1563 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1564 AV_PIX_FMT_FLAG_ALPHA,
0e6c7dfa
PM
1565 },
1566 [AV_PIX_FMT_GBRAP16BE] = {
1567 .name = "gbrap16be",
1568 .nb_components = 4,
1569 .log2_chroma_w = 0,
1570 .log2_chroma_h = 0,
1571 .comp = {
e336c51e 1572 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
2268db2c
VG
1573 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1574 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
2268db2c 1575 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
0e6c7dfa 1576 },
592a0405
VG
1577 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
1578 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
0e6c7dfa 1579 },
169fb94f
RDC
1580 [AV_PIX_FMT_VDPAU] = {
1581 .name = "vdpau",
1582 .log2_chroma_w = 1,
1583 .log2_chroma_h = 1,
e6c4ac7b 1584 .flags = AV_PIX_FMT_FLAG_HWACCEL,
169fb94f 1585 },
8c652645
NB
1586 [AV_PIX_FMT_XYZ12LE] = {
1587 .name = "xyz12le",
1588 .nb_components = 3,
1589 .log2_chroma_w = 0,
1590 .log2_chroma_h = 0,
1591 .comp = {
2268db2c
VG
1592 { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1593 { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1594 { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
8c652645
NB
1595 },
1596 /*.flags = -- not used*/
1597 },
1598 [AV_PIX_FMT_XYZ12BE] = {
1599 .name = "xyz12be",
1600 .nb_components = 3,
1601 .log2_chroma_w = 0,
1602 .log2_chroma_h = 0,
1603 .comp = {
2268db2c
VG
1604 { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1605 { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1606 { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
8c652645 1607 },
e6c4ac7b 1608 .flags = AV_PIX_FMT_FLAG_BE,
8c652645 1609 },
e208e6d2
KK
1610 [AV_PIX_FMT_NV16] = {
1611 .name = "nv16",
1612 .nb_components = 3,
1613 .log2_chroma_w = 1,
1614 .log2_chroma_h = 0,
1615 .comp = {
2268db2c
VG
1616 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
1617 { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
1618 { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
e208e6d2
KK
1619 },
1620 .flags = AV_PIX_FMT_FLAG_PLANAR,
1621 },
1622 [AV_PIX_FMT_NV20LE] = {
1623 .name = "nv20le",
1624 .nb_components = 3,
1625 .log2_chroma_w = 1,
1626 .log2_chroma_h = 0,
1627 .comp = {
2268db2c
VG
1628 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1629 { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1630 { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
e208e6d2
KK
1631 },
1632 .flags = AV_PIX_FMT_FLAG_PLANAR,
1633 },
1634 [AV_PIX_FMT_NV20BE] = {
1635 .name = "nv20be",
1636 .nb_components = 3,
1637 .log2_chroma_w = 1,
1638 .log2_chroma_h = 0,
1639 .comp = {
2268db2c
VG
1640 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1641 { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1642 { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
e208e6d2
KK
1643 },
1644 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
1645 },
66e6c8a7
AK
1646 [AV_PIX_FMT_VDA] = {
1647 .name = "vda",
1648 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1649 },
5b1d9cee
AK
1650 [AV_PIX_FMT_QSV] = {
1651 .name = "qsv",
1652 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1653 },
c4845616 1654 [AV_PIX_FMT_MMAL] = {
1655 .name = "mmal",
1656 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1657 },
7bc780cd
AK
1658 [AV_PIX_FMT_CUDA] = {
1659 .name = "cuda",
1660 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1661 },
b7c5f885
HL
1662 [AV_PIX_FMT_P010LE] = {
1663 .name = "p010le",
1664 .nb_components = 3,
1665 .log2_chroma_w = 1,
1666 .log2_chroma_h = 1,
1667 .comp = {
1668 { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
1669 { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
1670 { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
1671 },
1672 .flags = AV_PIX_FMT_FLAG_PLANAR,
1673 },
1674 [AV_PIX_FMT_P010BE] = {
1675 .name = "p010be",
1676 .nb_components = 3,
1677 .log2_chroma_w = 1,
1678 .log2_chroma_h = 1,
1679 .comp = {
1680 { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
1681 { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
1682 { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
1683 },
1684 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
1685 },
030c8be7
PM
1686 [AV_PIX_FMT_GBRAP10LE] = {
1687 .name = "gbrap10le",
1688 .nb_components = 4,
1689 .log2_chroma_w = 0,
1690 .log2_chroma_h = 0,
1691 .comp = {
1692 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
1693 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1694 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
1695 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
1696 },
1697 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1698 AV_PIX_FMT_FLAG_ALPHA,
1699 },
1700 [AV_PIX_FMT_GBRAP10BE] = {
1701 .name = "gbrap10be",
1702 .nb_components = 4,
1703 .log2_chroma_w = 0,
1704 .log2_chroma_h = 0,
1705 .comp = {
1706 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
1707 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1708 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
1709 { 3, 2, 0, 0, 10, 1, 9, 1 }, /* A */
1710 },
1711 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
1712 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1713 },
81f1f6c3
KK
1714 [AV_PIX_FMT_GBRAP12LE] = {
1715 .name = "gbrap12le",
1716 .nb_components = 4,
1717 .log2_chroma_w = 0,
1718 .log2_chroma_h = 0,
1719 .comp = {
1720 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1721 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1722 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1723 { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
1724 },
1725 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1726 AV_PIX_FMT_FLAG_ALPHA,
1727 },
1728 [AV_PIX_FMT_GBRAP12BE] = {
1729 .name = "gbrap12be",
1730 .nb_components = 4,
1731 .log2_chroma_w = 0,
1732 .log2_chroma_h = 0,
1733 .comp = {
1734 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1735 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1736 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1737 { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
1738 },
1739 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
1740 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1741 },
9b61d838 1742};
2268db2c
VG
1743#if FF_API_PLUS1_MINUS1
1744FF_ENABLE_DEPRECATION_WARNINGS
1745#endif
5efccce2 1746
fd9212f2 1747static const char * const color_range_names[] = {
bcc07e25
VG
1748 [AVCOL_RANGE_UNSPECIFIED] = "unknown",
1749 [AVCOL_RANGE_MPEG] = "tv",
1750 [AVCOL_RANGE_JPEG] = "pc",
5a419b2d
VG
1751};
1752
fd9212f2 1753static const char * const color_primaries_names[] = {
bcc07e25
VG
1754 [AVCOL_PRI_RESERVED0] = "reserved",
1755 [AVCOL_PRI_BT709] = "bt709",
1756 [AVCOL_PRI_UNSPECIFIED] = "unknown",
1757 [AVCOL_PRI_RESERVED] = "reserved",
1758 [AVCOL_PRI_BT470M] = "bt470m",
1759 [AVCOL_PRI_BT470BG] = "bt470bg",
1760 [AVCOL_PRI_SMPTE170M] = "smpte170m",
1761 [AVCOL_PRI_SMPTE240M] = "smpte240m",
1762 [AVCOL_PRI_FILM] = "film",
1763 [AVCOL_PRI_BT2020] = "bt2020",
f172e22d 1764 [AVCOL_PRI_SMPTE428] = "smpte428",
a8164323
VG
1765 [AVCOL_PRI_SMPTE431] = "smpte431",
1766 [AVCOL_PRI_SMPTE432] = "smpte432",
0d9b9bd3 1767 [AVCOL_PRI_JEDEC_P22] = "jedec-p22",
5a419b2d
VG
1768};
1769
fd9212f2 1770static const char * const color_transfer_names[] = {
bcc07e25
VG
1771 [AVCOL_TRC_RESERVED0] = "reserved",
1772 [AVCOL_TRC_BT709] = "bt709",
1773 [AVCOL_TRC_UNSPECIFIED] = "unknown",
1774 [AVCOL_TRC_RESERVED] = "reserved",
1775 [AVCOL_TRC_GAMMA22] = "bt470m",
1776 [AVCOL_TRC_GAMMA28] = "bt470bg",
1777 [AVCOL_TRC_SMPTE170M] = "smpte170m",
1778 [AVCOL_TRC_SMPTE240M] = "smpte240m",
1779 [AVCOL_TRC_LINEAR] = "linear",
1780 [AVCOL_TRC_LOG] = "log100",
1781 [AVCOL_TRC_LOG_SQRT] = "log316",
1782 [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
1783 [AVCOL_TRC_BT1361_ECG] = "bt1361e",
1784 [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
1785 [AVCOL_TRC_BT2020_10] = "bt2020-10",
444a3626 1786 [AVCOL_TRC_BT2020_12] = "bt2020-12",
f172e22d
VG
1787 [AVCOL_TRC_SMPTE2084] = "smpte2084",
1788 [AVCOL_TRC_SMPTE428] = "smpte428",
5d560d38 1789 [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
5a419b2d
VG
1790};
1791
fd9212f2 1792static const char * const color_space_names[] = {
bcc07e25
VG
1793 [AVCOL_SPC_RGB] = "gbr",
1794 [AVCOL_SPC_BT709] = "bt709",
1795 [AVCOL_SPC_UNSPECIFIED] = "unknown",
1796 [AVCOL_SPC_RESERVED] = "reserved",
1797 [AVCOL_SPC_FCC] = "fcc",
1798 [AVCOL_SPC_BT470BG] = "bt470bg",
1799 [AVCOL_SPC_SMPTE170M] = "smpte170m",
1800 [AVCOL_SPC_SMPTE240M] = "smpte240m",
17dac56b 1801 [AVCOL_SPC_YCGCO] = "ycgco",
bcc07e25
VG
1802 [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
1803 [AVCOL_SPC_BT2020_CL] = "bt2020c",
a8164323 1804 [AVCOL_SPC_SMPTE2085] = "smpte2085",
5a419b2d
VG
1805};
1806
fd9212f2 1807static const char * const chroma_location_names[] = {
bcc07e25
VG
1808 [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
1809 [AVCHROMA_LOC_LEFT] = "left",
1810 [AVCHROMA_LOC_CENTER] = "center",
1811 [AVCHROMA_LOC_TOPLEFT] = "topleft",
1812 [AVCHROMA_LOC_TOP] = "top",
1813 [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
1814 [AVCHROMA_LOC_BOTTOM] = "bottom",
5a419b2d
VG
1815};
1816
716d413c 1817static enum AVPixelFormat get_pix_fmt_internal(const char *name)
80a07f6e 1818{
716d413c 1819 enum AVPixelFormat pix_fmt;
80a07f6e 1820
716d413c 1821 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
80a07f6e 1822 if (av_pix_fmt_descriptors[pix_fmt].name &&
d2962e9f
LB
1823 (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1824 av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
80a07f6e
SS
1825 return pix_fmt;
1826
716d413c 1827 return AV_PIX_FMT_NONE;
80a07f6e
SS
1828}
1829
716d413c 1830const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
8f653e28 1831{
716d413c 1832 return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
8f653e28
SS
1833 av_pix_fmt_descriptors[pix_fmt].name : NULL;
1834}
1835
80a07f6e
SS
1836#if HAVE_BIGENDIAN
1837# define X_NE(be, le) be
1838#else
1839# define X_NE(be, le) le
1840#endif
1841
716d413c 1842enum AVPixelFormat av_get_pix_fmt(const char *name)
80a07f6e 1843{
716d413c 1844 enum AVPixelFormat pix_fmt;
80a07f6e
SS
1845
1846 if (!strcmp(name, "rgb32"))
1847 name = X_NE("argb", "bgra");
1848 else if (!strcmp(name, "bgr32"))
1849 name = X_NE("abgr", "rgba");
1850
1851 pix_fmt = get_pix_fmt_internal(name);
716d413c 1852 if (pix_fmt == AV_PIX_FMT_NONE) {
80a07f6e
SS
1853 char name2[32];
1854
1855 snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
1856 pix_fmt = get_pix_fmt_internal(name2);
1857 }
d264c720
MT
1858
1859#if FF_API_VAAPI
1860 if (pix_fmt == AV_PIX_FMT_NONE && !strcmp(name, "vaapi"))
1861 pix_fmt = AV_PIX_FMT_VAAPI;
1862#endif
80a07f6e
SS
1863 return pix_fmt;
1864}
1865
5efccce2
SS
1866int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
1867{
1868 int c, bits = 0;
1869 int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
1870
b8873c2a 1871 for (c = 0; c < pixdesc->nb_components; c++) {
4a59eca9 1872 int s = c == 1 || c == 2 ? 0 : log2_pixels;
2268db2c 1873 bits += pixdesc->comp[c].depth << s;
5efccce2
SS
1874 }
1875
1876 return bits >> log2_pixels;
1877}
bb4afa13 1878
b2e059a1
LB
1879char *av_get_pix_fmt_string(char *buf, int buf_size,
1880 enum AVPixelFormat pix_fmt)
bb4afa13
SS
1881{
1882 /* print header */
1883 if (pix_fmt < 0) {
4a59eca9 1884 snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
bb4afa13
SS
1885 } else {
1886 const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
4a59eca9
TB
1887 snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
1888 pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
bb4afa13
SS
1889 }
1890
1891 return buf;
1892}
d2fcb356
AK
1893
1894const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1895{
1896 if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1897 return NULL;
1898 return &av_pix_fmt_descriptors[pix_fmt];
1899}
1900
1901const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
1902{
1903 if (!prev)
1904 return &av_pix_fmt_descriptors[0];
1905 if (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1)
1906 return prev + 1;
1907 return NULL;
1908}
1909
1910enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
1911{
1912 if (desc < av_pix_fmt_descriptors ||
1913 desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
1914 return AV_PIX_FMT_NONE;
1915
1916 return desc - av_pix_fmt_descriptors;
1917}
c1a02e88
LB
1918
1919int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
1920 int *h_shift, int *v_shift)
1921{
1922 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1923 if (!desc)
1924 return AVERROR(ENOSYS);
1925 *h_shift = desc->log2_chroma_w;
1926 *v_shift = desc->log2_chroma_h;
1927
1928 return 0;
1929}
2c328a90
AK
1930
1931int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
1932{
1933 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1934 int i, planes[4] = { 0 }, ret = 0;
1935
1936 if (!desc)
1937 return AVERROR(EINVAL);
1938
1939 for (i = 0; i < desc->nb_components; i++)
1940 planes[desc->comp[i].plane] = 1;
1941 for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
1942 ret += planes[i];
1943 return ret;
1944}
74652af8
JG
1945
1946
1947enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
1948{
1949#define PIX_FMT_SWAP_ENDIANNESS(fmt) \
1950 case AV_PIX_FMT_ ## fmt ## BE: return AV_PIX_FMT_ ## fmt ## LE; \
1951 case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE
1952
1953 switch (pix_fmt) {
7471352f 1954 PIX_FMT_SWAP_ENDIANNESS(GRAY12);
74652af8 1955 PIX_FMT_SWAP_ENDIANNESS(GRAY16);
e9abafca 1956 PIX_FMT_SWAP_ENDIANNESS(YA16);
74652af8
JG
1957 PIX_FMT_SWAP_ENDIANNESS(RGB48);
1958 PIX_FMT_SWAP_ENDIANNESS(RGB565);
1959 PIX_FMT_SWAP_ENDIANNESS(RGB555);
1960 PIX_FMT_SWAP_ENDIANNESS(RGB444);
1961 PIX_FMT_SWAP_ENDIANNESS(BGR48);
1962 PIX_FMT_SWAP_ENDIANNESS(BGR565);
1963 PIX_FMT_SWAP_ENDIANNESS(BGR555);
1964 PIX_FMT_SWAP_ENDIANNESS(BGR444);
1965
1966 PIX_FMT_SWAP_ENDIANNESS(YUV420P9);
1967 PIX_FMT_SWAP_ENDIANNESS(YUV422P9);
1968 PIX_FMT_SWAP_ENDIANNESS(YUV444P9);
1969 PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
1970 PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
1971 PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
85406e7a 1972 PIX_FMT_SWAP_ENDIANNESS(YUV420P12);
0aebbbd0 1973 PIX_FMT_SWAP_ENDIANNESS(YUV422P12);
9bd6ea56 1974 PIX_FMT_SWAP_ENDIANNESS(YUV444P12);
74652af8
JG
1975 PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
1976 PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
1977 PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
1978
1979 PIX_FMT_SWAP_ENDIANNESS(GBRP9);
1980 PIX_FMT_SWAP_ENDIANNESS(GBRP10);
1e93aa69 1981 PIX_FMT_SWAP_ENDIANNESS(GBRP12);
74652af8
JG
1982 PIX_FMT_SWAP_ENDIANNESS(GBRP16);
1983 PIX_FMT_SWAP_ENDIANNESS(YUVA420P9);
1984 PIX_FMT_SWAP_ENDIANNESS(YUVA422P9);
1985 PIX_FMT_SWAP_ENDIANNESS(YUVA444P9);
1986 PIX_FMT_SWAP_ENDIANNESS(YUVA420P10);
1987 PIX_FMT_SWAP_ENDIANNESS(YUVA422P10);
1988 PIX_FMT_SWAP_ENDIANNESS(YUVA444P10);
1989 PIX_FMT_SWAP_ENDIANNESS(YUVA420P16);
1990 PIX_FMT_SWAP_ENDIANNESS(YUVA422P16);
1991 PIX_FMT_SWAP_ENDIANNESS(YUVA444P16);
1992
1993 PIX_FMT_SWAP_ENDIANNESS(XYZ12);
80035db8
JG
1994 PIX_FMT_SWAP_ENDIANNESS(NV20);
1995 PIX_FMT_SWAP_ENDIANNESS(RGBA64);
1996 PIX_FMT_SWAP_ENDIANNESS(BGRA64);
74652af8
JG
1997 default:
1998 return AV_PIX_FMT_NONE;
1999 }
2000#undef PIX_FMT_SWAP_ENDIANNESS
2001}
5a419b2d
VG
2002
2003const char *av_color_range_name(enum AVColorRange range)
2004{
2005 return (unsigned) range < AVCOL_RANGE_NB ?
2006 color_range_names[range] : NULL;
2007}
2008
2009const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2010{
2011 return (unsigned) primaries < AVCOL_PRI_NB ?
2012 color_primaries_names[primaries] : NULL;
2013}
2014
2015const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
2016{
2017 return (unsigned) transfer < AVCOL_TRC_NB ?
2018 color_transfer_names[transfer] : NULL;
2019}
2020
2021const char *av_color_space_name(enum AVColorSpace space)
2022{
2023 return (unsigned) space < AVCOL_SPC_NB ?
2024 color_space_names[space] : NULL;
2025}
2026
2027const char *av_chroma_location_name(enum AVChromaLocation location)
2028{
2029 return (unsigned) location < AVCHROMA_LOC_NB ?
2030 chroma_location_names[location] : NULL;
2031}
2032