static void chroma_4mv_motion(MpegEncContext *s,

                              uint8_t *dest_cb, uint8_t *dest_cr,

                              uint8_t **ref_picture,

                              op_pixels_func *pix_op,

                              int mx, int my)

{

    uint8_t *ptr;

    int src_x, src_y, dxy, emu = 0;

    ptrdiff_t offset;



    /* In case of 8X8, we construct a single chroma motion vector

     * with a special rounding */

    mx = ff_h263_round_chroma(mx);

    my = ff_h263_round_chroma(my);



    dxy  = ((my & 1) << 1) | (mx & 1);

    mx >>= 1;

    my >>= 1;



    src_x = s->mb_x * 8 + mx;

    src_y = s->mb_y * 8 + my;

    src_x = av_clip(src_x, -8, (s->width >> 1));

    if (src_x == (s->width >> 1))

        dxy &= ~1;

    src_y = av_clip(src_y, -8, (s->height >> 1));

    if (src_y == (s->height >> 1))

        dxy &= ~2;



    offset = src_y * s->uvlinesize + src_x;

    ptr    = ref_picture[1] + offset;

    if ((unsigned)src_x > FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 8, 0) ||

        (unsigned)src_y > FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 8, 0)) {

        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,

                                 s->uvlinesize, s->uvlinesize,

                                 9, 9, src_x, src_y,

                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);

        ptr = s->edge_emu_buffer;

        emu = 1;

    }

    pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8);



    ptr = ref_picture[2] + offset;

    if (emu) {

        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,

                                 s->uvlinesize, s->uvlinesize,

                                 9, 9, src_x, src_y,

                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);

        ptr = s->edge_emu_buffer;

    }

    pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8);

}

static void chroma_4mv_motion(MpegEncContext *s,

                              uint8_t *dest_cb, uint8_t *dest_cr,

                              uint8_t **ref_picture,

                              op_pixels_func *pix_op,

                              int mx, int my)

{

    uint8_t *ptr;

    int src_x, src_y, dxy, emu = 0;

    ptrdiff_t offset;



    



    mx = ff_h263_round_chroma(mx);

    my = ff_h263_round_chroma(my);



    dxy  = ((my & 1) << 1) | (mx & 1);

    mx >>= 1;

    my >>= 1;



    src_x = s->mb_x * 8 + mx;

    src_y = s->mb_y * 8 + my;

    src_x = av_clip(src_x, -8, (s->width >> 1));

    if (src_x == (s->width >> 1))

        dxy &= ~1;

    src_y = av_clip(src_y, -8, (s->height >> 1));

    if (src_y == (s->height >> 1))

        dxy &= ~2;



    offset = src_y * s->uvlinesize + src_x;

    ptr    = ref_picture[1] + offset;

    if ((unsigned)src_x > FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 8, 0) ||

        (unsigned)src_y > FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 8, 0)) {

        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,

                                 s->uvlinesize, s->uvlinesize,

                                 9, 9, src_x, src_y,

                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);

        ptr = s->edge_emu_buffer;

        emu = 1;

    }

    pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8);



    ptr = ref_picture[2] + offset;

    if (emu) {

        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,

                                 s->uvlinesize, s->uvlinesize,

                                 9, 9, src_x, src_y,

                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);

        ptr = s->edge_emu_buffer;

    }

    pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8);

}

static void FUNC_0(MpegEncContext *VAR_0,

                              uint8_t *VAR_1, uint8_t *VAR_2,

                              uint8_t **VAR_3,

                              op_pixels_func *VAR_4,

                              int VAR_5, int VAR_6)

{

    uint8_t *ptr;

    int VAR_7, VAR_8, VAR_9, VAR_10 = 0;

    ptrdiff_t offset;



    



    VAR_5 = ff_h263_round_chroma(VAR_5);

    VAR_6 = ff_h263_round_chroma(VAR_6);



    VAR_9  = ((VAR_6 & 1) << 1) | (VAR_5 & 1);

    VAR_5 >>= 1;

    VAR_6 >>= 1;



    VAR_7 = VAR_0->mb_x * 8 + VAR_5;

    VAR_8 = VAR_0->mb_y * 8 + VAR_6;

    VAR_7 = av_clip(VAR_7, -8, (VAR_0->width >> 1));

    if (VAR_7 == (VAR_0->width >> 1))

        VAR_9 &= ~1;

    VAR_8 = av_clip(VAR_8, -8, (VAR_0->height >> 1));

    if (VAR_8 == (VAR_0->height >> 1))

        VAR_9 &= ~2;



    offset = VAR_8 * VAR_0->uvlinesize + VAR_7;

    ptr    = VAR_3[1] + offset;

    if ((unsigned)VAR_7 > FFMAX((VAR_0->h_edge_pos >> 1) - (VAR_9 & 1) - 8, 0) ||

        (unsigned)VAR_8 > FFMAX((VAR_0->v_edge_pos >> 1) - (VAR_9 >> 1) - 8, 0)) {

        VAR_0->vdsp.emulated_edge_mc(VAR_0->edge_emu_buffer, ptr,

                                 VAR_0->uvlinesize, VAR_0->uvlinesize,

                                 9, 9, VAR_7, VAR_8,

                                 VAR_0->h_edge_pos >> 1, VAR_0->v_edge_pos >> 1);

        ptr = VAR_0->edge_emu_buffer;

        VAR_10 = 1;

    }

    VAR_4[VAR_9](VAR_1, ptr, VAR_0->uvlinesize, 8);



    ptr = VAR_3[2] + offset;

    if (VAR_10) {

        VAR_0->vdsp.emulated_edge_mc(VAR_0->edge_emu_buffer, ptr,

                                 VAR_0->uvlinesize, VAR_0->uvlinesize,

                                 9, 9, VAR_7, VAR_8,

                                 VAR_0->h_edge_pos >> 1, VAR_0->v_edge_pos >> 1);

        ptr = VAR_0->edge_emu_buffer;

    }

    VAR_4[VAR_9](VAR_2, ptr, VAR_0->uvlinesize, 8);

}

static void FUNC_0(MpegEncContext *VAR_0,
uint8_t *VAR_1, uint8_t *VAR_2,
uint8_t **VAR_3,
op_pixels_func *VAR_4,
int VAR_5, int VAR_6)
{ uint8_t *ptr; int VAR_7, VAR_8, VAR_9, VAR_10 = 0; ptrdiff_t offset; VAR_5 = ff_h263_round_chroma(VAR_5); VAR_6 = ff_h263_round_chroma(VAR_6); VAR_9  = ((VAR_6 & 1) << 1) | (VAR_5 & 1); VAR_5 >>= 1; VAR_6 >>= 1; VAR_7 = VAR_0->mb_x * 8 + VAR_5; VAR_8 = VAR_0->mb_y * 8 + VAR_6; VAR_7 = av_clip(VAR_7, -8, (VAR_0->width >> 1)); if (VAR_7 == (VAR_0->width >> 1))
VAR_9 &= ~1; VAR_8 = av_clip(VAR_8, -8, (VAR_0->height >> 1)); if (VAR_8 == (VAR_0->height >> 1))
VAR_9 &= ~2; offset = VAR_8 * VAR_0->uvlinesize + VAR_7; ptr    = VAR_3[1] + offset; if ((unsigned)VAR_7 > FFMAX((VAR_0->h_edge_pos >> 1) - (VAR_9 & 1) - 8, 0) ||
(unsigned)VAR_8 > FFMAX((VAR_0->v_edge_pos >> 1) - (VAR_9 >> 1) - 8, 0)) { VAR_0->vdsp.emulated_edge_mc(VAR_0->edge_emu_buffer, ptr,
VAR_0->uvlinesize, VAR_0->uvlinesize,
9, 9, VAR_7, VAR_8,
VAR_0->h_edge_pos >> 1, VAR_0->v_edge_pos >> 1); ptr = VAR_0->edge_emu_buffer; VAR_10 = 1; } VAR_4[VAR_9](VAR_1, ptr, VAR_0->uvlinesize, 8); ptr = VAR_3[2] + offset; if (VAR_10) { VAR_0->vdsp.emulated_edge_mc(VAR_0->edge_emu_buffer, ptr,
VAR_0->uvlinesize, VAR_0->uvlinesize,
9, 9, VAR_7, VAR_8,
VAR_0->h_edge_pos >> 1, VAR_0->v_edge_pos >> 1); ptr = VAR_0->edge_emu_buffer; } VAR_4[VAR_9](VAR_2, ptr, VAR_0->uvlinesize, 8); }