FFmpeg  4.3
Data Structures | Macros | Enumerations | Functions | Variables
vf_signalstats.c File Reference
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  SignalstatsContext
 
struct  ThreadData
 Used for passing data between threads. More...
 
struct  ThreadDataHueSatMetrics
 

Macros

#define OFFSET(x)   offsetof(SignalstatsContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define FILTER(i, j)
 
#define FILTER3(j)   (FILTER(-1, j) && FILTER(0, j) && FILTER(1, j))
 
#define VREP_START   4
 
#define SET_META(key, fmt, val)
 

Enumerations

enum  FilterMode {
  FILTER_8TAP_SMOOTH, FILTER_8TAP_REGULAR, FILTER_8TAP_SHARP, FILTER_BILINEAR,
  N_FILTERS, FILTER_SWITCHABLE = N_FILTERS, MODE_WIRES, MODE_COLORMIX,
  MODE_CANNY, NB_MODE, MODE_NONE, MODE_INTERLEAVE,
  MODE_DEINTERLEAVE, FILTER_NONE = -1, FILTER_TOUT, FILTER_VREP,
  FILTER_BRNG, FILT_NUMB
}
 

Functions

 AVFILTER_DEFINE_CLASS (signalstats)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static AVFramealloc_frame (enum AVPixelFormat pixfmt, int w, int h)
 
static int config_output (AVFilterLink *outlink)
 
static void burn_frame8 (const SignalstatsContext *s, AVFrame *f, int x, int y)
 
static void burn_frame16 (const SignalstatsContext *s, AVFrame *f, int x, int y)
 
static int filter8_brng (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter16_brng (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_tout_outlier (uint8_t x, uint8_t y, uint8_t z)
 
static int filter8_tout (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter16_tout (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter8_vrep (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter16_vrep (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int compute_sat_hue_metrics8 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int compute_sat_hue_metrics16 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static unsigned compute_bit_depth (uint16_t mask)
 
static int filter_frame8 (AVFilterLink *link, AVFrame *in)
 
static int filter_frame16 (AVFilterLink *link, AVFrame *in)
 
static int filter_frame (AVFilterLink *link, AVFrame *in)
 

Variables

static const AVOption signalstats_options []
 
struct {
   const char *   name
 
   int(*   process8 )(AVFilterContext *ctx, void
      *arg, int jobnr, int nb_jobs)
 
   int(*   process16 )(AVFilterContext *ctx, void
      *arg, int jobnr, int nb_jobs)
 
filters_def []
 
static const AVFilterPad signalstats_inputs []
 
static const AVFilterPad signalstats_outputs []
 
AVFilter ff_vf_signalstats
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 70 of file vf_signalstats.c.

◆ FLAGS

Definition at line 71 of file vf_signalstats.c.

◆ FILTER

#define FILTER (   i,
 
)
Value:
filter_tout_outlier(p[(y-j) * lw + x + i], \
p[ y * lw + x + i], \
p[(y+j) * lw + x + i])

◆ FILTER3

#define FILTER3 (   j)    (FILTER(-1, j) && FILTER(0, j) && FILTER(1, j))

◆ VREP_START

#define VREP_START   4

Definition at line 383 of file vf_signalstats.c.

◆ SET_META

#define SET_META (   key,
  fmt,
  val 
)
Value:
do { \
snprintf(metabuf, sizeof(metabuf), fmt, val); \
av_dict_set(&out->metadata, "lavfi.signalstats." key, metabuf, 0); \
} while (0)

Enumeration Type Documentation

◆ FilterMode

enum FilterMode
Enumerator
FILTER_8TAP_SMOOTH 
FILTER_8TAP_REGULAR 
FILTER_8TAP_SHARP 
FILTER_BILINEAR 
N_FILTERS 
FILTER_SWITCHABLE 
MODE_WIRES 
MODE_COLORMIX 
MODE_CANNY 
NB_MODE 
MODE_NONE 
MODE_INTERLEAVE 
MODE_DEINTERLEAVE 
FILTER_NONE 
FILTER_TOUT 
FILTER_VREP 
FILTER_BRNG 
FILT_NUMB 

Definition at line 28 of file vf_signalstats.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( signalstats  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 89 of file vf_signalstats.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 106 of file vf_signalstats.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 119 of file vf_signalstats.c.

◆ alloc_frame()

static AVFrame* alloc_frame ( enum AVPixelFormat  pixfmt,
int  w,
int  h 
)
static

Definition at line 143 of file vf_signalstats.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 161 of file vf_signalstats.c.

◆ burn_frame8()

static void burn_frame8 ( const SignalstatsContext s,
AVFrame f,
int  x,
int  y 
)
static

Definition at line 201 of file vf_signalstats.c.

Referenced by filter8_brng(), filter8_tout(), and filter8_vrep().

◆ burn_frame16()

static void burn_frame16 ( const SignalstatsContext s,
AVFrame f,
int  x,
int  y 
)
static

Definition at line 210 of file vf_signalstats.c.

Referenced by filter16_brng(), filter16_tout(), and filter16_vrep().

◆ filter8_brng()

static int filter8_brng ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 220 of file vf_signalstats.c.

◆ filter16_brng()

static int filter16_brng ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 254 of file vf_signalstats.c.

◆ filter_tout_outlier()

static int filter_tout_outlier ( uint8_t  x,
uint8_t  y,
uint8_t  z 
)
static

Definition at line 289 of file vf_signalstats.c.

◆ filter8_tout()

static int filter8_tout ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 294 of file vf_signalstats.c.

◆ filter16_tout()

static int filter16_tout ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 342 of file vf_signalstats.c.

◆ filter8_vrep()

static int filter8_vrep ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 385 of file vf_signalstats.c.

◆ filter16_vrep()

static int filter16_vrep ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 419 of file vf_signalstats.c.

◆ compute_sat_hue_metrics8()

static int compute_sat_hue_metrics8 ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 465 of file vf_signalstats.c.

Referenced by filter_frame8().

◆ compute_sat_hue_metrics16()

static int compute_sat_hue_metrics16 ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 503 of file vf_signalstats.c.

Referenced by filter_frame16().

◆ compute_bit_depth()

static unsigned compute_bit_depth ( uint16_t  mask)
static

Definition at line 542 of file vf_signalstats.c.

Referenced by filter_frame16(), and filter_frame8().

◆ filter_frame8()

static int filter_frame8 ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 547 of file vf_signalstats.c.

Referenced by filter_frame().

◆ filter_frame16()

static int filter_frame16 ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 769 of file vf_signalstats.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 986 of file vf_signalstats.c.

Variable Documentation

◆ signalstats_options

const AVOption signalstats_options[]
static
Initial value:
= {
{"stat", "set statistics filters", OFFSET(filters), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, INT_MAX, FLAGS, "filters"},
{"tout", "analyze pixels for temporal outliers", 0, AV_OPT_TYPE_CONST, {.i64=1<<FILTER_TOUT}, 0, 0, FLAGS, "filters"},
{"vrep", "analyze video lines for vertical line repetition", 0, AV_OPT_TYPE_CONST, {.i64=1<<FILTER_VREP}, 0, 0, FLAGS, "filters"},
{"brng", "analyze for pixels outside of broadcast range", 0, AV_OPT_TYPE_CONST, {.i64=1<<FILTER_BRNG}, 0, 0, FLAGS, "filters"},
{"out", "set video filter", OFFSET(outfilter), AV_OPT_TYPE_INT, {.i64=FILTER_NONE}, -1, FILT_NUMB-1, FLAGS, "out"},
{"tout", "highlight pixels that depict temporal outliers", 0, AV_OPT_TYPE_CONST, {.i64=FILTER_TOUT}, 0, 0, FLAGS, "out"},
{"vrep", "highlight video lines that depict vertical line repetition", 0, AV_OPT_TYPE_CONST, {.i64=FILTER_VREP}, 0, 0, FLAGS, "out"},
{"brng", "highlight pixels that are outside of broadcast range", 0, AV_OPT_TYPE_CONST, {.i64=FILTER_BRNG}, 0, 0, FLAGS, "out"},
{"c", "set highlight color", OFFSET(rgba_color), AV_OPT_TYPE_COLOR, {.str="yellow"}, .flags=FLAGS},
{"color", "set highlight color", OFFSET(rgba_color), AV_OPT_TYPE_COLOR, {.str="yellow"}, .flags=FLAGS},
{NULL}
}

Definition at line 73 of file vf_signalstats.c.

◆ name

const char* name

Definition at line 455 of file vf_signalstats.c.

Referenced by filter_frame16(), and filter_frame8().

◆ process8

int(* process8) (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)

Definition at line 456 of file vf_signalstats.c.

Referenced by filter_frame8().

◆ process16

int(* process16) (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)

Definition at line 457 of file vf_signalstats.c.

Referenced by filter_frame16().

◆ filters_def

const { ... } filters_def[]
Initial value:

Referenced by filter_frame16(), and filter_frame8().

◆ signalstats_inputs

const AVFilterPad signalstats_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 997 of file vf_signalstats.c.

◆ signalstats_outputs

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

Definition at line 1006 of file vf_signalstats.c.

◆ ff_vf_signalstats

AVFilter ff_vf_signalstats
Initial value:
= {
.name = "signalstats",
.description = "Generate statistics from video analysis.",
.init = init,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(SignalstatsContext),
.priv_class = &signalstats_class,
}

Definition at line 1015 of file vf_signalstats.c.

out
FILE * out
Definition: movenc.c:54
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_signalstats.c:89
filters
static const struct PPFilter filters[]
Definition: postprocess.c:134
filter8_brng
static int filter8_brng(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_signalstats.c:220
FLAGS
#define FLAGS
Definition: vf_signalstats.c:71
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
val
static double val(void *priv, double ch)
Definition: aeval.c:76
filter16_tout
static int filter16_tout(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_signalstats.c:342
filter_tout_outlier
static int filter_tout_outlier(uint8_t x, uint8_t y, uint8_t z)
Definition: vf_signalstats.c:289
FILT_NUMB
@ FILT_NUMB
Definition: vf_signalstats.c:33
SignalstatsContext
Definition: vf_signalstats.c:36
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_signalstats.c:106
FILTER_VREP
@ FILTER_VREP
Definition: vf_signalstats.c:31
OFFSET
#define OFFSET(x)
Definition: vf_signalstats.c:70
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
key
const char * key
Definition: hwcontext_opencl.c:168
NULL
#define NULL
Definition: coverity.c:32
FILTER_BRNG
@ FILTER_BRNG
Definition: vf_signalstats.c:32
filter8_tout
static int filter8_tout(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_signalstats.c:294
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Definition: opt.h:238
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
signalstats_inputs
static const AVFilterPad signalstats_inputs[]
Definition: vf_signalstats.c:997
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_signalstats.c:986
signalstats_outputs
static const AVFilterPad signalstats_outputs[]
Definition: vf_signalstats.c:1006
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
FILTER_TOUT
@ FILTER_TOUT
Definition: vf_signalstats.c:30
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_signalstats.c:161
filter16_brng
static int filter16_brng(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_signalstats.c:254
FILTER_NONE
@ FILTER_NONE
Definition: vf_signalstats.c:29
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
filter8_vrep
static int filter8_vrep(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_signalstats.c:385
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_signalstats.c:119
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
filter16_vrep
static int filter16_vrep(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_signalstats.c:419
AV_OPT_TYPE_FLAGS
@ AV_OPT_TYPE_FLAGS
Definition: opt.h:222
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232