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)

{

    int dxy, emu=0, src_x, src_y, offset;

    uint8_t *ptr;



    /* 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(s->flags&CODEC_FLAG_EMU_EDGE){

        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,

                                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,

                            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)

{

    int dxy, emu=0, src_x, src_y, offset;

    uint8_t *ptr;



    



    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(s->flags&CODEC_FLAG_EMU_EDGE){

        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,

                                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,

                            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);

}

    int dxy, emu=0, src_x, src_y, offset;
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)

{

    int VAR_7, VAR_8=0, VAR_9, VAR_10, VAR_11;

    uint8_t *ptr;



    



    VAR_5= ff_h263_round_chroma(VAR_5);

    VAR_6= ff_h263_round_chroma(VAR_6);



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

    VAR_5 >>= 1;

    VAR_6 >>= 1;



    VAR_9 = VAR_0->mb_x * 8 + VAR_5;

    VAR_10 = VAR_0->mb_y * 8 + VAR_6;

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

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

        VAR_7 &= ~1;

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

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

        VAR_7 &= ~2;



    VAR_11 = VAR_10 * VAR_0->uvlinesize + VAR_9;

    ptr = VAR_3[1] + VAR_11;

    if(VAR_0->flags&CODEC_FLAG_EMU_EDGE){

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

           || (unsigned)VAR_10 > FFMAX((VAR_0->v_edge_pos>>1) - (VAR_7>>1) - 8, 0)){

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

                                9, 9, VAR_9, VAR_10,

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

            ptr= VAR_0->edge_emu_buffer;

            VAR_8=1;

        }

    }

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



    ptr = VAR_3[2] + VAR_11;

    if(VAR_8){

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

                            9, 9, VAR_9, VAR_10,

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

        ptr= VAR_0->edge_emu_buffer;

    }

    VAR_4[VAR_7](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)
{ int VAR_7, VAR_8=0, VAR_9, VAR_10, VAR_11; uint8_t *ptr; VAR_5= ff_h263_round_chroma(VAR_5); VAR_6= ff_h263_round_chroma(VAR_6); VAR_7 = ((VAR_6 & 1) << 1) | (VAR_5 & 1); VAR_5 >>= 1; VAR_6 >>= 1; VAR_9 = VAR_0->mb_x * 8 + VAR_5; VAR_10 = VAR_0->mb_y * 8 + VAR_6; VAR_9 = av_clip(VAR_9, -8, (VAR_0->width >> 1)); if (VAR_9 == (VAR_0->width >> 1))
VAR_7 &= ~1; VAR_10 = av_clip(VAR_10, -8, (VAR_0->height >> 1)); if (VAR_10 == (VAR_0->height >> 1))
VAR_7 &= ~2; VAR_11 = VAR_10 * VAR_0->uvlinesize + VAR_9; ptr = VAR_3[1] + VAR_11; if(VAR_0->flags&CODEC_FLAG_EMU_EDGE){ if(   (unsigned)VAR_9 > FFMAX((VAR_0->h_edge_pos>>1) - (VAR_7 &1) - 8, 0)
|| (unsigned)VAR_10 > FFMAX((VAR_0->v_edge_pos>>1) - (VAR_7>>1) - 8, 0)){ VAR_0->vdsp.emulated_edge_mc(VAR_0->edge_emu_buffer, ptr, VAR_0->uvlinesize,
9, 9, VAR_9, VAR_10,
VAR_0->h_edge_pos>>1, VAR_0->v_edge_pos>>1); ptr= VAR_0->edge_emu_buffer; VAR_8=1; } } VAR_4[VAR_7](VAR_1, ptr, VAR_0->uvlinesize, 8); ptr = VAR_3[2] + VAR_11; if(VAR_8){ VAR_0->vdsp.emulated_edge_mc(VAR_0->edge_emu_buffer, ptr, VAR_0->uvlinesize,
9, 9, VAR_9, VAR_10,
VAR_0->h_edge_pos>>1, VAR_0->v_edge_pos>>1); ptr= VAR_0->edge_emu_buffer; } VAR_4[VAR_7](VAR_2, ptr, VAR_0->uvlinesize, 8); }