diff options
author | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2008-12-12 09:59:00 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2008-12-12 09:59:00 +0000 |
commit | 64adf4f28d2f29e4e51dbd219a8c11e56547480b (patch) | |
tree | 47c5fbda66e269c14f2d6ed32bcaf70fdfaa45be | |
parent | c0a8f8d4980a273be9c8ead6c5c29fe38242d8da (diff) | |
download | ffmpeg-64adf4f28d2f29e4e51dbd219a8c11e56547480b.tar.gz |
add Altivec implementation of clear_block
Originally committed as revision 16078 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 */ |