112
static void gf_yuv_10_load_lines_planar(unsigned char *dst, s32 dststride, unsigned char *_y_src, unsigned char *_u_src, unsigned char *_v_src, s32 y_stride, s32 uv_stride, s32 width)
115
unsigned char *dst2 = (unsigned char *) dst + dststride;
116
unsigned short *y_src2 = (unsigned short *) (_y_src + y_stride);
117
unsigned short *y_src = (unsigned short *)_y_src;
118
unsigned short *u_src = (unsigned short *)_u_src;
119
unsigned short *v_src = (unsigned short *)_v_src;
123
for (x = 0; x < hw; x++) {
125
s32 b_u, g_uv, r_v, rgb_y;
131
g_uv = G_U[u] + G_V[v];
134
rgb_y = RGB_Y[*y_src >> 2];
135
dst[0] = col_clip( (rgb_y + r_v) >> SCALEBITS_OUT);
136
dst[1] = col_clip( (rgb_y - g_uv) >> SCALEBITS_OUT);
137
dst[2] = col_clip( (rgb_y + b_u) >> SCALEBITS_OUT);
141
rgb_y = RGB_Y[*y_src >> 2];
142
dst[4] = col_clip( (rgb_y + r_v) >> SCALEBITS_OUT);
143
dst[5] = col_clip( (rgb_y - g_uv) >> SCALEBITS_OUT);
144
dst[6] = col_clip( (rgb_y + b_u) >> SCALEBITS_OUT);
148
rgb_y = RGB_Y[*y_src2 >> 2];
149
dst2[0] = col_clip( (rgb_y + r_v) >> SCALEBITS_OUT);
150
dst2[1] = col_clip( (rgb_y - g_uv) >> SCALEBITS_OUT);
151
dst2[2] = col_clip( (rgb_y + b_u) >> SCALEBITS_OUT);
155
rgb_y = RGB_Y[*y_src2 >> 2];
156
dst2[4] = col_clip( (rgb_y + r_v) >> SCALEBITS_OUT);
157
dst2[5] = col_clip( (rgb_y - g_uv) >> SCALEBITS_OUT);
158
dst2[6] = col_clip( (rgb_y + b_u) >> SCALEBITS_OUT);
112
168
static void gf_yuv_load_lines_packed(unsigned char *dst, s32 dststride, unsigned char *y_src, unsigned char *u_src, unsigned char * v_src, s32 width)
745
801
static void load_line_bgr_32(u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
747
804
src_bits += x_offset*4 + y_offset*y_pitch;
748
memcpy(dst_bits, src_bits, sizeof(char)*4*width);
805
for (i=0; i<width; i++) {
806
dst_bits[2] = *src_bits++;
807
dst_bits[1] = *src_bits++;
808
dst_bits[0] = *src_bits++;
809
dst_bits[3] = *src_bits++;
751
static void load_line_yv12(char *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
814
static void load_line_yv12(char *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits, u8 *pU, u8 *pV)
754
817
pY = (u8 *)src_bits;
755
pU = (u8 *)src_bits + y_pitch*height;
756
pV = (u8 *)src_bits + 5*y_pitch*height/4;
819
pU = (u8 *)src_bits + y_pitch*height;
820
pV = (u8 *)src_bits + 5*y_pitch*height/4;
757
823
pY += x_offset + y_offset*y_pitch;
758
824
pU += x_offset/2 + y_offset*y_pitch/4;
759
825
pV += x_offset/2 + y_offset*y_pitch/4;
760
826
gf_yuv_load_lines_planar((unsigned char*)dst_bits, 4*width, pY, pU, pV, y_pitch, y_pitch/2, width);
763
static void load_line_yuva(char *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
765
u8 *pY, *pU, *pV, *pA;
829
static void load_line_yv12_10(char *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits, u8 *pU, u8 *pV)
834
pU = (u8 *)src_bits + y_pitch*height;
835
pV = (u8 *)src_bits + 5*y_pitch*height/4;
838
pY += x_offset + y_offset*y_pitch;
839
pU += x_offset/2 + y_offset*y_pitch/4;
840
pV += x_offset/2 + y_offset*y_pitch/4;
841
gf_yuv_10_load_lines_planar((unsigned char*)dst_bits, 4*width, pY, pU, pV, y_pitch, y_pitch/2, width);
844
static void load_line_yuva(char *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits, u8 *pU, u8 *pV, u8 *pA)
766
847
pY = (u8*)src_bits;
767
pU = (u8*)src_bits + y_pitch*height;
768
pV = (u8*)src_bits + 5*y_pitch*height/4;
769
pA = (u8*)src_bits + 3*y_pitch*height/2;
849
pU = (u8*)src_bits + y_pitch*height;
850
pV = (u8*)src_bits + 5*y_pitch*height/4;
851
pA = (u8*)src_bits + 3*y_pitch*height/2;
771
854
pY += x_offset + y_offset*y_pitch;
772
855
pU += x_offset/2 + y_offset*y_pitch/4;
1030
1117
if (flip) the_row = src->height-2 - the_row;
1031
1118
if (yuv_planar_type==1) {
1032
load_line_yv12(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp);
1119
load_line_yv12(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp, src->u_ptr, src->v_ptr);
1120
} else if (yuv_planar_type==3) {
1121
load_line_yv12_10(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp, src->u_ptr, src->v_ptr);
1034
load_line_yuva(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp);
1123
load_line_yuva(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp, src->u_ptr, src->v_ptr, src->a_ptr);
1036
1125
the_row = src_row - 1;
1064
1153
if (flip) the_row = src->height-2 - the_row;
1065
1154
if (yuv_planar_type==1) {
1066
load_line_yv12(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp);
1155
load_line_yv12(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp, src->u_ptr, src->v_ptr);
1156
} else if (yuv_planar_type==3) {
1157
load_line_yv12_10(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp, src->u_ptr, src->v_ptr);
1068
load_line_yuva(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp);
1159
load_line_yuva(src->video_buffer, x_off, the_row, src->pitch_y, src_w, src->height, tmp, src->u_ptr, src->v_ptr, src->a_ptr);
1071
1162
rows = flip ? tmp + src_w * 4 : tmp;