static int inline get_mb_score(MpegEncContext * s, int mx, int my, int src_index,

                               int ref_index)

{

//    const int check_luma= s->dsp.me_sub_cmp != s->dsp.mb_cmp;

    MotionEstContext * const c= &s->me;

    const int size= 0;

    const int h= 16;

    const int penalty_factor= c->mb_penalty_factor;

    const int flags= c->mb_flags;

    const int qpel= flags & FLAG_QPEL;

    const int mask= 1+2*qpel;

    me_cmp_func cmp_sub, chroma_cmp_sub;

    int d;



    LOAD_COMMON

    

 //FIXME factorize



    cmp_sub= s->dsp.mb_cmp[size];

    chroma_cmp_sub= s->dsp.mb_cmp[size+1];

    

    assert(!c->skip);

    assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);



    d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);

    //FIXME check cbp before adding penalty for (0,0) vector

    if(mx || my || size>0)

        d += (mv_penalty[mx - pred_x] + mv_penalty[my - pred_y])*penalty_factor;

        

    return d;

}

static int inline get_mb_score(MpegEncContext * s, int mx, int my, int src_index,

                               int ref_index)

{



    MotionEstContext * const c= &s->me;

    const int size= 0;

    const int h= 16;

    const int penalty_factor= c->mb_penalty_factor;

    const int flags= c->mb_flags;

    const int qpel= flags & FLAG_QPEL;

    const int mask= 1+2*qpel;

    me_cmp_func cmp_sub, chroma_cmp_sub;

    int d;



    LOAD_COMMON

    

 



    cmp_sub= s->dsp.mb_cmp[size];

    chroma_cmp_sub= s->dsp.mb_cmp[size+1];

    

    assert(!c->skip);

    assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);



    d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);

    

    if(mx || my || size>0)

        d += (mv_penalty[mx - pred_x] + mv_penalty[my - pred_y])*penalty_factor;

        

    return d;

}

static int inline FUNC_0(MpegEncContext * VAR_0, int VAR_1, int VAR_2, int VAR_3,

                               int VAR_4)

{



    MotionEstContext * const c= &VAR_0->me;

    const int VAR_5= 0;

    const int VAR_6= 16;

    const int VAR_7= c->mb_penalty_factor;

    const int VAR_8= c->mb_flags;

    const int VAR_9= VAR_8 & FLAG_QPEL;

    const int VAR_10= 1+2*VAR_9;

    me_cmp_func cmp_sub, chroma_cmp_sub;

    int VAR_11;



    LOAD_COMMON

    

 



    cmp_sub= VAR_0->dsp.mb_cmp[VAR_5];

    chroma_cmp_sub= VAR_0->dsp.mb_cmp[VAR_5+1];

    

    assert(!c->skip);

    assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);



    VAR_11= cmp(VAR_0, VAR_1>>(VAR_9+1), VAR_2>>(VAR_9+1), VAR_1&VAR_10, VAR_2&VAR_10, VAR_5, VAR_6, VAR_4, VAR_3, cmp_sub, chroma_cmp_sub, VAR_8);

    

    if(VAR_1 || VAR_2 || VAR_5>0)

        VAR_11 += (mv_penalty[VAR_1 - pred_x] + mv_penalty[VAR_2 - pred_y])*VAR_7;

        

    return VAR_11;

}

static int inline FUNC_0(MpegEncContext * VAR_0, int VAR_1, int VAR_2, int VAR_3,
int VAR_4)
{ MotionEstContext * const c= &VAR_0->me; const int VAR_5= 0; const int VAR_6= 16; const int VAR_7= c->mb_penalty_factor; const int VAR_8= c->mb_flags; const int VAR_9= VAR_8 & FLAG_QPEL; const int VAR_10= 1+2*VAR_9; me_cmp_func cmp_sub, chroma_cmp_sub; int VAR_11; LOAD_COMMON
cmp_sub= VAR_0->dsp.mb_cmp[VAR_5]; chroma_cmp_sub= VAR_0->dsp.mb_cmp[VAR_5+1]; assert(!c->skip); assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp); VAR_11= cmp(VAR_0, VAR_1>>(VAR_9+1), VAR_2>>(VAR_9+1), VAR_1&VAR_10, VAR_2&VAR_10, VAR_5, VAR_6, VAR_4, VAR_3, cmp_sub, chroma_cmp_sub, VAR_8); if(VAR_1 || VAR_2 || VAR_5>0)
VAR_11 += (mv_penalty[VAR_1 - pred_x] + mv_penalty[VAR_2 - pred_y])*VAR_7; return VAR_11; }