]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_framerate.c
avfilter: Constify all AVFilters
[ffmpeg] / libavfilter / vf_framerate.c
index 8d16998457ffd4b0edce302c988c2359ca6a64fd..6b509443a637e994446e7042ab95fa1791b07c84 100644 (file)
@@ -71,20 +71,13 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next
 
     if (crnt->height == next->height &&
         crnt->width  == next->width) {
-        AVDictionaryEntry *e_mafd = NULL;
         uint64_t sad;
-        double mafd = HUGE_VAL, diff;
-        char *tail = NULL;
+        double mafd, diff;
 
         ff_dlog(ctx, "get_scene_score() process\n");
-        e_mafd = av_dict_get(next->metadata, "lavfi.scd.mafd", NULL, AV_DICT_MATCH_CASE);
-        if (e_mafd)
-            mafd = strtod(e_mafd->value, &tail);
-        if (*tail || mafd == HUGE_VAL) {
-            s->sad(crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height, &sad);
-            emms_c();
-            mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth);
-        }
+        s->sad(crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height, &sad);
+        emms_c();
+        mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth);
         diff = fabs(mafd - s->prev_mafd);
         ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);
         s->prev_mafd = mafd;
@@ -177,7 +170,9 @@ static int process_work_frame(AVFilterContext *ctx)
         return 0;
 
     if (!s->f0) {
-        s->work = av_frame_clone(s->f1);
+        av_assert1(s->flush);
+        s->work = s->f1;
+        s->f1 = NULL;
     } else {
         if (work_pts >= s->pts1 + s->delta && s->flush)
             return 0;
@@ -446,7 +441,7 @@ static const AVFilterPad framerate_outputs[] = {
     { NULL }
 };
 
-AVFilter ff_vf_framerate = {
+const AVFilter ff_vf_framerate = {
     .name          = "framerate",
     .description   = NULL_IF_CONFIG_SMALL("Upsamples or downsamples progressive source between specified frame rates."),
     .priv_size     = sizeof(FrameRateContext),