comparison snow.c @ 3020:c75fb0747e74 libavcodec

use h264 MC functions for 2xX Xx2 blocks in snow too
author michael
date Sun, 08 Jan 2006 01:50:34 +0000
parents 1d22fe43aa78
children e8599ab02b38
comparison
equal deleted inserted replaced
3019:08da190c65e2 3020:c75fb0747e74
2498 const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; 2498 const int scale= plane_index ? s->mv_scale : 2*s->mv_scale;
2499 int mx= block->mx*scale; 2499 int mx= block->mx*scale;
2500 int my= block->my*scale; 2500 int my= block->my*scale;
2501 const int dx= mx&15; 2501 const int dx= mx&15;
2502 const int dy= my&15; 2502 const int dy= my&15;
2503 const int tab_index= 3 - (b_w>>2) + (b_w>>4);
2503 sx += (mx>>4) - 2; 2504 sx += (mx>>4) - 2;
2504 sy += (my>>4) - 2; 2505 sy += (my>>4) - 2;
2505 src += sx + sy*stride; 2506 src += sx + sy*stride;
2506 if( (unsigned)sx >= w - b_w - 4 2507 if( (unsigned)sx >= w - b_w - 4
2507 || (unsigned)sy >= h - b_h - 4){ 2508 || (unsigned)sy >= h - b_h - 4){
2509 src= tmp + MB_SIZE; 2510 src= tmp + MB_SIZE;
2510 } 2511 }
2511 assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h); 2512 assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h);
2512 assert(!(b_w&(b_w-1))); 2513 assert(!(b_w&(b_w-1)));
2513 assert(b_w>1 && b_h>1); 2514 assert(b_w>1 && b_h>1);
2514 if((dx&3) || (dy&3) || b_w==2 || b_h==2) 2515 assert(tab_index>=0 && tab_index<4);
2516 if((dx&3) || (dy&3))
2515 mc_block(dst, src, tmp, stride, b_w, b_h, dx, dy); 2517 mc_block(dst, src, tmp, stride, b_w, b_h, dx, dy);
2516 else if(b_w==b_h) 2518 else if(b_w==b_h)
2517 s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst,src + 2 + 2*stride,stride); 2519 s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst,src + 2 + 2*stride,stride);
2518 else if(b_w==2*b_h){ 2520 else if(b_w==2*b_h){
2519 s->dsp.put_h264_qpel_pixels_tab[2-(b_h>>3)][dy+(dx>>2)](dst ,src + 2 + 2*stride,stride); 2521 s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst ,src + 2 + 2*stride,stride);
2520 s->dsp.put_h264_qpel_pixels_tab[2-(b_h>>3)][dy+(dx>>2)](dst+b_h,src + 2 + b_h + 2*stride,stride); 2522 s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst+b_h,src + 2 + b_h + 2*stride,stride);
2521 }else{ 2523 }else{
2522 assert(2*b_w==b_h); 2524 assert(2*b_w==b_h);
2523 s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst ,src + 2 + 2*stride ,stride); 2525 s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst ,src + 2 + 2*stride ,stride);
2524 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); 2526 s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst+b_w*stride,src + 2 + 2*stride+b_w*stride,stride);
2525 } 2527 }
2526 } 2528 }
2527 } 2529 }
2528 2530
2529 //FIXME name clenup (b_w, block_w, b_width stuff) 2531 //FIXME name clenup (b_w, block_w, b_width stuff)