diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-20 03:50:43 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-20 04:06:04 +0100 |
commit | da0684820a58ce42a5a2953cbce417e06a54be8f (patch) | |
tree | c2d468b28cc427bf5f37ab4074d028494ee4cdce /libavcodec/huffyuvdec.c | |
parent | f29cdbe1b59a0d997733b507041e15ec68cef00c (diff) | |
download | ffmpeg-da0684820a58ce42a5a2953cbce417e06a54be8f.tar.gz |
avcodec/dsputil/huffyuv: move diff int16 and add int16 to dsputil
This also fixes masking the bits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/huffyuvdec.c')
-rw-r--r-- | libavcodec/huffyuvdec.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index ced22f620a..aafa9e4abb 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -708,20 +708,7 @@ static void add_bytes(HYuvContext *s, uint8_t *dst, uint8_t *src, int w) if (s->bps <= 8) { s->dsp.add_bytes(dst, src, w); } else { - //FIXME optimize - const uint16_t *src16 = (const uint16_t *)src; - uint16_t *dst16 = ( uint16_t *)dst; - long i; - unsigned long msb = 0x1000100010001ULL << (s->bps-1); - unsigned long lsb = msb - 0x1000100010001ULL; - unsigned long mask = lsb + msb; - for (i = 0; i <= w - (int)sizeof(long)/2; i += sizeof(long)/2) { - long a = *(long*)(src16+i); - long b = *(long*)(dst16+i); - *(long*)(dst16+i) = ((a&lsb) + (b&lsb)) ^ ((a^b)&msb); - } - for(; i<w; i++) - dst16[i] = (dst16[i] + src16[i]) & mask; + s->dsp.add_int16((uint16_t*)dst, (const uint16_t*)src, s->n - 1, w); } } |