LCOV - code coverage report
Current view: top level - libavfilter - vf_framerate.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 212 233 91.0 %
Date: 2018-05-20 11:54:08 Functions: 17 17 100.0 %

          Line data    Source code
       1             : /*
       2             :  * Copyright (C) 2012 Mark Himsley
       3             :  *
       4             :  * get_scene_score() Copyright (c) 2011 Stefano Sabatini
       5             :  * taken from libavfilter/vf_select.c
       6             :  *
       7             :  * This file is part of FFmpeg.
       8             :  *
       9             :  * FFmpeg is free software; you can redistribute it and/or
      10             :  * modify it under the terms of the GNU Lesser General Public
      11             :  * License as published by the Free Software Foundation; either
      12             :  * version 2.1 of the License, or (at your option) any later version.
      13             :  *
      14             :  * FFmpeg is distributed in the hope that it will be useful,
      15             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      16             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      17             :  * Lesser General Public License for more details.
      18             :  *
      19             :  * You should have received a copy of the GNU Lesser General Public
      20             :  * License along with FFmpeg; if not, write to the Free Software
      21             :  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
      22             :  */
      23             : 
      24             : /**
      25             :  * @file
      26             :  * filter for upsampling or downsampling a progressive source
      27             :  */
      28             : 
      29             : #define DEBUG
      30             : 
      31             : #include "libavutil/avassert.h"
      32             : #include "libavutil/imgutils.h"
      33             : #include "libavutil/internal.h"
      34             : #include "libavutil/opt.h"
      35             : #include "libavutil/pixdesc.h"
      36             : #include "libavutil/pixelutils.h"
      37             : 
      38             : #include "avfilter.h"
      39             : #include "internal.h"
      40             : #include "video.h"
      41             : #include "framerate.h"
      42             : 
      43             : #define OFFSET(x) offsetof(FrameRateContext, x)
      44             : #define V AV_OPT_FLAG_VIDEO_PARAM
      45             : #define F AV_OPT_FLAG_FILTERING_PARAM
      46             : #define FRAMERATE_FLAG_SCD 01
      47             : 
      48             : static const AVOption framerate_options[] = {
      49             :     {"fps",                 "required output frames per second rate", OFFSET(dest_frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="50"},             0,       INT_MAX, V|F },
      50             : 
      51             :     {"interp_start",        "point to start linear interpolation",    OFFSET(interp_start),    AV_OPT_TYPE_INT,      {.i64=15},                 0,       255,     V|F },
      52             :     {"interp_end",          "point to end linear interpolation",      OFFSET(interp_end),      AV_OPT_TYPE_INT,      {.i64=240},                0,       255,     V|F },
      53             :     {"scene",               "scene change level",                     OFFSET(scene_score),     AV_OPT_TYPE_DOUBLE,   {.dbl=8.2},                0,       INT_MAX, V|F },
      54             : 
      55             :     {"flags",               "set flags",                              OFFSET(flags),           AV_OPT_TYPE_FLAGS,    {.i64=1},                  0,       INT_MAX, V|F, "flags" },
      56             :     {"scene_change_detect", "enable scene change detection",          0,                       AV_OPT_TYPE_CONST,    {.i64=FRAMERATE_FLAG_SCD}, INT_MIN, INT_MAX, V|F, "flags" },
      57             :     {"scd",                 "enable scene change detection",          0,                       AV_OPT_TYPE_CONST,    {.i64=FRAMERATE_FLAG_SCD}, INT_MIN, INT_MAX, V|F, "flags" },
      58             : 
      59             :     {NULL}
      60             : };
      61             : 
      62             : AVFILTER_DEFINE_CLASS(framerate);
      63             : 
      64      106800 : static av_always_inline int64_t sad_8x8_16(const uint16_t *src1, ptrdiff_t stride1,
      65             :                                            const uint16_t *src2, ptrdiff_t stride2)
      66             : {
      67      106800 :     int sum = 0;
      68             :     int x, y;
      69             : 
      70      961200 :     for (y = 0; y < 8; y++) {
      71     7689600 :         for (x = 0; x < 8; x++)
      72     6835200 :             sum += FFABS(src1[x] - src2[x]);
      73      854400 :         src1 += stride1;
      74      854400 :         src2 += stride2;
      75             :     }
      76      106800 :     return sum;
      77             : }
      78             : 
      79          89 : static int64_t scene_sad16(FrameRateContext *s, const uint16_t *p1, int p1_linesize, const uint16_t* p2, int p2_linesize, const int width, const int height)
      80             : {
      81             :     int64_t sad;
      82             :     int x, y;
      83        2759 :     for (sad = y = 0; y < height - 7; y += 8) {
      84      109470 :         for (x = 0; x < width - 7; x += 8) {
      85      213600 :             sad += sad_8x8_16(p1 + y * p1_linesize + x,
      86             :                               p1_linesize,
      87      106800 :                               p2 + y * p2_linesize + x,
      88             :                               p2_linesize);
      89             :         }
      90             :     }
      91          89 :     return sad;
      92             : }
      93             : 
      94           3 : static int64_t scene_sad8(FrameRateContext *s, uint8_t *p1, int p1_linesize, uint8_t* p2, int p2_linesize, const int width, const int height)
      95             : {
      96             :     int64_t sad;
      97             :     int x, y;
      98          93 :     for (sad = y = 0; y < height - 7; y += 8) {
      99        3690 :         for (x = 0; x < width - 7; x += 8) {
     100        7200 :             sad += s->sad(p1 + y * p1_linesize + x,
     101             :                           p1_linesize,
     102        3600 :                           p2 + y * p2_linesize + x,
     103             :                           p2_linesize);
     104             :         }
     105             :     }
     106           3 :     emms_c();
     107           3 :     return sad;
     108             : }
     109             : 
     110          92 : static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next)
     111             : {
     112          92 :     FrameRateContext *s = ctx->priv;
     113          92 :     double ret = 0;
     114             : 
     115          92 :     ff_dlog(ctx, "get_scene_score()\n");
     116             : 
     117         184 :     if (crnt->height == next->height &&
     118          92 :         crnt->width  == next->width) {
     119             :         int64_t sad;
     120             :         double mafd, diff;
     121             : 
     122          92 :         ff_dlog(ctx, "get_scene_score() process\n");
     123          92 :         if (s->bitdepth == 8)
     124           3 :             sad = scene_sad8(s, crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height);
     125             :         else
     126          89 :             sad = scene_sad16(s, (const uint16_t*)crnt->data[0], crnt->linesize[0] / 2, (const uint16_t*)next->data[0], next->linesize[0] / 2, crnt->width, crnt->height);
     127             : 
     128          92 :         mafd = (double)sad * 100.0 / FFMAX(1, (crnt->height & ~7) * (crnt->width & ~7)) / (1 << s->bitdepth);
     129          92 :         diff = fabs(mafd - s->prev_mafd);
     130          92 :         ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);
     131          92 :         s->prev_mafd = mafd;
     132             :     }
     133          92 :     ff_dlog(ctx, "get_scene_score() result is:%f\n", ret);
     134          92 :     return ret;
     135             : }
     136             : 
     137             : typedef struct ThreadData {
     138             :     AVFrame *copy_src1, *copy_src2;
     139             :     uint16_t src1_factor, src2_factor;
     140             : } ThreadData;
     141             : 
     142         909 : static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
     143             : {
     144         909 :     FrameRateContext *s = ctx->priv;
     145         909 :     ThreadData *td = arg;
     146         909 :     uint16_t src1_factor = td->src1_factor;
     147         909 :     uint16_t src2_factor = td->src2_factor;
     148             :     int plane;
     149             : 
     150        3636 :     for (plane = 0; plane < 4 && td->copy_src1->data[plane] && td->copy_src2->data[plane]; plane++) {
     151        2727 :         int cpy_line_width = s->line_size[plane];
     152        2727 :         uint8_t *cpy_src1_data = td->copy_src1->data[plane];
     153        2727 :         int cpy_src1_line_size = td->copy_src1->linesize[plane];
     154        2727 :         uint8_t *cpy_src2_data = td->copy_src2->data[plane];
     155        2727 :         int cpy_src2_line_size = td->copy_src2->linesize[plane];
     156        2727 :         int cpy_src_h = (plane > 0 && plane < 3) ? (td->copy_src1->height >> s->vsub) : (td->copy_src1->height);
     157        2727 :         uint8_t *cpy_dst_data = s->work->data[plane];
     158        2727 :         int cpy_dst_line_size = s->work->linesize[plane];
     159        2727 :         const int start = (cpy_src_h *  job   ) / nb_jobs;
     160        2727 :         const int end   = (cpy_src_h * (job+1)) / nb_jobs;
     161        2727 :         cpy_src1_data += start * cpy_src1_line_size;
     162        2727 :         cpy_src2_data += start * cpy_src2_line_size;
     163        2727 :         cpy_dst_data += start * cpy_dst_line_size;
     164             : 
     165        8181 :         s->blend(cpy_src1_data, cpy_src1_line_size,
     166             :                  cpy_src2_data, cpy_src2_line_size,
     167             :                  cpy_dst_data,  cpy_dst_line_size,
     168        2727 :                  cpy_line_width, end - start,
     169        2727 :                  src1_factor, src2_factor, s->blend_factor_max >> 1);
     170             :     }
     171             : 
     172         909 :     return 0;
     173             : }
     174             : 
     175         101 : static int blend_frames(AVFilterContext *ctx, int interpolate)
     176             : {
     177         101 :     FrameRateContext *s = ctx->priv;
     178         101 :     AVFilterLink *outlink = ctx->outputs[0];
     179         101 :     double interpolate_scene_score = 0;
     180             : 
     181         101 :     if ((s->flags & FRAMERATE_FLAG_SCD)) {
     182         101 :         if (s->score >= 0.0)
     183           9 :             interpolate_scene_score = s->score;
     184             :         else
     185          92 :             interpolate_scene_score = s->score = get_scene_score(ctx, s->f0, s->f1);
     186         101 :         ff_dlog(ctx, "blend_frames() interpolate scene score:%f\n", interpolate_scene_score);
     187             :     }
     188             :     // decide if the shot-change detection allows us to blend two frames
     189         101 :     if (interpolate_scene_score < s->scene_score) {
     190             :         ThreadData td;
     191         101 :         td.copy_src1 = s->f0;
     192         101 :         td.copy_src2 = s->f1;
     193         101 :         td.src2_factor = interpolate;
     194         101 :         td.src1_factor = s->blend_factor_max - td.src2_factor;
     195             : 
     196             :         // get work-space for output frame
     197         101 :         s->work = ff_get_video_buffer(outlink, outlink->w, outlink->h);
     198         101 :         if (!s->work)
     199           0 :             return AVERROR(ENOMEM);
     200             : 
     201         101 :         av_frame_copy_props(s->work, s->f0);
     202             : 
     203         101 :         ff_dlog(ctx, "blend_frames() INTERPOLATE to create work frame\n");
     204         101 :         ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(FFMAX(1, outlink->h >> 2), ff_filter_get_nb_threads(ctx)));
     205         101 :         return 1;
     206             :     }
     207           0 :     return 0;
     208             : }
     209             : 
     210         246 : static int process_work_frame(AVFilterContext *ctx)
     211             : {
     212         246 :     FrameRateContext *s = ctx->priv;
     213             :     int64_t work_pts;
     214             :     int64_t interpolate, interpolate8;
     215             :     int ret;
     216             : 
     217         246 :     if (!s->f1)
     218           0 :         return 0;
     219         246 :     if (!s->f0 && !s->flush)
     220           4 :         return 0;
     221             : 
     222         242 :     work_pts = s->start_pts + av_rescale_q(s->n, av_inv_q(s->dest_frame_rate), s->dest_time_base);
     223             : 
     224         242 :     if (work_pts >= s->pts1 && !s->flush)
     225         114 :         return 0;
     226             : 
     227         128 :     if (!s->f0) {
     228           0 :         s->work = av_frame_clone(s->f1);
     229             :     } else {
     230         128 :         if (work_pts >= s->pts1 + s->delta && s->flush)
     231           1 :             return 0;
     232             : 
     233         127 :         interpolate = av_rescale(work_pts - s->pts0, s->blend_factor_max, s->delta);
     234         127 :         interpolate8 = av_rescale(work_pts - s->pts0, 256, s->delta);
     235         127 :         ff_dlog(ctx, "process_work_frame() interpolate: %"PRId64"/256\n", interpolate8);
     236         127 :         if (interpolate >= s->blend_factor_max || interpolate8 > s->interp_end) {
     237           1 :             s->work = av_frame_clone(s->f1);
     238         126 :         } else if (interpolate <= 0 || interpolate8 < s->interp_start) {
     239          25 :             s->work = av_frame_clone(s->f0);
     240             :         } else {
     241         101 :             ret = blend_frames(ctx, interpolate);
     242         101 :             if (ret < 0)
     243           0 :                 return ret;
     244         101 :             if (ret == 0)
     245           0 :                 s->work = av_frame_clone(interpolate > (s->blend_factor_max >> 1) ? s->f1 : s->f0);
     246             :         }
     247             :     }
     248             : 
     249         127 :     if (!s->work)
     250           0 :         return AVERROR(ENOMEM);
     251             : 
     252         127 :     s->work->pts = work_pts;
     253         127 :     s->n++;
     254             : 
     255         127 :     return 1;
     256             : }
     257             : 
     258           8 : static av_cold int init(AVFilterContext *ctx)
     259             : {
     260           8 :     FrameRateContext *s = ctx->priv;
     261           8 :     s->start_pts = AV_NOPTS_VALUE;
     262           8 :     return 0;
     263             : }
     264             : 
     265           8 : static av_cold void uninit(AVFilterContext *ctx)
     266             : {
     267           8 :     FrameRateContext *s = ctx->priv;
     268           8 :     av_frame_free(&s->f0);
     269           8 :     av_frame_free(&s->f1);
     270           8 : }
     271             : 
     272           4 : static int query_formats(AVFilterContext *ctx)
     273             : {
     274             :     static const enum AVPixelFormat pix_fmts[] = {
     275             :         AV_PIX_FMT_YUV410P,
     276             :         AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVJ411P,
     277             :         AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
     278             :         AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
     279             :         AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
     280             :         AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
     281             :         AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12,
     282             :         AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12,
     283             :         AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12,
     284             :         AV_PIX_FMT_NONE
     285             :     };
     286             : 
     287           4 :     AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
     288           4 :     if (!fmts_list)
     289           0 :         return AVERROR(ENOMEM);
     290           4 :     return ff_set_common_formats(ctx, fmts_list);
     291             : }
     292             : 
     293         324 : static void blend_frames_c(BLEND_FUNC_PARAMS)
     294             : {
     295             :     int line, pixel;
     296        6084 :     for (line = 0; line < height; line++) {
     297     1388160 :         for (pixel = 0; pixel < width; pixel++)
     298     1382400 :             dst[pixel] = ((src1[pixel] * factor1) + (src2[pixel] * factor2) + half) >> BLEND_FACTOR_DEPTH8;
     299        5760 :         src1 += src1_linesize;
     300        5760 :         src2 += src2_linesize;
     301        5760 :         dst  += dst_linesize;
     302             :     }
     303         324 : }
     304             : 
     305        2403 : static void blend_frames16_c(BLEND_FUNC_PARAMS)
     306             : {
     307             :     int line, pixel;
     308        2403 :     uint16_t *dstw = (uint16_t *)dst;
     309        2403 :     uint16_t *src1w = (uint16_t *)src1;
     310        2403 :     uint16_t *src2w = (uint16_t *)src2;
     311        2403 :     width /= 2;
     312        2403 :     src1_linesize /= 2;
     313        2403 :     src2_linesize /= 2;
     314        2403 :     dst_linesize /= 2;
     315       66483 :     for (line = 0; line < height; line++) {
     316    13734480 :         for (pixel = 0; pixel < width; pixel++)
     317    13670400 :             dstw[pixel] = ((src1w[pixel] * factor1) + (src2w[pixel] * factor2) + half) >> BLEND_FACTOR_DEPTH16;
     318       64080 :         src1w += src1_linesize;
     319       64080 :         src2w += src2_linesize;
     320       64080 :         dstw  += dst_linesize;
     321             :     }
     322        2403 : }
     323             : 
     324           4 : void ff_framerate_init(FrameRateContext *s)
     325             : {
     326           4 :     if (s->bitdepth == 8) {
     327           2 :         s->blend_factor_max = 1 << BLEND_FACTOR_DEPTH8;
     328           2 :         s->blend = blend_frames_c;
     329             :     } else {
     330           2 :         s->blend_factor_max = 1 << BLEND_FACTOR_DEPTH16;
     331           2 :         s->blend = blend_frames16_c;
     332             :     }
     333             :     if (ARCH_X86)
     334           4 :         ff_framerate_init_x86(s);
     335           4 : }
     336             : 
     337           4 : static int config_input(AVFilterLink *inlink)
     338             : {
     339           4 :     AVFilterContext *ctx = inlink->dst;
     340           4 :     FrameRateContext *s = ctx->priv;
     341           4 :     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
     342             :     int plane;
     343             : 
     344          20 :     for (plane = 0; plane < 4; plane++) {
     345          16 :         s->line_size[plane] = av_image_get_linesize(inlink->format, inlink->w,
     346             :                                                     plane);
     347             :     }
     348             : 
     349           4 :     s->bitdepth = pix_desc->comp[0].depth;
     350           4 :     s->vsub = pix_desc->log2_chroma_h;
     351             : 
     352           4 :     s->sad = av_pixelutils_get_sad_fn(3, 3, 2, s); // 8x8 both sources aligned
     353           4 :     if (!s->sad)
     354           0 :         return AVERROR(EINVAL);
     355             : 
     356           4 :     s->srce_time_base = inlink->time_base;
     357             : 
     358           4 :     ff_framerate_init(s);
     359             : 
     360           4 :     return 0;
     361             : }
     362             : 
     363         118 : static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
     364             : {
     365             :     int ret;
     366         118 :     AVFilterContext *ctx = inlink->dst;
     367         118 :     FrameRateContext *s = ctx->priv;
     368             :     int64_t pts;
     369             : 
     370         118 :     if (inpicref->interlaced_frame)
     371           0 :         av_log(ctx, AV_LOG_WARNING, "Interlaced frame found - the output will not be correct.\n");
     372             : 
     373         118 :     if (inpicref->pts == AV_NOPTS_VALUE) {
     374           0 :         av_log(ctx, AV_LOG_WARNING, "Ignoring frame without PTS.\n");
     375           0 :         return 0;
     376             :     }
     377             : 
     378         118 :     pts = av_rescale_q(inpicref->pts, s->srce_time_base, s->dest_time_base);
     379         118 :     if (s->f1 && pts == s->pts1) {
     380           0 :         av_log(ctx, AV_LOG_WARNING, "Ignoring frame with same PTS.\n");
     381           0 :         return 0;
     382             :     }
     383             : 
     384         118 :     av_frame_free(&s->f0);
     385         118 :     s->f0 = s->f1;
     386         118 :     s->pts0 = s->pts1;
     387         118 :     s->f1 = inpicref;
     388         118 :     s->pts1 = pts;
     389         118 :     s->delta = s->pts1 - s->pts0;
     390         118 :     s->score = -1.0;
     391             : 
     392         118 :     if (s->delta < 0) {
     393           0 :         av_log(ctx, AV_LOG_WARNING, "PTS discontinuity.\n");
     394           0 :         s->start_pts = s->pts1;
     395           0 :         s->n = 0;
     396           0 :         av_frame_free(&s->f0);
     397             :     }
     398             : 
     399         118 :     if (s->start_pts == AV_NOPTS_VALUE)
     400           4 :         s->start_pts = s->pts1;
     401             : 
     402             :     do {
     403         244 :         ret = process_work_frame(ctx);
     404         244 :         if (ret <= 0)
     405         118 :             return ret;
     406         126 :         ret = ff_filter_frame(ctx->outputs[0], s->work);
     407         126 :     } while (ret >= 0);
     408             : 
     409           0 :     return ret;
     410             : }
     411             : 
     412           4 : static int config_output(AVFilterLink *outlink)
     413             : {
     414           4 :     AVFilterContext *ctx = outlink->src;
     415           4 :     FrameRateContext *s = ctx->priv;
     416             :     int exact;
     417             : 
     418           4 :     ff_dlog(ctx, "config_output()\n");
     419             : 
     420           4 :     ff_dlog(ctx,
     421             :            "config_output() input time base:%u/%u (%f)\n",
     422             :            ctx->inputs[0]->time_base.num,ctx->inputs[0]->time_base.den,
     423             :            av_q2d(ctx->inputs[0]->time_base));
     424             : 
     425             :     // make sure timebase is small enough to hold the framerate
     426             : 
     427          12 :     exact = av_reduce(&s->dest_time_base.num, &s->dest_time_base.den,
     428           4 :                       av_gcd((int64_t)s->srce_time_base.num * s->dest_frame_rate.num,
     429           4 :                              (int64_t)s->srce_time_base.den * s->dest_frame_rate.den ),
     430           4 :                       (int64_t)s->srce_time_base.den * s->dest_frame_rate.num, INT_MAX);
     431             : 
     432           4 :     av_log(ctx, AV_LOG_INFO,
     433             :            "time base:%u/%u -> %u/%u exact:%d\n",
     434             :            s->srce_time_base.num, s->srce_time_base.den,
     435             :            s->dest_time_base.num, s->dest_time_base.den, exact);
     436           4 :     if (!exact) {
     437           0 :         av_log(ctx, AV_LOG_WARNING, "Timebase conversion is not exact\n");
     438             :     }
     439             : 
     440           4 :     outlink->frame_rate = s->dest_frame_rate;
     441           4 :     outlink->time_base = s->dest_time_base;
     442             : 
     443           4 :     ff_dlog(ctx,
     444             :            "config_output() output time base:%u/%u (%f) w:%d h:%d\n",
     445             :            outlink->time_base.num, outlink->time_base.den,
     446             :            av_q2d(outlink->time_base),
     447             :            outlink->w, outlink->h);
     448             : 
     449             : 
     450           4 :     av_log(ctx, AV_LOG_INFO, "fps -> fps:%u/%u scene score:%f interpolate start:%d end:%d\n",
     451             :             s->dest_frame_rate.num, s->dest_frame_rate.den,
     452             :             s->scene_score, s->interp_start, s->interp_end);
     453             : 
     454           4 :     return 0;
     455             : }
     456             : 
     457         123 : static int request_frame(AVFilterLink *outlink)
     458             : {
     459         123 :     AVFilterContext *ctx = outlink->src;
     460         123 :     FrameRateContext *s = ctx->priv;
     461             :     int ret;
     462             : 
     463         123 :     ff_dlog(ctx, "request_frame()\n");
     464             : 
     465         123 :     ret = ff_request_frame(ctx->inputs[0]);
     466         123 :     if (ret == AVERROR_EOF && s->f1 && !s->flush) {
     467           2 :         s->flush = 1;
     468           2 :         ret = process_work_frame(ctx);
     469           2 :         if (ret < 0)
     470           0 :             return ret;
     471           2 :         ret = ret ? ff_filter_frame(ctx->outputs[0], s->work) : AVERROR_EOF;
     472             :     }
     473             : 
     474         123 :     ff_dlog(ctx, "request_frame() source's request_frame() returned:%d\n", ret);
     475         123 :     return ret;
     476             : }
     477             : 
     478             : static const AVFilterPad framerate_inputs[] = {
     479             :     {
     480             :         .name         = "default",
     481             :         .type         = AVMEDIA_TYPE_VIDEO,
     482             :         .config_props = config_input,
     483             :         .filter_frame = filter_frame,
     484             :     },
     485             :     { NULL }
     486             : };
     487             : 
     488             : static const AVFilterPad framerate_outputs[] = {
     489             :     {
     490             :         .name          = "default",
     491             :         .type          = AVMEDIA_TYPE_VIDEO,
     492             :         .request_frame = request_frame,
     493             :         .config_props  = config_output,
     494             :     },
     495             :     { NULL }
     496             : };
     497             : 
     498             : AVFilter ff_vf_framerate = {
     499             :     .name          = "framerate",
     500             :     .description   = NULL_IF_CONFIG_SMALL("Upsamples or downsamples progressive source between specified frame rates."),
     501             :     .priv_size     = sizeof(FrameRateContext),
     502             :     .priv_class    = &framerate_class,
     503             :     .init          = init,
     504             :     .uninit        = uninit,
     505             :     .query_formats = query_formats,
     506             :     .inputs        = framerate_inputs,
     507             :     .outputs       = framerate_outputs,
     508             :     .flags         = AVFILTER_FLAG_SLICE_THREADS,
     509             : };

Generated by: LCOV version 1.13