From 64adf4f28d2f29e4e51dbd219a8c11e56547480b Mon Sep 17 00:00:00 2001 From: Guillaume Poirier Date: Fri, 12 Dec 2008 09:59:00 +0000 Subject: [PATCH] add Altivec implementation of clear_block Originally committed as revision 16078 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ppc/dsputil_altivec.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libavcodec/ppc/dsputil_altivec.c b/libavcodec/ppc/dsputil_altivec.c index 6ff219e3b0..44cce6ae16 100644 --- a/libavcodec/ppc/dsputil_altivec.c +++ b/libavcodec/ppc/dsputil_altivec.c @@ -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 @@ void diff_pixels_altivec(DCTELEM *restrict block, const uint8_t *s1, } } + +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 @@ void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx) 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 */