25                                int block_w, 
int block_h,
 
   26                                int src_x, 
int src_y, 
int w, 
int h)
 
   29     int start_y, start_x, end_y, end_x;
 
   35         src -= src_y * src_stride;
 
   36         src += (h - 1) * src_stride;
 
   38     } 
else if (src_y <= -block_h) {
 
   39         src -= src_y * src_stride;
 
   40         src += (1 - block_h) * src_stride;
 
   44         src  += (w - 1 - src_x) * 
sizeof(
pixel);
 
   46     } 
else if (src_x <= -block_w) {
 
   47         src  += (1 - block_w - src_x) * 
sizeof(
pixel);
 
   51     start_y = 
FFMAX(0, -src_y);
 
   52     start_x = 
FFMAX(0, -src_x);
 
   53     end_y = 
FFMIN(block_h, h-src_y);
 
   54     end_x = 
FFMIN(block_w, w-src_x);
 
   59     src += start_y * src_stride + start_x * 
sizeof(
pixel);
 
   63     for (y = 0; y < start_y; y++) {
 
   69     for (; y < end_y; y++) {
 
   77     for (; y < block_h; y++) {
 
   82     buf -= block_h * buf_stride + start_x * 
sizeof(
pixel);
 
   87         for(x = 0; x < start_x; x++) {
 
   88             bufp[x] = bufp[start_x];
 
   92         for (x = end_x; x < block_w; x++) {
 
   93             bufp[x] = bufp[end_x - 1];