changeset 8307:bf5bc1f4cba0 libavcodec

add Altivec implementation of clear_block
author gpoirier
date Fri, 12 Dec 2008 09:59:00 +0000
parents ddecbc18fe94
children 61cfb1dcfae5
files ppc/dsputil_altivec.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ppc/dsputil_altivec.c	Fri Dec 12 05:12:51 2008 +0000
+++ b/ppc/dsputil_altivec.c	Fri Dec 12 09:59:00 2008 +0000
@@ -26,6 +26,7 @@
 
 #include "dsputil_ppc.h"
 #include "util_altivec.h"
+#include "types_altivec.h"
 
 int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
 {
@@ -573,6 +574,20 @@
     }
 }
 
+
+static void clear_block_altivec(DCTELEM *block) {
+    LOAD_ZERO;
+    vec_st(zero_s16v,   0, block);
+    vec_st(zero_s16v,  16, block);
+    vec_st(zero_s16v,  32, block);
+    vec_st(zero_s16v,  48, block);
+    vec_st(zero_s16v,  64, block);
+    vec_st(zero_s16v,  80, block);
+    vec_st(zero_s16v,  96, block);
+    vec_st(zero_s16v, 112, block);
+}
+
+
 void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) {
     register int i;
     register vector unsigned char vdst, vsrc;
@@ -1420,6 +1435,7 @@
     c->pix_sum = pix_sum_altivec;
     c->diff_pixels = diff_pixels_altivec;
     c->get_pixels = get_pixels_altivec;
+    c->clear_block = clear_block_altivec;
     c->add_bytes= add_bytes_altivec;
     c->put_pixels_tab[0][0] = put_pixels16_altivec;
     /* the two functions do the same thing, so use the same code */