Mercurial > libavcodec.hg
comparison dsputil.c @ 1527:8ffd0c00e6df libavcodec
mmx2 optimization of huffyuv median encoding
author | michael |
---|---|
date | Mon, 13 Oct 2003 17:27:30 +0000 |
parents | 2114c1e206e8 |
children | 5d53c03186a1 |
comparison
equal
deleted
inserted
replaced
1526:fcfa169fdbf8 | 1527:8ffd0c00e6df |
---|---|
2524 } | 2524 } |
2525 for(; i<w; i++) | 2525 for(; i<w; i++) |
2526 dst[i+0] = src1[i+0]-src2[i+0]; | 2526 dst[i+0] = src1[i+0]-src2[i+0]; |
2527 } | 2527 } |
2528 | 2528 |
2529 static void sub_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){ | |
2530 int i; | |
2531 uint8_t l, lt; | |
2532 | |
2533 l= *left; | |
2534 lt= *left_top; | |
2535 | |
2536 for(i=0; i<w; i++){ | |
2537 const int pred= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF); | |
2538 lt= src1[i]; | |
2539 l= src2[i]; | |
2540 dst[i]= l - pred; | |
2541 } | |
2542 | |
2543 *left= l; | |
2544 *left_top= lt; | |
2545 } | |
2546 | |
2529 #define BUTTERFLY2(o1,o2,i1,i2) \ | 2547 #define BUTTERFLY2(o1,o2,i1,i2) \ |
2530 o1= (i1)+(i2);\ | 2548 o1= (i1)+(i2);\ |
2531 o2= (i1)-(i2); | 2549 o2= (i1)-(i2); |
2532 | 2550 |
2533 #define BUTTERFLY1(x,y) \ | 2551 #define BUTTERFLY1(x,y) \ |
3005 c->bit[0]= bit16x16_c; | 3023 c->bit[0]= bit16x16_c; |
3006 c->bit[1]= bit8x8_c; | 3024 c->bit[1]= bit8x8_c; |
3007 | 3025 |
3008 c->add_bytes= add_bytes_c; | 3026 c->add_bytes= add_bytes_c; |
3009 c->diff_bytes= diff_bytes_c; | 3027 c->diff_bytes= diff_bytes_c; |
3028 c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c; | |
3010 c->bswap_buf= bswap_buf; | 3029 c->bswap_buf= bswap_buf; |
3011 | 3030 |
3012 #ifdef HAVE_MMX | 3031 #ifdef HAVE_MMX |
3013 dsputil_init_mmx(c, avctx); | 3032 dsputil_init_mmx(c, avctx); |
3014 #endif | 3033 #endif |