changeset 4788:ded34b64b01a libavcodec

IWMMXT-specific dsputils clear_blocks function. patch by David Bateman, adb014 gmail com
author diego
date Fri, 06 Apr 2007 09:59:55 +0000
parents 94301f9f53f7
children bf62c8a0d2fb
files armv4l/dsputil_iwmmxt.c
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/armv4l/dsputil_iwmmxt.c	Fri Apr 06 04:40:13 2007 +0000
+++ b/armv4l/dsputil_iwmmxt.c	Fri Apr 06 09:59:55 2007 +0000
@@ -123,6 +123,25 @@
         : "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 @@
 
     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;