Mercurial > libavcodec.hg
diff mpegvideo.c @ 6437:5154ab444372 libavcodec
move draw_edges() into dsputil
author | aurel |
---|---|
date | Tue, 04 Mar 2008 00:07:41 +0000 |
parents | 931ca319f2fe |
children | e1dd408a7864 |
line wrap: on
line diff
--- a/mpegvideo.c Mon Mar 03 23:14:25 2008 +0000 +++ b/mpegvideo.c Tue Mar 04 00:07:41 2008 +0000 @@ -53,14 +53,11 @@ DCTELEM *block, int n, int qscale); static void dct_unquantize_h263_inter_c(MpegEncContext *s, DCTELEM *block, int n, int qscale); -static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w); extern int XVMC_field_start(MpegEncContext*s, AVCodecContext *avctx); extern void XVMC_field_end(MpegEncContext *s); extern void XVMC_decode_mb(MpegEncContext *s); -void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w)= draw_edges_c; - /* enable all paranoid tests for rounding, overflows, etc... */ //#define PARANOID @@ -793,35 +790,6 @@ } } -/* draw the edges of width 'w' of an image of size width, height */ -//FIXME check that this is ok for mpeg4 interlaced -static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w) -{ - uint8_t *ptr, *last_line; - int i; - - last_line = buf + (height - 1) * wrap; - for(i=0;i<w;i++) { - /* top and bottom */ - memcpy(buf - (i + 1) * wrap, buf, width); - memcpy(last_line + (i + 1) * wrap, last_line, width); - } - /* left and right */ - ptr = buf; - for(i=0;i<height;i++) { - memset(ptr - w, ptr[0], w); - memset(ptr + width, ptr[width-1], w); - ptr += wrap; - } - /* corners */ - for(i=0;i<w;i++) { - memset(buf - (i + 1) * wrap - w, buf[0], w); /* top left */ - memset(buf - (i + 1) * wrap + width, buf[width-1], w); /* top right */ - memset(last_line + (i + 1) * wrap - w, last_line[0], w); /* top left */ - memset(last_line + (i + 1) * wrap + width, last_line[width-1], w); /* top right */ - } -} - int ff_find_unused_picture(MpegEncContext *s, int shared){ int i; @@ -1015,9 +983,9 @@ }else #endif if(s->unrestricted_mv && s->current_picture.reference && !s->intra_only && !(s->flags&CODEC_FLAG_EMU_EDGE)) { - draw_edges(s->current_picture.data[0], s->linesize , s->h_edge_pos , s->v_edge_pos , EDGE_WIDTH ); - draw_edges(s->current_picture.data[1], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2); - draw_edges(s->current_picture.data[2], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2); + s->dsp.draw_edges(s->current_picture.data[0], s->linesize , s->h_edge_pos , s->v_edge_pos , EDGE_WIDTH ); + s->dsp.draw_edges(s->current_picture.data[1], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2); + s->dsp.draw_edges(s->current_picture.data[2], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2); } emms_c();