static int motion_inter_4v_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[4];

  int	      i, result;



  /* predict and decode motion vector (0) */

  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;



  /* predict and decode motion vector (1) */

  pmv[0] = &mv;

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



  if (y == 0) {

    pmv[1] = pmv[0];

    pmv[2] = pmv[0];

  }



  result = decode_motion_vector (bitbuf, &motion[0], pmv);



  if (result != 0)

    return result;



  /* predict and decode motion vector (2) */

  pmv[1] = &motion[0];

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



  result = decode_motion_vector (bitbuf, &motion[(x / 8) + 2], pmv);



  if (result != 0)

    return result;



  /* predict and decode motion vector (3) */

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

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



  result = decode_motion_vector (bitbuf, pmv[3], pmv);



  if (result != 0)

    return result;



  /* form predictions */

  for (i=0; i < 4; i++) {

    src = &previous[(x + (pmv[i]->x >> 1)) + (y + (pmv[i]->y >> 1))*pitch];

    dst = current;



    put_pixels_tab[((pmv[i]->y & 1) << 1) | (pmv[i]->x & 1)](dst,src,pitch,8);



    /* select next block */

    if (i & 1) {

      current  += 8*(pitch - 1);

      previous += 8*(pitch - 1);

    } else {

      current  += 8;

      previous += 8;

    }

  }



  return 0;

}

static int motion_inter_4v_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[4];

  int	      i, 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;



  

  pmv[0] = &mv;

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



  if (y == 0) {

    pmv[1] = pmv[0];

    pmv[2] = pmv[0];

  }



  result = decode_motion_vector (bitbuf, &motion[0], pmv);



  if (result != 0)

    return result;



  

  pmv[1] = &motion[0];

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



  result = decode_motion_vector (bitbuf, &motion[(x / 8) + 2], pmv);



  if (result != 0)

    return result;



  

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

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



  result = decode_motion_vector (bitbuf, pmv[3], pmv);



  if (result != 0)

    return result;



  

  for (i=0; i < 4; i++) {

    src = &previous[(x + (pmv[i]->x >> 1)) + (y + (pmv[i]->y >> 1))*pitch];

    dst = current;



    put_pixels_tab[((pmv[i]->y & 1) << 1) | (pmv[i]->x & 1)](dst,src,pitch,8);



    

    if (i & 1) {

      current  += 8*(pitch - 1);

      previous += 8*(pitch - 1);

    } else {

      current  += 8;

      previous += 8;

    }

  }



  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[4];

  int	      VAR_7, VAR_8;



  

  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_8 = decode_motion_vector (VAR_0, &mv, pmv);



  if (VAR_8 != 0)

    return VAR_8;



  

  pmv[0] = &mv;

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



  if (VAR_6 == 0) {

    pmv[1] = pmv[0];

    pmv[2] = pmv[0];

  }



  VAR_8 = decode_motion_vector (VAR_0, &VAR_4[0], pmv);



  if (VAR_8 != 0)

    return VAR_8;



  

  pmv[1] = &VAR_4[0];

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



  VAR_8 = decode_motion_vector (VAR_0, &VAR_4[(VAR_5 / 8) + 2], pmv);



  if (VAR_8 != 0)

    return VAR_8;



  

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

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



  VAR_8 = decode_motion_vector (VAR_0, pmv[3], pmv);



  if (VAR_8 != 0)

    return VAR_8;



  

  for (VAR_7=0; VAR_7 < 4; VAR_7++) {

    src = &VAR_2[(VAR_5 + (pmv[VAR_7]->VAR_5 >> 1)) + (VAR_6 + (pmv[VAR_7]->VAR_6 >> 1))*VAR_3];

    dst = VAR_1;



    put_pixels_tab[((pmv[VAR_7]->VAR_6 & 1) << 1) | (pmv[VAR_7]->VAR_5 & 1)](dst,src,VAR_3,8);



    

    if (VAR_7 & 1) {

      VAR_1  += 8*(VAR_3 - 1);

      VAR_2 += 8*(VAR_3 - 1);

    } else {

      VAR_1  += 8;

      VAR_2 += 8;

    }

  }



  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[4]; int	      VAR_7, VAR_8; 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_8 = decode_motion_vector (VAR_0, &mv, pmv); if (VAR_8 != 0)
return VAR_8; pmv[0] = &mv; pmv[1] = &VAR_4[(VAR_5 / 8) + 3]; if (VAR_6 == 0) { pmv[1] = pmv[0]; pmv[2] = pmv[0]; } VAR_8 = decode_motion_vector (VAR_0, &VAR_4[0], pmv); if (VAR_8 != 0)
return VAR_8; pmv[1] = &VAR_4[0]; pmv[2] = &VAR_4[(VAR_5 / 8) + 1]; VAR_8 = decode_motion_vector (VAR_0, &VAR_4[(VAR_5 / 8) + 2], pmv); if (VAR_8 != 0)
return VAR_8; pmv[2] = &VAR_4[(VAR_5 / 8) + 2]; pmv[3] = &VAR_4[(VAR_5 / 8) + 3]; VAR_8 = decode_motion_vector (VAR_0, pmv[3], pmv); if (VAR_8 != 0)
return VAR_8; for (VAR_7=0; VAR_7 < 4; VAR_7++) { src = &VAR_2[(VAR_5 + (pmv[VAR_7]->VAR_5 >> 1)) + (VAR_6 + (pmv[VAR_7]->VAR_6 >> 1))*VAR_3]; dst = VAR_1; put_pixels_tab[((pmv[VAR_7]->VAR_6 & 1) << 1) | (pmv[VAR_7]->VAR_5 & 1)](dst,src,VAR_3,8); if (VAR_7 & 1) { VAR_1  += 8*(VAR_3 - 1); VAR_2 += 8*(VAR_3 - 1); } else { VAR_1  += 8; VAR_2 += 8; } } return 0; }