FFmpeg
Data Structures | Macros | Functions | Variables
vf_bitplanenoise.c File Reference
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  BPNContext
 

Macros

#define OFFSET(x)   offsetof(BPNContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define CHECK_BIT(x, a, b, c)
 

Functions

 AVFILTER_DEFINE_CLASS (bitplanenoise)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption bitplanenoise_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_bitplanenoise
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 40 of file vf_bitplanenoise.c.

◆ FLAGS

Definition at line 41 of file vf_bitplanenoise.c.

◆ CHECK_BIT

#define CHECK_BIT (   x,
  a,
  b,
  c 
)
Value:
{ \
bit = (((val[(x)] & mask) == (val[(x) + (a)] & mask)) + \
((val[(x)] & mask) == (val[(x) + (b)] & mask)) + \
((val[(x)] & mask) == (val[(x) + (c)] & mask))) > 1; \
if (dst) \
dst[(x)] = factor * bit; \
stats[plane] += bit; }

Definition at line 94 of file vf_bitplanenoise.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( bitplanenoise  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 50 of file vf_bitplanenoise.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 76 of file vf_bitplanenoise.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 102 of file vf_bitplanenoise.c.

Variable Documentation

◆ bitplanenoise_options

const AVOption bitplanenoise_options[]
static
Initial value:
= {
{ "bitplane", "set bit plane to use for measuring noise", OFFSET(bitplane), AV_OPT_TYPE_INT, {.i64=1}, 1, 16, FLAGS},
{ "filter", "show noisy pixels", OFFSET(filter), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
{ NULL }
}

Definition at line 42 of file vf_bitplanenoise.c.

◆ inputs

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

Definition at line 199 of file vf_bitplanenoise.c.

◆ outputs

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

Definition at line 209 of file vf_bitplanenoise.c.

◆ ff_vf_bitplanenoise

AVFilter ff_vf_bitplanenoise
Initial value:
= {
.name = "bitplanenoise",
.description = NULL_IF_CONFIG_SMALL("Measure bit plane noise."),
.priv_size = sizeof(BPNContext),
.priv_class = &bitplanenoise_class,
}

Definition at line 217 of file vf_bitplanenoise.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_bitplanenoise.c:50
b
#define b
Definition: input.c:41
filter
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
Definition: filter_design.txt:228
inputs
static const AVFilterPad inputs[]
Definition: vf_bitplanenoise.c:199
bit
#define bit(string, value)
Definition: cbs_mpeg2.c:58
plane
int plane
Definition: avisynth_c.h:384
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_bitplanenoise.c:102
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_bitplanenoise.c:76
mask
static const uint16_t mask[17]
Definition: lzw.c:38
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: vf_bitplanenoise.c:40
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
BPNContext
Definition: vf_bitplanenoise.c:28
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:188
val
const char const char void * val
Definition: avisynth_c.h:863
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
outputs
static const AVFilterPad outputs[]
Definition: vf_bitplanenoise.c:209
FLAGS
#define FLAGS
Definition: vf_bitplanenoise.c:41
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
factor
static const int factor[16]
Definition: vf_pp7.c:75
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565