Mercurial > libavcodec.hg
comparison dsputil.c @ 8760:31138c296ac6 libavcodec
ff_add_hfyu_median_prediction_mmx2
overall ffvhuff decoding speedup: 28% on core2, 25% on k8.
author | lorenm |
---|---|
date | Sun, 08 Feb 2009 17:45:30 +0000 |
parents | 2dbf614093ea |
children | bee83b3f9a6b |
comparison
equal
deleted
inserted
replaced
8759:4cea2f47219a | 8760:31138c296ac6 |
---|---|
3540 } | 3540 } |
3541 for(; i<w; i++) | 3541 for(; i<w; i++) |
3542 dst[i+0] = src1[i+0]-src2[i+0]; | 3542 dst[i+0] = src1[i+0]-src2[i+0]; |
3543 } | 3543 } |
3544 | 3544 |
3545 static void add_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *diff, int w, int *left, int *left_top){ | |
3546 int i; | |
3547 uint8_t l, lt; | |
3548 | |
3549 l= *left; | |
3550 lt= *left_top; | |
3551 | |
3552 for(i=0; i<w; i++){ | |
3553 l= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF) + diff[i]; | |
3554 lt= src1[i]; | |
3555 dst[i]= l; | |
3556 } | |
3557 | |
3558 *left= l; | |
3559 *left_top= lt; | |
3560 } | |
3561 | |
3545 static void sub_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){ | 3562 static void sub_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){ |
3546 int i; | 3563 int i; |
3547 uint8_t l, lt; | 3564 uint8_t l, lt; |
3548 | 3565 |
3549 l= *left; | 3566 l= *left; |
4552 c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c; | 4569 c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c; |
4553 | 4570 |
4554 c->add_bytes= add_bytes_c; | 4571 c->add_bytes= add_bytes_c; |
4555 c->add_bytes_l2= add_bytes_l2_c; | 4572 c->add_bytes_l2= add_bytes_l2_c; |
4556 c->diff_bytes= diff_bytes_c; | 4573 c->diff_bytes= diff_bytes_c; |
4574 c->add_hfyu_median_prediction= add_hfyu_median_prediction_c; | |
4557 c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c; | 4575 c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c; |
4558 c->bswap_buf= bswap_buf; | 4576 c->bswap_buf= bswap_buf; |
4559 #if CONFIG_PNG_DECODER | 4577 #if CONFIG_PNG_DECODER |
4560 c->add_png_paeth_prediction= ff_add_png_paeth_prediction; | 4578 c->add_png_paeth_prediction= ff_add_png_paeth_prediction; |
4561 #endif | 4579 #endif |