"Fossies" - the Fresh Open Source Software Archive

Member "quicktime4linux-2.3/cmodel_default.c" (9 Jan 2007, 49355 Bytes) of package /linux/privat/old/quicktime4linux-2.3-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    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.
   11  * 
   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
   16  */
   17 #include "cmodel_permutation.h"
   18 
   19 
   20 
   21 
   22 
   23 
   24 
   25 
   26 
   27 // ********************************* YUV101010 -> *****************************
   28 
   29 #define READ_YUV101010 \
   30     uint64_t y, u, v; \
   31     uint32_t input_i = input[0] | \
   32         (input[1] << 8) | \
   33         (input[2] << 16) | \
   34         (input[3] << 24); \
   35  \
   36     y = ((input_i & 0xffc00000) >> 16) | 0x3f; \
   37     u = ((input_i & 0x3ff000) >> 6) | 0x3f; \
   38     v = ((input_i & 0xffc) << 4) | 0x3f;
   39 
   40 
   41 
   42 
   43 
   44 
   45 static inline void transfer_YUV101010_to_RGB8(unsigned char *(*output), unsigned char *input)
   46 {
   47     int r, g, b;
   48 
   49     READ_YUV101010
   50 
   51     y = (y << 8) | (y >> 8);
   52 
   53     YUV_TO_RGB16(y, u, v, r, g, b);
   54 
   55     *(*output)++ = (unsigned char)(((input[0] & 0xc000) >> 8) +
   56                              ((input[1] & 0xe000) >> 10) +
   57                              ((input[2] & 0xe000) >> 13));
   58 }
   59 
   60 static inline void transfer_YUV101010_to_BGR565(unsigned char *(*output), unsigned char *input)
   61 {
   62     int r, g, b;
   63 
   64     READ_YUV101010
   65 
   66     y = (y << 8) | (y >> 8);
   67 
   68     YUV_TO_RGB16(y, u, v, r, g, b);
   69 
   70     *(uint16_t*)(*output) = (b & 0xf800) |
   71              ((g & 0xfc00) >> 5) |
   72              ((r & 0xf800) >> 11);
   73     (*output) += 2;
   74 }
   75 
   76 static inline void transfer_YUV101010_to_RGB565(unsigned char *(*output), unsigned char *input)
   77 {
   78     int r, g, b;
   79 
   80     READ_YUV101010
   81 
   82     y = (y << 8) | (y >> 8);
   83 
   84     YUV_TO_RGB16(y, u, v, r, g, b);
   85 
   86     *(uint16_t*)(*output) = (r & 0xf800) |
   87              ((g & 0xfc00) >> 5) |
   88              ((b & 0xf800) >> 11);
   89     (*output) += 2;
   90 }
   91 
   92 static inline void transfer_YUV101010_to_BGR888(unsigned char *(*output), unsigned char *input)
   93 {
   94     int r, g, b;
   95 
   96     READ_YUV101010
   97 
   98     y = (y << 8) | (y >> 8);
   99 
  100     YUV_TO_RGB16(y, u, v, r, g, b);
  101 
  102     *(*output)++ = b >> 8;
  103     *(*output)++ = g >> 8;
  104     *(*output)++ = r >> 8;
  105 }
  106 
  107 static inline void transfer_YUV101010_to_BGR8888(unsigned char *(*output), unsigned char *input)
  108 {
  109     int r, g, b;
  110 
  111     READ_YUV101010
  112 
  113     y = (y << 8) | (y >> 8);
  114 
  115     YUV_TO_RGB16(y, u, v, r, g, b);
  116 
  117     *(*output)++ = b >> 8;
  118     *(*output)++ = g >> 8;
  119     *(*output)++ = r >> 8;
  120     (*output)++;
  121 }
  122 
  123 static inline void transfer_YUV101010_to_YUV888(unsigned char *(*output), unsigned char *input)
  124 {
  125     READ_YUV101010
  126      
  127     *(*output)++ = y >> 8;
  128     *(*output)++ = u >> 8;
  129     *(*output)++ = v >> 8;
  130 }
  131 
  132 static inline void transfer_YUV101010_to_YUVA8888(unsigned char *(*output), unsigned char *input)
  133 {
  134     READ_YUV101010
  135      
  136     *(*output)++ = y >> 8;
  137     *(*output)++ = u >> 8;
  138     *(*output)++ = v >> 8;
  139     *(*output)++ = 0xff;
  140 }
  141 
  142 static inline void transfer_YUV101010_to_YUV161616(uint16_t *(*output), unsigned char *input)
  143 {
  144     READ_YUV101010
  145      
  146     *(*output)++ = y;
  147     *(*output)++ = u;
  148     *(*output)++ = v;
  149 }
  150 
  151 static inline void transfer_YUV101010_to_YUVA16161616(uint16_t *(*output), unsigned char *input)
  152 {
  153     READ_YUV101010
  154      
  155     *(*output)++ = y;
  156     *(*output)++ = u;
  157     *(*output)++ = v;
  158     *(*output)++ = 0xffff;
  159 }
  160 
  161 static inline void transfer_YUV101010_to_RGB888(unsigned char *(*output), unsigned char *input)
  162 {
  163     int r, g, b;
  164 
  165     READ_YUV101010
  166 
  167     y = (y << 8) | (y >> 8);
  168 
  169     YUV_TO_RGB16(y, u, v, r, g, b);
  170 
  171     *(*output)++ = r >> 8;
  172     *(*output)++ = g >> 8;
  173     *(*output)++ = b >> 8;
  174 }
  175 
  176 static inline void transfer_YUV101010_to_RGBA8888(unsigned char *(*output), unsigned char *input)
  177 {
  178     int r, g, b;
  179 
  180     READ_YUV101010
  181 
  182     y = (y << 8) | (y >> 8);
  183 
  184     YUV_TO_RGB16(y, u, v, r, g, b);
  185 
  186     *(*output)++ = r >> 8;
  187     *(*output)++ = g >> 8;
  188     *(*output)++ = b >> 8;
  189     *(*output)++ = 0xff;
  190 }
  191 
  192 static inline void transfer_YUV101010_to_RGB161616(uint16_t *(*output), unsigned char *input)
  193 {
  194     int r, g, b;
  195 
  196     READ_YUV101010
  197 
  198     y = (y << 8) | (y >> 8);
  199 
  200     YUV_TO_RGB16(y, u, v, r, g, b);
  201 
  202     *(*output)++ = r;
  203     *(*output)++ = g;
  204     *(*output)++ = b;
  205 }
  206 
  207 static inline void transfer_YUV101010_to_RGBA16161616(uint16_t *(*output), unsigned char *input)
  208 {
  209     int r, g, b;
  210 
  211     READ_YUV101010
  212 
  213     y = (y << 8) | (y >> 8);
  214 
  215     YUV_TO_RGB16(y, u, v, r, g, b);
  216 
  217     *(*output)++ = r;
  218     *(*output)++ = g;
  219     *(*output)++ = b;
  220     *(*output)++ = 0xffff;
  221 }
  222 
  223 
  224 
  225 
  226 static inline void transfer_YUV101010_to_RGB_FLOAT(float *(*output), 
  227     unsigned char *input)
  228 {
  229     float r, g, b;
  230     float y_f;
  231 
  232     READ_YUV101010
  233 
  234     y_f = (float)y / 0xffff;
  235 
  236     YUV16_TO_RGB_FLOAT(y_f, u, v, r, g, b);
  237 
  238     *(*output)++ = r;
  239     *(*output)++ = g;
  240     *(*output)++ = b;
  241 }
  242 
  243 static inline void transfer_YUV101010_to_RGBA_FLOAT(float *(*output), 
  244     unsigned char *input)
  245 {
  246     float r, g, b;
  247     float y_f;
  248 
  249     READ_YUV101010
  250 
  251     y_f = (float)y / 0xffff;
  252 
  253     YUV16_TO_RGB_FLOAT(y_f, u, v, r, g, b);
  254 
  255     *(*output)++ = r;
  256     *(*output)++ = g;
  257     *(*output)++ = b;
  258     *(*output)++ = 1.0;
  259 }
  260 
  261 
  262 
  263 
  264 
  265 
  266 
  267 
  268 
  269 
  270 
  271 
  272 
  273 
  274 
  275 
  276 
  277 
  278 
  279 // ******************************** VYU888 -> *********************************
  280 
  281 
  282 static inline void transfer_VYU888_to_RGB8(unsigned char *(*output), unsigned char *input)
  283 {
  284     int y, u, v;
  285     int r, g, b;
  286     
  287     y = ((int)input[1]) << 16;
  288     u = input[2];
  289     v = input[0];
  290     YUV_TO_RGB(y, u, v, r, g, b);
  291 
  292     *(*output) = (unsigned char)((r & 0xc0) +
  293                              ((g & 0xe0) >> 2) +
  294                              ((b & 0xe0) >> 5));
  295     (*output)++;
  296 }
  297 
  298 static inline void transfer_VYU888_to_BGR565(unsigned char *(*output), unsigned char *input)
  299 {
  300     int y, u, v;
  301     int r, g, b;
  302     
  303     y = ((int)input[1]) << 16;
  304     u = input[2];
  305     v = input[0];
  306     YUV_TO_RGB(y, u, v, r, g, b);
  307     *(uint16_t*)(*output) = ((b & 0xf8) << 8)
  308              + ((g & 0xfc) << 3)
  309              + ((r & 0xf8) >> 3);
  310     (*output) += 2;
  311 }
  312 
  313 static inline void transfer_VYU888_to_RGB565(unsigned char *(*output), unsigned char *input)
  314 {
  315     int y, u, v;
  316     int r, g, b;
  317     
  318     y = ((int)input[1]) << 16;
  319     u = input[2];
  320     v = input[0];
  321     YUV_TO_RGB(y, u, v, r, g, b);
  322     *(uint16_t*)(*output) = ((r & 0xf8) << 8)
  323              + ((g & 0xfc) << 3)
  324              + ((b & 0xf8) >> 3);
  325     (*output) += 2;
  326 }
  327 
  328 static inline void transfer_VYU888_to_BGR888(unsigned char *(*output), unsigned char *input)
  329 {
  330     int y, u, v;
  331     int r, g, b;
  332     
  333     y = ((int)input[1]) << 16;
  334     u = input[2];
  335     v = input[0];
  336     YUV_TO_RGB(y, u, v, r, g, b);
  337 
  338     (*output)[2] = r;
  339     (*output)[1] = g;
  340     (*output)[0] = b;
  341     (*output) += 3;
  342 }
  343 
  344 static inline void transfer_VYU888_to_BGR8888(unsigned char *(*output), unsigned char *input)
  345 {
  346     int y, u, v;
  347     int r, g, b;
  348 
  349     y = ((int)input[1]) << 16;
  350     u = input[2];
  351     v = input[0];
  352     YUV_TO_RGB(y, u, v, r, g, b);
  353     (*output)[2] = r;
  354     (*output)[1] = g;
  355     (*output)[0] = b;
  356     (*output) += 4;
  357 }
  358 
  359 
  360 static inline void transfer_VYU888_to_RGB888(unsigned char *(*output), unsigned char *input)
  361 {
  362     int y, u, v;
  363     int r, g, b;
  364     
  365     y = ((int)input[1]) << 16;
  366     u = input[2];
  367     v = input[0];
  368     YUV_TO_RGB(y, u, v, r, g, b);
  369 
  370     (*output)[0] = r;
  371     (*output)[1] = g;
  372     (*output)[2] = b;
  373     (*output) += 3;
  374 }
  375 
  376 static inline void transfer_VYU888_to_RGBA8888(unsigned char *(*output), unsigned char *input)
  377 {
  378     int y, u, v;
  379     int r, g, b;
  380     
  381     y = ((int)input[1]) << 16;
  382     u = input[2];
  383     v = input[0];
  384     YUV_TO_RGB(y, u, v, r, g, b);
  385 
  386     (*output)[0] = r;
  387     (*output)[1] = g;
  388     (*output)[2] = b;
  389     (*output)[3] = 0xff;
  390     (*output) += 4;
  391 }
  392 
  393 
  394 static inline void transfer_VYU888_to_RGB161616(uint16_t *(*output), unsigned char *input)
  395 {
  396     int y, u, v;
  397     int r, g, b;
  398     
  399     y = (input[1] << 16) | (input[1] << 8) | input[1];
  400     u = (input[2] << 8) | input[2];
  401     v = (input[0] << 8) | input[0];
  402     YUV_TO_RGB16(y, u, v, r, g, b);
  403 
  404     (*output)[0] = r;
  405     (*output)[1] = g;
  406     (*output)[2] = b;
  407     (*output) += 3;
  408 }
  409 
  410 static inline void transfer_VYU888_to_RGBA16161616(uint16_t *(*output), unsigned char *input)
  411 {
  412     int y, u, v;
  413     int r, g, b;
  414 
  415     y = (input[1] << 16) | (input[1] << 8) | input[1];
  416     u = (input[2] << 8) | input[2];
  417     v = (input[0] << 8) | input[0];
  418     YUV_TO_RGB16(y, u, v, r, g, b);
  419 
  420     (*output)[0] = r;
  421     (*output)[1] = g;
  422     (*output)[2] = b;
  423     (*output)[3] = 0xffff;
  424     (*output) += 3;
  425 }
  426 
  427 
  428 static inline void transfer_VYU888_to_RGB_FLOAT(float *(*output), unsigned char *input)
  429 {
  430     float y;
  431     int u, v;
  432     float r, g, b;
  433     
  434     v = *input++;
  435     y = (float)*input++ / 0xff;
  436     u = *input;
  437     YUV_TO_FLOAT(y, u, v, r, g, b);
  438 
  439     *(*output)++ = r;
  440     *(*output)++ = g;
  441     *(*output)++ = b;
  442 }
  443 
  444 static inline void transfer_VYU888_to_RGBA_FLOAT(float *(*output), unsigned char *input)
  445 {
  446     float y;
  447     int u, v;
  448     float r, g, b;
  449     
  450     v = *input++;
  451     y = (float)*input++ / 0xff;
  452     u = *input;
  453     YUV_TO_FLOAT(y, u, v, r, g, b);
  454 
  455     *(*output)++ = r;
  456     *(*output)++ = g;
  457     *(*output)++ = b;
  458     *(*output)++ = 1.0;
  459 }
  460 
  461 
  462 static inline void transfer_VYU888_to_YUV888(unsigned char *(*output), unsigned char *input)
  463 {
  464     (*output)[0] = input[1];
  465     (*output)[1] = input[2];
  466     (*output)[2] = input[0];
  467     (*output) += 3;
  468 }
  469 
  470 static inline void transfer_VYU888_to_YUVA8888(unsigned char *(*output), unsigned char *input)
  471 {
  472     (*output)[0] = input[1];
  473     (*output)[1] = input[2];
  474     (*output)[2] = input[0];
  475     (*output)[3] = 0xff;
  476     (*output) += 4;
  477 }
  478 
  479 
  480 static inline void transfer_VYU888_to_YUV161616(uint16_t *(*output), unsigned char *input)
  481 {
  482     (*output)[0] = ((int)input[1]) << 8;
  483     (*output)[1] = ((int)input[2]) << 8;
  484     (*output)[2] = ((int)input[0]) << 8;
  485     (*output) += 3;
  486 }
  487 
  488 static inline void transfer_VYU888_to_YUVA16161616(uint16_t *(*output), unsigned char *input)
  489 {
  490     (*output)[0] = ((int)input[1]) << 8;
  491     (*output)[1] = ((int)input[2]) << 8;
  492     (*output)[2] = ((int)input[0]) << 8;
  493     (*output)[3] = 0xff;
  494     (*output) += 4;
  495 }
  496 
  497 
  498 
  499 
  500 
  501 
  502 
  503 
  504 
  505 
  506 
  507 
  508 // ******************************** UYVA8888 -> *********************************
  509 
  510 
  511 static inline void transfer_UYVA8888_to_RGB8(unsigned char *(*output), unsigned char *input)
  512 {
  513     int y, u, v;
  514     int r, g, b;
  515 
  516     y = ((int)input[1]) << 16;
  517     u = input[0];
  518     v = input[2];
  519     YUV_TO_RGB(y, u, v, r, g, b);
  520 
  521     r = r * input[3] / 0xff;
  522     g = g * input[3] / 0xff;
  523     b = b * input[3] / 0xff;
  524     *(*output) = (unsigned char)((r & 0xc0) +
  525                              ((g & 0xe0) >> 2) +
  526                              ((b & 0xe0) >> 5));
  527     (*output)++;
  528 }
  529 
  530 static inline void transfer_UYVA8888_to_BGR565(unsigned char *(*output), unsigned char *input)
  531 {
  532     int y, u, v;
  533     int r, g, b;
  534     
  535     y = ((int)input[1]) << 16;
  536     u = input[0];
  537     v = input[2];
  538     YUV_TO_RGB(y, u, v, r, g, b);
  539     r = r * input[3] / 0xff;
  540     g = g * input[3] / 0xff;
  541     b = b * input[3] / 0xff;
  542     *(uint16_t*)(*output) = ((b & 0xf8) << 8)
  543              + ((g & 0xfc) << 3)
  544              + ((r & 0xf8) >> 3);
  545     (*output) += 2;
  546 }
  547 
  548 static inline void transfer_UYVA8888_to_RGB565(unsigned char *(*output), unsigned char *input)
  549 {
  550     int y, u, v;
  551     int r, g, b;
  552     
  553     y = ((int)input[1]) << 16;
  554     u = input[0];
  555     v = input[2];
  556     YUV_TO_RGB(y, u, v, r, g, b);
  557     r = r * input[3] / 0xff;
  558     g = g * input[3] / 0xff;
  559     b = b * input[3] / 0xff;
  560     *(uint16_t*)(*output) = ((r & 0xf8) << 8)
  561              + ((g & 0xfc) << 3)
  562              + ((b & 0xf8) >> 3);
  563     (*output) += 2;
  564 }
  565 
  566 static inline void transfer_UYVA8888_to_BGR888(unsigned char *(*output), unsigned char *input)
  567 {
  568     int y, u, v;
  569     int r, g, b;
  570     
  571     y = ((int)input[1]) << 16;
  572     u = input[0];
  573     v = input[2];
  574     YUV_TO_RGB(y, u, v, r, g, b);
  575     r = r * input[3] / 0xff;
  576     g = g * input[3] / 0xff;
  577     b = b * input[3] / 0xff;
  578 
  579     (*output)[2] = r;
  580     (*output)[1] = g;
  581     (*output)[0] = b;
  582     (*output) += 3;
  583 }
  584 
  585 static inline void transfer_UYVA8888_to_BGR8888(unsigned char *(*output), unsigned char *input)
  586 {
  587     int y, u, v;
  588     int r, g, b;
  589     
  590     y = ((int)input[1]) << 16;
  591     u = input[0];
  592     v = input[2];
  593     YUV_TO_RGB(y, u, v, r, g, b);
  594     r = r * input[3] / 0xff;
  595     g = g * input[3] / 0xff;
  596     b = b * input[3] / 0xff;
  597 
  598     (*output)[2] = r;
  599     (*output)[1] = g;
  600     (*output)[0] = b;
  601     (*output) += 4;
  602 }
  603 
  604 
  605 static inline void transfer_UYVA8888_to_RGB888(unsigned char *(*output), unsigned char *input)
  606 {
  607     int y, u, v;
  608     int r, g, b;
  609     
  610     y = ((int)input[1]) << 16;
  611     u = input[0];
  612     v = input[2];
  613     YUV_TO_RGB(y, u, v, r, g, b);
  614     r = r * input[3] / 0xff;
  615     g = g * input[3] / 0xff;
  616     b = b * input[3] / 0xff;
  617 
  618     (*output)[0] = r;
  619     (*output)[1] = g;
  620     (*output)[2] = b;
  621     (*output) += 3;
  622 }
  623 
  624 static inline void transfer_UYVA8888_to_RGBA8888(unsigned char *(*output), unsigned char *input)
  625 {
  626     int y, u, v;
  627     int r, g, b;
  628     
  629     y = ((int)input[1]) << 16;
  630     u = input[0];
  631     v = input[2];
  632     YUV_TO_RGB(y, u, v, r, g, b);
  633 
  634     (*output)[0] = r;
  635     (*output)[1] = g;
  636     (*output)[2] = b;
  637     (*output)[3] = input[3];
  638     (*output) += 4;
  639 }
  640 
  641 
  642 static inline void transfer_UYVA8888_to_RGB161616(uint16_t *(*output), unsigned char *input)
  643 {
  644     int y, u, v;
  645     int r, g, b;
  646     
  647     y = ((int)input[1]) << 16;
  648     u = (input[0] << 8) | input[0];
  649     v = (input[2] << 8) | input[2];
  650     YUV_TO_RGB16(y, u, v, r, g, b);
  651     r = r * input[3] / 0xff;
  652     g = g * input[3] / 0xff;
  653     b = b * input[3] / 0xff;
  654 
  655     (*output)[0] = r;
  656     (*output)[1] = g;
  657     (*output)[2] = b;
  658     (*output) += 3;
  659 }
  660 
  661 static inline void transfer_UYVA8888_to_RGBA16161616(uint16_t *(*output), unsigned char *input)
  662 {
  663     int y, u, v;
  664     int r, g, b;
  665 
  666     y = ((int)input[1]) << 16;
  667     u = (input[0] << 8) | input[0];
  668     v = (input[2] << 8) | input[2];
  669     YUV_TO_RGB16(y, u, v, r, g, b);
  670 
  671     (*output)[0] = r;
  672     (*output)[1] = g;
  673     (*output)[2] = b;
  674     (*output)[3] = input[3] << 8;
  675     (*output) += 4;
  676 }
  677 
  678 static inline void transfer_UYVA8888_to_RGB_FLOAT(float *(*output), unsigned char *input)
  679 {
  680     float y, a;
  681     int u, v;
  682     float r, g, b;
  683     
  684     u = *input++;
  685     y = (float)*input++ / 0xff;
  686     v = *input++;
  687     a = (float)*input / 0xff;
  688     YUV_TO_FLOAT(y, u, v, r, g, b);
  689 
  690     r = r * a;
  691     g = g * a;
  692     b = b * a;
  693 
  694     *(*output)++ = r;
  695     *(*output)++ = g;
  696     *(*output)++ = b;
  697 }
  698 
  699 static inline void transfer_UYVA8888_to_RGBA_FLOAT(float *(*output), unsigned char *input)
  700 {
  701     float y, a;
  702     int u, v;
  703     float r, g, b;
  704     
  705     u = *input++;
  706     y = (float)*input++ / 0xff;
  707     v = *input++;
  708     a = (float)*input / 0xff;
  709     YUV_TO_FLOAT(y, u, v, r, g, b);
  710 
  711     *(*output)++ = r;
  712     *(*output)++ = g;
  713     *(*output)++ = b;
  714     *(*output)++ = a;
  715 }
  716 
  717 
  718 static inline void transfer_UYVA8888_to_YUV888(unsigned char *(*output), unsigned char *input)
  719 {
  720     int a, anti_a;
  721     a = input[3];
  722     anti_a = 0xff - a;
  723 
  724     (*output)[0] = (a * input[1]) / 0xff;
  725     (*output)[1] = (a * input[0] + anti_a * 0x80) / 0xff;
  726     (*output)[2] = (a * input[2] + anti_a * 0x80) / 0xff;
  727     (*output) += 3;
  728 }
  729 
  730 static inline void transfer_UYVA8888_to_YUVA8888(unsigned char *(*output), unsigned char *input)
  731 {
  732     (*output)[0] = input[1];
  733     (*output)[1] = input[0];
  734     (*output)[2] = input[2];
  735     (*output)[3] = input[3];
  736     (*output) += 4;
  737 }
  738 
  739 
  740 static inline void transfer_UYVA8888_to_YUV161616(uint16_t *(*output), unsigned char *input)
  741 {
  742     int a, anti_a;
  743     a = input[3];
  744     anti_a = 0xff - a;
  745 
  746     (*output)[0] = a * input[1];
  747     (*output)[1] = a * input[0] + anti_a * 0x80;
  748     (*output)[2] = a * input[2] + anti_a * 0x80;
  749     (*output) += 3;
  750 }
  751 
  752 static inline void transfer_UYVA8888_to_YUVA16161616(uint16_t *(*output), unsigned char *input)
  753 {
  754     (*output)[0] = input[1] << 8;
  755     (*output)[1] = input[0] << 8;
  756     (*output)[2] = input[2] << 8;
  757     (*output)[3] = input[3] << 8;
  758     (*output) += 4;
  759 }
  760 
  761 
  762 
  763 
  764 
  765 
  766 
  767 
  768 
  769 
  770 #define TRANSFER_FRAME_DEFAULT(output, \
  771     input, \
  772     y_in_offset, \
  773     u_in_offset, \
  774     v_in_offset, \
  775     input_column) \
  776 { \
  777     register int i, j; \
  778  \
  779     switch(in_colormodel) \
  780     { \
  781         case BC_YUV888: \
  782             switch(out_colormodel) \
  783             { \
  784                 case BC_RGB8: \
  785                     TRANSFER_FRAME_HEAD \
  786                     transfer_YUV888_to_RGB8((output), (input));      \
  787                     TRANSFER_FRAME_TAIL \
  788                     break; \
  789                 case BC_BGR565: \
  790                     TRANSFER_FRAME_HEAD \
  791                     transfer_YUV888_to_BGR565((output), (input));    \
  792                     TRANSFER_FRAME_TAIL \
  793                     break; \
  794                 case BC_RGB565: \
  795                     TRANSFER_FRAME_HEAD \
  796                     transfer_YUV888_to_RGB565((output), (input));    \
  797                     TRANSFER_FRAME_TAIL \
  798                     break; \
  799                 case BC_BGR888: \
  800                     TRANSFER_FRAME_HEAD \
  801                     transfer_YUV888_to_BGR888((output), (input));    \
  802                     TRANSFER_FRAME_TAIL \
  803                     break; \
  804                 case BC_BGR8888: \
  805                     TRANSFER_FRAME_HEAD \
  806                     transfer_YUV888_to_BGR8888((output), (input));   \
  807                     TRANSFER_FRAME_TAIL \
  808                     break; \
  809                 case BC_RGB888: \
  810                     TRANSFER_FRAME_HEAD \
  811                     transfer_YUV888_to_RGB888((output), (input));    \
  812                     TRANSFER_FRAME_TAIL \
  813                     break; \
  814                 case BC_RGBA8888: \
  815                     TRANSFER_FRAME_HEAD \
  816                     transfer_YUV888_to_RGBA8888((output), (input));   \
  817                     TRANSFER_FRAME_TAIL \
  818                     break; \
  819                 case BC_ARGB8888: \
  820                     TRANSFER_FRAME_HEAD \
  821                     transfer_YUV888_to_ARGB8888((output), (input));   \
  822                     TRANSFER_FRAME_TAIL \
  823                     break; \
  824                 case BC_RGB_FLOAT: \
  825                     TRANSFER_FRAME_HEAD \
  826                     transfer_YUV888_to_RGB_FLOAT((float**)(output), (input));    \
  827                     TRANSFER_FRAME_TAIL \
  828                     break; \
  829                 case BC_RGBA_FLOAT: \
  830                     TRANSFER_FRAME_HEAD \
  831                     transfer_YUV888_to_RGBA_FLOAT((float**)(output), (input));   \
  832                     TRANSFER_FRAME_TAIL \
  833                     break; \
  834                 case BC_YUV101010: \
  835                     TRANSFER_FRAME_HEAD \
  836                     transfer_YUV888_to_YUV101010((output), (input));   \
  837                     TRANSFER_FRAME_TAIL \
  838                     break; \
  839                 case BC_YUV420P: \
  840                     TRANSFER_YUV420P_OUT_HEAD \
  841                     transfer_YUV888_to_YUV420P_YUV422P(output_y, \
  842                         output_u, \
  843                         output_v, \
  844                         (input), \
  845                         j); \
  846                     TRANSFER_FRAME_TAIL \
  847                     break; \
  848                 case BC_YUV422P: \
  849                     TRANSFER_YUV422P_OUT_HEAD \
  850                     transfer_YUV888_to_YUV420P_YUV422P(output_y, \
  851                         output_u, \
  852                         output_v, \
  853                         (input), \
  854                         j); \
  855                     TRANSFER_FRAME_TAIL \
  856                     break; \
  857                 case BC_YUV444P: \
  858                     TRANSFER_YUV444P_OUT_HEAD \
  859                     transfer_YUV888_to_YUV444P(output_y, \
  860                         output_u, \
  861                         output_v, \
  862                         (input), \
  863                         j); \
  864                     TRANSFER_FRAME_TAIL \
  865                     break; \
  866                 case BC_YUV422: \
  867                     TRANSFER_FRAME_HEAD \
  868                     transfer_YUV888_to_YUV422((output), \
  869                         (input), \
  870                         j); \
  871                     TRANSFER_FRAME_TAIL \
  872                     break; \
  873                 case BC_YUV888: \
  874                     TRANSFER_FRAME_HEAD \
  875                     transfer_YUV888_to_YUV888((output), (input));   \
  876                     TRANSFER_FRAME_TAIL \
  877                     break; \
  878                 case BC_YUVA8888: \
  879                     TRANSFER_FRAME_HEAD \
  880                     transfer_YUV888_to_YUVA8888((output), (input));   \
  881                     TRANSFER_FRAME_TAIL \
  882                     break; \
  883                 case BC_VYU888: \
  884                     TRANSFER_FRAME_HEAD \
  885                     transfer_YUV888_to_VYU888((output), (input));   \
  886                     TRANSFER_FRAME_TAIL \
  887                     break; \
  888                 case BC_UYVA8888: \
  889                     TRANSFER_FRAME_HEAD \
  890                     transfer_YUV888_to_UYVA8888((output), (input));   \
  891                     TRANSFER_FRAME_TAIL \
  892                     break; \
  893             } \
  894             break; \
  895  \
  896         case BC_YUVA8888: \
  897             switch(out_colormodel) \
  898             { \
  899                 case BC_RGB8: \
  900                     TRANSFER_FRAME_HEAD \
  901                     transfer_YUVA8888_to_RGB8((output), (input));      \
  902                     TRANSFER_FRAME_TAIL \
  903                     break; \
  904                 case BC_BGR565: \
  905                     TRANSFER_FRAME_HEAD \
  906                     transfer_YUVA8888_to_BGR565((output), (input));    \
  907                     TRANSFER_FRAME_TAIL \
  908                     break; \
  909                 case BC_RGB565: \
  910                     TRANSFER_FRAME_HEAD \
  911                     transfer_YUVA8888_to_RGB565((output), (input));    \
  912                     TRANSFER_FRAME_TAIL \
  913                     break; \
  914                 case BC_BGR888: \
  915                     TRANSFER_FRAME_HEAD \
  916                     transfer_YUVA8888_to_BGR888((output), (input));    \
  917                     TRANSFER_FRAME_TAIL \
  918                     break; \
  919                 case BC_BGR8888: \
  920                     TRANSFER_FRAME_HEAD \
  921                     transfer_YUVA8888_to_BGR8888((output), (input));   \
  922                     TRANSFER_FRAME_TAIL \
  923                     break; \
  924                 case BC_RGB888: \
  925                     TRANSFER_FRAME_HEAD \
  926                     transfer_YUVA8888_to_RGB888((output), (input));    \
  927                     TRANSFER_FRAME_TAIL \
  928                     break; \
  929                 case BC_RGBA8888: \
  930                     TRANSFER_FRAME_HEAD \
  931                     transfer_YUVA8888_to_RGBA8888((output), (input));   \
  932                     TRANSFER_FRAME_TAIL \
  933                     break; \
  934                 case BC_ARGB8888: \
  935                     TRANSFER_FRAME_HEAD \
  936                     transfer_YUVA8888_to_ARGB8888((output), (input));   \
  937                     TRANSFER_FRAME_TAIL \
  938                     break; \
  939                 case BC_RGB_FLOAT: \
  940                     TRANSFER_FRAME_HEAD \
  941                     transfer_YUVA8888_to_RGB_FLOAT((float**)(output), (input));    \
  942                     TRANSFER_FRAME_TAIL \
  943                     break; \
  944                 case BC_RGBA_FLOAT: \
  945                     TRANSFER_FRAME_HEAD \
  946                     transfer_YUVA8888_to_RGBA_FLOAT((float**)(output), (input));   \
  947                     TRANSFER_FRAME_TAIL \
  948                     break; \
  949                 case BC_VYU888: \
  950                     TRANSFER_FRAME_HEAD \
  951                     transfer_YUVA8888_to_VYU888((output), (input));   \
  952                     TRANSFER_FRAME_TAIL \
  953                     break; \
  954                 case BC_YUVA8888: \
  955                     TRANSFER_FRAME_HEAD \
  956                     transfer_YUVA8888_to_YUVA8888((output), (input));   \
  957                     TRANSFER_FRAME_TAIL \
  958                     break; \
  959                 case BC_UYVA8888: \
  960                     TRANSFER_FRAME_HEAD \
  961                     transfer_YUVA8888_to_UYVA8888((output), (input));   \
  962                     TRANSFER_FRAME_TAIL \
  963                     break; \
  964                 case BC_YUV101010: \
  965                     TRANSFER_FRAME_HEAD \
  966                     transfer_YUVA8888_to_YUV101010((output), (input));   \
  967                     TRANSFER_FRAME_TAIL \
  968                     break; \
  969                 case BC_YUV420P: \
  970                     TRANSFER_YUV420P_OUT_HEAD \
  971                     transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \
  972                         output_u, \
  973                         output_v, \
  974                         (input), \
  975                         j); \
  976                     TRANSFER_FRAME_TAIL \
  977                     break; \
  978                 case BC_YUV422P: \
  979                     TRANSFER_YUV422P_OUT_HEAD \
  980                     transfer_YUVA8888_to_YUV420P_YUV422P(output_y, \
  981                         output_u, \
  982                         output_v, \
  983                         (input), \
  984                         j); \
  985                     TRANSFER_FRAME_TAIL \
  986                     break; \
  987                 case BC_YUV444P: \
  988                     TRANSFER_YUV444P_OUT_HEAD \
  989                     transfer_YUVA8888_to_YUV444P(output_y, \
  990                         output_u, \
  991                         output_v, \
  992                         (input), \
  993                         j); \
  994                     TRANSFER_FRAME_TAIL \
  995                     break; \
  996                 case BC_YUV422: \
  997                     TRANSFER_FRAME_HEAD \
  998                     transfer_YUVA8888_to_YUV422((output), \
  999                         (input), \
 1000                         j); \
 1001                     TRANSFER_FRAME_TAIL \
 1002                     break; \
 1003             } \
 1004             break; \
 1005  \
 1006         case BC_YUV161616: \
 1007             switch(out_colormodel) \
 1008             { \
 1009                 case BC_RGB8: \
 1010                     TRANSFER_FRAME_HEAD \
 1011                     transfer_YUV161616_to_RGB8((output), (uint16_t*)(input));      \
 1012                     TRANSFER_FRAME_TAIL \
 1013                     break; \
 1014                 case BC_BGR565: \
 1015                     TRANSFER_FRAME_HEAD \
 1016                     transfer_YUV161616_to_BGR565((output), (uint16_t*)(input));    \
 1017                     TRANSFER_FRAME_TAIL \
 1018                     break; \
 1019                 case BC_RGB565: \
 1020                     TRANSFER_FRAME_HEAD \
 1021                     transfer_YUV161616_to_RGB565((output), (uint16_t*)(input));    \
 1022                     TRANSFER_FRAME_TAIL \
 1023                     break; \
 1024                 case BC_BGR888: \
 1025                     TRANSFER_FRAME_HEAD \
 1026                     transfer_YUV161616_to_BGR888((output), (uint16_t*)(input));    \
 1027                     TRANSFER_FRAME_TAIL \
 1028                     break; \
 1029                 case BC_BGR8888: \
 1030                     TRANSFER_FRAME_HEAD \
 1031                     transfer_YUV161616_to_BGR8888((output), (uint16_t*)(input));   \
 1032                     TRANSFER_FRAME_TAIL \
 1033                     break; \
 1034                 case BC_RGB888: \
 1035                     TRANSFER_FRAME_HEAD \
 1036                     transfer_YUV161616_to_RGB888((output), (uint16_t*)(input));    \
 1037                     TRANSFER_FRAME_TAIL \
 1038                     break; \
 1039                 case BC_RGBA8888: \
 1040                     TRANSFER_FRAME_HEAD \
 1041                     transfer_YUV161616_to_RGBA8888((output), (uint16_t*)(input));   \
 1042                     TRANSFER_FRAME_TAIL \
 1043                     break; \
 1044                 case BC_ARGB8888: \
 1045                     TRANSFER_FRAME_HEAD \
 1046                     transfer_YUV161616_to_ARGB8888((output), (uint16_t*)(input));   \
 1047                     TRANSFER_FRAME_TAIL \
 1048                     break; \
 1049                 case BC_RGB_FLOAT: \
 1050                     TRANSFER_FRAME_HEAD \
 1051                     transfer_YUV161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input));    \
 1052                     TRANSFER_FRAME_TAIL \
 1053                     break; \
 1054                 case BC_RGBA_FLOAT: \
 1055                     TRANSFER_FRAME_HEAD \
 1056                     transfer_YUV161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input));   \
 1057                     TRANSFER_FRAME_TAIL \
 1058                     break; \
 1059                 case BC_YUV420P: \
 1060                     TRANSFER_YUV420P_OUT_HEAD \
 1061                     transfer_YUV161616_to_YUV420P_YUV422P(output_y, \
 1062                         output_u, \
 1063                         output_v, \
 1064                         (uint16_t*)(input), \
 1065                         j); \
 1066                     TRANSFER_FRAME_TAIL \
 1067                     break; \
 1068                 case BC_YUV422P: \
 1069                     TRANSFER_YUV422P_OUT_HEAD \
 1070                     transfer_YUV161616_to_YUV420P_YUV422P(output_y, \
 1071                         output_u, \
 1072                         output_v, \
 1073                         (uint16_t*)(input), \
 1074                         j); \
 1075                     TRANSFER_FRAME_TAIL \
 1076                     break; \
 1077                 case BC_YUV444P: \
 1078                     TRANSFER_YUV444P_OUT_HEAD \
 1079                     transfer_YUV161616_to_YUV444P(output_y, \
 1080                         output_u, \
 1081                         output_v, \
 1082                         (uint16_t*)(input), \
 1083                         j); \
 1084                     TRANSFER_FRAME_TAIL \
 1085                     break; \
 1086                 case BC_YUV422: \
 1087                     TRANSFER_FRAME_HEAD \
 1088                     transfer_YUV161616_to_YUV422((output), \
 1089                         (uint16_t*)(input), \
 1090                         j); \
 1091                     TRANSFER_FRAME_TAIL \
 1092                     break; \
 1093                 case BC_YUV101010: \
 1094                     TRANSFER_FRAME_HEAD \
 1095                     transfer_YUV161616_to_YUV101010((output), (uint16_t*)(input));   \
 1096                     TRANSFER_FRAME_TAIL \
 1097                     break; \
 1098                 case BC_YUVA8888: \
 1099                     TRANSFER_FRAME_HEAD \
 1100                     transfer_YUV161616_to_YUVA8888((output), \
 1101                         (uint16_t*)(input));   \
 1102                     TRANSFER_FRAME_TAIL \
 1103                     break; \
 1104                 case BC_VYU888: \
 1105                     TRANSFER_FRAME_HEAD \
 1106                     transfer_YUV161616_to_VYU888((output), (uint16_t*)(input));   \
 1107                     TRANSFER_FRAME_TAIL \
 1108                     break; \
 1109                 case BC_UYVA8888: \
 1110                     TRANSFER_FRAME_HEAD \
 1111                     transfer_YUV161616_to_UYVA8888((output), (uint16_t*)(input));   \
 1112                     TRANSFER_FRAME_TAIL \
 1113                     break; \
 1114                 case BC_YUV161616: \
 1115                     TRANSFER_FRAME_HEAD \
 1116                     transfer_YUV161616_to_YUV161616((uint16_t**)(output), \
 1117                         (uint16_t*)(input));   \
 1118                     TRANSFER_FRAME_TAIL \
 1119                     break; \
 1120             } \
 1121             break; \
 1122  \
 1123         case BC_YUVA16161616: \
 1124             switch(out_colormodel) \
 1125             { \
 1126                 case BC_RGB8: \
 1127                     TRANSFER_FRAME_HEAD \
 1128                     transfer_YUVA16161616_to_RGB8((output), (uint16_t*)(input));      \
 1129                     TRANSFER_FRAME_TAIL \
 1130                     break; \
 1131                 case BC_BGR565: \
 1132                     TRANSFER_FRAME_HEAD \
 1133                     transfer_YUVA16161616_to_BGR565((output), (uint16_t*)(input));    \
 1134                     TRANSFER_FRAME_TAIL \
 1135                     break; \
 1136                 case BC_RGB565: \
 1137                     TRANSFER_FRAME_HEAD \
 1138                     transfer_YUVA16161616_to_RGB565((output), (uint16_t*)(input));    \
 1139                     TRANSFER_FRAME_TAIL \
 1140                     break; \
 1141                 case BC_BGR888: \
 1142                     TRANSFER_FRAME_HEAD \
 1143                     transfer_YUVA16161616_to_BGR888((output), (uint16_t*)(input));    \
 1144                     TRANSFER_FRAME_TAIL \
 1145                     break; \
 1146                 case BC_BGR8888: \
 1147                     TRANSFER_FRAME_HEAD \
 1148                     transfer_YUVA16161616_to_BGR8888((output), (uint16_t*)(input));   \
 1149                     TRANSFER_FRAME_TAIL \
 1150                     break; \
 1151                 case BC_RGB888: \
 1152                     TRANSFER_FRAME_HEAD \
 1153                     transfer_YUVA16161616_to_RGB888((output), (uint16_t*)(input));    \
 1154                     TRANSFER_FRAME_TAIL \
 1155                     break; \
 1156                 case BC_RGBA8888: \
 1157                     TRANSFER_FRAME_HEAD \
 1158                     transfer_YUVA16161616_to_RGBA8888((output), (uint16_t*)(input));   \
 1159                     TRANSFER_FRAME_TAIL \
 1160                     break; \
 1161                 case BC_ARGB8888: \
 1162                     TRANSFER_FRAME_HEAD \
 1163                     transfer_YUVA16161616_to_ARGB8888((output), (uint16_t*)(input));   \
 1164                     TRANSFER_FRAME_TAIL \
 1165                     break; \
 1166                 case BC_RGB_FLOAT: \
 1167                     TRANSFER_FRAME_HEAD \
 1168                     transfer_YUVA16161616_to_RGB_FLOAT((float**)(output), (uint16_t*)(input));    \
 1169                     TRANSFER_FRAME_TAIL \
 1170                     break; \
 1171                 case BC_RGBA_FLOAT: \
 1172                     TRANSFER_FRAME_HEAD \
 1173                     transfer_YUVA16161616_to_RGBA_FLOAT((float**)(output), (uint16_t*)(input));   \
 1174                     TRANSFER_FRAME_TAIL \
 1175                     break; \
 1176                 case BC_YUV101010: \
 1177                     TRANSFER_FRAME_HEAD \
 1178                     transfer_YUVA16161616_to_YUV101010((output), (uint16_t*)(input));   \
 1179                     TRANSFER_FRAME_TAIL \
 1180                     break; \
 1181                 case BC_VYU888: \
 1182                     TRANSFER_FRAME_HEAD \
 1183                     transfer_YUVA16161616_to_VYU888((output), (uint16_t*)(input));   \
 1184                     TRANSFER_FRAME_TAIL \
 1185                     break; \
 1186                 case BC_UYVA8888: \
 1187                     TRANSFER_FRAME_HEAD \
 1188                     transfer_YUVA16161616_to_UYVA8888((output), (uint16_t*)(input));   \
 1189                     TRANSFER_FRAME_TAIL \
 1190                     break; \
 1191                 case BC_YUVA16161616: \
 1192                     TRANSFER_FRAME_HEAD \
 1193                     transfer_YUVA16161616_to_YUVA16161616((uint16_t**)(output), (uint16_t*)(input));   \
 1194                     TRANSFER_FRAME_TAIL \
 1195                     break; \
 1196                 case BC_YUV420P: \
 1197                     TRANSFER_YUV420P_OUT_HEAD \
 1198                     transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \
 1199                         output_u, \
 1200                         output_v, \
 1201                         (uint16_t*)(input), \
 1202                         j); \
 1203                     TRANSFER_FRAME_TAIL \
 1204                     break; \
 1205                 case BC_YUV422P: \
 1206                     TRANSFER_YUV422P_OUT_HEAD \
 1207                     transfer_YUVA16161616_to_YUV420P_YUV422P(output_y, \
 1208                         output_u, \
 1209                         output_v, \
 1210                         (uint16_t*)(input), \
 1211                         j); \
 1212                     TRANSFER_FRAME_TAIL \
 1213                     break; \
 1214                 case BC_YUV444P: \
 1215                     TRANSFER_YUV444P_OUT_HEAD \
 1216                     transfer_YUVA16161616_to_YUV444P(output_y, \
 1217                         output_u, \
 1218                         output_v, \
 1219                         (uint16_t*)(input), \
 1220                         j); \
 1221                     TRANSFER_FRAME_TAIL \
 1222                     break; \
 1223                 case BC_YUV422: \
 1224                     TRANSFER_FRAME_HEAD \
 1225                     transfer_YUVA16161616_to_YUV422((output), \
 1226                         (uint16_t*)(input), \
 1227                         j); \
 1228                     TRANSFER_FRAME_TAIL \
 1229                     break; \
 1230             } \
 1231             break; \
 1232  \
 1233         case BC_YUV101010: \
 1234             switch(out_colormodel) \
 1235             { \
 1236                 case BC_RGB8: \
 1237                     TRANSFER_FRAME_HEAD \
 1238                     transfer_YUV101010_to_RGB8((output), (input));      \
 1239                     TRANSFER_FRAME_TAIL \
 1240                     break; \
 1241                 case BC_BGR565: \
 1242                     TRANSFER_FRAME_HEAD \
 1243                     transfer_YUV101010_to_BGR565((output), (input));    \
 1244                     TRANSFER_FRAME_TAIL \
 1245                     break; \
 1246                 case BC_RGB565: \
 1247                     TRANSFER_FRAME_HEAD \
 1248                     transfer_YUV101010_to_RGB565((output), (input));    \
 1249                     TRANSFER_FRAME_TAIL \
 1250                     break; \
 1251                 case BC_BGR888: \
 1252                     TRANSFER_FRAME_HEAD \
 1253                     transfer_YUV101010_to_BGR888((output), (input));    \
 1254                     TRANSFER_FRAME_TAIL \
 1255                     break; \
 1256                 case BC_BGR8888: \
 1257                     TRANSFER_FRAME_HEAD \
 1258                     transfer_YUV101010_to_BGR8888((output), (input));   \
 1259                     TRANSFER_FRAME_TAIL \
 1260                     break; \
 1261                 case BC_RGB888: \
 1262                     TRANSFER_FRAME_HEAD \
 1263                     transfer_YUV101010_to_RGB888((output), (input));   \
 1264                     TRANSFER_FRAME_TAIL \
 1265                     break; \
 1266                 case BC_RGBA8888: \
 1267                     TRANSFER_FRAME_HEAD \
 1268                     transfer_YUV101010_to_RGBA8888((output), (input));   \
 1269                     TRANSFER_FRAME_TAIL \
 1270                     break; \
 1271                 case BC_YUV888: \
 1272                     TRANSFER_FRAME_HEAD \
 1273                     transfer_YUV101010_to_YUV888((output), (input));   \
 1274                     TRANSFER_FRAME_TAIL \
 1275                     break; \
 1276                 case BC_YUVA8888: \
 1277                     TRANSFER_FRAME_HEAD \
 1278                     transfer_YUV101010_to_YUVA8888((output), (input));   \
 1279                     TRANSFER_FRAME_TAIL \
 1280                     break; \
 1281                 case BC_RGB161616: \
 1282                     TRANSFER_FRAME_HEAD \
 1283                     transfer_YUV101010_to_RGB161616((uint16_t**)(output), (input));   \
 1284                     TRANSFER_FRAME_TAIL \
 1285                     break; \
 1286                 case BC_RGBA16161616: \
 1287                     TRANSFER_FRAME_HEAD \
 1288                     transfer_YUV101010_to_RGBA16161616((uint16_t**)(output), (input));   \
 1289                     TRANSFER_FRAME_TAIL \
 1290                     break; \
 1291                 case BC_RGB_FLOAT: \
 1292                     TRANSFER_FRAME_HEAD \
 1293                     transfer_YUV101010_to_RGB_FLOAT((float**)(output), (input));   \
 1294                     TRANSFER_FRAME_TAIL \
 1295                     break; \
 1296                 case BC_RGBA_FLOAT: \
 1297                     TRANSFER_FRAME_HEAD \
 1298                     transfer_YUV101010_to_RGBA_FLOAT((float**)(output), (input));   \
 1299                     TRANSFER_FRAME_TAIL \
 1300                     break; \
 1301                 case BC_YUV161616: \
 1302                     TRANSFER_FRAME_HEAD \
 1303                     transfer_YUV101010_to_YUV161616((uint16_t**)(output), (input));   \
 1304                     TRANSFER_FRAME_TAIL \
 1305                     break; \
 1306                 case BC_YUVA16161616: \
 1307                     TRANSFER_FRAME_HEAD \
 1308                     transfer_YUV101010_to_YUVA16161616((uint16_t**)(output), (input));   \
 1309                     TRANSFER_FRAME_TAIL \
 1310                     break; \
 1311             } \
 1312             break; \
 1313  \
 1314         case BC_VYU888: \
 1315             switch(out_colormodel) \
 1316             { \
 1317                 case BC_RGB8: \
 1318                     TRANSFER_FRAME_HEAD \
 1319                     transfer_VYU888_to_RGB8((output), (input));      \
 1320                     TRANSFER_FRAME_TAIL \
 1321                     break; \
 1322                 case BC_BGR565: \
 1323                     TRANSFER_FRAME_HEAD \
 1324                     transfer_VYU888_to_BGR565((output), (input));    \
 1325                     TRANSFER_FRAME_TAIL \
 1326                     break; \
 1327                 case BC_RGB565: \
 1328                     TRANSFER_FRAME_HEAD \
 1329                     transfer_VYU888_to_RGB565((output), (input));    \
 1330                     TRANSFER_FRAME_TAIL \
 1331                     break; \
 1332                 case BC_BGR888: \
 1333                     TRANSFER_FRAME_HEAD \
 1334                     transfer_VYU888_to_BGR888((output), (input));    \
 1335                     TRANSFER_FRAME_TAIL \
 1336                     break; \
 1337                 case BC_BGR8888: \
 1338                     TRANSFER_FRAME_HEAD \
 1339                     transfer_VYU888_to_BGR8888((output), (input));   \
 1340                     TRANSFER_FRAME_TAIL \
 1341                     break; \
 1342                 case BC_RGB888: \
 1343                     TRANSFER_FRAME_HEAD \
 1344                     transfer_VYU888_to_RGB888((output), (input));   \
 1345                     TRANSFER_FRAME_TAIL \
 1346                     break; \
 1347                 case BC_RGBA8888: \
 1348                     TRANSFER_FRAME_HEAD \
 1349                     transfer_VYU888_to_RGBA8888((output), (input));   \
 1350                     TRANSFER_FRAME_TAIL \
 1351                     break; \
 1352                 case BC_YUV888: \
 1353                     TRANSFER_FRAME_HEAD \
 1354                     transfer_VYU888_to_YUV888((output), (input));   \
 1355                     TRANSFER_FRAME_TAIL \
 1356                     break; \
 1357                 case BC_YUVA8888: \
 1358                     TRANSFER_FRAME_HEAD \
 1359                     transfer_VYU888_to_YUVA8888((output), (input));   \
 1360                     TRANSFER_FRAME_TAIL \
 1361                     break; \
 1362                 case BC_RGB161616: \
 1363                     TRANSFER_FRAME_HEAD \
 1364                     transfer_VYU888_to_RGB161616((uint16_t**)(output), (input));   \
 1365                     TRANSFER_FRAME_TAIL \
 1366                     break; \
 1367                 case BC_RGBA16161616: \
 1368                     TRANSFER_FRAME_HEAD \
 1369                     transfer_VYU888_to_RGBA16161616((uint16_t**)(output), (input));   \
 1370                     TRANSFER_FRAME_TAIL \
 1371                     break; \
 1372                 case BC_RGB_FLOAT: \
 1373                     TRANSFER_FRAME_HEAD \
 1374                     transfer_VYU888_to_RGB_FLOAT((float**)(output), (input));   \
 1375                     TRANSFER_FRAME_TAIL \
 1376                     break; \
 1377                 case BC_RGBA_FLOAT: \
 1378                     TRANSFER_FRAME_HEAD \
 1379                     transfer_VYU888_to_RGBA_FLOAT((float**)(output), (input));   \
 1380                     TRANSFER_FRAME_TAIL \
 1381                     break; \
 1382                 case BC_YUV161616: \
 1383                     TRANSFER_FRAME_HEAD \
 1384                     transfer_VYU888_to_YUV161616((uint16_t**)(output), (input));   \
 1385                     TRANSFER_FRAME_TAIL \
 1386                     break; \
 1387                 case BC_YUVA16161616: \
 1388                     TRANSFER_FRAME_HEAD \
 1389                     transfer_VYU888_to_YUVA16161616((uint16_t**)(output), (input));   \
 1390                     TRANSFER_FRAME_TAIL \
 1391                     break; \
 1392             } \
 1393             break; \
 1394  \
 1395         case BC_UYVA8888: \
 1396             switch(out_colormodel) \
 1397             { \
 1398                 case BC_RGB8: \
 1399                     TRANSFER_FRAME_HEAD \
 1400                     transfer_UYVA8888_to_RGB8((output), (input));      \
 1401                     TRANSFER_FRAME_TAIL \
 1402                     break; \
 1403                 case BC_BGR565: \
 1404                     TRANSFER_FRAME_HEAD \
 1405                     transfer_UYVA8888_to_BGR565((output), (input));    \
 1406                     TRANSFER_FRAME_TAIL \
 1407                     break; \
 1408                 case BC_RGB565: \
 1409                     TRANSFER_FRAME_HEAD \
 1410                     transfer_UYVA8888_to_RGB565((output), (input));    \
 1411                     TRANSFER_FRAME_TAIL \
 1412                     break; \
 1413                 case BC_BGR888: \
 1414                     TRANSFER_FRAME_HEAD \
 1415                     transfer_UYVA8888_to_BGR888((output), (input));    \
 1416                     TRANSFER_FRAME_TAIL \
 1417                     break; \
 1418                 case BC_BGR8888: \
 1419                     TRANSFER_FRAME_HEAD \
 1420                     transfer_UYVA8888_to_BGR8888((output), (input));   \
 1421                     TRANSFER_FRAME_TAIL \
 1422                     break; \
 1423                 case BC_RGB888: \
 1424                     TRANSFER_FRAME_HEAD \
 1425                     transfer_UYVA8888_to_RGB888((output), (input));   \
 1426                     TRANSFER_FRAME_TAIL \
 1427                     break; \
 1428                 case BC_RGBA8888: \
 1429                     TRANSFER_FRAME_HEAD \
 1430                     transfer_UYVA8888_to_RGBA8888((output), (input));   \
 1431                     TRANSFER_FRAME_TAIL \
 1432                     break; \
 1433                 case BC_YUV888: \
 1434                     TRANSFER_FRAME_HEAD \
 1435                     transfer_UYVA8888_to_YUV888((output), (input));   \
 1436                     TRANSFER_FRAME_TAIL \
 1437                     break; \
 1438                 case BC_YUVA8888: \
 1439                     TRANSFER_FRAME_HEAD \
 1440                     transfer_UYVA8888_to_YUVA8888((output), (input));   \
 1441                     TRANSFER_FRAME_TAIL \
 1442                     break; \
 1443                 case BC_RGB161616: \
 1444                     TRANSFER_FRAME_HEAD \
 1445                     transfer_UYVA8888_to_RGB161616((uint16_t**)(output), (input));   \
 1446                     TRANSFER_FRAME_TAIL \
 1447                     break; \
 1448                 case BC_RGBA16161616: \
 1449                     TRANSFER_FRAME_HEAD \
 1450                     transfer_UYVA8888_to_RGBA16161616((uint16_t**)(output), (input));   \
 1451                     TRANSFER_FRAME_TAIL \
 1452                     break; \
 1453                 case BC_RGB_FLOAT: \
 1454                     TRANSFER_FRAME_HEAD \
 1455                     transfer_UYVA8888_to_RGB_FLOAT((float**)(output), (input));   \
 1456                     TRANSFER_FRAME_TAIL \
 1457                     break; \
 1458                 case BC_RGBA_FLOAT: \
 1459                     TRANSFER_FRAME_HEAD \
 1460                     transfer_UYVA8888_to_RGBA_FLOAT((float**)(output), (input));   \
 1461                     TRANSFER_FRAME_TAIL \
 1462                     break; \
 1463                 case BC_YUV161616: \
 1464                     TRANSFER_FRAME_HEAD \
 1465                     transfer_UYVA8888_to_YUV161616((uint16_t**)(output), (input));   \
 1466                     TRANSFER_FRAME_TAIL \
 1467                     break; \
 1468                 case BC_YUVA16161616: \
 1469                     TRANSFER_FRAME_HEAD \
 1470                     transfer_UYVA8888_to_YUVA16161616((uint16_t**)(output), (input));   \
 1471                     TRANSFER_FRAME_TAIL \
 1472                     break; \
 1473             } \
 1474             break; \
 1475  \
 1476         case BC_ARGB8888: \
 1477         case BC_ABGR8888: \
 1478             switch(out_colormodel) \
 1479             { \
 1480                 case BC_ARGB8888: \
 1481                 case BC_ABGR8888: \
 1482                     TRANSFER_FRAME_HEAD \
 1483                     transfer_ARGB8888_to_ARGB8888((output), (input)); \
 1484                     TRANSFER_FRAME_TAIL \
 1485                     break; \
 1486                 case BC_RGBA8888: \
 1487                     TRANSFER_FRAME_HEAD \
 1488                     transfer_ARGB8888_to_RGBA8888((output), (input)); \
 1489                     TRANSFER_FRAME_TAIL \
 1490                     break; \
 1491                 case BC_RGB888: \
 1492                     TRANSFER_FRAME_HEAD \
 1493                     transfer_ARGB8888_to_RGB888((output), (input)); \
 1494                     TRANSFER_FRAME_TAIL \
 1495                     break; \
 1496                 case BC_BGR8888: \
 1497                     TRANSFER_FRAME_HEAD \
 1498                     transfer_ARGB8888_to_BGR8888((output), (input)); \
 1499                     TRANSFER_FRAME_TAIL \
 1500                     break; \
 1501             } \
 1502             break; \
 1503  \
 1504         case BC_RGB888: \
 1505             switch(out_colormodel) \
 1506             { \
 1507                 case BC_RGB8: \
 1508                     TRANSFER_FRAME_HEAD \
 1509                     transfer_RGB888_to_RGB8((output), (input));      \
 1510                     TRANSFER_FRAME_TAIL \
 1511                     break; \
 1512                 case BC_BGR565: \
 1513                     TRANSFER_FRAME_HEAD \
 1514                     transfer_RGB888_to_BGR565((output), (input));    \
 1515                     TRANSFER_FRAME_TAIL \
 1516                     break; \
 1517                 case BC_RGB565: \
 1518                     TRANSFER_FRAME_HEAD \
 1519                     transfer_RGB888_to_RGB565((output), (input));    \
 1520                     TRANSFER_FRAME_TAIL \
 1521                     break; \
 1522                 case BC_BGR888: \
 1523                     TRANSFER_FRAME_HEAD \
 1524                     transfer_RGB888_to_BGR888((output), (input));    \
 1525                     TRANSFER_FRAME_TAIL \
 1526                     break; \
 1527                 case BC_RGB888: \
 1528                     TRANSFER_FRAME_HEAD \
 1529                     transfer_RGB888_to_RGB888((output), (input));    \
 1530                     TRANSFER_FRAME_TAIL \
 1531                     break; \
 1532                 case BC_RGBA8888: \
 1533                     TRANSFER_FRAME_HEAD \
 1534                     transfer_RGB888_to_RGBA8888((output), (input));    \
 1535                     TRANSFER_FRAME_TAIL \
 1536                     break; \
 1537                 case BC_ARGB8888: \
 1538                     TRANSFER_FRAME_HEAD \
 1539                     transfer_RGB888_to_ARGB8888((output), (input));    \
 1540                     TRANSFER_FRAME_TAIL \
 1541                     break; \
 1542                 case BC_RGB161616: \
 1543                     TRANSFER_FRAME_HEAD \
 1544                     transfer_RGB888_to_RGB161616((uint16_t**)(output), (input));    \
 1545                     TRANSFER_FRAME_TAIL \
 1546                     break; \
 1547                 case BC_RGBA16161616: \
 1548                     TRANSFER_FRAME_HEAD \
 1549                     transfer_RGB888_to_RGBA16161616((uint16_t**)(output), (input));    \
 1550                     TRANSFER_FRAME_TAIL \
 1551                     break; \
 1552                 case BC_RGB_FLOAT: \
 1553                     TRANSFER_FRAME_HEAD \
 1554                     transfer_RGB888_to_RGB_FLOAT((float**)(output), (input));    \
 1555                     TRANSFER_FRAME_TAIL \
 1556                     break; \
 1557                 case BC_RGBA_FLOAT: \
 1558                     TRANSFER_FRAME_HEAD \
 1559                     transfer_RGB888_to_RGBA_FLOAT((float**)(output), (input));    \
 1560                     TRANSFER_FRAME_TAIL \
 1561                     break; \
 1562                 case BC_ABGR8888: \
 1563                     TRANSFER_FRAME_HEAD \
 1564                     transfer_RGB888_to_ABGR8888((output), (input));    \
 1565                     TRANSFER_FRAME_TAIL \
 1566                     break; \
 1567                 case BC_BGR8888: \
 1568                     TRANSFER_FRAME_HEAD \
 1569                     transfer_RGB888_to_BGR8888((output), (input));   \
 1570                     TRANSFER_FRAME_TAIL \
 1571                     break; \
 1572                 case BC_YUV888: \
 1573                     TRANSFER_FRAME_HEAD \
 1574                     transfer_RGB888_to_YUV888((output), (input));   \
 1575                     TRANSFER_FRAME_TAIL \
 1576                     break; \
 1577                 case BC_YUVA8888: \
 1578                     TRANSFER_FRAME_HEAD \
 1579                     transfer_RGB888_to_YUVA8888((output), (input));   \
 1580                     TRANSFER_FRAME_TAIL \
 1581                     break; \
 1582                 case BC_YUV161616: \
 1583                     TRANSFER_FRAME_HEAD \
 1584                     transfer_RGB888_to_YUV161616((uint16_t**)(output), (input));   \
 1585                     TRANSFER_FRAME_TAIL \
 1586                     break; \
 1587                 case BC_YUVA16161616: \
 1588                     TRANSFER_FRAME_HEAD \
 1589                     transfer_RGB888_to_YUVA16161616((uint16_t**)(output), (input));   \
 1590                     TRANSFER_FRAME_TAIL \
 1591                     break; \
 1592                 case BC_YUV101010: \
 1593                     TRANSFER_FRAME_HEAD \
 1594                     transfer_RGB888_to_YUV101010((output), (input));   \
 1595                     TRANSFER_FRAME_TAIL \
 1596                     break; \
 1597                 case BC_YUV420P: \
 1598                     TRANSFER_YUV420P_OUT_HEAD \
 1599                     transfer_RGB888_to_YUV420P_YUV422P(output_y, \
 1600                         output_u, \
 1601                         output_v, \
 1602                         (input), \
 1603                         j); \
 1604                     TRANSFER_FRAME_TAIL \
 1605                     break; \
 1606                 case BC_YUV422: \
 1607                     TRANSFER_FRAME_HEAD \
 1608                     transfer_RGB888_to_YUV422((output), (input), j); \
 1609                     TRANSFER_FRAME_TAIL \
 1610                     break; \
 1611                 case BC_YUV422P: \
 1612                     TRANSFER_YUV422P_OUT_HEAD \
 1613                     transfer_RGB888_to_YUV420P_YUV422P(output_y, \
 1614                         output_u, \
 1615                         output_v, \
 1616                         (input), \
 1617                         j); \
 1618                     TRANSFER_FRAME_TAIL \
 1619                     break; \
 1620                 case BC_YUV444P: \
 1621                     TRANSFER_YUV444P_OUT_HEAD \
 1622                     transfer_RGB888_to_YUV444P(output_y, \
 1623                         output_u, \
 1624                         output_v, \
 1625                         (input), \
 1626                         j); \
 1627                     TRANSFER_FRAME_TAIL \
 1628                     break; \
 1629             } \
 1630             break; \
 1631  \
 1632         case BC_RGBA8888: \
 1633             switch(out_colormodel) \
 1634             { \
 1635                 case BC_TRANSPARENCY: \
 1636                     TRANSFER_FRAME_HEAD \
 1637                     transfer_RGBA8888_to_TRANSPARENCY((output), (input), &bit_counter); \
 1638                     TRANSFER_FRAME_TAIL \
 1639                     break; \
 1640                 case BC_RGB8: \
 1641                     if(bg_color > 0) \
 1642                         TRANSFER_FRAME_HEAD \
 1643                         transfer_RGBA8888_to_RGB8bg((output), (input), bg_r, bg_g, bg_b); \
 1644                         TRANSFER_FRAME_TAIL \
 1645                     else \
 1646                         TRANSFER_FRAME_HEAD \
 1647                         transfer_RGBA8888_to_RGB8((output), (input)); \
 1648                         TRANSFER_FRAME_TAIL \
 1649                     break; \
 1650                 case BC_BGR565: \
 1651                     if(bg_color > 0) \
 1652                         TRANSFER_FRAME_HEAD \
 1653                         transfer_RGBA8888_to_BGR565bg((output), (input), bg_r, bg_g, bg_b); \
 1654                         TRANSFER_FRAME_TAIL \
 1655                     else \
 1656                         TRANSFER_FRAME_HEAD \
 1657                         transfer_RGBA8888_to_BGR565((output), (input)); \
 1658                         TRANSFER_FRAME_TAIL \
 1659                     break; \
 1660                 case BC_RGB565: \
 1661                     if(bg_color > 0) \
 1662                         TRANSFER_FRAME_HEAD \
 1663                         transfer_RGBA8888_to_RGB565bg((output), (input), bg_r, bg_g, bg_b); \
 1664                         TRANSFER_FRAME_TAIL \
 1665                     else \
 1666                         TRANSFER_FRAME_HEAD \
 1667                         transfer_RGBA8888_to_RGB565((output), (input)); \
 1668                         TRANSFER_FRAME_TAIL \
 1669                     break; \
 1670                 case BC_BGR888: \
 1671                     if(bg_color > 0) \
 1672                         TRANSFER_FRAME_HEAD \
 1673                         transfer_RGBA8888_to_BGR888bg((output), (input), bg_r, bg_g, bg_b); \
 1674                         TRANSFER_FRAME_TAIL \
 1675                     else \
 1676                         TRANSFER_FRAME_HEAD \
 1677                         transfer_RGBA8888_to_BGR888((output), (input)); \
 1678                         TRANSFER_FRAME_TAIL \
 1679                     break; \
 1680                 case BC_RGB888: \
 1681                     if(bg_color > 0) \
 1682                         TRANSFER_FRAME_HEAD \
 1683                         transfer_RGBA8888_to_RGB888bg((output), (input), bg_r, bg_g, bg_b); \
 1684                         TRANSFER_FRAME_TAIL \
 1685                     else \
 1686                         TRANSFER_FRAME_HEAD \
 1687                         transfer_RGBA8888_to_RGB888((output), (input)); \
 1688                         TRANSFER_FRAME_TAIL \
 1689                     break; \
 1690                 case BC_RGBA8888: \
 1691                     TRANSFER_FRAME_HEAD \
 1692                     transfer_RGBA8888_to_RGBA8888((output), (input)); \
 1693                     TRANSFER_FRAME_TAIL \
 1694                     break; \
 1695                 case BC_ARGB8888: \
 1696                     TRANSFER_FRAME_HEAD \
 1697                     transfer_RGBA8888_to_ARGB8888((output), (input)); \
 1698                     TRANSFER_FRAME_TAIL \
 1699                     break; \
 1700                 case BC_RGB161616: \
 1701                     TRANSFER_FRAME_HEAD \
 1702                     transfer_RGBA8888_to_RGB161616((uint16_t**)(output), (input)); \
 1703                     TRANSFER_FRAME_TAIL \
 1704                     break; \
 1705                 case BC_RGBA16161616: \
 1706                     TRANSFER_FRAME_HEAD \
 1707                     transfer_RGBA8888_to_RGBA16161616((uint16_t**)(output), (input)); \
 1708                     TRANSFER_FRAME_TAIL \
 1709                     break; \
 1710                 case BC_RGB_FLOAT: \
 1711                     TRANSFER_FRAME_HEAD \
 1712                     transfer_RGBA8888_to_RGB_FLOAT((float**)(output), (input)); \
 1713                     TRANSFER_FRAME_TAIL \
 1714                     break; \
 1715                 case BC_RGBA_FLOAT: \
 1716                     TRANSFER_FRAME_HEAD \
 1717                     transfer_RGBA8888_to_RGBA_FLOAT((float**)(output), (input)); \
 1718                     TRANSFER_FRAME_TAIL \
 1719                     break; \
 1720                 case BC_BGR8888: \
 1721                     if(bg_color > 0) \
 1722                         TRANSFER_FRAME_HEAD \
 1723                         transfer_RGBA8888_to_BGR8888bg((output), (input), bg_r, bg_g, bg_b); \
 1724                         TRANSFER_FRAME_TAIL \
 1725                     else \
 1726                         TRANSFER_FRAME_HEAD \
 1727                         transfer_RGBA8888_to_BGR8888((output), (input)); \
 1728                         TRANSFER_FRAME_TAIL \
 1729                     break; \
 1730                 case BC_YUV888: \
 1731                     TRANSFER_FRAME_HEAD \
 1732                     transfer_RGBA8888_to_YUV888((output), (input)); \
 1733                     TRANSFER_FRAME_TAIL \
 1734                     break; \
 1735                 case BC_YUVA8888: \
 1736                     TRANSFER_FRAME_HEAD \
 1737                     transfer_RGBA8888_to_YUVA8888((output), (input)); \
 1738                     TRANSFER_FRAME_TAIL \
 1739                     break; \
 1740                 case BC_YUV161616: \
 1741                     TRANSFER_FRAME_HEAD \
 1742                     transfer_RGBA8888_to_YUV161616((uint16_t**)(output), (input)); \
 1743                     TRANSFER_FRAME_TAIL \
 1744                     break; \
 1745                 case BC_YUVA16161616: \
 1746                     TRANSFER_FRAME_HEAD \
 1747                     transfer_RGBA8888_to_YUVA16161616((uint16_t**)(output), (input)); \
 1748                     TRANSFER_FRAME_TAIL \
 1749                     break; \
 1750                 case BC_YUV101010: \
 1751                     TRANSFER_FRAME_HEAD \
 1752                     transfer_RGBA8888_to_YUV101010((output), (input)); \
 1753                     TRANSFER_FRAME_TAIL \
 1754                     break; \
 1755                 case BC_YUV420P: \
 1756                     TRANSFER_YUV420P_OUT_HEAD \
 1757                     transfer_RGBA888_to_YUV420P_YUV422P(output_y, \
 1758                         output_u, \
 1759                         output_v, \
 1760                         (input), \
 1761                         j); \
 1762                     TRANSFER_FRAME_TAIL \
 1763                     break; \
 1764                 case BC_YUV422: \
 1765                     TRANSFER_FRAME_HEAD \
 1766                     transfer_RGBA888_to_YUV422((output), (input), j); \
 1767                     TRANSFER_FRAME_TAIL \
 1768                     break; \
 1769                 case BC_YUV422P: \
 1770                     TRANSFER_YUV422P_OUT_HEAD \
 1771                     transfer_RGBA888_to_YUV420P_YUV422P(output_y, \
 1772                         output_u, \
 1773                         output_v, \
 1774                         (input), \
 1775                         j); \
 1776                     TRANSFER_FRAME_TAIL \
 1777                     break; \
 1778                 case BC_YUV444P: \
 1779                     TRANSFER_YUV444P_OUT_HEAD \
 1780                     transfer_RGBA888_to_YUV444P(output_y, \
 1781                         output_u, \
 1782                         output_v, \
 1783                         (input), \
 1784                         j); \
 1785                     TRANSFER_FRAME_TAIL \
 1786                     break; \
 1787             } \
 1788             break; \
 1789  \
 1790         case BC_RGB161616: \
 1791             switch(out_colormodel) \
 1792             { \
 1793                 case BC_RGB8: \
 1794                     TRANSFER_FRAME_HEAD \
 1795                     transfer_RGB161616_to_RGB8((output), (uint16_t*)(input));      \
 1796                     TRANSFER_FRAME_TAIL \
 1797                     break; \
 1798                 case BC_BGR565: \
 1799                     TRANSFER_FRAME_HEAD \
 1800                     transfer_RGB161616_to_BGR565((output), (uint16_t*)(input));    \
 1801                     TRANSFER_FRAME_TAIL \
 1802                     break; \
 1803                 case BC_RGB565: \
 1804                     TRANSFER_FRAME_HEAD \
 1805                     transfer_RGB161616_to_RGB565((output), (uint16_t*)(input));    \
 1806                     TRANSFER_FRAME_TAIL \
 1807                     break; \
 1808                 case BC_BGR888: \
 1809                     TRANSFER_FRAME_HEAD \
 1810                     transfer_RGB161616_to_BGR888((output), (uint16_t*)(input));    \
 1811                     TRANSFER_FRAME_TAIL \
 1812                     break; \
 1813                 case BC_BGR8888: \
 1814                     TRANSFER_FRAME_HEAD \
 1815                     transfer_RGB161616_to_BGR8888((output), (uint16_t*)(input));   \
 1816                     TRANSFER_FRAME_TAIL \
 1817                     break; \
 1818                 case BC_RGB888: \
 1819                     TRANSFER_FRAME_HEAD \
 1820                     transfer_RGB161616_to_RGB888((output), (uint16_t*)(input));    \
 1821                     TRANSFER_FRAME_TAIL \
 1822                     break; \
 1823                 case BC_RGBA8888: \
 1824                     TRANSFER_FRAME_HEAD \
 1825                     transfer_RGB161616_to_RGBA8888((output), (uint16_t*)(input));    \
 1826                     TRANSFER_FRAME_TAIL \
 1827                     break; \
 1828                 case BC_YUV888: \
 1829                     TRANSFER_FRAME_HEAD \
 1830                     transfer_RGB161616_to_YUV888((output), (uint16_t*)(input));   \
 1831                     TRANSFER_FRAME_TAIL \
 1832                     break; \
 1833                 case BC_YUVA8888: \
 1834                     TRANSFER_FRAME_HEAD \
 1835                     transfer_RGB161616_to_YUVA8888((output), (uint16_t*)(input));   \
 1836                     TRANSFER_FRAME_TAIL \
 1837                     break; \
 1838                 case BC_YUV101010: \
 1839                     TRANSFER_FRAME_HEAD \
 1840                     transfer_RGB161616_to_YUV101010((output), (uint16_t*)(input));   \
 1841                     TRANSFER_FRAME_TAIL \
 1842                     break; \
 1843                 case BC_YUV420P: \
 1844                     TRANSFER_YUV420P_OUT_HEAD \
 1845                     transfer_RGB161616_to_YUV420P_YUV422P(output_y, \
 1846                         output_u, \
 1847                         output_v, \
 1848                         (uint16_t*)(input), \
 1849                         j); \
 1850                     TRANSFER_FRAME_TAIL \
 1851                     break; \
 1852                 case BC_YUV422P: \
 1853                     TRANSFER_YUV422P_OUT_HEAD \
 1854                     transfer_RGB161616_to_YUV420P_YUV422P(output_y, \
 1855                         output_u, \
 1856                         output_v, \
 1857                         (uint16_t*)(input), \
 1858                         j); \
 1859                     TRANSFER_FRAME_TAIL \
 1860                     break; \
 1861                 case BC_YUV444P: \
 1862                     TRANSFER_YUV444P_OUT_HEAD \
 1863                     transfer_RGB161616_to_YUV444P(output_y, \
 1864                         output_u, \
 1865                         output_v, \
 1866                         (uint16_t*)(input), \
 1867                         j); \
 1868                     TRANSFER_FRAME_TAIL \
 1869                     break; \
 1870             } \
 1871             break; \
 1872  \
 1873         case BC_RGBA16161616: \
 1874             switch(out_colormodel) \
 1875             { \
 1876                 case BC_RGB8: \
 1877                     TRANSFER_FRAME_HEAD \
 1878                     transfer_RGBA16161616_to_RGB8((output), (uint16_t*)(input)); \
 1879                     TRANSFER_FRAME_TAIL \
 1880                     break; \
 1881                 case BC_BGR565: \
 1882                     TRANSFER_FRAME_HEAD \
 1883                     transfer_RGBA16161616_to_BGR565((output), (uint16_t*)(input)); \
 1884                     TRANSFER_FRAME_TAIL \
 1885                     break; \
 1886                 case BC_RGB565: \
 1887                     TRANSFER_FRAME_HEAD \
 1888                     transfer_RGBA16161616_to_RGB565((output), (uint16_t*)(input)); \
 1889                     TRANSFER_FRAME_TAIL \
 1890                     break; \
 1891                 case BC_BGR888:      \
 1892                     TRANSFER_FRAME_HEAD \
 1893                     transfer_RGBA16161616_to_BGR888((output), (uint16_t*)(input)); \
 1894                     TRANSFER_FRAME_TAIL \
 1895                 break; \
 1896                 case BC_BGR8888: \
 1897                     TRANSFER_FRAME_HEAD \
 1898                     transfer_RGBA16161616_to_BGR8888((output), (uint16_t*)(input)); \
 1899                     TRANSFER_FRAME_TAIL \
 1900                     break; \
 1901                 case BC_RGB888: \
 1902                     TRANSFER_FRAME_HEAD \
 1903                     transfer_RGBA16161616_to_RGB888((output), (uint16_t*)(input)); \
 1904                     TRANSFER_FRAME_TAIL \
 1905                     break; \
 1906                 case BC_RGBA8888: \
 1907                     TRANSFER_FRAME_HEAD \
 1908                     transfer_RGBA16161616_to_RGBA8888((output), (input)); \
 1909                     TRANSFER_FRAME_TAIL \
 1910                     break; \
 1911                 case BC_YUV101010: \
 1912                     TRANSFER_FRAME_HEAD \
 1913                     transfer_RGBA16161616_to_YUV101010((output), (uint16_t*)(input)); \
 1914                     TRANSFER_FRAME_TAIL \
 1915                     break; \
 1916                 case BC_YUV420P: \
 1917                     TRANSFER_YUV420P_OUT_HEAD \
 1918                     transfer_RGBA16161616_to_YUV420P_YUV422P(output_y, \
 1919                         output_u, \
 1920                         output_v, \
 1921                         (uint16_t*)(input), \
 1922                         j); \
 1923                     TRANSFER_FRAME_TAIL \
 1924                     break; \
 1925                 case BC_YUV422P: \
 1926                     TRANSFER_YUV422P_OUT_HEAD \
 1927                     transfer_RGBA16161616_to_YUV420P_YUV422P(output_y, \
 1928                         output_u, \
 1929                         output_v, \
 1930                         (uint16_t*)(input), \
 1931                         j); \
 1932                     TRANSFER_FRAME_TAIL \
 1933                     break; \
 1934                 case BC_YUV444P: \
 1935                     TRANSFER_YUV444P_OUT_HEAD \
 1936                     transfer_RGBA16161616_to_YUV444P(output_y, \
 1937                         output_u, \
 1938                         output_v, \
 1939                         (uint16_t*)(input), \
 1940                         j); \
 1941                     TRANSFER_FRAME_TAIL \
 1942                     break; \
 1943             } \
 1944             break; \
 1945  \
 1946         case BC_BGR8888: \
 1947             switch(out_colormodel) \
 1948             { \
 1949                 case BC_RGB888: \
 1950                     TRANSFER_FRAME_HEAD \
 1951                     transfer_BGR8888_to_RGB888((output), (input));    \
 1952                     TRANSFER_FRAME_TAIL \
 1953                     break; \
 1954                 case BC_BGR8888: \
 1955                     TRANSFER_FRAME_HEAD \
 1956                     transfer_BGR8888_to_BGR8888((output), (input));    \
 1957                     TRANSFER_FRAME_TAIL \
 1958                     break; \
 1959             } \
 1960             break; \
 1961  \
 1962         case BC_BGR888: \
 1963             switch(out_colormodel) \
 1964             { \
 1965                 case BC_RGB888: \
 1966                     TRANSFER_FRAME_HEAD \
 1967                     transfer_BGR888_to_RGB888((output), (input));    \
 1968                     TRANSFER_FRAME_TAIL \
 1969                     break; \
 1970             } \
 1971             break; \
 1972     } \
 1973 }
 1974 
 1975 
 1976 
 1977 
 1978 void cmodel_default(PERMUTATION_ARGS)
 1979 {
 1980     if(scale)
 1981     {
 1982         TRANSFER_FRAME_DEFAULT(&output_row, 
 1983             input_row + column_table[j] * in_pixelsize,
 1984             0,
 1985             0,
 1986             0,
 1987             0);
 1988     }
 1989     else
 1990     {
 1991         TRANSFER_FRAME_DEFAULT(&output_row, 
 1992             input_row + j * in_pixelsize,
 1993             0,
 1994             0,
 1995             0,
 1996             0);
 1997     }
 1998 }