summaryrefslogtreecommitdiff
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2014-01-08 00:43:09 +0100
committerDiego Biurrun <diego@biurrun.de>2014-03-26 04:31:27 -0700
commit92ba965103d3884609730ba9bf293772dc78a9ef (patch)
treee7fa31519b4bc7e18924f7da1913907ee478cfe7 /libavcodec/dsputil.c
parentda5be235250a61d6994408b054e3e3acf2e0f90f (diff)
dsputil: Move draw_edges and clear_block* out of dsputil_template
The functions are not used templatized.
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 843c244e5b..534bc92d40 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -2402,6 +2402,44 @@ static void jref_idct_add(uint8_t *dest, int line_size, int16_t *block)
add_pixels_clamped_c(block, dest, line_size);
}
+/* draw the edges of width 'w' of an image of size width, height */
+// FIXME: Check that this is OK for MPEG-4 interlaced.
+static void draw_edges_8_c(uint8_t *buf, int wrap, int width, int height,
+ int w, int h, int sides)
+{
+ uint8_t *ptr = buf, *last_line;
+ int i;
+
+ /* left and right */
+ for (i = 0; i < height; i++) {
+ memset(ptr - w, ptr[0], w);
+ memset(ptr + width, ptr[width - 1], w);
+ ptr += wrap;
+ }
+
+ /* top and bottom + corners */
+ buf -= w;
+ last_line = buf + (height - 1) * wrap;
+ if (sides & EDGE_TOP)
+ for (i = 0; i < h; i++)
+ // top
+ memcpy(buf - (i + 1) * wrap, buf, width + w + w);
+ if (sides & EDGE_BOTTOM)
+ for (i = 0; i < h; i++)
+ // bottom
+ memcpy(last_line + (i + 1) * wrap, last_line, width + w + w);
+}
+
+static void clear_block_8_c(int16_t *block)
+{
+ memset(block, 0, sizeof(int16_t) * 64);
+}
+
+static void clear_blocks_8_c(int16_t *blocks)
+{
+ memset(blocks, 0, sizeof(int16_t) * 6 * 64);
+}
+
/* init static data */
av_cold void ff_dsputil_static_init(void)
{