FFmpeg  4.3
Data Structures | Macros | Functions | Variables
vf_decimate.c File Reference
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/timestamp.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  qitem
 
struct  DecimateContext
 

Macros

#define INPUT_MAIN   0
 
#define INPUT_CLEANSRC   1
 
#define OFFSET(x)   offsetof(DecimateContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define CALC_DIFF(nbits)
 
#define PF_NOALPHA(suf)   AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf
 
#define PF_ALPHA(suf)   AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf
 
#define PF(suf)   PF_NOALPHA(suf), PF_ALPHA(suf)
 

Functions

 AVFILTER_DEFINE_CLASS (decimate)
 
static void calc_diffs (const DecimateContext *dm, struct qitem *q, const AVFrame *f1, const AVFrame *f2)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold int decimate_init (AVFilterContext *ctx)
 
static av_cold void decimate_uninit (AVFilterContext *ctx)
 
static int request_inlink (AVFilterContext *ctx, int lid)
 
static int request_frame (AVFilterLink *outlink)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 

Variables

static const AVOption decimate_options []
 
static const AVFilterPad decimate_outputs []
 
AVFilter ff_vf_decimate
 

Macro Definition Documentation

◆ INPUT_MAIN

#define INPUT_MAIN   0

Definition at line 28 of file vf_decimate.c.

◆ INPUT_CLEANSRC

#define INPUT_CLEANSRC   1

Definition at line 29 of file vf_decimate.c.

◆ OFFSET

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

Definition at line 65 of file vf_decimate.c.

◆ FLAGS

Definition at line 66 of file vf_decimate.c.

◆ CALC_DIFF

#define CALC_DIFF (   nbits)
Value:
do { \
for (x = 0; x < width; x += hblockx) { \
int64_t acc = 0; \
int m = FFMIN(width, x + hblockx); \
for (xl = x; xl < m; xl++) \
acc += abs(((const uint##nbits##_t *)f1p)[xl] - \
((const uint##nbits##_t *)f2p)[xl]); \
bdiffs[ydest * dm->nxblocks + xdest] += acc; \
xdest++; \
} \
} while (0)

◆ PF_NOALPHA

#define PF_NOALPHA (   suf)    AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf

◆ PF_ALPHA

#define PF_ALPHA (   suf)    AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf

◆ PF

#define PF (   suf)    PF_NOALPHA(suf), PF_ALPHA(suf)

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( decimate  )

◆ calc_diffs()

static void calc_diffs ( const DecimateContext dm,
struct qitem q,
const AVFrame f1,
const AVFrame f2 
)
static

Definition at line 81 of file vf_decimate.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 146 of file vf_decimate.c.

Referenced by decimate_init(), and request_inlink().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 239 of file vf_decimate.c.

Referenced by decimate_init().

◆ decimate_init()

static av_cold int decimate_init ( AVFilterContext ctx)
static

Definition at line 272 of file vf_decimate.c.

◆ decimate_uninit()

static av_cold void decimate_uninit ( AVFilterContext ctx)
static

Definition at line 312 of file vf_decimate.c.

◆ request_inlink()

static int request_inlink ( AVFilterContext ctx,
int  lid 
)
static

Definition at line 333 of file vf_decimate.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 349 of file vf_decimate.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 365 of file vf_decimate.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 382 of file vf_decimate.c.

Variable Documentation

◆ decimate_options

const AVOption decimate_options[]
static
Initial value:
= {
{ "cycle", "set the number of frame from which one will be dropped", OFFSET(cycle), AV_OPT_TYPE_INT, {.i64 = 5}, 2, 25, FLAGS },
{ "dupthresh", "set duplicate threshold", OFFSET(dupthresh_flt), AV_OPT_TYPE_DOUBLE, {.dbl = 1.1}, 0, 100, FLAGS },
{ "scthresh", "set scene change threshold", OFFSET(scthresh_flt), AV_OPT_TYPE_DOUBLE, {.dbl = 15.0}, 0, 100, FLAGS },
{ "blockx", "set the size of the x-axis blocks used during metric calculations", OFFSET(blockx), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
{ "blocky", "set the size of the y-axis blocks used during metric calculations", OFFSET(blocky), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS },
{ "ppsrc", "mark main input as a pre-processed input and activate clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "chroma", "set whether or not chroma is considered in the metric calculations", OFFSET(chroma), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ NULL }
}

Definition at line 68 of file vf_decimate.c.

◆ decimate_outputs

const AVFilterPad decimate_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_output,
},
{ NULL }
}

Definition at line 407 of file vf_decimate.c.

◆ ff_vf_decimate

AVFilter ff_vf_decimate
Initial value:
= {
.name = "decimate",
.description = NULL_IF_CONFIG_SMALL("Decimate frames (post field matching filter)."),
.init = decimate_init,
.uninit = decimate_uninit,
.priv_size = sizeof(DecimateContext),
.priv_class = &decimate_class,
}

Definition at line 417 of file vf_decimate.c.

acc
int acc
Definition: yuv2rgb.c:555
chroma
static av_always_inline void chroma(WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset_y, int offset_x, int column, int mirror, int jobnr, int nb_jobs)
Definition: vf_waveform.c:1631
x
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
Definition: fate.txt:150
AVFILTER_FLAG_DYNAMIC_INPUTS
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:105
width
#define width
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
OFFSET
#define OFFSET(x)
Definition: vf_decimate.c:65
NULL
#define NULL
Definition: coverity.c:32
abs
#define abs(x)
Definition: cuda_runtime.h:35
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:186
FFMIN
#define FFMIN(a, b)
Definition: common.h:96
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_decimate.c:365
decimate_uninit
static av_cold void decimate_uninit(AVFilterContext *ctx)
Definition: vf_decimate.c:312
decimate_init
static av_cold int decimate_init(AVFilterContext *ctx)
Definition: vf_decimate.c:272
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_decimate.c:382
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
DecimateContext
Definition: vf_decimate.c:37
FLAGS
#define FLAGS
Definition: vf_decimate.c:66
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_decimate.c:349
decimate_outputs
static const AVFilterPad decimate_outputs[]
Definition: vf_decimate.c:407