static inline void xchg_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg){

    MpegEncContext * const s = &h->s;

    int temp8, i;

    uint64_t temp64;



    src_y  -=   linesize + 1;

    src_cb -= uvlinesize + 1;

    src_cr -= uvlinesize + 1;



#define XCHG(a,b,t,xchg)\

t= a;\

if(xchg)\

    a= b;\

b= t;

    

    for(i=0; i<17; i++){

        XCHG(h->left_border[i     ], src_y [i*  linesize], temp8, xchg);

    }

    

    XCHG(*(uint64_t*)(h->top_border[s->mb_x]+0), *(uint64_t*)(src_y +1), temp64, xchg);

    XCHG(*(uint64_t*)(h->top_border[s->mb_x]+8), *(uint64_t*)(src_y +9), temp64, 1);



    if(!(s->flags&CODEC_FLAG_GRAY)){

        for(i=0; i<9; i++){

            XCHG(h->left_border[i+17  ], src_cb[i*uvlinesize], temp8, xchg);

            XCHG(h->left_border[i+17+9], src_cr[i*uvlinesize], temp8, xchg);

        }

        XCHG(*(uint64_t*)(h->top_border[s->mb_x]+16), *(uint64_t*)(src_cb+1), temp64, 1);

        XCHG(*(uint64_t*)(h->top_border[s->mb_x]+24), *(uint64_t*)(src_cr+1), temp64, 1);

    }

}

static inline void xchg_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg){

    MpegEncContext * const s = &h->s;

    int temp8, i;

    uint64_t temp64;



    src_y  -=   linesize + 1;

    src_cb -= uvlinesize + 1;

    src_cr -= uvlinesize + 1;



#define XCHG(a,b,t,xchg)\

t= a;\

if(xchg)\

    a= b;\

b= t;

    

    for(i=0; i<17; i++){

        XCHG(h->left_border[i     ], src_y [i*  linesize], temp8, xchg);

    }

    

    XCHG(*(uint64_t*)(h->top_border[s->mb_x]+0), *(uint64_t*)(src_y +1), temp64, xchg);

    XCHG(*(uint64_t*)(h->top_border[s->mb_x]+8), *(uint64_t*)(src_y +9), temp64, 1);



    if(!(s->flags&CODEC_FLAG_GRAY)){

        for(i=0; i<9; i++){

            XCHG(h->left_border[i+17  ], src_cb[i*uvlinesize], temp8, xchg);

            XCHG(h->left_border[i+17+9], src_cr[i*uvlinesize], temp8, xchg);

        }

        XCHG(*(uint64_t*)(h->top_border[s->mb_x]+16), *(uint64_t*)(src_cb+1), temp64, 1);

        XCHG(*(uint64_t*)(h->top_border[s->mb_x]+24), *(uint64_t*)(src_cr+1), temp64, 1);

    }

}

    for(i=0; i<17; i++){         XCHG(h->left_border[i     ], src_y [i*  linesize], temp8, xchg);     XCHG(*(uint64_t*)(h->top_border[s->mb_x]+0), *(uint64_t*)(src_y +1), temp64, xchg);     XCHG(*(uint64_t*)(h->top_border[s->mb_x]+8), *(uint64_t*)(src_y +9), temp64, 1);         for(i=0; i<9; i++){             XCHG(h->left_border[i+17  ], src_cb[i*uvlinesize], temp8, xchg);             XCHG(h->left_border[i+17+9], src_cr[i*uvlinesize], temp8, xchg);         XCHG(*(uint64_t*)(h->top_border[s->mb_x]+16), *(uint64_t*)(src_cb+1), temp64, 1);         XCHG(*(uint64_t*)(h->top_border[s->mb_x]+24), *(uint64_t*)(src_cr+1), temp64, 1);
static inline void FUNC_0(H264Context *VAR_0, uint8_t *VAR_1, uint8_t *VAR_2, uint8_t *VAR_3, int VAR_4, int VAR_5, int VAR_6){

    MpegEncContext * const s = &VAR_0->s;

    int VAR_7, VAR_8;

    uint64_t temp64;



    VAR_1  -=   VAR_4 + 1;

    VAR_2 -= VAR_5 + 1;

    VAR_3 -= VAR_5 + 1;



#define XCHG(a,b,t,VAR_6)\

t= a;\

if(VAR_6)\

    a= b;\

b= t;

    

    for(VAR_8=0; VAR_8<17; VAR_8++){

        XCHG(VAR_0->left_border[VAR_8     ], VAR_1 [VAR_8*  VAR_4], VAR_7, VAR_6);

    }

    

    XCHG(*(uint64_t*)(VAR_0->top_border[s->mb_x]+0), *(uint64_t*)(VAR_1 +1), temp64, VAR_6);

    XCHG(*(uint64_t*)(VAR_0->top_border[s->mb_x]+8), *(uint64_t*)(VAR_1 +9), temp64, 1);



    if(!(s->flags&CODEC_FLAG_GRAY)){

        for(VAR_8=0; VAR_8<9; VAR_8++){

            XCHG(VAR_0->left_border[VAR_8+17  ], VAR_2[VAR_8*VAR_5], VAR_7, VAR_6);

            XCHG(VAR_0->left_border[VAR_8+17+9], VAR_3[VAR_8*VAR_5], VAR_7, VAR_6);

        }

        XCHG(*(uint64_t*)(VAR_0->top_border[s->mb_x]+16), *(uint64_t*)(VAR_2+1), temp64, 1);

        XCHG(*(uint64_t*)(VAR_0->top_border[s->mb_x]+24), *(uint64_t*)(VAR_3+1), temp64, 1);

    }

}

static inline void FUNC_0(H264Context *VAR_0, uint8_t *VAR_1, uint8_t *VAR_2, uint8_t *VAR_3, int VAR_4, int VAR_5, int VAR_6){ MpegEncContext * const s = &VAR_0->s; int VAR_7, VAR_8; uint64_t temp64; VAR_1  -=   VAR_4 + 1; VAR_2 -= VAR_5 + 1; VAR_3 -= VAR_5 + 1; #define XCHG(a,b,t,VAR_6)\
t= a;\ if(VAR_6)\
a= b;\ b= t; for(VAR_8=0; VAR_8<17; VAR_8++){ XCHG(VAR_0->left_border[VAR_8     ], VAR_1 [VAR_8*  VAR_4], VAR_7, VAR_6); } XCHG(*(uint64_t*)(VAR_0->top_border[s->mb_x]+0), *(uint64_t*)(VAR_1 +1), temp64, VAR_6); XCHG(*(uint64_t*)(VAR_0->top_border[s->mb_x]+8), *(uint64_t*)(VAR_1 +9), temp64, 1); if(!(s->flags&CODEC_FLAG_GRAY)){ for(VAR_8=0; VAR_8<9; VAR_8++){ XCHG(VAR_0->left_border[VAR_8+17  ], VAR_2[VAR_8*VAR_5], VAR_7, VAR_6); XCHG(VAR_0->left_border[VAR_8+17+9], VAR_3[VAR_8*VAR_5], VAR_7, VAR_6); } XCHG(*(uint64_t*)(VAR_0->top_border[s->mb_x]+16), *(uint64_t*)(VAR_2+1), temp64, 1); XCHG(*(uint64_t*)(VAR_0->top_border[s->mb_x]+24), *(uint64_t*)(VAR_3+1), temp64, 1); } }