av_free(buf);
memcpy(dst,src_m1,width); dst += dst_wrap;  deinterlace_line(dst,src_m2,src_m1,src_0,src_0,src_0,width);
static void deinterlace_bottom_field(UINT8 *dst, int dst_wrap,                                     UINT8 *src1, int src_wrap,                                     int width, int height){    UINT8 *src, *ptr;    int y, y1, i;    UINT8 *buf;    buf = (UINT8*)av_malloc(5 * width);    src = src1;    for(y=0;y<height;y+=2) {        /* copy top field line */        memcpy(dst, src, width);        dst += dst_wrap;        src += (1 - 2) * src_wrap;        y1 = y - 2;        if (y1 >= 0 && (y1 + 4) < height) {            /* fast case : no edges */            deinterlace_line(dst, src, src_wrap, width);        } else {            /* in order to use the same function, we use an intermediate buffer */            ptr = buf;            for(i=0;i<5;i++) {                if (y1 < 0)                    memcpy(ptr, src1, width);                else if (y1 >= height)                     memcpy(ptr, src1 + (height - 1) * src_wrap, width);                else                    memcpy(ptr, src1 + y1 * src_wrap, width);                y1++;                ptr += width;            }            deinterlace_line(dst, buf, width, width);        }        dst += dst_wrap;        src += (2 + 1) * src_wrap;    }    av_free(buf);}