2 * This library is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU Lesser General Public License as published
4 * by the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This library is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 #include "cmodel_permutation.h"
29 // ********************************* YUV101010 -> *****************************
31 #define READ_YUV101010 \
33 uint32_t input_i = input[0] | \
38 y = ((input_i & 0xffc00000) >> 16) | 0x3f; \
39 u = ((input_i & 0x3ff000) >> 6) | 0x3f; \
40 v = ((input_i & 0xffc) << 4) | 0x3f;
47 static inline void transfer_YUV101010_to_RGB8(unsigned char *(*output
), unsigned char *input
)
53 y
= (y
<< 8) | (y
>> 8);
55 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
57 *(*output
)++ = (unsigned char)(((input
[0] & 0xc000) >> 8) +
58 ((input
[1] & 0xe000) >> 10) +
59 ((input
[2] & 0xe000) >> 13));
62 static inline void transfer_YUV101010_to_BGR565(unsigned char *(*output
), unsigned char *input
)
68 y
= (y
<< 8) | (y
>> 8);
70 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
72 *(uint16_t*)(*output
) = (b
& 0xf800) |
78 static inline void transfer_YUV101010_to_RGB565(unsigned char *(*output
), unsigned char *input
)
84 y
= (y
<< 8) | (y
>> 8);
86 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
88 *(uint16_t*)(*output
) = (r
& 0xf800) |
94 static inline void transfer_YUV101010_to_BGR888(unsigned char *(*output
), unsigned char *input
)
100 y
= (y
<< 8) | (y
>> 8);
102 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
104 *(*output
)++ = b
>> 8;
105 *(*output
)++ = g
>> 8;
106 *(*output
)++ = r
>> 8;
109 static inline void transfer_YUV101010_to_BGR8888(unsigned char *(*output
), unsigned char *input
)
115 y
= (y
<< 8) | (y
>> 8);
117 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
119 *(*output
)++ = b
>> 8;
120 *(*output
)++ = g
>> 8;
121 *(*output
)++ = r
>> 8;
125 static inline void transfer_YUV101010_to_YUV888(unsigned char *(*output
), unsigned char *input
)
129 *(*output
)++ = y
>> 8;
130 *(*output
)++ = u
>> 8;
131 *(*output
)++ = v
>> 8;
134 static inline void transfer_YUV101010_to_YUVA8888(unsigned char *(*output
), unsigned char *input
)
138 *(*output
)++ = y
>> 8;
139 *(*output
)++ = u
>> 8;
140 *(*output
)++ = v
>> 8;
144 static inline void transfer_YUV101010_to_YUV161616(uint16_t *(*output
), unsigned char *input
)
153 static inline void transfer_YUV101010_to_YUVA16161616(uint16_t *(*output
), unsigned char *input
)
160 *(*output
)++ = 0xffff;
163 static inline void transfer_YUV101010_to_RGB888(unsigned char *(*output
), unsigned char *input
)
169 y
= (y
<< 8) | (y
>> 8);
171 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
173 *(*output
)++ = r
>> 8;
174 *(*output
)++ = g
>> 8;
175 *(*output
)++ = b
>> 8;
178 static inline void transfer_YUV101010_to_RGBA8888(unsigned char *(*output
), unsigned char *input
)
184 y
= (y
<< 8) | (y
>> 8);
186 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
188 *(*output
)++ = r
>> 8;
189 *(*output
)++ = g
>> 8;
190 *(*output
)++ = b
>> 8;
194 static inline void transfer_YUV101010_to_RGB161616(uint16_t *(*output
), unsigned char *input
)
200 y
= (y
<< 8) | (y
>> 8);
202 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
209 static inline void transfer_YUV101010_to_RGBA16161616(uint16_t *(*output
), unsigned char *input
)
215 y
= (y
<< 8) | (y
>> 8);
217 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
222 *(*output
)++ = 0xffff;
228 static inline void transfer_YUV101010_to_RGB_FLOAT(float *(*output
),
229 unsigned char *input
)
236 y_f
= (float)y
/ 0xffff;
238 YUV16_TO_RGB_FLOAT(y_f
, u
, v
, r
, g
, b
);
245 static inline void transfer_YUV101010_to_RGBA_FLOAT(float *(*output
),
246 unsigned char *input
)
253 y_f
= (float)y
/ 0xffff;
255 YUV16_TO_RGB_FLOAT(y_f
, u
, v
, r
, g
, b
);
281 // ******************************** VYU888 -> *********************************
284 static inline void transfer_VYU888_to_RGB8(unsigned char *(*output
), unsigned char *input
)
289 y
= ((int)input
[1]) << 16;
292 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
294 *(*output
) = (unsigned char)((r
& 0xc0) +
300 static inline void transfer_VYU888_to_BGR565(unsigned char *(*output
), unsigned char *input
)
305 y
= ((int)input
[1]) << 16;
308 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
309 *(uint16_t*)(*output
) = ((b
& 0xf8) << 8)
315 static inline void transfer_VYU888_to_RGB565(unsigned char *(*output
), unsigned char *input
)
320 y
= ((int)input
[1]) << 16;
323 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
324 *(uint16_t*)(*output
) = ((r
& 0xf8) << 8)
330 static inline void transfer_VYU888_to_BGR888(unsigned char *(*output
), unsigned char *input
)
335 y
= ((int)input
[1]) << 16;
338 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
346 static inline void transfer_VYU888_to_BGR8888(unsigned char *(*output
), unsigned char *input
)
351 y
= ((int)input
[1]) << 16;
354 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
362 static inline void transfer_VYU888_to_RGB888(unsigned char *(*output
), unsigned char *input
)
367 y
= ((int)input
[1]) << 16;
370 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
378 static inline void transfer_VYU888_to_RGBA8888(unsigned char *(*output
), unsigned char *input
)
383 y
= ((int)input
[1]) << 16;
386 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
396 static inline void transfer_VYU888_to_RGB161616(uint16_t *(*output
), unsigned char *input
)
401 y
= (input
[1] << 16) | (input
[1] << 8) | input
[1];
402 u
= (input
[2] << 8) | input
[2];
403 v
= (input
[0] << 8) | input
[0];
404 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
412 static inline void transfer_VYU888_to_RGBA16161616(uint16_t *(*output
), unsigned char *input
)
417 y
= (input
[1] << 16) | (input
[1] << 8) | input
[1];
418 u
= (input
[2] << 8) | input
[2];
419 v
= (input
[0] << 8) | input
[0];
420 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
425 (*output
)[3] = 0xffff;
430 static inline void transfer_VYU888_to_RGB_FLOAT(float *(*output
), unsigned char *input
)
437 y
= (float)*input
++ / 0xff;
439 YUV_TO_FLOAT(y
, u
, v
, r
, g
, b
);
446 static inline void transfer_VYU888_to_RGBA_FLOAT(float *(*output
), unsigned char *input
)
453 y
= (float)*input
++ / 0xff;
455 YUV_TO_FLOAT(y
, u
, v
, r
, g
, b
);
464 static inline void transfer_VYU888_to_YUV888(unsigned char *(*output
), unsigned char *input
)
466 (*output
)[0] = input
[1];
467 (*output
)[1] = input
[2];
468 (*output
)[2] = input
[0];
472 static inline void transfer_VYU888_to_YUVA8888(unsigned char *(*output
), unsigned char *input
)
474 (*output
)[0] = input
[1];
475 (*output
)[1] = input
[2];
476 (*output
)[2] = input
[0];
482 static inline void transfer_VYU888_to_YUV161616(uint16_t *(*output
), unsigned char *input
)
484 (*output
)[0] = ((int)input
[1]) << 8;
485 (*output
)[1] = ((int)input
[2]) << 8;
486 (*output
)[2] = ((int)input
[0]) << 8;
490 static inline void transfer_VYU888_to_YUVA16161616(uint16_t *(*output
), unsigned char *input
)
492 (*output
)[0] = ((int)input
[1]) << 8;
493 (*output
)[1] = ((int)input
[2]) << 8;
494 (*output
)[2] = ((int)input
[0]) << 8;
510 // ******************************** UYVA8888 -> *********************************
513 static inline void transfer_UYVA8888_to_RGB8(unsigned char *(*output
), unsigned char *input
)
518 y
= ((int)input
[1]) << 16;
521 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
523 r
= r
* input
[3] / 0xff;
524 g
= g
* input
[3] / 0xff;
525 b
= b
* input
[3] / 0xff;
526 *(*output
) = (unsigned char)((r
& 0xc0) +
532 static inline void transfer_UYVA8888_to_BGR565(unsigned char *(*output
), unsigned char *input
)
537 y
= ((int)input
[1]) << 16;
540 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
541 r
= r
* input
[3] / 0xff;
542 g
= g
* input
[3] / 0xff;
543 b
= b
* input
[3] / 0xff;
544 *(uint16_t*)(*output
) = ((b
& 0xf8) << 8)
550 static inline void transfer_UYVA8888_to_RGB565(unsigned char *(*output
), unsigned char *input
)
555 y
= ((int)input
[1]) << 16;
558 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
559 r
= r
* input
[3] / 0xff;
560 g
= g
* input
[3] / 0xff;
561 b
= b
* input
[3] / 0xff;
562 *(uint16_t*)(*output
) = ((r
& 0xf8) << 8)
568 static inline void transfer_UYVA8888_to_BGR888(unsigned char *(*output
), unsigned char *input
)
573 y
= ((int)input
[1]) << 16;
576 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
577 r
= r
* input
[3] / 0xff;
578 g
= g
* input
[3] / 0xff;
579 b
= b
* input
[3] / 0xff;
587 static inline void transfer_UYVA8888_to_BGR8888(unsigned char *(*output
), unsigned char *input
)
592 y
= ((int)input
[1]) << 16;
595 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
596 r
= r
* input
[3] / 0xff;
597 g
= g
* input
[3] / 0xff;
598 b
= b
* input
[3] / 0xff;
607 static inline void transfer_UYVA8888_to_RGB888(unsigned char *(*output
), unsigned char *input
)
612 y
= ((int)input
[1]) << 16;
615 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
616 r
= r
* input
[3] / 0xff;
617 g
= g
* input
[3] / 0xff;
618 b
= b
* input
[3] / 0xff;
626 static inline void transfer_UYVA8888_to_RGBA8888(unsigned char *(*output
), unsigned char *input
)
631 y
= ((int)input
[1]) << 16;
634 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
639 (*output
)[3] = input
[3];
644 static inline void transfer_UYVA8888_to_RGB161616(uint16_t *(*output
), unsigned char *input
)
649 y
= ((int)input
[1]) << 16;
650 u
= (input
[0] << 8) | input
[0];
651 v
= (input
[2] << 8) | input
[2];
652 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
653 r
= r
* input
[3] / 0xff;
654 g
= g
* input
[3] / 0xff;
655 b
= b
* input
[3] / 0xff;
663 static inline void transfer_UYVA8888_to_RGBA16161616(uint16_t *(*output
), unsigned char *input
)
668 y
= ((int)input
[1]) << 16;
669 u
= (input
[0] << 8) | input
[0];
670 v
= (input
[2] << 8) | input
[2];
671 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
676 (*output
)[3] = input
[3] << 8;
680 static inline void transfer_UYVA8888_to_RGB_FLOAT(float *(*output
), unsigned char *input
)
687 y
= (float)*input
++ / 0xff;
689 a
= (float)*input
/ 0xff;
690 YUV_TO_FLOAT(y
, u
, v
, r
, g
, b
);
701 static inline void transfer_UYVA8888_to_RGBA_FLOAT(float *(*output
), unsigned char *input
)
708 y
= (float)*input
++ / 0xff;
710 a
= (float)*input
/ 0xff;
711 YUV_TO_FLOAT(y
, u
, v
, r
, g
, b
);
720 static inline void transfer_UYVA8888_to_YUV888(unsigned char *(*output
), unsigned char *input
)
726 (*output
)[0] = (a
* input
[1]) / 0xff;
727 (*output
)[1] = (a
* input
[0] + anti_a
* 0x80) / 0xff;
728 (*output
)[2] = (a
* input
[2] + anti_a
* 0x80) / 0xff;
732 static inline void transfer_UYVA8888_to_YUVA8888(unsigned char *(*output
), unsigned char *input
)
734 (*output
)[0] = input
[1];
735 (*output
)[1] = input
[0];
736 (*output
)[2] = input
[2];
737 (*output
)[3] = input
[3];
742 static inline void transfer_UYVA8888_to_YUV161616(uint16_t *(*output
), unsigned char *input
)
748 (*output
)[0] = a
* input
[1];
749 (*output
)[1] = a
* input
[0] + anti_a
* 0x80;
750 (*output
)[2] = a
* input
[2] + anti_a
* 0x80;
754 static inline void transfer_UYVA8888_to_YUVA16161616(uint16_t *(*output
), unsigned char *input
)
756 (*output
)[0] = input
[1] << 8;
757 (*output
)[1] = input
[0] << 8;
758 (*output
)[2] = input
[2] << 8;
759 (*output
)[3] = input
[3] << 8;
772 #define TRANSFER_FRAME_DEFAULT(output, \
781 switch(in_colormodel) \
784 switch(out_colormodel) \
787 TRANSFER_FRAME_HEAD \
788 transfer_YUV888_to_RGB8((output), (input)); \
789 TRANSFER_FRAME_TAIL \
792 TRANSFER_FRAME_HEAD \
793 transfer_YUV888_to_BGR565((output), (input)); \
794 TRANSFER_FRAME_TAIL \
797 TRANSFER_FRAME_HEAD \
798 transfer_YUV888_to_RGB565((output), (input)); \
799 TRANSFER_FRAME_TAIL \
802 TRANSFER_FRAME_HEAD \
803 transfer_YUV888_to_BGR888((output), (input)); \
804 TRANSFER_FRAME_TAIL \
807 TRANSFER_FRAME_HEAD \
808 transfer_YUV888_to_BGR8888((output), (input)); \
809 TRANSFER_FRAME_TAIL \
812 TRANSFER_FRAME_HEAD \
813 transfer_YUV888_to_RGB888((output), (input)); \
814 TRANSFER_FRAME_TAIL \
817 TRANSFER_FRAME_HEAD \
818 transfer_YUV888_to_RGBA8888((output), (input)); \
819 TRANSFER_FRAME_TAIL \
822 TRANSFER_FRAME_HEAD \
823 transfer_YUV888_to_ARGB8888((output), (input)); \
824 TRANSFER_FRAME_TAIL \
827 TRANSFER_FRAME_HEAD \
828 transfer_YUV888_to_RGB_FLOAT((float**)(output), (input)); \
829 TRANSFER_FRAME_TAIL \
831 case BC_RGBA_FLOAT: \
832 TRANSFER_FRAME_HEAD \
833 transfer_YUV888_to_RGBA_FLOAT((float**)(output), (input)); \
834 TRANSFER_FRAME_TAIL \
837 TRANSFER_FRAME_HEAD \
838 transfer_YUV888_to_YUV101010((output), (input)); \
839 TRANSFER_FRAME_TAIL \
842 TRANSFER_YUV420P_OUT_HEAD \
843 transfer_YUV888_to_YUV420P_YUV422P(output_y, \
848 TRANSFER_FRAME_TAIL \
851 TRANSFER_YUV422P_OUT_HEAD \
852 transfer_YUV888_to_YUV420P_YUV422P(output_y, \
857 TRANSFER_FRAME_TAIL \
860 TRANSFER_YUV444P_OUT_HEAD \
861 transfer_YUV888_to_YUV444P(output_y, \
866 TRANSFER_FRAME_TAIL \
869 TRANSFER_FRAME_HEAD \
870 transfer_YUV888_to_YUV422((output), \
873 TRANSFER_FRAME_TAIL \
876 TRANSFER_FRAME_HEAD \
877 transfer_YUV888_to_YUV888((output), (input)); \
878 TRANSFER_FRAME_TAIL \
881 TRANSFER_FRAME_HEAD \
882 transfer_YUV888_to_YUVA8888((output), (input)); \
883 TRANSFER_FRAME_TAIL \
886 TRANSFER_FRAME_HEAD \
887 transfer_YUV888_to_VYU888((output), (input)); \
888 TRANSFER_FRAME_TAIL \
891 TRANSFER_FRAME_HEAD \
892 transfer_YUV888_to_UYVA8888((output), (input)); \
893 TRANSFER_FRAME_TAIL \
899 switch(out_colormodel) \
902 TRANSFER_FRAME_HEAD \
903 transfer_YUVA8888_to_RGB8((output), (input)); \
904 TRANSFER_FRAME_TAIL \
907 TRANSFER_FRAME_HEAD \
908 transfer_YUVA8888_to_BGR565((output), (input)); \
909 TRANSFER_FRAME_TAIL \
912 TRANSFER_FRAME_HEAD \
913 transfer_YUVA8888_to_RGB565((output), (input)); \
914 TRANSFER_FRAME_TAIL \
917 TRANSFER_FRAME_HEAD \
918 transfer_YUVA8888_to_BGR888((output), (input)); \
919 TRANSFER_FRAME_TAIL \
922 TRANSFER_FRAME_HEAD \
923 transfer_YUVA8888_to_BGR8888((output), (input)); \
924 TRANSFER_FRAME_TAIL \
927 TRANSFER_FRAME_HEAD \
928 transfer_YUVA8888_to_RGB888((output), (input)); \
929 TRANSFER_FRAME_TAIL \
932 TRANSFER_FRAME_HEAD \
933 transfer_YUVA8888_to_RGBA8888((output), (input)); \
934 TRANSFER_FRAME_TAIL \
937 TRANSFER_FRAME_HEAD \
938 transfer_YUVA8888_to_ARGB8888((output), (input)); \
939 TRANSFER_FRAME_TAIL \
942 TRANSFER_FRAME_HEAD \
943 transfer_YUVA8888_to_RGB_FLOAT((float**)(output), (input)); \
944 TRANSFER_FRAME_TAIL \
946 case BC_RGBA_FLOAT: \
947 TRANSFER_FRAME_HEAD \
948 transfer_YUVA8888_to_RGBA_FLOAT((float**)(output), (input)); \
949 TRANSFER_FRAME_TAIL \
952 TRANSFER_FRAME_HEAD \
953 transfer_YUVA8888_to_VYU888((output), (input)); \
954 TRANSFER_FRAME_TAIL \
957 TRANSFER_FRAME_HEAD \
958 transfer_YUVA8888_to_YUVA8888((output), (input)); \
959 TRANSFER_FRAME_TAIL \
962 TRANSFER_FRAME_HEAD \
963 transfer_YUVA8888_to_UYVA8888((output), (input)); \
964 TRANSFER_FRAME_TAIL \
967 TRANSFER_FRAME_HEAD \
968 transfer_YUVA8888_to_YUV101010((output), (input)); \
969 TRANSFER_FRAME_TAIL \
972 TRANSFER_YUV420P_OUT_HEAD \
973 transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \
978 TRANSFER_FRAME_TAIL \
981 TRANSFER_YUV422P_OUT_HEAD \
982 transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \
987 TRANSFER_FRAME_TAIL \
990 TRANSFER_YUV444P_OUT_HEAD \
991 transfer_YUVA8888_to_YUV444P(output_y, \
996 TRANSFER_FRAME_TAIL \
999 TRANSFER_FRAME_HEAD \
1000 transfer_YUVA8888_to_YUV422((output), \
1003 TRANSFER_FRAME_TAIL \
1008 case BC_YUV161616: \
1009 switch(out_colormodel) \
1012 TRANSFER_FRAME_HEAD \
1013 transfer_YUV161616_to_RGB8((output), (uint16_t*)(input)); \
1014 TRANSFER_FRAME_TAIL \
1017 TRANSFER_FRAME_HEAD \
1018 transfer_YUV161616_to_BGR565((output), (uint16_t*)(input)); \
1019 TRANSFER_FRAME_TAIL \
1022 TRANSFER_FRAME_HEAD \
1023 transfer_YUV161616_to_RGB565((output), (uint16_t*)(input)); \
1024 TRANSFER_FRAME_TAIL \
1027 TRANSFER_FRAME_HEAD \
1028 transfer_YUV161616_to_BGR888((output), (uint16_t*)(input)); \
1029 TRANSFER_FRAME_TAIL \
1032 TRANSFER_FRAME_HEAD \
1033 transfer_YUV161616_to_BGR8888((output), (uint16_t*)(input)); \
1034 TRANSFER_FRAME_TAIL \
1037 TRANSFER_FRAME_HEAD \
1038 transfer_YUV161616_to_RGB888((output), (uint16_t*)(input)); \
1039 TRANSFER_FRAME_TAIL \
1042 TRANSFER_FRAME_HEAD \
1043 transfer_YUV161616_to_RGBA8888((output), (uint16_t*)(input)); \
1044 TRANSFER_FRAME_TAIL \
1047 TRANSFER_FRAME_HEAD \
1048 transfer_YUV161616_to_ARGB8888((output), (uint16_t*)(input)); \
1049 TRANSFER_FRAME_TAIL \
1051 case BC_RGB_FLOAT: \
1052 TRANSFER_FRAME_HEAD \
1053 transfer_YUV161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1054 TRANSFER_FRAME_TAIL \
1056 case BC_RGBA_FLOAT: \
1057 TRANSFER_FRAME_HEAD \
1058 transfer_YUV161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1059 TRANSFER_FRAME_TAIL \
1062 TRANSFER_YUV420P_OUT_HEAD \
1063 transfer_YUV161616_to_YUV420P_YUV422P(output_y, \
1066 (uint16_t*)(input), \
1068 TRANSFER_FRAME_TAIL \
1071 TRANSFER_YUV422P_OUT_HEAD \
1072 transfer_YUV161616_to_YUV420P_YUV422P(output_y, \
1075 (uint16_t*)(input), \
1077 TRANSFER_FRAME_TAIL \
1080 TRANSFER_YUV444P_OUT_HEAD \
1081 transfer_YUV161616_to_YUV444P(output_y, \
1084 (uint16_t*)(input), \
1086 TRANSFER_FRAME_TAIL \
1089 TRANSFER_FRAME_HEAD \
1090 transfer_YUV161616_to_YUV422((output), \
1091 (uint16_t*)(input), \
1093 TRANSFER_FRAME_TAIL \
1095 case BC_YUV101010: \
1096 TRANSFER_FRAME_HEAD \
1097 transfer_YUV161616_to_YUV101010((output), (uint16_t*)(input)); \
1098 TRANSFER_FRAME_TAIL \
1101 TRANSFER_FRAME_HEAD \
1102 transfer_YUV161616_to_YUVA8888((output), \
1103 (uint16_t*)(input)); \
1104 TRANSFER_FRAME_TAIL \
1107 TRANSFER_FRAME_HEAD \
1108 transfer_YUV161616_to_VYU888((output), (uint16_t*)(input)); \
1109 TRANSFER_FRAME_TAIL \
1112 TRANSFER_FRAME_HEAD \
1113 transfer_YUV161616_to_UYVA8888((output), (uint16_t*)(input)); \
1114 TRANSFER_FRAME_TAIL \
1116 case BC_YUV161616: \
1117 TRANSFER_FRAME_HEAD \
1118 transfer_YUV161616_to_YUV161616((uint16_t**)(output), \
1119 (uint16_t*)(input)); \
1120 TRANSFER_FRAME_TAIL \
1125 case BC_YUVA16161616: \
1126 switch(out_colormodel) \
1129 TRANSFER_FRAME_HEAD \
1130 transfer_YUVA16161616_to_RGB8((output), (uint16_t*)(input)); \
1131 TRANSFER_FRAME_TAIL \
1134 TRANSFER_FRAME_HEAD \
1135 transfer_YUVA16161616_to_BGR565((output), (uint16_t*)(input)); \
1136 TRANSFER_FRAME_TAIL \
1139 TRANSFER_FRAME_HEAD \
1140 transfer_YUVA16161616_to_RGB565((output), (uint16_t*)(input)); \
1141 TRANSFER_FRAME_TAIL \
1144 TRANSFER_FRAME_HEAD \
1145 transfer_YUVA16161616_to_BGR888((output), (uint16_t*)(input)); \
1146 TRANSFER_FRAME_TAIL \
1149 TRANSFER_FRAME_HEAD \
1150 transfer_YUVA16161616_to_BGR8888((output), (uint16_t*)(input)); \
1151 TRANSFER_FRAME_TAIL \
1154 TRANSFER_FRAME_HEAD \
1155 transfer_YUVA16161616_to_RGB888((output), (uint16_t*)(input)); \
1156 TRANSFER_FRAME_TAIL \
1159 TRANSFER_FRAME_HEAD \
1160 transfer_YUVA16161616_to_RGBA8888((output), (uint16_t*)(input)); \
1161 TRANSFER_FRAME_TAIL \
1164 TRANSFER_FRAME_HEAD \
1165 transfer_YUVA16161616_to_ARGB8888((output), (uint16_t*)(input)); \
1166 TRANSFER_FRAME_TAIL \
1168 case BC_RGB_FLOAT: \
1169 TRANSFER_FRAME_HEAD \
1170 transfer_YUVA16161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1171 TRANSFER_FRAME_TAIL \
1173 case BC_RGBA_FLOAT: \
1174 TRANSFER_FRAME_HEAD \
1175 transfer_YUVA16161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1176 TRANSFER_FRAME_TAIL \
1178 case BC_YUV101010: \
1179 TRANSFER_FRAME_HEAD \
1180 transfer_YUVA16161616_to_YUV101010((output), (uint16_t*)(input)); \
1181 TRANSFER_FRAME_TAIL \
1184 TRANSFER_FRAME_HEAD \
1185 transfer_YUVA16161616_to_VYU888((output), (uint16_t*)(input)); \
1186 TRANSFER_FRAME_TAIL \
1189 TRANSFER_FRAME_HEAD \
1190 transfer_YUVA16161616_to_UYVA8888((output), (uint16_t*)(input)); \
1191 TRANSFER_FRAME_TAIL \
1193 case BC_YUVA16161616: \
1194 TRANSFER_FRAME_HEAD \
1195 transfer_YUVA16161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1196 TRANSFER_FRAME_TAIL \
1199 TRANSFER_YUV420P_OUT_HEAD \
1200 transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \
1203 (uint16_t*)(input), \
1205 TRANSFER_FRAME_TAIL \
1208 TRANSFER_YUV422P_OUT_HEAD \
1209 transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \
1212 (uint16_t*)(input), \
1214 TRANSFER_FRAME_TAIL \
1217 TRANSFER_YUV444P_OUT_HEAD \
1218 transfer_YUVA16161616_to_YUV444P(output_y, \
1221 (uint16_t*)(input), \
1223 TRANSFER_FRAME_TAIL \
1226 TRANSFER_FRAME_HEAD \
1227 transfer_YUVA16161616_to_YUV422((output), \
1228 (uint16_t*)(input), \
1230 TRANSFER_FRAME_TAIL \
1235 case BC_YUV101010: \
1236 switch(out_colormodel) \
1239 TRANSFER_FRAME_HEAD \
1240 transfer_YUV101010_to_RGB8((output), (input)); \
1241 TRANSFER_FRAME_TAIL \
1244 TRANSFER_FRAME_HEAD \
1245 transfer_YUV101010_to_BGR565((output), (input)); \
1246 TRANSFER_FRAME_TAIL \
1249 TRANSFER_FRAME_HEAD \
1250 transfer_YUV101010_to_RGB565((output), (input)); \
1251 TRANSFER_FRAME_TAIL \
1254 TRANSFER_FRAME_HEAD \
1255 transfer_YUV101010_to_BGR888((output), (input)); \
1256 TRANSFER_FRAME_TAIL \
1259 TRANSFER_FRAME_HEAD \
1260 transfer_YUV101010_to_BGR8888((output), (input)); \
1261 TRANSFER_FRAME_TAIL \
1264 TRANSFER_FRAME_HEAD \
1265 transfer_YUV101010_to_RGB888((output), (input)); \
1266 TRANSFER_FRAME_TAIL \
1269 TRANSFER_FRAME_HEAD \
1270 transfer_YUV101010_to_RGBA8888((output), (input)); \
1271 TRANSFER_FRAME_TAIL \
1274 TRANSFER_FRAME_HEAD \
1275 transfer_YUV101010_to_YUV888((output), (input)); \
1276 TRANSFER_FRAME_TAIL \
1279 TRANSFER_FRAME_HEAD \
1280 transfer_YUV101010_to_YUVA8888((output), (input)); \
1281 TRANSFER_FRAME_TAIL \
1283 case BC_RGB161616: \
1284 TRANSFER_FRAME_HEAD \
1285 transfer_YUV101010_to_RGB161616((uint16_t**)(output), (input)); \
1286 TRANSFER_FRAME_TAIL \
1288 case BC_RGBA16161616: \
1289 TRANSFER_FRAME_HEAD \
1290 transfer_YUV101010_to_RGBA16161616((uint16_t**)(output), (input)); \
1291 TRANSFER_FRAME_TAIL \
1293 case BC_RGB_FLOAT: \
1294 TRANSFER_FRAME_HEAD \
1295 transfer_YUV101010_to_RGB_FLOAT((float**)(output), (input)); \
1296 TRANSFER_FRAME_TAIL \
1298 case BC_RGBA_FLOAT: \
1299 TRANSFER_FRAME_HEAD \
1300 transfer_YUV101010_to_RGBA_FLOAT((float**)(output), (input)); \
1301 TRANSFER_FRAME_TAIL \
1303 case BC_YUV161616: \
1304 TRANSFER_FRAME_HEAD \
1305 transfer_YUV101010_to_YUV161616((uint16_t**)(output), (input)); \
1306 TRANSFER_FRAME_TAIL \
1308 case BC_YUVA16161616: \
1309 TRANSFER_FRAME_HEAD \
1310 transfer_YUV101010_to_YUVA16161616((uint16_t**)(output), (input)); \
1311 TRANSFER_FRAME_TAIL \
1317 switch(out_colormodel) \
1320 TRANSFER_FRAME_HEAD \
1321 transfer_VYU888_to_RGB8((output), (input)); \
1322 TRANSFER_FRAME_TAIL \
1325 TRANSFER_FRAME_HEAD \
1326 transfer_VYU888_to_BGR565((output), (input)); \
1327 TRANSFER_FRAME_TAIL \
1330 TRANSFER_FRAME_HEAD \
1331 transfer_VYU888_to_RGB565((output), (input)); \
1332 TRANSFER_FRAME_TAIL \
1335 TRANSFER_FRAME_HEAD \
1336 transfer_VYU888_to_BGR888((output), (input)); \
1337 TRANSFER_FRAME_TAIL \
1340 TRANSFER_FRAME_HEAD \
1341 transfer_VYU888_to_BGR8888((output), (input)); \
1342 TRANSFER_FRAME_TAIL \
1345 TRANSFER_FRAME_HEAD \
1346 transfer_VYU888_to_RGB888((output), (input)); \
1347 TRANSFER_FRAME_TAIL \
1350 TRANSFER_FRAME_HEAD \
1351 transfer_VYU888_to_RGBA8888((output), (input)); \
1352 TRANSFER_FRAME_TAIL \
1355 TRANSFER_FRAME_HEAD \
1356 transfer_VYU888_to_YUV888((output), (input)); \
1357 TRANSFER_FRAME_TAIL \
1360 TRANSFER_FRAME_HEAD \
1361 transfer_VYU888_to_YUVA8888((output), (input)); \
1362 TRANSFER_FRAME_TAIL \
1364 case BC_RGB161616: \
1365 TRANSFER_FRAME_HEAD \
1366 transfer_VYU888_to_RGB161616((uint16_t**)(output), (input)); \
1367 TRANSFER_FRAME_TAIL \
1369 case BC_RGBA16161616: \
1370 TRANSFER_FRAME_HEAD \
1371 transfer_VYU888_to_RGBA16161616((uint16_t**)(output), (input)); \
1372 TRANSFER_FRAME_TAIL \
1374 case BC_RGB_FLOAT: \
1375 TRANSFER_FRAME_HEAD \
1376 transfer_VYU888_to_RGB_FLOAT((float**)(output), (input)); \
1377 TRANSFER_FRAME_TAIL \
1379 case BC_RGBA_FLOAT: \
1380 TRANSFER_FRAME_HEAD \
1381 transfer_VYU888_to_RGBA_FLOAT((float**)(output), (input)); \
1382 TRANSFER_FRAME_TAIL \
1384 case BC_YUV161616: \
1385 TRANSFER_FRAME_HEAD \
1386 transfer_VYU888_to_YUV161616((uint16_t**)(output), (input)); \
1387 TRANSFER_FRAME_TAIL \
1389 case BC_YUVA16161616: \
1390 TRANSFER_FRAME_HEAD \
1391 transfer_VYU888_to_YUVA16161616((uint16_t**)(output), (input)); \
1392 TRANSFER_FRAME_TAIL \
1398 switch(out_colormodel) \
1401 TRANSFER_FRAME_HEAD \
1402 transfer_UYVA8888_to_RGB8((output), (input)); \
1403 TRANSFER_FRAME_TAIL \
1406 TRANSFER_FRAME_HEAD \
1407 transfer_UYVA8888_to_BGR565((output), (input)); \
1408 TRANSFER_FRAME_TAIL \
1411 TRANSFER_FRAME_HEAD \
1412 transfer_UYVA8888_to_RGB565((output), (input)); \
1413 TRANSFER_FRAME_TAIL \
1416 TRANSFER_FRAME_HEAD \
1417 transfer_UYVA8888_to_BGR888((output), (input)); \
1418 TRANSFER_FRAME_TAIL \
1421 TRANSFER_FRAME_HEAD \
1422 transfer_UYVA8888_to_BGR8888((output), (input)); \
1423 TRANSFER_FRAME_TAIL \
1426 TRANSFER_FRAME_HEAD \
1427 transfer_UYVA8888_to_RGB888((output), (input)); \
1428 TRANSFER_FRAME_TAIL \
1431 TRANSFER_FRAME_HEAD \
1432 transfer_UYVA8888_to_RGBA8888((output), (input)); \
1433 TRANSFER_FRAME_TAIL \
1436 TRANSFER_FRAME_HEAD \
1437 transfer_UYVA8888_to_YUV888((output), (input)); \
1438 TRANSFER_FRAME_TAIL \
1441 TRANSFER_FRAME_HEAD \
1442 transfer_UYVA8888_to_YUVA8888((output), (input)); \
1443 TRANSFER_FRAME_TAIL \
1445 case BC_RGB161616: \
1446 TRANSFER_FRAME_HEAD \
1447 transfer_UYVA8888_to_RGB161616((uint16_t**)(output), (input)); \
1448 TRANSFER_FRAME_TAIL \
1450 case BC_RGBA16161616: \
1451 TRANSFER_FRAME_HEAD \
1452 transfer_UYVA8888_to_RGBA16161616((uint16_t**)(output), (input)); \
1453 TRANSFER_FRAME_TAIL \
1455 case BC_RGB_FLOAT: \
1456 TRANSFER_FRAME_HEAD \
1457 transfer_UYVA8888_to_RGB_FLOAT((float**)(output), (input)); \
1458 TRANSFER_FRAME_TAIL \
1460 case BC_RGBA_FLOAT: \
1461 TRANSFER_FRAME_HEAD \
1462 transfer_UYVA8888_to_RGBA_FLOAT((float**)(output), (input)); \
1463 TRANSFER_FRAME_TAIL \
1465 case BC_YUV161616: \
1466 TRANSFER_FRAME_HEAD \
1467 transfer_UYVA8888_to_YUV161616((uint16_t**)(output), (input)); \
1468 TRANSFER_FRAME_TAIL \
1470 case BC_YUVA16161616: \
1471 TRANSFER_FRAME_HEAD \
1472 transfer_UYVA8888_to_YUVA16161616((uint16_t**)(output), (input)); \
1473 TRANSFER_FRAME_TAIL \
1480 switch(out_colormodel) \
1484 TRANSFER_FRAME_HEAD \
1485 transfer_ARGB8888_to_ARGB8888((output), (input)); \
1486 TRANSFER_FRAME_TAIL \
1489 TRANSFER_FRAME_HEAD \
1490 transfer_ARGB8888_to_RGBA8888((output), (input)); \
1491 TRANSFER_FRAME_TAIL \
1494 TRANSFER_FRAME_HEAD \
1495 transfer_ARGB8888_to_RGB888((output), (input)); \
1496 TRANSFER_FRAME_TAIL \
1499 TRANSFER_FRAME_HEAD \
1500 transfer_ARGB8888_to_BGR8888((output), (input)); \
1501 TRANSFER_FRAME_TAIL \
1507 switch(out_colormodel) \
1510 TRANSFER_FRAME_HEAD \
1511 transfer_RGB888_to_RGB8((output), (input)); \
1512 TRANSFER_FRAME_TAIL \
1515 TRANSFER_FRAME_HEAD \
1516 transfer_RGB888_to_BGR565((output), (input)); \
1517 TRANSFER_FRAME_TAIL \
1520 TRANSFER_FRAME_HEAD \
1521 transfer_RGB888_to_RGB565((output), (input)); \
1522 TRANSFER_FRAME_TAIL \
1525 TRANSFER_FRAME_HEAD \
1526 transfer_RGB888_to_BGR888((output), (input)); \
1527 TRANSFER_FRAME_TAIL \
1530 TRANSFER_FRAME_HEAD \
1531 transfer_RGB888_to_RGB888((output), (input)); \
1532 TRANSFER_FRAME_TAIL \
1535 TRANSFER_FRAME_HEAD \
1536 transfer_RGB888_to_RGBA8888((output), (input)); \
1537 TRANSFER_FRAME_TAIL \
1540 TRANSFER_FRAME_HEAD \
1541 transfer_RGB888_to_ARGB8888((output), (input)); \
1542 TRANSFER_FRAME_TAIL \
1544 case BC_RGB161616: \
1545 TRANSFER_FRAME_HEAD \
1546 transfer_RGB888_to_RGB161616((uint16_t**)(output), (input)); \
1547 TRANSFER_FRAME_TAIL \
1549 case BC_RGBA16161616: \
1550 TRANSFER_FRAME_HEAD \
1551 transfer_RGB888_to_RGBA16161616((uint16_t**)(output), (input)); \
1552 TRANSFER_FRAME_TAIL \
1554 case BC_RGB_FLOAT: \
1555 TRANSFER_FRAME_HEAD \
1556 transfer_RGB888_to_RGB_FLOAT((float**)(output), (input)); \
1557 TRANSFER_FRAME_TAIL \
1559 case BC_RGBA_FLOAT: \
1560 TRANSFER_FRAME_HEAD \
1561 transfer_RGB888_to_RGBA_FLOAT((float**)(output), (input)); \
1562 TRANSFER_FRAME_TAIL \
1565 TRANSFER_FRAME_HEAD \
1566 transfer_RGB888_to_ABGR8888((output), (input)); \
1567 TRANSFER_FRAME_TAIL \
1570 TRANSFER_FRAME_HEAD \
1571 transfer_RGB888_to_BGR8888((output), (input)); \
1572 TRANSFER_FRAME_TAIL \
1575 TRANSFER_FRAME_HEAD \
1576 transfer_RGB888_to_YUV888((output), (input)); \
1577 TRANSFER_FRAME_TAIL \
1580 TRANSFER_FRAME_HEAD \
1581 transfer_RGB888_to_YUVA8888((output), (input)); \
1582 TRANSFER_FRAME_TAIL \
1584 case BC_YUV161616: \
1585 TRANSFER_FRAME_HEAD \
1586 transfer_RGB888_to_YUV161616((uint16_t**)(output), (input)); \
1587 TRANSFER_FRAME_TAIL \
1589 case BC_YUVA16161616: \
1590 TRANSFER_FRAME_HEAD \
1591 transfer_RGB888_to_YUVA16161616((uint16_t**)(output), (input)); \
1592 TRANSFER_FRAME_TAIL \
1594 case BC_YUV101010: \
1595 TRANSFER_FRAME_HEAD \
1596 transfer_RGB888_to_YUV101010((output), (input)); \
1597 TRANSFER_FRAME_TAIL \
1600 TRANSFER_YUV420P_OUT_HEAD \
1601 transfer_RGB888_to_YUV420P_YUV422P(output_y, \
1606 TRANSFER_FRAME_TAIL \
1609 TRANSFER_FRAME_HEAD \
1610 transfer_RGB888_to_YUV422((output), (input), j); \
1611 TRANSFER_FRAME_TAIL \
1614 TRANSFER_YUV422P_OUT_HEAD \
1615 transfer_RGB888_to_YUV420P_YUV422P(output_y, \
1620 TRANSFER_FRAME_TAIL \
1623 TRANSFER_YUV444P_OUT_HEAD \
1624 transfer_RGB888_to_YUV444P(output_y, \
1629 TRANSFER_FRAME_TAIL \
1635 switch(out_colormodel) \
1637 case BC_TRANSPARENCY: \
1638 TRANSFER_FRAME_HEAD \
1639 transfer_RGBA8888_to_TRANSPARENCY((output), (input), &bit_counter); \
1640 TRANSFER_FRAME_TAIL \
1644 TRANSFER_FRAME_HEAD \
1645 transfer_RGBA8888_to_RGB8bg((output), (input), bg_r, bg_g, bg_b); \
1646 TRANSFER_FRAME_TAIL \
1648 TRANSFER_FRAME_HEAD \
1649 transfer_RGBA8888_to_RGB8((output), (input)); \
1650 TRANSFER_FRAME_TAIL \
1654 TRANSFER_FRAME_HEAD \
1655 transfer_RGBA8888_to_BGR565bg((output), (input), bg_r, bg_g, bg_b); \
1656 TRANSFER_FRAME_TAIL \
1658 TRANSFER_FRAME_HEAD \
1659 transfer_RGBA8888_to_BGR565((output), (input)); \
1660 TRANSFER_FRAME_TAIL \
1664 TRANSFER_FRAME_HEAD \
1665 transfer_RGBA8888_to_RGB565bg((output), (input), bg_r, bg_g, bg_b); \
1666 TRANSFER_FRAME_TAIL \
1668 TRANSFER_FRAME_HEAD \
1669 transfer_RGBA8888_to_RGB565((output), (input)); \
1670 TRANSFER_FRAME_TAIL \
1674 TRANSFER_FRAME_HEAD \
1675 transfer_RGBA8888_to_BGR888bg((output), (input), bg_r, bg_g, bg_b); \
1676 TRANSFER_FRAME_TAIL \
1678 TRANSFER_FRAME_HEAD \
1679 transfer_RGBA8888_to_BGR888((output), (input)); \
1680 TRANSFER_FRAME_TAIL \
1684 TRANSFER_FRAME_HEAD \
1685 transfer_RGBA8888_to_RGB888bg((output), (input), bg_r, bg_g, bg_b); \
1686 TRANSFER_FRAME_TAIL \
1688 TRANSFER_FRAME_HEAD \
1689 transfer_RGBA8888_to_RGB888((output), (input)); \
1690 TRANSFER_FRAME_TAIL \
1693 TRANSFER_FRAME_HEAD \
1694 transfer_RGBA8888_to_RGBA8888((output), (input)); \
1695 TRANSFER_FRAME_TAIL \
1698 TRANSFER_FRAME_HEAD \
1699 transfer_RGBA8888_to_ARGB8888((output), (input)); \
1700 TRANSFER_FRAME_TAIL \
1702 case BC_RGB161616: \
1703 TRANSFER_FRAME_HEAD \
1704 transfer_RGBA8888_to_RGB161616((uint16_t**)(output), (input)); \
1705 TRANSFER_FRAME_TAIL \
1707 case BC_RGBA16161616: \
1708 TRANSFER_FRAME_HEAD \
1709 transfer_RGBA8888_to_RGBA16161616((uint16_t**)(output), (input)); \
1710 TRANSFER_FRAME_TAIL \
1712 case BC_RGB_FLOAT: \
1713 TRANSFER_FRAME_HEAD \
1714 transfer_RGBA8888_to_RGB_FLOAT((float**)(output), (input)); \
1715 TRANSFER_FRAME_TAIL \
1717 case BC_RGBA_FLOAT: \
1718 TRANSFER_FRAME_HEAD \
1719 transfer_RGBA8888_to_RGBA_FLOAT((float**)(output), (input)); \
1720 TRANSFER_FRAME_TAIL \
1724 TRANSFER_FRAME_HEAD \
1725 transfer_RGBA8888_to_BGR8888bg((output), (input), bg_r, bg_g, bg_b); \
1726 TRANSFER_FRAME_TAIL \
1728 TRANSFER_FRAME_HEAD \
1729 transfer_RGBA8888_to_BGR8888((output), (input)); \
1730 TRANSFER_FRAME_TAIL \
1733 TRANSFER_FRAME_HEAD \
1734 transfer_RGBA8888_to_YUV888((output), (input)); \
1735 TRANSFER_FRAME_TAIL \
1738 TRANSFER_FRAME_HEAD \
1739 transfer_RGBA8888_to_YUVA8888((output), (input)); \
1740 TRANSFER_FRAME_TAIL \
1742 case BC_YUV161616: \
1743 TRANSFER_FRAME_HEAD \
1744 transfer_RGBA8888_to_YUV161616((uint16_t**)(output), (input)); \
1745 TRANSFER_FRAME_TAIL \
1747 case BC_YUVA16161616: \
1748 TRANSFER_FRAME_HEAD \
1749 transfer_RGBA8888_to_YUVA16161616((uint16_t**)(output), (input)); \
1750 TRANSFER_FRAME_TAIL \
1752 case BC_YUV101010: \
1753 TRANSFER_FRAME_HEAD \
1754 transfer_RGBA8888_to_YUV101010((output), (input)); \
1755 TRANSFER_FRAME_TAIL \
1758 TRANSFER_YUV420P_OUT_HEAD \
1759 transfer_RGBA888_to_YUV420P_YUV422P(output_y, \
1764 TRANSFER_FRAME_TAIL \
1767 TRANSFER_FRAME_HEAD \
1768 transfer_RGBA888_to_YUV422((output), (input), j); \
1769 TRANSFER_FRAME_TAIL \
1772 TRANSFER_YUV422P_OUT_HEAD \
1773 transfer_RGBA888_to_YUV420P_YUV422P(output_y, \
1778 TRANSFER_FRAME_TAIL \
1781 TRANSFER_YUV444P_OUT_HEAD \
1782 transfer_RGBA888_to_YUV444P(output_y, \
1787 TRANSFER_FRAME_TAIL \
1792 case BC_RGB161616: \
1793 switch(out_colormodel) \
1796 TRANSFER_FRAME_HEAD \
1797 transfer_RGB161616_to_RGB8((output), (uint16_t*)(input)); \
1798 TRANSFER_FRAME_TAIL \
1801 TRANSFER_FRAME_HEAD \
1802 transfer_RGB161616_to_BGR565((output), (uint16_t*)(input)); \
1803 TRANSFER_FRAME_TAIL \
1806 TRANSFER_FRAME_HEAD \
1807 transfer_RGB161616_to_RGB565((output), (uint16_t*)(input)); \
1808 TRANSFER_FRAME_TAIL \
1811 TRANSFER_FRAME_HEAD \
1812 transfer_RGB161616_to_BGR888((output), (uint16_t*)(input)); \
1813 TRANSFER_FRAME_TAIL \
1816 TRANSFER_FRAME_HEAD \
1817 transfer_RGB161616_to_BGR8888((output), (uint16_t*)(input)); \
1818 TRANSFER_FRAME_TAIL \
1821 TRANSFER_FRAME_HEAD \
1822 transfer_RGB161616_to_RGB888((output), (uint16_t*)(input)); \
1823 TRANSFER_FRAME_TAIL \
1826 TRANSFER_FRAME_HEAD \
1827 transfer_RGB161616_to_RGBA8888((output), (uint16_t*)(input)); \
1828 TRANSFER_FRAME_TAIL \
1830 case BC_RGB_FLOAT: \
1831 TRANSFER_FRAME_HEAD \
1832 transfer_RGB161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1833 TRANSFER_FRAME_TAIL \
1835 case BC_RGBA_FLOAT: \
1836 TRANSFER_FRAME_HEAD \
1837 transfer_RGB161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1838 TRANSFER_FRAME_TAIL \
1841 TRANSFER_FRAME_HEAD \
1842 transfer_RGB161616_to_YUV888((output), (uint16_t*)(input)); \
1843 TRANSFER_FRAME_TAIL \
1846 TRANSFER_FRAME_HEAD \
1847 transfer_RGB161616_to_YUVA8888((output), (uint16_t*)(input)); \
1848 TRANSFER_FRAME_TAIL \
1850 case BC_YUV161616: \
1851 TRANSFER_FRAME_HEAD \
1852 transfer_RGB161616_to_YUV161616((uint16_t**)(output), (uint16_t*)(input)); \
1853 TRANSFER_FRAME_TAIL \
1855 case BC_YUVA16161616: \
1856 TRANSFER_FRAME_HEAD \
1857 transfer_RGB161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1858 TRANSFER_FRAME_TAIL \
1860 case BC_YUV101010: \
1861 TRANSFER_FRAME_HEAD \
1862 transfer_RGB161616_to_YUV101010((output), (uint16_t*)(input)); \
1863 TRANSFER_FRAME_TAIL \
1866 TRANSFER_YUV420P_OUT_HEAD \
1867 transfer_RGB161616_to_YUV420P_YUV422P(output_y, \
1870 (uint16_t*)(input), \
1872 TRANSFER_FRAME_TAIL \
1875 TRANSFER_YUV422P_OUT_HEAD \
1876 transfer_RGB161616_to_YUV420P_YUV422P(output_y, \
1879 (uint16_t*)(input), \
1881 TRANSFER_FRAME_TAIL \
1884 TRANSFER_YUV444P_OUT_HEAD \
1885 transfer_RGB161616_to_YUV444P(output_y, \
1888 (uint16_t*)(input), \
1890 TRANSFER_FRAME_TAIL \
1895 case BC_RGBA16161616: \
1896 switch(out_colormodel) \
1899 TRANSFER_FRAME_HEAD \
1900 transfer_RGBA16161616_to_RGB8((output), (uint16_t*)(input)); \
1901 TRANSFER_FRAME_TAIL \
1904 TRANSFER_FRAME_HEAD \
1905 transfer_RGBA16161616_to_BGR565((output), (uint16_t*)(input)); \
1906 TRANSFER_FRAME_TAIL \
1909 TRANSFER_FRAME_HEAD \
1910 transfer_RGBA16161616_to_RGB565((output), (uint16_t*)(input)); \
1911 TRANSFER_FRAME_TAIL \
1914 TRANSFER_FRAME_HEAD \
1915 transfer_RGBA16161616_to_BGR888((output), (uint16_t*)(input)); \
1916 TRANSFER_FRAME_TAIL \
1919 TRANSFER_FRAME_HEAD \
1920 transfer_RGBA16161616_to_BGR8888((output), (uint16_t*)(input)); \
1921 TRANSFER_FRAME_TAIL \
1924 TRANSFER_FRAME_HEAD \
1925 transfer_RGBA16161616_to_RGB888((output), (uint16_t*)(input)); \
1926 TRANSFER_FRAME_TAIL \
1929 TRANSFER_FRAME_HEAD \
1930 transfer_RGBA16161616_to_RGBA8888((output), (uint16_t*)(input)); \
1931 TRANSFER_FRAME_TAIL \
1933 case BC_RGB_FLOAT: \
1934 TRANSFER_FRAME_HEAD \
1935 transfer_RGBA16161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1936 TRANSFER_FRAME_TAIL \
1938 case BC_RGBA_FLOAT: \
1939 TRANSFER_FRAME_HEAD \
1940 transfer_RGBA16161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1941 TRANSFER_FRAME_TAIL \
1944 TRANSFER_FRAME_HEAD \
1945 transfer_RGBA16161616_to_YUV888((output), (uint16_t*)(input)); \
1946 TRANSFER_FRAME_TAIL \
1949 TRANSFER_FRAME_HEAD \
1950 transfer_RGBA16161616_to_YUVA8888((output), (uint16_t*)(input)); \
1951 TRANSFER_FRAME_TAIL \
1953 case BC_YUV161616: \
1954 TRANSFER_FRAME_HEAD \
1955 transfer_RGBA16161616_to_YUV161616(((uint16_t**)output), (uint16_t*)(input)); \
1956 TRANSFER_FRAME_TAIL \
1958 case BC_YUVA16161616: \
1959 TRANSFER_FRAME_HEAD \
1960 transfer_RGBA16161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1961 TRANSFER_FRAME_TAIL \
1963 case BC_YUV101010: \
1964 TRANSFER_FRAME_HEAD \
1965 transfer_RGBA16161616_to_YUV101010((output), (uint16_t*)(input)); \
1966 TRANSFER_FRAME_TAIL \
1969 TRANSFER_YUV420P_OUT_HEAD \
1970 transfer_RGBA16161616_to_YUV420P_YUV422P(output_y, \
1973 (uint16_t*)(input), \
1975 TRANSFER_FRAME_TAIL \
1978 TRANSFER_YUV422P_OUT_HEAD \
1979 transfer_RGBA16161616_to_YUV420P_YUV422P(output_y, \
1982 (uint16_t*)(input), \
1984 TRANSFER_FRAME_TAIL \
1987 TRANSFER_YUV444P_OUT_HEAD \
1988 transfer_RGBA16161616_to_YUV444P(output_y, \
1991 (uint16_t*)(input), \
1993 TRANSFER_FRAME_TAIL \
1999 switch(out_colormodel) \
2002 TRANSFER_FRAME_HEAD \
2003 transfer_BGR8888_to_RGB888((output), (input)); \
2004 TRANSFER_FRAME_TAIL \
2007 TRANSFER_FRAME_HEAD \
2008 transfer_BGR8888_to_BGR8888((output), (input)); \
2009 TRANSFER_FRAME_TAIL \
2015 switch(out_colormodel) \
2018 TRANSFER_FRAME_HEAD \
2019 transfer_BGR888_to_RGB888((output), (input)); \
2020 TRANSFER_FRAME_TAIL \
2027 int64_t get_difference(struct timeval
*start_time
)
2029 struct timeval new_time
;
2031 gettimeofday(&new_time
, 0);
2033 new_time
.tv_usec
-= start_time
->tv_usec
;
2034 new_time
.tv_sec
-= start_time
->tv_sec
;
2035 if(new_time
.tv_usec
< 0)
2037 new_time
.tv_usec
+= 1000000;
2041 return (int64_t)new_time
.tv_sec
* 1000000 +
2042 (int64_t)new_time
.tv_usec
;
2049 void cmodel_default(PERMUTATION_ARGS
)
2054 switch (in_colormodel
) {
2056 switch (out_colormodel
) {
2059 // struct timeval start_time;
2060 // gettimeofday(&start_time, 0);
2062 short int *utog_tab
= yuv_table
->utog_tab8
;
2063 short int *vtog_tab
= yuv_table
->vtog_tab8
;
2064 short int *vtor_tab
= yuv_table
->vtor_tab8
;
2065 short int *utob_tab
= yuv_table
->utob_tab8
;
2068 for(i
= 0; i
< out_h
; i
++)
2070 unsigned char *input_row
= input_rows
[row_table
[i
]];
2071 unsigned char *output_row
= output_rows
[i
+ out_y
] + out_x
* out_pixelsize
;
2072 unsigned char *input_data
= input_row
+ (column_table
[0] << 2);
2073 __builtin_prefetch (input_data
, 0, 0);
2076 for(j
= 0; j
< out_w
; j
++)
2078 unsigned char y
= input_data
[0];
2079 unsigned char u
= input_data
[1];
2080 unsigned char v
= input_data
[2];
2081 unsigned char a
= input_data
[3];
2083 /* the secret of the speedup ... delayed index calculation */
2084 /* we do not overflow at the end since column table holds + 1 element */
2085 input_data
= input_row
+ (column_table
[j
+ 1] << 2);
2087 short int r
= y
+ vtor_tab
[v
];
2088 short int g
= y
+ utog_tab
[u
] + vtog_tab
[v
];
2089 short int b
= y
+ utob_tab
[u
];
2091 r
= (r
< 0 ? 0 : (r
> 0xff ? 0xff : r
));
2092 g
= (g
< 0 ? 0 : (g
> 0xff ? 0xff : g
));
2093 b
= (b
< 0 ? 0 : (b
> 0xff ? 0xff : b
));
2099 output_row
[0] = ((b
) >> 8);
2100 output_row
[1] = ((g
) >> 8);
2101 output_row
[2] = ((r
) >> 8);
2107 // long long dif= get_difference(&start_time);
2108 // printf("diff_inside: %lli\n", dif);
2119 TRANSFER_FRAME_DEFAULT(&output_row
,
2120 input_row
+ column_table
[j
] * in_pixelsize
,
2129 TRANSFER_FRAME_DEFAULT(&output_row
,
2130 input_row
+ j
* in_pixelsize
,