void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,

                 ThreadFrame *ref, 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])

{

    uint8_t *src = ref->f->data[0];



    if (AV_RN32A(mv)) {



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

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



        x_off += mv->x >> 2;

        y_off += mv->y >> 2;



        // edge emulation

        ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 4, 0);

        src += y_off * linesize + x_off;

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

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

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

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

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

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

        }

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

    } else {

        ff_thread_await_progress(ref, (3 + y_off + block_h) >> 4, 0);

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

    }

}

void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,

                 ThreadFrame *ref, 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])

{

    uint8_t *src = ref->f->data[0];



    if (AV_RN32A(mv)) {



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

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



        x_off += mv->x >> 2;

        y_off += mv->y >> 2;



        

        ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 4, 0);

        src += y_off * linesize + x_off;

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

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

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

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

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

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

        }

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

    } else {

        ff_thread_await_progress(ref, (3 + y_off + block_h) >> 4, 0);

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

    }

}

                 int width, int height, int linesize,
void FUNC_0(VP8Context *VAR_0, VP8ThreadData *VAR_1, uint8_t *VAR_2,

                 ThreadFrame *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])

{

    uint8_t *src = VAR_3->f->data[0];



    if (AV_RN32A(VAR_4)) {



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

        int VAR_15 = (VAR_4->y << 1)&7, VAR_16 = subpel_idx[0][VAR_15];



        VAR_5 += VAR_4->x >> 2;

        VAR_6 += VAR_4->y >> 2;



        

        ff_thread_await_progress(VAR_3, (3 + VAR_6 + VAR_8 + subpel_idx[2][VAR_15]) >> 4, 0);

        src += VAR_6 * VAR_11 + VAR_5;

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

            VAR_6 < VAR_16 || VAR_6 >= VAR_10 - VAR_8 - subpel_idx[2][VAR_15]) {

            VAR_0->vdsp.emulated_edge_mc(VAR_1->edge_emu_buffer, src - VAR_16 * VAR_11 - VAR_14, VAR_11,

                                     VAR_7 + subpel_idx[1][VAR_13], VAR_8 + subpel_idx[1][VAR_15],

                                     VAR_5 - VAR_14, VAR_6 - VAR_16, VAR_9, VAR_10);

            src = VAR_1->edge_emu_buffer + VAR_14 + VAR_11 * VAR_16;

        }

        VAR_12[VAR_16][VAR_14](VAR_2, VAR_11, src, VAR_11, VAR_8, VAR_13, VAR_15);

    } else {

        ff_thread_await_progress(VAR_3, (3 + VAR_6 + VAR_8) >> 4, 0);

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

    }

}

void FUNC_0(VP8Context *VAR_0, VP8ThreadData *VAR_1, uint8_t *VAR_2,
ThreadFrame *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])
{ uint8_t *src = VAR_3->f->data[0]; if (AV_RN32A(VAR_4)) { int VAR_13 = (VAR_4->x << 1)&7, VAR_14 = subpel_idx[0][VAR_13]; int VAR_15 = (VAR_4->y << 1)&7, VAR_16 = subpel_idx[0][VAR_15]; VAR_5 += VAR_4->x >> 2; VAR_6 += VAR_4->y >> 2; ff_thread_await_progress(VAR_3, (3 + VAR_6 + VAR_8 + subpel_idx[2][VAR_15]) >> 4, 0); src += VAR_6 * VAR_11 + VAR_5; if (VAR_5 < VAR_14 || VAR_5 >= VAR_9  - VAR_7 - subpel_idx[2][VAR_13] ||
VAR_6 < VAR_16 || VAR_6 >= VAR_10 - VAR_8 - subpel_idx[2][VAR_15]) { VAR_0->vdsp.emulated_edge_mc(VAR_1->edge_emu_buffer, src - VAR_16 * VAR_11 - VAR_14, VAR_11,
VAR_7 + subpel_idx[1][VAR_13], VAR_8 + subpel_idx[1][VAR_15],
VAR_5 - VAR_14, VAR_6 - VAR_16, VAR_9, VAR_10); src = VAR_1->edge_emu_buffer + VAR_14 + VAR_11 * VAR_16; } VAR_12[VAR_16][VAR_14](VAR_2, VAR_11, src, VAR_11, VAR_8, VAR_13, VAR_15); } else { ff_thread_await_progress(VAR_3, (3 + VAR_6 + VAR_8) >> 4, 0); VAR_12[0][0](VAR_2, VAR_11, src + VAR_6 * VAR_11 + VAR_5, VAR_11, VAR_8, 0, 0); } }