void inter_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb,

                   int mb_x, int mb_y)

{

    int x_off = mb_x << 4, y_off = mb_y << 4;

    int width = 16*s->mb_width, height = 16*s->mb_height;

    AVFrame *ref = s->framep[mb->ref_frame];

    VP56mv *bmv = mb->bmv;



    switch (mb->partitioning) {

    case VP8_SPLITMVMODE_NONE:

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 0, 16, 16, width, height, &mb->mv);

        break;

    case VP8_SPLITMVMODE_4x4: {

        int x, y;

        VP56mv uvmv;



        /* Y */

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

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

                vp8_mc(s, 1, dst[0] + 4*y*s->linesize + x*4,

                       ref->data[0], &bmv[4*y + x],

                       4*x + x_off, 4*y + y_off, 4, 4,

                       width, height, s->linesize,

                       s->put_pixels_tab[2]);

            }

        }



        /* U/V */

        x_off >>= 1; y_off >>= 1; width >>= 1; height >>= 1;

        for (y = 0; y < 2; y++) {

            for (x = 0; x < 2; x++) {

                uvmv.x = mb->bmv[ 2*y    * 4 + 2*x  ].x +

                         mb->bmv[ 2*y    * 4 + 2*x+1].x +

                         mb->bmv[(2*y+1) * 4 + 2*x  ].x +

                         mb->bmv[(2*y+1) * 4 + 2*x+1].x;

                uvmv.y = mb->bmv[ 2*y    * 4 + 2*x  ].y +

                         mb->bmv[ 2*y    * 4 + 2*x+1].y +

                         mb->bmv[(2*y+1) * 4 + 2*x  ].y +

                         mb->bmv[(2*y+1) * 4 + 2*x+1].y;

                uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT-1))) >> 2;

                uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT-1))) >> 2;

                if (s->profile == 3) {

                    uvmv.x &= ~7;

                    uvmv.y &= ~7;

                }

                vp8_mc(s, 0, dst[1] + 4*y*s->uvlinesize + x*4,

                       ref->data[1], &uvmv,

                       4*x + x_off, 4*y + y_off, 4, 4,

                       width, height, s->uvlinesize,

                       s->put_pixels_tab[2]);

                vp8_mc(s, 0, dst[2] + 4*y*s->uvlinesize + x*4,

                       ref->data[2], &uvmv,

                       4*x + x_off, 4*y + y_off, 4, 4,

                       width, height, s->uvlinesize,

                       s->put_pixels_tab[2]);

            }

        }

        break;

    }

    case VP8_SPLITMVMODE_16x8:

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 0, 16, 8, width, height, &bmv[0]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 8, 16, 8, width, height, &bmv[1]);

        break;

    case VP8_SPLITMVMODE_8x16:

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 0, 8, 16, width, height, &bmv[0]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    8, 0, 8, 16, width, height, &bmv[1]);

        break;

    case VP8_SPLITMVMODE_8x8:

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 0, 8, 8, width, height, &bmv[0]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    8, 0, 8, 8, width, height, &bmv[1]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 8, 8, 8, width, height, &bmv[2]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    8, 8, 8, 8, width, height, &bmv[3]);

        break;

    }

}

void inter_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb,

                   int mb_x, int mb_y)

{

    int x_off = mb_x << 4, y_off = mb_y << 4;

    int width = 16*s->mb_width, height = 16*s->mb_height;

    AVFrame *ref = s->framep[mb->ref_frame];

    VP56mv *bmv = mb->bmv;



    switch (mb->partitioning) {

    case VP8_SPLITMVMODE_NONE:

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 0, 16, 16, width, height, &mb->mv);

        break;

    case VP8_SPLITMVMODE_4x4: {

        int x, y;

        VP56mv uvmv;



        

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

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

                vp8_mc(s, 1, dst[0] + 4*y*s->linesize + x*4,

                       ref->data[0], &bmv[4*y + x],

                       4*x + x_off, 4*y + y_off, 4, 4,

                       width, height, s->linesize,

                       s->put_pixels_tab[2]);

            }

        }



        

        x_off >>= 1; y_off >>= 1; width >>= 1; height >>= 1;

        for (y = 0; y < 2; y++) {

            for (x = 0; x < 2; x++) {

                uvmv.x = mb->bmv[ 2*y    * 4 + 2*x  ].x +

                         mb->bmv[ 2*y    * 4 + 2*x+1].x +

                         mb->bmv[(2*y+1) * 4 + 2*x  ].x +

                         mb->bmv[(2*y+1) * 4 + 2*x+1].x;

                uvmv.y = mb->bmv[ 2*y    * 4 + 2*x  ].y +

                         mb->bmv[ 2*y    * 4 + 2*x+1].y +

                         mb->bmv[(2*y+1) * 4 + 2*x  ].y +

                         mb->bmv[(2*y+1) * 4 + 2*x+1].y;

                uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT-1))) >> 2;

                uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT-1))) >> 2;

                if (s->profile == 3) {

                    uvmv.x &= ~7;

                    uvmv.y &= ~7;

                }

                vp8_mc(s, 0, dst[1] + 4*y*s->uvlinesize + x*4,

                       ref->data[1], &uvmv,

                       4*x + x_off, 4*y + y_off, 4, 4,

                       width, height, s->uvlinesize,

                       s->put_pixels_tab[2]);

                vp8_mc(s, 0, dst[2] + 4*y*s->uvlinesize + x*4,

                       ref->data[2], &uvmv,

                       4*x + x_off, 4*y + y_off, 4, 4,

                       width, height, s->uvlinesize,

                       s->put_pixels_tab[2]);

            }

        }

        break;

    }

    case VP8_SPLITMVMODE_16x8:

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 0, 16, 8, width, height, &bmv[0]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 8, 16, 8, width, height, &bmv[1]);

        break;

    case VP8_SPLITMVMODE_8x16:

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 0, 8, 16, width, height, &bmv[0]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    8, 0, 8, 16, width, height, &bmv[1]);

        break;

    case VP8_SPLITMVMODE_8x8:

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 0, 8, 8, width, height, &bmv[0]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    8, 0, 8, 8, width, height, &bmv[1]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    0, 8, 8, 8, width, height, &bmv[2]);

        vp8_mc_part(s, dst, ref, x_off, y_off,

                    8, 8, 8, 8, width, height, &bmv[3]);

        break;

    }

}

void FUNC_0(VP8Context *VAR_0, uint8_t *VAR_1[3], VP8Macroblock *VAR_2,

                   int VAR_3, int VAR_4)

{

    int VAR_5 = VAR_3 << 4, VAR_6 = VAR_4 << 4;

    int VAR_7 = 16*VAR_0->mb_width, VAR_8 = 16*VAR_0->mb_height;

    AVFrame *ref = VAR_0->framep[VAR_2->ref_frame];

    VP56mv *bmv = VAR_2->bmv;



    switch (VAR_2->partitioning) {

    case VP8_SPLITMVMODE_NONE:

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    0, 0, 16, 16, VAR_7, VAR_8, &VAR_2->mv);

        break;

    case VP8_SPLITMVMODE_4x4: {

        int VAR_9, VAR_10;

        VP56mv uvmv;



        

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

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

                vp8_mc(VAR_0, 1, VAR_1[0] + 4*VAR_10*VAR_0->linesize + VAR_9*4,

                       ref->data[0], &bmv[4*VAR_10 + VAR_9],

                       4*VAR_9 + VAR_5, 4*VAR_10 + VAR_6, 4, 4,

                       VAR_7, VAR_8, VAR_0->linesize,

                       VAR_0->put_pixels_tab[2]);

            }

        }



        

        VAR_5 >>= 1; VAR_6 >>= 1; VAR_7 >>= 1; VAR_8 >>= 1;

        for (VAR_10 = 0; VAR_10 < 2; VAR_10++) {

            for (VAR_9 = 0; VAR_9 < 2; VAR_9++) {

                uvmv.VAR_9 = VAR_2->bmv[ 2*VAR_10    * 4 + 2*VAR_9  ].VAR_9 +

                         VAR_2->bmv[ 2*VAR_10    * 4 + 2*VAR_9+1].VAR_9 +

                         VAR_2->bmv[(2*VAR_10+1) * 4 + 2*VAR_9  ].VAR_9 +

                         VAR_2->bmv[(2*VAR_10+1) * 4 + 2*VAR_9+1].VAR_9;

                uvmv.VAR_10 = VAR_2->bmv[ 2*VAR_10    * 4 + 2*VAR_9  ].VAR_10 +

                         VAR_2->bmv[ 2*VAR_10    * 4 + 2*VAR_9+1].VAR_10 +

                         VAR_2->bmv[(2*VAR_10+1) * 4 + 2*VAR_9  ].VAR_10 +

                         VAR_2->bmv[(2*VAR_10+1) * 4 + 2*VAR_9+1].VAR_10;

                uvmv.VAR_9 = (uvmv.VAR_9 + 2 + (uvmv.VAR_9 >> (INT_BIT-1))) >> 2;

                uvmv.VAR_10 = (uvmv.VAR_10 + 2 + (uvmv.VAR_10 >> (INT_BIT-1))) >> 2;

                if (VAR_0->profile == 3) {

                    uvmv.VAR_9 &= ~7;

                    uvmv.VAR_10 &= ~7;

                }

                vp8_mc(VAR_0, 0, VAR_1[1] + 4*VAR_10*VAR_0->uvlinesize + VAR_9*4,

                       ref->data[1], &uvmv,

                       4*VAR_9 + VAR_5, 4*VAR_10 + VAR_6, 4, 4,

                       VAR_7, VAR_8, VAR_0->uvlinesize,

                       VAR_0->put_pixels_tab[2]);

                vp8_mc(VAR_0, 0, VAR_1[2] + 4*VAR_10*VAR_0->uvlinesize + VAR_9*4,

                       ref->data[2], &uvmv,

                       4*VAR_9 + VAR_5, 4*VAR_10 + VAR_6, 4, 4,

                       VAR_7, VAR_8, VAR_0->uvlinesize,

                       VAR_0->put_pixels_tab[2]);

            }

        }

        break;

    }

    case VP8_SPLITMVMODE_16x8:

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    0, 0, 16, 8, VAR_7, VAR_8, &bmv[0]);

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    0, 8, 16, 8, VAR_7, VAR_8, &bmv[1]);

        break;

    case VP8_SPLITMVMODE_8x16:

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    0, 0, 8, 16, VAR_7, VAR_8, &bmv[0]);

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    8, 0, 8, 16, VAR_7, VAR_8, &bmv[1]);

        break;

    case VP8_SPLITMVMODE_8x8:

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    0, 0, 8, 8, VAR_7, VAR_8, &bmv[0]);

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    8, 0, 8, 8, VAR_7, VAR_8, &bmv[1]);

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    0, 8, 8, 8, VAR_7, VAR_8, &bmv[2]);

        vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,

                    8, 8, 8, 8, VAR_7, VAR_8, &bmv[3]);

        break;

    }

}

void FUNC_0(VP8Context *VAR_0, uint8_t *VAR_1[3], VP8Macroblock *VAR_2,
int VAR_3, int VAR_4)
{ int VAR_5 = VAR_3 << 4, VAR_6 = VAR_4 << 4; int VAR_7 = 16*VAR_0->mb_width, VAR_8 = 16*VAR_0->mb_height; AVFrame *ref = VAR_0->framep[VAR_2->ref_frame]; VP56mv *bmv = VAR_2->bmv; switch (VAR_2->partitioning) { case VP8_SPLITMVMODE_NONE:
vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
0, 0, 16, 16, VAR_7, VAR_8, &VAR_2->mv); break; case VP8_SPLITMVMODE_4x4: { int VAR_9, VAR_10; VP56mv uvmv; for (VAR_10 = 0; VAR_10 < 4; VAR_10++) { for (VAR_9 = 0; VAR_9 < 4; VAR_9++) { vp8_mc(VAR_0, 1, VAR_1[0] + 4*VAR_10*VAR_0->linesize + VAR_9*4,
ref->data[0], &bmv[4*VAR_10 + VAR_9],
4*VAR_9 + VAR_5, 4*VAR_10 + VAR_6, 4, 4,
VAR_7, VAR_8, VAR_0->linesize,
VAR_0->put_pixels_tab[2]); } } VAR_5 >>= 1; VAR_6 >>= 1; VAR_7 >>= 1; VAR_8 >>= 1; for (VAR_10 = 0; VAR_10 < 2; VAR_10++) { for (VAR_9 = 0; VAR_9 < 2; VAR_9++) { uvmv.VAR_9 = VAR_2->bmv[ 2*VAR_10    * 4 + 2*VAR_9  ].VAR_9 +
VAR_2->bmv[ 2*VAR_10    * 4 + 2*VAR_9+1].VAR_9 +
VAR_2->bmv[(2*VAR_10+1) * 4 + 2*VAR_9  ].VAR_9 +
VAR_2->bmv[(2*VAR_10+1) * 4 + 2*VAR_9+1].VAR_9; uvmv.VAR_10 = VAR_2->bmv[ 2*VAR_10    * 4 + 2*VAR_9  ].VAR_10 +
VAR_2->bmv[ 2*VAR_10    * 4 + 2*VAR_9+1].VAR_10 +
VAR_2->bmv[(2*VAR_10+1) * 4 + 2*VAR_9  ].VAR_10 +
VAR_2->bmv[(2*VAR_10+1) * 4 + 2*VAR_9+1].VAR_10; uvmv.VAR_9 = (uvmv.VAR_9 + 2 + (uvmv.VAR_9 >> (INT_BIT-1))) >> 2; uvmv.VAR_10 = (uvmv.VAR_10 + 2 + (uvmv.VAR_10 >> (INT_BIT-1))) >> 2; if (VAR_0->profile == 3) { uvmv.VAR_9 &= ~7; uvmv.VAR_10 &= ~7; } vp8_mc(VAR_0, 0, VAR_1[1] + 4*VAR_10*VAR_0->uvlinesize + VAR_9*4,
ref->data[1], &uvmv,
4*VAR_9 + VAR_5, 4*VAR_10 + VAR_6, 4, 4,
VAR_7, VAR_8, VAR_0->uvlinesize,
VAR_0->put_pixels_tab[2]); vp8_mc(VAR_0, 0, VAR_1[2] + 4*VAR_10*VAR_0->uvlinesize + VAR_9*4,
ref->data[2], &uvmv,
4*VAR_9 + VAR_5, 4*VAR_10 + VAR_6, 4, 4,
VAR_7, VAR_8, VAR_0->uvlinesize,
VAR_0->put_pixels_tab[2]); } } break; } case VP8_SPLITMVMODE_16x8:
vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
0, 0, 16, 8, VAR_7, VAR_8, &bmv[0]); vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
0, 8, 16, 8, VAR_7, VAR_8, &bmv[1]); break; case VP8_SPLITMVMODE_8x16:
vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
0, 0, 8, 16, VAR_7, VAR_8, &bmv[0]); vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
8, 0, 8, 16, VAR_7, VAR_8, &bmv[1]); break; case VP8_SPLITMVMODE_8x8:
vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
0, 0, 8, 8, VAR_7, VAR_8, &bmv[0]); vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
8, 0, 8, 8, VAR_7, VAR_8, &bmv[1]); vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
0, 8, 8, 8, VAR_7, VAR_8, &bmv[2]); vp8_mc_part(VAR_0, VAR_1, ref, VAR_5, VAR_6,
8, 8, 8, 8, VAR_7, VAR_8, &bmv[3]); break; } }