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

Go to the source code of this file.

Data Structures

struct  ShowFreqsContext
 

Macros

#define OFFSET(x)   offsetof(ShowFreqsContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define RE(x, ch)   s->fft_data[ch][x].re
 
#define IM(x, ch)   s->fft_data[ch][x].im
 
#define M(a, b)   (sqrt((a) * (a) + (b) * (b)))
 

Enumerations

enum  DisplayMode {
  SINGLE, SEPARATE, NB_DMODES, LINE,
  BAR, DOT, NB_MODES, COMBINED,
  SEPARATE, NB_MODES
}
 
enum  ChannelMode { COMBINED, SEPARATE, NB_CMODES }
 
enum  FrequencyScale {
  FS_LINEAR, FS_LOG, FS_RLOG, NB_FSCALES,
  F_LINEAR, F_LOG, NB_FSCALES
}
 
enum  AmplitudeScale {
  ALINEAR, ALOG, NB_ASCALES, AS_LINEAR,
  AS_SQRT, AS_CBRT, AS_LOG, NB_ASCALES
}
 

Functions

 AVFILTER_DEFINE_CLASS (showfreqs)
 
static int query_formats (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static void draw_dot (AVFrame *out, int x, int y, uint8_t fg[4])
 
static int get_sx (ShowFreqsContext *s, int f)
 
static float get_bsize (ShowFreqsContext *s, int f)
 
static void plot_freq (ShowFreqsContext *s, int ch, double a, int f, uint8_t fg[4], int *prev_y, AVFrame *out, AVFilterLink *outlink)
 
static int plot_freqs (AVFilterLink *inlink, AVFrame *in)
 
static int filter_frame (AVFilterLink *inlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption showfreqs_options []
 
static const AVFilterPad showfreqs_inputs []
 
static const AVFilterPad showfreqs_outputs []
 
AVFilter ff_avf_showfreqs
 

Macro Definition Documentation

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

Definition at line 70 of file avf_showfreqs.c.

Definition at line 71 of file avf_showfreqs.c.

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

Referenced by plot_freqs().

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

Referenced by plot_freqs().

#define M (   a,
  b 
)    (sqrt((a) * (a) + (b) * (b)))

Referenced by plot_freqs().

Enumeration Type Documentation

Enumerator
SINGLE 
SEPARATE 
NB_DMODES 
LINE 
BAR 
DOT 
NB_MODES 
COMBINED 
SEPARATE 
NB_MODES 

Definition at line 39 of file avf_showfreqs.c.

Enumerator
COMBINED 
SEPARATE 
NB_CMODES 

Definition at line 40 of file avf_showfreqs.c.

Enumerator
FS_LINEAR 
FS_LOG 
FS_RLOG 
NB_FSCALES 
F_LINEAR 
F_LOG 
NB_FSCALES 

Definition at line 41 of file avf_showfreqs.c.

Enumerator
ALINEAR 
ALOG 
NB_ASCALES 
AS_LINEAR 
AS_SQRT 
AS_CBRT 
AS_LOG 
NB_ASCALES 

Definition at line 42 of file avf_showfreqs.c.

Function Documentation

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

Definition at line 123 of file avf_showfreqs.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 154 of file avf_showfreqs.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 163 of file avf_showfreqs.c.

static void draw_dot ( AVFrame out,
int  x,
int  y,
uint8_t  fg[4] 
)
inlinestatic

Definition at line 236 of file avf_showfreqs.c.

Referenced by plot_freq().

static int get_sx ( ShowFreqsContext s,
int  f 
)
static

Definition at line 247 of file avf_showfreqs.c.

Referenced by plot_freq().

static float get_bsize ( ShowFreqsContext s,
int  f 
)
static

Definition at line 261 of file avf_showfreqs.c.

Referenced by plot_freq().

static void plot_freq ( ShowFreqsContext s,
int  ch,
double  a,
int  f,
uint8_t  fg[4],
int prev_y,
AVFrame out,
AVFilterLink outlink 
)
inlinestatic

Definition at line 277 of file avf_showfreqs.c.

Referenced by plot_freqs().

static int plot_freqs ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 360 of file avf_showfreqs.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink)
static

Definition at line 432 of file avf_showfreqs.c.

Referenced by activate().

static int activate ( AVFilterContext ctx)
static

Definition at line 460 of file avf_showfreqs.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 492 of file avf_showfreqs.c.

Variable Documentation

const AVOption showfreqs_options[]
static

Definition at line 73 of file avf_showfreqs.c.

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

Definition at line 510 of file avf_showfreqs.c.

const AVFilterPad showfreqs_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 518 of file avf_showfreqs.c.

AVFilter ff_avf_showfreqs
Initial value:
= {
.name = "showfreqs",
.description = NULL_IF_CONFIG_SMALL("Convert input audio to a frequencies video output."),
.init = init,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ShowFreqsContext),
.priv_class = &showfreqs_class,
}
static av_cold int init(AVFilterContext *ctx)
static const AVFilterPad showfreqs_outputs[]
static int query_formats(AVFilterContext *ctx)
static int activate(AVFilterContext *ctx)
#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 outputs[]
Definition: af_acontrast.c:203
static av_cold void uninit(AVFilterContext *ctx)
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
static const AVFilterPad showfreqs_inputs[]

Definition at line 527 of file avf_showfreqs.c.