e4e5674a66a50dff8bc6bb56d8f75cc52afb1bdc
[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 [AV_PIX_FMT_UYVY422] = {
317 .name = "uyvy422",
318 .nb_components = 3,
319 .log2_chroma_w = 1,
320 .log2_chroma_h = 0,
321 .comp = {
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 */
325 },
326 },
327 [AV_PIX_FMT_UYYVYY411] = {
328 .name = "uyyvyy411",
329 .nb_components = 3,
330 .log2_chroma_w = 2,
331 .log2_chroma_h = 0,
332 .comp = {
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 */
336 },
337 },
338 [AV_PIX_FMT_BGR8] = {
339 .name = "bgr8",
340 .nb_components = 3,
341 .log2_chroma_w = 0,
342 .log2_chroma_h = 0,
343 .comp = {
344 { 0, 1, 0, 0, 3, 0, 2, 1 }, /* R */
345 { 0, 1, 0, 3, 3, 0, 2, 1 }, /* G */
346 { 0, 1, 0, 6, 2, 0, 1, 1 }, /* B */
347 },
348 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
349 },
350 [AV_PIX_FMT_BGR4] = {
351 .name = "bgr4",
352 .nb_components = 3,
353 .log2_chroma_w = 0,
354 .log2_chroma_h = 0,
355 .comp = {
356 { 0, 4, 3, 0, 1, 3, 0, 4 }, /* R */
357 { 0, 4, 1, 0, 2, 3, 1, 2 }, /* G */
358 { 0, 4, 0, 0, 1, 3, 0, 1 }, /* B */
359 },
360 .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
361 },
362 [AV_PIX_FMT_BGR4_BYTE] = {
363 .name = "bgr4_byte",
364 .nb_components = 3,
365 .log2_chroma_w = 0,
366 .log2_chroma_h = 0,
367 .comp = {
368 { 0, 1, 0, 0, 1, 0, 0, 1 }, /* R */
369 { 0, 1, 0, 1, 2, 0, 1, 1 }, /* G */
370 { 0, 1, 0, 3, 1, 0, 0, 1 }, /* B */
371 },
372 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
373 },
374 [AV_PIX_FMT_RGB8] = {
375 .name = "rgb8",
376 .nb_components = 3,
377 .log2_chroma_w = 0,
378 .log2_chroma_h = 0,
379 .comp = {
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 */
383 },
384 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
385 },
386 [AV_PIX_FMT_RGB4] = {
387 .name = "rgb4",
388 .nb_components = 3,
389 .log2_chroma_w = 0,
390 .log2_chroma_h = 0,
391 .comp = {
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 */
395 },
396 .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
397 },
398 [AV_PIX_FMT_RGB4_BYTE] = {
399 .name = "rgb4_byte",
400 .nb_components = 3,
401 .log2_chroma_w = 0,
402 .log2_chroma_h = 0,
403 .comp = {
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 */
407 },
408 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
409 },
410 [AV_PIX_FMT_NV12] = {
411 .name = "nv12",
412 .nb_components = 3,
413 .log2_chroma_w = 1,
414 .log2_chroma_h = 1,
415 .comp = {
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 */
419 },
420 .flags = AV_PIX_FMT_FLAG_PLANAR,
421 },
422 [AV_PIX_FMT_NV21] = {
423 .name = "nv21",
424 .nb_components = 3,
425 .log2_chroma_w = 1,
426 .log2_chroma_h = 1,
427 .comp = {
428 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
429 { 1, 2, 1, 0, 8, 1, 7, 2 }, /* U */
430 { 1, 2, 0, 0, 8, 1, 7, 1 }, /* V */
431 },
432 .flags = AV_PIX_FMT_FLAG_PLANAR,
433 },
434 [AV_PIX_FMT_ARGB] = {
435 .name = "argb",
436 .nb_components = 4,
437 .log2_chroma_w = 0,
438 .log2_chroma_h = 0,
439 .comp = {
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 */
443 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* A */
444 },
445 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
446 },
447 [AV_PIX_FMT_RGBA] = {
448 .name = "rgba",
449 .nb_components = 4,
450 .log2_chroma_w = 0,
451 .log2_chroma_h = 0,
452 .comp = {
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 */
457 },
458 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
459 },
460 [AV_PIX_FMT_ABGR] = {
461 .name = "abgr",
462 .nb_components = 4,
463 .log2_chroma_w = 0,
464 .log2_chroma_h = 0,
465 .comp = {
466 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* R */
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 */
470 },
471 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
472 },
473 [AV_PIX_FMT_BGRA] = {
474 .name = "bgra",
475 .nb_components = 4,
476 .log2_chroma_w = 0,
477 .log2_chroma_h = 0,
478 .comp = {
479 { 0, 4, 2, 0, 8, 3, 7, 3 }, /* R */
480 { 0, 4, 1, 0, 8, 3, 7, 2 }, /* G */
481 { 0, 4, 0, 0, 8, 3, 7, 1 }, /* B */
482 { 0, 4, 3, 0, 8, 3, 7, 4 }, /* A */
483 },
484 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
485 },
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 },
507 [AV_PIX_FMT_GRAY16BE] = {
508 .name = "gray16be",
509 .nb_components = 1,
510 .log2_chroma_w = 0,
511 .log2_chroma_h = 0,
512 .comp = {
513 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
514 },
515 .flags = AV_PIX_FMT_FLAG_BE,
516 .alias = "y16be",
517 },
518 [AV_PIX_FMT_GRAY16LE] = {
519 .name = "gray16le",
520 .nb_components = 1,
521 .log2_chroma_w = 0,
522 .log2_chroma_h = 0,
523 .comp = {
524 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
525 },
526 .alias = "y16le",
527 },
528 [AV_PIX_FMT_YUV440P] = {
529 .name = "yuv440p",
530 .nb_components = 3,
531 .log2_chroma_w = 0,
532 .log2_chroma_h = 1,
533 .comp = {
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 */
537 },
538 .flags = AV_PIX_FMT_FLAG_PLANAR,
539 },
540 [AV_PIX_FMT_YUVJ440P] = {
541 .name = "yuvj440p",
542 .nb_components = 3,
543 .log2_chroma_w = 0,
544 .log2_chroma_h = 1,
545 .comp = {
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 */
549 },
550 .flags = AV_PIX_FMT_FLAG_PLANAR,
551 },
552 [AV_PIX_FMT_YUVA420P] = {
553 .name = "yuva420p",
554 .nb_components = 4,
555 .log2_chroma_w = 1,
556 .log2_chroma_h = 1,
557 .comp = {
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 */
562 },
563 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
575 },
576 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
588 },
589 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
590 },
591 [AV_PIX_FMT_YUVA420P9BE] = {
592 .name = "yuva420p9be",
593 .nb_components = 4,
594 .log2_chroma_w = 1,
595 .log2_chroma_h = 1,
596 .comp = {
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 */
601 },
602 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
614 },
615 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
627 },
628 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
640 },
641 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
653 },
654 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
666 },
667 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
679 },
680 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
692 },
693 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
705 },
706 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
718 },
719 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
731 },
732 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
744 },
745 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
757 },
758 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
770 },
771 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
783 },
784 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
796 },
797 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
809 },
810 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
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 = {
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 */
822 },
823 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
824 },
825 #if FF_API_VDPAU
826 [AV_PIX_FMT_VDPAU_H264] = {
827 .name = "vdpau_h264",
828 .log2_chroma_w = 1,
829 .log2_chroma_h = 1,
830 .flags = AV_PIX_FMT_FLAG_HWACCEL,
831 },
832 [AV_PIX_FMT_VDPAU_MPEG1] = {
833 .name = "vdpau_mpeg1",
834 .log2_chroma_w = 1,
835 .log2_chroma_h = 1,
836 .flags = AV_PIX_FMT_FLAG_HWACCEL,
837 },
838 [AV_PIX_FMT_VDPAU_MPEG2] = {
839 .name = "vdpau_mpeg2",
840 .log2_chroma_w = 1,
841 .log2_chroma_h = 1,
842 .flags = AV_PIX_FMT_FLAG_HWACCEL,
843 },
844 [AV_PIX_FMT_VDPAU_WMV3] = {
845 .name = "vdpau_wmv3",
846 .log2_chroma_w = 1,
847 .log2_chroma_h = 1,
848 .flags = AV_PIX_FMT_FLAG_HWACCEL,
849 },
850 [AV_PIX_FMT_VDPAU_VC1] = {
851 .name = "vdpau_vc1",
852 .log2_chroma_w = 1,
853 .log2_chroma_h = 1,
854 .flags = AV_PIX_FMT_FLAG_HWACCEL,
855 },
856 [AV_PIX_FMT_VDPAU_MPEG4] = {
857 .name = "vdpau_mpeg4",
858 .log2_chroma_w = 1,
859 .log2_chroma_h = 1,
860 .flags = AV_PIX_FMT_FLAG_HWACCEL,
861 },
862 #endif
863 [AV_PIX_FMT_RGB48BE] = {
864 .name = "rgb48be",
865 .nb_components = 3,
866 .log2_chroma_w = 0,
867 .log2_chroma_h = 0,
868 .comp = {
869 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
870 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
871 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
872 },
873 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE,
874 },
875 [AV_PIX_FMT_RGB48LE] = {
876 .name = "rgb48le",
877 .nb_components = 3,
878 .log2_chroma_w = 0,
879 .log2_chroma_h = 0,
880 .comp = {
881 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* R */
882 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
883 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* B */
884 },
885 .flags = AV_PIX_FMT_FLAG_RGB,
886 },
887 [AV_PIX_FMT_RGBA64BE] = {
888 .name = "rgba64be",
889 .nb_components = 4,
890 .log2_chroma_w = 0,
891 .log2_chroma_h = 0,
892 .comp = {
893 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
894 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
895 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
896 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
897 },
898 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
899 },
900 [AV_PIX_FMT_RGBA64LE] = {
901 .name = "rgba64le",
902 .nb_components = 4,
903 .log2_chroma_w = 0,
904 .log2_chroma_h = 0,
905 .comp = {
906 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* R */
907 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
908 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* B */
909 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
910 },
911 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
912 },
913 [AV_PIX_FMT_RGB565BE] = {
914 .name = "rgb565be",
915 .nb_components = 3,
916 .log2_chroma_w = 0,
917 .log2_chroma_h = 0,
918 .comp = {
919 { 0, 2, -1, 3, 5, 1, 4, 0 }, /* R */
920 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
921 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
922 },
923 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
924 },
925 [AV_PIX_FMT_RGB565LE] = {
926 .name = "rgb565le",
927 .nb_components = 3,
928 .log2_chroma_w = 0,
929 .log2_chroma_h = 0,
930 .comp = {
931 { 0, 2, 1, 3, 5, 1, 4, 2 }, /* R */
932 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
933 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
934 },
935 .flags = AV_PIX_FMT_FLAG_RGB,
936 },
937 [AV_PIX_FMT_RGB555BE] = {
938 .name = "rgb555be",
939 .nb_components = 3,
940 .log2_chroma_w = 0,
941 .log2_chroma_h = 0,
942 .comp = {
943 { 0, 2, -1, 2, 5, 1, 4, 0 }, /* R */
944 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
945 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
946 },
947 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
948 },
949 [AV_PIX_FMT_RGB555LE] = {
950 .name = "rgb555le",
951 .nb_components = 3,
952 .log2_chroma_w = 0,
953 .log2_chroma_h = 0,
954 .comp = {
955 { 0, 2, 1, 2, 5, 1, 4, 2 }, /* R */
956 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
957 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* B */
958 },
959 .flags = AV_PIX_FMT_FLAG_RGB,
960 },
961 [AV_PIX_FMT_RGB444BE] = {
962 .name = "rgb444be",
963 .nb_components = 3,
964 .log2_chroma_w = 0,
965 .log2_chroma_h = 0,
966 .comp = {
967 { 0, 2, -1, 0, 4, 1, 3, 0 }, /* R */
968 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
969 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
970 },
971 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
972 },
973 [AV_PIX_FMT_RGB444LE] = {
974 .name = "rgb444le",
975 .nb_components = 3,
976 .log2_chroma_w = 0,
977 .log2_chroma_h = 0,
978 .comp = {
979 { 0, 2, 1, 0, 4, 1, 3, 2 }, /* R */
980 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
981 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* B */
982 },
983 .flags = AV_PIX_FMT_FLAG_RGB,
984 },
985 [AV_PIX_FMT_BGR48BE] = {
986 .name = "bgr48be",
987 .nb_components = 3,
988 .log2_chroma_w = 0,
989 .log2_chroma_h = 0,
990 .comp = {
991 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
992 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
993 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
994 },
995 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
996 },
997 [AV_PIX_FMT_BGR48LE] = {
998 .name = "bgr48le",
999 .nb_components = 3,
1000 .log2_chroma_w = 0,
1001 .log2_chroma_h = 0,
1002 .comp = {
1003 { 0, 6, 4, 0, 16, 5, 15, 5 }, /* R */
1004 { 0, 6, 2, 0, 16, 5, 15, 3 }, /* G */
1005 { 0, 6, 0, 0, 16, 5, 15, 1 }, /* B */
1006 },
1007 .flags = AV_PIX_FMT_FLAG_RGB,
1008 },
1009 [AV_PIX_FMT_BGRA64BE] = {
1010 .name = "bgra64be",
1011 .nb_components = 4,
1012 .log2_chroma_w = 0,
1013 .log2_chroma_h = 0,
1014 .comp = {
1015 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
1016 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1017 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
1018 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1019 },
1020 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1021 },
1022 [AV_PIX_FMT_BGRA64LE] = {
1023 .name = "bgra64le",
1024 .nb_components = 4,
1025 .log2_chroma_w = 0,
1026 .log2_chroma_h = 0,
1027 .comp = {
1028 { 0, 8, 4, 0, 16, 7, 15, 5 }, /* R */
1029 { 0, 8, 2, 0, 16, 7, 15, 3 }, /* G */
1030 { 0, 8, 0, 0, 16, 7, 15, 1 }, /* B */
1031 { 0, 8, 6, 0, 16, 7, 15, 7 }, /* A */
1032 },
1033 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1034 },
1035 [AV_PIX_FMT_BGR565BE] = {
1036 .name = "bgr565be",
1037 .nb_components = 3,
1038 .log2_chroma_w = 0,
1039 .log2_chroma_h = 0,
1040 .comp = {
1041 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1042 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1043 { 0, 2, -1, 3, 5, 1, 4, 0 }, /* B */
1044 },
1045 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
1046 },
1047 [AV_PIX_FMT_BGR565LE] = {
1048 .name = "bgr565le",
1049 .nb_components = 3,
1050 .log2_chroma_w = 0,
1051 .log2_chroma_h = 0,
1052 .comp = {
1053 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1054 { 0, 2, 0, 5, 6, 1, 5, 1 }, /* G */
1055 { 0, 2, 1, 3, 5, 1, 4, 2 }, /* B */
1056 },
1057 .flags = AV_PIX_FMT_FLAG_RGB,
1058 },
1059 [AV_PIX_FMT_BGR555BE] = {
1060 .name = "bgr555be",
1061 .nb_components = 3,
1062 .log2_chroma_w = 0,
1063 .log2_chroma_h = 0,
1064 .comp = {
1065 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1066 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1067 { 0, 2, -1, 2, 5, 1, 4, 0 }, /* B */
1068 },
1069 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
1070 },
1071 [AV_PIX_FMT_BGR555LE] = {
1072 .name = "bgr555le",
1073 .nb_components = 3,
1074 .log2_chroma_w = 0,
1075 .log2_chroma_h = 0,
1076 .comp = {
1077 { 0, 2, 0, 0, 5, 1, 4, 1 }, /* R */
1078 { 0, 2, 0, 5, 5, 1, 4, 1 }, /* G */
1079 { 0, 2, 1, 2, 5, 1, 4, 2 }, /* B */
1080 },
1081 .flags = AV_PIX_FMT_FLAG_RGB,
1082 },
1083 [AV_PIX_FMT_BGR444BE] = {
1084 .name = "bgr444be",
1085 .nb_components = 3,
1086 .log2_chroma_w = 0,
1087 .log2_chroma_h = 0,
1088 .comp = {
1089 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
1090 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1091 { 0, 2, -1, 0, 4, 1, 3, 0 }, /* B */
1092 },
1093 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
1094 },
1095 [AV_PIX_FMT_BGR444LE] = {
1096 .name = "bgr444le",
1097 .nb_components = 3,
1098 .log2_chroma_w = 0,
1099 .log2_chroma_h = 0,
1100 .comp = {
1101 { 0, 2, 0, 0, 4, 1, 3, 1 }, /* R */
1102 { 0, 2, 0, 4, 4, 1, 3, 1 }, /* G */
1103 { 0, 2, 1, 0, 4, 1, 3, 2 }, /* B */
1104 },
1105 .flags = AV_PIX_FMT_FLAG_RGB,
1106 },
1107 #if FF_API_VAAPI
1108 [AV_PIX_FMT_VAAPI_MOCO] = {
1109 .name = "vaapi_moco",
1110 .log2_chroma_w = 1,
1111 .log2_chroma_h = 1,
1112 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1113 },
1114 [AV_PIX_FMT_VAAPI_IDCT] = {
1115 .name = "vaapi_idct",
1116 .log2_chroma_w = 1,
1117 .log2_chroma_h = 1,
1118 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1119 },
1120 [AV_PIX_FMT_VAAPI_VLD] = {
1121 .name = "vaapi_vld",
1122 .log2_chroma_w = 1,
1123 .log2_chroma_h = 1,
1124 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1125 },
1126 #else
1127 [AV_PIX_FMT_VAAPI] = {
1128 .name = "vaapi",
1129 .log2_chroma_w = 1,
1130 .log2_chroma_h = 1,
1131 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1132 },
1133 #endif
1134 [AV_PIX_FMT_VDA_VLD] = {
1135 .name = "vda_vld",
1136 .log2_chroma_w = 1,
1137 .log2_chroma_h = 1,
1138 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1139 },
1140 [AV_PIX_FMT_YUV420P9LE] = {
1141 .name = "yuv420p9le",
1142 .nb_components = 3,
1143 .log2_chroma_w = 1,
1144 .log2_chroma_h = 1,
1145 .comp = {
1146 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1147 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1148 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1149 },
1150 .flags = AV_PIX_FMT_FLAG_PLANAR,
1151 },
1152 [AV_PIX_FMT_YUV420P9BE] = {
1153 .name = "yuv420p9be",
1154 .nb_components = 3,
1155 .log2_chroma_w = 1,
1156 .log2_chroma_h = 1,
1157 .comp = {
1158 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1159 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1160 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1161 },
1162 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1163 },
1164 [AV_PIX_FMT_YUV420P10LE] = {
1165 .name = "yuv420p10le",
1166 .nb_components = 3,
1167 .log2_chroma_w = 1,
1168 .log2_chroma_h = 1,
1169 .comp = {
1170 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1171 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1172 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1173 },
1174 .flags = AV_PIX_FMT_FLAG_PLANAR,
1175 },
1176 [AV_PIX_FMT_YUV420P10BE] = {
1177 .name = "yuv420p10be",
1178 .nb_components = 3,
1179 .log2_chroma_w = 1,
1180 .log2_chroma_h = 1,
1181 .comp = {
1182 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1183 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1184 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1185 },
1186 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1187 },
1188 [AV_PIX_FMT_YUV420P12LE] = {
1189 .name = "yuv420p12le",
1190 .nb_components = 3,
1191 .log2_chroma_w = 1,
1192 .log2_chroma_h = 1,
1193 .comp = {
1194 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1195 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1196 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1197 },
1198 .flags = AV_PIX_FMT_FLAG_PLANAR,
1199 },
1200 [AV_PIX_FMT_YUV420P12BE] = {
1201 .name = "yuv420p12be",
1202 .nb_components = 3,
1203 .log2_chroma_w = 1,
1204 .log2_chroma_h = 1,
1205 .comp = {
1206 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1207 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1208 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1209 },
1210 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1211 },
1212 [AV_PIX_FMT_YUV420P16LE] = {
1213 .name = "yuv420p16le",
1214 .nb_components = 3,
1215 .log2_chroma_w = 1,
1216 .log2_chroma_h = 1,
1217 .comp = {
1218 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1219 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1220 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1221 },
1222 .flags = AV_PIX_FMT_FLAG_PLANAR,
1223 },
1224 [AV_PIX_FMT_YUV420P16BE] = {
1225 .name = "yuv420p16be",
1226 .nb_components = 3,
1227 .log2_chroma_w = 1,
1228 .log2_chroma_h = 1,
1229 .comp = {
1230 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1231 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1232 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1233 },
1234 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1235 },
1236 [AV_PIX_FMT_YUV422P9LE] = {
1237 .name = "yuv422p9le",
1238 .nb_components = 3,
1239 .log2_chroma_w = 1,
1240 .log2_chroma_h = 0,
1241 .comp = {
1242 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1243 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1244 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1245 },
1246 .flags = AV_PIX_FMT_FLAG_PLANAR,
1247 },
1248 [AV_PIX_FMT_YUV422P9BE] = {
1249 .name = "yuv422p9be",
1250 .nb_components = 3,
1251 .log2_chroma_w = 1,
1252 .log2_chroma_h = 0,
1253 .comp = {
1254 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1255 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1256 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1257 },
1258 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1259 },
1260 [AV_PIX_FMT_YUV422P10LE] = {
1261 .name = "yuv422p10le",
1262 .nb_components = 3,
1263 .log2_chroma_w = 1,
1264 .log2_chroma_h = 0,
1265 .comp = {
1266 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1267 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1268 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1269 },
1270 .flags = AV_PIX_FMT_FLAG_PLANAR,
1271 },
1272 [AV_PIX_FMT_YUV422P10BE] = {
1273 .name = "yuv422p10be",
1274 .nb_components = 3,
1275 .log2_chroma_w = 1,
1276 .log2_chroma_h = 0,
1277 .comp = {
1278 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1279 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1280 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1281 },
1282 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1283 },
1284 [AV_PIX_FMT_YUV422P12LE] = {
1285 .name = "yuv422p12le",
1286 .nb_components = 3,
1287 .log2_chroma_w = 1,
1288 .log2_chroma_h = 0,
1289 .comp = {
1290 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1291 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1292 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1293 },
1294 .flags = AV_PIX_FMT_FLAG_PLANAR,
1295 },
1296 [AV_PIX_FMT_YUV422P12BE] = {
1297 .name = "yuv422p12be",
1298 .nb_components = 3,
1299 .log2_chroma_w = 1,
1300 .log2_chroma_h = 0,
1301 .comp = {
1302 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1303 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1304 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1305 },
1306 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1307 },
1308 [AV_PIX_FMT_YUV422P16LE] = {
1309 .name = "yuv422p16le",
1310 .nb_components = 3,
1311 .log2_chroma_w = 1,
1312 .log2_chroma_h = 0,
1313 .comp = {
1314 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1315 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1316 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1317 },
1318 .flags = AV_PIX_FMT_FLAG_PLANAR,
1319 },
1320 [AV_PIX_FMT_YUV422P16BE] = {
1321 .name = "yuv422p16be",
1322 .nb_components = 3,
1323 .log2_chroma_w = 1,
1324 .log2_chroma_h = 0,
1325 .comp = {
1326 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1327 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1328 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1329 },
1330 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1331 },
1332 [AV_PIX_FMT_YUV444P16LE] = {
1333 .name = "yuv444p16le",
1334 .nb_components = 3,
1335 .log2_chroma_w = 0,
1336 .log2_chroma_h = 0,
1337 .comp = {
1338 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1339 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1340 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1341 },
1342 .flags = AV_PIX_FMT_FLAG_PLANAR,
1343 },
1344 [AV_PIX_FMT_YUV444P16BE] = {
1345 .name = "yuv444p16be",
1346 .nb_components = 3,
1347 .log2_chroma_w = 0,
1348 .log2_chroma_h = 0,
1349 .comp = {
1350 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* Y */
1351 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* U */
1352 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* V */
1353 },
1354 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1355 },
1356 [AV_PIX_FMT_YUV444P12LE] = {
1357 .name = "yuv444p12le",
1358 .nb_components = 3,
1359 .log2_chroma_w = 0,
1360 .log2_chroma_h = 0,
1361 .comp = {
1362 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1363 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1364 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1365 },
1366 .flags = AV_PIX_FMT_FLAG_PLANAR,
1367 },
1368 [AV_PIX_FMT_YUV444P12BE] = {
1369 .name = "yuv444p12be",
1370 .nb_components = 3,
1371 .log2_chroma_w = 0,
1372 .log2_chroma_h = 0,
1373 .comp = {
1374 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
1375 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
1376 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
1377 },
1378 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1379 },
1380 [AV_PIX_FMT_YUV444P10LE] = {
1381 .name = "yuv444p10le",
1382 .nb_components = 3,
1383 .log2_chroma_w = 0,
1384 .log2_chroma_h = 0,
1385 .comp = {
1386 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1387 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1388 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1389 },
1390 .flags = AV_PIX_FMT_FLAG_PLANAR,
1391 },
1392 [AV_PIX_FMT_YUV444P10BE] = {
1393 .name = "yuv444p10be",
1394 .nb_components = 3,
1395 .log2_chroma_w = 0,
1396 .log2_chroma_h = 0,
1397 .comp = {
1398 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1399 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* U */
1400 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* V */
1401 },
1402 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1403 },
1404 [AV_PIX_FMT_YUV444P9LE] = {
1405 .name = "yuv444p9le",
1406 .nb_components = 3,
1407 .log2_chroma_w = 0,
1408 .log2_chroma_h = 0,
1409 .comp = {
1410 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1411 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1412 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1413 },
1414 .flags = AV_PIX_FMT_FLAG_PLANAR,
1415 },
1416 [AV_PIX_FMT_YUV444P9BE] = {
1417 .name = "yuv444p9be",
1418 .nb_components = 3,
1419 .log2_chroma_w = 0,
1420 .log2_chroma_h = 0,
1421 .comp = {
1422 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* Y */
1423 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* U */
1424 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* V */
1425 },
1426 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1427 },
1428 [AV_PIX_FMT_D3D11VA_VLD] = {
1429 .name = "d3d11va_vld",
1430 .log2_chroma_w = 1,
1431 .log2_chroma_h = 1,
1432 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1433 },
1434 [AV_PIX_FMT_DXVA2_VLD] = {
1435 .name = "dxva2_vld",
1436 .log2_chroma_w = 1,
1437 .log2_chroma_h = 1,
1438 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1439 },
1440 [AV_PIX_FMT_YA8] = {
1441 .name = "ya8",
1442 .nb_components = 2,
1443 .comp = {
1444 { 0, 2, 0, 0, 8, 1, 7, 1 }, /* Y */
1445 { 0, 2, 1, 0, 8, 1, 7, 2 }, /* A */
1446 },
1447 .flags = AV_PIX_FMT_FLAG_ALPHA,
1448 .alias = "gray8a",
1449 },
1450 [AV_PIX_FMT_YA16LE] = {
1451 .name = "ya16le",
1452 .nb_components = 2,
1453 .comp = {
1454 { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1455 { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
1456 },
1457 .flags = AV_PIX_FMT_FLAG_ALPHA,
1458 },
1459 [AV_PIX_FMT_YA16BE] = {
1460 .name = "ya16be",
1461 .nb_components = 2,
1462 .comp = {
1463 { 0, 4, 0, 0, 16, 3, 15, 1 }, /* Y */
1464 { 0, 4, 2, 0, 16, 3, 15, 3 }, /* A */
1465 },
1466 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
1467 },
1468 [AV_PIX_FMT_GBRP] = {
1469 .name = "gbrp",
1470 .nb_components = 3,
1471 .log2_chroma_w = 0,
1472 .log2_chroma_h = 0,
1473 .comp = {
1474 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
1475 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1476 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
1477 },
1478 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1479 },
1480 [AV_PIX_FMT_GBRP9LE] = {
1481 .name = "gbrp9le",
1482 .nb_components = 3,
1483 .log2_chroma_w = 0,
1484 .log2_chroma_h = 0,
1485 .comp = {
1486 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
1487 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1488 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
1489 },
1490 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1491 },
1492 [AV_PIX_FMT_GBRP9BE] = {
1493 .name = "gbrp9be",
1494 .nb_components = 3,
1495 .log2_chroma_w = 0,
1496 .log2_chroma_h = 0,
1497 .comp = {
1498 { 2, 2, 0, 0, 9, 1, 8, 1 }, /* R */
1499 { 0, 2, 0, 0, 9, 1, 8, 1 }, /* G */
1500 { 1, 2, 0, 0, 9, 1, 8, 1 }, /* B */
1501 },
1502 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1503 },
1504 [AV_PIX_FMT_GBRP10LE] = {
1505 .name = "gbrp10le",
1506 .nb_components = 3,
1507 .log2_chroma_w = 0,
1508 .log2_chroma_h = 0,
1509 .comp = {
1510 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
1511 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1512 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
1513 },
1514 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1515 },
1516 [AV_PIX_FMT_GBRP10BE] = {
1517 .name = "gbrp10be",
1518 .nb_components = 3,
1519 .log2_chroma_w = 0,
1520 .log2_chroma_h = 0,
1521 .comp = {
1522 { 2, 2, 0, 0, 10, 1, 9, 1 }, /* R */
1523 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* G */
1524 { 1, 2, 0, 0, 10, 1, 9, 1 }, /* B */
1525 },
1526 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1527 },
1528 [AV_PIX_FMT_GBRP12LE] = {
1529 .name = "gbrp12le",
1530 .nb_components = 3,
1531 .log2_chroma_w = 0,
1532 .log2_chroma_h = 0,
1533 .comp = {
1534 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1535 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1536 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1537 },
1538 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1539 },
1540 [AV_PIX_FMT_GBRP12BE] = {
1541 .name = "gbrp12be",
1542 .nb_components = 3,
1543 .log2_chroma_w = 0,
1544 .log2_chroma_h = 0,
1545 .comp = {
1546 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1547 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1548 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1549 },
1550 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1551 },
1552 [AV_PIX_FMT_GBRP16LE] = {
1553 .name = "gbrp16le",
1554 .nb_components = 3,
1555 .log2_chroma_w = 0,
1556 .log2_chroma_h = 0,
1557 .comp = {
1558 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1559 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1560 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1561 },
1562 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1563 },
1564 [AV_PIX_FMT_GBRP16BE] = {
1565 .name = "gbrp16be",
1566 .nb_components = 3,
1567 .log2_chroma_w = 0,
1568 .log2_chroma_h = 0,
1569 .comp = {
1570 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1571 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1572 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1573 },
1574 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1575 },
1576 [AV_PIX_FMT_GBRAP] = {
1577 .name = "gbrap",
1578 .nb_components = 4,
1579 .log2_chroma_w = 0,
1580 .log2_chroma_h = 0,
1581 .comp = {
1582 { 2, 1, 0, 0, 8, 0, 7, 1 }, /* R */
1583 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* G */
1584 { 1, 1, 0, 0, 8, 0, 7, 1 }, /* B */
1585 { 3, 1, 0, 0, 8, 0, 7, 1 }, /* A */
1586 },
1587 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1588 AV_PIX_FMT_FLAG_ALPHA,
1589 },
1590 [AV_PIX_FMT_GBRAP16LE] = {
1591 .name = "gbrap16le",
1592 .nb_components = 4,
1593 .log2_chroma_w = 0,
1594 .log2_chroma_h = 0,
1595 .comp = {
1596 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1597 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1598 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1599 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
1600 },
1601 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1602 AV_PIX_FMT_FLAG_ALPHA,
1603 },
1604 [AV_PIX_FMT_GBRAP16BE] = {
1605 .name = "gbrap16be",
1606 .nb_components = 4,
1607 .log2_chroma_w = 0,
1608 .log2_chroma_h = 0,
1609 .comp = {
1610 { 2, 2, 0, 0, 16, 1, 15, 1 }, /* R */
1611 { 0, 2, 0, 0, 16, 1, 15, 1 }, /* G */
1612 { 1, 2, 0, 0, 16, 1, 15, 1 }, /* B */
1613 { 3, 2, 0, 0, 16, 1, 15, 1 }, /* A */
1614 },
1615 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
1616 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1617 },
1618 [AV_PIX_FMT_VDPAU] = {
1619 .name = "vdpau",
1620 .log2_chroma_w = 1,
1621 .log2_chroma_h = 1,
1622 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1623 },
1624 [AV_PIX_FMT_XYZ12LE] = {
1625 .name = "xyz12le",
1626 .nb_components = 3,
1627 .log2_chroma_w = 0,
1628 .log2_chroma_h = 0,
1629 .comp = {
1630 { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1631 { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1632 { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
1633 },
1634 /*.flags = -- not used*/
1635 },
1636 [AV_PIX_FMT_XYZ12BE] = {
1637 .name = "xyz12be",
1638 .nb_components = 3,
1639 .log2_chroma_w = 0,
1640 .log2_chroma_h = 0,
1641 .comp = {
1642 { 0, 6, 0, 4, 12, 5, 11, 1 }, /* X */
1643 { 0, 6, 2, 4, 12, 5, 11, 3 }, /* Y */
1644 { 0, 6, 4, 4, 12, 5, 11, 5 }, /* Z */
1645 },
1646 .flags = AV_PIX_FMT_FLAG_BE,
1647 },
1648 [AV_PIX_FMT_NV16] = {
1649 .name = "nv16",
1650 .nb_components = 3,
1651 .log2_chroma_w = 1,
1652 .log2_chroma_h = 0,
1653 .comp = {
1654 { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
1655 { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
1656 { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
1657 },
1658 .flags = AV_PIX_FMT_FLAG_PLANAR,
1659 },
1660 [AV_PIX_FMT_NV20LE] = {
1661 .name = "nv20le",
1662 .nb_components = 3,
1663 .log2_chroma_w = 1,
1664 .log2_chroma_h = 0,
1665 .comp = {
1666 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1667 { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1668 { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
1669 },
1670 .flags = AV_PIX_FMT_FLAG_PLANAR,
1671 },
1672 [AV_PIX_FMT_NV20BE] = {
1673 .name = "nv20be",
1674 .nb_components = 3,
1675 .log2_chroma_w = 1,
1676 .log2_chroma_h = 0,
1677 .comp = {
1678 { 0, 2, 0, 0, 10, 1, 9, 1 }, /* Y */
1679 { 1, 4, 0, 0, 10, 3, 9, 1 }, /* U */
1680 { 1, 4, 2, 0, 10, 3, 9, 3 }, /* V */
1681 },
1682 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
1683 },
1684 [AV_PIX_FMT_VDA] = {
1685 .name = "vda",
1686 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1687 },
1688 [AV_PIX_FMT_QSV] = {
1689 .name = "qsv",
1690 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1691 },
1692 [AV_PIX_FMT_MMAL] = {
1693 .name = "mmal",
1694 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1695 },
1696 [AV_PIX_FMT_CUDA] = {
1697 .name = "cuda",
1698 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1699 },
1700 [AV_PIX_FMT_P010LE] = {
1701 .name = "p010le",
1702 .nb_components = 3,
1703 .log2_chroma_w = 1,
1704 .log2_chroma_h = 1,
1705 .comp = {
1706 { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
1707 { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
1708 { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
1709 },
1710 .flags = AV_PIX_FMT_FLAG_PLANAR,
1711 },
1712 [AV_PIX_FMT_P010BE] = {
1713 .name = "p010be",
1714 .nb_components = 3,
1715 .log2_chroma_w = 1,
1716 .log2_chroma_h = 1,
1717 .comp = {
1718 { 0, 2, 0, 6, 10, 1, 9, 1 }, /* Y */
1719 { 1, 4, 0, 6, 10, 3, 9, 1 }, /* U */
1720 { 1, 4, 2, 6, 10, 3, 9, 3 }, /* V */
1721 },
1722 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
1723 },
1724 [AV_PIX_FMT_GBRAP12LE] = {
1725 .name = "gbrap12le",
1726 .nb_components = 4,
1727 .log2_chroma_w = 0,
1728 .log2_chroma_h = 0,
1729 .comp = {
1730 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1731 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1732 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1733 { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
1734 },
1735 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
1736 AV_PIX_FMT_FLAG_ALPHA,
1737 },
1738 [AV_PIX_FMT_GBRAP12BE] = {
1739 .name = "gbrap12be",
1740 .nb_components = 4,
1741 .log2_chroma_w = 0,
1742 .log2_chroma_h = 0,
1743 .comp = {
1744 { 2, 2, 0, 0, 12, 1, 11, 1 }, /* R */
1745 { 0, 2, 0, 0, 12, 1, 11, 1 }, /* G */
1746 { 1, 2, 0, 0, 12, 1, 11, 1 }, /* B */
1747 { 3, 2, 0, 0, 12, 1, 11, 1 }, /* A */
1748 },
1749 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
1750 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1751 },
1752 };
1753 #if FF_API_PLUS1_MINUS1
1754 FF_ENABLE_DEPRECATION_WARNINGS
1755 #endif
1756
1757 static const char * const color_range_names[] = {
1758 [AVCOL_RANGE_UNSPECIFIED] = "unknown",
1759 [AVCOL_RANGE_MPEG] = "tv",
1760 [AVCOL_RANGE_JPEG] = "pc",
1761 };
1762
1763 static const char * const color_primaries_names[] = {
1764 [AVCOL_PRI_RESERVED0] = "reserved",
1765 [AVCOL_PRI_BT709] = "bt709",
1766 [AVCOL_PRI_UNSPECIFIED] = "unknown",
1767 [AVCOL_PRI_RESERVED] = "reserved",
1768 [AVCOL_PRI_BT470M] = "bt470m",
1769 [AVCOL_PRI_BT470BG] = "bt470bg",
1770 [AVCOL_PRI_SMPTE170M] = "smpte170m",
1771 [AVCOL_PRI_SMPTE240M] = "smpte240m",
1772 [AVCOL_PRI_FILM] = "film",
1773 [AVCOL_PRI_BT2020] = "bt2020",
1774 [AVCOL_PRI_SMPTE428] = "smpte428",
1775 [AVCOL_PRI_SMPTE431] = "smpte431",
1776 [AVCOL_PRI_SMPTE432] = "smpte432",
1777 [AVCOL_PRI_JEDEC_P22] = "jedec-p22",
1778 };
1779
1780 static const char * const color_transfer_names[] = {
1781 [AVCOL_TRC_RESERVED0] = "reserved",
1782 [AVCOL_TRC_BT709] = "bt709",
1783 [AVCOL_TRC_UNSPECIFIED] = "unknown",
1784 [AVCOL_TRC_RESERVED] = "reserved",
1785 [AVCOL_TRC_GAMMA22] = "bt470m",
1786 [AVCOL_TRC_GAMMA28] = "bt470bg",
1787 [AVCOL_TRC_SMPTE170M] = "smpte170m",
1788 [AVCOL_TRC_SMPTE240M] = "smpte240m",
1789 [AVCOL_TRC_LINEAR] = "linear",
1790 [AVCOL_TRC_LOG] = "log100",
1791 [AVCOL_TRC_LOG_SQRT] = "log316",
1792 [AVCOL_TRC_IEC61966_2_4] = "iec61966-2-4",
1793 [AVCOL_TRC_BT1361_ECG] = "bt1361e",
1794 [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
1795 [AVCOL_TRC_BT2020_10] = "bt2020-10",
1796 [AVCOL_TRC_BT2020_12] = "bt2020-12",
1797 [AVCOL_TRC_SMPTE2084] = "smpte2084",
1798 [AVCOL_TRC_SMPTE428] = "smpte428",
1799 [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
1800 };
1801
1802 static const char * const color_space_names[] = {
1803 [AVCOL_SPC_RGB] = "gbr",
1804 [AVCOL_SPC_BT709] = "bt709",
1805 [AVCOL_SPC_UNSPECIFIED] = "unknown",
1806 [AVCOL_SPC_RESERVED] = "reserved",
1807 [AVCOL_SPC_FCC] = "fcc",
1808 [AVCOL_SPC_BT470BG] = "bt470bg",
1809 [AVCOL_SPC_SMPTE170M] = "smpte170m",
1810 [AVCOL_SPC_SMPTE240M] = "smpte240m",
1811 [AVCOL_SPC_YCGCO] = "ycgco",
1812 [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
1813 [AVCOL_SPC_BT2020_CL] = "bt2020c",
1814 [AVCOL_SPC_SMPTE2085] = "smpte2085",
1815 };
1816
1817 static const char * const chroma_location_names[] = {
1818 [AVCHROMA_LOC_UNSPECIFIED] = "unspecified",
1819 [AVCHROMA_LOC_LEFT] = "left",
1820 [AVCHROMA_LOC_CENTER] = "center",
1821 [AVCHROMA_LOC_TOPLEFT] = "topleft",
1822 [AVCHROMA_LOC_TOP] = "top",
1823 [AVCHROMA_LOC_BOTTOMLEFT] = "bottomleft",
1824 [AVCHROMA_LOC_BOTTOM] = "bottom",
1825 };
1826
1827 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
1828 {
1829 enum AVPixelFormat pix_fmt;
1830
1831 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
1832 if (av_pix_fmt_descriptors[pix_fmt].name &&
1833 (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1834 av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
1835 return pix_fmt;
1836
1837 return AV_PIX_FMT_NONE;
1838 }
1839
1840 const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
1841 {
1842 return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
1843 av_pix_fmt_descriptors[pix_fmt].name : NULL;
1844 }
1845
1846 #if HAVE_BIGENDIAN
1847 # define X_NE(be, le) be
1848 #else
1849 # define X_NE(be, le) le
1850 #endif
1851
1852 enum AVPixelFormat av_get_pix_fmt(const char *name)
1853 {
1854 enum AVPixelFormat pix_fmt;
1855
1856 if (!strcmp(name, "rgb32"))
1857 name = X_NE("argb", "bgra");
1858 else if (!strcmp(name, "bgr32"))
1859 name = X_NE("abgr", "rgba");
1860
1861 pix_fmt = get_pix_fmt_internal(name);
1862 if (pix_fmt == AV_PIX_FMT_NONE) {
1863 char name2[32];
1864
1865 snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
1866 pix_fmt = get_pix_fmt_internal(name2);
1867 }
1868
1869 #if FF_API_VAAPI
1870 if (pix_fmt == AV_PIX_FMT_NONE && !strcmp(name, "vaapi"))
1871 pix_fmt = AV_PIX_FMT_VAAPI;
1872 #endif
1873 return pix_fmt;
1874 }
1875
1876 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
1877 {
1878 int c, bits = 0;
1879 int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
1880
1881 for (c = 0; c < pixdesc->nb_components; c++) {
1882 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1883 bits += pixdesc->comp[c].depth << s;
1884 }
1885
1886 return bits >> log2_pixels;
1887 }
1888
1889 char *av_get_pix_fmt_string(char *buf, int buf_size,
1890 enum AVPixelFormat pix_fmt)
1891 {
1892 /* print header */
1893 if (pix_fmt < 0) {
1894 snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
1895 } else {
1896 const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
1897 snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
1898 pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
1899 }
1900
1901 return buf;
1902 }
1903
1904 const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1905 {
1906 if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1907 return NULL;
1908 return &av_pix_fmt_descriptors[pix_fmt];
1909 }
1910
1911 const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
1912 {
1913 if (!prev)
1914 return &av_pix_fmt_descriptors[0];
1915 if (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1)
1916 return prev + 1;
1917 return NULL;
1918 }
1919
1920 enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
1921 {
1922 if (desc < av_pix_fmt_descriptors ||
1923 desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
1924 return AV_PIX_FMT_NONE;
1925
1926 return desc - av_pix_fmt_descriptors;
1927 }
1928
1929 int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
1930 int *h_shift, int *v_shift)
1931 {
1932 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1933 if (!desc)
1934 return AVERROR(ENOSYS);
1935 *h_shift = desc->log2_chroma_w;
1936 *v_shift = desc->log2_chroma_h;
1937
1938 return 0;
1939 }
1940
1941 int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
1942 {
1943 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1944 int i, planes[4] = { 0 }, ret = 0;
1945
1946 if (!desc)
1947 return AVERROR(EINVAL);
1948
1949 for (i = 0; i < desc->nb_components; i++)
1950 planes[desc->comp[i].plane] = 1;
1951 for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
1952 ret += planes[i];
1953 return ret;
1954 }
1955
1956
1957 enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
1958 {
1959 #define PIX_FMT_SWAP_ENDIANNESS(fmt) \
1960 case AV_PIX_FMT_ ## fmt ## BE: return AV_PIX_FMT_ ## fmt ## LE; \
1961 case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE
1962
1963 switch (pix_fmt) {
1964 PIX_FMT_SWAP_ENDIANNESS(GRAY12);
1965 PIX_FMT_SWAP_ENDIANNESS(GRAY16);
1966 PIX_FMT_SWAP_ENDIANNESS(YA16);
1967 PIX_FMT_SWAP_ENDIANNESS(RGB48);
1968 PIX_FMT_SWAP_ENDIANNESS(RGB565);
1969 PIX_FMT_SWAP_ENDIANNESS(RGB555);
1970 PIX_FMT_SWAP_ENDIANNESS(RGB444);
1971 PIX_FMT_SWAP_ENDIANNESS(BGR48);
1972 PIX_FMT_SWAP_ENDIANNESS(BGR565);
1973 PIX_FMT_SWAP_ENDIANNESS(BGR555);
1974 PIX_FMT_SWAP_ENDIANNESS(BGR444);
1975
1976 PIX_FMT_SWAP_ENDIANNESS(YUV420P9);
1977 PIX_FMT_SWAP_ENDIANNESS(YUV422P9);
1978 PIX_FMT_SWAP_ENDIANNESS(YUV444P9);
1979 PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
1980 PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
1981 PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
1982 PIX_FMT_SWAP_ENDIANNESS(YUV420P12);
1983 PIX_FMT_SWAP_ENDIANNESS(YUV422P12);
1984 PIX_FMT_SWAP_ENDIANNESS(YUV444P12);
1985 PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
1986 PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
1987 PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
1988
1989 PIX_FMT_SWAP_ENDIANNESS(GBRP9);
1990 PIX_FMT_SWAP_ENDIANNESS(GBRP10);
1991 PIX_FMT_SWAP_ENDIANNESS(GBRP12);
1992 PIX_FMT_SWAP_ENDIANNESS(GBRP16);
1993 PIX_FMT_SWAP_ENDIANNESS(YUVA420P9);
1994 PIX_FMT_SWAP_ENDIANNESS(YUVA422P9);
1995 PIX_FMT_SWAP_ENDIANNESS(YUVA444P9);
1996 PIX_FMT_SWAP_ENDIANNESS(YUVA420P10);
1997 PIX_FMT_SWAP_ENDIANNESS(YUVA422P10);
1998 PIX_FMT_SWAP_ENDIANNESS(YUVA444P10);
1999 PIX_FMT_SWAP_ENDIANNESS(YUVA420P16);
2000 PIX_FMT_SWAP_ENDIANNESS(YUVA422P16);
2001 PIX_FMT_SWAP_ENDIANNESS(YUVA444P16);
2002
2003 PIX_FMT_SWAP_ENDIANNESS(XYZ12);
2004 PIX_FMT_SWAP_ENDIANNESS(NV20);
2005 PIX_FMT_SWAP_ENDIANNESS(RGBA64);
2006 PIX_FMT_SWAP_ENDIANNESS(BGRA64);
2007 default:
2008 return AV_PIX_FMT_NONE;
2009 }
2010 #undef PIX_FMT_SWAP_ENDIANNESS
2011 }
2012
2013 const char *av_color_range_name(enum AVColorRange range)
2014 {
2015 return (unsigned) range < AVCOL_RANGE_NB ?
2016 color_range_names[range] : NULL;
2017 }
2018
2019 const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2020 {
2021 return (unsigned) primaries < AVCOL_PRI_NB ?
2022 color_primaries_names[primaries] : NULL;
2023 }
2024
2025 const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
2026 {
2027 return (unsigned) transfer < AVCOL_TRC_NB ?
2028 color_transfer_names[transfer] : NULL;
2029 }
2030
2031 const char *av_color_space_name(enum AVColorSpace space)
2032 {
2033 return (unsigned) space < AVCOL_SPC_NB ?
2034 color_space_names[space] : NULL;
2035 }
2036
2037 const char *av_chroma_location_name(enum AVChromaLocation location)
2038 {
2039 return (unsigned) location < AVCHROMA_LOC_NB ?
2040 chroma_location_names[location] : NULL;
2041 }
2042