void vp8_mc(VP8Context *s, int luma,

            uint8_t *dst, uint8_t *src, const VP56mv *mv,

            int x_off, int y_off, int block_w, int block_h,

            int width, int height, int linesize,

            vp8_mc_func mc_func[3][3])

{

    if (AV_RN32A(mv)) {

        static const uint8_t idx[3][8] = {

            { 0, 1, 2, 1, 2, 1, 2, 1 }, // nr. of left extra pixels,

                                        // also function pointer index

            { 0, 3, 5, 3, 5, 3, 5, 3 }, // nr. of extra pixels required

            { 0, 2, 3, 2, 3, 2, 3, 2 }, // nr. of right extra pixels

        };

        int mx = (mv->x << luma)&7, mx_idx = idx[0][mx];

        int my = (mv->y << luma)&7, my_idx = idx[0][my];



        x_off += mv->x >> (3 - luma);

        y_off += mv->y >> (3 - luma);



        // edge emulation

        src += y_off * linesize + x_off;

        if (x_off < mx_idx || x_off >= width  - block_w - idx[2][mx] ||

            y_off < my_idx || y_off >= height - block_h - idx[2][my]) {

            s->dsp.emulated_edge_mc(s->edge_emu_buffer, src - my_idx * linesize - mx_idx, linesize,

                                block_w + idx[1][mx], block_h + idx[1][my],

                                x_off - mx_idx, y_off - my_idx, width, height);

            src = s->edge_emu_buffer + mx_idx + linesize * my_idx;

        }

        mc_func[my_idx][mx_idx](dst, linesize, src, linesize, block_h, mx, my);

    } else

        mc_func[0][0](dst, linesize, src + y_off * linesize + x_off, linesize, block_h, 0, 0);

}

void vp8_mc(VP8Context *s, int luma,

            uint8_t *dst, uint8_t *src, const VP56mv *mv,

            int x_off, int y_off, int block_w, int block_h,

            int width, int height, int linesize,

            vp8_mc_func mc_func[3][3])

{

    if (AV_RN32A(mv)) {

        static const uint8_t idx[3][8] = {

            { 0, 1, 2, 1, 2, 1, 2, 1 }, 

                                        

            { 0, 3, 5, 3, 5, 3, 5, 3 }, 

            { 0, 2, 3, 2, 3, 2, 3, 2 }, 

        };

        int mx = (mv->x << luma)&7, mx_idx = idx[0][mx];

        int my = (mv->y << luma)&7, my_idx = idx[0][my];



        x_off += mv->x >> (3 - luma);

        y_off += mv->y >> (3 - luma);



        

        src += y_off * linesize + x_off;

        if (x_off < mx_idx || x_off >= width  - block_w - idx[2][mx] ||

            y_off < my_idx || y_off >= height - block_h - idx[2][my]) {

            s->dsp.emulated_edge_mc(s->edge_emu_buffer, src - my_idx * linesize - mx_idx, linesize,

                                block_w + idx[1][mx], block_h + idx[1][my],

                                x_off - mx_idx, y_off - my_idx, width, height);

            src = s->edge_emu_buffer + mx_idx + linesize * my_idx;

        }

        mc_func[my_idx][mx_idx](dst, linesize, src, linesize, block_h, mx, my);

    } else

        mc_func[0][0](dst, linesize, src + y_off * linesize + x_off, linesize, block_h, 0, 0);

}

void FUNC_0(VP8Context *VAR_0, int VAR_1,

            uint8_t *VAR_2, uint8_t *VAR_3, const VP56mv *VAR_4,

            int VAR_5, int VAR_6, int VAR_7, int VAR_8,

            int VAR_9, int VAR_10, int VAR_11,

            vp8_mc_func VAR_12[3][3])

{

    if (AV_RN32A(VAR_4)) {

        static const uint8_t VAR_13[3][8] = {

            { 0, 1, 2, 1, 2, 1, 2, 1 }, 

                                        

            { 0, 3, 5, 3, 5, 3, 5, 3 }, 

            { 0, 2, 3, 2, 3, 2, 3, 2 }, 

        };

        int VAR_14 = (VAR_4->x << VAR_1)&7, VAR_15 = VAR_13[0][VAR_14];

        int VAR_16 = (VAR_4->y << VAR_1)&7, VAR_17 = VAR_13[0][VAR_16];



        VAR_5 += VAR_4->x >> (3 - VAR_1);

        VAR_6 += VAR_4->y >> (3 - VAR_1);



        

        VAR_3 += VAR_6 * VAR_11 + VAR_5;

        if (VAR_5 < VAR_15 || VAR_5 >= VAR_9  - VAR_7 - VAR_13[2][VAR_14] ||

            VAR_6 < VAR_17 || VAR_6 >= VAR_10 - VAR_8 - VAR_13[2][VAR_16]) {

            VAR_0->dsp.emulated_edge_mc(VAR_0->edge_emu_buffer, VAR_3 - VAR_17 * VAR_11 - VAR_15, VAR_11,

                                VAR_7 + VAR_13[1][VAR_14], VAR_8 + VAR_13[1][VAR_16],

                                VAR_5 - VAR_15, VAR_6 - VAR_17, VAR_9, VAR_10);

            VAR_3 = VAR_0->edge_emu_buffer + VAR_15 + VAR_11 * VAR_17;

        }

        VAR_12[VAR_17][VAR_15](VAR_2, VAR_11, VAR_3, VAR_11, VAR_8, VAR_14, VAR_16);

    } else

        VAR_12[0][0](VAR_2, VAR_11, VAR_3 + VAR_6 * VAR_11 + VAR_5, VAR_11, VAR_8, 0, 0);

}

void FUNC_0(VP8Context *VAR_0, int VAR_1,
uint8_t *VAR_2, uint8_t *VAR_3, const VP56mv *VAR_4,
int VAR_5, int VAR_6, int VAR_7, int VAR_8,
int VAR_9, int VAR_10, int VAR_11,
vp8_mc_func VAR_12[3][3])
{ if (AV_RN32A(VAR_4)) { static const uint8_t VAR_13[3][8] = { { 0, 1, 2, 1, 2, 1, 2, 1 }, { 0, 3, 5, 3, 5, 3, 5, 3 }, { 0, 2, 3, 2, 3, 2, 3, 2 }, }; int VAR_14 = (VAR_4->x << VAR_1)&7, VAR_15 = VAR_13[0][VAR_14]; int VAR_16 = (VAR_4->y << VAR_1)&7, VAR_17 = VAR_13[0][VAR_16]; VAR_5 += VAR_4->x >> (3 - VAR_1); VAR_6 += VAR_4->y >> (3 - VAR_1); VAR_3 += VAR_6 * VAR_11 + VAR_5; if (VAR_5 < VAR_15 || VAR_5 >= VAR_9  - VAR_7 - VAR_13[2][VAR_14] ||
VAR_6 < VAR_17 || VAR_6 >= VAR_10 - VAR_8 - VAR_13[2][VAR_16]) { VAR_0->dsp.emulated_edge_mc(VAR_0->edge_emu_buffer, VAR_3 - VAR_17 * VAR_11 - VAR_15, VAR_11,
VAR_7 + VAR_13[1][VAR_14], VAR_8 + VAR_13[1][VAR_16],
VAR_5 - VAR_15, VAR_6 - VAR_17, VAR_9, VAR_10); VAR_3 = VAR_0->edge_emu_buffer + VAR_15 + VAR_11 * VAR_17; } VAR_12[VAR_17][VAR_15](VAR_2, VAR_11, VAR_3, VAR_11, VAR_8, VAR_14, VAR_16); } else VAR_12[0][0](VAR_2, VAR_11, VAR_3 + VAR_6 * VAR_11 + VAR_5, VAR_11, VAR_8, 0, 0); }