37 int x,
int y,
int c,
int w,
38 int read_pal_component,
43 int depth =
comp.depth;
44 unsigned mask = (1ULL << depth) - 1;
48 uint16_t *dst16 = dst;
49 uint32_t *dst32 = dst;
54 int shift = 8 - depth - (skip & 7);
58 if (read_pal_component)
63 if (dst_element_size == 4) *dst32++ =
val;
69 int is_8bit =
shift + depth <= 8;
70 int is_16bit=
shift + depth <=16;
77 if (is_8bit)
val = *p;
81 if (read_pal_component)
84 if (dst_element_size == 4) *dst32++ =
val;
93 int x,
int y,
int c,
int w,
94 int read_pal_component)
104 int x,
int y,
int c,
int w,
int src_element_size)
108 int depth =
comp.depth;
111 const uint32_t *src32 =
src;
112 const uint16_t *src16 =
src;
117 int shift = 8 - depth - (skip & 7);
120 *p |= (src_element_size == 4 ? *src32++ : *src16++) <<
shift;
130 if (
shift + depth <= 8) {
133 *p |= ((src_element_size == 4 ? *src32++ : *src16++) <<
shift);
138 unsigned s = (src_element_size == 4 ? *src32++ : *src16++);
139 if (
shift + depth <= 16) {
165 int x,
int y,
int c,
int w)
170 #if FF_API_PLUS1_MINUS1
180 { 0, 1, 0, 0, 8, 0, 7, 1 },
181 { 1, 1, 0, 0, 8, 0, 7, 1 },
182 { 2, 1, 0, 0, 8, 0, 7, 1 },
192 { 0, 2, 0, 0, 8, 1, 7, 1 },
193 { 0, 4, 1, 0, 8, 3, 7, 2 },
194 { 0, 4, 3, 0, 8, 3, 7, 4 },
203 { 0, 2, 0, 0, 8, 1, 7, 1 },
204 { 0, 4, 3, 0, 8, 3, 7, 4 },
205 { 0, 4, 1, 0, 8, 3, 7, 2 },
214 { 0, 3, 0, 0, 8, 2, 7, 1 },
215 { 0, 3, 1, 0, 8, 2, 7, 2 },
216 { 0, 3, 2, 0, 8, 2, 7, 3 },
226 { 0, 3, 2, 0, 8, 2, 7, 3 },
227 { 0, 3, 1, 0, 8, 2, 7, 2 },
228 { 0, 3, 0, 0, 8, 2, 7, 1 },
238 { 0, 1, 0, 0, 8, 0, 7, 1 },
239 { 1, 1, 0, 0, 8, 0, 7, 1 },
240 { 2, 1, 0, 0, 8, 0, 7, 1 },
250 { 0, 1, 0, 0, 8, 0, 7, 1 },
251 { 1, 1, 0, 0, 8, 0, 7, 1 },
252 { 2, 1, 0, 0, 8, 0, 7, 1 },
262 { 0, 1, 0, 0, 8, 0, 7, 1 },
263 { 1, 1, 0, 0, 8, 0, 7, 1 },
264 { 2, 1, 0, 0, 8, 0, 7, 1 },
274 { 0, 1, 0, 0, 8, 0, 7, 1 },
275 { 1, 1, 0, 0, 8, 0, 7, 1 },
276 { 2, 1, 0, 0, 8, 0, 7, 1 },
286 { 0, 1, 0, 0, 8, 0, 7, 1 },
287 { 1, 1, 0, 0, 8, 0, 7, 1 },
288 { 2, 1, 0, 0, 8, 0, 7, 1 },
298 { 0, 1, 0, 0, 8, 0, 7, 1 },
309 { 0, 1, 0, 0, 1, 0, 0, 1 },
319 { 0, 1, 0, 7, 1, 0, 0, 1 },
329 { 0, 1, 0, 0, 8, 0, 7, 1 },
339 { 0, 1, 0, 0, 8, 0, 7, 1 },
340 { 1, 1, 0, 0, 8, 0, 7, 1 },
341 { 2, 1, 0, 0, 8, 0, 7, 1 },
351 { 0, 1, 0, 0, 8, 0, 7, 1 },
352 { 1, 1, 0, 0, 8, 0, 7, 1 },
353 { 2, 1, 0, 0, 8, 0, 7, 1 },
363 { 0, 1, 0, 0, 8, 0, 7, 1 },
364 { 1, 1, 0, 0, 8, 0, 7, 1 },
365 { 2, 1, 0, 0, 8, 0, 7, 1 },
379 { 0, 2, 1, 0, 8, 1, 7, 2 },
380 { 0, 4, 0, 0, 8, 3, 7, 1 },
381 { 0, 4, 2, 0, 8, 3, 7, 3 },
390 { 0, 4, 1, 0, 8, 3, 7, 2 },
391 { 0, 6, 0, 0, 8, 5, 7, 1 },
392 { 0, 6, 3, 0, 8, 5, 7, 4 },
401 { 0, 1, 0, 0, 3, 0, 2, 1 },
402 { 0, 1, 0, 3, 3, 0, 2, 1 },
403 { 0, 1, 0, 6, 2, 0, 1, 1 },
413 { 0, 4, 3, 0, 1, 3, 0, 4 },
414 { 0, 4, 1, 0, 2, 3, 1, 2 },
415 { 0, 4, 0, 0, 1, 3, 0, 1 },
425 { 0, 1, 0, 0, 1, 0, 0, 1 },
426 { 0, 1, 0, 1, 2, 0, 1, 1 },
427 { 0, 1, 0, 3, 1, 0, 0, 1 },
437 { 0, 1, 0, 6, 2, 0, 1, 1 },
438 { 0, 1, 0, 3, 3, 0, 2, 1 },
439 { 0, 1, 0, 0, 3, 0, 2, 1 },
449 { 0, 4, 0, 0, 1, 3, 0, 1 },
450 { 0, 4, 1, 0, 2, 3, 1, 2 },
451 { 0, 4, 3, 0, 1, 3, 0, 4 },
461 { 0, 1, 0, 3, 1, 0, 0, 1 },
462 { 0, 1, 0, 1, 2, 0, 1, 1 },
463 { 0, 1, 0, 0, 1, 0, 0, 1 },
473 { 0, 1, 0, 0, 8, 0, 7, 1 },
474 { 1, 2, 0, 0, 8, 1, 7, 1 },
475 { 1, 2, 1, 0, 8, 1, 7, 2 },
485 { 0, 1, 0, 0, 8, 0, 7, 1 },
486 { 1, 2, 1, 0, 8, 1, 7, 2 },
487 { 1, 2, 0, 0, 8, 1, 7, 1 },
497 { 0, 4, 1, 0, 8, 3, 7, 2 },
498 { 0, 4, 2, 0, 8, 3, 7, 3 },
499 { 0, 4, 3, 0, 8, 3, 7, 4 },
500 { 0, 4, 0, 0, 8, 3, 7, 1 },
510 { 0, 4, 0, 0, 8, 3, 7, 1 },
511 { 0, 4, 1, 0, 8, 3, 7, 2 },
512 { 0, 4, 2, 0, 8, 3, 7, 3 },
513 { 0, 4, 3, 0, 8, 3, 7, 4 },
523 { 0, 4, 3, 0, 8, 3, 7, 4 },
524 { 0, 4, 2, 0, 8, 3, 7, 3 },
525 { 0, 4, 1, 0, 8, 3, 7, 2 },
526 { 0, 4, 0, 0, 8, 3, 7, 1 },
536 { 0, 4, 2, 0, 8, 3, 7, 3 },
537 { 0, 4, 1, 0, 8, 3, 7, 2 },
538 { 0, 4, 0, 0, 8, 3, 7, 1 },
539 { 0, 4, 3, 0, 8, 3, 7, 4 },
549 { 0, 4, 1, 0, 8, 3, 7, 2 },
550 { 0, 4, 2, 0, 8, 3, 7, 3 },
551 { 0, 4, 3, 0, 8, 3, 7, 4 },
561 { 0, 4, 0, 0, 8, 3, 7, 1 },
562 { 0, 4, 1, 0, 8, 3, 7, 2 },
563 { 0, 4, 2, 0, 8, 3, 7, 3 },
573 { 0, 4, 3, 0, 8, 3, 7, 4 },
574 { 0, 4, 2, 0, 8, 3, 7, 3 },
575 { 0, 4, 1, 0, 8, 3, 7, 2 },
585 { 0, 4, 2, 0, 8, 3, 7, 3 },
586 { 0, 4, 1, 0, 8, 3, 7, 2 },
587 { 0, 4, 0, 0, 8, 3, 7, 1 },
597 { 0, 2, 0, 0, 9, 1, 8, 1 },
608 { 0, 2, 0, 0, 9, 1, 8, 1 },
618 { 0, 2, 0, 0, 10, 1, 9, 1 },
629 { 0, 2, 0, 0, 10, 1, 9, 1 },
639 { 0, 2, 0, 0, 12, 1, 11, 1 },
650 { 0, 2, 0, 0, 12, 1, 11, 1 },
660 { 0, 2, 0, 0, 14, 1, 13, 1 },
671 { 0, 2, 0, 0, 14, 1, 13, 1 },
681 { 0, 2, 0, 0, 16, 1, 15, 1 },
692 { 0, 2, 0, 0, 16, 1, 15, 1 },
702 { 0, 1, 0, 0, 8, 0, 7, 1 },
703 { 1, 1, 0, 0, 8, 0, 7, 1 },
704 { 2, 1, 0, 0, 8, 0, 7, 1 },
714 { 0, 1, 0, 0, 8, 0, 7, 1 },
715 { 1, 1, 0, 0, 8, 0, 7, 1 },
716 { 2, 1, 0, 0, 8, 0, 7, 1 },
721 .name =
"yuv440p10le",
726 { 0, 2, 0, 0, 10, 1, 9, 1 },
727 { 1, 2, 0, 0, 10, 1, 9, 1 },
728 { 2, 2, 0, 0, 10, 1, 9, 1 },
733 .name =
"yuv440p10be",
738 { 0, 2, 0, 0, 10, 1, 9, 1 },
739 { 1, 2, 0, 0, 10, 1, 9, 1 },
740 { 2, 2, 0, 0, 10, 1, 9, 1 },
745 .name =
"yuv440p12le",
750 { 0, 2, 0, 0, 12, 1, 11, 1 },
751 { 1, 2, 0, 0, 12, 1, 11, 1 },
752 { 2, 2, 0, 0, 12, 1, 11, 1 },
757 .name =
"yuv440p12be",
762 { 0, 2, 0, 0, 12, 1, 11, 1 },
763 { 1, 2, 0, 0, 12, 1, 11, 1 },
764 { 2, 2, 0, 0, 12, 1, 11, 1 },
774 { 0, 1, 0, 0, 8, 0, 7, 1 },
775 { 1, 1, 0, 0, 8, 0, 7, 1 },
776 { 2, 1, 0, 0, 8, 0, 7, 1 },
777 { 3, 1, 0, 0, 8, 0, 7, 1 },
787 { 0, 1, 0, 0, 8, 0, 7, 1 },
788 { 1, 1, 0, 0, 8, 0, 7, 1 },
789 { 2, 1, 0, 0, 8, 0, 7, 1 },
790 { 3, 1, 0, 0, 8, 0, 7, 1 },
800 { 0, 1, 0, 0, 8, 0, 7, 1 },
801 { 1, 1, 0, 0, 8, 0, 7, 1 },
802 { 2, 1, 0, 0, 8, 0, 7, 1 },
803 { 3, 1, 0, 0, 8, 0, 7, 1 },
808 .name =
"yuva420p9be",
813 { 0, 2, 0, 0, 9, 1, 8, 1 },
814 { 1, 2, 0, 0, 9, 1, 8, 1 },
815 { 2, 2, 0, 0, 9, 1, 8, 1 },
816 { 3, 2, 0, 0, 9, 1, 8, 1 },
821 .name =
"yuva420p9le",
826 { 0, 2, 0, 0, 9, 1, 8, 1 },
827 { 1, 2, 0, 0, 9, 1, 8, 1 },
828 { 2, 2, 0, 0, 9, 1, 8, 1 },
829 { 3, 2, 0, 0, 9, 1, 8, 1 },
834 .name =
"yuva422p9be",
839 { 0, 2, 0, 0, 9, 1, 8, 1 },
840 { 1, 2, 0, 0, 9, 1, 8, 1 },
841 { 2, 2, 0, 0, 9, 1, 8, 1 },
842 { 3, 2, 0, 0, 9, 1, 8, 1 },
847 .name =
"yuva422p9le",
852 { 0, 2, 0, 0, 9, 1, 8, 1 },
853 { 1, 2, 0, 0, 9, 1, 8, 1 },
854 { 2, 2, 0, 0, 9, 1, 8, 1 },
855 { 3, 2, 0, 0, 9, 1, 8, 1 },
860 .name =
"yuva444p9be",
865 { 0, 2, 0, 0, 9, 1, 8, 1 },
866 { 1, 2, 0, 0, 9, 1, 8, 1 },
867 { 2, 2, 0, 0, 9, 1, 8, 1 },
868 { 3, 2, 0, 0, 9, 1, 8, 1 },
873 .name =
"yuva444p9le",
878 { 0, 2, 0, 0, 9, 1, 8, 1 },
879 { 1, 2, 0, 0, 9, 1, 8, 1 },
880 { 2, 2, 0, 0, 9, 1, 8, 1 },
881 { 3, 2, 0, 0, 9, 1, 8, 1 },
886 .name =
"yuva420p10be",
891 { 0, 2, 0, 0, 10, 1, 9, 1 },
892 { 1, 2, 0, 0, 10, 1, 9, 1 },
893 { 2, 2, 0, 0, 10, 1, 9, 1 },
894 { 3, 2, 0, 0, 10, 1, 9, 1 },
899 .name =
"yuva420p10le",
904 { 0, 2, 0, 0, 10, 1, 9, 1 },
905 { 1, 2, 0, 0, 10, 1, 9, 1 },
906 { 2, 2, 0, 0, 10, 1, 9, 1 },
907 { 3, 2, 0, 0, 10, 1, 9, 1 },
912 .name =
"yuva422p10be",
917 { 0, 2, 0, 0, 10, 1, 9, 1 },
918 { 1, 2, 0, 0, 10, 1, 9, 1 },
919 { 2, 2, 0, 0, 10, 1, 9, 1 },
920 { 3, 2, 0, 0, 10, 1, 9, 1 },
925 .name =
"yuva422p10le",
930 { 0, 2, 0, 0, 10, 1, 9, 1 },
931 { 1, 2, 0, 0, 10, 1, 9, 1 },
932 { 2, 2, 0, 0, 10, 1, 9, 1 },
933 { 3, 2, 0, 0, 10, 1, 9, 1 },
938 .name =
"yuva444p10be",
943 { 0, 2, 0, 0, 10, 1, 9, 1 },
944 { 1, 2, 0, 0, 10, 1, 9, 1 },
945 { 2, 2, 0, 0, 10, 1, 9, 1 },
946 { 3, 2, 0, 0, 10, 1, 9, 1 },
951 .name =
"yuva444p10le",
956 { 0, 2, 0, 0, 10, 1, 9, 1 },
957 { 1, 2, 0, 0, 10, 1, 9, 1 },
958 { 2, 2, 0, 0, 10, 1, 9, 1 },
959 { 3, 2, 0, 0, 10, 1, 9, 1 },
964 .name =
"yuva420p16be",
969 { 0, 2, 0, 0, 16, 1, 15, 1 },
970 { 1, 2, 0, 0, 16, 1, 15, 1 },
971 { 2, 2, 0, 0, 16, 1, 15, 1 },
972 { 3, 2, 0, 0, 16, 1, 15, 1 },
977 .name =
"yuva420p16le",
982 { 0, 2, 0, 0, 16, 1, 15, 1 },
983 { 1, 2, 0, 0, 16, 1, 15, 1 },
984 { 2, 2, 0, 0, 16, 1, 15, 1 },
985 { 3, 2, 0, 0, 16, 1, 15, 1 },
990 .name =
"yuva422p16be",
995 { 0, 2, 0, 0, 16, 1, 15, 1 },
996 { 1, 2, 0, 0, 16, 1, 15, 1 },
997 { 2, 2, 0, 0, 16, 1, 15, 1 },
998 { 3, 2, 0, 0, 16, 1, 15, 1 },
1003 .name =
"yuva422p16le",
1008 { 0, 2, 0, 0, 16, 1, 15, 1 },
1009 { 1, 2, 0, 0, 16, 1, 15, 1 },
1010 { 2, 2, 0, 0, 16, 1, 15, 1 },
1011 { 3, 2, 0, 0, 16, 1, 15, 1 },
1016 .name =
"yuva444p16be",
1021 { 0, 2, 0, 0, 16, 1, 15, 1 },
1022 { 1, 2, 0, 0, 16, 1, 15, 1 },
1023 { 2, 2, 0, 0, 16, 1, 15, 1 },
1024 { 3, 2, 0, 0, 16, 1, 15, 1 },
1029 .name =
"yuva444p16le",
1034 { 0, 2, 0, 0, 16, 1, 15, 1 },
1035 { 1, 2, 0, 0, 16, 1, 15, 1 },
1036 { 2, 2, 0, 0, 16, 1, 15, 1 },
1037 { 3, 2, 0, 0, 16, 1, 15, 1 },
1047 { 0, 6, 0, 0, 16, 5, 15, 1 },
1048 { 0, 6, 2, 0, 16, 5, 15, 3 },
1049 { 0, 6, 4, 0, 16, 5, 15, 5 },
1059 { 0, 6, 0, 0, 16, 5, 15, 1 },
1060 { 0, 6, 2, 0, 16, 5, 15, 3 },
1061 { 0, 6, 4, 0, 16, 5, 15, 5 },
1071 { 0, 8, 0, 0, 16, 7, 15, 1 },
1072 { 0, 8, 2, 0, 16, 7, 15, 3 },
1073 { 0, 8, 4, 0, 16, 7, 15, 5 },
1074 { 0, 8, 6, 0, 16, 7, 15, 7 },
1084 { 0, 8, 0, 0, 16, 7, 15, 1 },
1085 { 0, 8, 2, 0, 16, 7, 15, 3 },
1086 { 0, 8, 4, 0, 16, 7, 15, 5 },
1087 { 0, 8, 6, 0, 16, 7, 15, 7 },
1097 { 0, 2, -1, 3, 5, 1, 4, 0 },
1098 { 0, 2, 0, 5, 6, 1, 5, 1 },
1099 { 0, 2, 0, 0, 5, 1, 4, 1 },
1109 { 0, 2, 1, 3, 5, 1, 4, 2 },
1110 { 0, 2, 0, 5, 6, 1, 5, 1 },
1111 { 0, 2, 0, 0, 5, 1, 4, 1 },
1121 { 0, 2, -1, 2, 5, 1, 4, 0 },
1122 { 0, 2, 0, 5, 5, 1, 4, 1 },
1123 { 0, 2, 0, 0, 5, 1, 4, 1 },
1133 { 0, 2, 1, 2, 5, 1, 4, 2 },
1134 { 0, 2, 0, 5, 5, 1, 4, 1 },
1135 { 0, 2, 0, 0, 5, 1, 4, 1 },
1145 { 0, 2, -1, 0, 4, 1, 3, 0 },
1146 { 0, 2, 0, 4, 4, 1, 3, 1 },
1147 { 0, 2, 0, 0, 4, 1, 3, 1 },
1157 { 0, 2, 1, 0, 4, 1, 3, 2 },
1158 { 0, 2, 0, 4, 4, 1, 3, 1 },
1159 { 0, 2, 0, 0, 4, 1, 3, 1 },
1169 { 0, 6, 4, 0, 16, 5, 15, 5 },
1170 { 0, 6, 2, 0, 16, 5, 15, 3 },
1171 { 0, 6, 0, 0, 16, 5, 15, 1 },
1181 { 0, 6, 4, 0, 16, 5, 15, 5 },
1182 { 0, 6, 2, 0, 16, 5, 15, 3 },
1183 { 0, 6, 0, 0, 16, 5, 15, 1 },
1193 { 0, 8, 4, 0, 16, 7, 15, 5 },
1194 { 0, 8, 2, 0, 16, 7, 15, 3 },
1195 { 0, 8, 0, 0, 16, 7, 15, 1 },
1196 { 0, 8, 6, 0, 16, 7, 15, 7 },
1206 { 0, 8, 4, 0, 16, 7, 15, 5 },
1207 { 0, 8, 2, 0, 16, 7, 15, 3 },
1208 { 0, 8, 0, 0, 16, 7, 15, 1 },
1209 { 0, 8, 6, 0, 16, 7, 15, 7 },
1219 { 0, 2, 0, 0, 5, 1, 4, 1 },
1220 { 0, 2, 0, 5, 6, 1, 5, 1 },
1221 { 0, 2, -1, 3, 5, 1, 4, 0 },
1231 { 0, 2, 0, 0, 5, 1, 4, 1 },
1232 { 0, 2, 0, 5, 6, 1, 5, 1 },
1233 { 0, 2, 1, 3, 5, 1, 4, 2 },
1243 { 0, 2, 0, 0, 5, 1, 4, 1 },
1244 { 0, 2, 0, 5, 5, 1, 4, 1 },
1245 { 0, 2, -1, 2, 5, 1, 4, 0 },
1255 { 0, 2, 0, 0, 5, 1, 4, 1 },
1256 { 0, 2, 0, 5, 5, 1, 4, 1 },
1257 { 0, 2, 1, 2, 5, 1, 4, 2 },
1267 { 0, 2, 0, 0, 4, 1, 3, 1 },
1268 { 0, 2, 0, 4, 4, 1, 3, 1 },
1269 { 0, 2, -1, 0, 4, 1, 3, 0 },
1279 { 0, 2, 0, 0, 4, 1, 3, 1 },
1280 { 0, 2, 0, 4, 4, 1, 3, 1 },
1281 { 0, 2, 1, 0, 4, 1, 3, 2 },
1287 .name =
"vaapi_moco",
1293 .name =
"vaapi_idct",
1299 .name =
"vaapi_vld",
1313 .name =
"yuv420p9le",
1318 { 0, 2, 0, 0, 9, 1, 8, 1 },
1319 { 1, 2, 0, 0, 9, 1, 8, 1 },
1320 { 2, 2, 0, 0, 9, 1, 8, 1 },
1325 .name =
"yuv420p9be",
1330 { 0, 2, 0, 0, 9, 1, 8, 1 },
1331 { 1, 2, 0, 0, 9, 1, 8, 1 },
1332 { 2, 2, 0, 0, 9, 1, 8, 1 },
1337 .name =
"yuv420p10le",
1342 { 0, 2, 0, 0, 10, 1, 9, 1 },
1343 { 1, 2, 0, 0, 10, 1, 9, 1 },
1344 { 2, 2, 0, 0, 10, 1, 9, 1 },
1349 .name =
"yuv420p10be",
1354 { 0, 2, 0, 0, 10, 1, 9, 1 },
1355 { 1, 2, 0, 0, 10, 1, 9, 1 },
1356 { 2, 2, 0, 0, 10, 1, 9, 1 },
1361 .name =
"yuv420p12le",
1366 { 0, 2, 0, 0, 12, 1, 11, 1 },
1367 { 1, 2, 0, 0, 12, 1, 11, 1 },
1368 { 2, 2, 0, 0, 12, 1, 11, 1 },
1373 .name =
"yuv420p12be",
1378 { 0, 2, 0, 0, 12, 1, 11, 1 },
1379 { 1, 2, 0, 0, 12, 1, 11, 1 },
1380 { 2, 2, 0, 0, 12, 1, 11, 1 },
1385 .name =
"yuv420p14le",
1390 { 0, 2, 0, 0, 14, 1, 13, 1 },
1391 { 1, 2, 0, 0, 14, 1, 13, 1 },
1392 { 2, 2, 0, 0, 14, 1, 13, 1 },
1397 .name =
"yuv420p14be",
1402 { 0, 2, 0, 0, 14, 1, 13, 1 },
1403 { 1, 2, 0, 0, 14, 1, 13, 1 },
1404 { 2, 2, 0, 0, 14, 1, 13, 1 },
1409 .name =
"yuv420p16le",
1414 { 0, 2, 0, 0, 16, 1, 15, 1 },
1415 { 1, 2, 0, 0, 16, 1, 15, 1 },
1416 { 2, 2, 0, 0, 16, 1, 15, 1 },
1421 .name =
"yuv420p16be",
1426 { 0, 2, 0, 0, 16, 1, 15, 1 },
1427 { 1, 2, 0, 0, 16, 1, 15, 1 },
1428 { 2, 2, 0, 0, 16, 1, 15, 1 },
1433 .name =
"yuv422p9le",
1438 { 0, 2, 0, 0, 9, 1, 8, 1 },
1439 { 1, 2, 0, 0, 9, 1, 8, 1 },
1440 { 2, 2, 0, 0, 9, 1, 8, 1 },
1445 .name =
"yuv422p9be",
1450 { 0, 2, 0, 0, 9, 1, 8, 1 },
1451 { 1, 2, 0, 0, 9, 1, 8, 1 },
1452 { 2, 2, 0, 0, 9, 1, 8, 1 },
1457 .name =
"yuv422p10le",
1462 { 0, 2, 0, 0, 10, 1, 9, 1 },
1463 { 1, 2, 0, 0, 10, 1, 9, 1 },
1464 { 2, 2, 0, 0, 10, 1, 9, 1 },
1469 .name =
"yuv422p10be",
1474 { 0, 2, 0, 0, 10, 1, 9, 1 },
1475 { 1, 2, 0, 0, 10, 1, 9, 1 },
1476 { 2, 2, 0, 0, 10, 1, 9, 1 },
1481 .name =
"yuv422p12le",
1486 { 0, 2, 0, 0, 12, 1, 11, 1 },
1487 { 1, 2, 0, 0, 12, 1, 11, 1 },
1488 { 2, 2, 0, 0, 12, 1, 11, 1 },
1493 .name =
"yuv422p12be",
1498 { 0, 2, 0, 0, 12, 1, 11, 1 },
1499 { 1, 2, 0, 0, 12, 1, 11, 1 },
1500 { 2, 2, 0, 0, 12, 1, 11, 1 },
1505 .name =
"yuv422p14le",
1510 { 0, 2, 0, 0, 14, 1, 13, 1 },
1511 { 1, 2, 0, 0, 14, 1, 13, 1 },
1512 { 2, 2, 0, 0, 14, 1, 13, 1 },
1517 .name =
"yuv422p14be",
1522 { 0, 2, 0, 0, 14, 1, 13, 1 },
1523 { 1, 2, 0, 0, 14, 1, 13, 1 },
1524 { 2, 2, 0, 0, 14, 1, 13, 1 },
1529 .name =
"yuv422p16le",
1534 { 0, 2, 0, 0, 16, 1, 15, 1 },
1535 { 1, 2, 0, 0, 16, 1, 15, 1 },
1536 { 2, 2, 0, 0, 16, 1, 15, 1 },
1541 .name =
"yuv422p16be",
1546 { 0, 2, 0, 0, 16, 1, 15, 1 },
1547 { 1, 2, 0, 0, 16, 1, 15, 1 },
1548 { 2, 2, 0, 0, 16, 1, 15, 1 },
1553 .name =
"yuv444p16le",
1558 { 0, 2, 0, 0, 16, 1, 15, 1 },
1559 { 1, 2, 0, 0, 16, 1, 15, 1 },
1560 { 2, 2, 0, 0, 16, 1, 15, 1 },
1565 .name =
"yuv444p16be",
1570 { 0, 2, 0, 0, 16, 1, 15, 1 },
1571 { 1, 2, 0, 0, 16, 1, 15, 1 },
1572 { 2, 2, 0, 0, 16, 1, 15, 1 },
1577 .name =
"yuv444p10le",
1582 { 0, 2, 0, 0, 10, 1, 9, 1 },
1583 { 1, 2, 0, 0, 10, 1, 9, 1 },
1584 { 2, 2, 0, 0, 10, 1, 9, 1 },
1589 .name =
"yuv444p10be",
1594 { 0, 2, 0, 0, 10, 1, 9, 1 },
1595 { 1, 2, 0, 0, 10, 1, 9, 1 },
1596 { 2, 2, 0, 0, 10, 1, 9, 1 },
1601 .name =
"yuv444p9le",
1606 { 0, 2, 0, 0, 9, 1, 8, 1 },
1607 { 1, 2, 0, 0, 9, 1, 8, 1 },
1608 { 2, 2, 0, 0, 9, 1, 8, 1 },
1613 .name =
"yuv444p9be",
1618 { 0, 2, 0, 0, 9, 1, 8, 1 },
1619 { 1, 2, 0, 0, 9, 1, 8, 1 },
1620 { 2, 2, 0, 0, 9, 1, 8, 1 },
1625 .name =
"yuv444p12le",
1630 { 0, 2, 0, 0, 12, 1, 11, 1 },
1631 { 1, 2, 0, 0, 12, 1, 11, 1 },
1632 { 2, 2, 0, 0, 12, 1, 11, 1 },
1637 .name =
"yuv444p12be",
1642 { 0, 2, 0, 0, 12, 1, 11, 1 },
1643 { 1, 2, 0, 0, 12, 1, 11, 1 },
1644 { 2, 2, 0, 0, 12, 1, 11, 1 },
1649 .name =
"yuv444p14le",
1654 { 0, 2, 0, 0, 14, 1, 13, 1 },
1655 { 1, 2, 0, 0, 14, 1, 13, 1 },
1656 { 2, 2, 0, 0, 14, 1, 13, 1 },
1661 .name =
"yuv444p14be",
1666 { 0, 2, 0, 0, 14, 1, 13, 1 },
1667 { 1, 2, 0, 0, 14, 1, 13, 1 },
1668 { 2, 2, 0, 0, 14, 1, 13, 1 },
1673 .name =
"d3d11va_vld",
1679 .name =
"dxva2_vld",
1688 { 0, 2, 0, 0, 8, 1, 7, 1 },
1689 { 0, 2, 1, 0, 8, 1, 7, 2 },
1698 { 0, 4, 0, 0, 16, 3, 15, 1 },
1699 { 0, 4, 2, 0, 16, 3, 15, 3 },
1707 { 0, 4, 0, 0, 16, 3, 15, 1 },
1708 { 0, 4, 2, 0, 16, 3, 15, 3 },
1713 .name =
"videotoolbox_vld",
1722 { 2, 1, 0, 0, 8, 0, 7, 1 },
1723 { 0, 1, 0, 0, 8, 0, 7, 1 },
1724 { 1, 1, 0, 0, 8, 0, 7, 1 },
1734 { 2, 2, 0, 0, 9, 1, 8, 1 },
1735 { 0, 2, 0, 0, 9, 1, 8, 1 },
1736 { 1, 2, 0, 0, 9, 1, 8, 1 },
1746 { 2, 2, 0, 0, 9, 1, 8, 1 },
1747 { 0, 2, 0, 0, 9, 1, 8, 1 },
1748 { 1, 2, 0, 0, 9, 1, 8, 1 },
1758 { 2, 2, 0, 0, 10, 1, 9, 1 },
1759 { 0, 2, 0, 0, 10, 1, 9, 1 },
1760 { 1, 2, 0, 0, 10, 1, 9, 1 },
1770 { 2, 2, 0, 0, 10, 1, 9, 1 },
1771 { 0, 2, 0, 0, 10, 1, 9, 1 },
1772 { 1, 2, 0, 0, 10, 1, 9, 1 },
1782 { 2, 2, 0, 0, 12, 1, 11, 1 },
1783 { 0, 2, 0, 0, 12, 1, 11, 1 },
1784 { 1, 2, 0, 0, 12, 1, 11, 1 },
1794 { 2, 2, 0, 0, 12, 1, 11, 1 },
1795 { 0, 2, 0, 0, 12, 1, 11, 1 },
1796 { 1, 2, 0, 0, 12, 1, 11, 1 },
1806 { 2, 2, 0, 0, 14, 1, 13, 1 },
1807 { 0, 2, 0, 0, 14, 1, 13, 1 },
1808 { 1, 2, 0, 0, 14, 1, 13, 1 },
1818 { 2, 2, 0, 0, 14, 1, 13, 1 },
1819 { 0, 2, 0, 0, 14, 1, 13, 1 },
1820 { 1, 2, 0, 0, 14, 1, 13, 1 },
1830 { 2, 2, 0, 0, 16, 1, 15, 1 },
1831 { 0, 2, 0, 0, 16, 1, 15, 1 },
1832 { 1, 2, 0, 0, 16, 1, 15, 1 },
1842 { 2, 2, 0, 0, 16, 1, 15, 1 },
1843 { 0, 2, 0, 0, 16, 1, 15, 1 },
1844 { 1, 2, 0, 0, 16, 1, 15, 1 },
1854 { 2, 1, 0, 0, 8, 0, 7, 1 },
1855 { 0, 1, 0, 0, 8, 0, 7, 1 },
1856 { 1, 1, 0, 0, 8, 0, 7, 1 },
1857 { 3, 1, 0, 0, 8, 0, 7, 1 },
1863 .name =
"gbrap16le",
1868 { 2, 2, 0, 0, 16, 1, 15, 1 },
1869 { 0, 2, 0, 0, 16, 1, 15, 1 },
1870 { 1, 2, 0, 0, 16, 1, 15, 1 },
1871 { 3, 2, 0, 0, 16, 1, 15, 1 },
1877 .name =
"gbrap16be",
1882 { 2, 2, 0, 0, 16, 1, 15, 1 },
1883 { 0, 2, 0, 0, 16, 1, 15, 1 },
1884 { 1, 2, 0, 0, 16, 1, 15, 1 },
1885 { 3, 2, 0, 0, 16, 1, 15, 1 },
1902 { 0, 6, 0, 4, 12, 5, 11, 1 },
1903 { 0, 6, 2, 4, 12, 5, 11, 3 },
1904 { 0, 6, 4, 4, 12, 5, 11, 5 },
1914 { 0, 6, 0, 4, 12, 5, 11, 1 },
1915 { 0, 6, 2, 4, 12, 5, 11, 3 },
1916 { 0, 6, 4, 4, 12, 5, 11, 5 },
1921 #define BAYER8_DESC_COMMON \
1922 .nb_components= 3, \
1923 .log2_chroma_w= 0, \
1924 .log2_chroma_h= 0, \
1931 #define BAYER16_DESC_COMMON \
1932 .nb_components= 3, \
1933 .log2_chroma_w= 0, \
1934 .log2_chroma_h= 0, \
1942 .name =
"bayer_bggr8",
1947 .name =
"bayer_bggr16le",
1952 .name =
"bayer_bggr16be",
1957 .name =
"bayer_rggb8",
1962 .name =
"bayer_rggb16le",
1967 .name =
"bayer_rggb16be",
1972 .name =
"bayer_gbrg8",
1977 .name =
"bayer_gbrg16le",
1982 .name =
"bayer_gbrg16be",
1987 .name =
"bayer_grbg8",
1992 .name =
"bayer_grbg16le",
1997 .name =
"bayer_grbg16be",
2007 { 0, 1, 0, 0, 8, 0, 7, 1 },
2008 { 1, 2, 0, 0, 8, 1, 7, 1 },
2009 { 1, 2, 1, 0, 8, 1, 7, 2 },
2019 { 0, 2, 0, 0, 10, 1, 9, 1 },
2020 { 1, 4, 0, 0, 10, 3, 9, 1 },
2021 { 1, 4, 2, 0, 10, 3, 9, 3 },
2031 { 0, 2, 0, 0, 10, 1, 9, 1 },
2032 { 1, 4, 0, 0, 10, 3, 9, 1 },
2033 { 1, 4, 2, 0, 10, 3, 9, 3 },
2042 .name =
"mediacodec",
2059 { 0, 8, 2, 0, 16, 7, 15, 3 },
2060 { 0, 8, 4, 0, 16, 7, 15, 5 },
2061 { 0, 8, 6, 0, 16, 7, 15, 7 },
2062 { 0, 8, 0, 0, 16, 7, 15, 1 },
2072 { 0, 8, 2, 0, 16, 7, 15, 3 },
2073 { 0, 8, 4, 0, 16, 7, 15, 5 },
2074 { 0, 8, 6, 0, 16, 7, 15, 7 },
2075 { 0, 8, 0, 0, 16, 7, 15, 1 },
2085 { 0, 2, 0, 6, 10, 1, 9, 1 },
2086 { 1, 4, 0, 6, 10, 3, 9, 1 },
2087 { 1, 4, 2, 6, 10, 3, 9, 3 },
2097 { 0, 2, 0, 6, 10, 1, 9, 1 },
2098 { 1, 4, 0, 6, 10, 3, 9, 1 },
2099 { 1, 4, 2, 6, 10, 3, 9, 3 },
2109 { 0, 2, 0, 0, 16, 1, 15, 1 },
2110 { 1, 4, 0, 0, 16, 3, 15, 1 },
2111 { 1, 4, 2, 0, 16, 3, 15, 3 },
2121 { 0, 2, 0, 0, 16, 1, 15, 1 },
2122 { 1, 4, 0, 0, 16, 3, 15, 1 },
2123 { 1, 4, 2, 0, 16, 3, 15, 3 },
2128 .name =
"gbrap12le",
2133 { 2, 2, 0, 0, 12, 1, 11, 1 },
2134 { 0, 2, 0, 0, 12, 1, 11, 1 },
2135 { 1, 2, 0, 0, 12, 1, 11, 1 },
2136 { 3, 2, 0, 0, 12, 1, 11, 1 },
2142 .name =
"gbrap12be",
2147 { 2, 2, 0, 0, 12, 1, 11, 1 },
2148 { 0, 2, 0, 0, 12, 1, 11, 1 },
2149 { 1, 2, 0, 0, 12, 1, 11, 1 },
2150 { 3, 2, 0, 0, 12, 1, 11, 1 },
2156 .name =
"gbrap10le",
2161 { 2, 2, 0, 0, 10, 1, 9, 1 },
2162 { 0, 2, 0, 0, 10, 1, 9, 1 },
2163 { 1, 2, 0, 0, 10, 1, 9, 1 },
2164 { 3, 2, 0, 0, 10, 1, 9, 1 },
2170 .name =
"gbrap10be",
2175 { 2, 2, 0, 0, 10, 1, 9, 1 },
2176 { 0, 2, 0, 0, 10, 1, 9, 1 },
2177 { 1, 2, 0, 0, 10, 1, 9, 1 },
2178 { 3, 2, 0, 0, 10, 1, 9, 1 },
2188 .name =
"gbrpf32be",
2193 { 2, 4, 0, 0, 32, 3, 31, 1 },
2194 { 0, 4, 0, 0, 32, 3, 31, 1 },
2195 { 1, 4, 0, 0, 32, 3, 31, 1 },
2201 .name =
"gbrpf32le",
2206 { 2, 4, 0, 0, 32, 3, 31, 1 },
2207 { 0, 4, 0, 0, 32, 3, 31, 1 },
2208 { 1, 4, 0, 0, 32, 3, 31, 1 },
2213 .name =
"gbrapf32be",
2218 { 2, 4, 0, 0, 32, 3, 31, 1 },
2219 { 0, 4, 0, 0, 32, 3, 31, 1 },
2220 { 1, 4, 0, 0, 32, 3, 31, 1 },
2221 { 3, 4, 0, 0, 32, 3, 31, 1 },
2228 .name =
"gbrapf32le",
2233 { 2, 4, 0, 0, 32, 3, 31, 1 },
2234 { 0, 4, 0, 0, 32, 3, 31, 1 },
2235 { 1, 4, 0, 0, 32, 3, 31, 1 },
2236 { 3, 4, 0, 0, 32, 3, 31, 1 },
2242 .name =
"drm_prime",
2250 .name =
"grayf32be",
2255 { 0, 4, 0, 0, 32, 3, 31, 1 },
2261 .name =
"grayf32le",
2266 { 0, 4, 0, 0, 32, 3, 31, 1 },
2272 .name =
"yuva422p12be",
2277 { 0, 2, 0, 0, 12, 1, 11, 1 },
2278 { 1, 2, 0, 0, 12, 1, 11, 1 },
2279 { 2, 2, 0, 0, 12, 1, 11, 1 },
2280 { 3, 2, 0, 0, 12, 1, 11, 1 },
2285 .name =
"yuva422p12le",
2290 { 0, 2, 0, 0, 12, 1, 11, 1 },
2291 { 1, 2, 0, 0, 12, 1, 11, 1 },
2292 { 2, 2, 0, 0, 12, 1, 11, 1 },
2293 { 3, 2, 0, 0, 12, 1, 11, 1 },
2298 .name =
"yuva444p12be",
2303 { 0, 2, 0, 0, 12, 1, 11, 1 },
2304 { 1, 2, 0, 0, 12, 1, 11, 1 },
2305 { 2, 2, 0, 0, 12, 1, 11, 1 },
2306 { 3, 2, 0, 0, 12, 1, 11, 1 },
2311 .name =
"yuva444p12le",
2316 { 0, 2, 0, 0, 12, 1, 11, 1 },
2317 { 1, 2, 0, 0, 12, 1, 11, 1 },
2318 { 2, 2, 0, 0, 12, 1, 11, 1 },
2319 { 3, 2, 0, 0, 12, 1, 11, 1 },
2329 { 0, 1, 0, 0, 8, 0, 7, 1 },
2330 { 1, 2, 0, 0, 8, 1, 7, 1 },
2331 { 1, 2, 1, 0, 8, 1, 7, 2 },
2341 { 0, 1, 0, 0, 8, 0, 7, 1 },
2342 { 1, 2, 1, 0, 8, 1, 7, 2 },
2343 { 1, 2, 0, 0, 8, 1, 7, 1 },
2348 #if FF_API_PLUS1_MINUS1
2445 # define X_NE(be, le) be
2447 # define X_NE(be, le) le
2454 if (!strcmp(
name,
"rgb32"))
2456 else if (!strcmp(
name,
"bgr32"))
2480 int s =
c == 1 ||
c == 2 ? 0 : log2_pixels;
2484 return bits >> log2_pixels;
2495 int s =
c == 1 ||
c == 2 ? 0 : log2_pixels;
2498 for (
c = 0;
c < 4;
c++)
2504 return bits >> log2_pixels;
2512 snprintf (
buf, buf_size,
"name" " nb_components" " nb_bits");
2551 int *h_shift,
int *v_shift)
2556 *h_shift =
desc->log2_chroma_w;
2557 *v_shift =
desc->log2_chroma_h;
2570 for (
i = 0;
i <
desc->nb_components;
i++)
2582 uint8_t fill[4][8+6+3] = {{0}};
2583 uint8_t *
data[4] = {fill[0], fill[1], fill[2], fill[3]};
2584 int linesize[4] = {0,0,0,0};
2599 av_assert0(!
c->plane && !
c->step && !
c->offset && !
c->shift && !
c->depth);
2611 tmp[0] =
tmp[1] = (1<<
c->depth) - 1;
2624 if (!
desc || strlen(
desc->name) < 2)
2627 i = strlen(
name) - 2;
2628 if (strcmp(
name +
i,
"be") && strcmp(
name +
i,
"le"))
2631 name[
i] ^=
'b' ^
'l';
2636 #define FF_COLOR_NA -1
2637 #define FF_COLOR_RGB 0
2638 #define FF_COLOR_GRAY 1
2639 #define FF_COLOR_YUV 2
2640 #define FF_COLOR_YUV_JPEG 3
2641 #define FF_COLOR_XYZ 4
2643 #define pixdesc_has_alpha(pixdesc) \
2644 ((pixdesc)->flags & AV_PIX_FMT_FLAG_ALPHA)
2651 if(
desc->nb_components == 1 ||
desc->nb_components == 2)
2654 if(
desc->name && !strncmp(
desc->name,
"yuvj", 4))
2657 if(
desc->name && !strncmp(
desc->name,
"xyz", 3))
2663 if(
desc->nb_components == 0)
2674 if (!
desc || !
desc->nb_components) {
2679 *
min = INT_MAX, *
max = -INT_MAX;
2680 for (
i = 0;
i <
desc->nb_components;
i++) {
2689 unsigned *lossp,
unsigned consider)
2693 int src_color, dst_color;
2694 int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2695 int ret, loss,
i, nb_components;
2696 int score = INT_MAX - 1;
2698 if (!src_desc || !dst_desc)
2703 if (dst_pix_fmt == src_pix_fmt)
2712 if (dst_pix_fmt == src_pix_fmt)
2727 for (
i = 0;
i < nb_components;
i++) {
2731 score -= 65536 >> depth_minus1;
2774 if (src_color != dst_color)
2812 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr)
2815 int loss1, loss2, loss_mask;
2821 dst_pix_fmt = dst_pix_fmt2;
2822 }
else if (!desc2) {
2823 dst_pix_fmt = dst_pix_fmt1;
2825 loss_mask= loss_ptr?~*loss_ptr:~0;
2832 if (score1 == score2) {
2839 dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;