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
32
36 int x,
int y,
int c,
int w,
37 int read_pal_component)
38 {
40 int plane = comp.
plane;
46
49 const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
50 int shift = 8 - depth - (skip & 7);
51
52 while (w--) {
54 if (read_pal_component)
55 val = data[1][4*val +
c];
56 shift -= step;
57 p -= shift >> 3;
58 shift &= 7;
60 }
61 } else {
62 const uint8_t *p = data[plane] + y * linesize[plane] +
64 int is_8bit = shift + depth <= 8;
65
66 if (is_8bit)
68
69 while (w--) {
70 int val = is_8bit ? *p :
72 val = (val >>
shift) & mask;
73 if (read_pal_component)
74 val = data[1][4 * val +
c];
75 p += step;
77 }
78 }
79 }
80
84 int x,
int y,
int c,
int w)
85 {
87 int plane = comp.
plane;
91
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 {
105 uint8_t *p = data[plane] + y * linesize[plane] +
107
108 if (shift + depth <= 8) {
110 while (w--) {
111 *p |= (*src++ <<
shift);
112 p += step;
113 }
114 } else {
115 while (w--) {
119 } else {
122 }
123 p += step;
124 }
125 }
126 }
127 }
128
129 #if !FF_API_PIX_FMT_DESC
130 static
131 #endif
135 .nb_components = 3,
136 .log2_chroma_w = 1,
137 .log2_chroma_h = 1,
138 .comp = {
139 { 0, 0, 1, 0, 7 }, /* Y */
140 { 1, 0, 1, 0, 7 }, /* U */
141 { 2, 0, 1, 0, 7 }, /* V */
142 },
144 },
146 .name = "yuyv422",
147 .nb_components = 3,
148 .log2_chroma_w = 1,
149 .log2_chroma_h = 0,
150 .comp = {
151 { 0, 1, 1, 0, 7 }, /* Y */
152 { 0, 3, 2, 0, 7 }, /* U */
153 { 0, 3, 4, 0, 7 }, /* V */
154 },
155 },
157 .name = "rgb24",
158 .nb_components = 3,
159 .log2_chroma_w = 0,
160 .log2_chroma_h = 0,
161 .comp = {
162 { 0, 2, 1, 0, 7 }, /* R */
163 { 0, 2, 2, 0, 7 }, /* G */
164 { 0, 2, 3, 0, 7 }, /* B */
165 },
167 },
169 .name = "bgr24",
170 .nb_components = 3,
171 .log2_chroma_w = 0,
172 .log2_chroma_h = 0,
173 .comp = {
174 { 0, 2, 3, 0, 7 }, /* R */
175 { 0, 2, 2, 0, 7 }, /* G */
176 { 0, 2, 1, 0, 7 }, /* B */
177 },
179 },
181 .name = "yuv422p",
182 .nb_components = 3,
183 .log2_chroma_w = 1,
184 .log2_chroma_h = 0,
185 .comp = {
186 { 0, 0, 1, 0, 7 }, /* Y */
187 { 1, 0, 1, 0, 7 }, /* U */
188 { 2, 0, 1, 0, 7 }, /* V */
189 },
191 },
193 .name = "yuv444p",
194 .nb_components = 3,
195 .log2_chroma_w = 0,
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 = "yuv410p",
206 .nb_components = 3,
207 .log2_chroma_w = 2,
208 .log2_chroma_h = 2,
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 = "yuv411p",
218 .nb_components = 3,
219 .log2_chroma_w = 2,
220 .log2_chroma_h = 0,
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 = "yuvj411p",
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 = "gray",
242 .nb_components = 1,
243 .log2_chroma_w = 0,
244 .log2_chroma_h = 0,
245 .comp = {
246 { 0, 0, 1, 0, 7 }, /* Y */
247 },
249 },
251 .name = "monow",
252 .nb_components = 1,
253 .log2_chroma_w = 0,
254 .log2_chroma_h = 0,
255 .comp = {
256 { 0, 0, 1, 0, 0 }, /* Y */
257 },
259 },
261 .name = "monob",
262 .nb_components = 1,
263 .log2_chroma_w = 0,
264 .log2_chroma_h = 0,
265 .comp = {
266 { 0, 0, 1, 7, 0 }, /* Y */
267 },
269 },
271 .name = "pal8",
272 .nb_components = 1,
273 .log2_chroma_w = 0,
274 .log2_chroma_h = 0,
275 .comp = {
276 { 0, 0, 1, 0, 7 },
277 },
279 },
281 .name = "yuvj420p",
282 .nb_components = 3,
283 .log2_chroma_w = 1,
284 .log2_chroma_h = 1,
285 .comp = {
286 { 0, 0, 1, 0, 7 }, /* Y */
287 { 1, 0, 1, 0, 7 }, /* U */
288 { 2, 0, 1, 0, 7 }, /* V */
289 },
291 },
293 .name = "yuvj422p",
294 .nb_components = 3,
295 .log2_chroma_w = 1,
296 .log2_chroma_h = 0,
297 .comp = {
298 { 0, 0, 1, 0, 7 }, /* Y */
299 { 1, 0, 1, 0, 7 }, /* U */
300 { 2, 0, 1, 0, 7 }, /* V */
301 },
303 },
305 .name = "yuvj444p",
306 .nb_components = 3,
307 .log2_chroma_w = 0,
308 .log2_chroma_h = 0,
309 .comp = {
310 { 0, 0, 1, 0, 7 }, /* Y */
311 { 1, 0, 1, 0, 7 }, /* U */
312 { 2, 0, 1, 0, 7 }, /* V */
313 },
315 },
317 .name = "xvmcmc",
319 },
321 .name = "xvmcidct",
323 },
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 },
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 },
347 .name = "bgr8",
348 .nb_components = 3,
349 .log2_chroma_w = 0,
350 .log2_chroma_h = 0,
351 .comp = {
352 { 0, 0, 1, 0, 2 }, /* R */
353 { 0, 0, 1, 3, 2 }, /* G */
354 { 0, 0, 1, 6, 1 }, /* B */
355 },
357 },
359 .name = "bgr4",
360 .nb_components = 3,
361 .log2_chroma_w = 0,
362 .log2_chroma_h = 0,
363 .comp = {
364 { 0, 3, 4, 0, 0 }, /* R */
365 { 0, 3, 2, 0, 1 }, /* G */
366 { 0, 3, 1, 0, 0 }, /* B */
367 },
369 },
371 .name = "bgr4_byte",
372 .nb_components = 3,
373 .log2_chroma_w = 0,
374 .log2_chroma_h = 0,
375 .comp = {
376 { 0, 0, 1, 0, 0 }, /* R */
377 { 0, 0, 1, 1, 1 }, /* G */
378 { 0, 0, 1, 3, 0 }, /* B */
379 },
381 },
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 },
393 },
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 },
405 },
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 },
417 },
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 },
429 },
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, 2, 0, 7 }, /* U */
438 { 1, 1, 1, 0, 7 }, /* V */
439 },
441 },
443 .name = "argb",
444 .nb_components = 4,
445 .log2_chroma_w = 0,
446 .log2_chroma_h = 0,
447 .comp = {
448 { 0, 3, 2, 0, 7 }, /* R */
449 { 0, 3, 3, 0, 7 }, /* G */
450 { 0, 3, 4, 0, 7 }, /* B */
451 { 0, 3, 1, 0, 7 }, /* A */
452 },
454 },
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 },
467 },
469 .name = "abgr",
470 .nb_components = 4,
471 .log2_chroma_w = 0,
472 .log2_chroma_h = 0,
473 .comp = {
474 { 0, 3, 4, 0, 7 }, /* R */
475 { 0, 3, 3, 0, 7 }, /* G */
476 { 0, 3, 2, 0, 7 }, /* B */
477 { 0, 3, 1, 0, 7 }, /* A */
478 },
480 },
482 .name = "bgra",
483 .nb_components = 4,
484 .log2_chroma_w = 0,
485 .log2_chroma_h = 0,
486 .comp = {
487 { 0, 3, 3, 0, 7 }, /* R */
488 { 0, 3, 2, 0, 7 }, /* G */
489 { 0, 3, 1, 0, 7 }, /* B */
490 { 0, 3, 4, 0, 7 }, /* A */
491 },
493 },
495 .name = "0rgb",
496 .nb_components= 3,
497 .log2_chroma_w= 0,
498 .log2_chroma_h= 0,
499 .comp = {
500 { 0, 3, 2, 0, 7 }, /* R */
501 { 0, 3, 3, 0, 7 }, /* G */
502 { 0, 3, 4, 0, 7 }, /* B */
503 },
505 },
507 .name = "rgb0",
508 .nb_components= 3,
509 .log2_chroma_w= 0,
510 .log2_chroma_h= 0,
511 .comp = {
512 { 0, 3, 1, 0, 7 }, /* R */
513 { 0, 3, 2, 0, 7 }, /* G */
514 { 0, 3, 3, 0, 7 }, /* B */
515 },
517 },
519 .name = "0bgr",
520 .nb_components= 3,
521 .log2_chroma_w= 0,
522 .log2_chroma_h= 0,
523 .comp = {
524 { 0, 3, 4, 0, 7 }, /* R */
525 { 0, 3, 3, 0, 7 }, /* G */
526 { 0, 3, 2, 0, 7 }, /* B */
527 },
529 },
531 .name = "bgr0",
532 .nb_components= 3,
533 .log2_chroma_w= 0,
534 .log2_chroma_h= 0,
535 .comp = {
536 { 0, 3, 3, 0, 7 }, /* R */
537 { 0, 3, 2, 0, 7 }, /* G */
538 { 0, 3, 1, 0, 7 }, /* B */
539 },
541 },
543 .name = "gray16be",
544 .nb_components = 1,
545 .log2_chroma_w = 0,
546 .log2_chroma_h = 0,
547 .comp = {
548 { 0, 1, 1, 0, 15 }, /* Y */
549 },
551 },
553 .name = "gray16le",
554 .nb_components = 1,
555 .log2_chroma_w = 0,
556 .log2_chroma_h = 0,
557 .comp = {
558 { 0, 1, 1, 0, 15 }, /* Y */
559 },
560 },
562 .name = "yuv440p",
563 .nb_components = 3,
564 .log2_chroma_w = 0,
565 .log2_chroma_h = 1,
566 .comp = {
567 { 0, 0, 1, 0, 7 }, /* Y */
568 { 1, 0, 1, 0, 7 }, /* U */
569 { 2, 0, 1, 0, 7 }, /* V */
570 },
572 },
574 .name = "yuvj440p",
575 .nb_components = 3,
576 .log2_chroma_w = 0,
577 .log2_chroma_h = 1,
578 .comp = {
579 { 0, 0, 1, 0, 7 }, /* Y */
580 { 1, 0, 1, 0, 7 }, /* U */
581 { 2, 0, 1, 0, 7 }, /* V */
582 },
584 },
586 .name = "yuva420p",
587 .nb_components = 4,
588 .log2_chroma_w = 1,
589 .log2_chroma_h = 1,
590 .comp = {
591 { 0, 0, 1, 0, 7 }, /* Y */
592 { 1, 0, 1, 0, 7 }, /* U */
593 { 2, 0, 1, 0, 7 }, /* V */
594 { 3, 0, 1, 0, 7 }, /* A */
595 },
597 },
599 .name = "yuva422p",
600 .nb_components = 4,
601 .log2_chroma_w = 1,
602 .log2_chroma_h = 0,
603 .comp = {
604 { 0, 0, 1, 0, 7 }, /* Y */
605 { 1, 0, 1, 0, 7 }, /* U */
606 { 2, 0, 1, 0, 7 }, /* V */
607 { 3, 0, 1, 0, 7 }, /* A */
608 },
610 },
612 .name = "yuva444p",
613 .nb_components = 4,
614 .log2_chroma_w = 0,
615 .log2_chroma_h = 0,
616 .comp = {
617 { 0, 0, 1, 0, 7 }, /* Y */
618 { 1, 0, 1, 0, 7 }, /* U */
619 { 2, 0, 1, 0, 7 }, /* V */
620 { 3, 0, 1, 0, 7 }, /* A */
621 },
623 },
625 .name = "yuva420p9be",
626 .nb_components = 4,
627 .log2_chroma_w = 1,
628 .log2_chroma_h = 1,
629 .comp = {
630 { 0, 1, 1, 0, 8 }, /* Y */
631 { 1, 1, 1, 0, 8 }, /* U */
632 { 2, 1, 1, 0, 8 }, /* V */
633 { 3, 1, 1, 0, 8 }, /* A */
634 },
636 },
638 .name = "yuva420p9le",
639 .nb_components = 4,
640 .log2_chroma_w = 1,
641 .log2_chroma_h = 1,
642 .comp = {
643 { 0, 1, 1, 0, 8 }, /* Y */
644 { 1, 1, 1, 0, 8 }, /* U */
645 { 2, 1, 1, 0, 8 }, /* V */
646 { 3, 1, 1, 0, 8 }, /* A */
647 },
649 },
651 .name = "yuva422p9be",
652 .nb_components = 4,
653 .log2_chroma_w = 1,
654 .log2_chroma_h = 0,
655 .comp = {
656 { 0, 1, 1, 0, 8 }, /* Y */
657 { 1, 1, 1, 0, 8 }, /* U */
658 { 2, 1, 1, 0, 8 }, /* V */
659 { 3, 1, 1, 0, 8 }, /* A */
660 },
662 },
664 .name = "yuva422p9le",
665 .nb_components = 4,
666 .log2_chroma_w = 1,
667 .log2_chroma_h = 0,
668 .comp = {
669 { 0, 1, 1, 0, 8 }, /* Y */
670 { 1, 1, 1, 0, 8 }, /* U */
671 { 2, 1, 1, 0, 8 }, /* V */
672 { 3, 1, 1, 0, 8 }, /* A */
673 },
675 },
677 .name = "yuva444p9be",
678 .nb_components = 4,
679 .log2_chroma_w = 0,
680 .log2_chroma_h = 0,
681 .comp = {
682 { 0, 1, 1, 0, 8 }, /* Y */
683 { 1, 1, 1, 0, 8 }, /* U */
684 { 2, 1, 1, 0, 8 }, /* V */
685 { 3, 1, 1, 0, 8 }, /* A */
686 },
688 },
690 .name = "yuva444p9le",
691 .nb_components = 4,
692 .log2_chroma_w = 0,
693 .log2_chroma_h = 0,
694 .comp = {
695 { 0, 1, 1, 0, 8 }, /* Y */
696 { 1, 1, 1, 0, 8 }, /* U */
697 { 2, 1, 1, 0, 8 }, /* V */
698 { 3, 1, 1, 0, 8 }, /* A */
699 },
701 },
703 .name = "yuva420p10be",
704 .nb_components = 4,
705 .log2_chroma_w = 1,
706 .log2_chroma_h = 1,
707 .comp = {
708 { 0, 1, 1, 0, 9 }, /* Y */
709 { 1, 1, 1, 0, 9 }, /* U */
710 { 2, 1, 1, 0, 9 }, /* V */
711 { 3, 1, 1, 0, 9 }, /* A */
712 },
714 },
716 .name = "yuva420p10le",
717 .nb_components = 4,
718 .log2_chroma_w = 1,
719 .log2_chroma_h = 1,
720 .comp = {
721 { 0, 1, 1, 0, 9 }, /* Y */
722 { 1, 1, 1, 0, 9 }, /* U */
723 { 2, 1, 1, 0, 9 }, /* V */
724 { 3, 1, 1, 0, 9 }, /* A */
725 },
727 },
729 .name = "yuva422p10be",
730 .nb_components = 4,
731 .log2_chroma_w = 1,
732 .log2_chroma_h = 0,
733 .comp = {
734 { 0, 1, 1, 0, 9 }, /* Y */
735 { 1, 1, 1, 0, 9 }, /* U */
736 { 2, 1, 1, 0, 9 }, /* V */
737 { 3, 1, 1, 0, 9 }, /* A */
738 },
740 },
742 .name = "yuva422p10le",
743 .nb_components = 4,
744 .log2_chroma_w = 1,
745 .log2_chroma_h = 0,
746 .comp = {
747 { 0, 1, 1, 0, 9 }, /* Y */
748 { 1, 1, 1, 0, 9 }, /* U */
749 { 2, 1, 1, 0, 9 }, /* V */
750 { 3, 1, 1, 0, 9 }, /* A */
751 },
753 },
755 .name = "yuva444p10be",
756 .nb_components = 4,
757 .log2_chroma_w = 0,
758 .log2_chroma_h = 0,
759 .comp = {
760 { 0, 1, 1, 0, 9 }, /* Y */
761 { 1, 1, 1, 0, 9 }, /* U */
762 { 2, 1, 1, 0, 9 }, /* V */
763 { 3, 1, 1, 0, 9 }, /* A */
764 },
766 },
768 .name = "yuva444p10le",
769 .nb_components = 4,
770 .log2_chroma_w = 0,
771 .log2_chroma_h = 0,
772 .comp = {
773 { 0, 1, 1, 0, 9 }, /* Y */
774 { 1, 1, 1, 0, 9 }, /* U */
775 { 2, 1, 1, 0, 9 }, /* V */
776 { 3, 1, 1, 0, 9 }, /* A */
777 },
779 },
781 .name = "yuva420p16be",
782 .nb_components = 4,
783 .log2_chroma_w = 1,
784 .log2_chroma_h = 1,
785 .comp = {
786 { 0, 1, 1, 0, 15 }, /* Y */
787 { 1, 1, 1, 0, 15 }, /* U */
788 { 2, 1, 1, 0, 15 }, /* V */
789 { 3, 1, 1, 0, 15 }, /* A */
790 },
792 },
794 .name = "yuva420p16le",
795 .nb_components = 4,
796 .log2_chroma_w = 1,
797 .log2_chroma_h = 1,
798 .comp = {
799 { 0, 1, 1, 0, 15 }, /* Y */
800 { 1, 1, 1, 0, 15 }, /* U */
801 { 2, 1, 1, 0, 15 }, /* V */
802 { 3, 1, 1, 0, 15 }, /* A */
803 },
805 },
807 .name = "yuva422p16be",
808 .nb_components = 4,
809 .log2_chroma_w = 1,
810 .log2_chroma_h = 0,
811 .comp = {
812 { 0, 1, 1, 0, 15 }, /* Y */
813 { 1, 1, 1, 0, 15 }, /* U */
814 { 2, 1, 1, 0, 15 }, /* V */
815 { 3, 1, 1, 0, 15 }, /* A */
816 },
818 },
820 .name = "yuva422p16le",
821 .nb_components = 4,
822 .log2_chroma_w = 1,
823 .log2_chroma_h = 0,
824 .comp = {
825 { 0, 1, 1, 0, 15 }, /* Y */
826 { 1, 1, 1, 0, 15 }, /* U */
827 { 2, 1, 1, 0, 15 }, /* V */
828 { 3, 1, 1, 0, 15 }, /* A */
829 },
831 },
833 .name = "yuva444p16be",
834 .nb_components = 4,
835 .log2_chroma_w = 0,
836 .log2_chroma_h = 0,
837 .comp = {
838 { 0, 1, 1, 0, 15 }, /* Y */
839 { 1, 1, 1, 0, 15 }, /* U */
840 { 2, 1, 1, 0, 15 }, /* V */
841 { 3, 1, 1, 0, 15 }, /* A */
842 },
844 },
846 .name = "yuva444p16le",
847 .nb_components = 4,
848 .log2_chroma_w = 0,
849 .log2_chroma_h = 0,
850 .comp = {
851 { 0, 1, 1, 0, 15 }, /* Y */
852 { 1, 1, 1, 0, 15 }, /* U */
853 { 2, 1, 1, 0, 15 }, /* V */
854 { 3, 1, 1, 0, 15 }, /* A */
855 },
857 },
858 #if FF_API_VDPAU
860 .name = "vdpau_h264",
861 .log2_chroma_w = 1,
862 .log2_chroma_h = 1,
864 },
866 .name = "vdpau_mpeg1",
867 .log2_chroma_w = 1,
868 .log2_chroma_h = 1,
870 },
872 .name = "vdpau_mpeg2",
873 .log2_chroma_w = 1,
874 .log2_chroma_h = 1,
876 },
878 .name = "vdpau_wmv3",
879 .log2_chroma_w = 1,
880 .log2_chroma_h = 1,
882 },
884 .name = "vdpau_vc1",
885 .log2_chroma_w = 1,
886 .log2_chroma_h = 1,
888 },
890 .name = "vdpau_mpeg4",
891 .log2_chroma_w = 1,
892 .log2_chroma_h = 1,
894 },
895 #endif
897 .name = "rgb48be",
898 .nb_components = 3,
899 .log2_chroma_w = 0,
900 .log2_chroma_h = 0,
901 .comp = {
902 { 0, 5, 1, 0, 15 }, /* R */
903 { 0, 5, 3, 0, 15 }, /* G */
904 { 0, 5, 5, 0, 15 }, /* B */
905 },
907 },
909 .name = "rgb48le",
910 .nb_components = 3,
911 .log2_chroma_w = 0,
912 .log2_chroma_h = 0,
913 .comp = {
914 { 0, 5, 1, 0, 15 }, /* R */
915 { 0, 5, 3, 0, 15 }, /* G */
916 { 0, 5, 5, 0, 15 }, /* B */
917 },
919 },
921 .name = "rgba64be",
922 .nb_components= 4,
923 .log2_chroma_w= 0,
924 .log2_chroma_h= 0,
925 .comp = {
926 { 0, 7, 1, 0, 15 }, /* R */
927 { 0, 7, 3, 0, 15 }, /* G */
928 { 0, 7, 5, 0, 15 }, /* B */
929 { 0, 7, 7, 0, 15 }, /* A */
930 },
932 },
934 .name = "rgba64le",
935 .nb_components= 4,
936 .log2_chroma_w= 0,
937 .log2_chroma_h= 0,
938 .comp = {
939 { 0, 7, 1, 0, 15 }, /* R */
940 { 0, 7, 3, 0, 15 }, /* G */
941 { 0, 7, 5, 0, 15 }, /* B */
942 { 0, 7, 7, 0, 15 }, /* A */
943 },
945 },
947 .name = "rgb565be",
948 .nb_components = 3,
949 .log2_chroma_w = 0,
950 .log2_chroma_h = 0,
951 .comp = {
952 { 0, 1, 0, 3, 4 }, /* R */
953 { 0, 1, 1, 5, 5 }, /* G */
954 { 0, 1, 1, 0, 4 }, /* B */
955 },
957 },
959 .name = "rgb565le",
960 .nb_components = 3,
961 .log2_chroma_w = 0,
962 .log2_chroma_h = 0,
963 .comp = {
964 { 0, 1, 2, 3, 4 }, /* R */
965 { 0, 1, 1, 5, 5 }, /* G */
966 { 0, 1, 1, 0, 4 }, /* B */
967 },
969 },
971 .name = "rgb555be",
972 .nb_components = 3,
973 .log2_chroma_w = 0,
974 .log2_chroma_h = 0,
975 .comp = {
976 { 0, 1, 0, 2, 4 }, /* R */
977 { 0, 1, 1, 5, 4 }, /* G */
978 { 0, 1, 1, 0, 4 }, /* B */
979 },
981 },
983 .name = "rgb555le",
984 .nb_components = 3,
985 .log2_chroma_w = 0,
986 .log2_chroma_h = 0,
987 .comp = {
988 { 0, 1, 2, 2, 4 }, /* R */
989 { 0, 1, 1, 5, 4 }, /* G */
990 { 0, 1, 1, 0, 4 }, /* B */
991 },
993 },
995 .name = "rgb444be",
996 .nb_components = 3,
997 .log2_chroma_w = 0,
998 .log2_chroma_h = 0,
999 .comp = {
1000 { 0, 1, 0, 0, 3 }, /* R */
1001 { 0, 1, 1, 4, 3 }, /* G */
1002 { 0, 1, 1, 0, 3 }, /* B */
1003 },
1005 },
1007 .name = "rgb444le",
1008 .nb_components = 3,
1009 .log2_chroma_w = 0,
1010 .log2_chroma_h = 0,
1011 .comp = {
1012 { 0, 1, 2, 0, 3 }, /* R */
1013 { 0, 1, 1, 4, 3 }, /* G */
1014 { 0, 1, 1, 0, 3 }, /* B */
1015 },
1017 },
1019 .name = "bgr48be",
1020 .nb_components = 3,
1021 .log2_chroma_w = 0,
1022 .log2_chroma_h = 0,
1023 .comp = {
1024 { 0, 5, 5, 0, 15 }, /* R */
1025 { 0, 5, 3, 0, 15 }, /* G */
1026 { 0, 5, 1, 0, 15 }, /* B */
1027 },
1029 },
1031 .name = "bgr48le",
1032 .nb_components = 3,
1033 .log2_chroma_w = 0,
1034 .log2_chroma_h = 0,
1035 .comp = {
1036 { 0, 5, 5, 0, 15 }, /* R */
1037 { 0, 5, 3, 0, 15 }, /* G */
1038 { 0, 5, 1, 0, 15 }, /* B */
1039 },
1041 },
1043 .name = "bgra64be",
1044 .nb_components= 4,
1045 .log2_chroma_w= 0,
1046 .log2_chroma_h= 0,
1047 .comp = {
1048 { 0, 7, 5, 0, 15 }, /* R */
1049 { 0, 7, 3, 0, 15 }, /* G */
1050 { 0, 7, 1, 0, 15 }, /* B */
1051 { 0, 7, 7, 0, 15 }, /* A */
1052 },
1054 },
1056 .name = "bgra64le",
1057 .nb_components= 4,
1058 .log2_chroma_w= 0,
1059 .log2_chroma_h= 0,
1060 .comp = {
1061 { 0, 7, 5, 0, 15 }, /* R */
1062 { 0, 7, 3, 0, 15 }, /* G */
1063 { 0, 7, 1, 0, 15 }, /* B */
1064 { 0, 7, 7, 0, 15 }, /* A */
1065 },
1067 },
1069 .name = "bgr565be",
1070 .nb_components = 3,
1071 .log2_chroma_w = 0,
1072 .log2_chroma_h = 0,
1073 .comp = {
1074 { 0, 1, 1, 0, 4 }, /* R */
1075 { 0, 1, 1, 5, 5 }, /* G */
1076 { 0, 1, 0, 3, 4 }, /* B */
1077 },
1079 },
1081 .name = "bgr565le",
1082 .nb_components = 3,
1083 .log2_chroma_w = 0,
1084 .log2_chroma_h = 0,
1085 .comp = {
1086 { 0, 1, 1, 0, 4 }, /* R */
1087 { 0, 1, 1, 5, 5 }, /* G */
1088 { 0, 1, 2, 3, 4 }, /* B */
1089 },
1091 },
1093 .name = "bgr555be",
1094 .nb_components = 3,
1095 .log2_chroma_w = 0,
1096 .log2_chroma_h = 0,
1097 .comp = {
1098 { 0, 1, 1, 0, 4 }, /* R */
1099 { 0, 1, 1, 5, 4 }, /* G */
1100 { 0, 1, 0, 2, 4 }, /* B */
1101 },
1103 },
1105 .name = "bgr555le",
1106 .nb_components = 3,
1107 .log2_chroma_w = 0,
1108 .log2_chroma_h = 0,
1109 .comp = {
1110 { 0, 1, 1, 0, 4 }, /* R */
1111 { 0, 1, 1, 5, 4 }, /* G */
1112 { 0, 1, 2, 2, 4 }, /* B */
1113 },
1115 },
1117 .name = "bgr444be",
1118 .nb_components = 3,
1119 .log2_chroma_w = 0,
1120 .log2_chroma_h = 0,
1121 .comp = {
1122 { 0, 1, 1, 0, 3 }, /* R */
1123 { 0, 1, 1, 4, 3 }, /* G */
1124 { 0, 1, 0, 0, 3 }, /* B */
1125 },
1127 },
1129 .name = "bgr444le",
1130 .nb_components = 3,
1131 .log2_chroma_w = 0,
1132 .log2_chroma_h = 0,
1133 .comp = {
1134 { 0, 1, 1, 0, 3 }, /* R */
1135 { 0, 1, 1, 4, 3 }, /* G */
1136 { 0, 1, 2, 0, 3 }, /* B */
1137 },
1139 },
1141 .name = "vaapi_moco",
1142 .log2_chroma_w = 1,
1143 .log2_chroma_h = 1,
1145 },
1147 .name = "vaapi_idct",
1148 .log2_chroma_w = 1,
1149 .log2_chroma_h = 1,
1151 },
1153 .name = "vaapi_vld",
1154 .log2_chroma_w = 1,
1155 .log2_chroma_h = 1,
1157 },
1159 .name = "yuv420p9le",
1160 .nb_components = 3,
1161 .log2_chroma_w = 1,
1162 .log2_chroma_h = 1,
1163 .comp = {
1164 { 0, 1, 1, 0, 8 }, /* Y */
1165 { 1, 1, 1, 0, 8 }, /* U */
1166 { 2, 1, 1, 0, 8 }, /* V */
1167 },
1169 },
1171 .name = "yuv420p9be",
1172 .nb_components = 3,
1173 .log2_chroma_w = 1,
1174 .log2_chroma_h = 1,
1175 .comp = {
1176 { 0, 1, 1, 0, 8 }, /* Y */
1177 { 1, 1, 1, 0, 8 }, /* U */
1178 { 2, 1, 1, 0, 8 }, /* V */
1179 },
1181 },
1183 .name = "yuv420p10le",
1184 .nb_components = 3,
1185 .log2_chroma_w = 1,
1186 .log2_chroma_h = 1,
1187 .comp = {
1188 { 0, 1, 1, 0, 9 }, /* Y */
1189 { 1, 1, 1, 0, 9 }, /* U */
1190 { 2, 1, 1, 0, 9 }, /* V */
1191 },
1193 },
1195 .name = "yuv420p10be",
1196 .nb_components = 3,
1197 .log2_chroma_w = 1,
1198 .log2_chroma_h = 1,
1199 .comp = {
1200 { 0, 1, 1, 0, 9 }, /* Y */
1201 { 1, 1, 1, 0, 9 }, /* U */
1202 { 2, 1, 1, 0, 9 }, /* V */
1203 },
1205 },
1207 .name = "yuv420p12le",
1208 .nb_components = 3,
1209 .log2_chroma_w = 1,
1210 .log2_chroma_h = 1,
1211 .comp = {
1212 { 0, 1, 1, 0, 11 }, /* Y */
1213 { 1, 1, 1, 0, 11 }, /* U */
1214 { 2, 1, 1, 0, 11 }, /* V */
1215 },
1217 },
1219 .name = "yuv420p12be",
1220 .nb_components = 3,
1221 .log2_chroma_w = 1,
1222 .log2_chroma_h = 1,
1223 .comp = {
1224 { 0, 1, 1, 0, 11 }, /* Y */
1225 { 1, 1, 1, 0, 11 }, /* U */
1226 { 2, 1, 1, 0, 11 }, /* V */
1227 },
1229 },
1231 .name = "yuv420p14le",
1232 .nb_components = 3,
1233 .log2_chroma_w = 1,
1234 .log2_chroma_h = 1,
1235 .comp = {
1236 { 0, 1, 1, 0, 13 }, /* Y */
1237 { 1, 1, 1, 0, 13 }, /* U */
1238 { 2, 1, 1, 0, 13 }, /* V */
1239 },
1241 },
1243 .name = "yuv420p14be",
1244 .nb_components = 3,
1245 .log2_chroma_w = 1,
1246 .log2_chroma_h = 1,
1247 .comp = {
1248 { 0, 1, 1, 0, 13 }, /* Y */
1249 { 1, 1, 1, 0, 13 }, /* U */
1250 { 2, 1, 1, 0, 13 }, /* V */
1251 },
1253 },
1255 .name = "yuv420p16le",
1256 .nb_components = 3,
1257 .log2_chroma_w = 1,
1258 .log2_chroma_h = 1,
1259 .comp = {
1260 { 0, 1, 1, 0, 15 }, /* Y */
1261 { 1, 1, 1, 0, 15 }, /* U */
1262 { 2, 1, 1, 0, 15 }, /* V */
1263 },
1265 },
1267 .name = "yuv420p16be",
1268 .nb_components = 3,
1269 .log2_chroma_w = 1,
1270 .log2_chroma_h = 1,
1271 .comp = {
1272 { 0, 1, 1, 0, 15 }, /* Y */
1273 { 1, 1, 1, 0, 15 }, /* U */
1274 { 2, 1, 1, 0, 15 }, /* V */
1275 },
1277 },
1279 .name = "yuv422p9le",
1280 .nb_components = 3,
1281 .log2_chroma_w = 1,
1282 .log2_chroma_h = 0,
1283 .comp = {
1284 { 0, 1, 1, 0, 8 }, /* Y */
1285 { 1, 1, 1, 0, 8 }, /* U */
1286 { 2, 1, 1, 0, 8 }, /* V */
1287 },
1289 },
1291 .name = "yuv422p9be",
1292 .nb_components = 3,
1293 .log2_chroma_w = 1,
1294 .log2_chroma_h = 0,
1295 .comp = {
1296 { 0, 1, 1, 0, 8 }, /* Y */
1297 { 1, 1, 1, 0, 8 }, /* U */
1298 { 2, 1, 1, 0, 8 }, /* V */
1299 },
1301 },
1303 .name = "yuv422p10le",
1304 .nb_components = 3,
1305 .log2_chroma_w = 1,
1306 .log2_chroma_h = 0,
1307 .comp = {
1308 { 0, 1, 1, 0, 9 }, /* Y */
1309 { 1, 1, 1, 0, 9 }, /* U */
1310 { 2, 1, 1, 0, 9 }, /* V */
1311 },
1313 },
1315 .name = "yuv422p10be",
1316 .nb_components = 3,
1317 .log2_chroma_w = 1,
1318 .log2_chroma_h = 0,
1319 .comp = {
1320 { 0, 1, 1, 0, 9 }, /* Y */
1321 { 1, 1, 1, 0, 9 }, /* U */
1322 { 2, 1, 1, 0, 9 }, /* V */
1323 },
1325 },
1327 .name = "yuv422p12le",
1328 .nb_components = 3,
1329 .log2_chroma_w = 1,
1330 .log2_chroma_h = 0,
1331 .comp = {
1332 { 0, 1, 1, 0, 11 }, /* Y */
1333 { 1, 1, 1, 0, 11 }, /* U */
1334 { 2, 1, 1, 0, 11 }, /* V */
1335 },
1337 },
1339 .name = "yuv422p12be",
1340 .nb_components = 3,
1341 .log2_chroma_w = 1,
1342 .log2_chroma_h = 0,
1343 .comp = {
1344 { 0, 1, 1, 0, 11 }, /* Y */
1345 { 1, 1, 1, 0, 11 }, /* U */
1346 { 2, 1, 1, 0, 11 }, /* V */
1347 },
1349 },
1351 .name = "yuv422p14le",
1352 .nb_components = 3,
1353 .log2_chroma_w = 1,
1354 .log2_chroma_h = 0,
1355 .comp = {
1356 { 0, 1, 1, 0, 13 }, /* Y */
1357 { 1, 1, 1, 0, 13 }, /* U */
1358 { 2, 1, 1, 0, 13 }, /* V */
1359 },
1361 },
1363 .name = "yuv422p14be",
1364 .nb_components = 3,
1365 .log2_chroma_w = 1,
1366 .log2_chroma_h = 0,
1367 .comp = {
1368 { 0, 1, 1, 0, 13 }, /* Y */
1369 { 1, 1, 1, 0, 13 }, /* U */
1370 { 2, 1, 1, 0, 13 }, /* V */
1371 },
1373 },
1375 .name = "yuv422p16le",
1376 .nb_components = 3,
1377 .log2_chroma_w = 1,
1378 .log2_chroma_h = 0,
1379 .comp = {
1380 { 0, 1, 1, 0, 15 }, /* Y */
1381 { 1, 1, 1, 0, 15 }, /* U */
1382 { 2, 1, 1, 0, 15 }, /* V */
1383 },
1385 },
1387 .name = "yuv422p16be",
1388 .nb_components = 3,
1389 .log2_chroma_w = 1,
1390 .log2_chroma_h = 0,
1391 .comp = {
1392 { 0, 1, 1, 0, 15 }, /* Y */
1393 { 1, 1, 1, 0, 15 }, /* U */
1394 { 2, 1, 1, 0, 15 }, /* V */
1395 },
1397 },
1399 .name = "yuv444p16le",
1400 .nb_components = 3,
1401 .log2_chroma_w = 0,
1402 .log2_chroma_h = 0,
1403 .comp = {
1404 { 0, 1, 1, 0, 15 }, /* Y */
1405 { 1, 1, 1, 0, 15 }, /* U */
1406 { 2, 1, 1, 0, 15 }, /* V */
1407 },
1409 },
1411 .name = "yuv444p16be",
1412 .nb_components = 3,
1413 .log2_chroma_w = 0,
1414 .log2_chroma_h = 0,
1415 .comp = {
1416 { 0, 1, 1, 0, 15 }, /* Y */
1417 { 1, 1, 1, 0, 15 }, /* U */
1418 { 2, 1, 1, 0, 15 }, /* V */
1419 },
1421 },
1423 .name = "yuv444p10le",
1424 .nb_components = 3,
1425 .log2_chroma_w = 0,
1426 .log2_chroma_h = 0,
1427 .comp = {
1428 { 0, 1, 1, 0, 9 }, /* Y */
1429 { 1, 1, 1, 0, 9 }, /* U */
1430 { 2, 1, 1, 0, 9 }, /* V */
1431 },
1433 },
1435 .name = "yuv444p10be",
1436 .nb_components = 3,
1437 .log2_chroma_w = 0,
1438 .log2_chroma_h = 0,
1439 .comp = {
1440 { 0, 1, 1, 0, 9 }, /* Y */
1441 { 1, 1, 1, 0, 9 }, /* U */
1442 { 2, 1, 1, 0, 9 }, /* V */
1443 },
1445 },
1447 .name = "yuv444p9le",
1448 .nb_components = 3,
1449 .log2_chroma_w = 0,
1450 .log2_chroma_h = 0,
1451 .comp = {
1452 { 0, 1, 1, 0, 8 }, /* Y */
1453 { 1, 1, 1, 0, 8 }, /* U */
1454 { 2, 1, 1, 0, 8 }, /* V */
1455 },
1457 },
1459 .name = "yuv444p9be",
1460 .nb_components = 3,
1461 .log2_chroma_w = 0,
1462 .log2_chroma_h = 0,
1463 .comp = {
1464 { 0, 1, 1, 0, 8 }, /* Y */
1465 { 1, 1, 1, 0, 8 }, /* U */
1466 { 2, 1, 1, 0, 8 }, /* V */
1467 },
1469 },
1471 .name = "yuv444p12le",
1472 .nb_components = 3,
1473 .log2_chroma_w = 0,
1474 .log2_chroma_h = 0,
1475 .comp = {
1476 { 0, 1, 1, 0, 11 }, /* Y */
1477 { 1, 1, 1, 0, 11 }, /* U */
1478 { 2, 1, 1, 0, 11 }, /* V */
1479 },
1481 },
1483 .name = "yuv444p12be",
1484 .nb_components = 3,
1485 .log2_chroma_w = 0,
1486 .log2_chroma_h = 0,
1487 .comp = {
1488 { 0, 1, 1, 0, 11 }, /* Y */
1489 { 1, 1, 1, 0, 11 }, /* U */
1490 { 2, 1, 1, 0, 11 }, /* V */
1491 },
1493 },
1495 .name = "yuv444p14le",
1496 .nb_components = 3,
1497 .log2_chroma_w = 0,
1498 .log2_chroma_h = 0,
1499 .comp = {
1500 { 0, 1, 1, 0, 13 }, /* Y */
1501 { 1, 1, 1, 0, 13 }, /* U */
1502 { 2, 1, 1, 0, 13 }, /* V */
1503 },
1505 },
1507 .name = "yuv444p14be",
1508 .nb_components = 3,
1509 .log2_chroma_w = 0,
1510 .log2_chroma_h = 0,
1511 .comp = {
1512 { 0, 1, 1, 0, 13 }, /* Y */
1513 { 1, 1, 1, 0, 13 }, /* U */
1514 { 2, 1, 1, 0, 13 }, /* V */
1515 },
1517 },
1519 .name = "dxva2_vld",
1520 .log2_chroma_w = 1,
1521 .log2_chroma_h = 1,
1523 },
1525 .name = "vda_vld",
1526 .log2_chroma_w = 1,
1527 .log2_chroma_h = 1,
1529 },
1531 .name = "gray8a",
1532 .nb_components = 2,
1533 .comp = {
1534 { 0, 1, 1, 0, 7 }, /* Y */
1535 { 0, 1, 2, 0, 7 }, /* A */
1536 },
1538 },
1540 .name = "gbrp",
1541 .nb_components = 3,
1542 .log2_chroma_w = 0,
1543 .log2_chroma_h = 0,
1544 .comp = {
1545 { 2, 0, 1, 0, 7 }, /* R */
1546 { 0, 0, 1, 0, 7 }, /* G */
1547 { 1, 0, 1, 0, 7 }, /* B */
1548 },
1550 },
1552 .name = "gbrp9le",
1553 .nb_components = 3,
1554 .log2_chroma_w = 0,
1555 .log2_chroma_h = 0,
1556 .comp = {
1557 { 2, 1, 1, 0, 8 }, /* R */
1558 { 0, 1, 1, 0, 8 }, /* G */
1559 { 1, 1, 1, 0, 8 }, /* B */
1560 },
1562 },
1564 .name = "gbrp9be",
1565 .nb_components = 3,
1566 .log2_chroma_w = 0,
1567 .log2_chroma_h = 0,
1568 .comp = {
1569 { 2, 1, 1, 0, 8 }, /* R */
1570 { 0, 1, 1, 0, 8 }, /* G */
1571 { 1, 1, 1, 0, 8 }, /* B */
1572 },
1574 },
1576 .name = "gbrp10le",
1577 .nb_components = 3,
1578 .log2_chroma_w = 0,
1579 .log2_chroma_h = 0,
1580 .comp = {
1581 { 2, 1, 1, 0, 9 }, /* R */
1582 { 0, 1, 1, 0, 9 }, /* G */
1583 { 1, 1, 1, 0, 9 }, /* B */
1584 },
1586 },
1588 .name = "gbrp10be",
1589 .nb_components = 3,
1590 .log2_chroma_w = 0,
1591 .log2_chroma_h = 0,
1592 .comp = {
1593 { 2, 1, 1, 0, 9 }, /* R */
1594 { 0, 1, 1, 0, 9 }, /* G */
1595 { 1, 1, 1, 0, 9 }, /* B */
1596 },
1598 },
1600 .name = "gbrp12le",
1601 .nb_components = 3,
1602 .log2_chroma_w = 0,
1603 .log2_chroma_h = 0,
1604 .comp = {
1605 { 2, 1, 1, 0, 11 }, /* R */
1606 { 0, 1, 1, 0, 11 }, /* G */
1607 { 1, 1, 1, 0, 11 }, /* B */
1608 },
1610 },
1612 .name = "gbrp12be",
1613 .nb_components = 3,
1614 .log2_chroma_w = 0,
1615 .log2_chroma_h = 0,
1616 .comp = {
1617 { 2, 1, 1, 0, 11 }, /* R */
1618 { 0, 1, 1, 0, 11 }, /* G */
1619 { 1, 1, 1, 0, 11 }, /* B */
1620 },
1622 },
1624 .name = "gbrp14le",
1625 .nb_components = 3,
1626 .log2_chroma_w = 0,
1627 .log2_chroma_h = 0,
1628 .comp = {
1629 { 2, 1, 1, 0, 13 }, /* R */
1630 { 0, 1, 1, 0, 13 }, /* G */
1631 { 1, 1, 1, 0, 13 }, /* B */
1632 },
1634 },
1636 .name = "gbrp14be",
1637 .nb_components = 3,
1638 .log2_chroma_w = 0,
1639 .log2_chroma_h = 0,
1640 .comp = {
1641 { 2, 1, 1, 0, 13 }, /* R */
1642 { 0, 1, 1, 0, 13 }, /* G */
1643 { 1, 1, 1, 0, 13 }, /* B */
1644 },
1646 },
1648 .name = "gbrp16le",
1649 .nb_components = 3,
1650 .log2_chroma_w = 0,
1651 .log2_chroma_h = 0,
1652 .comp = {
1653 { 2, 1, 1, 0, 15 }, /* R */
1654 { 0, 1, 1, 0, 15 }, /* G */
1655 { 1, 1, 1, 0, 15 }, /* B */
1656 },
1658 },
1660 .name = "gbrp16be",
1661 .nb_components = 3,
1662 .log2_chroma_w = 0,
1663 .log2_chroma_h = 0,
1664 .comp = {
1665 { 2, 1, 1, 0, 15 }, /* R */
1666 { 0, 1, 1, 0, 15 }, /* G */
1667 { 1, 1, 1, 0, 15 }, /* B */
1668 },
1670 },
1672 .name = "gbrap",
1673 .nb_components = 4,
1674 .log2_chroma_w = 0,
1675 .log2_chroma_h = 0,
1676 .comp = {
1677 { 2, 0, 1, 0, 7 }, /* R */
1678 { 0, 0, 1, 0, 7 }, /* G */
1679 { 1, 0, 1, 0, 7 }, /* B */
1680 { 3, 0, 1, 0, 7 }, /* A */
1681 },
1683 },
1685 .name = "gbrap16le",
1686 .nb_components = 4,
1687 .log2_chroma_w = 0,
1688 .log2_chroma_h = 0,
1689 .comp = {
1690 { 2, 1, 1, 0, 15 }, /* R */
1691 { 0, 1, 1, 0, 15 }, /* G */
1692 { 1, 1, 1, 0, 15 }, /* B */
1693 { 3, 1, 1, 0, 15 }, /* A */
1694 },
1696 },
1698 .name = "gbrap16be",
1699 .nb_components = 4,
1700 .log2_chroma_w = 0,
1701 .log2_chroma_h = 0,
1702 .comp = {
1703 { 2, 1, 1, 0, 15 }, /* R */
1704 { 0, 1, 1, 0, 15 }, /* G */
1705 { 1, 1, 1, 0, 15 }, /* B */
1706 { 3, 1, 1, 0, 15 }, /* A */
1707 },
1709 },
1711 .name = "vdpau",
1712 .log2_chroma_w = 1,
1713 .log2_chroma_h = 1,
1715 },
1717 .name = "xyz12le",
1718 .nb_components = 3,
1719 .log2_chroma_w = 0,
1720 .log2_chroma_h = 0,
1721 .comp = {
1722 { 0, 5, 1, 4, 11 }, /* X */
1723 { 0, 5, 3, 4, 11 }, /* Y */
1724 { 0, 5, 5, 4, 11 }, /* Z */
1725 },
1726 /*.flags = -- not used*/
1727 },
1729 .name = "xyz12be",
1730 .nb_components = 3,
1731 .log2_chroma_w = 0,
1732 .log2_chroma_h = 0,
1733 .comp = {
1734 { 0, 5, 1, 4, 11 }, /* X */
1735 { 0, 5, 3, 4, 11 }, /* Y */
1736 { 0, 5, 5, 4, 11 }, /* Z */
1737 },
1739 },
1740
1741 #define BAYER8_DESC_COMMON \
1742 .nb_components= 3, \
1743 .log2_chroma_w= 0, \
1744 .log2_chroma_h= 0, \
1745 .comp = { \
1746 {0,0,0,0,1}, \
1747 {0,0,0,0,3}, \
1748 {0,0,0,0,1}, \
1749 }, \
1750
1751 #define BAYER16_DESC_COMMON \
1752 .nb_components= 3, \
1753 .log2_chroma_w= 0, \
1754 .log2_chroma_h= 0, \
1755 .comp = { \
1756 {0,1,0,0, 3}, \
1757 {0,1,0,0, 7}, \
1758 {0,1,0,0, 3}, \
1759 }, \
1760
1762 .name = "bayer_bggr8",
1764 },
1766 .name = "bayer_bggr16le",
1768 },
1770 .name = "bayer_bggr16be",
1772 },
1774 .name = "bayer_rggb8",
1776 },
1778 .name = "bayer_rggb16le",
1780 },
1782 .name = "bayer_rggb16be",
1784 },
1786 .name = "bayer_gbrg8",
1788 },
1790 .name = "bayer_gbrg16le",
1792 },
1794 .name = "bayer_gbrg16be",
1796 },
1798 .name = "bayer_grbg8",
1800 },
1802 .name = "bayer_grbg16le",
1804 },
1806 .name = "bayer_grbg16be",
1808 },
1810 .name = "nv16",
1811 .nb_components = 3,
1812 .log2_chroma_w = 1,
1813 .log2_chroma_h = 0,
1814 .comp = {
1815 { 0, 0, 1, 0, 7 }, /* Y */
1816 { 1, 1, 1, 0, 7 }, /* U */
1817 { 1, 1, 2, 0, 7 }, /* V */
1818 },
1820 },
1822 .name = "nv20le",
1823 .nb_components = 3,
1824 .log2_chroma_w = 1,
1825 .log2_chroma_h = 0,
1826 .comp = {
1827 { 0, 1, 1, 0, 9 }, /* Y */
1828 { 1, 3, 1, 0, 9 }, /* U */
1829 { 1, 3, 3, 0, 9 }, /* V */
1830 },
1832 },
1834 .name = "nv20be",
1835 .nb_components = 3,
1836 .log2_chroma_w = 1,
1837 .log2_chroma_h = 0,
1838 .comp = {
1839 { 0, 1, 1, 0, 9 }, /* Y */
1840 { 1, 3, 1, 0, 9 }, /* U */
1841 { 1, 3, 3, 0, 9 }, /* V */
1842 },
1844 },
1845 };
1846
1849 {
1851
1853 if (av_pix_fmt_descriptors[pix_fmt].name &&
1854 !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name))
1856
1858 }
1859
1861 {
1864 }
1865
1866 #if HAVE_BIGENDIAN
1867 # define X_NE(be, le) be
1868 #else
1869 # define X_NE(be, le) le
1870 #endif
1871
1873 {
1875
1876 if (!strcmp(name, "rgb32"))
1877 name =
X_NE(
"argb",
"bgra");
1878 else if (!strcmp(name, "bgr32"))
1879 name =
X_NE(
"abgr",
"rgba");
1880
1883 char name2[32];
1884
1885 snprintf(name2,
sizeof(name2),
"%s%s", name,
X_NE(
"be",
"le"));
1887 }
1889 }
1890
1892 {
1895
1897 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1899 }
1900
1901 return bits >> log2_pixels;
1902 }
1903
1905 {
1908 int steps[4] = {0};
1909
1912 int s = c == 1 || c == 2 ? 0 : log2_pixels;
1914 }
1915 for (c = 0; c < 4; c++)
1916 bits += steps[c];
1917
1919 bits *= 8;
1920
1921 return bits >> log2_pixels;
1922 }
1923
1925 {
1926 /* print header */
1927 if (pix_fmt < 0) {
1928 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
1929 } else {
1931 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
1933 }
1934
1936 }
1937
1939 {
1941 return NULL;
1942 return &av_pix_fmt_descriptors[
pix_fmt];
1943 }
1944
1946 {
1947 if (!prev)
1948 return &av_pix_fmt_descriptors[0];
1949 while (prev - av_pix_fmt_descriptors <
FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
1950 prev++;
1952 return prev;
1953 }
1954 return NULL;
1955 }
1956
1958 {
1959 if (desc < av_pix_fmt_descriptors ||
1960 desc >= av_pix_fmt_descriptors +
FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
1962
1964 }
1966
1968 int *h_shift, int *v_shift)
1969 {
1971 if (!desc)
1975
1976 return 0;
1977 }
1978
1980 {
1982 int i, planes[4] = { 0 },
ret = 0;
1983
1984 if (!desc)
1986
1992 }
1993
1995 int i, j;
1996
1999 uint8_t fill[4][8+6+3] = {{0}};
2000 uint8_t *
data[4] = {fill[0], fill[1], fill[2], fill[3]};
2001 int linesize[4] = {0,0,0,0};
2002 uint16_t tmp[2];
2003
2005 continue;
2006 // av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
2013
2018 continue;
2019 }
2022 } else {
2024 }
2025 if (!strncmp(d->
name,
"bayer_", 6))
2026 continue;
2031 }
2032 }
2033 }
2034
2035
2037 {
2040 int i;
2041
2042 if (!desc || strlen(desc->
name) < 2)
2045 i = strlen(name) - 2;
2046 if (strcmp(name + i, "be") && strcmp(name + i, "le"))
2048
2049 name[i] ^= 'b' ^ 'l';
2050
2052 }