static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next)

{

    FrameRateContext *s = ctx->priv;

    double ret = 0;



    ff_dlog(ctx, "get_scene_score()\n");



    if (crnt->height == next->height &&

        crnt->width  == next->width) {

        int64_t sad;

        double mafd, diff;



        ff_dlog(ctx, "get_scene_score() process\n");

        if (s->bitdepth == 8)

            sad = scene_sad8(s, crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->height);

        else

            sad = scene_sad16(s, (const uint16_t*)crnt->data[0], crnt->linesize[0] >> 1, (const uint16_t*)next->data[0], next->linesize[0] >> 1, crnt->height);



        mafd = (double)sad * 100.0 / (crnt->height * crnt->width) / (1 << s->bitdepth);

        diff = fabs(mafd - s->prev_mafd);

        ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);

        s->prev_mafd = mafd;

    }

    ff_dlog(ctx, "get_scene_score() result is:%f\n", ret);

    return ret;

}

static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next)

{

    FrameRateContext *s = ctx->priv;

    double ret = 0;



    ff_dlog(ctx, "get_scene_score()\n");



    if (crnt->height == next->height &&

        crnt->width  == next->width) {

        int64_t sad;

        double mafd, diff;



        ff_dlog(ctx, "get_scene_score() process\n");

        if (s->bitdepth == 8)

            sad = scene_sad8(s, crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->height);

        else

            sad = scene_sad16(s, (const uint16_t*)crnt->data[0], crnt->linesize[0] >> 1, (const uint16_t*)next->data[0], next->linesize[0] >> 1, crnt->height);



        mafd = (double)sad * 100.0 / (crnt->height * crnt->width) / (1 << s->bitdepth);

        diff = fabs(mafd - s->prev_mafd);

        ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);

        s->prev_mafd = mafd;

    }

    ff_dlog(ctx, "get_scene_score() result is:%f\n", ret);

    return ret;

}

            sad = scene_sad8(s, crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->height);             sad = scene_sad16(s, (const uint16_t*)crnt->data[0], crnt->linesize[0] >> 1, (const uint16_t*)next->data[0], next->linesize[0] >> 1, crnt->height);         mafd = (double)sad * 100.0 / (crnt->height * crnt->width) / (1 << s->bitdepth);
static double FUNC_0(AVFilterContext *VAR_0, AVFrame *VAR_1, AVFrame *VAR_2)

{

    FrameRateContext *s = VAR_0->priv;

    double VAR_3 = 0;



    ff_dlog(VAR_0, "FUNC_0()\n");



    if (VAR_1->height == VAR_2->height &&

        VAR_1->width  == VAR_2->width) {

        int64_t sad;

        double VAR_4, VAR_5;



        ff_dlog(VAR_0, "FUNC_0() process\n");

        if (s->bitdepth == 8)

            sad = scene_sad8(s, VAR_1->data[0], VAR_1->linesize[0], VAR_2->data[0], VAR_2->linesize[0], VAR_1->height);

        else

            sad = scene_sad16(s, (const uint16_t*)VAR_1->data[0], VAR_1->linesize[0] >> 1, (const uint16_t*)VAR_2->data[0], VAR_2->linesize[0] >> 1, VAR_1->height);



        VAR_4 = (double)sad * 100.0 / (VAR_1->height * VAR_1->width) / (1 << s->bitdepth);

        VAR_5 = fabs(VAR_4 - s->prev_mafd);

        VAR_3  = av_clipf(FFMIN(VAR_4, VAR_5), 0, 100.0);

        s->prev_mafd = VAR_4;

    }

    ff_dlog(VAR_0, "FUNC_0() result is:%f\n", VAR_3);

    return VAR_3;

}

static double FUNC_0(AVFilterContext *VAR_0, AVFrame *VAR_1, AVFrame *VAR_2)
{ FrameRateContext *s = VAR_0->priv; double VAR_3 = 0; ff_dlog(VAR_0, "FUNC_0()\n"); if (VAR_1->height == VAR_2->height &&
VAR_1->width  == VAR_2->width) { int64_t sad; double VAR_4, VAR_5; ff_dlog(VAR_0, "FUNC_0() process\n"); if (s->bitdepth == 8)
sad = scene_sad8(s, VAR_1->data[0], VAR_1->linesize[0], VAR_2->data[0], VAR_2->linesize[0], VAR_1->height); else
sad = scene_sad16(s, (const uint16_t*)VAR_1->data[0], VAR_1->linesize[0] >> 1, (const uint16_t*)VAR_2->data[0], VAR_2->linesize[0] >> 1, VAR_1->height); VAR_4 = (double)sad * 100.0 / (VAR_1->height * VAR_1->width) / (1 << s->bitdepth); VAR_5 = fabs(VAR_4 - s->prev_mafd); VAR_3  = av_clipf(FFMIN(VAR_4, VAR_5), 0, 100.0); s->prev_mafd = VAR_4; } ff_dlog(VAR_0, "FUNC_0() result is:%f\n", VAR_3); return VAR_3; }