Revision d375c104 libavcodec/dsputil.c

View differences:

libavcodec/dsputil.c
298 298

  
299 299
/* draw the edges of width 'w' of an image of size width, height */
300 300
//FIXME check that this is ok for mpeg4 interlaced
301
static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w)
301
static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w, int sides)
302 302
{
303 303
    uint8_t *ptr, *last_line;
304 304
    int i;
......
306 306
    last_line = buf + (height - 1) * wrap;
307 307
    for(i=0;i<w;i++) {
308 308
        /* top and bottom */
309
        memcpy(buf - (i + 1) * wrap, buf, width);
310
        memcpy(last_line + (i + 1) * wrap, last_line, width);
309
        if (sides&EDGE_TOP)    memcpy(buf - (i + 1) * wrap, buf, width);
310
        if (sides&EDGE_BOTTOM) memcpy(last_line + (i + 1) * wrap, last_line, width);
311 311
    }
312 312
    /* left and right */
313 313
    ptr = buf;
......
318 318
    }
319 319
    /* corners */
320 320
    for(i=0;i<w;i++) {
321
        memset(buf - (i + 1) * wrap - w, buf[0], w); /* top left */
322
        memset(buf - (i + 1) * wrap + width, buf[width-1], w); /* top right */
323
        memset(last_line + (i + 1) * wrap - w, last_line[0], w); /* top left */
324
        memset(last_line + (i + 1) * wrap + width, last_line[width-1], w); /* top right */
321
        if (sides&EDGE_TOP) {
322
            memset(buf - (i + 1) * wrap - w, buf[0], w); /* top left */
323
            memset(buf - (i + 1) * wrap + width, buf[width-1], w); /* top right */
324
        }
325

  
326
        if (sides&EDGE_BOTTOM) {
327
            memset(last_line + (i + 1) * wrap - w, last_line[0], w); /* top left */
328
            memset(last_line + (i + 1) * wrap + width, last_line[width-1], w); /* top right */
329
        }
325 330
    }
326 331
}
327 332

  

Also available in: Unified diff