38 |
packedFuncPtr abgr_to_yv12; |
packedFuncPtr abgr_to_yv12; |
39 |
packedFuncPtr rgba_to_yv12; |
packedFuncPtr rgba_to_yv12; |
40 |
packedFuncPtr argb_to_yv12; |
packedFuncPtr argb_to_yv12; |
|
packedFuncPtr yuv_to_yv12; |
|
41 |
packedFuncPtr yuyv_to_yv12; |
packedFuncPtr yuyv_to_yv12; |
42 |
packedFuncPtr uyvy_to_yv12; |
packedFuncPtr uyvy_to_yv12; |
43 |
|
|
59 |
packedFuncPtr yv12_to_abgr; |
packedFuncPtr yv12_to_abgr; |
60 |
packedFuncPtr yv12_to_rgba; |
packedFuncPtr yv12_to_rgba; |
61 |
packedFuncPtr yv12_to_argb; |
packedFuncPtr yv12_to_argb; |
|
packedFuncPtr yv12_to_yuv; |
|
62 |
packedFuncPtr yv12_to_yuyv; |
packedFuncPtr yv12_to_yuyv; |
63 |
packedFuncPtr yv12_to_uyvy; |
packedFuncPtr yv12_to_uyvy; |
64 |
|
|
75 |
planarFuncPtr yv12_to_yv12; |
planarFuncPtr yv12_to_yv12; |
76 |
|
|
77 |
|
|
78 |
int32_t RGB_Y_tab[256]; |
static int32_t RGB_Y_tab[256]; |
79 |
int32_t B_U_tab[256]; |
static int32_t B_U_tab[256]; |
80 |
int32_t G_U_tab[256]; |
static int32_t G_U_tab[256]; |
81 |
int32_t G_V_tab[256]; |
static int32_t G_V_tab[256]; |
82 |
int32_t R_V_tab[256]; |
static int32_t R_V_tab[256]; |
83 |
|
|
84 |
|
|
85 |
|
|
337 |
((MAX(0,MIN(255, B)) >> 3) & 0x001f) |
((MAX(0,MIN(255, B)) >> 3) & 0x001f) |
338 |
|
|
339 |
#define WRITE_RGB16(ROW,UV_ROW,C1) \ |
#define WRITE_RGB16(ROW,UV_ROW,C1) \ |
340 |
rgb_y = RGB_Y_tab[ y_ptr[y_stride + 0] ]; \ |
rgb_y = RGB_Y_tab[ y_ptr[y_stride*(ROW) + 0] ]; \ |
341 |
b[ROW] = (b[ROW] & 0x7) + ((rgb_y + b_u##UV_ROW) >> SCALEBITS_OUT); \ |
b[ROW] = (b[ROW] & 0x7) + ((rgb_y + b_u##UV_ROW) >> SCALEBITS_OUT); \ |
342 |
g[ROW] = (g[ROW] & 0x7) + ((rgb_y - g_uv##UV_ROW) >> SCALEBITS_OUT); \ |
g[ROW] = (g[ROW] & 0x7) + ((rgb_y - g_uv##UV_ROW) >> SCALEBITS_OUT); \ |
343 |
r[ROW] = (r[ROW] & 0x7) + ((rgb_y + r_v##UV_ROW) >> SCALEBITS_OUT); \ |
r[ROW] = (r[ROW] & 0x7) + ((rgb_y + r_v##UV_ROW) >> SCALEBITS_OUT); \ |
344 |
*(uint16_t *) (x_ptr+((ROW)*x_stride)+0) = C1(r[ROW], g[ROW], b[ROW]); \ |
*(uint16_t *) (x_ptr+((ROW)*x_stride)+0) = C1(r[ROW], g[ROW], b[ROW]); \ |
345 |
rgb_y = RGB_Y_tab[ y_ptr[y_stride + 1] ]; \ |
rgb_y = RGB_Y_tab[ y_ptr[y_stride*(ROW) + 1] ]; \ |
346 |
b[ROW] = (b[ROW] & 0x7) + ((rgb_y + b_u##UV_ROW) >> SCALEBITS_OUT); \ |
b[ROW] = (b[ROW] & 0x7) + ((rgb_y + b_u##UV_ROW) >> SCALEBITS_OUT); \ |
347 |
g[ROW] = (g[ROW] & 0x7) + ((rgb_y - g_uv##UV_ROW) >> SCALEBITS_OUT); \ |
g[ROW] = (g[ROW] & 0x7) + ((rgb_y - g_uv##UV_ROW) >> SCALEBITS_OUT); \ |
348 |
r[ROW] = (r[ROW] & 0x7) + ((rgb_y + r_v##UV_ROW) >> SCALEBITS_OUT); \ |
r[ROW] = (r[ROW] & 0x7) + ((rgb_y + r_v##UV_ROW) >> SCALEBITS_OUT); \ |
472 |
int width2 = width / 2; |
int width2 = width / 2; |
473 |
int height2 = height / 2; |
int height2 = height / 2; |
474 |
int y; |
int y; |
475 |
|
const int with_uv = (u_src!=0 && v_src!=0); |
476 |
|
|
477 |
if (vflip) { |
if (vflip) { |
478 |
y_src += (height - 1) * y_src_stride; |
y_src += (height - 1) * y_src_stride; |
479 |
|
if (with_uv) { |
480 |
u_src += (height2 - 1) * uv_src_stride; |
u_src += (height2 - 1) * uv_src_stride; |
481 |
v_src += (height2 - 1) * uv_src_stride; |
v_src += (height2 - 1) * uv_src_stride; |
482 |
|
} |
483 |
y_src_stride = -y_src_stride; |
y_src_stride = -y_src_stride; |
484 |
uv_src_stride = -uv_src_stride; |
uv_src_stride = -uv_src_stride; |
485 |
} |
} |
490 |
y_dst += y_dst_stride; |
y_dst += y_dst_stride; |
491 |
} |
} |
492 |
|
|
493 |
|
if (with_uv) { |
494 |
for (y = height2; y; y--) { |
for (y = height2; y; y--) { |
495 |
memcpy(u_dst, u_src, width2); |
memcpy(u_dst, u_src, width2); |
496 |
|
memcpy(v_dst, v_src, width2); |
497 |
u_src += uv_src_stride; |
u_src += uv_src_stride; |
498 |
u_dst += uv_dst_stride; |
u_dst += uv_dst_stride; |
499 |
|
v_src += uv_src_stride; |
500 |
|
v_dst += uv_dst_stride; |
501 |
} |
} |
502 |
|
} |
503 |
|
else { |
504 |
for (y = height2; y; y--) { |
for (y = height2; y; y--) { |
505 |
memcpy(v_dst, v_src, width2); |
memset(u_dst, 0x80, width2); |
506 |
v_src += uv_src_stride; |
memset(v_dst, 0x80, width2); |
507 |
|
u_dst += uv_dst_stride; |
508 |
v_dst += uv_dst_stride; |
v_dst += uv_dst_stride; |
509 |
} |
} |
510 |
} |
} |
511 |
|
} |
512 |
|
|
513 |
|
|
514 |
|
|