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"
30 // ********************************* YUV101010 -> *****************************
32 #define READ_YUV101010 \
34 uint32_t input_i = input[0] | \
39 y = ((input_i & 0xffc00000) >> 16) | 0x3f; \
40 u = ((input_i & 0x3ff000) >> 6) | 0x3f; \
41 v = ((input_i & 0xffc) << 4) | 0x3f;
48 static inline void transfer_YUV101010_to_RGB8(unsigned char *(*output
), unsigned char *input
)
54 y
= (y
<< 8) | (y
>> 8);
56 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
58 *(*output
)++ = (unsigned char)(((input
[0] & 0xc000) >> 8) +
59 ((input
[1] & 0xe000) >> 10) +
60 ((input
[2] & 0xe000) >> 13));
63 static inline void transfer_YUV101010_to_BGR565(unsigned char *(*output
), unsigned char *input
)
69 y
= (y
<< 8) | (y
>> 8);
71 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
73 *(uint16_t*)(*output
) = (b
& 0xf800) |
79 static inline void transfer_YUV101010_to_RGB565(unsigned char *(*output
), unsigned char *input
)
85 y
= (y
<< 8) | (y
>> 8);
87 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
89 *(uint16_t*)(*output
) = (r
& 0xf800) |
95 static inline void transfer_YUV101010_to_BGR888(unsigned char *(*output
), unsigned char *input
)
101 y
= (y
<< 8) | (y
>> 8);
103 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
105 *(*output
)++ = b
>> 8;
106 *(*output
)++ = g
>> 8;
107 *(*output
)++ = r
>> 8;
110 static inline void transfer_YUV101010_to_BGR8888(unsigned char *(*output
), unsigned char *input
)
116 y
= (y
<< 8) | (y
>> 8);
118 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
120 *(*output
)++ = b
>> 8;
121 *(*output
)++ = g
>> 8;
122 *(*output
)++ = r
>> 8;
126 static inline void transfer_YUV101010_to_YUV888(unsigned char *(*output
), unsigned char *input
)
130 *(*output
)++ = y
>> 8;
131 *(*output
)++ = u
>> 8;
132 *(*output
)++ = v
>> 8;
135 static inline void transfer_YUV101010_to_YUVA8888(unsigned char *(*output
), unsigned char *input
)
139 *(*output
)++ = y
>> 8;
140 *(*output
)++ = u
>> 8;
141 *(*output
)++ = v
>> 8;
145 static inline void transfer_YUV101010_to_YUV161616(uint16_t *(*output
), unsigned char *input
)
154 static inline void transfer_YUV101010_to_YUVA16161616(uint16_t *(*output
), unsigned char *input
)
161 *(*output
)++ = 0xffff;
164 static inline void transfer_YUV101010_to_RGB888(unsigned char *(*output
), unsigned char *input
)
170 y
= (y
<< 8) | (y
>> 8);
172 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
174 *(*output
)++ = r
>> 8;
175 *(*output
)++ = g
>> 8;
176 *(*output
)++ = b
>> 8;
179 static inline void transfer_YUV101010_to_RGBA8888(unsigned char *(*output
), unsigned char *input
)
185 y
= (y
<< 8) | (y
>> 8);
187 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
189 *(*output
)++ = r
>> 8;
190 *(*output
)++ = g
>> 8;
191 *(*output
)++ = b
>> 8;
195 static inline void transfer_YUV101010_to_RGB161616(uint16_t *(*output
), unsigned char *input
)
201 y
= (y
<< 8) | (y
>> 8);
203 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
210 static inline void transfer_YUV101010_to_RGBA16161616(uint16_t *(*output
), unsigned char *input
)
216 y
= (y
<< 8) | (y
>> 8);
218 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
223 *(*output
)++ = 0xffff;
229 static inline void transfer_YUV101010_to_RGB_FLOAT(float *(*output
),
230 unsigned char *input
)
237 y_f
= (float)y
/ 0xffff;
239 YUV16_TO_RGB_FLOAT(y_f
, u
, v
, r
, g
, b
);
246 static inline void transfer_YUV101010_to_RGBA_FLOAT(float *(*output
),
247 unsigned char *input
)
254 y_f
= (float)y
/ 0xffff;
256 YUV16_TO_RGB_FLOAT(y_f
, u
, v
, r
, g
, b
);
282 // ******************************** VYU888 -> *********************************
285 static inline void transfer_VYU888_to_RGB8(unsigned char *(*output
), unsigned char *input
)
290 y
= ((int)input
[1]) << 16;
293 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
295 *(*output
) = (unsigned char)((r
& 0xc0) +
301 static inline void transfer_VYU888_to_BGR565(unsigned char *(*output
), unsigned char *input
)
306 y
= ((int)input
[1]) << 16;
309 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
310 *(uint16_t*)(*output
) = ((b
& 0xf8) << 8)
316 static inline void transfer_VYU888_to_RGB565(unsigned char *(*output
), unsigned char *input
)
321 y
= ((int)input
[1]) << 16;
324 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
325 *(uint16_t*)(*output
) = ((r
& 0xf8) << 8)
331 static inline void transfer_VYU888_to_BGR888(unsigned char *(*output
), unsigned char *input
)
336 y
= ((int)input
[1]) << 16;
339 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
347 static inline void transfer_VYU888_to_BGR8888(unsigned char *(*output
), unsigned char *input
)
352 y
= ((int)input
[1]) << 16;
355 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
363 static inline void transfer_VYU888_to_RGB888(unsigned char *(*output
), unsigned char *input
)
368 y
= ((int)input
[1]) << 16;
371 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
379 static inline void transfer_VYU888_to_RGBA8888(unsigned char *(*output
), unsigned char *input
)
384 y
= ((int)input
[1]) << 16;
387 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
397 static inline void transfer_VYU888_to_RGB161616(uint16_t *(*output
), unsigned char *input
)
402 y
= (input
[1] << 16) | (input
[1] << 8) | input
[1];
403 u
= (input
[2] << 8) | input
[2];
404 v
= (input
[0] << 8) | input
[0];
405 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
413 static inline void transfer_VYU888_to_RGBA16161616(uint16_t *(*output
), unsigned char *input
)
418 y
= (input
[1] << 16) | (input
[1] << 8) | input
[1];
419 u
= (input
[2] << 8) | input
[2];
420 v
= (input
[0] << 8) | input
[0];
421 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
426 (*output
)[3] = 0xffff;
431 static inline void transfer_VYU888_to_RGB_FLOAT(float *(*output
), unsigned char *input
)
438 y
= (float)*input
++ / 0xff;
440 YUV_TO_FLOAT(y
, u
, v
, r
, g
, b
);
447 static inline void transfer_VYU888_to_RGBA_FLOAT(float *(*output
), unsigned char *input
)
454 y
= (float)*input
++ / 0xff;
456 YUV_TO_FLOAT(y
, u
, v
, r
, g
, b
);
465 static inline void transfer_VYU888_to_YUV888(unsigned char *(*output
), unsigned char *input
)
467 (*output
)[0] = input
[1];
468 (*output
)[1] = input
[2];
469 (*output
)[2] = input
[0];
473 static inline void transfer_VYU888_to_YUVA8888(unsigned char *(*output
), unsigned char *input
)
475 (*output
)[0] = input
[1];
476 (*output
)[1] = input
[2];
477 (*output
)[2] = input
[0];
483 static inline void transfer_VYU888_to_YUV161616(uint16_t *(*output
), unsigned char *input
)
485 (*output
)[0] = ((int)input
[1]) << 8;
486 (*output
)[1] = ((int)input
[2]) << 8;
487 (*output
)[2] = ((int)input
[0]) << 8;
491 static inline void transfer_VYU888_to_YUVA16161616(uint16_t *(*output
), unsigned char *input
)
493 (*output
)[0] = ((int)input
[1]) << 8;
494 (*output
)[1] = ((int)input
[2]) << 8;
495 (*output
)[2] = ((int)input
[0]) << 8;
511 // ******************************** UYVA8888 -> *********************************
514 static inline void transfer_UYVA8888_to_RGB8(unsigned char *(*output
), unsigned char *input
)
519 y
= ((int)input
[1]) << 16;
522 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
524 r
= r
* input
[3] / 0xff;
525 g
= g
* input
[3] / 0xff;
526 b
= b
* input
[3] / 0xff;
527 *(*output
) = (unsigned char)((r
& 0xc0) +
533 static inline void transfer_UYVA8888_to_BGR565(unsigned char *(*output
), unsigned char *input
)
538 y
= ((int)input
[1]) << 16;
541 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
542 r
= r
* input
[3] / 0xff;
543 g
= g
* input
[3] / 0xff;
544 b
= b
* input
[3] / 0xff;
545 *(uint16_t*)(*output
) = ((b
& 0xf8) << 8)
551 static inline void transfer_UYVA8888_to_RGB565(unsigned char *(*output
), unsigned char *input
)
556 y
= ((int)input
[1]) << 16;
559 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
560 r
= r
* input
[3] / 0xff;
561 g
= g
* input
[3] / 0xff;
562 b
= b
* input
[3] / 0xff;
563 *(uint16_t*)(*output
) = ((r
& 0xf8) << 8)
569 static inline void transfer_UYVA8888_to_BGR888(unsigned char *(*output
), unsigned char *input
)
574 y
= ((int)input
[1]) << 16;
577 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
578 r
= r
* input
[3] / 0xff;
579 g
= g
* input
[3] / 0xff;
580 b
= b
* input
[3] / 0xff;
588 static inline void transfer_UYVA8888_to_BGR8888(unsigned char *(*output
), unsigned char *input
)
593 y
= ((int)input
[1]) << 16;
596 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
597 r
= r
* input
[3] / 0xff;
598 g
= g
* input
[3] / 0xff;
599 b
= b
* input
[3] / 0xff;
608 static inline void transfer_UYVA8888_to_RGB888(unsigned char *(*output
), unsigned char *input
)
613 y
= ((int)input
[1]) << 16;
616 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
617 r
= r
* input
[3] / 0xff;
618 g
= g
* input
[3] / 0xff;
619 b
= b
* input
[3] / 0xff;
627 static inline void transfer_UYVA8888_to_RGBA8888(unsigned char *(*output
), unsigned char *input
)
632 y
= ((int)input
[1]) << 16;
635 YUV_TO_RGB(y
, u
, v
, r
, g
, b
);
640 (*output
)[3] = input
[3];
645 static inline void transfer_UYVA8888_to_RGB161616(uint16_t *(*output
), unsigned char *input
)
650 y
= ((int)input
[1]) << 16;
651 u
= (input
[0] << 8) | input
[0];
652 v
= (input
[2] << 8) | input
[2];
653 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
654 r
= r
* input
[3] / 0xff;
655 g
= g
* input
[3] / 0xff;
656 b
= b
* input
[3] / 0xff;
664 static inline void transfer_UYVA8888_to_RGBA16161616(uint16_t *(*output
), unsigned char *input
)
669 y
= ((int)input
[1]) << 16;
670 u
= (input
[0] << 8) | input
[0];
671 v
= (input
[2] << 8) | input
[2];
672 YUV_TO_RGB16(y
, u
, v
, r
, g
, b
);
677 (*output
)[3] = input
[3] << 8;
681 static inline void transfer_UYVA8888_to_RGB_FLOAT(float *(*output
), unsigned char *input
)
688 y
= (float)*input
++ / 0xff;
690 a
= (float)*input
/ 0xff;
691 YUV_TO_FLOAT(y
, u
, v
, r
, g
, b
);
702 static inline void transfer_UYVA8888_to_RGBA_FLOAT(float *(*output
), unsigned char *input
)
709 y
= (float)*input
++ / 0xff;
711 a
= (float)*input
/ 0xff;
712 YUV_TO_FLOAT(y
, u
, v
, r
, g
, b
);
721 static inline void transfer_UYVA8888_to_YUV888(unsigned char *(*output
), unsigned char *input
)
727 (*output
)[0] = (a
* input
[1]) / 0xff;
728 (*output
)[1] = (a
* input
[0] + anti_a
* 0x80) / 0xff;
729 (*output
)[2] = (a
* input
[2] + anti_a
* 0x80) / 0xff;
733 static inline void transfer_UYVA8888_to_YUVA8888(unsigned char *(*output
), unsigned char *input
)
735 (*output
)[0] = input
[1];
736 (*output
)[1] = input
[0];
737 (*output
)[2] = input
[2];
738 (*output
)[3] = input
[3];
743 static inline void transfer_UYVA8888_to_YUV161616(uint16_t *(*output
), unsigned char *input
)
749 (*output
)[0] = a
* input
[1];
750 (*output
)[1] = a
* input
[0] + anti_a
* 0x80;
751 (*output
)[2] = a
* input
[2] + anti_a
* 0x80;
755 static inline void transfer_UYVA8888_to_YUVA16161616(uint16_t *(*output
), unsigned char *input
)
757 (*output
)[0] = input
[1] << 8;
758 (*output
)[1] = input
[0] << 8;
759 (*output
)[2] = input
[2] << 8;
760 (*output
)[3] = input
[3] << 8;
773 #define TRANSFER_FRAME_DEFAULT(output, \
782 switch(in_colormodel) \
785 switch(out_colormodel) \
788 TRANSFER_FRAME_HEAD \
789 transfer_YUV888_to_RGB8((output), (input)); \
790 TRANSFER_FRAME_TAIL \
793 TRANSFER_FRAME_HEAD \
794 transfer_YUV888_to_BGR565((output), (input)); \
795 TRANSFER_FRAME_TAIL \
798 TRANSFER_FRAME_HEAD \
799 transfer_YUV888_to_RGB565((output), (input)); \
800 TRANSFER_FRAME_TAIL \
803 TRANSFER_FRAME_HEAD \
804 transfer_YUV888_to_BGR888((output), (input)); \
805 TRANSFER_FRAME_TAIL \
808 TRANSFER_FRAME_HEAD \
809 transfer_YUV888_to_BGR8888((output), (input)); \
810 TRANSFER_FRAME_TAIL \
813 TRANSFER_FRAME_HEAD \
814 transfer_YUV888_to_RGB888((output), (input)); \
815 TRANSFER_FRAME_TAIL \
818 TRANSFER_FRAME_HEAD \
819 transfer_YUV888_to_RGBA8888((output), (input)); \
820 TRANSFER_FRAME_TAIL \
823 TRANSFER_FRAME_HEAD \
824 transfer_YUV888_to_RGB_FLOAT((float**)(output), (input)); \
825 TRANSFER_FRAME_TAIL \
827 case BC_RGBA_FLOAT: \
828 TRANSFER_FRAME_HEAD \
829 transfer_YUV888_to_RGBA_FLOAT((float**)(output), (input)); \
830 TRANSFER_FRAME_TAIL \
833 TRANSFER_FRAME_HEAD \
834 transfer_YUV888_to_YUV101010((output), (input)); \
835 TRANSFER_FRAME_TAIL \
838 TRANSFER_YUV420P_OUT_HEAD \
839 transfer_YUV888_to_YUV420P_YUV422P(output_y, \
844 TRANSFER_FRAME_TAIL \
847 TRANSFER_YUV422P_OUT_HEAD \
848 transfer_YUV888_to_YUV420P_YUV422P(output_y, \
853 TRANSFER_FRAME_TAIL \
856 TRANSFER_YUV444P_OUT_HEAD \
857 transfer_YUV888_to_YUV444P(output_y, \
862 TRANSFER_FRAME_TAIL \
865 TRANSFER_FRAME_HEAD \
866 transfer_YUV888_to_YUV422((output), \
869 TRANSFER_FRAME_TAIL \
872 TRANSFER_FRAME_HEAD \
873 transfer_YUV888_to_YUV888((output), (input)); \
874 TRANSFER_FRAME_TAIL \
877 TRANSFER_FRAME_HEAD \
878 transfer_YUV888_to_YUVA8888((output), (input)); \
879 TRANSFER_FRAME_TAIL \
882 TRANSFER_FRAME_HEAD \
883 transfer_YUV888_to_VYU888((output), (input)); \
884 TRANSFER_FRAME_TAIL \
887 TRANSFER_FRAME_HEAD \
888 transfer_YUV888_to_UYVA8888((output), (input)); \
889 TRANSFER_FRAME_TAIL \
895 switch(out_colormodel) \
898 TRANSFER_FRAME_HEAD \
899 transfer_YUVA8888_to_RGB8((output), (input)); \
900 TRANSFER_FRAME_TAIL \
903 TRANSFER_FRAME_HEAD \
904 transfer_YUVA8888_to_BGR565((output), (input)); \
905 TRANSFER_FRAME_TAIL \
908 TRANSFER_FRAME_HEAD \
909 transfer_YUVA8888_to_RGB565((output), (input)); \
910 TRANSFER_FRAME_TAIL \
913 TRANSFER_FRAME_HEAD \
914 transfer_YUVA8888_to_BGR888((output), (input)); \
915 TRANSFER_FRAME_TAIL \
918 TRANSFER_FRAME_HEAD \
919 transfer_YUVA8888_to_BGR8888((output), (input)); \
920 TRANSFER_FRAME_TAIL \
923 TRANSFER_FRAME_HEAD \
924 transfer_YUVA8888_to_RGB888((output), (input)); \
925 TRANSFER_FRAME_TAIL \
928 TRANSFER_FRAME_HEAD \
929 transfer_YUVA8888_to_RGBA8888((output), (input)); \
930 TRANSFER_FRAME_TAIL \
933 TRANSFER_FRAME_HEAD \
934 transfer_YUVA8888_to_RGB_FLOAT((float**)(output), (input)); \
935 TRANSFER_FRAME_TAIL \
937 case BC_RGBA_FLOAT: \
938 TRANSFER_FRAME_HEAD \
939 transfer_YUVA8888_to_RGBA_FLOAT((float**)(output), (input)); \
940 TRANSFER_FRAME_TAIL \
943 TRANSFER_FRAME_HEAD \
944 transfer_YUVA8888_to_VYU888((output), (input)); \
945 TRANSFER_FRAME_TAIL \
948 TRANSFER_FRAME_HEAD \
949 transfer_YUVA8888_to_YUVA8888((output), (input)); \
950 TRANSFER_FRAME_TAIL \
953 TRANSFER_FRAME_HEAD \
954 transfer_YUVA8888_to_UYVA8888((output), (input)); \
955 TRANSFER_FRAME_TAIL \
958 TRANSFER_FRAME_HEAD \
959 transfer_YUVA8888_to_YUV101010((output), (input)); \
960 TRANSFER_FRAME_TAIL \
963 TRANSFER_YUV420P_OUT_HEAD \
964 transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \
969 TRANSFER_FRAME_TAIL \
972 TRANSFER_YUV422P_OUT_HEAD \
973 transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \
978 TRANSFER_FRAME_TAIL \
981 TRANSFER_YUV444P_OUT_HEAD \
982 transfer_YUVA8888_to_YUV444P(output_y, \
987 TRANSFER_FRAME_TAIL \
990 TRANSFER_FRAME_HEAD \
991 transfer_YUVA8888_to_YUV422((output), \
994 TRANSFER_FRAME_TAIL \
1000 switch(out_colormodel) \
1003 TRANSFER_FRAME_HEAD \
1004 transfer_YUV161616_to_RGB8((output), (uint16_t*)(input)); \
1005 TRANSFER_FRAME_TAIL \
1008 TRANSFER_FRAME_HEAD \
1009 transfer_YUV161616_to_BGR565((output), (uint16_t*)(input)); \
1010 TRANSFER_FRAME_TAIL \
1013 TRANSFER_FRAME_HEAD \
1014 transfer_YUV161616_to_RGB565((output), (uint16_t*)(input)); \
1015 TRANSFER_FRAME_TAIL \
1018 TRANSFER_FRAME_HEAD \
1019 transfer_YUV161616_to_BGR888((output), (uint16_t*)(input)); \
1020 TRANSFER_FRAME_TAIL \
1023 TRANSFER_FRAME_HEAD \
1024 transfer_YUV161616_to_BGR8888((output), (uint16_t*)(input)); \
1025 TRANSFER_FRAME_TAIL \
1028 TRANSFER_FRAME_HEAD \
1029 transfer_YUV161616_to_RGB888((output), (uint16_t*)(input)); \
1030 TRANSFER_FRAME_TAIL \
1033 TRANSFER_FRAME_HEAD \
1034 transfer_YUV161616_to_RGBA8888((output), (uint16_t*)(input)); \
1035 TRANSFER_FRAME_TAIL \
1037 case BC_RGB_FLOAT: \
1038 TRANSFER_FRAME_HEAD \
1039 transfer_YUV161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1040 TRANSFER_FRAME_TAIL \
1042 case BC_RGBA_FLOAT: \
1043 TRANSFER_FRAME_HEAD \
1044 transfer_YUV161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1045 TRANSFER_FRAME_TAIL \
1048 TRANSFER_YUV420P_OUT_HEAD \
1049 transfer_YUV161616_to_YUV420P_YUV422P(output_y, \
1052 (uint16_t*)(input), \
1054 TRANSFER_FRAME_TAIL \
1057 TRANSFER_YUV422P_OUT_HEAD \
1058 transfer_YUV161616_to_YUV420P_YUV422P(output_y, \
1061 (uint16_t*)(input), \
1063 TRANSFER_FRAME_TAIL \
1066 TRANSFER_YUV444P_OUT_HEAD \
1067 transfer_YUV161616_to_YUV444P(output_y, \
1070 (uint16_t*)(input), \
1072 TRANSFER_FRAME_TAIL \
1075 TRANSFER_FRAME_HEAD \
1076 transfer_YUV161616_to_YUV422((output), \
1077 (uint16_t*)(input), \
1079 TRANSFER_FRAME_TAIL \
1081 case BC_YUV101010: \
1082 TRANSFER_FRAME_HEAD \
1083 transfer_YUV161616_to_YUV101010((output), (uint16_t*)(input)); \
1084 TRANSFER_FRAME_TAIL \
1087 TRANSFER_FRAME_HEAD \
1088 transfer_YUV161616_to_YUVA8888((output), \
1089 (uint16_t*)(input)); \
1090 TRANSFER_FRAME_TAIL \
1093 TRANSFER_FRAME_HEAD \
1094 transfer_YUV161616_to_VYU888((output), (uint16_t*)(input)); \
1095 TRANSFER_FRAME_TAIL \
1098 TRANSFER_FRAME_HEAD \
1099 transfer_YUV161616_to_UYVA8888((output), (uint16_t*)(input)); \
1100 TRANSFER_FRAME_TAIL \
1102 case BC_YUV161616: \
1103 TRANSFER_FRAME_HEAD \
1104 transfer_YUV161616_to_YUV161616((uint16_t**)(output), \
1105 (uint16_t*)(input)); \
1106 TRANSFER_FRAME_TAIL \
1111 case BC_YUVA16161616: \
1112 switch(out_colormodel) \
1115 TRANSFER_FRAME_HEAD \
1116 transfer_YUVA16161616_to_RGB8((output), (uint16_t*)(input)); \
1117 TRANSFER_FRAME_TAIL \
1120 TRANSFER_FRAME_HEAD \
1121 transfer_YUVA16161616_to_BGR565((output), (uint16_t*)(input)); \
1122 TRANSFER_FRAME_TAIL \
1125 TRANSFER_FRAME_HEAD \
1126 transfer_YUVA16161616_to_RGB565((output), (uint16_t*)(input)); \
1127 TRANSFER_FRAME_TAIL \
1130 TRANSFER_FRAME_HEAD \
1131 transfer_YUVA16161616_to_BGR888((output), (uint16_t*)(input)); \
1132 TRANSFER_FRAME_TAIL \
1135 TRANSFER_FRAME_HEAD \
1136 transfer_YUVA16161616_to_BGR8888((output), (uint16_t*)(input)); \
1137 TRANSFER_FRAME_TAIL \
1140 TRANSFER_FRAME_HEAD \
1141 transfer_YUVA16161616_to_RGB888((output), (uint16_t*)(input)); \
1142 TRANSFER_FRAME_TAIL \
1145 TRANSFER_FRAME_HEAD \
1146 transfer_YUVA16161616_to_RGBA8888((output), (uint16_t*)(input)); \
1147 TRANSFER_FRAME_TAIL \
1149 case BC_RGB_FLOAT: \
1150 TRANSFER_FRAME_HEAD \
1151 transfer_YUVA16161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1152 TRANSFER_FRAME_TAIL \
1154 case BC_RGBA_FLOAT: \
1155 TRANSFER_FRAME_HEAD \
1156 transfer_YUVA16161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1157 TRANSFER_FRAME_TAIL \
1159 case BC_YUV101010: \
1160 TRANSFER_FRAME_HEAD \
1161 transfer_YUVA16161616_to_YUV101010((output), (uint16_t*)(input)); \
1162 TRANSFER_FRAME_TAIL \
1165 TRANSFER_FRAME_HEAD \
1166 transfer_YUVA16161616_to_VYU888((output), (uint16_t*)(input)); \
1167 TRANSFER_FRAME_TAIL \
1170 TRANSFER_FRAME_HEAD \
1171 transfer_YUVA16161616_to_UYVA8888((output), (uint16_t*)(input)); \
1172 TRANSFER_FRAME_TAIL \
1174 case BC_YUVA16161616: \
1175 TRANSFER_FRAME_HEAD \
1176 transfer_YUVA16161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1177 TRANSFER_FRAME_TAIL \
1180 TRANSFER_YUV420P_OUT_HEAD \
1181 transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \
1184 (uint16_t*)(input), \
1186 TRANSFER_FRAME_TAIL \
1189 TRANSFER_YUV422P_OUT_HEAD \
1190 transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \
1193 (uint16_t*)(input), \
1195 TRANSFER_FRAME_TAIL \
1198 TRANSFER_YUV444P_OUT_HEAD \
1199 transfer_YUVA16161616_to_YUV444P(output_y, \
1202 (uint16_t*)(input), \
1204 TRANSFER_FRAME_TAIL \
1207 TRANSFER_FRAME_HEAD \
1208 transfer_YUVA16161616_to_YUV422((output), \
1209 (uint16_t*)(input), \
1211 TRANSFER_FRAME_TAIL \
1216 case BC_YUV101010: \
1217 switch(out_colormodel) \
1220 TRANSFER_FRAME_HEAD \
1221 transfer_YUV101010_to_RGB8((output), (input)); \
1222 TRANSFER_FRAME_TAIL \
1225 TRANSFER_FRAME_HEAD \
1226 transfer_YUV101010_to_BGR565((output), (input)); \
1227 TRANSFER_FRAME_TAIL \
1230 TRANSFER_FRAME_HEAD \
1231 transfer_YUV101010_to_RGB565((output), (input)); \
1232 TRANSFER_FRAME_TAIL \
1235 TRANSFER_FRAME_HEAD \
1236 transfer_YUV101010_to_BGR888((output), (input)); \
1237 TRANSFER_FRAME_TAIL \
1240 TRANSFER_FRAME_HEAD \
1241 transfer_YUV101010_to_BGR8888((output), (input)); \
1242 TRANSFER_FRAME_TAIL \
1245 TRANSFER_FRAME_HEAD \
1246 transfer_YUV101010_to_RGB888((output), (input)); \
1247 TRANSFER_FRAME_TAIL \
1250 TRANSFER_FRAME_HEAD \
1251 transfer_YUV101010_to_RGBA8888((output), (input)); \
1252 TRANSFER_FRAME_TAIL \
1255 TRANSFER_FRAME_HEAD \
1256 transfer_YUV101010_to_YUV888((output), (input)); \
1257 TRANSFER_FRAME_TAIL \
1260 TRANSFER_FRAME_HEAD \
1261 transfer_YUV101010_to_YUVA8888((output), (input)); \
1262 TRANSFER_FRAME_TAIL \
1264 case BC_RGB161616: \
1265 TRANSFER_FRAME_HEAD \
1266 transfer_YUV101010_to_RGB161616((uint16_t**)(output), (input)); \
1267 TRANSFER_FRAME_TAIL \
1269 case BC_RGBA16161616: \
1270 TRANSFER_FRAME_HEAD \
1271 transfer_YUV101010_to_RGBA16161616((uint16_t**)(output), (input)); \
1272 TRANSFER_FRAME_TAIL \
1274 case BC_RGB_FLOAT: \
1275 TRANSFER_FRAME_HEAD \
1276 transfer_YUV101010_to_RGB_FLOAT((float**)(output), (input)); \
1277 TRANSFER_FRAME_TAIL \
1279 case BC_RGBA_FLOAT: \
1280 TRANSFER_FRAME_HEAD \
1281 transfer_YUV101010_to_RGBA_FLOAT((float**)(output), (input)); \
1282 TRANSFER_FRAME_TAIL \
1284 case BC_YUV161616: \
1285 TRANSFER_FRAME_HEAD \
1286 transfer_YUV101010_to_YUV161616((uint16_t**)(output), (input)); \
1287 TRANSFER_FRAME_TAIL \
1289 case BC_YUVA16161616: \
1290 TRANSFER_FRAME_HEAD \
1291 transfer_YUV101010_to_YUVA16161616((uint16_t**)(output), (input)); \
1292 TRANSFER_FRAME_TAIL \
1298 switch(out_colormodel) \
1301 TRANSFER_FRAME_HEAD \
1302 transfer_VYU888_to_RGB8((output), (input)); \
1303 TRANSFER_FRAME_TAIL \
1306 TRANSFER_FRAME_HEAD \
1307 transfer_VYU888_to_BGR565((output), (input)); \
1308 TRANSFER_FRAME_TAIL \
1311 TRANSFER_FRAME_HEAD \
1312 transfer_VYU888_to_RGB565((output), (input)); \
1313 TRANSFER_FRAME_TAIL \
1316 TRANSFER_FRAME_HEAD \
1317 transfer_VYU888_to_BGR888((output), (input)); \
1318 TRANSFER_FRAME_TAIL \
1321 TRANSFER_FRAME_HEAD \
1322 transfer_VYU888_to_BGR8888((output), (input)); \
1323 TRANSFER_FRAME_TAIL \
1326 TRANSFER_FRAME_HEAD \
1327 transfer_VYU888_to_RGB888((output), (input)); \
1328 TRANSFER_FRAME_TAIL \
1331 TRANSFER_FRAME_HEAD \
1332 transfer_VYU888_to_RGBA8888((output), (input)); \
1333 TRANSFER_FRAME_TAIL \
1336 TRANSFER_FRAME_HEAD \
1337 transfer_VYU888_to_YUV888((output), (input)); \
1338 TRANSFER_FRAME_TAIL \
1341 TRANSFER_FRAME_HEAD \
1342 transfer_VYU888_to_YUVA8888((output), (input)); \
1343 TRANSFER_FRAME_TAIL \
1345 case BC_RGB161616: \
1346 TRANSFER_FRAME_HEAD \
1347 transfer_VYU888_to_RGB161616((uint16_t**)(output), (input)); \
1348 TRANSFER_FRAME_TAIL \
1350 case BC_RGBA16161616: \
1351 TRANSFER_FRAME_HEAD \
1352 transfer_VYU888_to_RGBA16161616((uint16_t**)(output), (input)); \
1353 TRANSFER_FRAME_TAIL \
1355 case BC_RGB_FLOAT: \
1356 TRANSFER_FRAME_HEAD \
1357 transfer_VYU888_to_RGB_FLOAT((float**)(output), (input)); \
1358 TRANSFER_FRAME_TAIL \
1360 case BC_RGBA_FLOAT: \
1361 TRANSFER_FRAME_HEAD \
1362 transfer_VYU888_to_RGBA_FLOAT((float**)(output), (input)); \
1363 TRANSFER_FRAME_TAIL \
1365 case BC_YUV161616: \
1366 TRANSFER_FRAME_HEAD \
1367 transfer_VYU888_to_YUV161616((uint16_t**)(output), (input)); \
1368 TRANSFER_FRAME_TAIL \
1370 case BC_YUVA16161616: \
1371 TRANSFER_FRAME_HEAD \
1372 transfer_VYU888_to_YUVA16161616((uint16_t**)(output), (input)); \
1373 TRANSFER_FRAME_TAIL \
1379 switch(out_colormodel) \
1382 TRANSFER_FRAME_HEAD \
1383 transfer_UYVA8888_to_RGB8((output), (input)); \
1384 TRANSFER_FRAME_TAIL \
1387 TRANSFER_FRAME_HEAD \
1388 transfer_UYVA8888_to_BGR565((output), (input)); \
1389 TRANSFER_FRAME_TAIL \
1392 TRANSFER_FRAME_HEAD \
1393 transfer_UYVA8888_to_RGB565((output), (input)); \
1394 TRANSFER_FRAME_TAIL \
1397 TRANSFER_FRAME_HEAD \
1398 transfer_UYVA8888_to_BGR888((output), (input)); \
1399 TRANSFER_FRAME_TAIL \
1402 TRANSFER_FRAME_HEAD \
1403 transfer_UYVA8888_to_BGR8888((output), (input)); \
1404 TRANSFER_FRAME_TAIL \
1407 TRANSFER_FRAME_HEAD \
1408 transfer_UYVA8888_to_RGB888((output), (input)); \
1409 TRANSFER_FRAME_TAIL \
1412 TRANSFER_FRAME_HEAD \
1413 transfer_UYVA8888_to_RGBA8888((output), (input)); \
1414 TRANSFER_FRAME_TAIL \
1417 TRANSFER_FRAME_HEAD \
1418 transfer_UYVA8888_to_YUV888((output), (input)); \
1419 TRANSFER_FRAME_TAIL \
1422 TRANSFER_FRAME_HEAD \
1423 transfer_UYVA8888_to_YUVA8888((output), (input)); \
1424 TRANSFER_FRAME_TAIL \
1426 case BC_RGB161616: \
1427 TRANSFER_FRAME_HEAD \
1428 transfer_UYVA8888_to_RGB161616((uint16_t**)(output), (input)); \
1429 TRANSFER_FRAME_TAIL \
1431 case BC_RGBA16161616: \
1432 TRANSFER_FRAME_HEAD \
1433 transfer_UYVA8888_to_RGBA16161616((uint16_t**)(output), (input)); \
1434 TRANSFER_FRAME_TAIL \
1436 case BC_RGB_FLOAT: \
1437 TRANSFER_FRAME_HEAD \
1438 transfer_UYVA8888_to_RGB_FLOAT((float**)(output), (input)); \
1439 TRANSFER_FRAME_TAIL \
1441 case BC_RGBA_FLOAT: \
1442 TRANSFER_FRAME_HEAD \
1443 transfer_UYVA8888_to_RGBA_FLOAT((float**)(output), (input)); \
1444 TRANSFER_FRAME_TAIL \
1446 case BC_YUV161616: \
1447 TRANSFER_FRAME_HEAD \
1448 transfer_UYVA8888_to_YUV161616((uint16_t**)(output), (input)); \
1449 TRANSFER_FRAME_TAIL \
1451 case BC_YUVA16161616: \
1452 TRANSFER_FRAME_HEAD \
1453 transfer_UYVA8888_to_YUVA16161616((uint16_t**)(output), (input)); \
1454 TRANSFER_FRAME_TAIL \
1461 switch(out_colormodel) \
1465 TRANSFER_FRAME_HEAD \
1466 transfer_ARGB8888_to_ARGB8888((output), (input)); \
1467 TRANSFER_FRAME_TAIL \
1473 switch(out_colormodel) \
1476 TRANSFER_FRAME_HEAD \
1477 transfer_RGB888_to_RGB8((output), (input)); \
1478 TRANSFER_FRAME_TAIL \
1481 TRANSFER_FRAME_HEAD \
1482 transfer_RGB888_to_BGR565((output), (input)); \
1483 TRANSFER_FRAME_TAIL \
1486 TRANSFER_FRAME_HEAD \
1487 transfer_RGB888_to_RGB565((output), (input)); \
1488 TRANSFER_FRAME_TAIL \
1491 TRANSFER_FRAME_HEAD \
1492 transfer_RGB888_to_BGR888((output), (input)); \
1493 TRANSFER_FRAME_TAIL \
1496 TRANSFER_FRAME_HEAD \
1497 transfer_RGB888_to_RGB888((output), (input)); \
1498 TRANSFER_FRAME_TAIL \
1501 TRANSFER_FRAME_HEAD \
1502 transfer_RGB888_to_RGBA8888((output), (input)); \
1503 TRANSFER_FRAME_TAIL \
1505 case BC_RGB161616: \
1506 TRANSFER_FRAME_HEAD \
1507 transfer_RGB888_to_RGB161616((uint16_t**)(output), (input)); \
1508 TRANSFER_FRAME_TAIL \
1510 case BC_RGBA16161616: \
1511 TRANSFER_FRAME_HEAD \
1512 transfer_RGB888_to_RGBA16161616((uint16_t**)(output), (input)); \
1513 TRANSFER_FRAME_TAIL \
1515 case BC_RGB_FLOAT: \
1516 TRANSFER_FRAME_HEAD \
1517 transfer_RGB888_to_RGB_FLOAT((float**)(output), (input)); \
1518 TRANSFER_FRAME_TAIL \
1520 case BC_RGBA_FLOAT: \
1521 TRANSFER_FRAME_HEAD \
1522 transfer_RGB888_to_RGBA_FLOAT((float**)(output), (input)); \
1523 TRANSFER_FRAME_TAIL \
1526 TRANSFER_FRAME_HEAD \
1527 transfer_RGB888_to_ARGB8888((output), (input)); \
1528 TRANSFER_FRAME_TAIL \
1531 TRANSFER_FRAME_HEAD \
1532 transfer_RGB888_to_ABGR8888((output), (input)); \
1533 TRANSFER_FRAME_TAIL \
1536 TRANSFER_FRAME_HEAD \
1537 transfer_RGB888_to_BGR8888((output), (input)); \
1538 TRANSFER_FRAME_TAIL \
1541 TRANSFER_FRAME_HEAD \
1542 transfer_RGB888_to_YUV888((output), (input)); \
1543 TRANSFER_FRAME_TAIL \
1546 TRANSFER_FRAME_HEAD \
1547 transfer_RGB888_to_YUVA8888((output), (input)); \
1548 TRANSFER_FRAME_TAIL \
1550 case BC_YUV161616: \
1551 TRANSFER_FRAME_HEAD \
1552 transfer_RGB888_to_YUV161616((uint16_t**)(output), (input)); \
1553 TRANSFER_FRAME_TAIL \
1555 case BC_YUVA16161616: \
1556 TRANSFER_FRAME_HEAD \
1557 transfer_RGB888_to_YUVA16161616((uint16_t**)(output), (input)); \
1558 TRANSFER_FRAME_TAIL \
1560 case BC_YUV101010: \
1561 TRANSFER_FRAME_HEAD \
1562 transfer_RGB888_to_YUV101010((output), (input)); \
1563 TRANSFER_FRAME_TAIL \
1566 TRANSFER_YUV420P_OUT_HEAD \
1567 transfer_RGB888_to_YUV420P_YUV422P(output_y, \
1572 TRANSFER_FRAME_TAIL \
1575 TRANSFER_FRAME_HEAD \
1576 transfer_RGB888_to_YUV422((output), (input), j); \
1577 TRANSFER_FRAME_TAIL \
1580 TRANSFER_YUV422P_OUT_HEAD \
1581 transfer_RGB888_to_YUV420P_YUV422P(output_y, \
1586 TRANSFER_FRAME_TAIL \
1589 TRANSFER_YUV444P_OUT_HEAD \
1590 transfer_RGB888_to_YUV444P(output_y, \
1595 TRANSFER_FRAME_TAIL \
1601 switch(out_colormodel) \
1603 case BC_TRANSPARENCY: \
1604 TRANSFER_FRAME_HEAD \
1605 transfer_RGBA8888_to_TRANSPARENCY((output), (input), &bit_counter); \
1606 TRANSFER_FRAME_TAIL \
1610 TRANSFER_FRAME_HEAD \
1611 transfer_RGBA8888_to_RGB8bg((output), (input), bg_r, bg_g, bg_b); \
1612 TRANSFER_FRAME_TAIL \
1614 TRANSFER_FRAME_HEAD \
1615 transfer_RGBA8888_to_RGB8((output), (input)); \
1616 TRANSFER_FRAME_TAIL \
1620 TRANSFER_FRAME_HEAD \
1621 transfer_RGBA8888_to_BGR565bg((output), (input), bg_r, bg_g, bg_b); \
1622 TRANSFER_FRAME_TAIL \
1624 TRANSFER_FRAME_HEAD \
1625 transfer_RGBA8888_to_BGR565((output), (input)); \
1626 TRANSFER_FRAME_TAIL \
1630 TRANSFER_FRAME_HEAD \
1631 transfer_RGBA8888_to_RGB565bg((output), (input), bg_r, bg_g, bg_b); \
1632 TRANSFER_FRAME_TAIL \
1634 TRANSFER_FRAME_HEAD \
1635 transfer_RGBA8888_to_RGB565((output), (input)); \
1636 TRANSFER_FRAME_TAIL \
1640 TRANSFER_FRAME_HEAD \
1641 transfer_RGBA8888_to_BGR888bg((output), (input), bg_r, bg_g, bg_b); \
1642 TRANSFER_FRAME_TAIL \
1644 TRANSFER_FRAME_HEAD \
1645 transfer_RGBA8888_to_BGR888((output), (input)); \
1646 TRANSFER_FRAME_TAIL \
1650 TRANSFER_FRAME_HEAD \
1651 transfer_RGBA8888_to_RGB888bg((output), (input), bg_r, bg_g, bg_b); \
1652 TRANSFER_FRAME_TAIL \
1654 TRANSFER_FRAME_HEAD \
1655 transfer_RGBA8888_to_RGB888((output), (input)); \
1656 TRANSFER_FRAME_TAIL \
1659 TRANSFER_FRAME_HEAD \
1660 transfer_RGBA8888_to_ARGB8888((output), (input)); \
1661 TRANSFER_FRAME_TAIL \
1664 TRANSFER_FRAME_HEAD \
1665 transfer_RGBA8888_to_RGBA8888((output), (input)); \
1666 TRANSFER_FRAME_TAIL \
1668 case BC_RGB161616: \
1669 TRANSFER_FRAME_HEAD \
1670 transfer_RGBA8888_to_RGB161616((uint16_t**)(output), (input)); \
1671 TRANSFER_FRAME_TAIL \
1673 case BC_RGBA16161616: \
1674 TRANSFER_FRAME_HEAD \
1675 transfer_RGBA8888_to_RGBA16161616((uint16_t**)(output), (input)); \
1676 TRANSFER_FRAME_TAIL \
1678 case BC_RGB_FLOAT: \
1679 TRANSFER_FRAME_HEAD \
1680 transfer_RGBA8888_to_RGB_FLOAT((float**)(output), (input)); \
1681 TRANSFER_FRAME_TAIL \
1683 case BC_RGBA_FLOAT: \
1684 TRANSFER_FRAME_HEAD \
1685 transfer_RGBA8888_to_RGBA_FLOAT((float**)(output), (input)); \
1686 TRANSFER_FRAME_TAIL \
1690 TRANSFER_FRAME_HEAD \
1691 transfer_RGBA8888_to_BGR8888bg((output), (input), bg_r, bg_g, bg_b); \
1692 TRANSFER_FRAME_TAIL \
1694 TRANSFER_FRAME_HEAD \
1695 transfer_RGBA8888_to_BGR8888((output), (input)); \
1696 TRANSFER_FRAME_TAIL \
1699 TRANSFER_FRAME_HEAD \
1700 transfer_RGBA8888_to_YUV888((output), (input)); \
1701 TRANSFER_FRAME_TAIL \
1704 TRANSFER_FRAME_HEAD \
1705 transfer_RGBA8888_to_YUVA8888((output), (input)); \
1706 TRANSFER_FRAME_TAIL \
1708 case BC_YUV161616: \
1709 TRANSFER_FRAME_HEAD \
1710 transfer_RGBA8888_to_YUV161616((uint16_t**)(output), (input)); \
1711 TRANSFER_FRAME_TAIL \
1713 case BC_YUVA16161616: \
1714 TRANSFER_FRAME_HEAD \
1715 transfer_RGBA8888_to_YUVA16161616((uint16_t**)(output), (input)); \
1716 TRANSFER_FRAME_TAIL \
1718 case BC_YUV101010: \
1719 TRANSFER_FRAME_HEAD \
1720 transfer_RGBA8888_to_YUV101010((output), (input)); \
1721 TRANSFER_FRAME_TAIL \
1724 TRANSFER_YUV420P_OUT_HEAD \
1725 transfer_RGBA888_to_YUV420P_YUV422P(output_y, \
1730 TRANSFER_FRAME_TAIL \
1733 TRANSFER_FRAME_HEAD \
1734 transfer_RGBA888_to_YUV422((output), (input), j); \
1735 TRANSFER_FRAME_TAIL \
1738 TRANSFER_YUV422P_OUT_HEAD \
1739 transfer_RGBA888_to_YUV420P_YUV422P(output_y, \
1744 TRANSFER_FRAME_TAIL \
1747 TRANSFER_YUV444P_OUT_HEAD \
1748 transfer_RGBA888_to_YUV444P(output_y, \
1753 TRANSFER_FRAME_TAIL \
1758 case BC_RGB161616: \
1759 switch(out_colormodel) \
1762 TRANSFER_FRAME_HEAD \
1763 transfer_RGB161616_to_RGB8((output), (uint16_t*)(input)); \
1764 TRANSFER_FRAME_TAIL \
1767 TRANSFER_FRAME_HEAD \
1768 transfer_RGB161616_to_BGR565((output), (uint16_t*)(input)); \
1769 TRANSFER_FRAME_TAIL \
1772 TRANSFER_FRAME_HEAD \
1773 transfer_RGB161616_to_RGB565((output), (uint16_t*)(input)); \
1774 TRANSFER_FRAME_TAIL \
1777 TRANSFER_FRAME_HEAD \
1778 transfer_RGB161616_to_BGR888((output), (uint16_t*)(input)); \
1779 TRANSFER_FRAME_TAIL \
1782 TRANSFER_FRAME_HEAD \
1783 transfer_RGB161616_to_BGR8888((output), (uint16_t*)(input)); \
1784 TRANSFER_FRAME_TAIL \
1787 TRANSFER_FRAME_HEAD \
1788 transfer_RGB161616_to_RGB888((output), (uint16_t*)(input)); \
1789 TRANSFER_FRAME_TAIL \
1792 TRANSFER_FRAME_HEAD \
1793 transfer_RGB161616_to_RGBA8888((output), (uint16_t*)(input)); \
1794 TRANSFER_FRAME_TAIL \
1796 case BC_RGB_FLOAT: \
1797 TRANSFER_FRAME_HEAD \
1798 transfer_RGB161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1799 TRANSFER_FRAME_TAIL \
1801 case BC_RGBA_FLOAT: \
1802 TRANSFER_FRAME_HEAD \
1803 transfer_RGB161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1804 TRANSFER_FRAME_TAIL \
1807 TRANSFER_FRAME_HEAD \
1808 transfer_RGB161616_to_YUV888((output), (uint16_t*)(input)); \
1809 TRANSFER_FRAME_TAIL \
1812 TRANSFER_FRAME_HEAD \
1813 transfer_RGB161616_to_YUVA8888((output), (uint16_t*)(input)); \
1814 TRANSFER_FRAME_TAIL \
1816 case BC_YUV161616: \
1817 TRANSFER_FRAME_HEAD \
1818 transfer_RGB161616_to_YUV161616((uint16_t**)(output), (uint16_t*)(input)); \
1819 TRANSFER_FRAME_TAIL \
1821 case BC_YUVA16161616: \
1822 TRANSFER_FRAME_HEAD \
1823 transfer_RGB161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1824 TRANSFER_FRAME_TAIL \
1826 case BC_YUV101010: \
1827 TRANSFER_FRAME_HEAD \
1828 transfer_RGB161616_to_YUV101010((output), (uint16_t*)(input)); \
1829 TRANSFER_FRAME_TAIL \
1832 TRANSFER_YUV420P_OUT_HEAD \
1833 transfer_RGB161616_to_YUV420P_YUV422P(output_y, \
1836 (uint16_t*)(input), \
1838 TRANSFER_FRAME_TAIL \
1841 TRANSFER_YUV422P_OUT_HEAD \
1842 transfer_RGB161616_to_YUV420P_YUV422P(output_y, \
1845 (uint16_t*)(input), \
1847 TRANSFER_FRAME_TAIL \
1850 TRANSFER_YUV444P_OUT_HEAD \
1851 transfer_RGB161616_to_YUV444P(output_y, \
1854 (uint16_t*)(input), \
1856 TRANSFER_FRAME_TAIL \
1861 case BC_RGBA16161616: \
1862 switch(out_colormodel) \
1865 TRANSFER_FRAME_HEAD \
1866 transfer_RGBA16161616_to_RGB8((output), (uint16_t*)(input)); \
1867 TRANSFER_FRAME_TAIL \
1870 TRANSFER_FRAME_HEAD \
1871 transfer_RGBA16161616_to_BGR565((output), (uint16_t*)(input)); \
1872 TRANSFER_FRAME_TAIL \
1875 TRANSFER_FRAME_HEAD \
1876 transfer_RGBA16161616_to_RGB565((output), (uint16_t*)(input)); \
1877 TRANSFER_FRAME_TAIL \
1880 TRANSFER_FRAME_HEAD \
1881 transfer_RGBA16161616_to_BGR888((output), (uint16_t*)(input)); \
1882 TRANSFER_FRAME_TAIL \
1885 TRANSFER_FRAME_HEAD \
1886 transfer_RGBA16161616_to_BGR8888((output), (uint16_t*)(input)); \
1887 TRANSFER_FRAME_TAIL \
1890 TRANSFER_FRAME_HEAD \
1891 transfer_RGBA16161616_to_RGB888((output), (uint16_t*)(input)); \
1892 TRANSFER_FRAME_TAIL \
1895 TRANSFER_FRAME_HEAD \
1896 transfer_RGBA16161616_to_RGBA8888((output), (uint16_t*)(input)); \
1897 TRANSFER_FRAME_TAIL \
1899 case BC_RGB_FLOAT: \
1900 TRANSFER_FRAME_HEAD \
1901 transfer_RGBA16161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1902 TRANSFER_FRAME_TAIL \
1904 case BC_RGBA_FLOAT: \
1905 TRANSFER_FRAME_HEAD \
1906 transfer_RGBA16161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1907 TRANSFER_FRAME_TAIL \
1910 TRANSFER_FRAME_HEAD \
1911 transfer_RGBA16161616_to_YUV888((output), (uint16_t*)(input)); \
1912 TRANSFER_FRAME_TAIL \
1915 TRANSFER_FRAME_HEAD \
1916 transfer_RGBA16161616_to_YUVA8888((output), (uint16_t*)(input)); \
1917 TRANSFER_FRAME_TAIL \
1919 case BC_YUV161616: \
1920 TRANSFER_FRAME_HEAD \
1921 transfer_RGBA16161616_to_YUV161616(((uint16_t**)output), (uint16_t*)(input)); \
1922 TRANSFER_FRAME_TAIL \
1924 case BC_YUVA16161616: \
1925 TRANSFER_FRAME_HEAD \
1926 transfer_RGBA16161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1927 TRANSFER_FRAME_TAIL \
1929 case BC_YUV101010: \
1930 TRANSFER_FRAME_HEAD \
1931 transfer_RGBA16161616_to_YUV101010((output), (uint16_t*)(input)); \
1932 TRANSFER_FRAME_TAIL \
1935 TRANSFER_YUV420P_OUT_HEAD \
1936 transfer_RGBA16161616_to_YUV420P_YUV422P(output_y, \
1939 (uint16_t*)(input), \
1941 TRANSFER_FRAME_TAIL \
1944 TRANSFER_YUV422P_OUT_HEAD \
1945 transfer_RGBA16161616_to_YUV420P_YUV422P(output_y, \
1948 (uint16_t*)(input), \
1950 TRANSFER_FRAME_TAIL \
1953 TRANSFER_YUV444P_OUT_HEAD \
1954 transfer_RGBA16161616_to_YUV444P(output_y, \
1957 (uint16_t*)(input), \
1959 TRANSFER_FRAME_TAIL \
1965 switch(out_colormodel) \
1968 TRANSFER_FRAME_HEAD \
1969 transfer_BGR8888_to_RGB888((output), (input)); \
1970 TRANSFER_FRAME_TAIL \
1973 TRANSFER_FRAME_HEAD \
1974 transfer_BGR8888_to_BGR8888((output), (input)); \
1975 TRANSFER_FRAME_TAIL \
1981 switch(out_colormodel) \
1984 TRANSFER_FRAME_HEAD \
1985 transfer_BGR888_to_RGB888((output), (input)); \
1986 TRANSFER_FRAME_TAIL \
1993 int64_t get_difference(struct timeval
*start_time
)
1995 struct timeval new_time
;
1997 gettimeofday(&new_time
, 0);
1999 new_time
.tv_usec
-= start_time
->tv_usec
;
2000 new_time
.tv_sec
-= start_time
->tv_sec
;
2001 if(new_time
.tv_usec
< 0)
2003 new_time
.tv_usec
+= 1000000;
2007 return (int64_t)new_time
.tv_sec
* 1000000 +
2008 (int64_t)new_time
.tv_usec
;
2015 void cmodel_default(PERMUTATION_ARGS
)
2020 switch (in_colormodel
) {
2022 switch (out_colormodel
) {
2025 // struct timeval start_time;
2026 // gettimeofday(&start_time, 0);
2028 short int *utog_tab
= yuv_table
->utog_tab8
;
2029 short int *vtog_tab
= yuv_table
->vtog_tab8
;
2030 short int *vtor_tab
= yuv_table
->vtor_tab8
;
2031 short int *utob_tab
= yuv_table
->utob_tab8
;
2034 for(i
= 0; i
< out_h
; i
++)
2036 unsigned char *input_row
= input_rows
[row_table
[i
]];
2037 unsigned char *output_row
= output_rows
[i
+ out_y
] + out_x
* out_pixelsize
;
2038 unsigned char *input_data
= input_row
+ (column_table
[0] << 2);
2039 __builtin_prefetch (input_data
, 0, 0);
2042 for(j
= 0; j
< out_w
; j
++)
2044 unsigned char y
= input_data
[0];
2045 unsigned char u
= input_data
[1];
2046 unsigned char v
= input_data
[2];
2047 unsigned char a
= input_data
[3];
2049 /* the secret of the speedup ... delayed index calculation */
2050 /* we do not overflow at the end since column table holds + 1 element */
2051 input_data
= input_row
+ (column_table
[j
+ 1] << 2);
2053 short int r
= y
+ vtor_tab
[v
];
2054 short int g
= y
+ utog_tab
[u
] + vtog_tab
[v
];
2055 short int b
= y
+ utob_tab
[u
];
2057 r
= (r
< 0 ? 0 : (r
> 0xff ? 0xff : r
));
2058 g
= (g
< 0 ? 0 : (g
> 0xff ? 0xff : g
));
2059 b
= (b
< 0 ? 0 : (b
> 0xff ? 0xff : b
));
2065 output_row
[0] = ((b
) >> 8);
2066 output_row
[1] = ((g
) >> 8);
2067 output_row
[2] = ((r
) >> 8);
2073 // long long dif= get_difference(&start_time);
2074 // printf("diff_inside: %lli\n", dif);
2085 TRANSFER_FRAME_DEFAULT(&output_row
,
2086 input_row
+ column_table
[j
] * in_pixelsize
,
2095 TRANSFER_FRAME_DEFAULT(&output_row
,
2096 input_row
+ j
* in_pixelsize
,