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


#define OFFSET(x)   offsetof(BPNContext, x)
#define CHECK_BIT(x, a, b, c)


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


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,
{ \
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; }
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)
static const int factor[16]
Definition: vf_pp7.c:75
#define bit(string, value)
Definition: cbs_mpeg2.c:58
static double val(void *priv, double ch)
Definition: aeval.c:76

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)

Definition at line 50 of file vf_bitplanenoise.c.

static int config_input ( AVFilterLink inlink)

Definition at line 76 of file vf_bitplanenoise.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 

Definition at line 102 of file vf_bitplanenoise.c.

Variable Documentation

const AVOption bitplanenoise_options[]
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[]
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[]
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[]
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:126
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:153
static const AVFilterPad inputs[]
static int query_formats(AVFilterContext *ctx)
#define flags(name, subs,...)
Definition: cbs_av1.c:560

Definition at line 217 of file vf_bitplanenoise.c.