// mga_vid drawing functions static void write_frame_g200(uint8_t *y,uint8_t *cr, uint8_t *cb) { uint8_t *dest; uint32_t bespitch,h,w; dest = vid_data; bespitch = (mga_vid_config.src_width + 31) & ~31; for(h=0; h < mga_vid_config.src_height; h++) { memcpy(dest, y, mga_vid_config.src_width); y += mga_vid_config.src_width; dest += bespitch; } for(h=0; h < mga_vid_config.src_height/2; h++) { for(w=0; w < mga_vid_config.src_width/2; w++) { *dest++ = *cb++; *dest++ = *cr++; } dest += bespitch - mga_vid_config.src_width; } } static void write_frame_g400(uint8_t *y,uint8_t *cr, uint8_t *cb) { uint8_t *dest; uint32_t bespitch,h; dest = vid_data; bespitch = (mga_vid_config.src_width + 31) & ~31; for(h=0; h < mga_vid_config.src_height; h++) { memcpy(dest, y, mga_vid_config.src_width); y += mga_vid_config.src_width; dest += bespitch; } for(h=0; h < mga_vid_config.src_height/2; h++) { memcpy(dest, cb, mga_vid_config.src_width/2); cb += mga_vid_config.src_width/2; dest += bespitch/2; } for(h=0; h < mga_vid_config.src_height/2; h++) { memcpy(dest, cr, mga_vid_config.src_width/2); cr += mga_vid_config.src_width/2; dest += bespitch/2; } } //static void //write_slice_g200(uint8_t *y,uint8_t *cr, uint8_t *cb,uint32_t slice_num) static void draw_slice_g200(uint8_t *image[], int stride[], int width,int height,int x,int y) { uint8_t *src; uint8_t *src2; uint8_t *dest; uint32_t bespitch,h,w; bespitch = (mga_vid_config.src_width + 31) & ~31; dest = vid_data + bespitch * y * x; src = image[0]; for(h=0; h < height; h++) { memcpy(dest, src, width); src += stride[0]; dest += bespitch; } width/=2;height/=2;x/=2;y/=2; dest = vid_data + bespitch * mga_vid_config.src_height + bespitch * y + 2*x; src = image[1]; src2 = image[2]; for(h=0; h < height; h++) { for(w=0; w < width; w++) { dest[2*w+0] = src[w]; dest[2*w+1] = src2[w]; } dest += bespitch; src += stride[1]; src2+= stride[2]; } } static void draw_slice_g400(uint8_t *image[], int stride[], int w,int h,int x,int y) { uint8_t *src; uint8_t *dest; uint32_t bespitch,bespitch2; int i; bespitch = (mga_vid_config.src_width + 31) & ~31; bespitch2 = bespitch/2; dest = vid_data + bespitch * y + x; src = image[0]; for(i=0;i