FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_waveform.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  WaveformContext
 

Macros

#define OFFSET(x)   offsetof(WaveformContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  FilterType {
  BUTTERWORTH, CHEBYSHEV1, CHEBYSHEV2, NB_TYPES,
  biquad, equalizer, bass, treble,
  band, bandpass, bandreject, allpass,
  highpass, lowpass, LOWPASS, FLAT,
  AFLAT, CHROMA, ACHROMA, COLOR,
  NB_FILTERS
}
 

Functions

 AVFILTER_DEFINE_CLASS (waveform)
 
static int query_formats (AVFilterContext *ctx)
 
static void envelope_instant16 (WaveformContext *s, AVFrame *out, int plane, int component)
 
static void envelope_instant (WaveformContext *s, AVFrame *out, int plane, int component)
 
static void envelope_peak16 (WaveformContext *s, AVFrame *out, int plane, int component)
 
static void envelope_peak (WaveformContext *s, AVFrame *out, int plane, int component)
 
static void envelope16 (WaveformContext *s, AVFrame *out, int plane, int component)
 
static void envelope (WaveformContext *s, AVFrame *out, int plane, int component)
 
static void update16 (uint16_t *target, int max, int intensity, int limit)
 
static void update (uint8_t *target, int max, int intensity)
 
static void lowpass16 (WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
 
static void lowpass (WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
 
static void flat (WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
 
static void aflat (WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
 
static void chroma (WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
 
static void achroma (WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
 
static void color16 (WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
 
static void color (WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption waveform_options []
 
static enum AVPixelFormat lowpass_pix_fmts []
 
static enum AVPixelFormat flat_pix_fmts []
 
static enum AVPixelFormat color_pix_fmts []
 
static const uint8_t black_yuva_color [4] = { 0, 127, 127, 255 }
 
static const uint8_t black_gbrp_color [4] = { 0, 0, 0, 255 }
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_waveform
 

Macro Definition Documentation

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

Definition at line 66 of file vf_waveform.c.

Definition at line 67 of file vf_waveform.c.

Enumeration Type Documentation

enum FilterType
Enumerator
BUTTERWORTH 
CHEBYSHEV1 
CHEBYSHEV2 
NB_TYPES 
biquad 
equalizer 
bass 
treble 
band 
bandpass 
bandreject 
allpass 
highpass 
lowpass 
LOWPASS 
FLAT 
AFLAT 
CHROMA 
ACHROMA 
COLOR 
NB_FILTERS 

Definition at line 31 of file vf_waveform.c.

Function Documentation

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

Definition at line 132 of file vf_waveform.c.

static void envelope_instant16 ( WaveformContext s,
AVFrame out,
int  plane,
int  component 
)
static

Definition at line 153 of file vf_waveform.c.

Referenced by envelope16(), and envelope_peak16().

static void envelope_instant ( WaveformContext s,
AVFrame out,
int  plane,
int  component 
)
static

Definition at line 204 of file vf_waveform.c.

Referenced by envelope(), and envelope_peak().

static void envelope_peak16 ( WaveformContext s,
AVFrame out,
int  plane,
int  component 
)
static

Definition at line 254 of file vf_waveform.c.

Referenced by envelope16().

static void envelope_peak ( WaveformContext s,
AVFrame out,
int  plane,
int  component 
)
static

Definition at line 327 of file vf_waveform.c.

Referenced by envelope().

static void envelope16 ( WaveformContext s,
AVFrame out,
int  plane,
int  component 
)
static

Definition at line 399 of file vf_waveform.c.

Referenced by color16(), and lowpass16().

static void envelope ( WaveformContext s,
AVFrame out,
int  plane,
int  component 
)
static

Definition at line 410 of file vf_waveform.c.

Referenced by achroma(), aflat(), chroma(), color(), flat(), and lowpass().

static void update16 ( uint16_t *  target,
int  max,
int  intensity,
int  limit 
)
static

Definition at line 421 of file vf_waveform.c.

Referenced by lowpass16().

static void update ( uint8_t target,
int  max,
int  intensity 
)
static

Definition at line 429 of file vf_waveform.c.

Referenced by achroma(), aflat(), chroma(), flat(), and lowpass().

static void lowpass16 ( WaveformContext s,
AVFrame in,
AVFrame out,
int  component,
int  intensity,
int  offset,
int  column 
)
static

Definition at line 437 of file vf_waveform.c.

Referenced by config_input().

static void lowpass ( WaveformContext s,
AVFrame in,
AVFrame out,
int  component,
int  intensity,
int  offset,
int  column 
)
static

Definition at line 487 of file vf_waveform.c.

Referenced by config_input().

static void flat ( WaveformContext s,
AVFrame in,
AVFrame out,
int  component,
int  intensity,
int  offset,
int  column 
)
static
static void aflat ( WaveformContext s,
AVFrame in,
AVFrame out,
int  component,
int  intensity,
int  offset,
int  column 
)
static

Definition at line 630 of file vf_waveform.c.

Referenced by config_input().

static void chroma ( WaveformContext s,
AVFrame in,
AVFrame out,
int  component,
int  intensity,
int  offset,
int  column 
)
static
static void achroma ( WaveformContext s,
AVFrame in,
AVFrame out,
int  component,
int  intensity,
int  offset,
int  column 
)
static

Definition at line 812 of file vf_waveform.c.

Referenced by config_input().

static void color16 ( WaveformContext s,
AVFrame in,
AVFrame out,
int  component,
int  intensity,
int  offset,
int  column 
)
static

Definition at line 900 of file vf_waveform.c.

Referenced by config_input().

static void color ( WaveformContext s,
AVFrame in,
AVFrame out,
int  component,
int  intensity,
int  offset,
int  column 
)
static

Definition at line 991 of file vf_waveform.c.

Referenced by config_input().

static int config_input ( AVFilterLink inlink)
static

Definition at line 1084 of file vf_waveform.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 1132 of file vf_waveform.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 1191 of file vf_waveform.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 1238 of file vf_waveform.c.

Variable Documentation

const AVOption waveform_options[]
static

Definition at line 69 of file vf_waveform.c.

enum AVPixelFormat lowpass_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:359
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:361
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:362
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:68
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:181
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:346
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:103
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:358
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:345
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:102
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:76
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:188
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:333
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:67
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:328
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:75
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:363
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:329
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:189
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:330
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:69
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:327
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:331
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:63
Y , 8bpp.
Definition: pixfmt.h:71
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:229
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:360
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:77
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:70
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:266
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:101

Definition at line 103 of file vf_waveform.c.

Referenced by query_formats().

enum AVPixelFormat flat_pix_fmts[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:68
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:77

Definition at line 120 of file vf_waveform.c.

Referenced by query_formats().

enum AVPixelFormat color_pix_fmts[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:68
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:181
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:346
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:345
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:333
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:329
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:229
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:77

Definition at line 124 of file vf_waveform.c.

Referenced by query_formats().

const uint8_t black_yuva_color[4] = { 0, 127, 127, 255 }
static

Definition at line 1081 of file vf_waveform.c.

Referenced by config_input().

const uint8_t black_gbrp_color[4] = { 0, 0, 0, 255 }
static

Definition at line 1082 of file vf_waveform.c.

Referenced by config_input().

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 config_input(AVFilterLink *inlink)
Definition: vf_waveform.c:1084
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_waveform.c:1191

Definition at line 1245 of file vf_waveform.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: vf_waveform.c:1132

Definition at line 1255 of file vf_waveform.c.

AVFilter ff_vf_waveform
Initial value:
= {
.name = "waveform",
.description = NULL_IF_CONFIG_SMALL("Video waveform monitor."),
.priv_size = sizeof(WaveformContext),
.priv_class = &waveform_class,
}
static const AVFilterPad inputs[]
Definition: vf_waveform.c:1245
static int query_formats(AVFilterContext *ctx)
Definition: vf_waveform.c:132
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad outputs[]
Definition: vf_waveform.c:1255
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_waveform.c:1238

Definition at line 1264 of file vf_waveform.c.