37 int x,
int y,
int c,
int w,
38 int read_pal_component,
42 int plane =
comp.plane;
43 int depth =
comp.depth;
44 unsigned mask = (1ULL << depth) - 1;
48 uint16_t *dst16 = dst;
49 uint32_t *dst32 = dst;
53 const uint8_t *p =
data[plane] + y * linesize[plane] + (skip >> 3);
54 int shift = 8 - depth - (skip & 7);
58 if (read_pal_component)
63 if (dst_element_size == 4) *dst32++ =
val;
67 const uint8_t *p =
data[plane] + y * linesize[plane] +
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)
107 int plane =
comp.plane;
108 int depth =
comp.depth;
111 const uint32_t *src32 =
src;
112 const uint16_t *src16 =
src;
116 uint8_t *p =
data[plane] + y * linesize[plane] + (skip >> 3);
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, 4, 0, 6, 10, 3, 9, 1 },
215 { 0, 8, 2, 6, 10, 7, 9, 3 },
216 { 0, 8, 6, 6, 10, 7, 9, 7 },
225 { 0, 4, 0, 6, 10, 3, 9, 1 },
226 { 0, 8, 2, 6, 10, 7, 9, 3 },
227 { 0, 8, 6, 6, 10, 7, 9, 7 },
237 { 0, 3, 0, 0, 8, 2, 7, 1 },
238 { 0, 3, 1, 0, 8, 2, 7, 2 },
239 { 0, 3, 2, 0, 8, 2, 7, 3 },
249 { 0, 3, 2, 0, 8, 2, 7, 3 },
250 { 0, 3, 1, 0, 8, 2, 7, 2 },
251 { 0, 3, 0, 0, 8, 2, 7, 1 },
261 { 0, 1, 0, 0, 8, 0, 7, 1 },
262 { 1, 1, 0, 0, 8, 0, 7, 1 },
263 { 2, 1, 0, 0, 8, 0, 7, 1 },
273 { 0, 1, 0, 0, 8, 0, 7, 1 },
274 { 1, 1, 0, 0, 8, 0, 7, 1 },
275 { 2, 1, 0, 0, 8, 0, 7, 1 },
285 { 0, 1, 0, 0, 8, 0, 7, 1 },
286 { 1, 1, 0, 0, 8, 0, 7, 1 },
287 { 2, 1, 0, 0, 8, 0, 7, 1 },
297 { 0, 1, 0, 0, 8, 0, 7, 1 },
298 { 1, 1, 0, 0, 8, 0, 7, 1 },
299 { 2, 1, 0, 0, 8, 0, 7, 1 },
309 { 0, 1, 0, 0, 8, 0, 7, 1 },
310 { 1, 1, 0, 0, 8, 0, 7, 1 },
311 { 2, 1, 0, 0, 8, 0, 7, 1 },
321 { 0, 1, 0, 0, 8, 0, 7, 1 },
332 { 0, 1, 0, 0, 1, 0, 0, 1 },
342 { 0, 1, 0, 7, 1, 0, 0, 1 },
352 { 0, 1, 0, 0, 8, 0, 7, 1 },
362 { 0, 1, 0, 0, 8, 0, 7, 1 },
363 { 1, 1, 0, 0, 8, 0, 7, 1 },
364 { 2, 1, 0, 0, 8, 0, 7, 1 },
374 { 0, 1, 0, 0, 8, 0, 7, 1 },
375 { 1, 1, 0, 0, 8, 0, 7, 1 },
376 { 2, 1, 0, 0, 8, 0, 7, 1 },
386 { 0, 1, 0, 0, 8, 0, 7, 1 },
387 { 1, 1, 0, 0, 8, 0, 7, 1 },
388 { 2, 1, 0, 0, 8, 0, 7, 1 },
402 { 0, 2, 1, 0, 8, 1, 7, 2 },
403 { 0, 4, 0, 0, 8, 3, 7, 1 },
404 { 0, 4, 2, 0, 8, 3, 7, 3 },
413 { 0, 4, 1, 0, 8, 3, 7, 2 },
414 { 0, 6, 0, 0, 8, 5, 7, 1 },
415 { 0, 6, 3, 0, 8, 5, 7, 4 },
424 { 0, 1, 0, 0, 3, 0, 2, 1 },
425 { 0, 1, 0, 3, 3, 0, 2, 1 },
426 { 0, 1, 0, 6, 2, 0, 1, 1 },
436 { 0, 4, 3, 0, 1, 3, 0, 4 },
437 { 0, 4, 1, 0, 2, 3, 1, 2 },
438 { 0, 4, 0, 0, 1, 3, 0, 1 },
448 { 0, 1, 0, 0, 1, 0, 0, 1 },
449 { 0, 1, 0, 1, 2, 0, 1, 1 },
450 { 0, 1, 0, 3, 1, 0, 0, 1 },
460 { 0, 1, 0, 6, 2, 0, 1, 1 },
461 { 0, 1, 0, 3, 3, 0, 2, 1 },
462 { 0, 1, 0, 0, 3, 0, 2, 1 },
472 { 0, 4, 0, 0, 1, 3, 0, 1 },
473 { 0, 4, 1, 0, 2, 3, 1, 2 },
474 { 0, 4, 3, 0, 1, 3, 0, 4 },
484 { 0, 1, 0, 3, 1, 0, 0, 1 },
485 { 0, 1, 0, 1, 2, 0, 1, 1 },
486 { 0, 1, 0, 0, 1, 0, 0, 1 },
496 { 0, 1, 0, 0, 8, 0, 7, 1 },
497 { 1, 2, 0, 0, 8, 1, 7, 1 },
498 { 1, 2, 1, 0, 8, 1, 7, 2 },
508 { 0, 1, 0, 0, 8, 0, 7, 1 },
509 { 1, 2, 1, 0, 8, 1, 7, 2 },
510 { 1, 2, 0, 0, 8, 1, 7, 1 },
520 { 0, 4, 1, 0, 8, 3, 7, 2 },
521 { 0, 4, 2, 0, 8, 3, 7, 3 },
522 { 0, 4, 3, 0, 8, 3, 7, 4 },
523 { 0, 4, 0, 0, 8, 3, 7, 1 },
533 { 0, 4, 0, 0, 8, 3, 7, 1 },
534 { 0, 4, 1, 0, 8, 3, 7, 2 },
535 { 0, 4, 2, 0, 8, 3, 7, 3 },
536 { 0, 4, 3, 0, 8, 3, 7, 4 },
546 { 0, 4, 3, 0, 8, 3, 7, 4 },
547 { 0, 4, 2, 0, 8, 3, 7, 3 },
548 { 0, 4, 1, 0, 8, 3, 7, 2 },
549 { 0, 4, 0, 0, 8, 3, 7, 1 },
559 { 0, 4, 2, 0, 8, 3, 7, 3 },
560 { 0, 4, 1, 0, 8, 3, 7, 2 },
561 { 0, 4, 0, 0, 8, 3, 7, 1 },
562 { 0, 4, 3, 0, 8, 3, 7, 4 },
572 { 0, 4, 1, 0, 8, 3, 7, 2 },
573 { 0, 4, 2, 0, 8, 3, 7, 3 },
574 { 0, 4, 3, 0, 8, 3, 7, 4 },
584 { 0, 4, 0, 0, 8, 3, 7, 1 },
585 { 0, 4, 1, 0, 8, 3, 7, 2 },
586 { 0, 4, 2, 0, 8, 3, 7, 3 },
596 { 0, 4, 3, 0, 8, 3, 7, 4 },
597 { 0, 4, 2, 0, 8, 3, 7, 3 },
598 { 0, 4, 1, 0, 8, 3, 7, 2 },
608 { 0, 4, 2, 0, 8, 3, 7, 3 },
609 { 0, 4, 1, 0, 8, 3, 7, 2 },
610 { 0, 4, 0, 0, 8, 3, 7, 1 },
620 { 0, 2, 0, 0, 9, 1, 8, 1 },
631 { 0, 2, 0, 0, 9, 1, 8, 1 },
641 { 0, 2, 0, 0, 10, 1, 9, 1 },
652 { 0, 2, 0, 0, 10, 1, 9, 1 },
662 { 0, 2, 0, 0, 12, 1, 11, 1 },
673 { 0, 2, 0, 0, 12, 1, 11, 1 },
683 { 0, 2, 0, 0, 14, 1, 13, 1 },
694 { 0, 2, 0, 0, 14, 1, 13, 1 },
704 { 0, 2, 0, 0, 16, 1, 15, 1 },
715 { 0, 2, 0, 0, 16, 1, 15, 1 },
725 { 0, 1, 0, 0, 8, 0, 7, 1 },
726 { 1, 1, 0, 0, 8, 0, 7, 1 },
727 { 2, 1, 0, 0, 8, 0, 7, 1 },
737 { 0, 1, 0, 0, 8, 0, 7, 1 },
738 { 1, 1, 0, 0, 8, 0, 7, 1 },
739 { 2, 1, 0, 0, 8, 0, 7, 1 },
744 .name =
"yuv440p10le",
749 { 0, 2, 0, 0, 10, 1, 9, 1 },
750 { 1, 2, 0, 0, 10, 1, 9, 1 },
751 { 2, 2, 0, 0, 10, 1, 9, 1 },
756 .name =
"yuv440p10be",
761 { 0, 2, 0, 0, 10, 1, 9, 1 },
762 { 1, 2, 0, 0, 10, 1, 9, 1 },
763 { 2, 2, 0, 0, 10, 1, 9, 1 },
768 .name =
"yuv440p12le",
773 { 0, 2, 0, 0, 12, 1, 11, 1 },
774 { 1, 2, 0, 0, 12, 1, 11, 1 },
775 { 2, 2, 0, 0, 12, 1, 11, 1 },
780 .name =
"yuv440p12be",
785 { 0, 2, 0, 0, 12, 1, 11, 1 },
786 { 1, 2, 0, 0, 12, 1, 11, 1 },
787 { 2, 2, 0, 0, 12, 1, 11, 1 },
797 { 0, 1, 0, 0, 8, 0, 7, 1 },
798 { 1, 1, 0, 0, 8, 0, 7, 1 },
799 { 2, 1, 0, 0, 8, 0, 7, 1 },
800 { 3, 1, 0, 0, 8, 0, 7, 1 },
810 { 0, 1, 0, 0, 8, 0, 7, 1 },
811 { 1, 1, 0, 0, 8, 0, 7, 1 },
812 { 2, 1, 0, 0, 8, 0, 7, 1 },
813 { 3, 1, 0, 0, 8, 0, 7, 1 },
823 { 0, 1, 0, 0, 8, 0, 7, 1 },
824 { 1, 1, 0, 0, 8, 0, 7, 1 },
825 { 2, 1, 0, 0, 8, 0, 7, 1 },
826 { 3, 1, 0, 0, 8, 0, 7, 1 },
831 .name =
"yuva420p9be",
836 { 0, 2, 0, 0, 9, 1, 8, 1 },
837 { 1, 2, 0, 0, 9, 1, 8, 1 },
838 { 2, 2, 0, 0, 9, 1, 8, 1 },
839 { 3, 2, 0, 0, 9, 1, 8, 1 },
844 .name =
"yuva420p9le",
849 { 0, 2, 0, 0, 9, 1, 8, 1 },
850 { 1, 2, 0, 0, 9, 1, 8, 1 },
851 { 2, 2, 0, 0, 9, 1, 8, 1 },
852 { 3, 2, 0, 0, 9, 1, 8, 1 },
857 .name =
"yuva422p9be",
862 { 0, 2, 0, 0, 9, 1, 8, 1 },
863 { 1, 2, 0, 0, 9, 1, 8, 1 },
864 { 2, 2, 0, 0, 9, 1, 8, 1 },
865 { 3, 2, 0, 0, 9, 1, 8, 1 },
870 .name =
"yuva422p9le",
875 { 0, 2, 0, 0, 9, 1, 8, 1 },
876 { 1, 2, 0, 0, 9, 1, 8, 1 },
877 { 2, 2, 0, 0, 9, 1, 8, 1 },
878 { 3, 2, 0, 0, 9, 1, 8, 1 },
883 .name =
"yuva444p9be",
888 { 0, 2, 0, 0, 9, 1, 8, 1 },
889 { 1, 2, 0, 0, 9, 1, 8, 1 },
890 { 2, 2, 0, 0, 9, 1, 8, 1 },
891 { 3, 2, 0, 0, 9, 1, 8, 1 },
896 .name =
"yuva444p9le",
901 { 0, 2, 0, 0, 9, 1, 8, 1 },
902 { 1, 2, 0, 0, 9, 1, 8, 1 },
903 { 2, 2, 0, 0, 9, 1, 8, 1 },
904 { 3, 2, 0, 0, 9, 1, 8, 1 },
909 .name =
"yuva420p10be",
914 { 0, 2, 0, 0, 10, 1, 9, 1 },
915 { 1, 2, 0, 0, 10, 1, 9, 1 },
916 { 2, 2, 0, 0, 10, 1, 9, 1 },
917 { 3, 2, 0, 0, 10, 1, 9, 1 },
922 .name =
"yuva420p10le",
927 { 0, 2, 0, 0, 10, 1, 9, 1 },
928 { 1, 2, 0, 0, 10, 1, 9, 1 },
929 { 2, 2, 0, 0, 10, 1, 9, 1 },
930 { 3, 2, 0, 0, 10, 1, 9, 1 },
935 .name =
"yuva422p10be",
940 { 0, 2, 0, 0, 10, 1, 9, 1 },
941 { 1, 2, 0, 0, 10, 1, 9, 1 },
942 { 2, 2, 0, 0, 10, 1, 9, 1 },
943 { 3, 2, 0, 0, 10, 1, 9, 1 },
948 .name =
"yuva422p10le",
953 { 0, 2, 0, 0, 10, 1, 9, 1 },
954 { 1, 2, 0, 0, 10, 1, 9, 1 },
955 { 2, 2, 0, 0, 10, 1, 9, 1 },
956 { 3, 2, 0, 0, 10, 1, 9, 1 },
961 .name =
"yuva444p10be",
966 { 0, 2, 0, 0, 10, 1, 9, 1 },
967 { 1, 2, 0, 0, 10, 1, 9, 1 },
968 { 2, 2, 0, 0, 10, 1, 9, 1 },
969 { 3, 2, 0, 0, 10, 1, 9, 1 },
974 .name =
"yuva444p10le",
979 { 0, 2, 0, 0, 10, 1, 9, 1 },
980 { 1, 2, 0, 0, 10, 1, 9, 1 },
981 { 2, 2, 0, 0, 10, 1, 9, 1 },
982 { 3, 2, 0, 0, 10, 1, 9, 1 },
987 .name =
"yuva420p16be",
992 { 0, 2, 0, 0, 16, 1, 15, 1 },
993 { 1, 2, 0, 0, 16, 1, 15, 1 },
994 { 2, 2, 0, 0, 16, 1, 15, 1 },
995 { 3, 2, 0, 0, 16, 1, 15, 1 },
1000 .name =
"yuva420p16le",
1005 { 0, 2, 0, 0, 16, 1, 15, 1 },
1006 { 1, 2, 0, 0, 16, 1, 15, 1 },
1007 { 2, 2, 0, 0, 16, 1, 15, 1 },
1008 { 3, 2, 0, 0, 16, 1, 15, 1 },
1013 .name =
"yuva422p16be",
1018 { 0, 2, 0, 0, 16, 1, 15, 1 },
1019 { 1, 2, 0, 0, 16, 1, 15, 1 },
1020 { 2, 2, 0, 0, 16, 1, 15, 1 },
1021 { 3, 2, 0, 0, 16, 1, 15, 1 },
1026 .name =
"yuva422p16le",
1031 { 0, 2, 0, 0, 16, 1, 15, 1 },
1032 { 1, 2, 0, 0, 16, 1, 15, 1 },
1033 { 2, 2, 0, 0, 16, 1, 15, 1 },
1034 { 3, 2, 0, 0, 16, 1, 15, 1 },
1039 .name =
"yuva444p16be",
1044 { 0, 2, 0, 0, 16, 1, 15, 1 },
1045 { 1, 2, 0, 0, 16, 1, 15, 1 },
1046 { 2, 2, 0, 0, 16, 1, 15, 1 },
1047 { 3, 2, 0, 0, 16, 1, 15, 1 },
1052 .name =
"yuva444p16le",
1057 { 0, 2, 0, 0, 16, 1, 15, 1 },
1058 { 1, 2, 0, 0, 16, 1, 15, 1 },
1059 { 2, 2, 0, 0, 16, 1, 15, 1 },
1060 { 3, 2, 0, 0, 16, 1, 15, 1 },
1070 { 0, 6, 0, 0, 16, 5, 15, 1 },
1071 { 0, 6, 2, 0, 16, 5, 15, 3 },
1072 { 0, 6, 4, 0, 16, 5, 15, 5 },
1082 { 0, 6, 0, 0, 16, 5, 15, 1 },
1083 { 0, 6, 2, 0, 16, 5, 15, 3 },
1084 { 0, 6, 4, 0, 16, 5, 15, 5 },
1094 { 0, 8, 0, 0, 16, 7, 15, 1 },
1095 { 0, 8, 2, 0, 16, 7, 15, 3 },
1096 { 0, 8, 4, 0, 16, 7, 15, 5 },
1097 { 0, 8, 6, 0, 16, 7, 15, 7 },
1107 { 0, 8, 0, 0, 16, 7, 15, 1 },
1108 { 0, 8, 2, 0, 16, 7, 15, 3 },
1109 { 0, 8, 4, 0, 16, 7, 15, 5 },
1110 { 0, 8, 6, 0, 16, 7, 15, 7 },
1120 { 0, 2, -1, 3, 5, 1, 4, 0 },
1121 { 0, 2, 0, 5, 6, 1, 5, 1 },
1122 { 0, 2, 0, 0, 5, 1, 4, 1 },
1132 { 0, 2, 1, 3, 5, 1, 4, 2 },
1133 { 0, 2, 0, 5, 6, 1, 5, 1 },
1134 { 0, 2, 0, 0, 5, 1, 4, 1 },
1144 { 0, 2, -1, 2, 5, 1, 4, 0 },
1145 { 0, 2, 0, 5, 5, 1, 4, 1 },
1146 { 0, 2, 0, 0, 5, 1, 4, 1 },
1156 { 0, 2, 1, 2, 5, 1, 4, 2 },
1157 { 0, 2, 0, 5, 5, 1, 4, 1 },
1158 { 0, 2, 0, 0, 5, 1, 4, 1 },
1168 { 0, 2, -1, 0, 4, 1, 3, 0 },
1169 { 0, 2, 0, 4, 4, 1, 3, 1 },
1170 { 0, 2, 0, 0, 4, 1, 3, 1 },
1180 { 0, 2, 1, 0, 4, 1, 3, 2 },
1181 { 0, 2, 0, 4, 4, 1, 3, 1 },
1182 { 0, 2, 0, 0, 4, 1, 3, 1 },
1192 { 0, 6, 4, 0, 16, 5, 15, 5 },
1193 { 0, 6, 2, 0, 16, 5, 15, 3 },
1194 { 0, 6, 0, 0, 16, 5, 15, 1 },
1204 { 0, 6, 4, 0, 16, 5, 15, 5 },
1205 { 0, 6, 2, 0, 16, 5, 15, 3 },
1206 { 0, 6, 0, 0, 16, 5, 15, 1 },
1216 { 0, 8, 4, 0, 16, 7, 15, 5 },
1217 { 0, 8, 2, 0, 16, 7, 15, 3 },
1218 { 0, 8, 0, 0, 16, 7, 15, 1 },
1219 { 0, 8, 6, 0, 16, 7, 15, 7 },
1229 { 0, 8, 4, 0, 16, 7, 15, 5 },
1230 { 0, 8, 2, 0, 16, 7, 15, 3 },
1231 { 0, 8, 0, 0, 16, 7, 15, 1 },
1232 { 0, 8, 6, 0, 16, 7, 15, 7 },
1242 { 0, 2, 0, 0, 5, 1, 4, 1 },
1243 { 0, 2, 0, 5, 6, 1, 5, 1 },
1244 { 0, 2, -1, 3, 5, 1, 4, 0 },
1254 { 0, 2, 0, 0, 5, 1, 4, 1 },
1255 { 0, 2, 0, 5, 6, 1, 5, 1 },
1256 { 0, 2, 1, 3, 5, 1, 4, 2 },
1266 { 0, 2, 0, 0, 5, 1, 4, 1 },
1267 { 0, 2, 0, 5, 5, 1, 4, 1 },
1268 { 0, 2, -1, 2, 5, 1, 4, 0 },
1278 { 0, 2, 0, 0, 5, 1, 4, 1 },
1279 { 0, 2, 0, 5, 5, 1, 4, 1 },
1280 { 0, 2, 1, 2, 5, 1, 4, 2 },
1290 { 0, 2, 0, 0, 4, 1, 3, 1 },
1291 { 0, 2, 0, 4, 4, 1, 3, 1 },
1292 { 0, 2, -1, 0, 4, 1, 3, 0 },
1302 { 0, 2, 0, 0, 4, 1, 3, 1 },
1303 { 0, 2, 0, 4, 4, 1, 3, 1 },
1304 { 0, 2, 1, 0, 4, 1, 3, 2 },
1310 .name =
"vaapi_moco",
1316 .name =
"vaapi_idct",
1322 .name =
"vaapi_vld",
1336 .name =
"yuv420p9le",
1341 { 0, 2, 0, 0, 9, 1, 8, 1 },
1342 { 1, 2, 0, 0, 9, 1, 8, 1 },
1343 { 2, 2, 0, 0, 9, 1, 8, 1 },
1348 .name =
"yuv420p9be",
1353 { 0, 2, 0, 0, 9, 1, 8, 1 },
1354 { 1, 2, 0, 0, 9, 1, 8, 1 },
1355 { 2, 2, 0, 0, 9, 1, 8, 1 },
1360 .name =
"yuv420p10le",
1365 { 0, 2, 0, 0, 10, 1, 9, 1 },
1366 { 1, 2, 0, 0, 10, 1, 9, 1 },
1367 { 2, 2, 0, 0, 10, 1, 9, 1 },
1372 .name =
"yuv420p10be",
1377 { 0, 2, 0, 0, 10, 1, 9, 1 },
1378 { 1, 2, 0, 0, 10, 1, 9, 1 },
1379 { 2, 2, 0, 0, 10, 1, 9, 1 },
1384 .name =
"yuv420p12le",
1389 { 0, 2, 0, 0, 12, 1, 11, 1 },
1390 { 1, 2, 0, 0, 12, 1, 11, 1 },
1391 { 2, 2, 0, 0, 12, 1, 11, 1 },
1396 .name =
"yuv420p12be",
1401 { 0, 2, 0, 0, 12, 1, 11, 1 },
1402 { 1, 2, 0, 0, 12, 1, 11, 1 },
1403 { 2, 2, 0, 0, 12, 1, 11, 1 },
1408 .name =
"yuv420p14le",
1413 { 0, 2, 0, 0, 14, 1, 13, 1 },
1414 { 1, 2, 0, 0, 14, 1, 13, 1 },
1415 { 2, 2, 0, 0, 14, 1, 13, 1 },
1420 .name =
"yuv420p14be",
1425 { 0, 2, 0, 0, 14, 1, 13, 1 },
1426 { 1, 2, 0, 0, 14, 1, 13, 1 },
1427 { 2, 2, 0, 0, 14, 1, 13, 1 },
1432 .name =
"yuv420p16le",
1437 { 0, 2, 0, 0, 16, 1, 15, 1 },
1438 { 1, 2, 0, 0, 16, 1, 15, 1 },
1439 { 2, 2, 0, 0, 16, 1, 15, 1 },
1444 .name =
"yuv420p16be",
1449 { 0, 2, 0, 0, 16, 1, 15, 1 },
1450 { 1, 2, 0, 0, 16, 1, 15, 1 },
1451 { 2, 2, 0, 0, 16, 1, 15, 1 },
1456 .name =
"yuv422p9le",
1461 { 0, 2, 0, 0, 9, 1, 8, 1 },
1462 { 1, 2, 0, 0, 9, 1, 8, 1 },
1463 { 2, 2, 0, 0, 9, 1, 8, 1 },
1468 .name =
"yuv422p9be",
1473 { 0, 2, 0, 0, 9, 1, 8, 1 },
1474 { 1, 2, 0, 0, 9, 1, 8, 1 },
1475 { 2, 2, 0, 0, 9, 1, 8, 1 },
1480 .name =
"yuv422p10le",
1485 { 0, 2, 0, 0, 10, 1, 9, 1 },
1486 { 1, 2, 0, 0, 10, 1, 9, 1 },
1487 { 2, 2, 0, 0, 10, 1, 9, 1 },
1492 .name =
"yuv422p10be",
1497 { 0, 2, 0, 0, 10, 1, 9, 1 },
1498 { 1, 2, 0, 0, 10, 1, 9, 1 },
1499 { 2, 2, 0, 0, 10, 1, 9, 1 },
1504 .name =
"yuv422p12le",
1509 { 0, 2, 0, 0, 12, 1, 11, 1 },
1510 { 1, 2, 0, 0, 12, 1, 11, 1 },
1511 { 2, 2, 0, 0, 12, 1, 11, 1 },
1516 .name =
"yuv422p12be",
1521 { 0, 2, 0, 0, 12, 1, 11, 1 },
1522 { 1, 2, 0, 0, 12, 1, 11, 1 },
1523 { 2, 2, 0, 0, 12, 1, 11, 1 },
1528 .name =
"yuv422p14le",
1533 { 0, 2, 0, 0, 14, 1, 13, 1 },
1534 { 1, 2, 0, 0, 14, 1, 13, 1 },
1535 { 2, 2, 0, 0, 14, 1, 13, 1 },
1540 .name =
"yuv422p14be",
1545 { 0, 2, 0, 0, 14, 1, 13, 1 },
1546 { 1, 2, 0, 0, 14, 1, 13, 1 },
1547 { 2, 2, 0, 0, 14, 1, 13, 1 },
1552 .name =
"yuv422p16le",
1557 { 0, 2, 0, 0, 16, 1, 15, 1 },
1558 { 1, 2, 0, 0, 16, 1, 15, 1 },
1559 { 2, 2, 0, 0, 16, 1, 15, 1 },
1564 .name =
"yuv422p16be",
1569 { 0, 2, 0, 0, 16, 1, 15, 1 },
1570 { 1, 2, 0, 0, 16, 1, 15, 1 },
1571 { 2, 2, 0, 0, 16, 1, 15, 1 },
1576 .name =
"yuv444p16le",
1581 { 0, 2, 0, 0, 16, 1, 15, 1 },
1582 { 1, 2, 0, 0, 16, 1, 15, 1 },
1583 { 2, 2, 0, 0, 16, 1, 15, 1 },
1588 .name =
"yuv444p16be",
1593 { 0, 2, 0, 0, 16, 1, 15, 1 },
1594 { 1, 2, 0, 0, 16, 1, 15, 1 },
1595 { 2, 2, 0, 0, 16, 1, 15, 1 },
1600 .name =
"yuv444p10le",
1605 { 0, 2, 0, 0, 10, 1, 9, 1 },
1606 { 1, 2, 0, 0, 10, 1, 9, 1 },
1607 { 2, 2, 0, 0, 10, 1, 9, 1 },
1612 .name =
"yuv444p10be",
1617 { 0, 2, 0, 0, 10, 1, 9, 1 },
1618 { 1, 2, 0, 0, 10, 1, 9, 1 },
1619 { 2, 2, 0, 0, 10, 1, 9, 1 },
1624 .name =
"yuv444p9le",
1629 { 0, 2, 0, 0, 9, 1, 8, 1 },
1630 { 1, 2, 0, 0, 9, 1, 8, 1 },
1631 { 2, 2, 0, 0, 9, 1, 8, 1 },
1636 .name =
"yuv444p9be",
1641 { 0, 2, 0, 0, 9, 1, 8, 1 },
1642 { 1, 2, 0, 0, 9, 1, 8, 1 },
1643 { 2, 2, 0, 0, 9, 1, 8, 1 },
1648 .name =
"yuv444p12le",
1653 { 0, 2, 0, 0, 12, 1, 11, 1 },
1654 { 1, 2, 0, 0, 12, 1, 11, 1 },
1655 { 2, 2, 0, 0, 12, 1, 11, 1 },
1660 .name =
"yuv444p12be",
1665 { 0, 2, 0, 0, 12, 1, 11, 1 },
1666 { 1, 2, 0, 0, 12, 1, 11, 1 },
1667 { 2, 2, 0, 0, 12, 1, 11, 1 },
1672 .name =
"yuv444p14le",
1677 { 0, 2, 0, 0, 14, 1, 13, 1 },
1678 { 1, 2, 0, 0, 14, 1, 13, 1 },
1679 { 2, 2, 0, 0, 14, 1, 13, 1 },
1684 .name =
"yuv444p14be",
1689 { 0, 2, 0, 0, 14, 1, 13, 1 },
1690 { 1, 2, 0, 0, 14, 1, 13, 1 },
1691 { 2, 2, 0, 0, 14, 1, 13, 1 },
1696 .name =
"d3d11va_vld",
1702 .name =
"dxva2_vld",
1711 { 0, 2, 0, 0, 8, 1, 7, 1 },
1712 { 0, 2, 1, 0, 8, 1, 7, 2 },
1721 { 0, 4, 0, 0, 16, 3, 15, 1 },
1722 { 0, 4, 2, 0, 16, 3, 15, 3 },
1730 { 0, 4, 0, 0, 16, 3, 15, 1 },
1731 { 0, 4, 2, 0, 16, 3, 15, 3 },
1736 .name =
"videotoolbox_vld",
1745 { 2, 1, 0, 0, 8, 0, 7, 1 },
1746 { 0, 1, 0, 0, 8, 0, 7, 1 },
1747 { 1, 1, 0, 0, 8, 0, 7, 1 },
1757 { 2, 2, 0, 0, 9, 1, 8, 1 },
1758 { 0, 2, 0, 0, 9, 1, 8, 1 },
1759 { 1, 2, 0, 0, 9, 1, 8, 1 },
1769 { 2, 2, 0, 0, 9, 1, 8, 1 },
1770 { 0, 2, 0, 0, 9, 1, 8, 1 },
1771 { 1, 2, 0, 0, 9, 1, 8, 1 },
1781 { 2, 2, 0, 0, 10, 1, 9, 1 },
1782 { 0, 2, 0, 0, 10, 1, 9, 1 },
1783 { 1, 2, 0, 0, 10, 1, 9, 1 },
1793 { 2, 2, 0, 0, 10, 1, 9, 1 },
1794 { 0, 2, 0, 0, 10, 1, 9, 1 },
1795 { 1, 2, 0, 0, 10, 1, 9, 1 },
1805 { 2, 2, 0, 0, 12, 1, 11, 1 },
1806 { 0, 2, 0, 0, 12, 1, 11, 1 },
1807 { 1, 2, 0, 0, 12, 1, 11, 1 },
1817 { 2, 2, 0, 0, 12, 1, 11, 1 },
1818 { 0, 2, 0, 0, 12, 1, 11, 1 },
1819 { 1, 2, 0, 0, 12, 1, 11, 1 },
1829 { 2, 2, 0, 0, 14, 1, 13, 1 },
1830 { 0, 2, 0, 0, 14, 1, 13, 1 },
1831 { 1, 2, 0, 0, 14, 1, 13, 1 },
1841 { 2, 2, 0, 0, 14, 1, 13, 1 },
1842 { 0, 2, 0, 0, 14, 1, 13, 1 },
1843 { 1, 2, 0, 0, 14, 1, 13, 1 },
1853 { 2, 2, 0, 0, 16, 1, 15, 1 },
1854 { 0, 2, 0, 0, 16, 1, 15, 1 },
1855 { 1, 2, 0, 0, 16, 1, 15, 1 },
1865 { 2, 2, 0, 0, 16, 1, 15, 1 },
1866 { 0, 2, 0, 0, 16, 1, 15, 1 },
1867 { 1, 2, 0, 0, 16, 1, 15, 1 },
1877 { 2, 1, 0, 0, 8, 0, 7, 1 },
1878 { 0, 1, 0, 0, 8, 0, 7, 1 },
1879 { 1, 1, 0, 0, 8, 0, 7, 1 },
1880 { 3, 1, 0, 0, 8, 0, 7, 1 },
1886 .name =
"gbrap16le",
1891 { 2, 2, 0, 0, 16, 1, 15, 1 },
1892 { 0, 2, 0, 0, 16, 1, 15, 1 },
1893 { 1, 2, 0, 0, 16, 1, 15, 1 },
1894 { 3, 2, 0, 0, 16, 1, 15, 1 },
1900 .name =
"gbrap16be",
1905 { 2, 2, 0, 0, 16, 1, 15, 1 },
1906 { 0, 2, 0, 0, 16, 1, 15, 1 },
1907 { 1, 2, 0, 0, 16, 1, 15, 1 },
1908 { 3, 2, 0, 0, 16, 1, 15, 1 },
1925 { 0, 6, 0, 4, 12, 5, 11, 1 },
1926 { 0, 6, 2, 4, 12, 5, 11, 3 },
1927 { 0, 6, 4, 4, 12, 5, 11, 5 },
1937 { 0, 6, 0, 4, 12, 5, 11, 1 },
1938 { 0, 6, 2, 4, 12, 5, 11, 3 },
1939 { 0, 6, 4, 4, 12, 5, 11, 5 },
1944 #define BAYER8_DESC_COMMON \
1945 .nb_components= 3, \
1946 .log2_chroma_w= 0, \
1947 .log2_chroma_h= 0, \
1954 #define BAYER16_DESC_COMMON \
1955 .nb_components= 3, \
1956 .log2_chroma_w= 0, \
1957 .log2_chroma_h= 0, \
1965 .name =
"bayer_bggr8",
1970 .name =
"bayer_bggr16le",
1975 .name =
"bayer_bggr16be",
1980 .name =
"bayer_rggb8",
1985 .name =
"bayer_rggb16le",
1990 .name =
"bayer_rggb16be",
1995 .name =
"bayer_gbrg8",
2000 .name =
"bayer_gbrg16le",
2005 .name =
"bayer_gbrg16be",
2010 .name =
"bayer_grbg8",
2015 .name =
"bayer_grbg16le",
2020 .name =
"bayer_grbg16be",
2030 { 0, 1, 0, 0, 8, 0, 7, 1 },
2031 { 1, 2, 0, 0, 8, 1, 7, 1 },
2032 { 1, 2, 1, 0, 8, 1, 7, 2 },
2042 { 0, 2, 0, 0, 10, 1, 9, 1 },
2043 { 1, 4, 0, 0, 10, 3, 9, 1 },
2044 { 1, 4, 2, 0, 10, 3, 9, 3 },
2054 { 0, 2, 0, 0, 10, 1, 9, 1 },
2055 { 1, 4, 0, 0, 10, 3, 9, 1 },
2056 { 1, 4, 2, 0, 10, 3, 9, 3 },
2065 .name =
"mediacodec",
2082 { 0, 8, 2, 0, 16, 7, 15, 3 },
2083 { 0, 8, 4, 0, 16, 7, 15, 5 },
2084 { 0, 8, 6, 0, 16, 7, 15, 7 },
2085 { 0, 8, 0, 0, 16, 7, 15, 1 },
2095 { 0, 8, 2, 0, 16, 7, 15, 3 },
2096 { 0, 8, 4, 0, 16, 7, 15, 5 },
2097 { 0, 8, 6, 0, 16, 7, 15, 7 },
2098 { 0, 8, 0, 0, 16, 7, 15, 1 },
2108 { 0, 2, 0, 6, 10, 1, 9, 1 },
2109 { 1, 4, 0, 6, 10, 3, 9, 1 },
2110 { 1, 4, 2, 6, 10, 3, 9, 3 },
2120 { 0, 2, 0, 6, 10, 1, 9, 1 },
2121 { 1, 4, 0, 6, 10, 3, 9, 1 },
2122 { 1, 4, 2, 6, 10, 3, 9, 3 },
2132 { 0, 2, 0, 0, 16, 1, 15, 1 },
2133 { 1, 4, 0, 0, 16, 3, 15, 1 },
2134 { 1, 4, 2, 0, 16, 3, 15, 3 },
2144 { 0, 2, 0, 0, 16, 1, 15, 1 },
2145 { 1, 4, 0, 0, 16, 3, 15, 1 },
2146 { 1, 4, 2, 0, 16, 3, 15, 3 },
2151 .name =
"gbrap12le",
2156 { 2, 2, 0, 0, 12, 1, 11, 1 },
2157 { 0, 2, 0, 0, 12, 1, 11, 1 },
2158 { 1, 2, 0, 0, 12, 1, 11, 1 },
2159 { 3, 2, 0, 0, 12, 1, 11, 1 },
2165 .name =
"gbrap12be",
2170 { 2, 2, 0, 0, 12, 1, 11, 1 },
2171 { 0, 2, 0, 0, 12, 1, 11, 1 },
2172 { 1, 2, 0, 0, 12, 1, 11, 1 },
2173 { 3, 2, 0, 0, 12, 1, 11, 1 },
2179 .name =
"gbrap10le",
2184 { 2, 2, 0, 0, 10, 1, 9, 1 },
2185 { 0, 2, 0, 0, 10, 1, 9, 1 },
2186 { 1, 2, 0, 0, 10, 1, 9, 1 },
2187 { 3, 2, 0, 0, 10, 1, 9, 1 },
2193 .name =
"gbrap10be",
2198 { 2, 2, 0, 0, 10, 1, 9, 1 },
2199 { 0, 2, 0, 0, 10, 1, 9, 1 },
2200 { 1, 2, 0, 0, 10, 1, 9, 1 },
2201 { 3, 2, 0, 0, 10, 1, 9, 1 },
2211 .name =
"gbrpf32be",
2216 { 2, 4, 0, 0, 32, 3, 31, 1 },
2217 { 0, 4, 0, 0, 32, 3, 31, 1 },
2218 { 1, 4, 0, 0, 32, 3, 31, 1 },
2224 .name =
"gbrpf32le",
2229 { 2, 4, 0, 0, 32, 3, 31, 1 },
2230 { 0, 4, 0, 0, 32, 3, 31, 1 },
2231 { 1, 4, 0, 0, 32, 3, 31, 1 },
2236 .name =
"gbrapf32be",
2241 { 2, 4, 0, 0, 32, 3, 31, 1 },
2242 { 0, 4, 0, 0, 32, 3, 31, 1 },
2243 { 1, 4, 0, 0, 32, 3, 31, 1 },
2244 { 3, 4, 0, 0, 32, 3, 31, 1 },
2251 .name =
"gbrapf32le",
2256 { 2, 4, 0, 0, 32, 3, 31, 1 },
2257 { 0, 4, 0, 0, 32, 3, 31, 1 },
2258 { 1, 4, 0, 0, 32, 3, 31, 1 },
2259 { 3, 4, 0, 0, 32, 3, 31, 1 },
2265 .name =
"drm_prime",
2273 .name =
"grayf32be",
2278 { 0, 4, 0, 0, 32, 3, 31, 1 },
2284 .name =
"grayf32le",
2289 { 0, 4, 0, 0, 32, 3, 31, 1 },
2295 .name =
"yuva422p12be",
2300 { 0, 2, 0, 0, 12, 1, 11, 1 },
2301 { 1, 2, 0, 0, 12, 1, 11, 1 },
2302 { 2, 2, 0, 0, 12, 1, 11, 1 },
2303 { 3, 2, 0, 0, 12, 1, 11, 1 },
2308 .name =
"yuva422p12le",
2313 { 0, 2, 0, 0, 12, 1, 11, 1 },
2314 { 1, 2, 0, 0, 12, 1, 11, 1 },
2315 { 2, 2, 0, 0, 12, 1, 11, 1 },
2316 { 3, 2, 0, 0, 12, 1, 11, 1 },
2321 .name =
"yuva444p12be",
2326 { 0, 2, 0, 0, 12, 1, 11, 1 },
2327 { 1, 2, 0, 0, 12, 1, 11, 1 },
2328 { 2, 2, 0, 0, 12, 1, 11, 1 },
2329 { 3, 2, 0, 0, 12, 1, 11, 1 },
2334 .name =
"yuva444p12le",
2339 { 0, 2, 0, 0, 12, 1, 11, 1 },
2340 { 1, 2, 0, 0, 12, 1, 11, 1 },
2341 { 2, 2, 0, 0, 12, 1, 11, 1 },
2342 { 3, 2, 0, 0, 12, 1, 11, 1 },
2352 { 0, 1, 0, 0, 8, 0, 7, 1 },
2353 { 1, 2, 0, 0, 8, 1, 7, 1 },
2354 { 1, 2, 1, 0, 8, 1, 7, 2 },
2364 { 0, 1, 0, 0, 8, 0, 7, 1 },
2365 { 1, 2, 1, 0, 8, 1, 7, 2 },
2366 { 1, 2, 0, 0, 8, 1, 7, 1 },
2375 #if FF_API_PLUS1_MINUS1
2472 # define X_NE(be, le) be
2474 # define X_NE(be, le) le
2481 if (!strcmp(
name,
"rgb32"))
2483 else if (!strcmp(
name,
"bgr32"))
2507 int s =
c == 1 ||
c == 2 ? 0 : log2_pixels;
2511 return bits >> log2_pixels;
2522 int s =
c == 1 ||
c == 2 ? 0 : log2_pixels;
2525 for (
c = 0;
c < 4;
c++)
2531 return bits >> log2_pixels;
2539 snprintf (buf, buf_size,
"name" " nb_components" " nb_bits");
2542 snprintf(buf, buf_size,
"%-11s %7d %10d", pixdesc->
name,
2578 int *h_shift,
int *v_shift)
2583 *h_shift =
desc->log2_chroma_w;
2584 *v_shift =
desc->log2_chroma_h;
2597 for (
i = 0;
i <
desc->nb_components;
i++)
2609 uint8_t fill[4][8+6+3] = {{0}};
2610 uint8_t *
data[4] = {fill[0], fill[1], fill[2], fill[3]};
2611 int linesize[4] = {0,0,0,0};
2626 av_assert0(!
c->plane && !
c->step && !
c->offset && !
c->shift && !
c->depth);
2638 tmp[0] =
tmp[1] = (1<<
c->depth) - 1;
2651 if (!
desc || strlen(
desc->name) < 2)
2654 i = strlen(
name) - 2;
2655 if (strcmp(
name +
i,
"be") && strcmp(
name +
i,
"le"))
2658 name[
i] ^=
'b' ^
'l';
2663 #define FF_COLOR_NA -1
2664 #define FF_COLOR_RGB 0
2665 #define FF_COLOR_GRAY 1
2666 #define FF_COLOR_YUV 2
2667 #define FF_COLOR_YUV_JPEG 3
2668 #define FF_COLOR_XYZ 4
2670 #define pixdesc_has_alpha(pixdesc) \
2671 ((pixdesc)->flags & AV_PIX_FMT_FLAG_ALPHA)
2678 if(
desc->nb_components == 1 ||
desc->nb_components == 2)
2681 if(
desc->name && !strncmp(
desc->name,
"yuvj", 4))
2684 if(
desc->name && !strncmp(
desc->name,
"xyz", 3))
2690 if(
desc->nb_components == 0)
2701 if (!
desc || !
desc->nb_components) {
2706 *
min = INT_MAX, *
max = -INT_MAX;
2707 for (
i = 0;
i <
desc->nb_components;
i++) {
2716 unsigned *lossp,
unsigned consider)
2720 int src_color, dst_color;
2721 int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
2722 int ret, loss,
i, nb_components;
2723 int score = INT_MAX - 1;
2725 if (!src_desc || !dst_desc)
2730 if (dst_pix_fmt == src_pix_fmt)
2739 if (dst_pix_fmt == src_pix_fmt)
2754 for (
i = 0;
i < nb_components;
i++) {
2758 score -= 65536 >> depth_minus1;
2801 if (src_color != dst_color)
2839 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr)
2842 int loss1, loss2, loss_mask;
2848 dst_pix_fmt = dst_pix_fmt2;
2849 }
else if (!desc2) {
2850 dst_pix_fmt = dst_pix_fmt1;
2852 loss_mask= loss_ptr?~*loss_ptr:~0;
2859 if (score1 == score2) {
2866 dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;