static int sse_mb(MpegEncContext *s){

    int w= 16;

    int h= 16;



    if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16;

    if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16;



    if(w==16 && h==16)

      if(s->avctx->mb_cmp == FF_CMP_NSSE){

        return  s->dsp.nsse[0](s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)

               +s->dsp.nsse[1](s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)

               +s->dsp.nsse[1](s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);

      }else{

        return  s->dsp.sse[0](NULL, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)

               +s->dsp.sse[1](NULL, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)

               +s->dsp.sse[1](NULL, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);

      }

    else

        return  sse(s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize)

               +sse(s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], w>>1, h>>1, s->uvlinesize)

               +sse(s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);

}

static int sse_mb(MpegEncContext *s){

    int w= 16;

    int h= 16;



    if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16;

    if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16;



    if(w==16 && h==16)

      if(s->avctx->mb_cmp == FF_CMP_NSSE){

        return  s->dsp.nsse[0](s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)

               +s->dsp.nsse[1](s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)

               +s->dsp.nsse[1](s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);

      }else{

        return  s->dsp.sse[0](NULL, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)

               +s->dsp.sse[1](NULL, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)

               +s->dsp.sse[1](NULL, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);

      }

    else

        return  sse(s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize)

               +sse(s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], w>>1, h>>1, s->uvlinesize)

               +sse(s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);

}

        return  s->dsp.nsse[0](s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)                +s->dsp.nsse[1](s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)                +s->dsp.nsse[1](s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);         return  s->dsp.sse[0](NULL, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)                +s->dsp.sse[1](NULL, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)                +s->dsp.sse[1](NULL, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);         return  sse(s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize)                +sse(s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], w>>1, h>>1, s->uvlinesize)                +sse(s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);
static int FUNC_0(MpegEncContext *VAR_0){

    int VAR_1= 16;

    int VAR_2= 16;



    if(VAR_0->mb_x*16 + 16 > VAR_0->width ) VAR_1= VAR_0->width - VAR_0->mb_x*16;

    if(VAR_0->mb_y*16 + 16 > VAR_0->height) VAR_2= VAR_0->height- VAR_0->mb_y*16;



    if(VAR_1==16 && VAR_2==16)

      if(VAR_0->avctx->mb_cmp == FF_CMP_NSSE){

        return  VAR_0->dsp.nsse[0](VAR_0, VAR_0->new_picture.f.data[0] + VAR_0->mb_x*16 + VAR_0->mb_y*VAR_0->linesize*16, VAR_0->dest[0], VAR_0->linesize, 16)

               +VAR_0->dsp.nsse[1](VAR_0, VAR_0->new_picture.f.data[1] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[1], VAR_0->uvlinesize, 8)

               +VAR_0->dsp.nsse[1](VAR_0, VAR_0->new_picture.f.data[2] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[2], VAR_0->uvlinesize, 8);

      }else{

        return  VAR_0->dsp.sse[0](NULL, VAR_0->new_picture.f.data[0] + VAR_0->mb_x*16 + VAR_0->mb_y*VAR_0->linesize*16, VAR_0->dest[0], VAR_0->linesize, 16)

               +VAR_0->dsp.sse[1](NULL, VAR_0->new_picture.f.data[1] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[1], VAR_0->uvlinesize, 8)

               +VAR_0->dsp.sse[1](NULL, VAR_0->new_picture.f.data[2] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[2], VAR_0->uvlinesize, 8);

      }

    else

        return  sse(VAR_0, VAR_0->new_picture.f.data[0] + VAR_0->mb_x*16 + VAR_0->mb_y*VAR_0->linesize*16, VAR_0->dest[0], VAR_1, VAR_2, VAR_0->linesize)

               +sse(VAR_0, VAR_0->new_picture.f.data[1] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[1], VAR_1>>1, VAR_2>>1, VAR_0->uvlinesize)

               +sse(VAR_0, VAR_0->new_picture.f.data[2] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[2], VAR_1>>1, VAR_2>>1, VAR_0->uvlinesize);

}

static int FUNC_0(MpegEncContext *VAR_0){ int VAR_1= 16; int VAR_2= 16; if(VAR_0->mb_x*16 + 16 > VAR_0->width ) VAR_1= VAR_0->width - VAR_0->mb_x*16; if(VAR_0->mb_y*16 + 16 > VAR_0->height) VAR_2= VAR_0->height- VAR_0->mb_y*16; if(VAR_1==16 && VAR_2==16)
if(VAR_0->avctx->mb_cmp == FF_CMP_NSSE){ return  VAR_0->dsp.nsse[0](VAR_0, VAR_0->new_picture.f.data[0] + VAR_0->mb_x*16 + VAR_0->mb_y*VAR_0->linesize*16, VAR_0->dest[0], VAR_0->linesize, 16)
+VAR_0->dsp.nsse[1](VAR_0, VAR_0->new_picture.f.data[1] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[1], VAR_0->uvlinesize, 8)
+VAR_0->dsp.nsse[1](VAR_0, VAR_0->new_picture.f.data[2] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[2], VAR_0->uvlinesize, 8); }else{ return  VAR_0->dsp.sse[0](NULL, VAR_0->new_picture.f.data[0] + VAR_0->mb_x*16 + VAR_0->mb_y*VAR_0->linesize*16, VAR_0->dest[0], VAR_0->linesize, 16)
+VAR_0->dsp.sse[1](NULL, VAR_0->new_picture.f.data[1] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[1], VAR_0->uvlinesize, 8)
+VAR_0->dsp.sse[1](NULL, VAR_0->new_picture.f.data[2] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[2], VAR_0->uvlinesize, 8); } else
return  sse(VAR_0, VAR_0->new_picture.f.data[0] + VAR_0->mb_x*16 + VAR_0->mb_y*VAR_0->linesize*16, VAR_0->dest[0], VAR_1, VAR_2, VAR_0->linesize)
+sse(VAR_0, VAR_0->new_picture.f.data[1] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[1], VAR_1>>1, VAR_2>>1, VAR_0->uvlinesize)
+sse(VAR_0, VAR_0->new_picture.f.data[2] + VAR_0->mb_x*8  + VAR_0->mb_y*VAR_0->uvlinesize*8,VAR_0->dest[2], VAR_1>>1, VAR_2>>1, VAR_0->uvlinesize); }