static int svq1_motion_inter_block(DSPContext *dsp, GetBitContext *bitbuf,

                                   uint8_t *current, uint8_t *previous,

                                   int pitch, svq1_pmv *motion, int x, int y)

{

    uint8_t *src;

    uint8_t *dst;

    svq1_pmv mv;

    svq1_pmv *pmv[3];

    int result;



    /* predict and decode motion vector */

    pmv[0] = &motion[0];

    if (y == 0) {

        pmv[1] =

        pmv[2] = pmv[0];

    } else {

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

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

    }



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



    if (result != 0)

        return result;



    motion[0].x         =

    motion[x / 8 + 2].x =

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

    motion[0].y         =

    motion[x / 8 + 2].y =

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



    if (y + (mv.y >> 1) < 0)

        mv.y = 0;

    if (x + (mv.x >> 1) < 0)

        mv.x = 0;



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

    dst = current;



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



    return 0;

}

static int svq1_motion_inter_block(DSPContext *dsp, GetBitContext *bitbuf,

                                   uint8_t *current, uint8_t *previous,

                                   int pitch, svq1_pmv *motion, int x, int y)

{

    uint8_t *src;

    uint8_t *dst;

    svq1_pmv mv;

    svq1_pmv *pmv[3];

    int result;



    

    pmv[0] = &motion[0];

    if (y == 0) {

        pmv[1] =

        pmv[2] = pmv[0];

    } else {

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

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

    }



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



    if (result != 0)

        return result;



    motion[0].x         =

    motion[x / 8 + 2].x =

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

    motion[0].y         =

    motion[x / 8 + 2].y =

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



    if (y + (mv.y >> 1) < 0)

        mv.y = 0;

    if (x + (mv.x >> 1) < 0)

        mv.x = 0;



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

    dst = current;



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



    return 0;

}

                                   int pitch, svq1_pmv *motion, int x, int y)     if (y + (mv.y >> 1) < 0)         mv.y = 0;     if (x + (mv.x >> 1) < 0)         mv.x = 0;                                    int pitch, svq1_pmv *motion, int x, int y)
static int FUNC_0(DSPContext *VAR_0, GetBitContext *VAR_1,

                                   uint8_t *VAR_2, uint8_t *VAR_3,

                                   int VAR_4, svq1_pmv *VAR_5, int VAR_6, int VAR_7)

{

    uint8_t *src;

    uint8_t *dst;

    svq1_pmv mv;

    svq1_pmv *pmv[3];

    int VAR_8;



    

    pmv[0] = &VAR_5[0];

    if (VAR_7 == 0) {

        pmv[1] =

        pmv[2] = pmv[0];

    } else {

        pmv[1] = &VAR_5[VAR_6 / 8 + 2];

        pmv[2] = &VAR_5[VAR_6 / 8 + 4];

    }



    VAR_8 = svq1_decode_motion_vector(VAR_1, &mv, pmv);



    if (VAR_8 != 0)

        return VAR_8;



    VAR_5[0].VAR_6         =

    VAR_5[VAR_6 / 8 + 2].VAR_6 =

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

    VAR_5[0].VAR_7         =

    VAR_5[VAR_6 / 8 + 2].VAR_7 =

    VAR_5[VAR_6 / 8 + 3].VAR_7 = mv.VAR_7;



    if (VAR_7 + (mv.VAR_7 >> 1) < 0)

        mv.VAR_7 = 0;

    if (VAR_6 + (mv.VAR_6 >> 1) < 0)

        mv.VAR_6 = 0;



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

    dst = VAR_2;



    VAR_0->put_pixels_tab[0][(mv.VAR_7 & 1) << 1 | (mv.VAR_6 & 1)](dst, src, VAR_4, 16);



    return 0;

}

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