r499: This commit was manufactured by cvs2svn to create tag 'r1_2_1-last'.
[cinelerra_cv/mob.git] / hvirtual / quicktime / cmodel_default.c
blobaac6543048e01e4a81f1630301efd9a601383c94
1 /*
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.
6 *
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
15 * USA
17 #include <sys/time.h>
18 #include <time.h>
19 #include "cmodel_permutation.h"
30 // ********************************* YUV101010 -> *****************************
32 #define READ_YUV101010 \
33 uint64_t y, u, v; \
34 uint32_t input_i = input[0] | \
35 (input[1] << 8) | \
36 (input[2] << 16) | \
37 (input[3] << 24); \
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)
50 int r, g, b;
52 READ_YUV101010
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)
65 int r, g, b;
67 READ_YUV101010
69 y = (y << 8) | (y >> 8);
71 YUV_TO_RGB16(y, u, v, r, g, b);
73 *(uint16_t*)(*output) = (b & 0xf800) |
74 ((g & 0xfc00) >> 5) |
75 ((r & 0xf800) >> 11);
76 (*output) += 2;
79 static inline void transfer_YUV101010_to_RGB565(unsigned char *(*output), unsigned char *input)
81 int r, g, b;
83 READ_YUV101010
85 y = (y << 8) | (y >> 8);
87 YUV_TO_RGB16(y, u, v, r, g, b);
89 *(uint16_t*)(*output) = (r & 0xf800) |
90 ((g & 0xfc00) >> 5) |
91 ((b & 0xf800) >> 11);
92 (*output) += 2;
95 static inline void transfer_YUV101010_to_BGR888(unsigned char *(*output), unsigned char *input)
97 int r, g, b;
99 READ_YUV101010
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)
112 int r, g, b;
114 READ_YUV101010
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;
123 (*output)++;
126 static inline void transfer_YUV101010_to_YUV888(unsigned char *(*output), unsigned char *input)
128 READ_YUV101010
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)
137 READ_YUV101010
139 *(*output)++ = y >> 8;
140 *(*output)++ = u >> 8;
141 *(*output)++ = v >> 8;
142 *(*output)++ = 0xff;
145 static inline void transfer_YUV101010_to_YUV161616(uint16_t *(*output), unsigned char *input)
147 READ_YUV101010
149 *(*output)++ = y;
150 *(*output)++ = u;
151 *(*output)++ = v;
154 static inline void transfer_YUV101010_to_YUVA16161616(uint16_t *(*output), unsigned char *input)
156 READ_YUV101010
158 *(*output)++ = y;
159 *(*output)++ = u;
160 *(*output)++ = v;
161 *(*output)++ = 0xffff;
164 static inline void transfer_YUV101010_to_RGB888(unsigned char *(*output), unsigned char *input)
166 int r, g, b;
168 READ_YUV101010
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)
181 int r, g, b;
183 READ_YUV101010
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;
192 *(*output)++ = 0xff;
195 static inline void transfer_YUV101010_to_RGB161616(uint16_t *(*output), unsigned char *input)
197 int r, g, b;
199 READ_YUV101010
201 y = (y << 8) | (y >> 8);
203 YUV_TO_RGB16(y, u, v, r, g, b);
205 *(*output)++ = r;
206 *(*output)++ = g;
207 *(*output)++ = b;
210 static inline void transfer_YUV101010_to_RGBA16161616(uint16_t *(*output), unsigned char *input)
212 int r, g, b;
214 READ_YUV101010
216 y = (y << 8) | (y >> 8);
218 YUV_TO_RGB16(y, u, v, r, g, b);
220 *(*output)++ = r;
221 *(*output)++ = g;
222 *(*output)++ = b;
223 *(*output)++ = 0xffff;
229 static inline void transfer_YUV101010_to_RGB_FLOAT(float *(*output),
230 unsigned char *input)
232 float r, g, b;
233 float y_f;
235 READ_YUV101010
237 y_f = (float)y / 0xffff;
239 YUV16_TO_RGB_FLOAT(y_f, u, v, r, g, b);
241 *(*output)++ = r;
242 *(*output)++ = g;
243 *(*output)++ = b;
246 static inline void transfer_YUV101010_to_RGBA_FLOAT(float *(*output),
247 unsigned char *input)
249 float r, g, b;
250 float y_f;
252 READ_YUV101010
254 y_f = (float)y / 0xffff;
256 YUV16_TO_RGB_FLOAT(y_f, u, v, r, g, b);
258 *(*output)++ = r;
259 *(*output)++ = g;
260 *(*output)++ = b;
261 *(*output)++ = 1.0;
282 // ******************************** VYU888 -> *********************************
285 static inline void transfer_VYU888_to_RGB8(unsigned char *(*output), unsigned char *input)
287 int y, u, v;
288 int r, g, b;
290 y = ((int)input[1]) << 16;
291 u = input[2];
292 v = input[0];
293 YUV_TO_RGB(y, u, v, r, g, b);
295 *(*output) = (unsigned char)((r & 0xc0) +
296 ((g & 0xe0) >> 2) +
297 ((b & 0xe0) >> 5));
298 (*output)++;
301 static inline void transfer_VYU888_to_BGR565(unsigned char *(*output), unsigned char *input)
303 int y, u, v;
304 int r, g, b;
306 y = ((int)input[1]) << 16;
307 u = input[2];
308 v = input[0];
309 YUV_TO_RGB(y, u, v, r, g, b);
310 *(uint16_t*)(*output) = ((b & 0xf8) << 8)
311 + ((g & 0xfc) << 3)
312 + ((r & 0xf8) >> 3);
313 (*output) += 2;
316 static inline void transfer_VYU888_to_RGB565(unsigned char *(*output), unsigned char *input)
318 int y, u, v;
319 int r, g, b;
321 y = ((int)input[1]) << 16;
322 u = input[2];
323 v = input[0];
324 YUV_TO_RGB(y, u, v, r, g, b);
325 *(uint16_t*)(*output) = ((r & 0xf8) << 8)
326 + ((g & 0xfc) << 3)
327 + ((b & 0xf8) >> 3);
328 (*output) += 2;
331 static inline void transfer_VYU888_to_BGR888(unsigned char *(*output), unsigned char *input)
333 int y, u, v;
334 int r, g, b;
336 y = ((int)input[1]) << 16;
337 u = input[2];
338 v = input[0];
339 YUV_TO_RGB(y, u, v, r, g, b);
341 (*output)[2] = r;
342 (*output)[1] = g;
343 (*output)[0] = b;
344 (*output) += 3;
347 static inline void transfer_VYU888_to_BGR8888(unsigned char *(*output), unsigned char *input)
349 int y, u, v;
350 int r, g, b;
352 y = ((int)input[1]) << 16;
353 u = input[2];
354 v = input[0];
355 YUV_TO_RGB(y, u, v, r, g, b);
356 (*output)[2] = r;
357 (*output)[1] = g;
358 (*output)[0] = b;
359 (*output) += 4;
363 static inline void transfer_VYU888_to_RGB888(unsigned char *(*output), unsigned char *input)
365 int y, u, v;
366 int r, g, b;
368 y = ((int)input[1]) << 16;
369 u = input[2];
370 v = input[0];
371 YUV_TO_RGB(y, u, v, r, g, b);
373 (*output)[0] = r;
374 (*output)[1] = g;
375 (*output)[2] = b;
376 (*output) += 3;
379 static inline void transfer_VYU888_to_RGBA8888(unsigned char *(*output), unsigned char *input)
381 int y, u, v;
382 int r, g, b;
384 y = ((int)input[1]) << 16;
385 u = input[2];
386 v = input[0];
387 YUV_TO_RGB(y, u, v, r, g, b);
389 (*output)[0] = r;
390 (*output)[1] = g;
391 (*output)[2] = b;
392 (*output)[3] = 0xff;
393 (*output) += 4;
397 static inline void transfer_VYU888_to_RGB161616(uint16_t *(*output), unsigned char *input)
399 int y, u, v;
400 int r, g, b;
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);
407 (*output)[0] = r;
408 (*output)[1] = g;
409 (*output)[2] = b;
410 (*output) += 3;
413 static inline void transfer_VYU888_to_RGBA16161616(uint16_t *(*output), unsigned char *input)
415 int y, u, v;
416 int r, g, b;
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);
423 (*output)[0] = r;
424 (*output)[1] = g;
425 (*output)[2] = b;
426 (*output)[3] = 0xffff;
427 (*output) += 3;
431 static inline void transfer_VYU888_to_RGB_FLOAT(float *(*output), unsigned char *input)
433 float y;
434 int u, v;
435 float r, g, b;
437 v = *input++;
438 y = (float)*input++ / 0xff;
439 u = *input;
440 YUV_TO_FLOAT(y, u, v, r, g, b);
442 *(*output)++ = r;
443 *(*output)++ = g;
444 *(*output)++ = b;
447 static inline void transfer_VYU888_to_RGBA_FLOAT(float *(*output), unsigned char *input)
449 float y;
450 int u, v;
451 float r, g, b;
453 v = *input++;
454 y = (float)*input++ / 0xff;
455 u = *input;
456 YUV_TO_FLOAT(y, u, v, r, g, b);
458 *(*output)++ = r;
459 *(*output)++ = g;
460 *(*output)++ = b;
461 *(*output)++ = 1.0;
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];
470 (*output) += 3;
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];
478 (*output)[3] = 0xff;
479 (*output) += 4;
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;
488 (*output) += 3;
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;
496 (*output)[3] = 0xff;
497 (*output) += 4;
511 // ******************************** UYVA8888 -> *********************************
514 static inline void transfer_UYVA8888_to_RGB8(unsigned char *(*output), unsigned char *input)
516 int y, u, v;
517 int r, g, b;
519 y = ((int)input[1]) << 16;
520 u = input[0];
521 v = input[2];
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) +
528 ((g & 0xe0) >> 2) +
529 ((b & 0xe0) >> 5));
530 (*output)++;
533 static inline void transfer_UYVA8888_to_BGR565(unsigned char *(*output), unsigned char *input)
535 int y, u, v;
536 int r, g, b;
538 y = ((int)input[1]) << 16;
539 u = input[0];
540 v = input[2];
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)
546 + ((g & 0xfc) << 3)
547 + ((r & 0xf8) >> 3);
548 (*output) += 2;
551 static inline void transfer_UYVA8888_to_RGB565(unsigned char *(*output), unsigned char *input)
553 int y, u, v;
554 int r, g, b;
556 y = ((int)input[1]) << 16;
557 u = input[0];
558 v = input[2];
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)
564 + ((g & 0xfc) << 3)
565 + ((b & 0xf8) >> 3);
566 (*output) += 2;
569 static inline void transfer_UYVA8888_to_BGR888(unsigned char *(*output), unsigned char *input)
571 int y, u, v;
572 int r, g, b;
574 y = ((int)input[1]) << 16;
575 u = input[0];
576 v = input[2];
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;
582 (*output)[2] = r;
583 (*output)[1] = g;
584 (*output)[0] = b;
585 (*output) += 3;
588 static inline void transfer_UYVA8888_to_BGR8888(unsigned char *(*output), unsigned char *input)
590 int y, u, v;
591 int r, g, b;
593 y = ((int)input[1]) << 16;
594 u = input[0];
595 v = input[2];
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;
601 (*output)[2] = r;
602 (*output)[1] = g;
603 (*output)[0] = b;
604 (*output) += 4;
608 static inline void transfer_UYVA8888_to_RGB888(unsigned char *(*output), unsigned char *input)
610 int y, u, v;
611 int r, g, b;
613 y = ((int)input[1]) << 16;
614 u = input[0];
615 v = input[2];
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;
621 (*output)[0] = r;
622 (*output)[1] = g;
623 (*output)[2] = b;
624 (*output) += 3;
627 static inline void transfer_UYVA8888_to_RGBA8888(unsigned char *(*output), unsigned char *input)
629 int y, u, v;
630 int r, g, b;
632 y = ((int)input[1]) << 16;
633 u = input[0];
634 v = input[2];
635 YUV_TO_RGB(y, u, v, r, g, b);
637 (*output)[0] = r;
638 (*output)[1] = g;
639 (*output)[2] = b;
640 (*output)[3] = input[3];
641 (*output) += 4;
645 static inline void transfer_UYVA8888_to_RGB161616(uint16_t *(*output), unsigned char *input)
647 int y, u, v;
648 int r, g, b;
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;
658 (*output)[0] = r;
659 (*output)[1] = g;
660 (*output)[2] = b;
661 (*output) += 3;
664 static inline void transfer_UYVA8888_to_RGBA16161616(uint16_t *(*output), unsigned char *input)
666 int y, u, v;
667 int r, g, b;
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);
674 (*output)[0] = r;
675 (*output)[1] = g;
676 (*output)[2] = b;
677 (*output)[3] = input[3] << 8;
678 (*output) += 4;
681 static inline void transfer_UYVA8888_to_RGB_FLOAT(float *(*output), unsigned char *input)
683 float y, a;
684 int u, v;
685 float r, g, b;
687 u = *input++;
688 y = (float)*input++ / 0xff;
689 v = *input++;
690 a = (float)*input / 0xff;
691 YUV_TO_FLOAT(y, u, v, r, g, b);
693 r = r * a;
694 g = g * a;
695 b = b * a;
697 *(*output)++ = r;
698 *(*output)++ = g;
699 *(*output)++ = b;
702 static inline void transfer_UYVA8888_to_RGBA_FLOAT(float *(*output), unsigned char *input)
704 float y, a;
705 int u, v;
706 float r, g, b;
708 u = *input++;
709 y = (float)*input++ / 0xff;
710 v = *input++;
711 a = (float)*input / 0xff;
712 YUV_TO_FLOAT(y, u, v, r, g, b);
714 *(*output)++ = r;
715 *(*output)++ = g;
716 *(*output)++ = b;
717 *(*output)++ = a;
721 static inline void transfer_UYVA8888_to_YUV888(unsigned char *(*output), unsigned char *input)
723 int a, anti_a;
724 a = input[3];
725 anti_a = 0xff - a;
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;
730 (*output) += 3;
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];
739 (*output) += 4;
743 static inline void transfer_UYVA8888_to_YUV161616(uint16_t *(*output), unsigned char *input)
745 int a, anti_a;
746 a = input[3];
747 anti_a = 0xff - a;
749 (*output)[0] = a * input[1];
750 (*output)[1] = a * input[0] + anti_a * 0x80;
751 (*output)[2] = a * input[2] + anti_a * 0x80;
752 (*output) += 3;
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;
761 (*output) += 4;
773 #define TRANSFER_FRAME_DEFAULT(output, \
774 input, \
775 y_in_offset, \
776 u_in_offset, \
777 v_in_offset, \
778 input_column) \
780 register int i, j; \
782 switch(in_colormodel) \
784 case BC_YUV888: \
785 switch(out_colormodel) \
787 case BC_RGB8: \
788 TRANSFER_FRAME_HEAD \
789 transfer_YUV888_to_RGB8((output), (input)); \
790 TRANSFER_FRAME_TAIL \
791 break; \
792 case BC_BGR565: \
793 TRANSFER_FRAME_HEAD \
794 transfer_YUV888_to_BGR565((output), (input)); \
795 TRANSFER_FRAME_TAIL \
796 break; \
797 case BC_RGB565: \
798 TRANSFER_FRAME_HEAD \
799 transfer_YUV888_to_RGB565((output), (input)); \
800 TRANSFER_FRAME_TAIL \
801 break; \
802 case BC_BGR888: \
803 TRANSFER_FRAME_HEAD \
804 transfer_YUV888_to_BGR888((output), (input)); \
805 TRANSFER_FRAME_TAIL \
806 break; \
807 case BC_BGR8888: \
808 TRANSFER_FRAME_HEAD \
809 transfer_YUV888_to_BGR8888((output), (input)); \
810 TRANSFER_FRAME_TAIL \
811 break; \
812 case BC_RGB888: \
813 TRANSFER_FRAME_HEAD \
814 transfer_YUV888_to_RGB888((output), (input)); \
815 TRANSFER_FRAME_TAIL \
816 break; \
817 case BC_RGBA8888: \
818 TRANSFER_FRAME_HEAD \
819 transfer_YUV888_to_RGBA8888((output), (input)); \
820 TRANSFER_FRAME_TAIL \
821 break; \
822 case BC_RGB_FLOAT: \
823 TRANSFER_FRAME_HEAD \
824 transfer_YUV888_to_RGB_FLOAT((float**)(output), (input)); \
825 TRANSFER_FRAME_TAIL \
826 break; \
827 case BC_RGBA_FLOAT: \
828 TRANSFER_FRAME_HEAD \
829 transfer_YUV888_to_RGBA_FLOAT((float**)(output), (input)); \
830 TRANSFER_FRAME_TAIL \
831 break; \
832 case BC_YUV101010: \
833 TRANSFER_FRAME_HEAD \
834 transfer_YUV888_to_YUV101010((output), (input)); \
835 TRANSFER_FRAME_TAIL \
836 break; \
837 case BC_YUV420P: \
838 TRANSFER_YUV420P_OUT_HEAD \
839 transfer_YUV888_to_YUV420P_YUV422P(output_y, \
840 output_u, \
841 output_v, \
842 (input), \
843 j); \
844 TRANSFER_FRAME_TAIL \
845 break; \
846 case BC_YUV422P: \
847 TRANSFER_YUV422P_OUT_HEAD \
848 transfer_YUV888_to_YUV420P_YUV422P(output_y, \
849 output_u, \
850 output_v, \
851 (input), \
852 j); \
853 TRANSFER_FRAME_TAIL \
854 break; \
855 case BC_YUV444P: \
856 TRANSFER_YUV444P_OUT_HEAD \
857 transfer_YUV888_to_YUV444P(output_y, \
858 output_u, \
859 output_v, \
860 (input), \
861 j); \
862 TRANSFER_FRAME_TAIL \
863 break; \
864 case BC_YUV422: \
865 TRANSFER_FRAME_HEAD \
866 transfer_YUV888_to_YUV422((output), \
867 (input), \
868 j); \
869 TRANSFER_FRAME_TAIL \
870 break; \
871 case BC_YUV888: \
872 TRANSFER_FRAME_HEAD \
873 transfer_YUV888_to_YUV888((output), (input)); \
874 TRANSFER_FRAME_TAIL \
875 break; \
876 case BC_YUVA8888: \
877 TRANSFER_FRAME_HEAD \
878 transfer_YUV888_to_YUVA8888((output), (input)); \
879 TRANSFER_FRAME_TAIL \
880 break; \
881 case BC_VYU888: \
882 TRANSFER_FRAME_HEAD \
883 transfer_YUV888_to_VYU888((output), (input)); \
884 TRANSFER_FRAME_TAIL \
885 break; \
886 case BC_UYVA8888: \
887 TRANSFER_FRAME_HEAD \
888 transfer_YUV888_to_UYVA8888((output), (input)); \
889 TRANSFER_FRAME_TAIL \
890 break; \
892 break; \
894 case BC_YUVA8888: \
895 switch(out_colormodel) \
897 case BC_RGB8: \
898 TRANSFER_FRAME_HEAD \
899 transfer_YUVA8888_to_RGB8((output), (input)); \
900 TRANSFER_FRAME_TAIL \
901 break; \
902 case BC_BGR565: \
903 TRANSFER_FRAME_HEAD \
904 transfer_YUVA8888_to_BGR565((output), (input)); \
905 TRANSFER_FRAME_TAIL \
906 break; \
907 case BC_RGB565: \
908 TRANSFER_FRAME_HEAD \
909 transfer_YUVA8888_to_RGB565((output), (input)); \
910 TRANSFER_FRAME_TAIL \
911 break; \
912 case BC_BGR888: \
913 TRANSFER_FRAME_HEAD \
914 transfer_YUVA8888_to_BGR888((output), (input)); \
915 TRANSFER_FRAME_TAIL \
916 break; \
917 case BC_BGR8888: \
918 TRANSFER_FRAME_HEAD \
919 transfer_YUVA8888_to_BGR8888((output), (input)); \
920 TRANSFER_FRAME_TAIL \
921 break; \
922 case BC_RGB888: \
923 TRANSFER_FRAME_HEAD \
924 transfer_YUVA8888_to_RGB888((output), (input)); \
925 TRANSFER_FRAME_TAIL \
926 break; \
927 case BC_RGBA8888: \
928 TRANSFER_FRAME_HEAD \
929 transfer_YUVA8888_to_RGBA8888((output), (input)); \
930 TRANSFER_FRAME_TAIL \
931 break; \
932 case BC_RGB_FLOAT: \
933 TRANSFER_FRAME_HEAD \
934 transfer_YUVA8888_to_RGB_FLOAT((float**)(output), (input)); \
935 TRANSFER_FRAME_TAIL \
936 break; \
937 case BC_RGBA_FLOAT: \
938 TRANSFER_FRAME_HEAD \
939 transfer_YUVA8888_to_RGBA_FLOAT((float**)(output), (input)); \
940 TRANSFER_FRAME_TAIL \
941 break; \
942 case BC_VYU888: \
943 TRANSFER_FRAME_HEAD \
944 transfer_YUVA8888_to_VYU888((output), (input)); \
945 TRANSFER_FRAME_TAIL \
946 break; \
947 case BC_YUVA8888: \
948 TRANSFER_FRAME_HEAD \
949 transfer_YUVA8888_to_YUVA8888((output), (input)); \
950 TRANSFER_FRAME_TAIL \
951 break; \
952 case BC_UYVA8888: \
953 TRANSFER_FRAME_HEAD \
954 transfer_YUVA8888_to_UYVA8888((output), (input)); \
955 TRANSFER_FRAME_TAIL \
956 break; \
957 case BC_YUV101010: \
958 TRANSFER_FRAME_HEAD \
959 transfer_YUVA8888_to_YUV101010((output), (input)); \
960 TRANSFER_FRAME_TAIL \
961 break; \
962 case BC_YUV420P: \
963 TRANSFER_YUV420P_OUT_HEAD \
964 transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \
965 output_u, \
966 output_v, \
967 (input), \
968 j); \
969 TRANSFER_FRAME_TAIL \
970 break; \
971 case BC_YUV422P: \
972 TRANSFER_YUV422P_OUT_HEAD \
973 transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \
974 output_u, \
975 output_v, \
976 (input), \
977 j); \
978 TRANSFER_FRAME_TAIL \
979 break; \
980 case BC_YUV444P: \
981 TRANSFER_YUV444P_OUT_HEAD \
982 transfer_YUVA8888_to_YUV444P(output_y, \
983 output_u, \
984 output_v, \
985 (input), \
986 j); \
987 TRANSFER_FRAME_TAIL \
988 break; \
989 case BC_YUV422: \
990 TRANSFER_FRAME_HEAD \
991 transfer_YUVA8888_to_YUV422((output), \
992 (input), \
993 j); \
994 TRANSFER_FRAME_TAIL \
995 break; \
997 break; \
999 case BC_YUV161616: \
1000 switch(out_colormodel) \
1002 case BC_RGB8: \
1003 TRANSFER_FRAME_HEAD \
1004 transfer_YUV161616_to_RGB8((output), (uint16_t*)(input)); \
1005 TRANSFER_FRAME_TAIL \
1006 break; \
1007 case BC_BGR565: \
1008 TRANSFER_FRAME_HEAD \
1009 transfer_YUV161616_to_BGR565((output), (uint16_t*)(input)); \
1010 TRANSFER_FRAME_TAIL \
1011 break; \
1012 case BC_RGB565: \
1013 TRANSFER_FRAME_HEAD \
1014 transfer_YUV161616_to_RGB565((output), (uint16_t*)(input)); \
1015 TRANSFER_FRAME_TAIL \
1016 break; \
1017 case BC_BGR888: \
1018 TRANSFER_FRAME_HEAD \
1019 transfer_YUV161616_to_BGR888((output), (uint16_t*)(input)); \
1020 TRANSFER_FRAME_TAIL \
1021 break; \
1022 case BC_BGR8888: \
1023 TRANSFER_FRAME_HEAD \
1024 transfer_YUV161616_to_BGR8888((output), (uint16_t*)(input)); \
1025 TRANSFER_FRAME_TAIL \
1026 break; \
1027 case BC_RGB888: \
1028 TRANSFER_FRAME_HEAD \
1029 transfer_YUV161616_to_RGB888((output), (uint16_t*)(input)); \
1030 TRANSFER_FRAME_TAIL \
1031 break; \
1032 case BC_RGBA8888: \
1033 TRANSFER_FRAME_HEAD \
1034 transfer_YUV161616_to_RGBA8888((output), (uint16_t*)(input)); \
1035 TRANSFER_FRAME_TAIL \
1036 break; \
1037 case BC_RGB_FLOAT: \
1038 TRANSFER_FRAME_HEAD \
1039 transfer_YUV161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1040 TRANSFER_FRAME_TAIL \
1041 break; \
1042 case BC_RGBA_FLOAT: \
1043 TRANSFER_FRAME_HEAD \
1044 transfer_YUV161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1045 TRANSFER_FRAME_TAIL \
1046 break; \
1047 case BC_YUV420P: \
1048 TRANSFER_YUV420P_OUT_HEAD \
1049 transfer_YUV161616_to_YUV420P_YUV422P(output_y, \
1050 output_u, \
1051 output_v, \
1052 (uint16_t*)(input), \
1053 j); \
1054 TRANSFER_FRAME_TAIL \
1055 break; \
1056 case BC_YUV422P: \
1057 TRANSFER_YUV422P_OUT_HEAD \
1058 transfer_YUV161616_to_YUV420P_YUV422P(output_y, \
1059 output_u, \
1060 output_v, \
1061 (uint16_t*)(input), \
1062 j); \
1063 TRANSFER_FRAME_TAIL \
1064 break; \
1065 case BC_YUV444P: \
1066 TRANSFER_YUV444P_OUT_HEAD \
1067 transfer_YUV161616_to_YUV444P(output_y, \
1068 output_u, \
1069 output_v, \
1070 (uint16_t*)(input), \
1071 j); \
1072 TRANSFER_FRAME_TAIL \
1073 break; \
1074 case BC_YUV422: \
1075 TRANSFER_FRAME_HEAD \
1076 transfer_YUV161616_to_YUV422((output), \
1077 (uint16_t*)(input), \
1078 j); \
1079 TRANSFER_FRAME_TAIL \
1080 break; \
1081 case BC_YUV101010: \
1082 TRANSFER_FRAME_HEAD \
1083 transfer_YUV161616_to_YUV101010((output), (uint16_t*)(input)); \
1084 TRANSFER_FRAME_TAIL \
1085 break; \
1086 case BC_YUVA8888: \
1087 TRANSFER_FRAME_HEAD \
1088 transfer_YUV161616_to_YUVA8888((output), \
1089 (uint16_t*)(input)); \
1090 TRANSFER_FRAME_TAIL \
1091 break; \
1092 case BC_VYU888: \
1093 TRANSFER_FRAME_HEAD \
1094 transfer_YUV161616_to_VYU888((output), (uint16_t*)(input)); \
1095 TRANSFER_FRAME_TAIL \
1096 break; \
1097 case BC_UYVA8888: \
1098 TRANSFER_FRAME_HEAD \
1099 transfer_YUV161616_to_UYVA8888((output), (uint16_t*)(input)); \
1100 TRANSFER_FRAME_TAIL \
1101 break; \
1102 case BC_YUV161616: \
1103 TRANSFER_FRAME_HEAD \
1104 transfer_YUV161616_to_YUV161616((uint16_t**)(output), \
1105 (uint16_t*)(input)); \
1106 TRANSFER_FRAME_TAIL \
1107 break; \
1109 break; \
1111 case BC_YUVA16161616: \
1112 switch(out_colormodel) \
1114 case BC_RGB8: \
1115 TRANSFER_FRAME_HEAD \
1116 transfer_YUVA16161616_to_RGB8((output), (uint16_t*)(input)); \
1117 TRANSFER_FRAME_TAIL \
1118 break; \
1119 case BC_BGR565: \
1120 TRANSFER_FRAME_HEAD \
1121 transfer_YUVA16161616_to_BGR565((output), (uint16_t*)(input)); \
1122 TRANSFER_FRAME_TAIL \
1123 break; \
1124 case BC_RGB565: \
1125 TRANSFER_FRAME_HEAD \
1126 transfer_YUVA16161616_to_RGB565((output), (uint16_t*)(input)); \
1127 TRANSFER_FRAME_TAIL \
1128 break; \
1129 case BC_BGR888: \
1130 TRANSFER_FRAME_HEAD \
1131 transfer_YUVA16161616_to_BGR888((output), (uint16_t*)(input)); \
1132 TRANSFER_FRAME_TAIL \
1133 break; \
1134 case BC_BGR8888: \
1135 TRANSFER_FRAME_HEAD \
1136 transfer_YUVA16161616_to_BGR8888((output), (uint16_t*)(input)); \
1137 TRANSFER_FRAME_TAIL \
1138 break; \
1139 case BC_RGB888: \
1140 TRANSFER_FRAME_HEAD \
1141 transfer_YUVA16161616_to_RGB888((output), (uint16_t*)(input)); \
1142 TRANSFER_FRAME_TAIL \
1143 break; \
1144 case BC_RGBA8888: \
1145 TRANSFER_FRAME_HEAD \
1146 transfer_YUVA16161616_to_RGBA8888((output), (uint16_t*)(input)); \
1147 TRANSFER_FRAME_TAIL \
1148 break; \
1149 case BC_RGB_FLOAT: \
1150 TRANSFER_FRAME_HEAD \
1151 transfer_YUVA16161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1152 TRANSFER_FRAME_TAIL \
1153 break; \
1154 case BC_RGBA_FLOAT: \
1155 TRANSFER_FRAME_HEAD \
1156 transfer_YUVA16161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1157 TRANSFER_FRAME_TAIL \
1158 break; \
1159 case BC_YUV101010: \
1160 TRANSFER_FRAME_HEAD \
1161 transfer_YUVA16161616_to_YUV101010((output), (uint16_t*)(input)); \
1162 TRANSFER_FRAME_TAIL \
1163 break; \
1164 case BC_VYU888: \
1165 TRANSFER_FRAME_HEAD \
1166 transfer_YUVA16161616_to_VYU888((output), (uint16_t*)(input)); \
1167 TRANSFER_FRAME_TAIL \
1168 break; \
1169 case BC_UYVA8888: \
1170 TRANSFER_FRAME_HEAD \
1171 transfer_YUVA16161616_to_UYVA8888((output), (uint16_t*)(input)); \
1172 TRANSFER_FRAME_TAIL \
1173 break; \
1174 case BC_YUVA16161616: \
1175 TRANSFER_FRAME_HEAD \
1176 transfer_YUVA16161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1177 TRANSFER_FRAME_TAIL \
1178 break; \
1179 case BC_YUV420P: \
1180 TRANSFER_YUV420P_OUT_HEAD \
1181 transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \
1182 output_u, \
1183 output_v, \
1184 (uint16_t*)(input), \
1185 j); \
1186 TRANSFER_FRAME_TAIL \
1187 break; \
1188 case BC_YUV422P: \
1189 TRANSFER_YUV422P_OUT_HEAD \
1190 transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \
1191 output_u, \
1192 output_v, \
1193 (uint16_t*)(input), \
1194 j); \
1195 TRANSFER_FRAME_TAIL \
1196 break; \
1197 case BC_YUV444P: \
1198 TRANSFER_YUV444P_OUT_HEAD \
1199 transfer_YUVA16161616_to_YUV444P(output_y, \
1200 output_u, \
1201 output_v, \
1202 (uint16_t*)(input), \
1203 j); \
1204 TRANSFER_FRAME_TAIL \
1205 break; \
1206 case BC_YUV422: \
1207 TRANSFER_FRAME_HEAD \
1208 transfer_YUVA16161616_to_YUV422((output), \
1209 (uint16_t*)(input), \
1210 j); \
1211 TRANSFER_FRAME_TAIL \
1212 break; \
1214 break; \
1216 case BC_YUV101010: \
1217 switch(out_colormodel) \
1219 case BC_RGB8: \
1220 TRANSFER_FRAME_HEAD \
1221 transfer_YUV101010_to_RGB8((output), (input)); \
1222 TRANSFER_FRAME_TAIL \
1223 break; \
1224 case BC_BGR565: \
1225 TRANSFER_FRAME_HEAD \
1226 transfer_YUV101010_to_BGR565((output), (input)); \
1227 TRANSFER_FRAME_TAIL \
1228 break; \
1229 case BC_RGB565: \
1230 TRANSFER_FRAME_HEAD \
1231 transfer_YUV101010_to_RGB565((output), (input)); \
1232 TRANSFER_FRAME_TAIL \
1233 break; \
1234 case BC_BGR888: \
1235 TRANSFER_FRAME_HEAD \
1236 transfer_YUV101010_to_BGR888((output), (input)); \
1237 TRANSFER_FRAME_TAIL \
1238 break; \
1239 case BC_BGR8888: \
1240 TRANSFER_FRAME_HEAD \
1241 transfer_YUV101010_to_BGR8888((output), (input)); \
1242 TRANSFER_FRAME_TAIL \
1243 break; \
1244 case BC_RGB888: \
1245 TRANSFER_FRAME_HEAD \
1246 transfer_YUV101010_to_RGB888((output), (input)); \
1247 TRANSFER_FRAME_TAIL \
1248 break; \
1249 case BC_RGBA8888: \
1250 TRANSFER_FRAME_HEAD \
1251 transfer_YUV101010_to_RGBA8888((output), (input)); \
1252 TRANSFER_FRAME_TAIL \
1253 break; \
1254 case BC_YUV888: \
1255 TRANSFER_FRAME_HEAD \
1256 transfer_YUV101010_to_YUV888((output), (input)); \
1257 TRANSFER_FRAME_TAIL \
1258 break; \
1259 case BC_YUVA8888: \
1260 TRANSFER_FRAME_HEAD \
1261 transfer_YUV101010_to_YUVA8888((output), (input)); \
1262 TRANSFER_FRAME_TAIL \
1263 break; \
1264 case BC_RGB161616: \
1265 TRANSFER_FRAME_HEAD \
1266 transfer_YUV101010_to_RGB161616((uint16_t**)(output), (input)); \
1267 TRANSFER_FRAME_TAIL \
1268 break; \
1269 case BC_RGBA16161616: \
1270 TRANSFER_FRAME_HEAD \
1271 transfer_YUV101010_to_RGBA16161616((uint16_t**)(output), (input)); \
1272 TRANSFER_FRAME_TAIL \
1273 break; \
1274 case BC_RGB_FLOAT: \
1275 TRANSFER_FRAME_HEAD \
1276 transfer_YUV101010_to_RGB_FLOAT((float**)(output), (input)); \
1277 TRANSFER_FRAME_TAIL \
1278 break; \
1279 case BC_RGBA_FLOAT: \
1280 TRANSFER_FRAME_HEAD \
1281 transfer_YUV101010_to_RGBA_FLOAT((float**)(output), (input)); \
1282 TRANSFER_FRAME_TAIL \
1283 break; \
1284 case BC_YUV161616: \
1285 TRANSFER_FRAME_HEAD \
1286 transfer_YUV101010_to_YUV161616((uint16_t**)(output), (input)); \
1287 TRANSFER_FRAME_TAIL \
1288 break; \
1289 case BC_YUVA16161616: \
1290 TRANSFER_FRAME_HEAD \
1291 transfer_YUV101010_to_YUVA16161616((uint16_t**)(output), (input)); \
1292 TRANSFER_FRAME_TAIL \
1293 break; \
1295 break; \
1297 case BC_VYU888: \
1298 switch(out_colormodel) \
1300 case BC_RGB8: \
1301 TRANSFER_FRAME_HEAD \
1302 transfer_VYU888_to_RGB8((output), (input)); \
1303 TRANSFER_FRAME_TAIL \
1304 break; \
1305 case BC_BGR565: \
1306 TRANSFER_FRAME_HEAD \
1307 transfer_VYU888_to_BGR565((output), (input)); \
1308 TRANSFER_FRAME_TAIL \
1309 break; \
1310 case BC_RGB565: \
1311 TRANSFER_FRAME_HEAD \
1312 transfer_VYU888_to_RGB565((output), (input)); \
1313 TRANSFER_FRAME_TAIL \
1314 break; \
1315 case BC_BGR888: \
1316 TRANSFER_FRAME_HEAD \
1317 transfer_VYU888_to_BGR888((output), (input)); \
1318 TRANSFER_FRAME_TAIL \
1319 break; \
1320 case BC_BGR8888: \
1321 TRANSFER_FRAME_HEAD \
1322 transfer_VYU888_to_BGR8888((output), (input)); \
1323 TRANSFER_FRAME_TAIL \
1324 break; \
1325 case BC_RGB888: \
1326 TRANSFER_FRAME_HEAD \
1327 transfer_VYU888_to_RGB888((output), (input)); \
1328 TRANSFER_FRAME_TAIL \
1329 break; \
1330 case BC_RGBA8888: \
1331 TRANSFER_FRAME_HEAD \
1332 transfer_VYU888_to_RGBA8888((output), (input)); \
1333 TRANSFER_FRAME_TAIL \
1334 break; \
1335 case BC_YUV888: \
1336 TRANSFER_FRAME_HEAD \
1337 transfer_VYU888_to_YUV888((output), (input)); \
1338 TRANSFER_FRAME_TAIL \
1339 break; \
1340 case BC_YUVA8888: \
1341 TRANSFER_FRAME_HEAD \
1342 transfer_VYU888_to_YUVA8888((output), (input)); \
1343 TRANSFER_FRAME_TAIL \
1344 break; \
1345 case BC_RGB161616: \
1346 TRANSFER_FRAME_HEAD \
1347 transfer_VYU888_to_RGB161616((uint16_t**)(output), (input)); \
1348 TRANSFER_FRAME_TAIL \
1349 break; \
1350 case BC_RGBA16161616: \
1351 TRANSFER_FRAME_HEAD \
1352 transfer_VYU888_to_RGBA16161616((uint16_t**)(output), (input)); \
1353 TRANSFER_FRAME_TAIL \
1354 break; \
1355 case BC_RGB_FLOAT: \
1356 TRANSFER_FRAME_HEAD \
1357 transfer_VYU888_to_RGB_FLOAT((float**)(output), (input)); \
1358 TRANSFER_FRAME_TAIL \
1359 break; \
1360 case BC_RGBA_FLOAT: \
1361 TRANSFER_FRAME_HEAD \
1362 transfer_VYU888_to_RGBA_FLOAT((float**)(output), (input)); \
1363 TRANSFER_FRAME_TAIL \
1364 break; \
1365 case BC_YUV161616: \
1366 TRANSFER_FRAME_HEAD \
1367 transfer_VYU888_to_YUV161616((uint16_t**)(output), (input)); \
1368 TRANSFER_FRAME_TAIL \
1369 break; \
1370 case BC_YUVA16161616: \
1371 TRANSFER_FRAME_HEAD \
1372 transfer_VYU888_to_YUVA16161616((uint16_t**)(output), (input)); \
1373 TRANSFER_FRAME_TAIL \
1374 break; \
1376 break; \
1378 case BC_UYVA8888: \
1379 switch(out_colormodel) \
1381 case BC_RGB8: \
1382 TRANSFER_FRAME_HEAD \
1383 transfer_UYVA8888_to_RGB8((output), (input)); \
1384 TRANSFER_FRAME_TAIL \
1385 break; \
1386 case BC_BGR565: \
1387 TRANSFER_FRAME_HEAD \
1388 transfer_UYVA8888_to_BGR565((output), (input)); \
1389 TRANSFER_FRAME_TAIL \
1390 break; \
1391 case BC_RGB565: \
1392 TRANSFER_FRAME_HEAD \
1393 transfer_UYVA8888_to_RGB565((output), (input)); \
1394 TRANSFER_FRAME_TAIL \
1395 break; \
1396 case BC_BGR888: \
1397 TRANSFER_FRAME_HEAD \
1398 transfer_UYVA8888_to_BGR888((output), (input)); \
1399 TRANSFER_FRAME_TAIL \
1400 break; \
1401 case BC_BGR8888: \
1402 TRANSFER_FRAME_HEAD \
1403 transfer_UYVA8888_to_BGR8888((output), (input)); \
1404 TRANSFER_FRAME_TAIL \
1405 break; \
1406 case BC_RGB888: \
1407 TRANSFER_FRAME_HEAD \
1408 transfer_UYVA8888_to_RGB888((output), (input)); \
1409 TRANSFER_FRAME_TAIL \
1410 break; \
1411 case BC_RGBA8888: \
1412 TRANSFER_FRAME_HEAD \
1413 transfer_UYVA8888_to_RGBA8888((output), (input)); \
1414 TRANSFER_FRAME_TAIL \
1415 break; \
1416 case BC_YUV888: \
1417 TRANSFER_FRAME_HEAD \
1418 transfer_UYVA8888_to_YUV888((output), (input)); \
1419 TRANSFER_FRAME_TAIL \
1420 break; \
1421 case BC_YUVA8888: \
1422 TRANSFER_FRAME_HEAD \
1423 transfer_UYVA8888_to_YUVA8888((output), (input)); \
1424 TRANSFER_FRAME_TAIL \
1425 break; \
1426 case BC_RGB161616: \
1427 TRANSFER_FRAME_HEAD \
1428 transfer_UYVA8888_to_RGB161616((uint16_t**)(output), (input)); \
1429 TRANSFER_FRAME_TAIL \
1430 break; \
1431 case BC_RGBA16161616: \
1432 TRANSFER_FRAME_HEAD \
1433 transfer_UYVA8888_to_RGBA16161616((uint16_t**)(output), (input)); \
1434 TRANSFER_FRAME_TAIL \
1435 break; \
1436 case BC_RGB_FLOAT: \
1437 TRANSFER_FRAME_HEAD \
1438 transfer_UYVA8888_to_RGB_FLOAT((float**)(output), (input)); \
1439 TRANSFER_FRAME_TAIL \
1440 break; \
1441 case BC_RGBA_FLOAT: \
1442 TRANSFER_FRAME_HEAD \
1443 transfer_UYVA8888_to_RGBA_FLOAT((float**)(output), (input)); \
1444 TRANSFER_FRAME_TAIL \
1445 break; \
1446 case BC_YUV161616: \
1447 TRANSFER_FRAME_HEAD \
1448 transfer_UYVA8888_to_YUV161616((uint16_t**)(output), (input)); \
1449 TRANSFER_FRAME_TAIL \
1450 break; \
1451 case BC_YUVA16161616: \
1452 TRANSFER_FRAME_HEAD \
1453 transfer_UYVA8888_to_YUVA16161616((uint16_t**)(output), (input)); \
1454 TRANSFER_FRAME_TAIL \
1455 break; \
1457 break; \
1459 case BC_ARGB8888: \
1460 case BC_ABGR8888: \
1461 switch(out_colormodel) \
1463 case BC_ARGB8888: \
1464 case BC_ABGR8888: \
1465 TRANSFER_FRAME_HEAD \
1466 transfer_ARGB8888_to_ARGB8888((output), (input)); \
1467 TRANSFER_FRAME_TAIL \
1468 break; \
1470 break; \
1472 case BC_RGB888: \
1473 switch(out_colormodel) \
1475 case BC_RGB8: \
1476 TRANSFER_FRAME_HEAD \
1477 transfer_RGB888_to_RGB8((output), (input)); \
1478 TRANSFER_FRAME_TAIL \
1479 break; \
1480 case BC_BGR565: \
1481 TRANSFER_FRAME_HEAD \
1482 transfer_RGB888_to_BGR565((output), (input)); \
1483 TRANSFER_FRAME_TAIL \
1484 break; \
1485 case BC_RGB565: \
1486 TRANSFER_FRAME_HEAD \
1487 transfer_RGB888_to_RGB565((output), (input)); \
1488 TRANSFER_FRAME_TAIL \
1489 break; \
1490 case BC_BGR888: \
1491 TRANSFER_FRAME_HEAD \
1492 transfer_RGB888_to_BGR888((output), (input)); \
1493 TRANSFER_FRAME_TAIL \
1494 break; \
1495 case BC_RGB888: \
1496 TRANSFER_FRAME_HEAD \
1497 transfer_RGB888_to_RGB888((output), (input)); \
1498 TRANSFER_FRAME_TAIL \
1499 break; \
1500 case BC_RGBA8888: \
1501 TRANSFER_FRAME_HEAD \
1502 transfer_RGB888_to_RGBA8888((output), (input)); \
1503 TRANSFER_FRAME_TAIL \
1504 break; \
1505 case BC_RGB161616: \
1506 TRANSFER_FRAME_HEAD \
1507 transfer_RGB888_to_RGB161616((uint16_t**)(output), (input)); \
1508 TRANSFER_FRAME_TAIL \
1509 break; \
1510 case BC_RGBA16161616: \
1511 TRANSFER_FRAME_HEAD \
1512 transfer_RGB888_to_RGBA16161616((uint16_t**)(output), (input)); \
1513 TRANSFER_FRAME_TAIL \
1514 break; \
1515 case BC_RGB_FLOAT: \
1516 TRANSFER_FRAME_HEAD \
1517 transfer_RGB888_to_RGB_FLOAT((float**)(output), (input)); \
1518 TRANSFER_FRAME_TAIL \
1519 break; \
1520 case BC_RGBA_FLOAT: \
1521 TRANSFER_FRAME_HEAD \
1522 transfer_RGB888_to_RGBA_FLOAT((float**)(output), (input)); \
1523 TRANSFER_FRAME_TAIL \
1524 break; \
1525 case BC_ARGB8888: \
1526 TRANSFER_FRAME_HEAD \
1527 transfer_RGB888_to_ARGB8888((output), (input)); \
1528 TRANSFER_FRAME_TAIL \
1529 break; \
1530 case BC_ABGR8888: \
1531 TRANSFER_FRAME_HEAD \
1532 transfer_RGB888_to_ABGR8888((output), (input)); \
1533 TRANSFER_FRAME_TAIL \
1534 break; \
1535 case BC_BGR8888: \
1536 TRANSFER_FRAME_HEAD \
1537 transfer_RGB888_to_BGR8888((output), (input)); \
1538 TRANSFER_FRAME_TAIL \
1539 break; \
1540 case BC_YUV888: \
1541 TRANSFER_FRAME_HEAD \
1542 transfer_RGB888_to_YUV888((output), (input)); \
1543 TRANSFER_FRAME_TAIL \
1544 break; \
1545 case BC_YUVA8888: \
1546 TRANSFER_FRAME_HEAD \
1547 transfer_RGB888_to_YUVA8888((output), (input)); \
1548 TRANSFER_FRAME_TAIL \
1549 break; \
1550 case BC_YUV161616: \
1551 TRANSFER_FRAME_HEAD \
1552 transfer_RGB888_to_YUV161616((uint16_t**)(output), (input)); \
1553 TRANSFER_FRAME_TAIL \
1554 break; \
1555 case BC_YUVA16161616: \
1556 TRANSFER_FRAME_HEAD \
1557 transfer_RGB888_to_YUVA16161616((uint16_t**)(output), (input)); \
1558 TRANSFER_FRAME_TAIL \
1559 break; \
1560 case BC_YUV101010: \
1561 TRANSFER_FRAME_HEAD \
1562 transfer_RGB888_to_YUV101010((output), (input)); \
1563 TRANSFER_FRAME_TAIL \
1564 break; \
1565 case BC_YUV420P: \
1566 TRANSFER_YUV420P_OUT_HEAD \
1567 transfer_RGB888_to_YUV420P_YUV422P(output_y, \
1568 output_u, \
1569 output_v, \
1570 (input), \
1571 j); \
1572 TRANSFER_FRAME_TAIL \
1573 break; \
1574 case BC_YUV422: \
1575 TRANSFER_FRAME_HEAD \
1576 transfer_RGB888_to_YUV422((output), (input), j); \
1577 TRANSFER_FRAME_TAIL \
1578 break; \
1579 case BC_YUV422P: \
1580 TRANSFER_YUV422P_OUT_HEAD \
1581 transfer_RGB888_to_YUV420P_YUV422P(output_y, \
1582 output_u, \
1583 output_v, \
1584 (input), \
1585 j); \
1586 TRANSFER_FRAME_TAIL \
1587 break; \
1588 case BC_YUV444P: \
1589 TRANSFER_YUV444P_OUT_HEAD \
1590 transfer_RGB888_to_YUV444P(output_y, \
1591 output_u, \
1592 output_v, \
1593 (input), \
1594 j); \
1595 TRANSFER_FRAME_TAIL \
1596 break; \
1598 break; \
1600 case BC_RGBA8888: \
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 \
1607 break; \
1608 case BC_RGB8: \
1609 if(bg_color > 0) \
1610 TRANSFER_FRAME_HEAD \
1611 transfer_RGBA8888_to_RGB8bg((output), (input), bg_r, bg_g, bg_b); \
1612 TRANSFER_FRAME_TAIL \
1613 else \
1614 TRANSFER_FRAME_HEAD \
1615 transfer_RGBA8888_to_RGB8((output), (input)); \
1616 TRANSFER_FRAME_TAIL \
1617 break; \
1618 case BC_BGR565: \
1619 if(bg_color > 0) \
1620 TRANSFER_FRAME_HEAD \
1621 transfer_RGBA8888_to_BGR565bg((output), (input), bg_r, bg_g, bg_b); \
1622 TRANSFER_FRAME_TAIL \
1623 else \
1624 TRANSFER_FRAME_HEAD \
1625 transfer_RGBA8888_to_BGR565((output), (input)); \
1626 TRANSFER_FRAME_TAIL \
1627 break; \
1628 case BC_RGB565: \
1629 if(bg_color > 0) \
1630 TRANSFER_FRAME_HEAD \
1631 transfer_RGBA8888_to_RGB565bg((output), (input), bg_r, bg_g, bg_b); \
1632 TRANSFER_FRAME_TAIL \
1633 else \
1634 TRANSFER_FRAME_HEAD \
1635 transfer_RGBA8888_to_RGB565((output), (input)); \
1636 TRANSFER_FRAME_TAIL \
1637 break; \
1638 case BC_BGR888: \
1639 if(bg_color > 0) \
1640 TRANSFER_FRAME_HEAD \
1641 transfer_RGBA8888_to_BGR888bg((output), (input), bg_r, bg_g, bg_b); \
1642 TRANSFER_FRAME_TAIL \
1643 else \
1644 TRANSFER_FRAME_HEAD \
1645 transfer_RGBA8888_to_BGR888((output), (input)); \
1646 TRANSFER_FRAME_TAIL \
1647 break; \
1648 case BC_RGB888: \
1649 if(bg_color > 0) \
1650 TRANSFER_FRAME_HEAD \
1651 transfer_RGBA8888_to_RGB888bg((output), (input), bg_r, bg_g, bg_b); \
1652 TRANSFER_FRAME_TAIL \
1653 else \
1654 TRANSFER_FRAME_HEAD \
1655 transfer_RGBA8888_to_RGB888((output), (input)); \
1656 TRANSFER_FRAME_TAIL \
1657 break; \
1658 case BC_ARGB8888: \
1659 TRANSFER_FRAME_HEAD \
1660 transfer_RGBA8888_to_ARGB8888((output), (input)); \
1661 TRANSFER_FRAME_TAIL \
1662 break; \
1663 case BC_RGBA8888: \
1664 TRANSFER_FRAME_HEAD \
1665 transfer_RGBA8888_to_RGBA8888((output), (input)); \
1666 TRANSFER_FRAME_TAIL \
1667 break; \
1668 case BC_RGB161616: \
1669 TRANSFER_FRAME_HEAD \
1670 transfer_RGBA8888_to_RGB161616((uint16_t**)(output), (input)); \
1671 TRANSFER_FRAME_TAIL \
1672 break; \
1673 case BC_RGBA16161616: \
1674 TRANSFER_FRAME_HEAD \
1675 transfer_RGBA8888_to_RGBA16161616((uint16_t**)(output), (input)); \
1676 TRANSFER_FRAME_TAIL \
1677 break; \
1678 case BC_RGB_FLOAT: \
1679 TRANSFER_FRAME_HEAD \
1680 transfer_RGBA8888_to_RGB_FLOAT((float**)(output), (input)); \
1681 TRANSFER_FRAME_TAIL \
1682 break; \
1683 case BC_RGBA_FLOAT: \
1684 TRANSFER_FRAME_HEAD \
1685 transfer_RGBA8888_to_RGBA_FLOAT((float**)(output), (input)); \
1686 TRANSFER_FRAME_TAIL \
1687 break; \
1688 case BC_BGR8888: \
1689 if(bg_color > 0) \
1690 TRANSFER_FRAME_HEAD \
1691 transfer_RGBA8888_to_BGR8888bg((output), (input), bg_r, bg_g, bg_b); \
1692 TRANSFER_FRAME_TAIL \
1693 else \
1694 TRANSFER_FRAME_HEAD \
1695 transfer_RGBA8888_to_BGR8888((output), (input)); \
1696 TRANSFER_FRAME_TAIL \
1697 break; \
1698 case BC_YUV888: \
1699 TRANSFER_FRAME_HEAD \
1700 transfer_RGBA8888_to_YUV888((output), (input)); \
1701 TRANSFER_FRAME_TAIL \
1702 break; \
1703 case BC_YUVA8888: \
1704 TRANSFER_FRAME_HEAD \
1705 transfer_RGBA8888_to_YUVA8888((output), (input)); \
1706 TRANSFER_FRAME_TAIL \
1707 break; \
1708 case BC_YUV161616: \
1709 TRANSFER_FRAME_HEAD \
1710 transfer_RGBA8888_to_YUV161616((uint16_t**)(output), (input)); \
1711 TRANSFER_FRAME_TAIL \
1712 break; \
1713 case BC_YUVA16161616: \
1714 TRANSFER_FRAME_HEAD \
1715 transfer_RGBA8888_to_YUVA16161616((uint16_t**)(output), (input)); \
1716 TRANSFER_FRAME_TAIL \
1717 break; \
1718 case BC_YUV101010: \
1719 TRANSFER_FRAME_HEAD \
1720 transfer_RGBA8888_to_YUV101010((output), (input)); \
1721 TRANSFER_FRAME_TAIL \
1722 break; \
1723 case BC_YUV420P: \
1724 TRANSFER_YUV420P_OUT_HEAD \
1725 transfer_RGBA888_to_YUV420P_YUV422P(output_y, \
1726 output_u, \
1727 output_v, \
1728 (input), \
1729 j); \
1730 TRANSFER_FRAME_TAIL \
1731 break; \
1732 case BC_YUV422: \
1733 TRANSFER_FRAME_HEAD \
1734 transfer_RGBA888_to_YUV422((output), (input), j); \
1735 TRANSFER_FRAME_TAIL \
1736 break; \
1737 case BC_YUV422P: \
1738 TRANSFER_YUV422P_OUT_HEAD \
1739 transfer_RGBA888_to_YUV420P_YUV422P(output_y, \
1740 output_u, \
1741 output_v, \
1742 (input), \
1743 j); \
1744 TRANSFER_FRAME_TAIL \
1745 break; \
1746 case BC_YUV444P: \
1747 TRANSFER_YUV444P_OUT_HEAD \
1748 transfer_RGBA888_to_YUV444P(output_y, \
1749 output_u, \
1750 output_v, \
1751 (input), \
1752 j); \
1753 TRANSFER_FRAME_TAIL \
1754 break; \
1756 break; \
1758 case BC_RGB161616: \
1759 switch(out_colormodel) \
1761 case BC_RGB8: \
1762 TRANSFER_FRAME_HEAD \
1763 transfer_RGB161616_to_RGB8((output), (uint16_t*)(input)); \
1764 TRANSFER_FRAME_TAIL \
1765 break; \
1766 case BC_BGR565: \
1767 TRANSFER_FRAME_HEAD \
1768 transfer_RGB161616_to_BGR565((output), (uint16_t*)(input)); \
1769 TRANSFER_FRAME_TAIL \
1770 break; \
1771 case BC_RGB565: \
1772 TRANSFER_FRAME_HEAD \
1773 transfer_RGB161616_to_RGB565((output), (uint16_t*)(input)); \
1774 TRANSFER_FRAME_TAIL \
1775 break; \
1776 case BC_BGR888: \
1777 TRANSFER_FRAME_HEAD \
1778 transfer_RGB161616_to_BGR888((output), (uint16_t*)(input)); \
1779 TRANSFER_FRAME_TAIL \
1780 break; \
1781 case BC_BGR8888: \
1782 TRANSFER_FRAME_HEAD \
1783 transfer_RGB161616_to_BGR8888((output), (uint16_t*)(input)); \
1784 TRANSFER_FRAME_TAIL \
1785 break; \
1786 case BC_RGB888: \
1787 TRANSFER_FRAME_HEAD \
1788 transfer_RGB161616_to_RGB888((output), (uint16_t*)(input)); \
1789 TRANSFER_FRAME_TAIL \
1790 break; \
1791 case BC_RGBA8888: \
1792 TRANSFER_FRAME_HEAD \
1793 transfer_RGB161616_to_RGBA8888((output), (uint16_t*)(input)); \
1794 TRANSFER_FRAME_TAIL \
1795 break; \
1796 case BC_RGB_FLOAT: \
1797 TRANSFER_FRAME_HEAD \
1798 transfer_RGB161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1799 TRANSFER_FRAME_TAIL \
1800 break; \
1801 case BC_RGBA_FLOAT: \
1802 TRANSFER_FRAME_HEAD \
1803 transfer_RGB161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1804 TRANSFER_FRAME_TAIL \
1805 break; \
1806 case BC_YUV888: \
1807 TRANSFER_FRAME_HEAD \
1808 transfer_RGB161616_to_YUV888((output), (uint16_t*)(input)); \
1809 TRANSFER_FRAME_TAIL \
1810 break; \
1811 case BC_YUVA8888: \
1812 TRANSFER_FRAME_HEAD \
1813 transfer_RGB161616_to_YUVA8888((output), (uint16_t*)(input)); \
1814 TRANSFER_FRAME_TAIL \
1815 break; \
1816 case BC_YUV161616: \
1817 TRANSFER_FRAME_HEAD \
1818 transfer_RGB161616_to_YUV161616((uint16_t**)(output), (uint16_t*)(input)); \
1819 TRANSFER_FRAME_TAIL \
1820 break; \
1821 case BC_YUVA16161616: \
1822 TRANSFER_FRAME_HEAD \
1823 transfer_RGB161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1824 TRANSFER_FRAME_TAIL \
1825 break; \
1826 case BC_YUV101010: \
1827 TRANSFER_FRAME_HEAD \
1828 transfer_RGB161616_to_YUV101010((output), (uint16_t*)(input)); \
1829 TRANSFER_FRAME_TAIL \
1830 break; \
1831 case BC_YUV420P: \
1832 TRANSFER_YUV420P_OUT_HEAD \
1833 transfer_RGB161616_to_YUV420P_YUV422P(output_y, \
1834 output_u, \
1835 output_v, \
1836 (uint16_t*)(input), \
1837 j); \
1838 TRANSFER_FRAME_TAIL \
1839 break; \
1840 case BC_YUV422P: \
1841 TRANSFER_YUV422P_OUT_HEAD \
1842 transfer_RGB161616_to_YUV420P_YUV422P(output_y, \
1843 output_u, \
1844 output_v, \
1845 (uint16_t*)(input), \
1846 j); \
1847 TRANSFER_FRAME_TAIL \
1848 break; \
1849 case BC_YUV444P: \
1850 TRANSFER_YUV444P_OUT_HEAD \
1851 transfer_RGB161616_to_YUV444P(output_y, \
1852 output_u, \
1853 output_v, \
1854 (uint16_t*)(input), \
1855 j); \
1856 TRANSFER_FRAME_TAIL \
1857 break; \
1859 break; \
1861 case BC_RGBA16161616: \
1862 switch(out_colormodel) \
1864 case BC_RGB8: \
1865 TRANSFER_FRAME_HEAD \
1866 transfer_RGBA16161616_to_RGB8((output), (uint16_t*)(input)); \
1867 TRANSFER_FRAME_TAIL \
1868 break; \
1869 case BC_BGR565: \
1870 TRANSFER_FRAME_HEAD \
1871 transfer_RGBA16161616_to_BGR565((output), (uint16_t*)(input)); \
1872 TRANSFER_FRAME_TAIL \
1873 break; \
1874 case BC_RGB565: \
1875 TRANSFER_FRAME_HEAD \
1876 transfer_RGBA16161616_to_RGB565((output), (uint16_t*)(input)); \
1877 TRANSFER_FRAME_TAIL \
1878 break; \
1879 case BC_BGR888: \
1880 TRANSFER_FRAME_HEAD \
1881 transfer_RGBA16161616_to_BGR888((output), (uint16_t*)(input)); \
1882 TRANSFER_FRAME_TAIL \
1883 break; \
1884 case BC_BGR8888: \
1885 TRANSFER_FRAME_HEAD \
1886 transfer_RGBA16161616_to_BGR8888((output), (uint16_t*)(input)); \
1887 TRANSFER_FRAME_TAIL \
1888 break; \
1889 case BC_RGB888: \
1890 TRANSFER_FRAME_HEAD \
1891 transfer_RGBA16161616_to_RGB888((output), (uint16_t*)(input)); \
1892 TRANSFER_FRAME_TAIL \
1893 break; \
1894 case BC_RGBA8888: \
1895 TRANSFER_FRAME_HEAD \
1896 transfer_RGBA16161616_to_RGBA8888((output), (uint16_t*)(input)); \
1897 TRANSFER_FRAME_TAIL \
1898 break; \
1899 case BC_RGB_FLOAT: \
1900 TRANSFER_FRAME_HEAD \
1901 transfer_RGBA16161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input)); \
1902 TRANSFER_FRAME_TAIL \
1903 break; \
1904 case BC_RGBA_FLOAT: \
1905 TRANSFER_FRAME_HEAD \
1906 transfer_RGBA16161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input)); \
1907 TRANSFER_FRAME_TAIL \
1908 break; \
1909 case BC_YUV888: \
1910 TRANSFER_FRAME_HEAD \
1911 transfer_RGBA16161616_to_YUV888((output), (uint16_t*)(input)); \
1912 TRANSFER_FRAME_TAIL \
1913 break; \
1914 case BC_YUVA8888: \
1915 TRANSFER_FRAME_HEAD \
1916 transfer_RGBA16161616_to_YUVA8888((output), (uint16_t*)(input)); \
1917 TRANSFER_FRAME_TAIL \
1918 break; \
1919 case BC_YUV161616: \
1920 TRANSFER_FRAME_HEAD \
1921 transfer_RGBA16161616_to_YUV161616(((uint16_t**)output), (uint16_t*)(input)); \
1922 TRANSFER_FRAME_TAIL \
1923 break; \
1924 case BC_YUVA16161616: \
1925 TRANSFER_FRAME_HEAD \
1926 transfer_RGBA16161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input)); \
1927 TRANSFER_FRAME_TAIL \
1928 break; \
1929 case BC_YUV101010: \
1930 TRANSFER_FRAME_HEAD \
1931 transfer_RGBA16161616_to_YUV101010((output), (uint16_t*)(input)); \
1932 TRANSFER_FRAME_TAIL \
1933 break; \
1934 case BC_YUV420P: \
1935 TRANSFER_YUV420P_OUT_HEAD \
1936 transfer_RGBA16161616_to_YUV420P_YUV422P(output_y, \
1937 output_u, \
1938 output_v, \
1939 (uint16_t*)(input), \
1940 j); \
1941 TRANSFER_FRAME_TAIL \
1942 break; \
1943 case BC_YUV422P: \
1944 TRANSFER_YUV422P_OUT_HEAD \
1945 transfer_RGBA16161616_to_YUV420P_YUV422P(output_y, \
1946 output_u, \
1947 output_v, \
1948 (uint16_t*)(input), \
1949 j); \
1950 TRANSFER_FRAME_TAIL \
1951 break; \
1952 case BC_YUV444P: \
1953 TRANSFER_YUV444P_OUT_HEAD \
1954 transfer_RGBA16161616_to_YUV444P(output_y, \
1955 output_u, \
1956 output_v, \
1957 (uint16_t*)(input), \
1958 j); \
1959 TRANSFER_FRAME_TAIL \
1960 break; \
1962 break; \
1964 case BC_BGR8888: \
1965 switch(out_colormodel) \
1967 case BC_RGB888: \
1968 TRANSFER_FRAME_HEAD \
1969 transfer_BGR8888_to_RGB888((output), (input)); \
1970 TRANSFER_FRAME_TAIL \
1971 break; \
1972 case BC_BGR8888: \
1973 TRANSFER_FRAME_HEAD \
1974 transfer_BGR8888_to_BGR8888((output), (input)); \
1975 TRANSFER_FRAME_TAIL \
1976 break; \
1978 break; \
1980 case BC_BGR888: \
1981 switch(out_colormodel) \
1983 case BC_RGB888: \
1984 TRANSFER_FRAME_HEAD \
1985 transfer_BGR888_to_RGB888((output), (input)); \
1986 TRANSFER_FRAME_TAIL \
1987 break; \
1989 break; \
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;
2004 new_time.tv_sec--;
2007 return (int64_t)new_time.tv_sec * 1000000 +
2008 (int64_t)new_time.tv_usec;
2015 void cmodel_default(PERMUTATION_ARGS)
2017 if(scale)
2019 int done = 0;
2020 switch (in_colormodel) {
2021 case BC_YUVA8888:
2022 switch (out_colormodel) {
2023 case BC_BGR8888:
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;
2033 short int i ;
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);
2041 short int j;
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));
2061 r *= a;
2062 g *= a;
2063 b *= a;
2065 output_row[0] = ((b) >> 8);
2066 output_row[1] = ((g) >> 8);
2067 output_row[2] = ((r) >> 8);
2069 output_row += 4;
2073 // long long dif= get_difference(&start_time);
2074 // printf("diff_inside: %lli\n", dif);
2076 done = 1;
2078 break;
2080 break;
2083 if (!done)
2085 TRANSFER_FRAME_DEFAULT(&output_row,
2086 input_row + column_table[j] * in_pixelsize,
2093 else
2095 TRANSFER_FRAME_DEFAULT(&output_row,
2096 input_row + j * in_pixelsize,