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