static int skip_check(MpegEncContext *s, Picture *p, Picture *ref){

    int x, y, plane;

    int score=0;

    int64_t score64=0;



    for(plane=0; plane<3; plane++){

        const int stride= p->linesize[plane];

        const int bw= plane ? 1 : 2;

        for(y=0; y<s->mb_height*bw; y++){

            for(x=0; x<s->mb_width*bw; x++){

                int v= s->dsp.frame_skip_cmp[1](s, p->data[plane] + 8*(x + y*stride), ref->data[plane] + 8*(x + y*stride), stride, 8);

                

                switch(s->avctx->frame_skip_exp){

                    case 0: score= FFMAX(score, v); break;

                    case 1: score+= ABS(v);break;

                    case 2: score+= v*v;break;

                    case 3: score64+= ABS(v*v*(int64_t)v);break;

                    case 4: score64+= v*v*(int64_t)(v*v);break;

                }

            }

        }

    }

    

    if(score) score64= score;



    if(score64 < s->avctx->frame_skip_threshold)

        return 1;

    if(score64 < ((s->avctx->frame_skip_factor * (int64_t)s->lambda)>>8))

        return 1;

    return 0;

}

static int skip_check(MpegEncContext *s, Picture *p, Picture *ref){

    int x, y, plane;

    int score=0;

    int64_t score64=0;



    for(plane=0; plane<3; plane++){

        const int stride= p->linesize[plane];

        const int bw= plane ? 1 : 2;

        for(y=0; y<s->mb_height*bw; y++){

            for(x=0; x<s->mb_width*bw; x++){

                int v= s->dsp.frame_skip_cmp[1](s, p->data[plane] + 8*(x + y*stride), ref->data[plane] + 8*(x + y*stride), stride, 8);

                

                switch(s->avctx->frame_skip_exp){

                    case 0: score= FFMAX(score, v); break;

                    case 1: score+= ABS(v);break;

                    case 2: score+= v*v;break;

                    case 3: score64+= ABS(v*v*(int64_t)v);break;

                    case 4: score64+= v*v*(int64_t)(v*v);break;

                }

            }

        }

    }

    

    if(score) score64= score;



    if(score64 < s->avctx->frame_skip_threshold)

        return 1;

    if(score64 < ((s->avctx->frame_skip_factor * (int64_t)s->lambda)>>8))

        return 1;

    return 0;

}

static int FUNC_0(MpegEncContext *VAR_0, Picture *VAR_1, Picture *VAR_2){

    int VAR_3, VAR_4, VAR_5;

    int VAR_6=0;

    int64_t score64=0;



    for(VAR_5=0; VAR_5<3; VAR_5++){

        const int VAR_7= VAR_1->linesize[VAR_5];

        const int VAR_8= VAR_5 ? 1 : 2;

        for(VAR_4=0; VAR_4<VAR_0->mb_height*VAR_8; VAR_4++){

            for(VAR_3=0; VAR_3<VAR_0->mb_width*VAR_8; VAR_3++){

                int v= VAR_0->dsp.frame_skip_cmp[1](VAR_0, VAR_1->data[VAR_5] + 8*(VAR_3 + VAR_4*VAR_7), VAR_2->data[VAR_5] + 8*(VAR_3 + VAR_4*VAR_7), VAR_7, 8);

                

                switch(VAR_0->avctx->frame_skip_exp){

                    case 0: VAR_6= FFMAX(VAR_6, v); break;

                    case 1: VAR_6+= ABS(v);break;

                    case 2: VAR_6+= v*v;break;

                    case 3: score64+= ABS(v*v*(int64_t)v);break;

                    case 4: score64+= v*v*(int64_t)(v*v);break;

                }

            }

        }

    }

    

    if(VAR_6) score64= VAR_6;



    if(score64 < VAR_0->avctx->frame_skip_threshold)

        return 1;

    if(score64 < ((VAR_0->avctx->frame_skip_factor * (int64_t)VAR_0->lambda)>>8))

        return 1;

    return 0;

}

static int FUNC_0(MpegEncContext *VAR_0, Picture *VAR_1, Picture *VAR_2){ int VAR_3, VAR_4, VAR_5; int VAR_6=0; int64_t score64=0; for(VAR_5=0; VAR_5<3; VAR_5++){ const int VAR_7= VAR_1->linesize[VAR_5]; const int VAR_8= VAR_5 ? 1 : 2; for(VAR_4=0; VAR_4<VAR_0->mb_height*VAR_8; VAR_4++){ for(VAR_3=0; VAR_3<VAR_0->mb_width*VAR_8; VAR_3++){ int v= VAR_0->dsp.frame_skip_cmp[1](VAR_0, VAR_1->data[VAR_5] + 8*(VAR_3 + VAR_4*VAR_7), VAR_2->data[VAR_5] + 8*(VAR_3 + VAR_4*VAR_7), VAR_7, 8); switch(VAR_0->avctx->frame_skip_exp){ case 0: VAR_6= FFMAX(VAR_6, v); break; case 1: VAR_6+= ABS(v);break; case 2: VAR_6+= v*v;break; case 3: score64+= ABS(v*v*(int64_t)v);break; case 4: score64+= v*v*(int64_t)(v*v);break; } } } } if(VAR_6) score64= VAR_6; if(score64 < VAR_0->avctx->frame_skip_threshold)
return 1; if(score64 < ((VAR_0->avctx->frame_skip_factor * (int64_t)VAR_0->lambda)>>8))
return 1; return 0; }