aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-03-22 22:36:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-03-22 22:36:57 +0100
commitd375c1040032ed42f84b7d4ea53baad4a661b628 (patch)
treef5bb63830cbc49106376a418c292c452f3b0728d /libavcodec/dsputil.c
parent038566a5edc73205120f30d41233a9911a42da44 (diff)
downloadffmpeg-d375c1040032ed42f84b7d4ea53baad4a661b628.tar.gz
Fake-Merge remote-tracking branch 'ffmpeg-mt/master'
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index b293642b1d..d4e538cd07 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -298,7 +298,7 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
/* 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)
+static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w, int sides)
{
uint8_t *ptr, *last_line;
int i;
@@ -306,8 +306,8 @@ static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w)
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);
+ if (sides&EDGE_TOP) memcpy(buf - (i + 1) * wrap, buf, width);
+ if (sides&EDGE_BOTTOM) memcpy(last_line + (i + 1) * wrap, last_line, width);
}
/* left and right */
ptr = buf;
@@ -318,10 +318,15 @@ static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w)
}
/* 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 */
+ if (sides&EDGE_TOP) {
+ memset(buf - (i + 1) * wrap - w, buf[0], w); /* top left */
+ memset(buf - (i + 1) * wrap + width, buf[width-1], w); /* top right */
+ }
+
+ if (sides&EDGE_BOTTOM) {
+ 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 */
+ }
}
}