diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-11-14 19:20:04 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-11-14 19:20:04 +0000 |
commit | 11f18fafcab80ef52391e6e29c5a1a8f6f22c4e3 (patch) | |
tree | 536c67a677f6aecf343d85251f933e7ab1885885 /libavcodec/dsputil.c | |
parent | 5844544064d18f0fc738a5849b1c3b4a0ec8022a (diff) | |
download | ffmpeg-11f18fafcab80ef52391e6e29c5a1a8f6f22c4e3.tar.gz |
huffyuv
Originally committed as revision 1211 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index affdfc5bd5..5952d92463 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -1342,6 +1342,38 @@ static void clear_blocks_c(DCTELEM *blocks) memset(blocks, 0, sizeof(DCTELEM)*6*64); } +static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){ + int i; + for(i=0; i+7<w; i++){ + dst[i+0] += src[i+0]; + dst[i+1] += src[i+1]; + dst[i+2] += src[i+2]; + dst[i+3] += src[i+3]; + dst[i+4] += src[i+4]; + dst[i+5] += src[i+5]; + dst[i+6] += src[i+6]; + dst[i+7] += src[i+7]; + } + for(; i<w; i++) + dst[i+0] += src[i+0]; +} + +static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ + int i; + for(i=0; i+7<w; i++){ + dst[i+0] = src1[i+0]-src2[i+0]; + dst[i+1] = src1[i+1]-src2[i+1]; + dst[i+2] = src1[i+2]-src2[i+2]; + dst[i+3] = src1[i+3]-src2[i+3]; + dst[i+4] = src1[i+4]-src2[i+4]; + dst[i+5] = src1[i+5]-src2[i+5]; + dst[i+6] = src1[i+6]-src2[i+6]; + dst[i+7] = src1[i+7]-src2[i+7]; + } + for(; i<w; i++) + dst[i+0] = src1[i+0]-src2[i+0]; +} + void dsputil_init(DSPContext* c, unsigned mask) { static int init_done = 0; @@ -1431,6 +1463,9 @@ void dsputil_init(DSPContext* c, unsigned mask) /* dspfunc(avg_no_rnd_qpel, 1, 8); */ #undef dspfunc + c->add_bytes= add_bytes_c; + c->diff_bytes= diff_bytes_c; + #ifdef HAVE_MMX dsputil_init_mmx(c, mask); if (ff_bit_exact) |