summaryrefslogtreecommitdiff
path: root/libavcodec/armv4l
diff options
context:
space:
mode:
authorDavid Bateman <adb014@gmail.com>2007-04-06 09:59:55 +0000
committerDiego Biurrun <diego@biurrun.de>2007-04-06 09:59:55 +0000
commite8d004170191b9d86bd7089e3e19d43ab1bd815c (patch)
treea86a7b2f4c2b3146499066b0f2efa41e2cd76eea /libavcodec/armv4l
parente19fbbec9520caf4817ffb8875322ab558611a18 (diff)
IWMMXT-specific dsputils clear_blocks function.
patch by David Bateman, adb014 gmail com Originally committed as revision 8632 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/armv4l')
-rw-r--r--libavcodec/armv4l/dsputil_iwmmxt.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/armv4l/dsputil_iwmmxt.c b/libavcodec/armv4l/dsputil_iwmmxt.c
index 7536100ee7..7b28db5bb5 100644
--- a/libavcodec/armv4l/dsputil_iwmmxt.c
+++ b/libavcodec/armv4l/dsputil_iwmmxt.c
@@ -123,6 +123,25 @@ void add_pixels_clamped_iwmmxt(const DCTELEM *block, uint8_t *pixels, int line_s
: "cc", "memory", "r12");
}
+static void clear_blocks_iwmmxt(DCTELEM *blocks)
+{
+ __asm __volatile(
+ "wzero wr0 \n\t"
+ "mov r1, #(128 * 6 / 32) \n\t"
+ "1: \n\t"
+ "wstrd wr0, [%0] \n\t"
+ "wstrd wr0, [%0, #8] \n\t"
+ "wstrd wr0, [%0, #16] \n\t"
+ "wstrd wr0, [%0, #24] \n\t"
+ "subs r1, r1, #1 \n\t"
+ "add %0, %0, #32 \n\t"
+ "bne 1b \n\t"
+ : "+r"(blocks)
+ :
+ : "r1"
+ );
+}
+
static void nop(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
return;
@@ -146,6 +165,8 @@ void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx)
c->add_pixels_clamped = add_pixels_clamped_iwmmxt;
+ c->clear_blocks = clear_blocks_iwmmxt;
+
c->put_pixels_tab[0][0] = put_pixels16_iwmmxt;
c->put_pixels_tab[0][1] = put_pixels16_x2_iwmmxt;
c->put_pixels_tab[0][2] = put_pixels16_y2_iwmmxt;