# HG changeset patch # User michael # Date 1136685034 0 # Node ID c75fb0747e740cea622731a40a91f43747612dc4 # Parent 08da190c65e2ffe6870053a46c10a7530af7f6e3 use h264 MC functions for 2xX Xx2 blocks in snow too diff -r 08da190c65e2 -r c75fb0747e74 dsputil.c --- a/dsputil.c Sat Jan 07 23:38:17 2006 +0000 +++ b/dsputil.c Sun Jan 08 01:50:34 2006 +0000 @@ -1487,6 +1487,17 @@ #undef op_avg #undef op_put +static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for(i=0; il) #define LD64(a) (((const struct unaligned_64 *) (a))->l) +#define ST16(a, b) (((struct unaligned_16 *) (a))->l) = (b) #define ST32(a, b) (((struct unaligned_32 *) (a))->l) = (b) #else /* __GNUC__ */ diff -r 08da190c65e2 -r c75fb0747e74 snow.c --- a/snow.c Sat Jan 07 23:38:17 2006 +0000 +++ b/snow.c Sun Jan 08 01:50:34 2006 +0000 @@ -2500,6 +2500,7 @@ int my= block->my*scale; const int dx= mx&15; const int dy= my&15; + const int tab_index= 3 - (b_w>>2) + (b_w>>4); sx += (mx>>4) - 2; sy += (my>>4) - 2; src += sx + sy*stride; @@ -2511,17 +2512,18 @@ assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h); assert(!(b_w&(b_w-1))); assert(b_w>1 && b_h>1); - if((dx&3) || (dy&3) || b_w==2 || b_h==2) + assert(tab_index>=0 && tab_index<4); + if((dx&3) || (dy&3)) mc_block(dst, src, tmp, stride, b_w, b_h, dx, dy); else if(b_w==b_h) - s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst,src + 2 + 2*stride,stride); + s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst,src + 2 + 2*stride,stride); else if(b_w==2*b_h){ - s->dsp.put_h264_qpel_pixels_tab[2-(b_h>>3)][dy+(dx>>2)](dst ,src + 2 + 2*stride,stride); - s->dsp.put_h264_qpel_pixels_tab[2-(b_h>>3)][dy+(dx>>2)](dst+b_h,src + 2 + b_h + 2*stride,stride); + s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst ,src + 2 + 2*stride,stride); + s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst+b_h,src + 2 + b_h + 2*stride,stride); }else{ assert(2*b_w==b_h); - s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst ,src + 2 + 2*stride ,stride); - s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst+b_w*stride,src + 2 + 2*stride+b_w*stride,stride); + s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst ,src + 2 + 2*stride ,stride); + s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst+b_w*stride,src + 2 + 2*stride+b_w*stride,stride); } } }