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

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

Definition at line 40 of file vf_bitplanenoise.c.

Definition at line 41 of file vf_bitplanenoise.c.

#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; \
int plane
Definition: avisynth_c.h:384
const char const char void * val
Definition: avisynth_c.h:863
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:36
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
static const uint16_t mask[17]
Definition: lzw.c:38
#define b
Definition: input.c:41
static void stats(AVPacket *const *in, int n_in, unsigned *_max, unsigned *_sum)
if(ret)
static const int factor[16]
Definition: vf_pp7.c:75
#define bit(string, value)
Definition: cbs_mpeg2.c:58

Definition at line 94 of file vf_bitplanenoise.c.

Referenced by filter_frame().

Function Documentation

AVFILTER_DEFINE_CLASS ( bitplanenoise  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 50 of file vf_bitplanenoise.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 76 of file vf_bitplanenoise.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 102 of file vf_bitplanenoise.c.

Variable Documentation

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 }
}
#define NULL
Definition: coverity.c:32
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
#define FLAGS
#define OFFSET(x)

Definition at line 42 of file vf_bitplanenoise.c.

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

Definition at line 199 of file vf_bitplanenoise.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 209 of file vf_bitplanenoise.c.

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,
}
static const AVFilterPad outputs[]
#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
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad inputs[]
static int query_formats(AVFilterContext *ctx)
#define flags(name, subs,...)
Definition: cbs_av1.c:561

Definition at line 217 of file vf_bitplanenoise.c.