FFmpeg
Data Structures | Macros | Functions | Variables
avf_showspatial.c File Reference
#include <float.h>
#include <math.h>
#include "libavcodec/avfft.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "audio.h"
#include "video.h"
#include "avfilter.h"
#include "filters.h"
#include "internal.h"
#include "window_func.h"

Go to the source code of this file.

Data Structures

struct  ShowSpatialContext
 

Macros

#define OFFSET(x)   offsetof(ShowSpatialContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define RE(y, ch)   s->fft_data[ch][y].re
 
#define IM(y, ch)   s->fft_data[ch][y].im
 

Functions

 AVFILTER_DEFINE_CLASS (showspatial)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int run_channel_fft (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_output (AVFilterLink *outlink)
 
static void draw_dot (uint8_t *dst, int linesize, int value)
 
static int draw_spatial (AVFilterLink *inlink, AVFrame *insamples)
 
static int spatial_activate (AVFilterContext *ctx)
 

Variables

static const AVOption showspatial_options []
 
static const AVFilterPad showspatial_inputs []
 
static const AVFilterPad showspatial_outputs []
 
AVFilter ff_avf_showspatial
 

Macro Definition Documentation

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

Definition at line 56 of file avf_showspatial.c.

Definition at line 57 of file avf_showspatial.c.

#define RE (   y,
  ch 
)    s->fft_data[ch][y].re

Definition at line 220 of file avf_showspatial.c.

Referenced by draw_spatial().

#define IM (   y,
  ch 
)    s->fft_data[ch][y].im

Definition at line 221 of file avf_showspatial.c.

Referenced by draw_spatial().

Function Documentation

AVFILTER_DEFINE_CLASS ( showspatial  )
static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 91 of file avf_showspatial.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 106 of file avf_showspatial.c.

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

Definition at line 133 of file avf_showspatial.c.

Referenced by spatial_activate().

static int config_output ( AVFilterLink outlink)
static

Definition at line 152 of file avf_showspatial.c.

static void draw_dot ( uint8_t dst,
int  linesize,
int  value 
)
static

Definition at line 223 of file avf_showspatial.c.

Referenced by draw_spatial().

static int draw_spatial ( AVFilterLink inlink,
AVFrame insamples 
)
static

Definition at line 232 of file avf_showspatial.c.

Referenced by spatial_activate().

static int spatial_activate ( AVFilterContext ctx)
static

Definition at line 281 of file avf_showspatial.c.

Variable Documentation

const AVOption showspatial_options[]
static
Initial value:
= {
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "512x512"}, 0, 0, FLAGS },
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "512x512"}, 0, 0, FLAGS },
{ "win_size", "set window size", OFFSET(win_size), AV_OPT_TYPE_INT, {.i64 = 4096}, 1024, 65536, FLAGS },
{ "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64 = WFUNC_HANNING}, 0, NB_WFUNC-1, FLAGS, "win_func" },
{ "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, FLAGS, "win_func" },
{ "bartlett", "Bartlett", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BARTLETT}, 0, 0, FLAGS, "win_func" },
{ "hann", "Hann", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING}, 0, 0, FLAGS, "win_func" },
{ "hanning", "Hanning", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING}, 0, 0, FLAGS, "win_func" },
{ "hamming", "Hamming", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HAMMING}, 0, 0, FLAGS, "win_func" },
{ "blackman", "Blackman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BLACKMAN}, 0, 0, FLAGS, "win_func" },
{ "welch", "Welch", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_WELCH}, 0, 0, FLAGS, "win_func" },
{ "flattop", "Flat-top", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_FLATTOP}, 0, 0, FLAGS, "win_func" },
{ "bharris", "Blackman-Harris", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHARRIS}, 0, 0, FLAGS, "win_func" },
{ "bnuttall", "Blackman-Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BNUTTALL}, 0, 0, FLAGS, "win_func" },
{ "bhann", "Bartlett-Hann", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHANN}, 0, 0, FLAGS, "win_func" },
{ "sine", "Sine", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_SINE}, 0, 0, FLAGS, "win_func" },
{ "nuttall", "Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_NUTTALL}, 0, 0, FLAGS, "win_func" },
{ "lanczos", "Lanczos", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_LANCZOS}, 0, 0, FLAGS, "win_func" },
{ "gauss", "Gauss", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_GAUSS}, 0, 0, FLAGS, "win_func" },
{ "tukey", "Tukey", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_TUKEY}, 0, 0, FLAGS, "win_func" },
{ "dolph", "Dolph-Chebyshev", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_DOLPH}, 0, 0, FLAGS, "win_func" },
{ "cauchy", "Cauchy", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_CAUCHY}, 0, 0, FLAGS, "win_func" },
{ "parzen", "Parzen", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_PARZEN}, 0, 0, FLAGS, "win_func" },
{ "poisson", "Poisson", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_POISSON}, 0, 0, FLAGS, "win_func" },
{ "bohman", "Bohman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BOHMAN}, 0, 0, FLAGS, "win_func" },
{ "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
uint8_t w
Definition: llviddspenc.c:38
#define FLAGS
offset must point to two consecutive integers
Definition: opt.h:233

Definition at line 59 of file avf_showspatial.c.

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

Definition at line 344 of file avf_showspatial.c.

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

Definition at line 352 of file avf_showspatial.c.

AVFilter ff_avf_showspatial
Initial value:
= {
.name = "showspatial",
.description = NULL_IF_CONFIG_SMALL("Convert input audio to a spatial video output."),
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ShowSpatialContext),
.priv_class = &showspatial_class,
}
filter_frame For filters that do not use the activate() callback
static int spatial_activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad showspatial_outputs[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad showspatial_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
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static int query_formats(AVFilterContext *ctx)

Definition at line 361 of file avf_showspatial.c.