lavu: Add a pixel format for new VDA hwaccel
[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 "common.h"
26 #include "pixfmt.h"
27 #include "pixdesc.h"
28 #include "internal.h"
29 #include "intreadwrite.h"
30 #include "version.h"
31
32 void av_read_image_line(uint16_t *dst,
33 const uint8_t *data[4], const int linesize[4],
34 const AVPixFmtDescriptor *desc,
35 int x, int y, int c, int w,
36 int read_pal_component)
37 {
38 AVComponentDescriptor comp = desc->comp[c];
39 int plane = comp.plane;
40 int depth = comp.depth_minus1 + 1;
41 int mask = (1 << depth) - 1;
42 int shift = comp.shift;
43 int step = comp.step_minus1 + 1;
44 int flags = desc->flags;
45
46 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
47 int skip = x * step + comp.offset_plus1 - 1;
48 const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
49 int shift = 8 - depth - (skip & 7);
50
51 while (w--) {
52 int val = (*p >> shift) & mask;
53 if (read_pal_component)
54 val = data[1][4*val + c];
55 shift -= step;
56 p -= shift >> 3;
57 shift &= 7;
58 *dst++ = val;
59 }
60 } else {
61 const uint8_t *p = data[plane] + y * linesize[plane] +
62 x * step + comp.offset_plus1 - 1;
63 int is_8bit = shift + depth <= 8;
64
65 if (is_8bit)
66 p += !!(flags & AV_PIX_FMT_FLAG_BE);
67
68 while (w--) {
69 int val = is_8bit ? *p :
70 flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
71 val = (val >> shift) & mask;
72 if (read_pal_component)
73 val = data[1][4 * val + c];
74 p += step;
75 *dst++ = val;
76 }
77 }
78 }
79
80 void av_write_image_line(const uint16_t *src,
81 uint8_t *data[4], const int linesize[4],
82 const AVPixFmtDescriptor *desc,
83 int x, int y, int c, int w)
84 {
85 AVComponentDescriptor comp = desc->comp[c];
86 int plane = comp.plane;
87 int depth = comp.depth_minus1 + 1;
88 int step = comp.step_minus1 + 1;
89 int flags = desc->flags;
90
91 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
92 int skip = x * step + comp.offset_plus1 - 1;
93 uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
94 int shift = 8 - depth - (skip & 7);
95
96 while (w--) {
97 *p |= *src++ << shift;
98 shift -= step;
99 p -= shift >> 3;
100 shift &= 7;
101 }
102 } else {
103 int shift = comp.shift;
104 uint8_t *p = data[plane] + y * linesize[plane] +
105 x * step + comp.offset_plus1 - 1;
106
107 if (shift + depth <= 8) {
108 p += !!(flags & AV_PIX_FMT_FLAG_BE);
109 while (w--) {
110 *p |= (*src++ << shift);
111 p += step;
112 }
113 } else {
114 while (w--) {
115 if (flags & AV_PIX_FMT_FLAG_BE) {
116 uint16_t val = AV_RB16(p) | (*src++ << shift);
117 AV_WB16(p, val);
118 } else {
119 uint16_t val = AV_RL16(p) | (*src++ << shift);
120 AV_WL16(p, val);
121 }
122 p += step;
123 }
124 }
125 }
126 }
127
128 #if !FF_API_PIX_FMT_DESC
129 static
130 #endif
131 const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
132 [AV_PIX_FMT_YUV420P] = {
133 .name = "yuv420p",
134 .nb_components = 3,
135 .log2_chroma_w = 1,
136 .log2_chroma_h = 1,
137 .comp = {
138 { 0, 0, 1, 0, 7 }, /* Y */
139 { 1, 0, 1, 0, 7 }, /* U */
140 { 2, 0, 1, 0, 7 }, /* V */
141 },
142 .flags = AV_PIX_FMT_FLAG_PLANAR,
143 },
144 [AV_PIX_FMT_YUYV422] = {
145 .name = "yuyv422",
146 .nb_components = 3,
147 .log2_chroma_w = 1,
148 .log2_chroma_h = 0,
149 .comp = {
150 { 0, 1, 1, 0, 7 }, /* Y */
151 { 0, 3, 2, 0, 7 }, /* U */
152 { 0, 3, 4, 0, 7 }, /* V */
153 },
154 },
155 [AV_PIX_FMT_YVYU422] = {
156 .name = "yvyu422",
157 .nb_components = 3,
158 .log2_chroma_w = 1,
159 .log2_chroma_h = 0,
160 .comp = {
161 { 0, 1, 1, 0, 7 }, /* Y */
162 { 0, 3, 2, 0, 7 }, /* V */
163 { 0, 3, 4, 0, 7 }, /* U */
164 },
165 },
166 [AV_PIX_FMT_RGB24] = {
167 .name = "rgb24",
168 .nb_components = 3,
169 .log2_chroma_w = 0,
170 .log2_chroma_h = 0,
171 .comp = {
172 { 0, 2, 1, 0, 7 }, /* R */
173 { 0, 2, 2, 0, 7 }, /* G */
174 { 0, 2, 3, 0, 7 }, /* B */
175 },
176 .flags = AV_PIX_FMT_FLAG_RGB,
177 },
178 [AV_PIX_FMT_BGR24] = {
179 .name = "bgr24",
180 .nb_components = 3,
181 .log2_chroma_w = 0,
182 .log2_chroma_h = 0,
183 .comp = {
184 { 0, 2, 1, 0, 7 }, /* B */
185 { 0, 2, 2, 0, 7 }, /* G */
186 { 0, 2, 3, 0, 7 }, /* R */
187 },
188 .flags = AV_PIX_FMT_FLAG_RGB,
189 },
190 [AV_PIX_FMT_YUV422P] = {
191 .name = "yuv422p",
192 .nb_components = 3,
193 .log2_chroma_w = 1,
194 .log2_chroma_h = 0,
195 .comp = {
196 { 0, 0, 1, 0, 7 }, /* Y */
197 { 1, 0, 1, 0, 7 }, /* U */
198 { 2, 0, 1, 0, 7 }, /* V */
199 },
200 .flags = AV_PIX_FMT_FLAG_PLANAR,
201 },
202 [AV_PIX_FMT_YUV444P] = {
203 .name = "yuv444p",
204 .nb_components = 3,
205 .log2_chroma_w = 0,
206 .log2_chroma_h = 0,
207 .comp = {
208 { 0, 0, 1, 0, 7 }, /* Y */
209 { 1, 0, 1, 0, 7 }, /* U */
210 { 2, 0, 1, 0, 7 }, /* V */
211 },
212 .flags = AV_PIX_FMT_FLAG_PLANAR,
213 },
214 [AV_PIX_FMT_YUV410P] = {
215 .name = "yuv410p",
216 .nb_components = 3,
217 .log2_chroma_w = 2,
218 .log2_chroma_h = 2,
219 .comp = {
220 { 0, 0, 1, 0, 7 }, /* Y */
221 { 1, 0, 1, 0, 7 }, /* U */
222 { 2, 0, 1, 0, 7 }, /* V */
223 },
224 .flags = AV_PIX_FMT_FLAG_PLANAR,
225 },
226 [AV_PIX_FMT_YUV411P] = {
227 .name = "yuv411p",
228 .nb_components = 3,
229 .log2_chroma_w = 2,
230 .log2_chroma_h = 0,
231 .comp = {
232 { 0, 0, 1, 0, 7 }, /* Y */
233 { 1, 0, 1, 0, 7 }, /* U */
234 { 2, 0, 1, 0, 7 }, /* V */
235 },
236 .flags = AV_PIX_FMT_FLAG_PLANAR,
237 },
238 [AV_PIX_FMT_GRAY8] = {
239 .name = "gray",
240 .nb_components = 1,
241 .log2_chroma_w = 0,
242 .log2_chroma_h = 0,
243 .comp = {
244 { 0, 0, 1, 0, 7 }, /* Y */
245 },
246 .flags = AV_PIX_FMT_FLAG_PSEUDOPAL,
247 },
248 [AV_PIX_FMT_MONOWHITE] = {
249 .name = "monow",
250 .nb_components = 1,
251 .log2_chroma_w = 0,
252 .log2_chroma_h = 0,
253 .comp = {
254 { 0, 0, 1, 0, 0 }, /* Y */
255 },
256 .flags = AV_PIX_FMT_FLAG_BITSTREAM,
257 },
258 [AV_PIX_FMT_MONOBLACK] = {
259 .name = "monob",
260 .nb_components = 1,
261 .log2_chroma_w = 0,
262 .log2_chroma_h = 0,
263 .comp = {
264 { 0, 0, 1, 7, 0 }, /* Y */
265 },
266 .flags = AV_PIX_FMT_FLAG_BITSTREAM,
267 },
268 [AV_PIX_FMT_PAL8] = {
269 .name = "pal8",
270 .nb_components = 1,
271 .log2_chroma_w = 0,
272 .log2_chroma_h = 0,
273 .comp = {
274 { 0, 0, 1, 0, 7 },
275 },
276 .flags = AV_PIX_FMT_FLAG_PAL,
277 },
278 [AV_PIX_FMT_YUVJ420P] = {
279 .name = "yuvj420p",
280 .nb_components = 3,
281 .log2_chroma_w = 1,
282 .log2_chroma_h = 1,
283 .comp = {
284 { 0, 0, 1, 0, 7 }, /* Y */
285 { 1, 0, 1, 0, 7 }, /* U */
286 { 2, 0, 1, 0, 7 }, /* V */
287 },
288 .flags = AV_PIX_FMT_FLAG_PLANAR,
289 },
290 [AV_PIX_FMT_YUVJ422P] = {
291 .name = "yuvj422p",
292 .nb_components = 3,
293 .log2_chroma_w = 1,
294 .log2_chroma_h = 0,
295 .comp = {
296 { 0, 0, 1, 0, 7 }, /* Y */
297 { 1, 0, 1, 0, 7 }, /* U */
298 { 2, 0, 1, 0, 7 }, /* V */
299 },
300 .flags = AV_PIX_FMT_FLAG_PLANAR,
301 },
302 [AV_PIX_FMT_YUVJ444P] = {
303 .name = "yuvj444p",
304 .nb_components = 3,
305 .log2_chroma_w = 0,
306 .log2_chroma_h = 0,
307 .comp = {
308 {0, 0, 1, 0, 7}, /* Y */
309 {1, 0, 1, 0, 7}, /* U */
310 {2, 0, 1, 0, 7}, /* V */
311 },
312 .flags = AV_PIX_FMT_FLAG_PLANAR,
313 },
314 #if FF_API_XVMC
315 [AV_PIX_FMT_XVMC_MPEG2_MC] = {
316 .name = "xvmcmc",
317 .flags = AV_PIX_FMT_FLAG_HWACCEL,
318 },
319 [AV_PIX_FMT_XVMC_MPEG2_IDCT] = {
320 .name = "xvmcidct",
321 .flags = AV_PIX_FMT_FLAG_HWACCEL,
322 },
323 #endif /* FF_API_XVMC */
324 [AV_PIX_FMT_UYVY422] = {
325 .name = "uyvy422",
326 .nb_components = 3,
327 .log2_chroma_w = 1,
328 .log2_chroma_h = 0,
329 .comp = {
330 { 0, 1, 2, 0, 7 }, /* Y */
331 { 0, 3, 1, 0, 7 }, /* U */
332 { 0, 3, 3, 0, 7 }, /* V */
333 },
334 },
335 [AV_PIX_FMT_UYYVYY411] = {
336 .name = "uyyvyy411",
337 .nb_components = 3,
338 .log2_chroma_w = 2,
339 .log2_chroma_h = 0,
340 .comp = {
341 { 0, 3, 2, 0, 7 }, /* Y */
342 { 0, 5, 1, 0, 7 }, /* U */
343 { 0, 5, 4, 0, 7 }, /* V */
344 },
345 },
346 [AV_PIX_FMT_BGR8] = {
347 .name = "bgr8",
348 .nb_components = 3,
349 .log2_chroma_w = 0,
350 .log2_chroma_h = 0,
351 .comp = {
352 { 0, 0, 1, 6, 1 }, /* B */
353 { 0, 0, 1, 3, 2 }, /* G */
354 { 0, 0, 1, 0, 2 }, /* R */
355 },
356 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
357 },
358 [AV_PIX_FMT_BGR4] = {
359 .name = "bgr4",
360 .nb_components = 3,
361 .log2_chroma_w = 0,
362 .log2_chroma_h = 0,
363 .comp = {
364 { 0, 3, 1, 0, 0 }, /* B */
365 { 0, 3, 2, 0, 1 }, /* G */
366 { 0, 3, 4, 0, 0 }, /* R */
367 },
368 .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
369 },
370 [AV_PIX_FMT_BGR4_BYTE] = {
371 .name = "bgr4_byte",
372 .nb_components = 3,
373 .log2_chroma_w = 0,
374 .log2_chroma_h = 0,
375 .comp = {
376 { 0, 0, 1, 3, 0 }, /* B */
377 { 0, 0, 1, 1, 1 }, /* G */
378 { 0, 0, 1, 0, 0 }, /* R */
379 },
380 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
381 },
382 [AV_PIX_FMT_RGB8] = {
383 .name = "rgb8",
384 .nb_components = 3,
385 .log2_chroma_w = 0,
386 .log2_chroma_h = 0,
387 .comp = {
388 { 0, 0, 1, 6, 1 }, /* R */
389 { 0, 0, 1, 3, 2 }, /* G */
390 { 0, 0, 1, 0, 2 }, /* B */
391 },
392 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
393 },
394 [AV_PIX_FMT_RGB4] = {
395 .name = "rgb4",
396 .nb_components = 3,
397 .log2_chroma_w = 0,
398 .log2_chroma_h = 0,
399 .comp = {
400 { 0, 3, 1, 0, 0 }, /* R */
401 { 0, 3, 2, 0, 1 }, /* G */
402 { 0, 3, 4, 0, 0 }, /* B */
403 },
404 .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
405 },
406 [AV_PIX_FMT_RGB4_BYTE] = {
407 .name = "rgb4_byte",
408 .nb_components = 3,
409 .log2_chroma_w = 0,
410 .log2_chroma_h = 0,
411 .comp = {
412 { 0, 0, 1, 3, 0 }, /* R */
413 { 0, 0, 1, 1, 1 }, /* G */
414 { 0, 0, 1, 0, 0 }, /* B */
415 },
416 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
417 },
418 [AV_PIX_FMT_NV12] = {
419 .name = "nv12",
420 .nb_components = 3,
421 .log2_chroma_w = 1,
422 .log2_chroma_h = 1,
423 .comp = {
424 { 0, 0, 1, 0, 7 }, /* Y */
425 { 1, 1, 1, 0, 7 }, /* U */
426 { 1, 1, 2, 0, 7 }, /* V */
427 },
428 .flags = AV_PIX_FMT_FLAG_PLANAR,
429 },
430 [AV_PIX_FMT_NV21] = {
431 .name = "nv21",
432 .nb_components = 3,
433 .log2_chroma_w = 1,
434 .log2_chroma_h = 1,
435 .comp = {
436 { 0, 0, 1, 0, 7 }, /* Y */
437 { 1, 1, 1, 0, 7 }, /* V */
438 { 1, 1, 2, 0, 7 }, /* U */
439 },
440 .flags = AV_PIX_FMT_FLAG_PLANAR,
441 },
442 [AV_PIX_FMT_ARGB] = {
443 .name = "argb",
444 .nb_components = 4,
445 .log2_chroma_w = 0,
446 .log2_chroma_h = 0,
447 .comp = {
448 { 0, 3, 1, 0, 7 }, /* A */
449 { 0, 3, 2, 0, 7 }, /* R */
450 { 0, 3, 3, 0, 7 }, /* G */
451 { 0, 3, 4, 0, 7 }, /* B */
452 },
453 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
454 },
455 [AV_PIX_FMT_RGBA] = {
456 .name = "rgba",
457 .nb_components = 4,
458 .log2_chroma_w = 0,
459 .log2_chroma_h = 0,
460 .comp = {
461 { 0, 3, 1, 0, 7 }, /* R */
462 { 0, 3, 2, 0, 7 }, /* G */
463 { 0, 3, 3, 0, 7 }, /* B */
464 { 0, 3, 4, 0, 7 }, /* A */
465 },
466 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
467 },
468 [AV_PIX_FMT_ABGR] = {
469 .name = "abgr",
470 .nb_components = 4,
471 .log2_chroma_w = 0,
472 .log2_chroma_h = 0,
473 .comp = {
474 { 0, 3, 1, 0, 7 }, /* A */
475 { 0, 3, 2, 0, 7 }, /* B */
476 { 0, 3, 3, 0, 7 }, /* G */
477 { 0, 3, 4, 0, 7 }, /* R */
478 },
479 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
480 },
481 [AV_PIX_FMT_BGRA] = {
482 .name = "bgra",
483 .nb_components = 4,
484 .log2_chroma_w = 0,
485 .log2_chroma_h = 0,
486 .comp = {
487 { 0, 3, 1, 0, 7 }, /* B */
488 { 0, 3, 2, 0, 7 }, /* G */
489 { 0, 3, 3, 0, 7 }, /* R */
490 { 0, 3, 4, 0, 7 }, /* A */
491 },
492 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
493 },
494 [AV_PIX_FMT_GRAY16BE] = {
495 .name = "gray16be",
496 .nb_components = 1,
497 .log2_chroma_w = 0,
498 .log2_chroma_h = 0,
499 .comp = {
500 { 0, 1, 1, 0, 15 }, /* Y */
501 },
502 .flags = AV_PIX_FMT_FLAG_BE,
503 },
504 [AV_PIX_FMT_GRAY16LE] = {
505 .name = "gray16le",
506 .nb_components = 1,
507 .log2_chroma_w = 0,
508 .log2_chroma_h = 0,
509 .comp = {
510 { 0, 1, 1, 0, 15 }, /* Y */
511 },
512 },
513 [AV_PIX_FMT_YUV440P] = {
514 .name = "yuv440p",
515 .nb_components = 3,
516 .log2_chroma_w = 0,
517 .log2_chroma_h = 1,
518 .comp = {
519 { 0, 0, 1, 0, 7 }, /* Y */
520 { 1, 0, 1, 0, 7 }, /* U */
521 { 2, 0, 1, 0, 7 }, /* V */
522 },
523 .flags = AV_PIX_FMT_FLAG_PLANAR,
524 },
525 [AV_PIX_FMT_YUVJ440P] = {
526 .name = "yuvj440p",
527 .nb_components = 3,
528 .log2_chroma_w = 0,
529 .log2_chroma_h = 1,
530 .comp = {
531 { 0, 0, 1, 0, 7 }, /* Y */
532 { 1, 0, 1, 0, 7 }, /* U */
533 { 2, 0, 1, 0, 7 }, /* V */
534 },
535 .flags = AV_PIX_FMT_FLAG_PLANAR,
536 },
537 [AV_PIX_FMT_YUVA420P] = {
538 .name = "yuva420p",
539 .nb_components = 4,
540 .log2_chroma_w = 1,
541 .log2_chroma_h = 1,
542 .comp = {
543 { 0, 0, 1, 0, 7 }, /* Y */
544 { 1, 0, 1, 0, 7 }, /* U */
545 { 2, 0, 1, 0, 7 }, /* V */
546 { 3, 0, 1, 0, 7 }, /* A */
547 },
548 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
549 },
550 [AV_PIX_FMT_YUVA422P] = {
551 .name = "yuva422p",
552 .nb_components = 4,
553 .log2_chroma_w = 1,
554 .log2_chroma_h = 0,
555 .comp = {
556 { 0, 0, 1, 0, 7 }, /* Y */
557 { 1, 0, 1, 0, 7 }, /* U */
558 { 2, 0, 1, 0, 7 }, /* V */
559 { 3, 0, 1, 0, 7 }, /* A */
560 },
561 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
562 },
563 [AV_PIX_FMT_YUVA444P] = {
564 .name = "yuva444p",
565 .nb_components = 4,
566 .log2_chroma_w = 0,
567 .log2_chroma_h = 0,
568 .comp = {
569 { 0, 0, 1, 0, 7 }, /* Y */
570 { 1, 0, 1, 0, 7 }, /* U */
571 { 2, 0, 1, 0, 7 }, /* V */
572 { 3, 0, 1, 0, 7 }, /* A */
573 },
574 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
575 },
576 [AV_PIX_FMT_YUVA420P9BE] = {
577 .name = "yuva420p9be",
578 .nb_components = 4,
579 .log2_chroma_w = 1,
580 .log2_chroma_h = 1,
581 .comp = {
582 { 0, 1, 1, 0, 8 }, /* Y */
583 { 1, 1, 1, 0, 8 }, /* U */
584 { 2, 1, 1, 0, 8 }, /* V */
585 { 3, 1, 1, 0, 8 }, /* A */
586 },
587 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
588 },
589 [AV_PIX_FMT_YUVA420P9LE] = {
590 .name = "yuva420p9le",
591 .nb_components = 4,
592 .log2_chroma_w = 1,
593 .log2_chroma_h = 1,
594 .comp = {
595 { 0, 1, 1, 0, 8 }, /* Y */
596 { 1, 1, 1, 0, 8 }, /* U */
597 { 2, 1, 1, 0, 8 }, /* V */
598 { 3, 1, 1, 0, 8 }, /* A */
599 },
600 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
601 },
602 [AV_PIX_FMT_YUVA422P9BE] = {
603 .name = "yuva422p9be",
604 .nb_components = 4,
605 .log2_chroma_w = 1,
606 .log2_chroma_h = 0,
607 .comp = {
608 { 0, 1, 1, 0, 8 }, /* Y */
609 { 1, 1, 1, 0, 8 }, /* U */
610 { 2, 1, 1, 0, 8 }, /* V */
611 { 3, 1, 1, 0, 8 }, /* A */
612 },
613 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
614 },
615 [AV_PIX_FMT_YUVA422P9LE] = {
616 .name = "yuva422p9le",
617 .nb_components = 4,
618 .log2_chroma_w = 1,
619 .log2_chroma_h = 0,
620 .comp = {
621 { 0, 1, 1, 0, 8 }, /* Y */
622 { 1, 1, 1, 0, 8 }, /* U */
623 { 2, 1, 1, 0, 8 }, /* V */
624 { 3, 1, 1, 0, 8 }, /* A */
625 },
626 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
627 },
628 [AV_PIX_FMT_YUVA444P9BE] = {
629 .name = "yuva444p9be",
630 .nb_components = 4,
631 .log2_chroma_w = 0,
632 .log2_chroma_h = 0,
633 .comp = {
634 { 0, 1, 1, 0, 8 }, /* Y */
635 { 1, 1, 1, 0, 8 }, /* U */
636 { 2, 1, 1, 0, 8 }, /* V */
637 { 3, 1, 1, 0, 8 }, /* A */
638 },
639 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
640 },
641 [AV_PIX_FMT_YUVA444P9LE] = {
642 .name = "yuva444p9le",
643 .nb_components = 4,
644 .log2_chroma_w = 0,
645 .log2_chroma_h = 0,
646 .comp = {
647 { 0, 1, 1, 0, 8 }, /* Y */
648 { 1, 1, 1, 0, 8 }, /* U */
649 { 2, 1, 1, 0, 8 }, /* V */
650 { 3, 1, 1, 0, 8 }, /* A */
651 },
652 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
653 },
654 [AV_PIX_FMT_YUVA420P10BE] = {
655 .name = "yuva420p10be",
656 .nb_components = 4,
657 .log2_chroma_w = 1,
658 .log2_chroma_h = 1,
659 .comp = {
660 { 0, 1, 1, 0, 9 }, /* Y */
661 { 1, 1, 1, 0, 9 }, /* U */
662 { 2, 1, 1, 0, 9 }, /* V */
663 { 3, 1, 1, 0, 9 }, /* A */
664 },
665 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
666 },
667 [AV_PIX_FMT_YUVA420P10LE] = {
668 .name = "yuva420p10le",
669 .nb_components = 4,
670 .log2_chroma_w = 1,
671 .log2_chroma_h = 1,
672 .comp = {
673 { 0, 1, 1, 0, 9 }, /* Y */
674 { 1, 1, 1, 0, 9 }, /* U */
675 { 2, 1, 1, 0, 9 }, /* V */
676 { 3, 1, 1, 0, 9 }, /* A */
677 },
678 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
679 },
680 [AV_PIX_FMT_YUVA422P10BE] = {
681 .name = "yuva422p10be",
682 .nb_components = 4,
683 .log2_chroma_w = 1,
684 .log2_chroma_h = 0,
685 .comp = {
686 { 0, 1, 1, 0, 9 }, /* Y */
687 { 1, 1, 1, 0, 9 }, /* U */
688 { 2, 1, 1, 0, 9 }, /* V */
689 { 3, 1, 1, 0, 9 }, /* A */
690 },
691 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
692 },
693 [AV_PIX_FMT_YUVA422P10LE] = {
694 .name = "yuva422p10le",
695 .nb_components = 4,
696 .log2_chroma_w = 1,
697 .log2_chroma_h = 0,
698 .comp = {
699 { 0, 1, 1, 0, 9 }, /* Y */
700 { 1, 1, 1, 0, 9 }, /* U */
701 { 2, 1, 1, 0, 9 }, /* V */
702 { 3, 1, 1, 0, 9 }, /* A */
703 },
704 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
705 },
706 [AV_PIX_FMT_YUVA444P10BE] = {
707 .name = "yuva444p10be",
708 .nb_components = 4,
709 .log2_chroma_w = 0,
710 .log2_chroma_h = 0,
711 .comp = {
712 { 0, 1, 1, 0, 9 }, /* Y */
713 { 1, 1, 1, 0, 9 }, /* U */
714 { 2, 1, 1, 0, 9 }, /* V */
715 { 3, 1, 1, 0, 9 }, /* A */
716 },
717 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
718 },
719 [AV_PIX_FMT_YUVA444P10LE] = {
720 .name = "yuva444p10le",
721 .nb_components = 4,
722 .log2_chroma_w = 0,
723 .log2_chroma_h = 0,
724 .comp = {
725 { 0, 1, 1, 0, 9 }, /* Y */
726 { 1, 1, 1, 0, 9 }, /* U */
727 { 2, 1, 1, 0, 9 }, /* V */
728 { 3, 1, 1, 0, 9 }, /* A */
729 },
730 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
731 },
732 [AV_PIX_FMT_YUVA420P16BE] = {
733 .name = "yuva420p16be",
734 .nb_components = 4,
735 .log2_chroma_w = 1,
736 .log2_chroma_h = 1,
737 .comp = {
738 { 0, 1, 1, 0, 15 }, /* Y */
739 { 1, 1, 1, 0, 15 }, /* U */
740 { 2, 1, 1, 0, 15 }, /* V */
741 { 3, 1, 1, 0, 15 }, /* A */
742 },
743 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
744 },
745 [AV_PIX_FMT_YUVA420P16LE] = {
746 .name = "yuva420p16le",
747 .nb_components = 4,
748 .log2_chroma_w = 1,
749 .log2_chroma_h = 1,
750 .comp = {
751 { 0, 1, 1, 0, 15 }, /* Y */
752 { 1, 1, 1, 0, 15 }, /* U */
753 { 2, 1, 1, 0, 15 }, /* V */
754 { 3, 1, 1, 0, 15 }, /* A */
755 },
756 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
757 },
758 [AV_PIX_FMT_YUVA422P16BE] = {
759 .name = "yuva422p16be",
760 .nb_components = 4,
761 .log2_chroma_w = 1,
762 .log2_chroma_h = 0,
763 .comp = {
764 { 0, 1, 1, 0, 15 }, /* Y */
765 { 1, 1, 1, 0, 15 }, /* U */
766 { 2, 1, 1, 0, 15 }, /* V */
767 { 3, 1, 1, 0, 15 }, /* A */
768 },
769 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
770 },
771 [AV_PIX_FMT_YUVA422P16LE] = {
772 .name = "yuva422p16le",
773 .nb_components = 4,
774 .log2_chroma_w = 1,
775 .log2_chroma_h = 0,
776 .comp = {
777 { 0, 1, 1, 0, 15 }, /* Y */
778 { 1, 1, 1, 0, 15 }, /* U */
779 { 2, 1, 1, 0, 15 }, /* V */
780 { 3, 1, 1, 0, 15 }, /* A */
781 },
782 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
783 },
784 [AV_PIX_FMT_YUVA444P16BE] = {
785 .name = "yuva444p16be",
786 .nb_components = 4,
787 .log2_chroma_w = 0,
788 .log2_chroma_h = 0,
789 .comp = {
790 { 0, 1, 1, 0, 15 }, /* Y */
791 { 1, 1, 1, 0, 15 }, /* U */
792 { 2, 1, 1, 0, 15 }, /* V */
793 { 3, 1, 1, 0, 15 }, /* A */
794 },
795 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
796 },
797 [AV_PIX_FMT_YUVA444P16LE] = {
798 .name = "yuva444p16le",
799 .nb_components = 4,
800 .log2_chroma_w = 0,
801 .log2_chroma_h = 0,
802 .comp = {
803 { 0, 1, 1, 0, 15 }, /* Y */
804 { 1, 1, 1, 0, 15 }, /* U */
805 { 2, 1, 1, 0, 15 }, /* V */
806 { 3, 1, 1, 0, 15 }, /* A */
807 },
808 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
809 },
810 #if FF_API_VDPAU
811 [AV_PIX_FMT_VDPAU_H264] = {
812 .name = "vdpau_h264",
813 .log2_chroma_w = 1,
814 .log2_chroma_h = 1,
815 .flags = AV_PIX_FMT_FLAG_HWACCEL,
816 },
817 [AV_PIX_FMT_VDPAU_MPEG1] = {
818 .name = "vdpau_mpeg1",
819 .log2_chroma_w = 1,
820 .log2_chroma_h = 1,
821 .flags = AV_PIX_FMT_FLAG_HWACCEL,
822 },
823 [AV_PIX_FMT_VDPAU_MPEG2] = {
824 .name = "vdpau_mpeg2",
825 .log2_chroma_w = 1,
826 .log2_chroma_h = 1,
827 .flags = AV_PIX_FMT_FLAG_HWACCEL,
828 },
829 [AV_PIX_FMT_VDPAU_WMV3] = {
830 .name = "vdpau_wmv3",
831 .log2_chroma_w = 1,
832 .log2_chroma_h = 1,
833 .flags = AV_PIX_FMT_FLAG_HWACCEL,
834 },
835 [AV_PIX_FMT_VDPAU_VC1] = {
836 .name = "vdpau_vc1",
837 .log2_chroma_w = 1,
838 .log2_chroma_h = 1,
839 .flags = AV_PIX_FMT_FLAG_HWACCEL,
840 },
841 [AV_PIX_FMT_VDPAU_MPEG4] = {
842 .name = "vdpau_mpeg4",
843 .log2_chroma_w = 1,
844 .log2_chroma_h = 1,
845 .flags = AV_PIX_FMT_FLAG_HWACCEL,
846 },
847 #endif
848 [AV_PIX_FMT_RGB48BE] = {
849 .name = "rgb48be",
850 .nb_components = 3,
851 .log2_chroma_w = 0,
852 .log2_chroma_h = 0,
853 .comp = {
854 { 0, 5, 1, 0, 15 }, /* R */
855 { 0, 5, 3, 0, 15 }, /* G */
856 { 0, 5, 5, 0, 15 }, /* B */
857 },
858 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE,
859 },
860 [AV_PIX_FMT_RGB48LE] = {
861 .name = "rgb48le",
862 .nb_components = 3,
863 .log2_chroma_w = 0,
864 .log2_chroma_h = 0,
865 .comp = {
866 { 0, 5, 1, 0, 15 }, /* R */
867 { 0, 5, 3, 0, 15 }, /* G */
868 { 0, 5, 5, 0, 15 }, /* B */
869 },
870 .flags = AV_PIX_FMT_FLAG_RGB,
871 },
872 [AV_PIX_FMT_RGBA64BE] = {
873 .name = "rgba64be",
874 .nb_components = 4,
875 .log2_chroma_w = 0,
876 .log2_chroma_h = 0,
877 .comp = {
878 { 0, 7, 1, 0, 15 }, /* R */
879 { 0, 7, 3, 0, 15 }, /* G */
880 { 0, 7, 5, 0, 15 }, /* B */
881 { 0, 7, 7, 0, 15 }, /* A */
882 },
883 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
884 },
885 [AV_PIX_FMT_RGBA64LE] = {
886 .name = "rgba64le",
887 .nb_components = 4,
888 .log2_chroma_w = 0,
889 .log2_chroma_h = 0,
890 .comp = {
891 { 0, 7, 1, 0, 15 }, /* R */
892 { 0, 7, 3, 0, 15 }, /* G */
893 { 0, 7, 5, 0, 15 }, /* B */
894 { 0, 7, 7, 0, 15 }, /* A */
895 },
896 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
897 },
898 [AV_PIX_FMT_RGB565BE] = {
899 .name = "rgb565be",
900 .nb_components = 3,
901 .log2_chroma_w = 0,
902 .log2_chroma_h = 0,
903 .comp = {
904 { 0, 1, 0, 3, 4 }, /* R */
905 { 0, 1, 1, 5, 5 }, /* G */
906 { 0, 1, 1, 0, 4 }, /* B */
907 },
908 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
909 },
910 [AV_PIX_FMT_RGB565LE] = {
911 .name = "rgb565le",
912 .nb_components = 3,
913 .log2_chroma_w = 0,
914 .log2_chroma_h = 0,
915 .comp = {
916 { 0, 1, 2, 3, 4 }, /* R */
917 { 0, 1, 1, 5, 5 }, /* G */
918 { 0, 1, 1, 0, 4 }, /* B */
919 },
920 .flags = AV_PIX_FMT_FLAG_RGB,
921 },
922 [AV_PIX_FMT_RGB555BE] = {
923 .name = "rgb555be",
924 .nb_components = 3,
925 .log2_chroma_w = 0,
926 .log2_chroma_h = 0,
927 .comp = {
928 { 0, 1, 0, 2, 4 }, /* R */
929 { 0, 1, 1, 5, 4 }, /* G */
930 { 0, 1, 1, 0, 4 }, /* B */
931 },
932 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
933 },
934 [AV_PIX_FMT_RGB555LE] = {
935 .name = "rgb555le",
936 .nb_components = 3,
937 .log2_chroma_w = 0,
938 .log2_chroma_h = 0,
939 .comp = {
940 { 0, 1, 2, 2, 4 }, /* R */
941 { 0, 1, 1, 5, 4 }, /* G */
942 { 0, 1, 1, 0, 4 }, /* B */
943 },
944 .flags = AV_PIX_FMT_FLAG_RGB,
945 },
946 [AV_PIX_FMT_RGB444BE] = {
947 .name = "rgb444be",
948 .nb_components = 3,
949 .log2_chroma_w = 0,
950 .log2_chroma_h = 0,
951 .comp = {
952 { 0, 1, 0, 0, 3 }, /* R */
953 { 0, 1, 1, 4, 3 }, /* G */
954 { 0, 1, 1, 0, 3 }, /* B */
955 },
956 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
957 },
958 [AV_PIX_FMT_RGB444LE] = {
959 .name = "rgb444le",
960 .nb_components = 3,
961 .log2_chroma_w = 0,
962 .log2_chroma_h = 0,
963 .comp = {
964 { 0, 1, 2, 0, 3 }, /* R */
965 { 0, 1, 1, 4, 3 }, /* G */
966 { 0, 1, 1, 0, 3 }, /* B */
967 },
968 .flags = AV_PIX_FMT_FLAG_RGB,
969 },
970 [AV_PIX_FMT_BGR48BE] = {
971 .name = "bgr48be",
972 .nb_components = 3,
973 .log2_chroma_w = 0,
974 .log2_chroma_h = 0,
975 .comp = {
976 { 0, 5, 1, 0, 15 }, /* B */
977 { 0, 5, 3, 0, 15 }, /* G */
978 { 0, 5, 5, 0, 15 }, /* R */
979 },
980 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
981 },
982 [AV_PIX_FMT_BGR48LE] = {
983 .name = "bgr48le",
984 .nb_components = 3,
985 .log2_chroma_w = 0,
986 .log2_chroma_h = 0,
987 .comp = {
988 { 0, 5, 1, 0, 15 }, /* B */
989 { 0, 5, 3, 0, 15 }, /* G */
990 { 0, 5, 5, 0, 15 }, /* R */
991 },
992 .flags = AV_PIX_FMT_FLAG_RGB,
993 },
994 [AV_PIX_FMT_BGRA64BE] = {
995 .name = "bgra64be",
996 .nb_components = 4,
997 .log2_chroma_w = 0,
998 .log2_chroma_h = 0,
999 .comp = {
1000 { 0, 5, 1, 0, 15 }, /* B */
1001 { 0, 5, 3, 0, 15 }, /* G */
1002 { 0, 5, 5, 0, 15 }, /* R */
1003 { 0, 5, 7, 0, 15 }, /* A */
1004 },
1005 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1006 },
1007 [AV_PIX_FMT_BGRA64LE] = {
1008 .name = "bgra64le",
1009 .nb_components = 4,
1010 .log2_chroma_w = 0,
1011 .log2_chroma_h = 0,
1012 .comp = {
1013 { 0, 5, 1, 0, 15 }, /* B */
1014 { 0, 5, 3, 0, 15 }, /* G */
1015 { 0, 5, 5, 0, 15 }, /* R */
1016 { 0, 5, 7, 0, 15 }, /* A */
1017 },
1018 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
1019 },
1020 [AV_PIX_FMT_BGR565BE] = {
1021 .name = "bgr565be",
1022 .nb_components = 3,
1023 .log2_chroma_w = 0,
1024 .log2_chroma_h = 0,
1025 .comp = {
1026 { 0, 1, 0, 3, 4 }, /* B */
1027 { 0, 1, 1, 5, 5 }, /* G */
1028 { 0, 1, 1, 0, 4 }, /* R */
1029 },
1030 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
1031 },
1032 [AV_PIX_FMT_BGR565LE] = {
1033 .name = "bgr565le",
1034 .nb_components = 3,
1035 .log2_chroma_w = 0,
1036 .log2_chroma_h = 0,
1037 .comp = {
1038 { 0, 1, 2, 3, 4 }, /* B */
1039 { 0, 1, 1, 5, 5 }, /* G */
1040 { 0, 1, 1, 0, 4 }, /* R */
1041 },
1042 .flags = AV_PIX_FMT_FLAG_RGB,
1043 },
1044 [AV_PIX_FMT_BGR555BE] = {
1045 .name = "bgr555be",
1046 .nb_components = 3,
1047 .log2_chroma_w = 0,
1048 .log2_chroma_h = 0,
1049 .comp = {
1050 { 0, 1, 0, 2, 4 }, /* B */
1051 { 0, 1, 1, 5, 4 }, /* G */
1052 { 0, 1, 1, 0, 4 }, /* R */
1053 },
1054 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
1055 },
1056 [AV_PIX_FMT_BGR555LE] = {
1057 .name = "bgr555le",
1058 .nb_components = 3,
1059 .log2_chroma_w = 0,
1060 .log2_chroma_h = 0,
1061 .comp = {
1062 { 0, 1, 2, 2, 4 }, /* B */
1063 { 0, 1, 1, 5, 4 }, /* G */
1064 { 0, 1, 1, 0, 4 }, /* R */
1065 },
1066 .flags = AV_PIX_FMT_FLAG_RGB,
1067 },
1068 [AV_PIX_FMT_BGR444BE] = {
1069 .name = "bgr444be",
1070 .nb_components = 3,
1071 .log2_chroma_w = 0,
1072 .log2_chroma_h = 0,
1073 .comp = {
1074 { 0, 1, 0, 0, 3 }, /* B */
1075 { 0, 1, 1, 4, 3 }, /* G */
1076 { 0, 1, 1, 0, 3 }, /* R */
1077 },
1078 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
1079 },
1080 [AV_PIX_FMT_BGR444LE] = {
1081 .name = "bgr444le",
1082 .nb_components = 3,
1083 .log2_chroma_w = 0,
1084 .log2_chroma_h = 0,
1085 .comp = {
1086 { 0, 1, 2, 0, 3 }, /* B */
1087 { 0, 1, 1, 4, 3 }, /* G */
1088 { 0, 1, 1, 0, 3 }, /* R */
1089 },
1090 .flags = AV_PIX_FMT_FLAG_RGB,
1091 },
1092 [AV_PIX_FMT_VAAPI_MOCO] = {
1093 .name = "vaapi_moco",
1094 .log2_chroma_w = 1,
1095 .log2_chroma_h = 1,
1096 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1097 },
1098 [AV_PIX_FMT_VAAPI_IDCT] = {
1099 .name = "vaapi_idct",
1100 .log2_chroma_w = 1,
1101 .log2_chroma_h = 1,
1102 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1103 },
1104 [AV_PIX_FMT_VAAPI_VLD] = {
1105 .name = "vaapi_vld",
1106 .log2_chroma_w = 1,
1107 .log2_chroma_h = 1,
1108 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1109 },
1110 [AV_PIX_FMT_VDA_VLD] = {
1111 .name = "vda_vld",
1112 .log2_chroma_w = 1,
1113 .log2_chroma_h = 1,
1114 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1115 },
1116 [AV_PIX_FMT_YUV420P9LE] = {
1117 .name = "yuv420p9le",
1118 .nb_components = 3,
1119 .log2_chroma_w = 1,
1120 .log2_chroma_h = 1,
1121 .comp = {
1122 { 0, 1, 1, 0, 8 }, /* Y */
1123 { 1, 1, 1, 0, 8 }, /* U */
1124 { 2, 1, 1, 0, 8 }, /* V */
1125 },
1126 .flags = AV_PIX_FMT_FLAG_PLANAR,
1127 },
1128 [AV_PIX_FMT_YUV420P9BE] = {
1129 .name = "yuv420p9be",
1130 .nb_components = 3,
1131 .log2_chroma_w = 1,
1132 .log2_chroma_h = 1,
1133 .comp = {
1134 { 0, 1, 1, 0, 8 }, /* Y */
1135 { 1, 1, 1, 0, 8 }, /* U */
1136 { 2, 1, 1, 0, 8 }, /* V */
1137 },
1138 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1139 },
1140 [AV_PIX_FMT_YUV420P10LE] = {
1141 .name = "yuv420p10le",
1142 .nb_components = 3,
1143 .log2_chroma_w = 1,
1144 .log2_chroma_h = 1,
1145 .comp = {
1146 { 0, 1, 1, 0, 9 }, /* Y */
1147 { 1, 1, 1, 0, 9 }, /* U */
1148 { 2, 1, 1, 0, 9 }, /* V */
1149 },
1150 .flags = AV_PIX_FMT_FLAG_PLANAR,
1151 },
1152 [AV_PIX_FMT_YUV420P10BE] = {
1153 .name = "yuv420p10be",
1154 .nb_components = 3,
1155 .log2_chroma_w = 1,
1156 .log2_chroma_h = 1,
1157 .comp = {
1158 { 0, 1, 1, 0, 9 }, /* Y */
1159 { 1, 1, 1, 0, 9 }, /* U */
1160 { 2, 1, 1, 0, 9 }, /* V */
1161 },
1162 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1163 },
1164 [AV_PIX_FMT_YUV420P16LE] = {
1165 .name = "yuv420p16le",
1166 .nb_components = 3,
1167 .log2_chroma_w = 1,
1168 .log2_chroma_h = 1,
1169 .comp = {
1170 { 0, 1, 1, 0, 15 }, /* Y */
1171 { 1, 1, 1, 0, 15 }, /* U */
1172 { 2, 1, 1, 0, 15 }, /* V */
1173 },
1174 .flags = AV_PIX_FMT_FLAG_PLANAR,
1175 },
1176 [AV_PIX_FMT_YUV420P16BE] = {
1177 .name = "yuv420p16be",
1178 .nb_components = 3,
1179 .log2_chroma_w = 1,
1180 .log2_chroma_h = 1,
1181 .comp = {
1182 { 0, 1, 1, 0, 15 }, /* Y */
1183 { 1, 1, 1, 0, 15 }, /* U */
1184 { 2, 1, 1, 0, 15 }, /* V */
1185 },
1186 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1187 },
1188 [AV_PIX_FMT_YUV422P9LE] = {
1189 .name = "yuv422p9le",
1190 .nb_components = 3,
1191 .log2_chroma_w = 1,
1192 .log2_chroma_h = 0,
1193 .comp = {
1194 { 0, 1, 1, 0, 8 }, /* Y */
1195 { 1, 1, 1, 0, 8 }, /* U */
1196 { 2, 1, 1, 0, 8 }, /* V */
1197 },
1198 .flags = AV_PIX_FMT_FLAG_PLANAR,
1199 },
1200 [AV_PIX_FMT_YUV422P9BE] = {
1201 .name = "yuv422p9be",
1202 .nb_components = 3,
1203 .log2_chroma_w = 1,
1204 .log2_chroma_h = 0,
1205 .comp = {
1206 { 0, 1, 1, 0, 8 }, /* Y */
1207 { 1, 1, 1, 0, 8 }, /* U */
1208 { 2, 1, 1, 0, 8 }, /* V */
1209 },
1210 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1211 },
1212 [AV_PIX_FMT_YUV422P10LE] = {
1213 .name = "yuv422p10le",
1214 .nb_components = 3,
1215 .log2_chroma_w = 1,
1216 .log2_chroma_h = 0,
1217 .comp = {
1218 { 0, 1, 1, 0, 9 }, /* Y */
1219 { 1, 1, 1, 0, 9 }, /* U */
1220 { 2, 1, 1, 0, 9 }, /* V */
1221 },
1222 .flags = AV_PIX_FMT_FLAG_PLANAR,
1223 },
1224 [AV_PIX_FMT_YUV422P10BE] = {
1225 .name = "yuv422p10be",
1226 .nb_components = 3,
1227 .log2_chroma_w = 1,
1228 .log2_chroma_h = 0,
1229 .comp = {
1230 { 0, 1, 1, 0, 9 }, /* Y */
1231 { 1, 1, 1, 0, 9 }, /* U */
1232 { 2, 1, 1, 0, 9 }, /* V */
1233 },
1234 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1235 },
1236 [AV_PIX_FMT_YUV422P16LE] = {
1237 .name = "yuv422p16le",
1238 .nb_components = 3,
1239 .log2_chroma_w = 1,
1240 .log2_chroma_h = 0,
1241 .comp = {
1242 { 0, 1, 1, 0, 15 }, /* Y */
1243 { 1, 1, 1, 0, 15 }, /* U */
1244 { 2, 1, 1, 0, 15 }, /* V */
1245 },
1246 .flags = AV_PIX_FMT_FLAG_PLANAR,
1247 },
1248 [AV_PIX_FMT_YUV422P16BE] = {
1249 .name = "yuv422p16be",
1250 .nb_components = 3,
1251 .log2_chroma_w = 1,
1252 .log2_chroma_h = 0,
1253 .comp = {
1254 { 0, 1, 1, 0, 15 }, /* Y */
1255 { 1, 1, 1, 0, 15 }, /* U */
1256 { 2, 1, 1, 0, 15 }, /* V */
1257 },
1258 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1259 },
1260 [AV_PIX_FMT_YUV444P16LE] = {
1261 .name = "yuv444p16le",
1262 .nb_components = 3,
1263 .log2_chroma_w = 0,
1264 .log2_chroma_h = 0,
1265 .comp = {
1266 { 0, 1, 1, 0, 15 }, /* Y */
1267 { 1, 1, 1, 0, 15 }, /* U */
1268 { 2, 1, 1, 0, 15 }, /* V */
1269 },
1270 .flags = AV_PIX_FMT_FLAG_PLANAR,
1271 },
1272 [AV_PIX_FMT_YUV444P16BE] = {
1273 .name = "yuv444p16be",
1274 .nb_components = 3,
1275 .log2_chroma_w = 0,
1276 .log2_chroma_h = 0,
1277 .comp = {
1278 { 0, 1, 1, 0, 15 }, /* Y */
1279 { 1, 1, 1, 0, 15 }, /* U */
1280 { 2, 1, 1, 0, 15 }, /* V */
1281 },
1282 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1283 },
1284 [AV_PIX_FMT_YUV444P10LE] = {
1285 .name = "yuv444p10le",
1286 .nb_components = 3,
1287 .log2_chroma_w = 0,
1288 .log2_chroma_h = 0,
1289 .comp = {
1290 { 0, 1, 1, 0, 9 }, /* Y */
1291 { 1, 1, 1, 0, 9 }, /* U */
1292 { 2, 1, 1, 0, 9 }, /* V */
1293 },
1294 .flags = AV_PIX_FMT_FLAG_PLANAR,
1295 },
1296 [AV_PIX_FMT_YUV444P10BE] = {
1297 .name = "yuv444p10be",
1298 .nb_components = 3,
1299 .log2_chroma_w = 0,
1300 .log2_chroma_h = 0,
1301 .comp = {
1302 { 0, 1, 1, 0, 9 }, /* Y */
1303 { 1, 1, 1, 0, 9 }, /* U */
1304 { 2, 1, 1, 0, 9 }, /* V */
1305 },
1306 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1307 },
1308 [AV_PIX_FMT_YUV444P9LE] = {
1309 .name = "yuv444p9le",
1310 .nb_components = 3,
1311 .log2_chroma_w = 0,
1312 .log2_chroma_h = 0,
1313 .comp = {
1314 { 0, 1, 1, 0, 8 }, /* Y */
1315 { 1, 1, 1, 0, 8 }, /* U */
1316 { 2, 1, 1, 0, 8 }, /* V */
1317 },
1318 .flags = AV_PIX_FMT_FLAG_PLANAR,
1319 },
1320 [AV_PIX_FMT_YUV444P9BE] = {
1321 .name = "yuv444p9be",
1322 .nb_components = 3,
1323 .log2_chroma_w = 0,
1324 .log2_chroma_h = 0,
1325 .comp = {
1326 { 0, 1, 1, 0, 8 }, /* Y */
1327 { 1, 1, 1, 0, 8 }, /* U */
1328 { 2, 1, 1, 0, 8 }, /* V */
1329 },
1330 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
1331 },
1332 [AV_PIX_FMT_DXVA2_VLD] = {
1333 .name = "dxva2_vld",
1334 .log2_chroma_w = 1,
1335 .log2_chroma_h = 1,
1336 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1337 },
1338 [AV_PIX_FMT_Y400A] = {
1339 .name = "y400a",
1340 .nb_components = 2,
1341 .comp = {
1342 { 0, 1, 1, 0, 7 }, /* Y */
1343 { 0, 1, 2, 0, 7 }, /* A */
1344 },
1345 .flags = AV_PIX_FMT_FLAG_ALPHA,
1346 },
1347 [AV_PIX_FMT_GBRP] = {
1348 .name = "gbrp",
1349 .nb_components = 3,
1350 .log2_chroma_w = 0,
1351 .log2_chroma_h = 0,
1352 .comp = {
1353 { 0, 0, 1, 0, 7 }, /* G */
1354 { 1, 0, 1, 0, 7 }, /* B */
1355 { 2, 0, 1, 0, 7 }, /* R */
1356 },
1357 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1358 },
1359 [AV_PIX_FMT_GBRP9LE] = {
1360 .name = "gbrp9le",
1361 .nb_components = 3,
1362 .log2_chroma_w = 0,
1363 .log2_chroma_h = 0,
1364 .comp = {
1365 { 0, 1, 1, 0, 8 }, /* G */
1366 { 1, 1, 1, 0, 8 }, /* B */
1367 { 2, 1, 1, 0, 8 }, /* R */
1368 },
1369 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1370 },
1371 [AV_PIX_FMT_GBRP9BE] = {
1372 .name = "gbrp9be",
1373 .nb_components = 3,
1374 .log2_chroma_w = 0,
1375 .log2_chroma_h = 0,
1376 .comp = {
1377 { 0, 1, 1, 0, 8 }, /* G */
1378 { 1, 1, 1, 0, 8 }, /* B */
1379 { 2, 1, 1, 0, 8 }, /* R */
1380 },
1381 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1382 },
1383 [AV_PIX_FMT_GBRP10LE] = {
1384 .name = "gbrp10le",
1385 .nb_components = 3,
1386 .log2_chroma_w = 0,
1387 .log2_chroma_h = 0,
1388 .comp = {
1389 { 0, 1, 1, 0, 9 }, /* G */
1390 { 1, 1, 1, 0, 9 }, /* B */
1391 { 2, 1, 1, 0, 9 }, /* R */
1392 },
1393 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1394 },
1395 [AV_PIX_FMT_GBRP10BE] = {
1396 .name = "gbrp10be",
1397 .nb_components = 3,
1398 .log2_chroma_w = 0,
1399 .log2_chroma_h = 0,
1400 .comp = {
1401 { 0, 1, 1, 0, 9 }, /* G */
1402 { 1, 1, 1, 0, 9 }, /* B */
1403 { 2, 1, 1, 0, 9 }, /* R */
1404 },
1405 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1406 },
1407 [AV_PIX_FMT_GBRP16LE] = {
1408 .name = "gbrp16le",
1409 .nb_components = 3,
1410 .log2_chroma_w = 0,
1411 .log2_chroma_h = 0,
1412 .comp = {
1413 { 0, 1, 1, 0, 15 }, /* G */
1414 { 1, 1, 1, 0, 15 }, /* B */
1415 { 2, 1, 1, 0, 15 }, /* R */
1416 },
1417 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1418 },
1419 [AV_PIX_FMT_GBRP16BE] = {
1420 .name = "gbrp16be",
1421 .nb_components = 3,
1422 .log2_chroma_w = 0,
1423 .log2_chroma_h = 0,
1424 .comp = {
1425 { 0, 1, 1, 0, 15 }, /* G */
1426 { 1, 1, 1, 0, 15 }, /* B */
1427 { 2, 1, 1, 0, 15 }, /* R */
1428 },
1429 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
1430 },
1431 [AV_PIX_FMT_VDPAU] = {
1432 .name = "vdpau",
1433 .log2_chroma_w = 1,
1434 .log2_chroma_h = 1,
1435 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1436 },
1437 [AV_PIX_FMT_XYZ12LE] = {
1438 .name = "xyz12le",
1439 .nb_components = 3,
1440 .log2_chroma_w = 0,
1441 .log2_chroma_h = 0,
1442 .comp = {
1443 { 0, 5, 1, 4, 11 }, /* X */
1444 { 0, 5, 3, 4, 11 }, /* Y */
1445 { 0, 5, 5, 4, 11 }, /* Z */
1446 },
1447 /*.flags = -- not used*/
1448 },
1449 [AV_PIX_FMT_XYZ12BE] = {
1450 .name = "xyz12be",
1451 .nb_components = 3,
1452 .log2_chroma_w = 0,
1453 .log2_chroma_h = 0,
1454 .comp = {
1455 { 0, 5, 1, 4, 11 }, /* X */
1456 { 0, 5, 3, 4, 11 }, /* Y */
1457 { 0, 5, 5, 4, 11 }, /* Z */
1458 },
1459 .flags = AV_PIX_FMT_FLAG_BE,
1460 },
1461 [AV_PIX_FMT_NV16] = {
1462 .name = "nv16",
1463 .nb_components = 3,
1464 .log2_chroma_w = 1,
1465 .log2_chroma_h = 0,
1466 .comp = {
1467 { 0, 0, 1, 0, 7 }, /* Y */
1468 { 1, 1, 1, 0, 7 }, /* U */
1469 { 1, 1, 2, 0, 7 }, /* V */
1470 },
1471 .flags = AV_PIX_FMT_FLAG_PLANAR,
1472 },
1473 [AV_PIX_FMT_NV20LE] = {
1474 .name = "nv20le",
1475 .nb_components = 3,
1476 .log2_chroma_w = 1,
1477 .log2_chroma_h = 0,
1478 .comp = {
1479 { 0, 1, 1, 0, 9 }, /* Y */
1480 { 1, 3, 1, 0, 9 }, /* U */
1481 { 1, 3, 3, 0, 9 }, /* V */
1482 },
1483 .flags = AV_PIX_FMT_FLAG_PLANAR,
1484 },
1485 [AV_PIX_FMT_NV20BE] = {
1486 .name = "nv20be",
1487 .nb_components = 3,
1488 .log2_chroma_w = 1,
1489 .log2_chroma_h = 0,
1490 .comp = {
1491 { 0, 1, 1, 0, 9 }, /* Y */
1492 { 1, 3, 1, 0, 9 }, /* U */
1493 { 1, 3, 3, 0, 9 }, /* V */
1494 },
1495 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
1496 },
1497 [AV_PIX_FMT_VDA] = {
1498 .name = "vda",
1499 .flags = AV_PIX_FMT_FLAG_HWACCEL,
1500 },
1501 };
1502
1503 FF_DISABLE_DEPRECATION_WARNINGS
1504 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
1505 {
1506 enum AVPixelFormat pix_fmt;
1507
1508 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
1509 if (av_pix_fmt_descriptors[pix_fmt].name &&
1510 !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name))
1511 return pix_fmt;
1512
1513 return AV_PIX_FMT_NONE;
1514 }
1515
1516 const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
1517 {
1518 return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
1519 av_pix_fmt_descriptors[pix_fmt].name : NULL;
1520 }
1521
1522 #if HAVE_BIGENDIAN
1523 # define X_NE(be, le) be
1524 #else
1525 # define X_NE(be, le) le
1526 #endif
1527
1528 enum AVPixelFormat av_get_pix_fmt(const char *name)
1529 {
1530 enum AVPixelFormat pix_fmt;
1531
1532 if (!strcmp(name, "rgb32"))
1533 name = X_NE("argb", "bgra");
1534 else if (!strcmp(name, "bgr32"))
1535 name = X_NE("abgr", "rgba");
1536
1537 pix_fmt = get_pix_fmt_internal(name);
1538 if (pix_fmt == AV_PIX_FMT_NONE) {
1539 char name2[32];
1540
1541 snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
1542 pix_fmt = get_pix_fmt_internal(name2);
1543 }
1544 return pix_fmt;
1545 }
1546
1547 int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
1548 {
1549 int c, bits = 0;
1550 int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
1551
1552 for (c = 0; c < pixdesc->nb_components; c++) {
1553 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1554 bits += (pixdesc->comp[c].depth_minus1 + 1) << s;
1555 }
1556
1557 return bits >> log2_pixels;
1558 }
1559
1560 char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt)
1561 {
1562 /* print header */
1563 if (pix_fmt < 0) {
1564 snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
1565 } else {
1566 const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
1567 snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
1568 pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
1569 }
1570
1571 return buf;
1572 }
1573
1574 const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1575 {
1576 if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1577 return NULL;
1578 return &av_pix_fmt_descriptors[pix_fmt];
1579 }
1580
1581 const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
1582 {
1583 if (!prev)
1584 return &av_pix_fmt_descriptors[0];
1585 if (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1)
1586 return prev + 1;
1587 return NULL;
1588 }
1589
1590 enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
1591 {
1592 if (desc < av_pix_fmt_descriptors ||
1593 desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
1594 return AV_PIX_FMT_NONE;
1595
1596 return desc - av_pix_fmt_descriptors;
1597 }
1598 FF_ENABLE_DEPRECATION_WARNINGS
1599
1600 int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
1601 int *h_shift, int *v_shift)
1602 {
1603 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1604 if (!desc)
1605 return AVERROR(ENOSYS);
1606 *h_shift = desc->log2_chroma_w;
1607 *v_shift = desc->log2_chroma_h;
1608
1609 return 0;
1610 }
1611
1612 int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
1613 {
1614 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
1615 int i, planes[4] = { 0 }, ret = 0;
1616
1617 if (!desc)
1618 return AVERROR(EINVAL);
1619
1620 for (i = 0; i < desc->nb_components; i++)
1621 planes[desc->comp[i].plane] = 1;
1622 for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
1623 ret += planes[i];
1624 return ret;
1625 }
1626
1627
1628 enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
1629 {
1630 #define PIX_FMT_SWAP_ENDIANNESS(fmt) \
1631 case AV_PIX_FMT_ ## fmt ## BE: return AV_PIX_FMT_ ## fmt ## LE; \
1632 case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE
1633
1634 switch (pix_fmt) {
1635 PIX_FMT_SWAP_ENDIANNESS(GRAY16);
1636 PIX_FMT_SWAP_ENDIANNESS(RGB48);
1637 PIX_FMT_SWAP_ENDIANNESS(RGB565);
1638 PIX_FMT_SWAP_ENDIANNESS(RGB555);
1639 PIX_FMT_SWAP_ENDIANNESS(RGB444);
1640 PIX_FMT_SWAP_ENDIANNESS(BGR48);
1641 PIX_FMT_SWAP_ENDIANNESS(BGR565);
1642 PIX_FMT_SWAP_ENDIANNESS(BGR555);
1643 PIX_FMT_SWAP_ENDIANNESS(BGR444);
1644
1645 PIX_FMT_SWAP_ENDIANNESS(YUV420P9);
1646 PIX_FMT_SWAP_ENDIANNESS(YUV422P9);
1647 PIX_FMT_SWAP_ENDIANNESS(YUV444P9);
1648 PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
1649 PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
1650 PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
1651 PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
1652 PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
1653 PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
1654
1655 PIX_FMT_SWAP_ENDIANNESS(GBRP9);
1656 PIX_FMT_SWAP_ENDIANNESS(GBRP10);
1657 PIX_FMT_SWAP_ENDIANNESS(GBRP16);
1658 PIX_FMT_SWAP_ENDIANNESS(YUVA420P9);
1659 PIX_FMT_SWAP_ENDIANNESS(YUVA422P9);
1660 PIX_FMT_SWAP_ENDIANNESS(YUVA444P9);
1661 PIX_FMT_SWAP_ENDIANNESS(YUVA420P10);
1662 PIX_FMT_SWAP_ENDIANNESS(YUVA422P10);
1663 PIX_FMT_SWAP_ENDIANNESS(YUVA444P10);
1664 PIX_FMT_SWAP_ENDIANNESS(YUVA420P16);
1665 PIX_FMT_SWAP_ENDIANNESS(YUVA422P16);
1666 PIX_FMT_SWAP_ENDIANNESS(YUVA444P16);
1667
1668 PIX_FMT_SWAP_ENDIANNESS(XYZ12);
1669 PIX_FMT_SWAP_ENDIANNESS(NV20);
1670 PIX_FMT_SWAP_ENDIANNESS(RGBA64);
1671 PIX_FMT_SWAP_ENDIANNESS(BGRA64);
1672 default:
1673 return AV_PIX_FMT_NONE;
1674 }
1675 #undef PIX_FMT_SWAP_ENDIANNESS
1676 }