diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-01-08 01:50:34 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-01-08 01:50:34 +0000 |
commit | 80e44bc3bf31ead00fe3df3d1bf2a197cd0856d8 (patch) | |
tree | c0dd5ffec14e20008aaf097d39837258df28e078 /libavcodec/snow.c | |
parent | 51bb91cb2412da024a9dd0ebce3c22f52eee7ec9 (diff) | |
download | ffmpeg-80e44bc3bf31ead00fe3df3d1bf2a197cd0856d8.tar.gz |
use h264 MC functions for 2xX Xx2 blocks in snow too
Originally committed as revision 4824 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r-- | libavcodec/snow.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c index 0aa56dba61..20d24f4fcb 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -2500,6 +2500,7 @@ static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *src, uint8_t *tmp, 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 @@ static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *src, uint8_t *tmp, 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); } } } |