add Altivec implementation of clear_block

Originally committed as revision 16078 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Guillaume Poirier 2008-12-12 09:59:00 +00:00
parent c0a8f8d498
commit 64adf4f28d

View File

@ -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 */