FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_framerate.c File Reference

filter for upsampling or downsampling a progressive source More...

#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixelutils.h"
#include "avfilter.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  FrameRateContext
 

Macros

#define DEBUG
 
#define N_SRCE   3
 
#define OFFSET(x)   offsetof(FrameRateContext, x)
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 
#define FRAMERATE_FLAG_SCD   01
 

Functions

 AVFILTER_DEFINE_CLASS (framerate)
 
static void next_source (AVFilterContext *ctx)
 
static av_always_inline int64_t sad_8x8_16 (const uint16_t *src1, ptrdiff_t stride1, const uint16_t *src2, ptrdiff_t stride2)
 
static double get_scene_score16 (AVFilterContext *ctx, AVFrame *crnt, AVFrame *next)
 
static double get_scene_score (AVFilterContext *ctx, AVFrame *crnt, AVFrame *next)
 
static int blend_frames16 (AVFilterContext *ctx, float interpolate, AVFrame *copy_src1, AVFrame *copy_src2)
 
static int blend_frames8 (AVFilterContext *ctx, float interpolate, AVFrame *copy_src1, AVFrame *copy_src2)
 
static int process_work_frame (AVFilterContext *ctx, int stop)
 
static void set_srce_frame_dest_pts (AVFilterContext *ctx)
 
static void set_work_frame_pts (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inpicref)
 
static int config_output (AVFilterLink *outlink)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption framerate_options []
 
static const AVFilterPad framerate_inputs []
 
static const AVFilterPad framerate_outputs []
 
AVFilter ff_vf_framerate
 

Detailed Description

filter for upsampling or downsampling a progressive source

Definition in file vf_framerate.c.

Macro Definition Documentation

#define DEBUG

Definition at line 29 of file vf_framerate.c.

Referenced by audio_decode_frame().

#define N_SRCE   3

Definition at line 42 of file vf_framerate.c.

Referenced by init().

#define OFFSET (   x)    offsetof(FrameRateContext, x)

Definition at line 83 of file vf_framerate.c.

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 84 of file vf_framerate.c.

Definition at line 85 of file vf_framerate.c.

#define FRAMERATE_FLAG_SCD   01

Definition at line 86 of file vf_framerate.c.

Referenced by blend_frames16(), and blend_frames8().

Function Documentation

AVFILTER_DEFINE_CLASS ( framerate  )
static void next_source ( AVFilterContext ctx)
static

Definition at line 104 of file vf_framerate.c.

Referenced by process_work_frame().

static av_always_inline int64_t sad_8x8_16 ( const uint16_t *  src1,
ptrdiff_t  stride1,
const uint16_t *  src2,
ptrdiff_t  stride2 
)
static

Definition at line 123 of file vf_framerate.c.

Referenced by get_scene_score16().

static double get_scene_score16 ( AVFilterContext ctx,
AVFrame crnt,
AVFrame next 
)
static

Definition at line 138 of file vf_framerate.c.

Referenced by blend_frames16().

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

Definition at line 175 of file vf_framerate.c.

Referenced by blend_frames8().

static int blend_frames16 ( AVFilterContext ctx,
float  interpolate,
AVFrame copy_src1,
AVFrame copy_src2 
)
static

Definition at line 213 of file vf_framerate.c.

Referenced by config_input().

static int blend_frames8 ( AVFilterContext ctx,
float  interpolate,
AVFrame copy_src1,
AVFrame copy_src2 
)
static

Definition at line 277 of file vf_framerate.c.

Referenced by config_input().

static int process_work_frame ( AVFilterContext ctx,
int  stop 
)
static

Definition at line 344 of file vf_framerate.c.

Referenced by filter_frame(), and request_frame().

static void set_srce_frame_dest_pts ( AVFilterContext ctx)
static

Definition at line 446 of file vf_framerate.c.

Referenced by filter_frame(), and set_work_frame_pts().

static void set_work_frame_pts ( AVFilterContext ctx)
static

Definition at line 461 of file vf_framerate.c.

Referenced by filter_frame(), and request_frame().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 509 of file vf_framerate.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 524 of file vf_framerate.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 536 of file vf_framerate.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 557 of file vf_framerate.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame inpicref 
)
static

Definition at line 587 of file vf_framerate.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 616 of file vf_framerate.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 661 of file vf_framerate.c.

Variable Documentation

const AVOption framerate_options[]
static
Initial value:
= {
{"fps", "required output frames per second rate", OFFSET(dest_frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="50"}, 0, INT_MAX, V|F },
{"interp_start", "point to start linear interpolation", OFFSET(interp_start), AV_OPT_TYPE_INT, {.i64=15}, 0, 255, V|F },
{"interp_end", "point to end linear interpolation", OFFSET(interp_end), AV_OPT_TYPE_INT, {.i64=240}, 0, 255, V|F },
{"scene", "scene change level", OFFSET(scene_score), AV_OPT_TYPE_DOUBLE, {.dbl=7.0}, 0, INT_MAX, V|F },
{"flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=1}, 0, INT_MAX, V|F, "flags" },
{"scene_change_detect", "enable scene change detection", 0, AV_OPT_TYPE_CONST, {.i64=FRAMERATE_FLAG_SCD}, INT_MIN, INT_MAX, V|F, "flags" },
{"scd", "enable scene change detection", 0, AV_OPT_TYPE_CONST, {.i64=FRAMERATE_FLAG_SCD}, INT_MIN, INT_MAX, V|F, "flags" },
{NULL}
}
#define NULL
Definition: coverity.c:32
static int flags
Definition: log.c:57
#define FRAMERATE_FLAG_SCD
Definition: vf_framerate.c:86
offset must point to AVRational
Definition: opt.h:236
#define F
Definition: vf_framerate.c:85
#define V
Definition: vf_framerate.c:84
#define OFFSET(x)
Definition: vf_framerate.c:83

Definition at line 88 of file vf_framerate.c.

const AVFilterPad framerate_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
Definition: vf_framerate.c:587
static int config_input(AVFilterLink *inlink)
Definition: vf_framerate.c:557

Definition at line 711 of file vf_framerate.c.

const AVFilterPad framerate_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: vf_framerate.c:661
static int config_output(AVFilterLink *outlink)
Definition: vf_framerate.c:616

Definition at line 721 of file vf_framerate.c.

AVFilter ff_vf_framerate
Initial value:
= {
.name = "framerate",
.description = NULL_IF_CONFIG_SMALL("Upsamples or downsamples progressive source between specified frame rates."),
.priv_size = sizeof(FrameRateContext),
.priv_class = &framerate_class,
.init = init,
}
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_framerate.c:524
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static const AVFilterPad framerate_outputs[]
Definition: vf_framerate.c:721
static int query_formats(AVFilterContext *ctx)
Definition: vf_framerate.c:536
static av_cold int init(AVFilterContext *ctx)
Definition: vf_framerate.c:509
static const AVFilterPad framerate_inputs[]
Definition: vf_framerate.c:711

Definition at line 731 of file vf_framerate.c.