1 /*
2 * pixel format descriptor
3 * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg 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 * FFmpeg 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 FFmpeg; 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
33
37 int x,
int y,
int c,
int w,
38 int read_pal_component)
39 {
41 int plane = comp.
plane;
47
50 const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
51 int shift = 8 - depth - (skip & 7);
52
53 while (w--) {
55 if (read_pal_component)
56 val = data[1][4*val +
c];
57 shift -= step;
58 p -= shift >> 3;
59 shift &= 7;
61 }
62 } else {
63 const uint8_t *p = data[plane] + y * linesize[plane] +
65 int is_8bit = shift + depth <= 8;
66
67 if (is_8bit)
69
70 while (w--) {
71 int val = is_8bit ? *p :
73 val = (val >>
shift) & mask;
74 if (read_pal_component)
75 val = data[1][4 * val +
c];
76 p += step;
78 }
79 }
80 }
81
85 int x,
int y,
int c,
int w)
86 {
88 int plane = comp.
plane;
92
95 uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
96 int shift = 8 - depth - (skip & 7);
97
98 while (w--) {
99 *p |= *src++ <<
shift;
100 shift -= step;
101 p -= shift >> 3;
102 shift &= 7;
103 }
104 } else {
106 uint8_t *p = data[plane] + y * linesize[plane] +
108
109 if (shift + depth <= 8) {
111 while (w--) {
112 *p |= (*src++ <<
shift);
113 p += step;
114 }
115 } else {
116 while (w--) {
120 } else {
123 }
124 p += step;
125 }
126 }
127 }
128 }
129
130 #if !FF_API_PIX_FMT_DESC
131 static
132 #endif
136 .nb_components = 3,
137 .log2_chroma_w = 1,
138 .log2_chroma_h = 1,
139 .comp = {
140 { 0, 0, 1, 0, 7 }, /* Y */
141 { 1, 0, 1, 0, 7 }, /* U */
142 { 2, 0, 1, 0, 7 }, /* V */
143 },
145 },
147 .name = "yuyv422",
148 .nb_components = 3,
149 .log2_chroma_w = 1,
150 .log2_chroma_h = 0,
151 .comp = {
152 { 0, 1, 1, 0, 7 }, /* Y */
153 { 0, 3, 2, 0, 7 }, /* U */
154 { 0, 3, 4, 0, 7 }, /* V */
155 },
156 },
158 .name = "yvyu422",
159 .nb_components = 3,
160 .log2_chroma_w = 1,
161 .log2_chroma_h = 0,
162 .comp = {
163 { 0, 1, 1, 0, 7 }, /* Y */
164 { 0, 3, 2, 0, 7 }, /* V */
165 { 0, 3, 4, 0, 7 }, /* U */
166 },
167 },
169 .name = "rgb24",
170 .nb_components = 3,
171 .log2_chroma_w = 0,
172 .log2_chroma_h = 0,
173 .comp = {
174 { 0, 2, 1, 0, 7 }, /* R */
175 { 0, 2, 2, 0, 7 }, /* G */
176 { 0, 2, 3, 0, 7 }, /* B */
177 },
179 },
181 .name = "bgr24",
182 .nb_components = 3,
183 .log2_chroma_w = 0,
184 .log2_chroma_h = 0,
185 .comp = {
186 { 0, 2, 3, 0, 7 }, /* R */
187 { 0, 2, 2, 0, 7 }, /* G */
188 { 0, 2, 1, 0, 7 }, /* B */
189 },
191 },
193 .name = "yuv422p",
194 .nb_components = 3,
195 .log2_chroma_w = 1,
196 .log2_chroma_h = 0,
197 .comp = {
198 { 0, 0, 1, 0, 7 }, /* Y */
199 { 1, 0, 1, 0, 7 }, /* U */
200 { 2, 0, 1, 0, 7 }, /* V */
201 },
203 },
205 .name = "yuv444p",
206 .nb_components = 3,
207 .log2_chroma_w = 0,
208 .log2_chroma_h = 0,
209 .comp = {
210 { 0, 0, 1, 0, 7 }, /* Y */
211 { 1, 0, 1, 0, 7 }, /* U */
212 { 2, 0, 1, 0, 7 }, /* V */
213 },
215 },
217 .name = "yuv410p",
218 .nb_components = 3,
219 .log2_chroma_w = 2,
220 .log2_chroma_h = 2,
221 .comp = {
222 { 0, 0, 1, 0, 7 }, /* Y */
223 { 1, 0, 1, 0, 7 }, /* U */
224 { 2, 0, 1, 0, 7 }, /* V */
225 },
227 },
229 .name = "yuv411p",
230 .nb_components = 3,
231 .log2_chroma_w = 2,
232 .log2_chroma_h = 0,
233 .comp = {
234 { 0, 0, 1, 0, 7 }, /* Y */
235 { 1, 0, 1, 0, 7 }, /* U */
236 { 2, 0, 1, 0, 7 }, /* V */
237 },
239 },
241 .name = "yuvj411p",
242 .nb_components = 3,
243 .log2_chroma_w = 2,
244 .log2_chroma_h = 0,
245 .comp = {
246 { 0, 0, 1, 0, 7 }, /* Y */
247 { 1, 0, 1, 0, 7 }, /* U */
248 { 2, 0, 1, 0, 7 }, /* V */
249 },
251 },
253 .name = "gray",
254 .nb_components = 1,
255 .log2_chroma_w = 0,
256 .log2_chroma_h = 0,
257 .comp = {
258 { 0, 0, 1, 0, 7 }, /* Y */
259 },
261 .alias = "gray8,y8",
262 },
264 .name = "monow",
265 .nb_components = 1,
266 .log2_chroma_w = 0,
267 .log2_chroma_h = 0,
268 .comp = {
269 { 0, 0, 1, 0, 0 }, /* Y */
270 },
272 },
274 .name = "monob",
275 .nb_components = 1,
276 .log2_chroma_w = 0,
277 .log2_chroma_h = 0,
278 .comp = {
279 { 0, 0, 1, 7, 0 }, /* Y */
280 },
282 },
284 .name = "pal8",
285 .nb_components = 1,
286 .log2_chroma_w = 0,
287 .log2_chroma_h = 0,
288 .comp = {
289 { 0, 0, 1, 0, 7 },
290 },
292 },
294 .name = "yuvj420p",
295 .nb_components = 3,
296 .log2_chroma_w = 1,
297 .log2_chroma_h = 1,
298 .comp = {
299 { 0, 0, 1, 0, 7 }, /* Y */
300 { 1, 0, 1, 0, 7 }, /* U */
301 { 2, 0, 1, 0, 7 }, /* V */
302 },
304 },
306 .name = "yuvj422p",
307 .nb_components = 3,
308 .log2_chroma_w = 1,
309 .log2_chroma_h = 0,
310 .comp = {
311 { 0, 0, 1, 0, 7 }, /* Y */
312 { 1, 0, 1, 0, 7 }, /* U */
313 { 2, 0, 1, 0, 7 }, /* V */
314 },
316 },
318 .name = "yuvj444p",
319 .nb_components = 3,
320 .log2_chroma_w = 0,
321 .log2_chroma_h = 0,
322 .comp = {
323 { 0, 0, 1, 0, 7 }, /* Y */
324 { 1, 0, 1, 0, 7 }, /* U */
325 { 2, 0, 1, 0, 7 }, /* V */
326 },
328 },
329 #if FF_API_XVMC
331 .name = "xvmcmc",
333 },
335 .name = "xvmcidct",
337 },
338 #endif /* FF_API_XVMC */
339 #if !FF_API_XVMC
341 .name = "xvmc",
343 },
344 #endif /* !FF_API_XVMC */
346 .name = "uyvy422",
347 .nb_components = 3,
348 .log2_chroma_w = 1,
349 .log2_chroma_h = 0,
350 .comp = {
351 { 0, 1, 2, 0, 7 }, /* Y */
352 { 0, 3, 1, 0, 7 }, /* U */
353 { 0, 3, 3, 0, 7 }, /* V */
354 },
355 },
357 .name = "uyyvyy411",
358 .nb_components = 3,
359 .log2_chroma_w = 2,
360 .log2_chroma_h = 0,
361 .comp = {
362 { 0, 3, 2, 0, 7 }, /* Y */
363 { 0, 5, 1, 0, 7 }, /* U */
364 { 0, 5, 4, 0, 7 }, /* V */
365 },
366 },
368 .name = "bgr8",
369 .nb_components = 3,
370 .log2_chroma_w = 0,
371 .log2_chroma_h = 0,
372 .comp = {
373 { 0, 0, 1, 0, 2 }, /* R */
374 { 0, 0, 1, 3, 2 }, /* G */
375 { 0, 0, 1, 6, 1 }, /* B */
376 },
378 },
380 .name = "bgr4",
381 .nb_components = 3,
382 .log2_chroma_w = 0,
383 .log2_chroma_h = 0,
384 .comp = {
385 { 0, 3, 4, 0, 0 }, /* R */
386 { 0, 3, 2, 0, 1 }, /* G */
387 { 0, 3, 1, 0, 0 }, /* B */
388 },
390 },
392 .name = "bgr4_byte",
393 .nb_components = 3,
394 .log2_chroma_w = 0,
395 .log2_chroma_h = 0,
396 .comp = {
397 { 0, 0, 1, 0, 0 }, /* R */
398 { 0, 0, 1, 1, 1 }, /* G */
399 { 0, 0, 1, 3, 0 }, /* B */
400 },
402 },
404 .name = "rgb8",
405 .nb_components = 3,
406 .log2_chroma_w = 0,
407 .log2_chroma_h = 0,
408 .comp = {
409 { 0, 0, 1, 6, 1 }, /* R */
410 { 0, 0, 1, 3, 2 }, /* G */
411 { 0, 0, 1, 0, 2 }, /* B */
412 },
414 },
416 .name = "rgb4",
417 .nb_components = 3,
418 .log2_chroma_w = 0,
419 .log2_chroma_h = 0,
420 .comp = {
421 { 0, 3, 1, 0, 0 }, /* R */
422 { 0, 3, 2, 0, 1 }, /* G */
423 { 0, 3, 4, 0, 0 }, /* B */
424 },
426 },
428 .name = "rgb4_byte",
429 .nb_components = 3,
430 .log2_chroma_w = 0,
431 .log2_chroma_h = 0,
432 .comp = {
433 { 0, 0, 1, 3, 0 }, /* R */
434 { 0, 0, 1, 1, 1 }, /* G */
435 { 0, 0, 1, 0, 0 }, /* B */
436 },
438 },
440 .name = "nv12",
441 .nb_components = 3,
442 .log2_chroma_w = 1,
443 .log2_chroma_h = 1,
444 .comp = {
445 { 0, 0, 1, 0, 7 }, /* Y */
446 { 1, 1, 1, 0, 7 }, /* U */
447 { 1, 1, 2, 0, 7 }, /* V */
448 },
450 },
452 .name = "nv21",
453 .nb_components = 3,
454 .log2_chroma_w = 1,
455 .log2_chroma_h = 1,
456 .comp = {
457 { 0, 0, 1, 0, 7 }, /* Y */
458 { 1, 1, 2, 0, 7 }, /* U */
459 { 1, 1, 1, 0, 7 }, /* V */
460 },
462 },
464 .name = "argb",
465 .nb_components = 4,
466 .log2_chroma_w = 0,
467 .log2_chroma_h = 0,
468 .comp = {
469 { 0, 3, 2, 0, 7 }, /* R */
470 { 0, 3, 3, 0, 7 }, /* G */
471 { 0, 3, 4, 0, 7 }, /* B */
472 { 0, 3, 1, 0, 7 }, /* A */
473 },
475 },
477 .name = "rgba",
478 .nb_components = 4,
479 .log2_chroma_w = 0,
480 .log2_chroma_h = 0,
481 .comp = {
482 { 0, 3, 1, 0, 7 }, /* R */
483 { 0, 3, 2, 0, 7 }, /* G */
484 { 0, 3, 3, 0, 7 }, /* B */
485 { 0, 3, 4, 0, 7 }, /* A */
486 },
488 },
490 .name = "abgr",
491 .nb_components = 4,
492 .log2_chroma_w = 0,
493 .log2_chroma_h = 0,
494 .comp = {
495 { 0, 3, 4, 0, 7 }, /* R */
496 { 0, 3, 3, 0, 7 }, /* G */
497 { 0, 3, 2, 0, 7 }, /* B */
498 { 0, 3, 1, 0, 7 }, /* A */
499 },
501 },
503 .name = "bgra",
504 .nb_components = 4,
505 .log2_chroma_w = 0,
506 .log2_chroma_h = 0,
507 .comp = {
508 { 0, 3, 3, 0, 7 }, /* R */
509 { 0, 3, 2, 0, 7 }, /* G */
510 { 0, 3, 1, 0, 7 }, /* B */
511 { 0, 3, 4, 0, 7 }, /* A */
512 },
514 },
516 .name = "0rgb",
517 .nb_components= 3,
518 .log2_chroma_w= 0,
519 .log2_chroma_h= 0,
520 .comp = {
521 { 0, 3, 2, 0, 7 }, /* R */
522 { 0, 3, 3, 0, 7 }, /* G */
523 { 0, 3, 4, 0, 7 }, /* B */
524 },
526 },
528 .name = "rgb0",
529 .nb_components= 3,
530 .log2_chroma_w= 0,
531 .log2_chroma_h= 0,
532 .comp = {
533 { 0, 3, 1, 0, 7 }, /* R */
534 { 0, 3, 2, 0, 7 }, /* G */
535 { 0, 3, 3, 0, 7 }, /* B */
536 },
538 },
540 .name = "0bgr",
541 .nb_components= 3,
542 .log2_chroma_w= 0,
543 .log2_chroma_h= 0,
544 .comp = {
545 { 0, 3, 4, 0, 7 }, /* R */
546 { 0, 3, 3, 0, 7 }, /* G */
547 { 0, 3, 2, 0, 7 }, /* B */
548 },
550 },
552 .name = "bgr0",
553 .nb_components= 3,
554 .log2_chroma_w= 0,
555 .log2_chroma_h= 0,
556 .comp = {
557 { 0, 3, 3, 0, 7 }, /* R */
558 { 0, 3, 2, 0, 7 }, /* G */
559 { 0, 3, 1, 0, 7 }, /* B */
560 },
562 },
564 .name = "gray16be",
565 .nb_components = 1,
566 .log2_chroma_w = 0,
567 .log2_chroma_h = 0,
568 .comp = {
569 { 0, 1, 1, 0, 15 }, /* Y */
570 },
572 .alias = "y16be",
573 },
575 .name = "gray16le",
576 .nb_components = 1,
577 .log2_chroma_w = 0,
578 .log2_chroma_h = 0,
579 .comp = {
580 { 0, 1, 1, 0, 15 }, /* Y */
581 },
582 .alias = "y16le",
583 },
585 .name = "yuv440p",
586 .nb_components = 3,
587 .log2_chroma_w = 0,
588 .log2_chroma_h = 1,
589 .comp = {
590 { 0, 0, 1, 0, 7 }, /* Y */
591 { 1, 0, 1, 0, 7 }, /* U */
592 { 2, 0, 1, 0, 7 }, /* V */
593 },
595 },
597 .name = "yuvj440p",
598 .nb_components = 3,
599 .log2_chroma_w = 0,
600 .log2_chroma_h = 1,
601 .comp = {
602 { 0, 0, 1, 0, 7 }, /* Y */
603 { 1, 0, 1, 0, 7 }, /* U */
604 { 2, 0, 1, 0, 7 }, /* V */
605 },
607 },
609 .name = "yuva420p",
610 .nb_components = 4,
611 .log2_chroma_w = 1,
612 .log2_chroma_h = 1,
613 .comp = {
614 { 0, 0, 1, 0, 7 }, /* Y */
615 { 1, 0, 1, 0, 7 }, /* U */
616 { 2, 0, 1, 0, 7 }, /* V */
617 { 3, 0, 1, 0, 7 }, /* A */
618 },
620 },
622 .name = "yuva422p",
623 .nb_components = 4,
624 .log2_chroma_w = 1,
625 .log2_chroma_h = 0,
626 .comp = {
627 { 0, 0, 1, 0, 7 }, /* Y */
628 { 1, 0, 1, 0, 7 }, /* U */
629 { 2, 0, 1, 0, 7 }, /* V */
630 { 3, 0, 1, 0, 7 }, /* A */
631 },
633 },
635 .name = "yuva444p",
636 .nb_components = 4,
637 .log2_chroma_w = 0,
638 .log2_chroma_h = 0,
639 .comp = {
640 { 0, 0, 1, 0, 7 }, /* Y */
641 { 1, 0, 1, 0, 7 }, /* U */
642 { 2, 0, 1, 0, 7 }, /* V */
643 { 3, 0, 1, 0, 7 }, /* A */
644 },
646 },
648 .name = "yuva420p9be",
649 .nb_components = 4,
650 .log2_chroma_w = 1,
651 .log2_chroma_h = 1,
652 .comp = {
653 { 0, 1, 1, 0, 8 }, /* Y */
654 { 1, 1, 1, 0, 8 }, /* U */
655 { 2, 1, 1, 0, 8 }, /* V */
656 { 3, 1, 1, 0, 8 }, /* A */
657 },
659 },
661 .name = "yuva420p9le",
662 .nb_components = 4,
663 .log2_chroma_w = 1,
664 .log2_chroma_h = 1,
665 .comp = {
666 { 0, 1, 1, 0, 8 }, /* Y */
667 { 1, 1, 1, 0, 8 }, /* U */
668 { 2, 1, 1, 0, 8 }, /* V */
669 { 3, 1, 1, 0, 8 }, /* A */
670 },
672 },
674 .name = "yuva422p9be",
675 .nb_components = 4,
676 .log2_chroma_w = 1,
677 .log2_chroma_h = 0,
678 .comp = {
679 { 0, 1, 1, 0, 8 }, /* Y */
680 { 1, 1, 1, 0, 8 }, /* U */
681 { 2, 1, 1, 0, 8 }, /* V */
682 { 3, 1, 1, 0, 8 }, /* A */
683 },
685 },
687 .name = "yuva422p9le",
688 .nb_components = 4,
689 .log2_chroma_w = 1,
690 .log2_chroma_h = 0,
691 .comp = {
692 { 0, 1, 1, 0, 8 }, /* Y */
693 { 1, 1, 1, 0, 8 }, /* U */
694 { 2, 1, 1, 0, 8 }, /* V */
695 { 3, 1, 1, 0, 8 }, /* A */
696 },
698 },
700 .name = "yuva444p9be",
701 .nb_components = 4,
702 .log2_chroma_w = 0,
703 .log2_chroma_h = 0,
704 .comp = {
705 { 0, 1, 1, 0, 8 }, /* Y */
706 { 1, 1, 1, 0, 8 }, /* U */
707 { 2, 1, 1, 0, 8 }, /* V */
708 { 3, 1, 1, 0, 8 }, /* A */
709 },
711 },
713 .name = "yuva444p9le",
714 .nb_components = 4,
715 .log2_chroma_w = 0,
716 .log2_chroma_h = 0,
717 .comp = {
718 { 0, 1, 1, 0, 8 }, /* Y */
719 { 1, 1, 1, 0, 8 }, /* U */
720 { 2, 1, 1, 0, 8 }, /* V */
721 { 3, 1, 1, 0, 8 }, /* A */
722 },
724 },
726 .name = "yuva420p10be",
727 .nb_components = 4,
728 .log2_chroma_w = 1,
729 .log2_chroma_h = 1,
730 .comp = {
731 { 0, 1, 1, 0, 9 }, /* Y */
732 { 1, 1, 1, 0, 9 }, /* U */
733 { 2, 1, 1, 0, 9 }, /* V */
734 { 3, 1, 1, 0, 9 }, /* A */
735 },
737 },
739 .name = "yuva420p10le",
740 .nb_components = 4,
741 .log2_chroma_w = 1,
742 .log2_chroma_h = 1,
743 .comp = {
744 { 0, 1, 1, 0, 9 }, /* Y */
745 { 1, 1, 1, 0, 9 }, /* U */
746 { 2, 1, 1, 0, 9 }, /* V */
747 { 3, 1, 1, 0, 9 }, /* A */
748 },
750 },
752 .name = "yuva422p10be",
753 .nb_components = 4,
754 .log2_chroma_w = 1,
755 .log2_chroma_h = 0,
756 .comp = {
757 { 0, 1, 1, 0, 9 }, /* Y */
758 { 1, 1, 1, 0, 9 }, /* U */
759 { 2, 1, 1, 0, 9 }, /* V */
760 { 3, 1, 1, 0, 9 }, /* A */
761 },
763 },
765 .name = "yuva422p10le",
766 .nb_components = 4,
767 .log2_chroma_w = 1,
768 .log2_chroma_h = 0,
769 .comp = {
770 { 0, 1, 1, 0, 9 }, /* Y */
771 { 1, 1, 1, 0, 9 }, /* U */
772 { 2, 1, 1, 0, 9 }, /* V */
773 { 3, 1, 1, 0, 9 }, /* A */
774 },
776 },
778 .name = "yuva444p10be",
779 .nb_components = 4,
780 .log2_chroma_w = 0,
781 .log2_chroma_h = 0,
782 .comp = {
783 { 0, 1, 1, 0, 9 }, /* Y */
784 { 1, 1, 1, 0, 9 }, /* U */
785 { 2, 1, 1, 0, 9 }, /* V */
786 { 3, 1, 1, 0, 9 }, /* A */
787 },
789 },
791 .name = "yuva444p10le",
792 .nb_components = 4,
793 .log2_chroma_w = 0,
794 .log2_chroma_h = 0,
795 .comp = {
796 { 0, 1, 1, 0, 9 }, /* Y */
797 { 1, 1, 1, 0, 9 }, /* U */
798 { 2, 1, 1, 0, 9 }, /* V */
799 { 3, 1, 1, 0, 9 }, /* A */
800 },
802 },
804 .name = "yuva420p16be",
805 .nb_components = 4,
806 .log2_chroma_w = 1,
807 .log2_chroma_h = 1,
808 .comp = {
809 { 0, 1, 1, 0, 15 }, /* Y */
810 { 1, 1, 1, 0, 15 }, /* U */
811 { 2, 1, 1, 0, 15 }, /* V */
812 { 3, 1, 1, 0, 15 }, /* A */
813 },
815 },
817 .name = "yuva420p16le",
818 .nb_components = 4,
819 .log2_chroma_w = 1,
820 .log2_chroma_h = 1,
821 .comp = {
822 { 0, 1, 1, 0, 15 }, /* Y */
823 { 1, 1, 1, 0, 15 }, /* U */
824 { 2, 1, 1, 0, 15 }, /* V */
825 { 3, 1, 1, 0, 15 }, /* A */
826 },
828 },
830 .name = "yuva422p16be",
831 .nb_components = 4,
832 .log2_chroma_w = 1,
833 .log2_chroma_h = 0,
834 .comp = {
835 { 0, 1, 1, 0, 15 }, /* Y */
836 { 1, 1, 1, 0, 15 }, /* U */
837 { 2, 1, 1, 0, 15 }, /* V */
838 { 3, 1, 1, 0, 15 }, /* A */
839 },
841 },
843 .name = "yuva422p16le",
844 .nb_components = 4,
845 .log2_chroma_w = 1,
846 .log2_chroma_h = 0,
847 .comp = {
848 { 0, 1, 1, 0, 15 }, /* Y */
849 { 1, 1, 1, 0, 15 }, /* U */
850 { 2, 1, 1, 0, 15 }, /* V */
851 { 3, 1, 1, 0, 15 }, /* A */
852 },
854 },
856 .name = "yuva444p16be",
857 .nb_components = 4,
858 .log2_chroma_w = 0,
859 .log2_chroma_h = 0,
860 .comp = {
861 { 0, 1, 1, 0, 15 }, /* Y */
862 { 1, 1, 1, 0, 15 }, /* U */
863 { 2, 1, 1, 0, 15 }, /* V */
864 { 3, 1, 1, 0, 15 }, /* A */
865 },
867 },
869 .name = "yuva444p16le",
870 .nb_components = 4,
871 .log2_chroma_w = 0,
872 .log2_chroma_h = 0,
873 .comp = {
874 { 0, 1, 1, 0, 15 }, /* Y */
875 { 1, 1, 1, 0, 15 }, /* U */
876 { 2, 1, 1, 0, 15 }, /* V */
877 { 3, 1, 1, 0, 15 }, /* A */
878 },
880 },
881 #if FF_API_VDPAU
883 .name = "vdpau_h264",
884 .log2_chroma_w = 1,
885 .log2_chroma_h = 1,
887 },
889 .name = "vdpau_mpeg1",
890 .log2_chroma_w = 1,
891 .log2_chroma_h = 1,
893 },
895 .name = "vdpau_mpeg2",
896 .log2_chroma_w = 1,
897 .log2_chroma_h = 1,
899 },
901 .name = "vdpau_wmv3",
902 .log2_chroma_w = 1,
903 .log2_chroma_h = 1,
905 },
907 .name = "vdpau_vc1",
908 .log2_chroma_w = 1,
909 .log2_chroma_h = 1,
911 },
913 .name = "vdpau_mpeg4",
914 .log2_chroma_w = 1,
915 .log2_chroma_h = 1,
917 },
918 #endif
920 .name = "rgb48be",
921 .nb_components = 3,
922 .log2_chroma_w = 0,
923 .log2_chroma_h = 0,
924 .comp = {
925 { 0, 5, 1, 0, 15 }, /* R */
926 { 0, 5, 3, 0, 15 }, /* G */
927 { 0, 5, 5, 0, 15 }, /* B */
928 },
930 },
932 .name = "rgb48le",
933 .nb_components = 3,
934 .log2_chroma_w = 0,
935 .log2_chroma_h = 0,
936 .comp = {
937 { 0, 5, 1, 0, 15 }, /* R */
938 { 0, 5, 3, 0, 15 }, /* G */
939 { 0, 5, 5, 0, 15 }, /* B */
940 },
942 },
944 .name = "rgba64be",
945 .nb_components = 4,
946 .log2_chroma_w = 0,
947 .log2_chroma_h = 0,
948 .comp = {
949 { 0, 7, 1, 0, 15 }, /* R */
950 { 0, 7, 3, 0, 15 }, /* G */
951 { 0, 7, 5, 0, 15 }, /* B */
952 { 0, 7, 7, 0, 15 }, /* A */
953 },
955 },
957 .name = "rgba64le",
958 .nb_components = 4,
959 .log2_chroma_w = 0,
960 .log2_chroma_h = 0,
961 .comp = {
962 { 0, 7, 1, 0, 15 }, /* R */
963 { 0, 7, 3, 0, 15 }, /* G */
964 { 0, 7, 5, 0, 15 }, /* B */
965 { 0, 7, 7, 0, 15 }, /* A */
966 },
968 },
970 .name = "rgb565be",
971 .nb_components = 3,
972 .log2_chroma_w = 0,
973 .log2_chroma_h = 0,
974 .comp = {
975 { 0, 1, 0, 3, 4 }, /* R */
976 { 0, 1, 1, 5, 5 }, /* G */
977 { 0, 1, 1, 0, 4 }, /* B */
978 },
980 },
982 .name = "rgb565le",
983 .nb_components = 3,
984 .log2_chroma_w = 0,
985 .log2_chroma_h = 0,
986 .comp = {
987 { 0, 1, 2, 3, 4 }, /* R */
988 { 0, 1, 1, 5, 5 }, /* G */
989 { 0, 1, 1, 0, 4 }, /* B */
990 },
992 },
994 .name = "rgb555be",
995 .nb_components = 3,
996 .log2_chroma_w = 0,
997 .log2_chroma_h = 0,
998 .comp = {
999 { 0, 1, 0, 2, 4 }, /* R */
1000 { 0, 1, 1, 5, 4 }, /* G */
1001 { 0, 1, 1, 0, 4 }, /* B */
1002 },
1004 },
1006 .name = "rgb555le",
1007 .nb_components = 3,
1008 .log2_chroma_w = 0,
1009 .log2_chroma_h = 0,
1010 .comp = {
1011 { 0, 1, 2, 2, 4 }, /* R */
1012 { 0, 1, 1, 5, 4 }, /* G */
1013 { 0, 1, 1, 0, 4 }, /* B */
1014 },
1016 },
1018 .name = "rgb444be",
1019 .nb_components = 3,
1020 .log2_chroma_w = 0,
1021 .log2_chroma_h = 0,
1022 .comp = {
1023 { 0, 1, 0, 0, 3 }, /* R */
1024 { 0, 1, 1, 4, 3 }, /* G */
1025 { 0, 1, 1, 0, 3 }, /* B */
1026 },
1028 },
1030 .name = "rgb444le",
1031 .nb_components = 3,
1032 .log2_chroma_w = 0,
1033 .log2_chroma_h = 0,
1034 .comp = {
1035 { 0, 1, 2, 0, 3 }, /* R */
1036 { 0, 1, 1, 4, 3 }, /* G */
1037 { 0, 1, 1, 0, 3 }, /* B */
1038 },
1040 },
1042 .name = "bgr48be",
1043 .nb_components = 3,
1044 .log2_chroma_w = 0,
1045 .log2_chroma_h = 0,
1046 .comp = {
1047 { 0, 5, 5, 0, 15 }, /* R */
1048 { 0, 5, 3, 0, 15 }, /* G */
1049 { 0, 5, 1, 0, 15 }, /* B */
1050 },
1052 },
1054 .name = "bgr48le",
1055 .nb_components = 3,
1056 .log2_chroma_w = 0,
1057 .log2_chroma_h = 0,
1058 .comp = {
1059 { 0, 5, 5, 0, 15 }, /* R */
1060 { 0, 5, 3, 0, 15 }, /* G */
1061 { 0, 5, 1, 0, 15 }, /* B */
1062 },
1064 },
1066 .name = "bgra64be",
1067 .nb_components = 4,
1068 .log2_chroma_w = 0,
1069 .log2_chroma_h = 0,
1070 .comp = {
1071 { 0, 7, 5, 0, 15 }, /* R */
1072 { 0, 7, 3, 0, 15 }, /* G */
1073 { 0, 7, 1, 0, 15 }, /* B */
1074 { 0, 7, 7, 0, 15 }, /* A */
1075 },
1077 },
1079 .name = "bgra64le",
1080 .nb_components = 4,
1081 .log2_chroma_w = 0,
1082 .log2_chroma_h = 0,
1083 .comp = {
1084 { 0, 7, 5, 0, 15 }, /* R */
1085 { 0, 7, 3, 0, 15 }, /* G */
1086 { 0, 7, 1, 0, 15 }, /* B */
1087 { 0, 7, 7, 0, 15 }, /* A */
1088 },
1090 },
1092 .name = "bgr565be",
1093 .nb_components = 3,
1094 .log2_chroma_w = 0,
1095 .log2_chroma_h = 0,
1096 .comp = {
1097 { 0, 1, 1, 0, 4 }, /* R */
1098 { 0, 1, 1, 5, 5 }, /* G */
1099 { 0, 1, 0, 3, 4 }, /* B */
1100 },
1102 },
1104 .name = "bgr565le",
1105 .nb_components = 3,
1106 .log2_chroma_w = 0,
1107 .log2_chroma_h = 0,
1108 .comp = {
1109 { 0, 1, 1, 0, 4 }, /* R */
1110 { 0, 1, 1, 5, 5 }, /* G */
1111 { 0, 1, 2, 3, 4 }, /* B */
1112 },
1114 },
1116 .name = "bgr555be",
1117 .nb_components = 3,
1118 .log2_chroma_w = 0,
1119 .log2_chroma_h = 0,
1120 .comp = {
1121 { 0, 1, 1, 0, 4 }, /* R */
1122 { 0, 1, 1, 5, 4 }, /* G */
1123 { 0, 1, 0, 2, 4 }, /* B */
1124 },
1126 },
1128 .name = "bgr555le",
1129 .nb_components = 3,
1130 .log2_chroma_w = 0,
1131 .log2_chroma_h = 0,
1132 .comp = {
1133 { 0, 1, 1, 0, 4 }, /* R */
1134 { 0, 1, 1, 5, 4 }, /* G */
1135 { 0, 1, 2, 2, 4 }, /* B */
1136 },
1138 },
1140 .name = "bgr444be",
1141 .nb_components = 3,
1142 .log2_chroma_w = 0,
1143 .log2_chroma_h = 0,
1144 .comp = {
1145 { 0, 1, 1, 0, 3 }, /* R */
1146 { 0, 1, 1, 4, 3 }, /* G */
1147 { 0, 1, 0, 0, 3 }, /* B */
1148 },
1150 },
1152 .name = "bgr444le",
1153 .nb_components = 3,
1154 .log2_chroma_w = 0,
1155 .log2_chroma_h = 0,
1156 .comp = {
1157 { 0, 1, 1, 0, 3 }, /* R */
1158 { 0, 1, 1, 4, 3 }, /* G */
1159 { 0, 1, 2, 0, 3 }, /* B */
1160 },
1162 },
1164 .name = "vaapi_moco",
1165 .log2_chroma_w = 1,
1166 .log2_chroma_h = 1,
1168 },
1170 .name = "vaapi_idct",
1171 .log2_chroma_w = 1,
1172 .log2_chroma_h = 1,
1174 },
1176 .name = "vaapi_vld",
1177 .log2_chroma_w = 1,
1178 .log2_chroma_h = 1,
1180 },
1182 .name = "yuv420p9le",
1183 .nb_components = 3,
1184 .log2_chroma_w = 1,
1185 .log2_chroma_h = 1,
1186 .comp = {
1187 { 0, 1, 1, 0, 8 }, /* Y */
1188 { 1, 1, 1, 0, 8 }, /* U */
1189 { 2, 1, 1, 0, 8 }, /* V */
1190 },
1192 },
1194 .name = "yuv420p9be",
1195 .nb_components = 3,
1196 .log2_chroma_w = 1,
1197 .log2_chroma_h = 1,
1198 .comp = {
1199 { 0, 1, 1, 0, 8 }, /* Y */
1200 { 1, 1, 1, 0, 8 }, /* U */
1201 { 2, 1, 1, 0, 8 }, /* V */
1202 },
1204 },
1206 .name = "yuv420p10le",
1207 .nb_components = 3,
1208 .log2_chroma_w = 1,
1209 .log2_chroma_h = 1,
1210 .comp = {
1211 { 0, 1, 1, 0, 9 }, /* Y */
1212 { 1, 1, 1, 0, 9 }, /* U */
1213 { 2, 1, 1, 0, 9 }, /* V */
1214 },
1216 },
1218 .name = "yuv420p10be",
1219 .nb_components = 3,
1220 .log2_chroma_w = 1,
1221 .log2_chroma_h = 1,
1222 .comp = {
1223 { 0, 1, 1, 0, 9 }, /* Y */
1224 { 1, 1, 1, 0, 9 }, /* U */
1225 { 2, 1, 1, 0, 9 }, /* V */
1226 },
1228 },
1230 .name = "yuv420p12le",
1231 .nb_components = 3,
1232 .log2_chroma_w = 1,
1233 .log2_chroma_h = 1,
1234 .comp = {
1235 { 0, 1, 1, 0, 11 }, /* Y */
1236 { 1, 1, 1, 0, 11 }, /* U */
1237 { 2, 1, 1, 0, 11 }, /* V */
1238 },
1240 },
1242 .name = "yuv420p12be",
1243 .nb_components = 3,
1244 .log2_chroma_w = 1,
1245 .log2_chroma_h = 1,
1246 .comp = {
1247 { 0, 1, 1, 0, 11 }, /* Y */
1248 { 1, 1, 1, 0, 11 }, /* U */
1249 { 2, 1, 1, 0, 11 }, /* V */
1250 },
1252 },
1254 .name = "yuv420p14le",
1255 .nb_components = 3,
1256 .log2_chroma_w = 1,
1257 .log2_chroma_h = 1,
1258 .comp = {
1259 { 0, 1, 1, 0, 13 }, /* Y */
1260 { 1, 1, 1, 0, 13 }, /* U */
1261 { 2, 1, 1, 0, 13 }, /* V */
1262 },
1264 },
1266 .name = "yuv420p14be",
1267 .nb_components = 3,
1268 .log2_chroma_w = 1,
1269 .log2_chroma_h = 1,
1270 .comp = {
1271 { 0, 1, 1, 0, 13 }, /* Y */
1272 { 1, 1, 1, 0, 13 }, /* U */
1273 { 2, 1, 1, 0, 13 }, /* V */
1274 },
1276 },
1278 .name = "yuv420p16le",
1279 .nb_components = 3,
1280 .log2_chroma_w = 1,
1281 .log2_chroma_h = 1,
1282 .comp = {
1283 { 0, 1, 1, 0, 15 }, /* Y */
1284 { 1, 1, 1, 0, 15 }, /* U */
1285 { 2, 1, 1, 0, 15 }, /* V */
1286 },
1288 },
1290 .name = "yuv420p16be",
1291 .nb_components = 3,
1292 .log2_chroma_w = 1,
1293 .log2_chroma_h = 1,
1294 .comp = {
1295 { 0, 1, 1, 0, 15 }, /* Y */
1296 { 1, 1, 1, 0, 15 }, /* U */
1297 { 2, 1, 1, 0, 15 }, /* V */
1298 },
1300 },
1302 .name = "yuv422p9le",
1303 .nb_components = 3,
1304 .log2_chroma_w = 1,
1305 .log2_chroma_h = 0,
1306 .comp = {
1307 { 0, 1, 1, 0, 8 }, /* Y */
1308 { 1, 1, 1, 0, 8 }, /* U */
1309 { 2, 1, 1, 0, 8 }, /* V */
1310 },
1312 },
1314 .name = "yuv422p9be",
1315 .nb_components = 3,
1316 .log2_chroma_w = 1,
1317 .log2_chroma_h = 0,
1318 .comp = {
1319 { 0, 1, 1, 0, 8 }, /* Y */
1320 { 1, 1, 1, 0, 8 }, /* U */
1321 { 2, 1, 1, 0, 8 }, /* V */
1322 },
1324 },
1326 .name = "yuv422p10le",
1327 .nb_components = 3,
1328 .log2_chroma_w = 1,
1329 .log2_chroma_h = 0,
1330 .comp = {
1331 { 0, 1, 1, 0, 9 }, /* Y */
1332 { 1, 1, 1, 0, 9 }, /* U */
1333 { 2, 1, 1, 0, 9 }, /* V */
1334 },
1336 },
1338 .name = "yuv422p10be",
1339 .nb_components = 3,
1340 .log2_chroma_w = 1,
1341 .log2_chroma_h = 0,
1342 .comp = {
1343 { 0, 1, 1, 0, 9 }, /* Y */
1344 { 1, 1, 1, 0, 9 }, /* U */
1345 { 2, 1, 1, 0, 9 }, /* V */
1346 },
1348 },
1350 .name = "yuv422p12le",
1351 .nb_components = 3,
1352 .log2_chroma_w = 1,
1353 .log2_chroma_h = 0,
1354 .comp = {
1355 { 0, 1, 1, 0, 11 }, /* Y */
1356 { 1, 1, 1, 0, 11 }, /* U */
1357 { 2, 1, 1, 0, 11 }, /* V */
1358 },
1360 },
1362 .name = "yuv422p12be",
1363 .nb_components = 3,
1364 .log2_chroma_w = 1,
1365 .log2_chroma_h = 0,
1366 .comp = {
1367 { 0, 1, 1, 0, 11 }, /* Y */
1368 { 1, 1, 1, 0, 11 }, /* U */
1369 { 2, 1, 1, 0, 11 }, /* V */
1370 },
1372 },
1374 .name = "yuv422p14le",
1375 .nb_components = 3,
1376 .log2_chroma_w = 1,
1377 .log2_chroma_h = 0,
1378 .comp = {
1379 { 0, 1, 1, 0, 13 }, /* Y */
1380 { 1, 1, 1, 0, 13 }, /* U */
1381 { 2, 1, 1, 0, 13 }, /* V */
1382 },
1384 },
1386 .name = "yuv422p14be",
1387 .nb_components = 3,
1388 .log2_chroma_w = 1,
1389 .log2_chroma_h = 0,
1390 .comp = {
1391 { 0, 1, 1, 0, 13 }, /* Y */
1392 { 1, 1, 1, 0, 13 }, /* U */
1393 { 2, 1, 1, 0, 13 }, /* V */
1394 },
1396 },
1398 .name = "yuv422p16le",
1399 .nb_components = 3,
1400 .log2_chroma_w = 1,
1401 .log2_chroma_h = 0,
1402 .comp = {
1403 { 0, 1, 1, 0, 15 }, /* Y */
1404 { 1, 1, 1, 0, 15 }, /* U */
1405 { 2, 1, 1, 0, 15 }, /* V */
1406 },
1408 },
1410 .name = "yuv422p16be",
1411 .nb_components = 3,
1412 .log2_chroma_w = 1,
1413 .log2_chroma_h = 0,
1414 .comp = {
1415 { 0, 1, 1, 0, 15 }, /* Y */
1416 { 1, 1, 1, 0, 15 }, /* U */
1417 { 2, 1, 1, 0, 15 }, /* V */
1418 },
1420 },
1422 .name = "yuv444p16le",
1423 .nb_components = 3,
1424 .log2_chroma_w = 0,
1425 .log2_chroma_h = 0,
1426 .comp = {
1427 { 0, 1, 1, 0, 15 }, /* Y */
1428 { 1, 1, 1, 0, 15 }, /* U */
1429 { 2, 1, 1, 0, 15 }, /* V */
1430 },
1432 },
1434 .name = "yuv444p16be",
1435 .nb_components = 3,
1436 .log2_chroma_w = 0,
1437 .log2_chroma_h = 0,
1438 .comp = {
1439 { 0, 1, 1, 0, 15 }, /* Y */
1440 { 1, 1, 1, 0, 15 }, /* U */
1441 { 2, 1, 1, 0, 15 }, /* V */
1442 },
1444 },
1446 .name = "yuv444p10le",
1447 .nb_components = 3,
1448 .log2_chroma_w = 0,
1449 .log2_chroma_h = 0,
1450 .comp = {
1451 { 0, 1, 1, 0, 9 }, /* Y */
1452 { 1, 1, 1, 0, 9 }, /* U */
1453 { 2, 1, 1, 0, 9 }, /* V */
1454 },
1456 },
1458 .name = "yuv444p10be",
1459 .nb_components = 3,
1460 .log2_chroma_w = 0,
1461 .log2_chroma_h = 0,
1462 .comp = {
1463 { 0, 1, 1, 0, 9 }, /* Y */
1464 { 1, 1, 1, 0, 9 }, /* U */
1465 { 2, 1, 1, 0, 9 }, /* V */
1466 },
1468 },
1470 .name = "yuv444p9le",
1471 .nb_components = 3,
1472 .log2_chroma_w = 0,
1473 .log2_chroma_h = 0,
1474 .comp = {
1475 { 0, 1, 1, 0, 8 }, /* Y */
1476 { 1, 1, 1, 0, 8 }, /* U */
1477 { 2, 1, 1, 0, 8 }, /* V */
1478 },
1480 },
1482 .name = "yuv444p9be",
1483 .nb_components = 3,
1484 .log2_chroma_w = 0,
1485 .log2_chroma_h = 0,
1486 .comp = {
1487 { 0, 1, 1, 0, 8 }, /* Y */
1488 { 1, 1, 1, 0, 8 }, /* U */
1489 { 2, 1, 1, 0, 8 }, /* V */
1490 },
1492 },
1494 .name = "yuv444p12le",
1495 .nb_components = 3,
1496 .log2_chroma_w = 0,
1497 .log2_chroma_h = 0,
1498 .comp = {
1499 { 0, 1, 1, 0, 11 }, /* Y */
1500 { 1, 1, 1, 0, 11 }, /* U */
1501 { 2, 1, 1, 0, 11 }, /* V */
1502 },
1504 },
1506 .name = "yuv444p12be",
1507 .nb_components = 3,
1508 .log2_chroma_w = 0,
1509 .log2_chroma_h = 0,
1510 .comp = {
1511 { 0, 1, 1, 0, 11 }, /* Y */
1512 { 1, 1, 1, 0, 11 }, /* U */
1513 { 2, 1, 1, 0, 11 }, /* V */
1514 },
1516 },
1518 .name = "yuv444p14le",
1519 .nb_components = 3,
1520 .log2_chroma_w = 0,
1521 .log2_chroma_h = 0,
1522 .comp = {
1523 { 0, 1, 1, 0, 13 }, /* Y */
1524 { 1, 1, 1, 0, 13 }, /* U */
1525 { 2, 1, 1, 0, 13 }, /* V */
1526 },
1528 },
1530 .name = "yuv444p14be",
1531 .nb_components = 3,
1532 .log2_chroma_w = 0,
1533 .log2_chroma_h = 0,
1534 .comp = {
1535 { 0, 1, 1, 0, 13 }, /* Y */
1536 { 1, 1, 1, 0, 13 }, /* U */
1537 { 2, 1, 1, 0, 13 }, /* V */
1538 },
1540 },
1542 .name = "dxva2_vld",
1543 .log2_chroma_w = 1,
1544 .log2_chroma_h = 1,
1546 },
1548 .name = "vda_vld",
1549 .log2_chroma_w = 1,
1550 .log2_chroma_h = 1,
1552 },
1554 .name = "ya8",
1555 .nb_components = 2,
1556 .comp = {
1557 { 0, 1, 1, 0, 7 }, /* Y */
1558 { 0, 1, 2, 0, 7 }, /* A */
1559 },
1561 .alias = "gray8a",
1562 },
1564 .name = "ya16le",
1565 .nb_components = 2,
1566 .comp = {
1567 { 0, 3, 1, 0, 15 }, /* Y */
1568 { 0, 3, 3, 0, 15 }, /* A */
1569 },
1571 },
1573 .name = "ya16be",
1574 .nb_components = 2,
1575 .comp = {
1576 { 0, 3, 1, 0, 15 }, /* Y */
1577 { 0, 3, 3, 0, 15 }, /* A */
1578 },
1580 },
1582 .name = "gbrp",
1583 .nb_components = 3,
1584 .log2_chroma_w = 0,
1585 .log2_chroma_h = 0,
1586 .comp = {
1587 { 2, 0, 1, 0, 7 }, /* R */
1588 { 0, 0, 1, 0, 7 }, /* G */
1589 { 1, 0, 1, 0, 7 }, /* B */
1590 },
1592 },
1594 .name = "gbrp9le",
1595 .nb_components = 3,
1596 .log2_chroma_w = 0,
1597 .log2_chroma_h = 0,
1598 .comp = {
1599 { 2, 1, 1, 0, 8 }, /* R */
1600 { 0, 1, 1, 0, 8 }, /* G */
1601 { 1, 1, 1, 0, 8 }, /* B */
1602 },
1604 },
1606 .name = "gbrp9be",
1607 .nb_components = 3,
1608 .log2_chroma_w = 0,
1609 .log2_chroma_h = 0,
1610 .comp = {
1611 { 2, 1, 1, 0, 8 }, /* R */
1612 { 0, 1, 1, 0, 8 }, /* G */
1613 { 1, 1, 1, 0, 8 }, /* B */
1614 },
1616 },
1618 .name = "gbrp10le",
1619 .nb_components = 3,
1620 .log2_chroma_w = 0,
1621 .log2_chroma_h = 0,
1622 .comp = {
1623 { 2, 1, 1, 0, 9 }, /* R */
1624 { 0, 1, 1, 0, 9 }, /* G */
1625 { 1, 1, 1, 0, 9 }, /* B */
1626 },
1628 },
1630 .name = "gbrp10be",
1631 .nb_components = 3,
1632 .log2_chroma_w = 0,
1633 .log2_chroma_h = 0,
1634 .comp = {
1635 { 2, 1, 1, 0, 9 }, /* R */
1636 { 0, 1, 1, 0, 9 }, /* G */
1637 { 1, 1, 1, 0, 9 }, /* B */
1638 },
1640 },
1642 .name = "gbrp12le",
1643 .nb_components = 3,
1644 .log2_chroma_w = 0,
1645 .log2_chroma_h = 0,
1646 .comp = {
1647 { 2, 1, 1, 0, 11 }, /* R */
1648 { 0, 1, 1, 0, 11 }, /* G */
1649 { 1, 1, 1, 0, 11 }, /* B */
1650 },
1652 },
1654 .name = "gbrp12be",
1655 .nb_components = 3,
1656 .log2_chroma_w = 0,
1657 .log2_chroma_h = 0,
1658 .comp = {
1659 { 2, 1, 1, 0, 11 }, /* R */
1660 { 0, 1, 1, 0, 11 }, /* G */
1661 { 1, 1, 1, 0, 11 }, /* B */
1662 },
1664 },
1666 .name = "gbrp14le",
1667 .nb_components = 3,
1668 .log2_chroma_w = 0,
1669 .log2_chroma_h = 0,
1670 .comp = {
1671 { 2, 1, 1, 0, 13 }, /* R */
1672 { 0, 1, 1, 0, 13 }, /* G */
1673 { 1, 1, 1, 0, 13 }, /* B */
1674 },
1676 },
1678 .name = "gbrp14be",
1679 .nb_components = 3,
1680 .log2_chroma_w = 0,
1681 .log2_chroma_h = 0,
1682 .comp = {
1683 { 2, 1, 1, 0, 13 }, /* R */
1684 { 0, 1, 1, 0, 13 }, /* G */
1685 { 1, 1, 1, 0, 13 }, /* B */
1686 },
1688 },
1690 .name = "gbrp16le",
1691 .nb_components = 3,
1692 .log2_chroma_w = 0,
1693 .log2_chroma_h = 0,
1694 .comp = {
1695 { 2, 1, 1, 0, 15 }, /* R */
1696 { 0, 1, 1, 0, 15 }, /* G */
1697 { 1, 1, 1, 0, 15 }, /* B */
1698 },
1700 },
1702 .name = "gbrp16be",
1703 .nb_components = 3,
1704 .log2_chroma_w = 0,
1705 .log2_chroma_h = 0,
1706 .comp = {
1707 { 2, 1, 1, 0, 15 }, /* R */
1708 { 0, 1, 1, 0, 15 }, /* G */
1709 { 1, 1, 1, 0, 15 }, /* B */
1710 },
1712 },
1714 .name = "gbrap",
1715 .nb_components = 4,
1716 .log2_chroma_w = 0,
1717 .log2_chroma_h = 0,
1718 .comp = {
1719 { 2, 0, 1, 0, 7 }, /* R */
1720 { 0, 0, 1, 0, 7 }, /* G */
1721 { 1, 0, 1, 0, 7 }, /* B */
1722 { 3, 0, 1, 0, 7 }, /* A */
1723 },
1725 },
1727 .name = "gbrap16le",
1728 .nb_components = 4,
1729 .log2_chroma_w = 0,
1730 .log2_chroma_h = 0,
1731 .comp = {
1732 { 2, 1, 1, 0, 15 }, /* R */
1733 { 0, 1, 1, 0, 15 }, /* G */
1734 { 1, 1, 1, 0, 15 }, /* B */
1735 { 3, 1, 1, 0, 15 }, /* A */
1736 },
1738 },
1740 .name = "gbrap16be",
1741 .nb_components = 4,
1742 .log2_chroma_w = 0,
1743 .log2_chroma_h = 0,
1744 .comp = {
1745 { 2, 1, 1, 0, 15 }, /* R */
1746 { 0, 1, 1, 0, 15 }, /* G */
1747 { 1, 1, 1, 0, 15 }, /* B */
1748 { 3, 1, 1, 0, 15 }, /* A */
1749 },
1751 },
1753 .name = "vdpau",
1754 .log2_chroma_w = 1,
1755 .log2_chroma_h = 1,
1757 },
1759 .name = "xyz12le",
1760 .nb_components = 3,
1761 .log2_chroma_w = 0,
1762 .log2_chroma_h = 0,
1763 .comp = {
1764 { 0, 5, 1, 4, 11 }, /* X */
1765 { 0, 5, 3, 4, 11 }, /* Y */
1766 { 0, 5, 5, 4, 11 }, /* Z */
1767 },
1768 /*.flags = -- not used*/
1769 },
1771 .name = "xyz12be",
1772 .nb_components = 3,
1773 .log2_chroma_w = 0,
1774 .log2_chroma_h = 0,
1775 .comp = {
1776 { 0, 5, 1, 4, 11 }, /* X */
1777 { 0, 5, 3, 4, 11 }, /* Y */
1778 { 0, 5, 5, 4, 11 }, /* Z */
1779 },
1781 },
1782
1783 #define BAYER8_DESC_COMMON \
1784 .nb_components= 3, \
1785 .log2_chroma_w= 0, \
1786 .log2_chroma_h= 0, \
1787 .comp = { \
1788 {0,0,0,0,1}, \
1789 {0,0,0,0,3}, \
1790 {0,0,0,0,1}, \
1791 }, \
1792
1793 #define BAYER16_DESC_COMMON \
1794 .nb_components= 3, \
1795 .log2_chroma_w= 0, \
1796 .log2_chroma_h= 0, \
1797 .comp = { \
1798 {0,1,0,0, 3}, \
1799 {0,1,0,0, 7}, \
1800 {0,1,0,0, 3}, \
1801 }, \
1802
1804 .name = "bayer_bggr8",
1807 },
1809 .name = "bayer_bggr16le",
1812 },
1814 .name = "bayer_bggr16be",
1817 },
1819 .name = "bayer_rggb8",
1822 },
1824 .name = "bayer_rggb16le",
1827 },
1829 .name = "bayer_rggb16be",
1832 },
1834 .name = "bayer_gbrg8",
1837 },
1839 .name = "bayer_gbrg16le",
1842 },
1844 .name = "bayer_gbrg16be",
1847 },
1849 .name = "bayer_grbg8",
1852 },
1854 .name = "bayer_grbg16le",
1857 },
1859 .name = "bayer_grbg16be",
1862 },
1864 .name = "nv16",
1865 .nb_components = 3,
1866 .log2_chroma_w = 1,
1867 .log2_chroma_h = 0,
1868 .comp = {
1869 { 0, 0, 1, 0, 7 }, /* Y */
1870 { 1, 1, 1, 0, 7 }, /* U */
1871 { 1, 1, 2, 0, 7 }, /* V */
1872 },
1874 },
1876 .name = "nv20le",
1877 .nb_components = 3,
1878 .log2_chroma_w = 1,
1879 .log2_chroma_h = 0,
1880 .comp = {
1881 { 0, 1, 1, 0, 9 }, /* Y */
1882 { 1, 3, 1, 0, 9 }, /* U */
1883 { 1, 3, 3, 0, 9 }, /* V */
1884 },
1886 },
1888 .name = "nv20be",
1889 .nb_components = 3,
1890 .log2_chroma_w = 1,
1891 .log2_chroma_h = 0,
1892 .comp = {
1893 { 0, 1, 1, 0, 9 }, /* Y */
1894 { 1, 3, 1, 0, 9 }, /* U */
1895 { 1, 3, 3, 0, 9 }, /* V */
1896 },
1898 },
1900 .name = "vda",
1902 },
1904 .name = "qsv",
1906 },
1907 };
1908
1910 "unknown", "tv", "pc",
1911 };
1912
1914 "reserved", "bt709", "unknown", "reserved", "bt470m",
1915 "bt470bg", "smpte170m", "smpte240m", "film", "bt2020",
1916 };
1917
1919 "reserved", "bt709", "unknown", "reserved", "bt470m",
1920 "bt470bg", "smpte170m", "smpte240m", "linear", "log100",
1921 "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1",
1922 "bt2020-10", "bt2020-20",
1923 };
1924
1926 "gbr", "bt709", "unknown", "reserved", "fcc",
1927 "bt470bg", "smpte170m", "smpte240m", "ycgco",
1928 "bt2020nc", "bt2020c",
1929 };
1930
1932 "unspecified", "left", "center", "topleft",
1933 "top", "bottomleft", "bottom",
1934 };
1935
1938 {
1940
1942 if (av_pix_fmt_descriptors[pix_fmt].name &&
1943 (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) ||
1944 av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias)))
1946
1948 }
1949
1951 {
1954 }
1955
1956 #if HAVE_BIGENDIAN
1957 # define X_NE(be, le) be
1958 #else
1959 # define X_NE(be, le) le
1960 #endif
1961
1963 {
1965
1966 if (!strcmp(name, "rgb32"))
1967 name =
X_NE(
"argb",
"bgra");
1968 else if (!strcmp(name, "bgr32"))
1969 name =
X_NE(
"abgr",
"rgba");
1970
1973 char name2[32];
1974
1975 snprintf(name2,
sizeof(name2),
"%s%s", name,
X_NE(
"be",
"le"));
1977 }
1979 }
1980
1982 {
1985
1987 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1989 }
1990
1991 return bits >> log2_pixels;
1992 }
1993
1995 {
1998 int steps[4] = {0};
1999
2002 int s = c == 1 || c == 2 ? 0 : log2_pixels;
2004 }
2005 for (c = 0; c < 4; c++)
2006 bits += steps[c];
2007
2009 bits *= 8;
2010
2011 return bits >> log2_pixels;
2012 }
2013
2016 {
2017 /* print header */
2018 if (pix_fmt < 0) {
2019 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
2020 } else {
2022 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
2024 }
2025
2027 }
2028
2030 {
2033 return &av_pix_fmt_descriptors[
pix_fmt];
2034 }
2035
2037 {
2038 if (!prev)
2039 return &av_pix_fmt_descriptors[0];
2040 while (prev - av_pix_fmt_descriptors <
FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
2041 prev++;
2043 return prev;
2044 }
2046 }
2047
2049 {
2050 if (desc < av_pix_fmt_descriptors ||
2051 desc >= av_pix_fmt_descriptors +
FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
2053
2055 }
2056
2058 int *h_shift, int *v_shift)
2059 {
2061 if (!desc)
2065
2066 return 0;
2067 }
2068
2070 {
2072 int i, planes[4] = { 0 },
ret = 0;
2073
2074 if (!desc)
2076
2082 }
2083
2085 int i, j;
2086
2089 uint8_t fill[4][8+6+3] = {{0}};
2090 uint8_t *
data[4] = {fill[0], fill[1], fill[2], fill[3]};
2091 int linesize[4] = {0,0,0,0};
2092 uint16_t tmp[2];
2093
2095 continue;
2096 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2103
2108 continue;
2109 }
2112 } else {
2114 }
2115 if (!strncmp(d->
name,
"bayer_", 6))
2116 continue;
2121 }
2122 }
2123 }
2125
2126
2128 {
2131 int i;
2132
2133 if (!desc || strlen(desc->
name) < 2)
2136 i = strlen(name) - 2;
2137 if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2139
2140 name[i] ^= 'b' ^ 'l';
2141
2143 }
2144
2145 #define FF_COLOR_NA -1
2146 #define FF_COLOR_RGB 0 /**< RGB color space */
2147 #define FF_COLOR_GRAY 1 /**< gray color space */
2148 #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
2149 #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
2150
2151 #define pixdesc_has_alpha(pixdesc) \
2152 ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
2153
2154
2158
2161
2162 if(desc->
name && !strncmp(desc->
name,
"yuvj", 4))
2164
2167
2170
2172 }
2173
2175 {
2177 int i;
2178
2180 *min = *max = 0;
2182 }
2183
2184 *min = INT_MAX, *max = -INT_MAX;
2188 }
2189 return 0;
2190 }
2191
2194 unsigned *lossp, unsigned consider)
2195 {
2198 int src_color, dst_color;
2199 int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2200 int ret, loss, i, nb_components;
2201 int score = INT_MAX - 1;
2202
2204 return ~0;
2205
2206 /* compute loss */
2207 *lossp = loss = 0;
2208
2209 if (dst_pix_fmt == src_pix_fmt)
2210 return INT_MAX;
2211
2216
2221 else
2223
2224 for (i = 0; i < nb_components; i++) {
2228 score -= 65536 >> depth_minus1;
2229 }
2230 }
2231
2236 }
2240 }
2241 // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
2244 score += 512;
2245 }
2246 }
2247
2249 switch(dst_color) {
2254 break;
2258 break;
2262 break;
2268 break;
2269 default:
2270 /* fail safe test */
2271 if (src_color != dst_color)
2273 break;
2274 }
2275 if(loss & FF_LOSS_COLORSPACE)
2277
2281 score -= 2 * 65536;
2282 }
2285 score -= 65536;
2286 }
2290 score -= 65536;
2291 }
2292
2293 *lossp = loss;
2294 return score;
2295 }
2296
2299 int has_alpha)
2300 {
2301 int loss;
2303 if (ret < 0)
2305 return loss;
2306 }
2307
2309 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr)
2310 {
2312 int loss1, loss2, loss_mask;
2315 int score1, score2;
2316
2317 loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
2318 if(!has_alpha)
2320
2323
2324 if (score1 == score2) {
2327 } else {
2329 }
2330 } else {
2331 dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
2332 }
2333
2334 if (loss_ptr)
2336 return dst_pix_fmt;
2337 }
2338
2340 {
2343 }
2344
2346 {
2349 }
2350
2352 {
2355 }
2356
2358 {
2361 }
2362
2364 {
2367 }
2368
2369 #ifdef TEST
2370
2372 int i;
2373 int err=0;
2374 int skip = 0;
2375
2378 if(!desc || !desc->
name) {
2379 skip ++;
2380 continue;
2381 }
2382 if (skip) {
2384 skip = 0;
2385 }
2389 err = 1;
2390 }
2391 }
2392 return err;
2393 }
2394
2395 #endif
2396