static int motion_inter_block (bit_buffer_t *bitbuf,

			       uint8_t *current, uint8_t *previous, int pitch,

			       svq1_pmv_t *motion, int x, int y) {

  uint8_t    *src;

  uint8_t    *dst;

  svq1_pmv_t  mv;

  svq1_pmv_t *pmv[3];

  int	      result;



  /* predict and decode motion vector */

  pmv[0] = &motion[0];

  pmv[1] = &motion[(x / 8) + 2];

  pmv[2] = &motion[(x / 8) + 4];



  if (y == 0) {

    pmv[1] = pmv[0];

    pmv[2] = pmv[0];

  }



  result = decode_motion_vector (bitbuf, &mv, pmv);



  if (result != 0)

    return result;



  motion[0].x		= mv.x;

  motion[0].y		= mv.y;

  motion[(x / 8) + 2].x	= mv.x;

  motion[(x / 8) + 2].y	= mv.y;

  motion[(x / 8) + 3].x	= mv.x;

  motion[(x / 8) + 3].y	= mv.y;



  src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1))*pitch];

  dst = current;



  put_pixels_tab[((mv.y & 1) << 1) | (mv.x & 1)](dst,src,pitch,16);

  put_pixels_tab[((mv.y & 1) << 1) | (mv.x & 1)](dst+8,src+8,pitch,16);



  return 0;

}

static int motion_inter_block (bit_buffer_t *bitbuf,

			       uint8_t *current, uint8_t *previous, int pitch,

			       svq1_pmv_t *motion, int x, int y) {

  uint8_t    *src;

  uint8_t    *dst;

  svq1_pmv_t  mv;

  svq1_pmv_t *pmv[3];

  int	      result;



  

  pmv[0] = &motion[0];

  pmv[1] = &motion[(x / 8) + 2];

  pmv[2] = &motion[(x / 8) + 4];



  if (y == 0) {

    pmv[1] = pmv[0];

    pmv[2] = pmv[0];

  }



  result = decode_motion_vector (bitbuf, &mv, pmv);



  if (result != 0)

    return result;



  motion[0].x		= mv.x;

  motion[0].y		= mv.y;

  motion[(x / 8) + 2].x	= mv.x;

  motion[(x / 8) + 2].y	= mv.y;

  motion[(x / 8) + 3].x	= mv.x;

  motion[(x / 8) + 3].y	= mv.y;



  src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1))*pitch];

  dst = current;



  put_pixels_tab[((mv.y & 1) << 1) | (mv.x & 1)](dst,src,pitch,16);

  put_pixels_tab[((mv.y & 1) << 1) | (mv.x & 1)](dst+8,src+8,pitch,16);



  return 0;

}

static int FUNC_0 (bit_buffer_t *VAR_0,

			       uint8_t *VAR_1, uint8_t *VAR_2, int VAR_3,

			       svq1_pmv_t *VAR_4, int VAR_5, int VAR_6) {

  uint8_t    *src;

  uint8_t    *dst;

  svq1_pmv_t  mv;

  svq1_pmv_t *pmv[3];

  int	      VAR_7;



  

  pmv[0] = &VAR_4[0];

  pmv[1] = &VAR_4[(VAR_5 / 8) + 2];

  pmv[2] = &VAR_4[(VAR_5 / 8) + 4];



  if (VAR_6 == 0) {

    pmv[1] = pmv[0];

    pmv[2] = pmv[0];

  }



  VAR_7 = decode_motion_vector (VAR_0, &mv, pmv);



  if (VAR_7 != 0)

    return VAR_7;



  VAR_4[0].VAR_5		= mv.VAR_5;

  VAR_4[0].VAR_6		= mv.VAR_6;

  VAR_4[(VAR_5 / 8) + 2].VAR_5	= mv.VAR_5;

  VAR_4[(VAR_5 / 8) + 2].VAR_6	= mv.VAR_6;

  VAR_4[(VAR_5 / 8) + 3].VAR_5	= mv.VAR_5;

  VAR_4[(VAR_5 / 8) + 3].VAR_6	= mv.VAR_6;



  src = &VAR_2[(VAR_5 + (mv.VAR_5 >> 1)) + (VAR_6 + (mv.VAR_6 >> 1))*VAR_3];

  dst = VAR_1;



  put_pixels_tab[((mv.VAR_6 & 1) << 1) | (mv.VAR_5 & 1)](dst,src,VAR_3,16);

  put_pixels_tab[((mv.VAR_6 & 1) << 1) | (mv.VAR_5 & 1)](dst+8,src+8,VAR_3,16);



  return 0;

}

static int FUNC_0 (bit_buffer_t *VAR_0,
uint8_t *VAR_1, uint8_t *VAR_2, int VAR_3,
svq1_pmv_t *VAR_4, int VAR_5, int VAR_6) { uint8_t    *src; uint8_t    *dst; svq1_pmv_t  mv; svq1_pmv_t *pmv[3]; int	      VAR_7; pmv[0] = &VAR_4[0]; pmv[1] = &VAR_4[(VAR_5 / 8) + 2]; pmv[2] = &VAR_4[(VAR_5 / 8) + 4]; if (VAR_6 == 0) { pmv[1] = pmv[0]; pmv[2] = pmv[0]; } VAR_7 = decode_motion_vector (VAR_0, &mv, pmv); if (VAR_7 != 0)
return VAR_7; VAR_4[0].VAR_5		= mv.VAR_5; VAR_4[0].VAR_6		= mv.VAR_6; VAR_4[(VAR_5 / 8) + 2].VAR_5	= mv.VAR_5; VAR_4[(VAR_5 / 8) + 2].VAR_6	= mv.VAR_6; VAR_4[(VAR_5 / 8) + 3].VAR_5	= mv.VAR_5; VAR_4[(VAR_5 / 8) + 3].VAR_6	= mv.VAR_6; src = &VAR_2[(VAR_5 + (mv.VAR_5 >> 1)) + (VAR_6 + (mv.VAR_6 >> 1))*VAR_3]; dst = VAR_1; put_pixels_tab[((mv.VAR_6 & 1) << 1) | (mv.VAR_5 & 1)](dst,src,VAR_3,16); put_pixels_tab[((mv.VAR_6 & 1) << 1) | (mv.VAR_5 & 1)](dst+8,src+8,VAR_3,16); return 0; }