00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "cmodel_permutation.h"
00021
00022
00023
00024
00025 static inline void transfer_YUV_PLANAR_to_RGB8(unsigned char *(*output),
00026 unsigned char *input_y,
00027 unsigned char *input_u,
00028 unsigned char *input_v)
00029 {
00030 int y, u, v, r, g, b;
00031
00032 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00033 u = *input_u;
00034 v = *input_v;
00035 YUV_TO_RGB(y, u, v, r, g, b)
00036
00037 *(*output) = (unsigned char)((r & 0xc0) +
00038 ((g & 0xe0) >> 2) +
00039 ((b & 0xe0) >> 5));
00040 (*output)++;
00041 }
00042
00043 static inline void transfer_YUV_PLANAR_to_BGR565(unsigned char *(*output),
00044 unsigned char *input_y,
00045 unsigned char *input_u,
00046 unsigned char *input_v)
00047 {
00048 int y, u, v;
00049 int r, g, b;
00050
00051 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00052 u = *input_u;
00053 v = *input_v;
00054 YUV_TO_RGB(y, u, v, r, g, b)
00055
00056 *(uint16_t*)(*output) = ((b & 0xf8) << 8)
00057 + ((g & 0xfc) << 3)
00058 + ((r & 0xf8) >> 3);
00059 (*output) += 2;
00060 }
00061
00062 static inline void transfer_YUV_PLANAR_to_RGB565(unsigned char *(*output),
00063 unsigned char *input_y,
00064 unsigned char *input_u,
00065 unsigned char *input_v)
00066 {
00067 int y, u, v;
00068 int r, g, b;
00069
00070 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00071 u = *input_u;
00072 v = *input_v;
00073 YUV_TO_RGB(y, u, v, r, g, b)
00074
00075 *(uint16_t*)(*output) = ((r & 0xf8) << 8)
00076 + ((g & 0xfc) << 3)
00077 + ((b & 0xf8) >> 3);
00078 (*output) += 2;
00079 }
00080
00081 static inline void transfer_YUV_PLANAR_to_BGR888(unsigned char *(*output),
00082 unsigned char *input_y,
00083 unsigned char *input_u,
00084 unsigned char *input_v)
00085 {
00086 int y, u, v;
00087 int r, g, b;
00088
00089 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00090 u = *input_u;
00091 v = *input_v;
00092 YUV_TO_RGB(y, u, v, r, g, b)
00093
00094 (*output)[0] = b;
00095 (*output)[1] = g;
00096 (*output)[2] = r;
00097 (*output) += 3;
00098 }
00099
00100 static inline void transfer_YUV_PLANAR_to_BGR8888(unsigned char *(*output),
00101 unsigned char *input_y,
00102 unsigned char *input_u,
00103 unsigned char *input_v)
00104 {
00105 int y, u, v;
00106 int r, g, b;
00107
00108 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00109 u = *input_u;
00110 v = *input_v;
00111 YUV_TO_RGB(y, u, v, r, g, b)
00112
00113 (*output)[0] = b;
00114 (*output)[1] = g;
00115 (*output)[2] = r;
00116 (*output) += 4;
00117 }
00118
00119 static inline void transfer_YUV_PLANAR_to_RGB888(unsigned char *(*output),
00120 unsigned char *input_y,
00121 unsigned char *input_u,
00122 unsigned char *input_v)
00123 {
00124
00125 int y, u, v, r, g, b;
00126
00127 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00128 u = *input_u;
00129 v = *input_v;
00130 YUV_TO_RGB(y, u, v, r, g, b)
00131
00132 (*output)[0] = r;
00133 (*output)[1] = g;
00134 (*output)[2] = b;
00135 (*output) += 3;
00136 }
00137
00138 static inline void transfer_YUV_PLANAR_to_ARGB8888(unsigned char *(*output),
00139 unsigned char *input_y,
00140 unsigned char *input_u,
00141 unsigned char *input_v)
00142 {
00143
00144 int y, u, v, r, g, b;
00145
00146 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00147 u = *input_u;
00148 v = *input_v;
00149 YUV_TO_RGB(y, u, v, r, g, b)
00150
00151 (*output)[0] = 0xff;
00152 (*output)[1] = r;
00153 (*output)[2] = g;
00154 (*output)[3] = b;
00155 (*output) += 4;
00156 }
00157
00158 static inline void transfer_YUV_PLANAR_to_ABGR8888(unsigned char *(*output),
00159 unsigned char *input_y,
00160 unsigned char *input_u,
00161 unsigned char *input_v)
00162 {
00163
00164 int y, u, v, r, g, b;
00165
00166 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00167 u = *input_u;
00168 v = *input_v;
00169 YUV_TO_RGB(y, u, v, r, g, b)
00170
00171 (*output)[0] = 0xff;
00172 (*output)[3] = r;
00173 (*output)[2] = g;
00174 (*output)[1] = b;
00175 (*output) += 4;
00176 }
00177
00178 static inline void transfer_YUV_PLANAR_to_RGBA8888(unsigned char *(*output),
00179 unsigned char *input_y,
00180 unsigned char *input_u,
00181 unsigned char *input_v)
00182 {
00183
00184 int y, u, v;
00185 int r, g, b;
00186
00187 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00188 u = *input_u;
00189 v = *input_v;
00190 YUV_TO_RGB(y, u, v, r, g, b)
00191
00192 (*output)[0] = r;
00193 (*output)[1] = g;
00194 (*output)[2] = b;
00195 (*output)[3] = 0xff;
00196 (*output) += 4;
00197 }
00198
00199 static inline void transfer_YUV_PLANAR_to_RGB161616(uint16_t *(*output),
00200 unsigned char *input_y,
00201 unsigned char *input_u,
00202 unsigned char *input_v)
00203 {
00204
00205 int y, u, v;
00206 int r, g, b;
00207 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00208 u = (*input_u << 8) | *input_u;
00209 v = (*input_v << 8) | *input_v;
00210 YUV_TO_RGB16(y, u, v, r, g, b)
00211 (*output)[0] = r;
00212 (*output)[1] = g;
00213 (*output)[2] = b;
00214
00215 (*output) += 3;
00216 }
00217
00218
00219 static inline void transfer_YUV_PLANAR_to_RGBA16161616(uint16_t *(*output),
00220 unsigned char *input_y,
00221 unsigned char *input_u,
00222 unsigned char *input_v)
00223 {
00224
00225 int y, u, v;
00226 int r, g, b;
00227 y = (*input_y << 16) | (*input_y << 8) | *input_y;
00228 u = (*input_u << 8) | *input_u;
00229 v = (*input_v << 8) | *input_v;
00230 YUV_TO_RGB16(y, u, v, r, g, b)
00231
00232 (*output)[0] = r;
00233 (*output)[1] = g;
00234 (*output)[2] = b;
00235 (*output)[3] = 0xffff;
00236
00237 (*output) += 4;
00238 }
00239
00240
00241 static inline void transfer_YUV_PLANAR_to_RGB_FLOAT(float* *output,
00242 unsigned char *input_y,
00243 unsigned char *input_u,
00244 unsigned char *input_v)
00245 {
00246
00247 float y = (float)*input_y / 0xff;
00248 int u, v;
00249 float r, g, b;
00250 u = *input_u;
00251 v = *input_v;
00252 YUV_TO_FLOAT(y, u, v, r, g, b)
00253
00254 *(*output)++ = r;
00255 *(*output)++ = g;
00256 *(*output)++ = b;
00257 }
00258
00259
00260 static inline void transfer_YUV_PLANAR_to_RGBA_FLOAT(float* *output,
00261 unsigned char *input_y,
00262 unsigned char *input_u,
00263 unsigned char *input_v)
00264 {
00265
00266 float y = (float)*input_y / 0xff;
00267 int u, v;
00268 float r, g, b;
00269 u = *input_u;
00270 v = *input_v;
00271 YUV_TO_FLOAT(y, u, v, r, g, b)
00272
00273 *(*output)++ = r;
00274 *(*output)++ = g;
00275 *(*output)++ = b;
00276 *(*output)++ = 1.0;
00277 }
00278
00279
00280
00281 static inline void transfer_YUV_PLANAR_to_YUV888(unsigned char *(*output),
00282 unsigned char *input_y,
00283 unsigned char *input_u,
00284 unsigned char *input_v)
00285 {
00286 (*output)[0] = *input_y;
00287 (*output)[1] = *input_u;
00288 (*output)[2] = *input_v;
00289 (*output) += 3;
00290 }
00291
00292 static inline void transfer_YUV_PLANAR_to_YUV161616(uint16_t *(*output),
00293 unsigned char *input_y,
00294 unsigned char *input_u,
00295 unsigned char *input_v)
00296 {
00297 (*output)[0] = (*input_y << 8) | *input_y;
00298 (*output)[1] = (*input_u << 8) | *input_u;
00299 (*output)[2] = (*input_v << 8) | *input_v;
00300 (*output) += 3;
00301 }
00302
00303 static inline void transfer_YUV_PLANAR_to_YUVA8888(unsigned char *(*output),
00304 unsigned char *input_y,
00305 unsigned char *input_u,
00306 unsigned char *input_v)
00307 {
00308 (*output)[0] = *input_y;
00309 (*output)[1] = *input_u;
00310 (*output)[2] = *input_v;
00311 (*output)[3] = 0xff;
00312 (*output) += 4;
00313 }
00314
00315 static inline void transfer_YUV_PLANAR_to_YUVA16161616(uint16_t *(*output),
00316 unsigned char *input_y,
00317 unsigned char *input_u,
00318 unsigned char *input_v)
00319 {
00320 (*output)[0] = (((uint16_t)*input_y) << 8) | *input_y;
00321 (*output)[1] = (((uint16_t)*input_u) << 8) | *input_u;
00322 (*output)[2] = (((uint16_t)*input_v) << 8) | *input_v;
00323
00324 (*output)[3] = 0xffff;
00325 (*output) += 4;
00326 }
00327
00328 static inline void transfer_YUV_PLANAR_to_YUV420P(unsigned char *input_y,
00329 unsigned char *input_u,
00330 unsigned char *input_v,
00331 unsigned char *output_y,
00332 unsigned char *output_u,
00333 unsigned char *output_v,
00334 int j)
00335 {
00336 output_y[j] = *input_y;
00337 output_u[j / 2] = *input_u;
00338 output_v[j / 2] = *input_v;
00339 }
00340
00341 static inline void transfer_YUV_PLANAR_to_YUV444P(unsigned char *input_y,
00342 unsigned char *input_u,
00343 unsigned char *input_v,
00344 unsigned char *output_y,
00345 unsigned char *output_u,
00346 unsigned char *output_v,
00347 int j)
00348 {
00349 output_y[j] = *input_y;
00350 output_u[j] = *input_u;
00351 output_v[j] = *input_v;
00352 }
00353
00354 static inline void transfer_YUV_PLANAR_to_YUV422(unsigned char *(*output),
00355 unsigned char *input_y,
00356 unsigned char *input_u,
00357 unsigned char *input_v,
00358 int j)
00359 {
00360
00361 if(!(j & 1))
00362 {
00363 (*output)[1] = *input_u;
00364 (*output)[3] = *input_v;
00365 (*output)[0] = *input_y;
00366 }
00367 else
00368
00369 {
00370 (*output)[2] = *input_y;
00371 (*output) += 4;
00372 }
00373 }
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391 static inline void transfer_YUV444P_to_YUV444P(unsigned char *input_y,
00392 unsigned char *input_u,
00393 unsigned char *input_v,
00394 unsigned char *output_y,
00395 unsigned char *output_u,
00396 unsigned char *output_v,
00397 int j)
00398 {
00399 output_y[j] = *input_y;
00400 output_u[j] = *input_u;
00401 output_v[j] = *input_v;
00402 }
00403
00404
00405
00406
00407 #define TRANSFER_FRAME_DEFAULT(output, \
00408 input, \
00409 y_in_offset, \
00410 u_in_offset, \
00411 v_in_offset, \
00412 input_column) \
00413 { \
00414 register int i, j; \
00415 \
00416 switch(in_colormodel) \
00417 { \
00418 case BC_YUV420P: \
00419 switch(out_colormodel) \
00420 { \
00421 case BC_RGB8: \
00422 TRANSFER_YUV420P_IN_HEAD \
00423 transfer_YUV_PLANAR_to_RGB8((output), \
00424 input_y + (y_in_offset), \
00425 input_u + (u_in_offset), \
00426 input_v + (v_in_offset)); \
00427 TRANSFER_FRAME_TAIL \
00428 break; \
00429 case BC_BGR565: \
00430 TRANSFER_YUV420P_IN_HEAD \
00431 transfer_YUV_PLANAR_to_BGR565((output), \
00432 input_y + (y_in_offset), \
00433 input_u + (u_in_offset), \
00434 input_v + (v_in_offset)); \
00435 TRANSFER_FRAME_TAIL \
00436 break; \
00437 case BC_RGB565: \
00438 TRANSFER_YUV420P_IN_HEAD \
00439 transfer_YUV_PLANAR_to_RGB565((output), \
00440 input_y + (y_in_offset), \
00441 input_u + (u_in_offset), \
00442 input_v + (v_in_offset)); \
00443 TRANSFER_FRAME_TAIL \
00444 break; \
00445 case BC_BGR888: \
00446 TRANSFER_YUV420P_IN_HEAD \
00447 transfer_YUV_PLANAR_to_BGR888((output), \
00448 input_y + (y_in_offset), \
00449 input_u + (u_in_offset), \
00450 input_v + (v_in_offset)); \
00451 TRANSFER_FRAME_TAIL \
00452 break; \
00453 case BC_BGR8888: \
00454 TRANSFER_YUV420P_IN_HEAD \
00455 transfer_YUV_PLANAR_to_BGR8888((output), \
00456 input_y + (y_in_offset), \
00457 input_u + (u_in_offset), \
00458 input_v + (v_in_offset)); \
00459 TRANSFER_FRAME_TAIL \
00460 break; \
00461 case BC_YUV420P: \
00462 for(i = 0; i < out_h; i++) \
00463 { \
00464 unsigned char *output_y = out_y_plane + i * total_out_w; \
00465 unsigned char *output_u = out_u_plane + i / 2 * total_out_w / 2; \
00466 unsigned char *output_v = out_v_plane + i / 2 * total_out_w / 2; \
00467 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
00468 unsigned char *input_u = in_u_plane + row_table[i] / 2 * total_in_w / 2; \
00469 unsigned char *input_v = in_v_plane + row_table[i] / 2 * total_in_w / 2; \
00470 for(j = 0; j < out_w; j++) \
00471 { \
00472 transfer_YUV_PLANAR_to_YUV420P(input_y + (y_in_offset), \
00473 input_u + (u_in_offset), \
00474 input_v + (v_in_offset), \
00475 output_y, \
00476 output_u, \
00477 output_v, \
00478 j); \
00479 } \
00480 } \
00481 break; \
00482 case BC_YUV422: \
00483 TRANSFER_YUV420P_IN_HEAD \
00484 transfer_YUV_PLANAR_to_YUV422((output), \
00485 input_y + (y_in_offset), \
00486 input_u + (u_in_offset), \
00487 input_v + (v_in_offset), \
00488 j); \
00489 TRANSFER_FRAME_TAIL \
00490 break; \
00491 case BC_YUV422P: \
00492 for(i = 0; i < out_h; i++) \
00493 { \
00494 unsigned char *output_y = out_y_plane + i * total_out_w; \
00495 unsigned char *output_u = out_u_plane + i * total_out_w / 2; \
00496 unsigned char *output_v = out_v_plane + i * total_out_w / 2; \
00497 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
00498 unsigned char *input_u = in_u_plane + row_table[i] / 2 * total_in_w / 2; \
00499 unsigned char *input_v = in_v_plane + row_table[i] / 2 * total_in_w / 2; \
00500 for(j = 0; j < out_w; j++) \
00501 { \
00502 transfer_YUV_PLANAR_to_YUV420P(input_y + (y_in_offset), \
00503 input_u + (u_in_offset), \
00504 input_v + (v_in_offset), \
00505 output_y, \
00506 output_u, \
00507 output_v, \
00508 j); \
00509 } \
00510 } \
00511 break; \
00512 case BC_YUV444P: \
00513 for(i = 0; i < out_h; i++) \
00514 { \
00515 unsigned char *output_y = out_y_plane + i * total_out_w; \
00516 unsigned char *output_u = out_u_plane + i * total_out_w; \
00517 unsigned char *output_v = out_v_plane + i * total_out_w; \
00518 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
00519 unsigned char *input_u = in_u_plane + row_table[i] / 2 * total_in_w / 2; \
00520 unsigned char *input_v = in_v_plane + row_table[i] / 2 * total_in_w / 2; \
00521 for(j = 0; j < out_w; j++) \
00522 { \
00523 transfer_YUV_PLANAR_to_YUV444P(input_y + (y_in_offset), \
00524 input_u + (u_in_offset), \
00525 input_v + (v_in_offset), \
00526 output_y, \
00527 output_u, \
00528 output_v, \
00529 j); \
00530 } \
00531 } \
00532 break; \
00533 case BC_RGB888: \
00534 TRANSFER_YUV420P_IN_HEAD \
00535 transfer_YUV_PLANAR_to_RGB888((output), \
00536 input_y + (y_in_offset), \
00537 input_u + (u_in_offset), \
00538 input_v + (v_in_offset)); \
00539 TRANSFER_FRAME_TAIL \
00540 break; \
00541 case BC_ARGB8888: \
00542 TRANSFER_YUV420P_IN_HEAD \
00543 transfer_YUV_PLANAR_to_ARGB8888((output), \
00544 input_y + (y_in_offset), \
00545 input_u + (u_in_offset), \
00546 input_v + (v_in_offset)); \
00547 TRANSFER_FRAME_TAIL \
00548 break; \
00549 case BC_ABGR8888: \
00550 TRANSFER_YUV420P_IN_HEAD \
00551 transfer_YUV_PLANAR_to_ABGR8888((output), \
00552 input_y + (y_in_offset), \
00553 input_u + (u_in_offset), \
00554 input_v + (v_in_offset)); \
00555 TRANSFER_FRAME_TAIL \
00556 break; \
00557 case BC_RGBA8888: \
00558 TRANSFER_YUV420P_IN_HEAD \
00559 transfer_YUV_PLANAR_to_RGBA8888((output), \
00560 input_y + (y_in_offset), \
00561 input_u + (u_in_offset), \
00562 input_v + (v_in_offset)); \
00563 TRANSFER_FRAME_TAIL \
00564 break; \
00565 case BC_RGB161616: \
00566 TRANSFER_YUV420P_IN_HEAD \
00567 transfer_YUV_PLANAR_to_RGB161616((uint16_t**)(output), \
00568 input_y + (y_in_offset), \
00569 input_u + (u_in_offset), \
00570 input_v + (v_in_offset)); \
00571 TRANSFER_FRAME_TAIL \
00572 break; \
00573 case BC_RGBA16161616: \
00574 TRANSFER_YUV420P_IN_HEAD \
00575 transfer_YUV_PLANAR_to_RGBA16161616((uint16_t**)(output), \
00576 input_y + (y_in_offset), \
00577 input_u + (u_in_offset), \
00578 input_v + (v_in_offset)); \
00579 TRANSFER_FRAME_TAIL \
00580 break; \
00581 case BC_RGB_FLOAT: \
00582 TRANSFER_YUV420P_IN_HEAD \
00583 transfer_YUV_PLANAR_to_RGB_FLOAT((float**)(output), \
00584 input_y + (y_in_offset), \
00585 input_u + (u_in_offset), \
00586 input_v + (v_in_offset)); \
00587 TRANSFER_FRAME_TAIL \
00588 break; \
00589 case BC_RGBA_FLOAT: \
00590 TRANSFER_YUV420P_IN_HEAD \
00591 transfer_YUV_PLANAR_to_RGBA_FLOAT((float**)(output), \
00592 input_y + (y_in_offset), \
00593 input_u + (u_in_offset), \
00594 input_v + (v_in_offset)); \
00595 TRANSFER_FRAME_TAIL \
00596 break; \
00597 case BC_YUV888: \
00598 TRANSFER_YUV420P_IN_HEAD \
00599 transfer_YUV_PLANAR_to_YUV888((output), \
00600 input_y + (y_in_offset), \
00601 input_u + (u_in_offset), \
00602 input_v + (v_in_offset)); \
00603 TRANSFER_FRAME_TAIL \
00604 break; \
00605 case BC_YUVA8888: \
00606 TRANSFER_YUV420P_IN_HEAD \
00607 transfer_YUV_PLANAR_to_YUVA8888((output), \
00608 input_y + (y_in_offset), \
00609 input_u + (u_in_offset), \
00610 input_v + (v_in_offset)); \
00611 TRANSFER_FRAME_TAIL \
00612 break; \
00613 case BC_YUV161616: \
00614 TRANSFER_YUV420P_IN_HEAD \
00615 transfer_YUV_PLANAR_to_YUV161616((uint16_t**)(output), \
00616 input_y + (y_in_offset), \
00617 input_u + (u_in_offset), \
00618 input_v + (v_in_offset)); \
00619 TRANSFER_FRAME_TAIL \
00620 break; \
00621 case BC_YUVA16161616: \
00622 TRANSFER_YUV420P_IN_HEAD \
00623 transfer_YUV_PLANAR_to_YUVA16161616((uint16_t**)(output), \
00624 input_y + (y_in_offset), \
00625 input_u + (u_in_offset), \
00626 input_v + (v_in_offset)); \
00627 TRANSFER_FRAME_TAIL \
00628 break; \
00629 } \
00630 break; \
00631 \
00632 case BC_YUV9P: \
00633 switch(out_colormodel) \
00634 { \
00635 case BC_RGB8: \
00636 TRANSFER_YUV9P_IN_HEAD \
00637 transfer_YUV_PLANAR_to_RGB8((output), \
00638 input_y + (y_in_offset), \
00639 input_u + (u_in_offset), \
00640 input_v + (v_in_offset)); \
00641 TRANSFER_FRAME_TAIL \
00642 break; \
00643 case BC_BGR565: \
00644 TRANSFER_YUV9P_IN_HEAD \
00645 transfer_YUV_PLANAR_to_BGR565((output), \
00646 input_y + (y_in_offset), \
00647 input_u + (u_in_offset), \
00648 input_v + (v_in_offset)); \
00649 TRANSFER_FRAME_TAIL \
00650 break; \
00651 case BC_RGB565: \
00652 TRANSFER_YUV9P_IN_HEAD \
00653 transfer_YUV_PLANAR_to_RGB565((output), \
00654 input_y + (y_in_offset), \
00655 input_u + (u_in_offset), \
00656 input_v + (v_in_offset)); \
00657 TRANSFER_FRAME_TAIL \
00658 break; \
00659 case BC_BGR888: \
00660 TRANSFER_YUV9P_IN_HEAD \
00661 transfer_YUV_PLANAR_to_BGR888((output), \
00662 input_y + (y_in_offset), \
00663 input_u + (u_in_offset), \
00664 input_v + (v_in_offset)); \
00665 TRANSFER_FRAME_TAIL \
00666 break; \
00667 case BC_BGR8888: \
00668 TRANSFER_YUV9P_IN_HEAD \
00669 transfer_YUV_PLANAR_to_BGR8888((output), \
00670 input_y + (y_in_offset), \
00671 input_u + (u_in_offset), \
00672 input_v + (v_in_offset)); \
00673 TRANSFER_FRAME_TAIL \
00674 break; \
00675 case BC_YUV420P: \
00676 for(i = 0; i < out_h; i++) \
00677 { \
00678 unsigned char *output_y = out_y_plane + i * total_out_w; \
00679 unsigned char *output_u = out_u_plane + i / 2 * total_out_w / 2; \
00680 unsigned char *output_v = out_v_plane + i / 2 * total_out_w / 2; \
00681 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
00682 unsigned char *input_u = in_u_plane + row_table[i] / 2 * total_in_w / 2; \
00683 unsigned char *input_v = in_v_plane + row_table[i] / 2 * total_in_w / 2; \
00684 for(j = 0; j < out_w; j++) \
00685 { \
00686 transfer_YUV_PLANAR_to_YUV420P(input_y + (y_in_offset), \
00687 input_u + (u_in_offset), \
00688 input_v + (v_in_offset), \
00689 output_y, \
00690 output_u, \
00691 output_v, \
00692 j); \
00693 } \
00694 } \
00695 break; \
00696 case BC_YUV422: \
00697 TRANSFER_YUV9P_IN_HEAD \
00698 transfer_YUV_PLANAR_to_YUV422((output), \
00699 input_y + (y_in_offset), \
00700 input_u + (u_in_offset), \
00701 input_v + (v_in_offset), \
00702 j); \
00703 TRANSFER_FRAME_TAIL \
00704 break; \
00705 case BC_YUV422P: \
00706 for(i = 0; i < out_h; i++) \
00707 { \
00708 unsigned char *output_y = out_y_plane + i * total_out_w; \
00709 unsigned char *output_u = out_u_plane + i * total_out_w / 2; \
00710 unsigned char *output_v = out_v_plane + i * total_out_w / 2; \
00711 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
00712 unsigned char *input_u = in_u_plane + row_table[i] / 2 * total_in_w / 2; \
00713 unsigned char *input_v = in_v_plane + row_table[i] / 2 * total_in_w / 2; \
00714 for(j = 0; j < out_w; j++) \
00715 { \
00716 transfer_YUV_PLANAR_to_YUV420P(input_y + (y_in_offset), \
00717 input_u + (u_in_offset), \
00718 input_v + (v_in_offset), \
00719 output_y, \
00720 output_u, \
00721 output_v, \
00722 j); \
00723 } \
00724 } \
00725 break; \
00726 case BC_YUV444P: \
00727 for(i = 0; i < out_h; i++) \
00728 { \
00729 unsigned char *output_y = out_y_plane + i * total_out_w; \
00730 unsigned char *output_u = out_u_plane + i * total_out_w; \
00731 unsigned char *output_v = out_v_plane + i * total_out_w; \
00732 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
00733 unsigned char *input_u = in_u_plane + row_table[i] / 2 * total_in_w / 2; \
00734 unsigned char *input_v = in_v_plane + row_table[i] / 2 * total_in_w / 2; \
00735 for(j = 0; j < out_w; j++) \
00736 { \
00737 transfer_YUV_PLANAR_to_YUV444P(input_y + (y_in_offset), \
00738 input_u + (u_in_offset), \
00739 input_v + (v_in_offset), \
00740 output_y, \
00741 output_u, \
00742 output_v, \
00743 j); \
00744 } \
00745 } \
00746 break; \
00747 case BC_RGB888: \
00748 TRANSFER_YUV9P_IN_HEAD \
00749 transfer_YUV_PLANAR_to_RGB888((output), \
00750 input_y + (y_in_offset), \
00751 input_u + (u_in_offset), \
00752 input_v + (v_in_offset)); \
00753 TRANSFER_FRAME_TAIL \
00754 break; \
00755 case BC_ARGB8888: \
00756 TRANSFER_YUV9P_IN_HEAD \
00757 transfer_YUV_PLANAR_to_ARGB8888((output), \
00758 input_y + (y_in_offset), \
00759 input_u + (u_in_offset), \
00760 input_v + (v_in_offset)); \
00761 TRANSFER_FRAME_TAIL \
00762 break; \
00763 case BC_ABGR8888: \
00764 TRANSFER_YUV9P_IN_HEAD \
00765 transfer_YUV_PLANAR_to_ABGR8888((output), \
00766 input_y + (y_in_offset), \
00767 input_u + (u_in_offset), \
00768 input_v + (v_in_offset)); \
00769 TRANSFER_FRAME_TAIL \
00770 break; \
00771 case BC_RGBA8888: \
00772 TRANSFER_YUV9P_IN_HEAD \
00773 transfer_YUV_PLANAR_to_RGBA8888((output), \
00774 input_y + (y_in_offset), \
00775 input_u + (u_in_offset), \
00776 input_v + (v_in_offset)); \
00777 TRANSFER_FRAME_TAIL \
00778 break; \
00779 case BC_RGB161616: \
00780 TRANSFER_YUV9P_IN_HEAD \
00781 transfer_YUV_PLANAR_to_RGB161616((uint16_t**)(output), \
00782 input_y + (y_in_offset), \
00783 input_u + (u_in_offset), \
00784 input_v + (v_in_offset)); \
00785 TRANSFER_FRAME_TAIL \
00786 break; \
00787 case BC_RGBA16161616: \
00788 TRANSFER_YUV9P_IN_HEAD \
00789 transfer_YUV_PLANAR_to_RGBA16161616((uint16_t**)(output), \
00790 input_y + (y_in_offset), \
00791 input_u + (u_in_offset), \
00792 input_v + (v_in_offset)); \
00793 TRANSFER_FRAME_TAIL \
00794 break; \
00795 case BC_RGB_FLOAT: \
00796 TRANSFER_YUV9P_IN_HEAD \
00797 transfer_YUV_PLANAR_to_RGB_FLOAT((float**)(output), \
00798 input_y + (y_in_offset), \
00799 input_u + (u_in_offset), \
00800 input_v + (v_in_offset)); \
00801 TRANSFER_FRAME_TAIL \
00802 break; \
00803 case BC_RGBA_FLOAT: \
00804 TRANSFER_YUV9P_IN_HEAD \
00805 transfer_YUV_PLANAR_to_RGBA_FLOAT((float**)(output), \
00806 input_y + (y_in_offset), \
00807 input_u + (u_in_offset), \
00808 input_v + (v_in_offset)); \
00809 TRANSFER_FRAME_TAIL \
00810 break; \
00811 case BC_YUV888: \
00812 TRANSFER_YUV9P_IN_HEAD \
00813 transfer_YUV_PLANAR_to_YUV888((output), \
00814 input_y + (y_in_offset), \
00815 input_u + (u_in_offset), \
00816 input_v + (v_in_offset)); \
00817 TRANSFER_FRAME_TAIL \
00818 break; \
00819 case BC_YUVA8888: \
00820 TRANSFER_YUV9P_IN_HEAD \
00821 transfer_YUV_PLANAR_to_YUVA8888((output), \
00822 input_y + (y_in_offset), \
00823 input_u + (u_in_offset), \
00824 input_v + (v_in_offset)); \
00825 TRANSFER_FRAME_TAIL \
00826 break; \
00827 case BC_YUV161616: \
00828 TRANSFER_YUV9P_IN_HEAD \
00829 transfer_YUV_PLANAR_to_YUV161616((uint16_t**)(output), \
00830 input_y + (y_in_offset), \
00831 input_u + (u_in_offset), \
00832 input_v + (v_in_offset)); \
00833 TRANSFER_FRAME_TAIL \
00834 break; \
00835 case BC_YUVA16161616: \
00836 TRANSFER_YUV9P_IN_HEAD \
00837 transfer_YUV_PLANAR_to_YUVA16161616((uint16_t**)(output), \
00838 input_y + (y_in_offset), \
00839 input_u + (u_in_offset), \
00840 input_v + (v_in_offset)); \
00841 TRANSFER_FRAME_TAIL \
00842 break; \
00843 } \
00844 break; \
00845 \
00846 case BC_YUV422P: \
00847 switch(out_colormodel) \
00848 { \
00849 case BC_RGB8: \
00850 TRANSFER_YUV422P_IN_HEAD \
00851 transfer_YUV_PLANAR_to_RGB8((output), \
00852 input_y + (y_in_offset), \
00853 input_u + (u_in_offset), \
00854 input_v + (v_in_offset)); \
00855 TRANSFER_FRAME_TAIL \
00856 break; \
00857 case BC_BGR565: \
00858 TRANSFER_YUV422P_IN_HEAD \
00859 transfer_YUV_PLANAR_to_BGR565((output), \
00860 input_y + (y_in_offset), \
00861 input_u + (u_in_offset), \
00862 input_v + (v_in_offset)); \
00863 TRANSFER_FRAME_TAIL \
00864 break; \
00865 case BC_RGB565: \
00866 TRANSFER_YUV422P_IN_HEAD \
00867 transfer_YUV_PLANAR_to_RGB565((output), \
00868 input_y + (y_in_offset), \
00869 input_u + (u_in_offset), \
00870 input_v + (v_in_offset)); \
00871 TRANSFER_FRAME_TAIL \
00872 break; \
00873 case BC_BGR888: \
00874 TRANSFER_YUV422P_IN_HEAD \
00875 transfer_YUV_PLANAR_to_BGR888((output), \
00876 input_y + (y_in_offset), \
00877 input_u + (u_in_offset), \
00878 input_v + (v_in_offset)); \
00879 TRANSFER_FRAME_TAIL \
00880 break; \
00881 case BC_BGR8888: \
00882 TRANSFER_YUV422P_IN_HEAD \
00883 transfer_YUV_PLANAR_to_BGR8888((output), \
00884 input_y + (y_in_offset), \
00885 input_u + (u_in_offset), \
00886 input_v + (v_in_offset)); \
00887 TRANSFER_FRAME_TAIL \
00888 break; \
00889 case BC_RGB888: \
00890 TRANSFER_YUV422P_IN_HEAD \
00891 transfer_YUV_PLANAR_to_RGB888((output), \
00892 input_y + (y_in_offset), \
00893 input_u + (u_in_offset), \
00894 input_v + (v_in_offset)); \
00895 TRANSFER_FRAME_TAIL \
00896 break; \
00897 case BC_ARGB8888: \
00898 TRANSFER_YUV422P_IN_HEAD \
00899 transfer_YUV_PLANAR_to_ARGB8888((output), \
00900 input_y + (y_in_offset), \
00901 input_u + (u_in_offset), \
00902 input_v + (v_in_offset)); \
00903 TRANSFER_FRAME_TAIL \
00904 break; \
00905 case BC_ABGR8888: \
00906 TRANSFER_YUV422P_IN_HEAD \
00907 transfer_YUV_PLANAR_to_ABGR8888((output), \
00908 input_y + (y_in_offset), \
00909 input_u + (u_in_offset), \
00910 input_v + (v_in_offset)); \
00911 TRANSFER_FRAME_TAIL \
00912 break; \
00913 case BC_RGBA8888: \
00914 TRANSFER_YUV422P_IN_HEAD \
00915 transfer_YUV_PLANAR_to_RGBA8888((output), \
00916 input_y + (y_in_offset), \
00917 input_u + (u_in_offset), \
00918 input_v + (v_in_offset)); \
00919 TRANSFER_FRAME_TAIL \
00920 break; \
00921 case BC_RGB161616: \
00922 TRANSFER_YUV422P_IN_HEAD \
00923 transfer_YUV_PLANAR_to_RGB161616((uint16_t**)(output), \
00924 input_y + (y_in_offset), \
00925 input_u + (u_in_offset), \
00926 input_v + (v_in_offset)); \
00927 TRANSFER_FRAME_TAIL \
00928 break; \
00929 case BC_RGBA16161616: \
00930 TRANSFER_YUV422P_IN_HEAD \
00931 transfer_YUV_PLANAR_to_RGBA16161616((uint16_t**)(output), \
00932 input_y + (y_in_offset), \
00933 input_u + (u_in_offset), \
00934 input_v + (v_in_offset)); \
00935 TRANSFER_FRAME_TAIL \
00936 break; \
00937 case BC_RGB_FLOAT: \
00938 TRANSFER_YUV422P_IN_HEAD \
00939 transfer_YUV_PLANAR_to_RGB_FLOAT((float**)(output), \
00940 input_y + (y_in_offset), \
00941 input_u + (u_in_offset), \
00942 input_v + (v_in_offset)); \
00943 TRANSFER_FRAME_TAIL \
00944 break; \
00945 case BC_RGBA_FLOAT: \
00946 TRANSFER_YUV422P_IN_HEAD \
00947 transfer_YUV_PLANAR_to_RGBA_FLOAT((float**)(output), \
00948 input_y + (y_in_offset), \
00949 input_u + (u_in_offset), \
00950 input_v + (v_in_offset)); \
00951 TRANSFER_FRAME_TAIL \
00952 break; \
00953 case BC_YUV888: \
00954 TRANSFER_YUV422P_IN_HEAD \
00955 transfer_YUV_PLANAR_to_YUV888((output), \
00956 input_y + (y_in_offset), \
00957 input_u + (u_in_offset), \
00958 input_v + (v_in_offset)); \
00959 TRANSFER_FRAME_TAIL \
00960 break; \
00961 case BC_YUVA8888: \
00962 TRANSFER_YUV422P_IN_HEAD \
00963 transfer_YUV_PLANAR_to_YUVA8888((output), \
00964 input_y + (y_in_offset), \
00965 input_u + (u_in_offset), \
00966 input_v + (v_in_offset)); \
00967 TRANSFER_FRAME_TAIL \
00968 break; \
00969 case BC_YUV161616: \
00970 TRANSFER_YUV422P_IN_HEAD \
00971 transfer_YUV_PLANAR_to_YUV161616((uint16_t**)(output), \
00972 input_y + (y_in_offset), \
00973 input_u + (u_in_offset), \
00974 input_v + (v_in_offset)); \
00975 TRANSFER_FRAME_TAIL \
00976 break; \
00977 case BC_YUVA16161616: \
00978 TRANSFER_YUV422P_IN_HEAD \
00979 transfer_YUV_PLANAR_to_YUVA16161616((uint16_t**)(output), \
00980 input_y + (y_in_offset), \
00981 input_u + (u_in_offset), \
00982 input_v + (v_in_offset)); \
00983 TRANSFER_FRAME_TAIL \
00984 break; \
00985 case BC_YUV420P: \
00986 for(i = 0; i < out_h; i++) \
00987 { \
00988 unsigned char *output_y = out_y_plane + i * total_in_w; \
00989 unsigned char *output_u = out_u_plane + i / 2 * total_in_w / 2; \
00990 unsigned char *output_v = out_v_plane + i / 2 * total_in_w / 2; \
00991 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
00992 unsigned char *input_u = in_u_plane + row_table[i] * total_in_w / 2; \
00993 unsigned char *input_v = in_v_plane + row_table[i] * total_in_w / 2; \
00994 for(j = 0; j < out_w; j++) \
00995 { \
00996 transfer_YUV_PLANAR_to_YUV420P(input_y + (y_in_offset), \
00997 input_u + (u_in_offset), \
00998 input_v + (v_in_offset), \
00999 output_y, \
01000 output_u, \
01001 output_v, \
01002 j); \
01003 } \
01004 } \
01005 break; \
01006 case BC_YUV422: \
01007 TRANSFER_YUV422_IN_HEAD \
01008 transfer_YUV_PLANAR_to_YUV422((output), \
01009 input_y + (y_in_offset), \
01010 input_u + (u_in_offset), \
01011 input_v + (v_in_offset), \
01012 j); \
01013 TRANSFER_FRAME_TAIL \
01014 break; \
01015 case BC_YUV422P: \
01016 for(i = 0; i < out_h; i++) \
01017 { \
01018 unsigned char *output_y = out_y_plane + i * total_in_w; \
01019 unsigned char *output_u = out_u_plane + i * total_in_w / 2; \
01020 unsigned char *output_v = out_v_plane + i * total_in_w / 2; \
01021 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
01022 unsigned char *input_u = in_u_plane + row_table[i] * total_in_w / 2; \
01023 unsigned char *input_v = in_v_plane + row_table[i] * total_in_w / 2; \
01024 for(j = 0; j < out_w; j++) \
01025 { \
01026 transfer_YUV_PLANAR_to_YUV420P(input_y + (y_in_offset), \
01027 input_u + (u_in_offset), \
01028 input_v + (v_in_offset), \
01029 output_y, \
01030 output_u, \
01031 output_v, \
01032 j); \
01033 } \
01034 } \
01035 break; \
01036 case BC_YUV444P: \
01037 for(i = 0; i < out_h; i++) \
01038 { \
01039 unsigned char *output_y = out_y_plane + i * total_in_w; \
01040 unsigned char *output_u = out_u_plane + i * total_in_w; \
01041 unsigned char *output_v = out_v_plane + i * total_in_w; \
01042 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
01043 unsigned char *input_u = in_u_plane + row_table[i] * total_in_w / 2; \
01044 unsigned char *input_v = in_v_plane + row_table[i] * total_in_w / 2; \
01045 for(j = 0; j < out_w; j++) \
01046 { \
01047 transfer_YUV_PLANAR_to_YUV444P(input_y + (y_in_offset), \
01048 input_u + (u_in_offset), \
01049 input_v + (v_in_offset), \
01050 output_y, \
01051 output_u, \
01052 output_v, \
01053 j); \
01054 } \
01055 } \
01056 break; \
01057 } \
01058 break; \
01059 \
01060 \
01061 case BC_YUV444P: \
01062 switch(out_colormodel) \
01063 { \
01064 case BC_RGB8: \
01065 TRANSFER_YUV444P_IN_HEAD \
01066 transfer_YUV_PLANAR_to_RGB8((output), \
01067 input_y + (y_in_offset), \
01068 input_u + (u_in_offset), \
01069 input_v + (v_in_offset)); \
01070 TRANSFER_FRAME_TAIL \
01071 break; \
01072 case BC_BGR565: \
01073 TRANSFER_YUV444P_IN_HEAD \
01074 transfer_YUV_PLANAR_to_BGR565((output), \
01075 input_y + (y_in_offset), \
01076 input_u + (u_in_offset), \
01077 input_v + (v_in_offset)); \
01078 TRANSFER_FRAME_TAIL \
01079 break; \
01080 case BC_RGB565: \
01081 TRANSFER_YUV444P_IN_HEAD \
01082 transfer_YUV_PLANAR_to_RGB565((output), \
01083 input_y + (y_in_offset), \
01084 input_u + (u_in_offset), \
01085 input_v + (v_in_offset)); \
01086 TRANSFER_FRAME_TAIL \
01087 break; \
01088 case BC_BGR888: \
01089 TRANSFER_YUV444P_IN_HEAD \
01090 transfer_YUV_PLANAR_to_BGR888((output), \
01091 input_y + (y_in_offset), \
01092 input_u + (u_in_offset), \
01093 input_v + (v_in_offset)); \
01094 TRANSFER_FRAME_TAIL \
01095 break; \
01096 case BC_BGR8888: \
01097 TRANSFER_YUV444P_IN_HEAD \
01098 transfer_YUV_PLANAR_to_BGR8888((output), \
01099 input_y + (y_in_offset), \
01100 input_u + (u_in_offset), \
01101 input_v + (v_in_offset)); \
01102 TRANSFER_FRAME_TAIL \
01103 break; \
01104 case BC_RGB888: \
01105 TRANSFER_YUV444P_IN_HEAD \
01106 transfer_YUV_PLANAR_to_RGB888((output), \
01107 input_y + (y_in_offset), \
01108 input_u + (u_in_offset), \
01109 input_v + (v_in_offset)); \
01110 TRANSFER_FRAME_TAIL \
01111 break; \
01112 case BC_ARGB8888: \
01113 TRANSFER_YUV444P_IN_HEAD \
01114 transfer_YUV_PLANAR_to_ARGB8888((output), \
01115 input_y + (y_in_offset), \
01116 input_u + (u_in_offset), \
01117 input_v + (v_in_offset)); \
01118 TRANSFER_FRAME_TAIL \
01119 break; \
01120 case BC_ABGR8888: \
01121 TRANSFER_YUV444P_IN_HEAD \
01122 transfer_YUV_PLANAR_to_ABGR8888((output), \
01123 input_y + (y_in_offset), \
01124 input_u + (u_in_offset), \
01125 input_v + (v_in_offset)); \
01126 TRANSFER_FRAME_TAIL \
01127 break; \
01128 case BC_RGBA8888: \
01129 TRANSFER_YUV444P_IN_HEAD \
01130 transfer_YUV_PLANAR_to_RGBA8888((output), \
01131 input_y + (y_in_offset), \
01132 input_u + (u_in_offset), \
01133 input_v + (v_in_offset)); \
01134 TRANSFER_FRAME_TAIL \
01135 break; \
01136 case BC_RGB161616: \
01137 TRANSFER_YUV444P_IN_HEAD \
01138 transfer_YUV_PLANAR_to_RGB161616((uint16_t**)(output), \
01139 input_y + (y_in_offset), \
01140 input_u + (u_in_offset), \
01141 input_v + (v_in_offset)); \
01142 TRANSFER_FRAME_TAIL \
01143 break; \
01144 case BC_RGBA16161616: \
01145 TRANSFER_YUV444P_IN_HEAD \
01146 transfer_YUV_PLANAR_to_RGBA16161616((uint16_t**)(output), \
01147 input_y + (y_in_offset), \
01148 input_u + (u_in_offset), \
01149 input_v + (v_in_offset)); \
01150 TRANSFER_FRAME_TAIL \
01151 break; \
01152 case BC_RGB_FLOAT: \
01153 TRANSFER_YUV444P_IN_HEAD \
01154 transfer_YUV_PLANAR_to_RGB_FLOAT((float**)(output), \
01155 input_y + (y_in_offset), \
01156 input_u + (u_in_offset), \
01157 input_v + (v_in_offset)); \
01158 TRANSFER_FRAME_TAIL \
01159 break; \
01160 case BC_RGBA_FLOAT: \
01161 TRANSFER_YUV444P_IN_HEAD \
01162 transfer_YUV_PLANAR_to_RGBA_FLOAT((float**)(output), \
01163 input_y + (y_in_offset), \
01164 input_u + (u_in_offset), \
01165 input_v + (v_in_offset)); \
01166 TRANSFER_FRAME_TAIL \
01167 break; \
01168 case BC_YUV888: \
01169 TRANSFER_YUV444P_IN_HEAD \
01170 transfer_YUV_PLANAR_to_YUV888((output), \
01171 input_y + (y_in_offset), \
01172 input_u + (u_in_offset), \
01173 input_v + (v_in_offset)); \
01174 TRANSFER_FRAME_TAIL \
01175 break; \
01176 case BC_YUVA8888: \
01177 TRANSFER_YUV444P_IN_HEAD \
01178 transfer_YUV_PLANAR_to_YUVA8888((output), \
01179 input_y + (y_in_offset), \
01180 input_u + (u_in_offset), \
01181 input_v + (v_in_offset)); \
01182 TRANSFER_FRAME_TAIL \
01183 break; \
01184 case BC_YUV161616: \
01185 TRANSFER_YUV444P_IN_HEAD \
01186 transfer_YUV_PLANAR_to_YUV161616((uint16_t**)(output), \
01187 input_y + (y_in_offset), \
01188 input_u + (u_in_offset), \
01189 input_v + (v_in_offset)); \
01190 TRANSFER_FRAME_TAIL \
01191 break; \
01192 case BC_YUVA16161616: \
01193 TRANSFER_YUV444P_IN_HEAD \
01194 transfer_YUV_PLANAR_to_YUVA16161616((uint16_t**)(output), \
01195 input_y + (y_in_offset), \
01196 input_u + (u_in_offset), \
01197 input_v + (v_in_offset)); \
01198 TRANSFER_FRAME_TAIL \
01199 break; \
01200 case BC_YUV420P: \
01201 for(i = 0; i < out_h; i++) \
01202 { \
01203 unsigned char *output_y = out_y_plane + i * total_in_w; \
01204 unsigned char *output_u = out_u_plane + i / 2 * total_in_w / 2; \
01205 unsigned char *output_v = out_v_plane + i / 2 * total_in_w / 2; \
01206 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
01207 unsigned char *input_u = in_u_plane + row_table[i] * total_in_w; \
01208 unsigned char *input_v = in_v_plane + row_table[i] * total_in_w; \
01209 for(j = 0; j < out_w; j++) \
01210 { \
01211 transfer_YUV_PLANAR_to_YUV420P(input_y + (y_in_offset), \
01212 input_u + (u_in_offset), \
01213 input_v + (v_in_offset), \
01214 output_y, \
01215 output_u, \
01216 output_v, \
01217 j); \
01218 } \
01219 } \
01220 break; \
01221 case BC_YUV422: \
01222 TRANSFER_YUV444P_IN_HEAD \
01223 transfer_YUV_PLANAR_to_YUV422((output), \
01224 input_y + (y_in_offset), \
01225 input_u + (u_in_offset), \
01226 input_v + (v_in_offset), \
01227 j); \
01228 TRANSFER_FRAME_TAIL \
01229 break; \
01230 case BC_YUV422P: \
01231 for(i = 0; i < out_h; i++) \
01232 { \
01233 unsigned char *output_y = out_y_plane + i * total_in_w; \
01234 unsigned char *output_u = out_u_plane + i * total_in_w / 2; \
01235 unsigned char *output_v = out_v_plane + i * total_in_w / 2; \
01236 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
01237 unsigned char *input_u = in_u_plane + row_table[i] * total_in_w; \
01238 unsigned char *input_v = in_v_plane + row_table[i] * total_in_w; \
01239 for(j = 0; j < out_w; j++) \
01240 { \
01241 transfer_YUV_PLANAR_to_YUV420P(input_y + (y_in_offset), \
01242 input_u + (u_in_offset), \
01243 input_v + (v_in_offset), \
01244 output_y, \
01245 output_u, \
01246 output_v, \
01247 j); \
01248 } \
01249 } \
01250 break; \
01251 case BC_YUV444P: \
01252 for(i = 0; i < out_h; i++) \
01253 { \
01254 unsigned char *output_y = out_y_plane + i * total_in_w; \
01255 unsigned char *output_u = out_u_plane + i * total_in_w; \
01256 unsigned char *output_v = out_v_plane + i * total_in_w; \
01257 unsigned char *input_y = in_y_plane + row_table[i] * total_in_w; \
01258 unsigned char *input_u = in_u_plane + row_table[i] * total_in_w; \
01259 unsigned char *input_v = in_v_plane + row_table[i] * total_in_w; \
01260 for(j = 0; j < out_w; j++) \
01261 { \
01262 transfer_YUV444P_to_YUV444P(input_y + (y_in_offset), \
01263 input_u + (u_in_offset), \
01264 input_v + (v_in_offset), \
01265 output_y, \
01266 output_u, \
01267 output_v, \
01268 j); \
01269 } \
01270 } \
01271 break; \
01272 } \
01273 break; \
01274 } \
01275 }
01276
01277 void cmodel_yuv420p(PERMUTATION_ARGS)
01278 {
01279 if(scale)
01280 {
01281 TRANSFER_FRAME_DEFAULT(&output_row,
01282 input_row + column_table[j] * in_pixelsize,
01283 column_table[j],
01284 column_table[j] / 2,
01285 column_table[j] / 2,
01286 0);
01287 }
01288 else
01289 {
01290 TRANSFER_FRAME_DEFAULT(&output_row,
01291 input_row + j * in_pixelsize,
01292 j,
01293 j / 2,
01294 j / 2,
01295 0);
01296 }
01297 }
01298
01299 void cmodel_yuv9p(PERMUTATION_ARGS)
01300 {
01301 if(scale)
01302 {
01303 TRANSFER_FRAME_DEFAULT(&output_row,
01304 input_row + column_table[j] * in_pixelsize,
01305 column_table[j],
01306 column_table[j] / 4,
01307 column_table[j] / 4,
01308 0);
01309 }
01310 else
01311 {
01312 TRANSFER_FRAME_DEFAULT(&output_row,
01313 input_row + j * in_pixelsize,
01314 j,
01315 j / 4,
01316 j / 4,
01317 0);
01318 }
01319 }
01320
01321 void cmodel_yuv444p(PERMUTATION_ARGS)
01322 {
01323 if(scale)
01324 {
01325 TRANSFER_FRAME_DEFAULT(&output_row,
01326 input_row + column_table[j] * in_pixelsize,
01327 column_table[j],
01328 column_table[j],
01329 column_table[j],
01330 0);
01331 }
01332 else
01333 {
01334 TRANSFER_FRAME_DEFAULT(&output_row,
01335 input_row + j * in_pixelsize,
01336 j,
01337 j,
01338 j,
01339 0);
01340 }
01341 }