diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2009-02-08 17:45:30 +0000 |
---|---|---|
committer | Loren Merritt <lorenm@u.washington.edu> | 2009-02-08 17:45:30 +0000 |
commit | 3daa434a40c56deef91c9d545552349d661105e9 (patch) | |
tree | a6baca6ac5d30f4f665918fddd0cf3b5e774d5d9 /libavcodec/dsputil.c | |
parent | 6166516d1f0df6cc8f96e7685e78ef75541b9698 (diff) | |
download | ffmpeg-streaming-3daa434a40c56deef91c9d545552349d661105e9.zip ffmpeg-streaming-3daa434a40c56deef91c9d545552349d661105e9.tar.gz |
ff_add_hfyu_median_prediction_mmx2
overall ffvhuff decoding speedup: 28% on core2, 25% on k8.
Originally committed as revision 17059 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 9baa08d..d4d4d2d 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -3542,6 +3542,23 @@ static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ dst[i+0] = src1[i+0]-src2[i+0]; } +static void add_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *diff, int w, int *left, int *left_top){ + int i; + uint8_t l, lt; + + l= *left; + lt= *left_top; + + for(i=0; i<w; i++){ + l= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF) + diff[i]; + lt= src1[i]; + dst[i]= l; + } + + *left= l; + *left_top= lt; +} + static void sub_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){ int i; uint8_t l, lt; @@ -4554,6 +4571,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->add_bytes= add_bytes_c; c->add_bytes_l2= add_bytes_l2_c; c->diff_bytes= diff_bytes_c; + c->add_hfyu_median_prediction= add_hfyu_median_prediction_c; c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c; c->bswap_buf= bswap_buf; #if CONFIG_PNG_DECODER |