Mercurial > libavcodec.hg
comparison dsputil.c @ 3663:8e180a3276fe libavcodec
New function for chroma MC (will be used in VC-1)
author | kostya |
---|---|
date | Sat, 02 Sep 2006 04:52:00 +0000 |
parents | 1cc5bdadd487 |
children | 9d942506b1f2 |
comparison
equal
deleted
inserted
replaced
3662:fc714e9a5419 | 3663:8e180a3276fe |
---|---|
1484 | 1484 |
1485 H264_CHROMA_MC(put_ , op_put) | 1485 H264_CHROMA_MC(put_ , op_put) |
1486 H264_CHROMA_MC(avg_ , op_avg) | 1486 H264_CHROMA_MC(avg_ , op_avg) |
1487 #undef op_avg | 1487 #undef op_avg |
1488 #undef op_put | 1488 #undef op_put |
1489 | |
1490 static void put_no_rnd_h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){ | |
1491 const int A=(8-x)*(8-y); | |
1492 const int B=( x)*(8-y); | |
1493 const int C=(8-x)*( y); | |
1494 const int D=( x)*( y); | |
1495 int i; | |
1496 | |
1497 assert(x<8 && y<8 && x>=0 && y>=0); | |
1498 | |
1499 for(i=0; i<h; i++) | |
1500 { | |
1501 dst[0] = (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + 32 - 4) >> 6; | |
1502 dst[1] = (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + 32 - 4) >> 6; | |
1503 dst[2] = (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + 32 - 4) >> 6; | |
1504 dst[3] = (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + 32 - 4) >> 6; | |
1505 dst[4] = (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + 32 - 4) >> 6; | |
1506 dst[5] = (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + 32 - 4) >> 6; | |
1507 dst[6] = (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + 32 - 4) >> 6; | |
1508 dst[7] = (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + 32 - 4) >> 6; | |
1509 dst+= stride; | |
1510 src+= stride; | |
1511 } | |
1512 } | |
1489 | 1513 |
1490 static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) | 1514 static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) |
1491 { | 1515 { |
1492 int i; | 1516 int i; |
1493 for(i=0; i<h; i++) | 1517 for(i=0; i<h; i++) |
4032 c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_c; | 4056 c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_c; |
4033 c->put_h264_chroma_pixels_tab[2]= put_h264_chroma_mc2_c; | 4057 c->put_h264_chroma_pixels_tab[2]= put_h264_chroma_mc2_c; |
4034 c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_c; | 4058 c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_c; |
4035 c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_c; | 4059 c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_c; |
4036 c->avg_h264_chroma_pixels_tab[2]= avg_h264_chroma_mc2_c; | 4060 c->avg_h264_chroma_pixels_tab[2]= avg_h264_chroma_mc2_c; |
4061 c->put_no_rnd_h264_chroma_pixels_tab[0]= put_no_rnd_h264_chroma_mc8_c; | |
4037 | 4062 |
4038 c->weight_h264_pixels_tab[0]= weight_h264_pixels16x16_c; | 4063 c->weight_h264_pixels_tab[0]= weight_h264_pixels16x16_c; |
4039 c->weight_h264_pixels_tab[1]= weight_h264_pixels16x8_c; | 4064 c->weight_h264_pixels_tab[1]= weight_h264_pixels16x8_c; |
4040 c->weight_h264_pixels_tab[2]= weight_h264_pixels8x16_c; | 4065 c->weight_h264_pixels_tab[2]= weight_h264_pixels8x16_c; |
4041 c->weight_h264_pixels_tab[3]= weight_h264_pixels8x8_c; | 4066 c->weight_h264_pixels_tab[3]= weight_h264_pixels8x8_c; |