FFmpeg
|
#include <float.h>
#include <math.h>
#include "libavutil/tx.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/cpu.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/xga_font_data.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 | ShowSpectrumContext |
struct | ColorTable |
Macros | |
#define | OFFSET(x) offsetof(ShowSpectrumContext, 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 |
#define | MAGNITUDE(y, ch) hypotf(RE(y, ch), IM(y, ch)) |
#define | PHASE(y, ch) atan2f(IM(y, ch), RE(y, ch)) |
Enumerations | |
enum | DisplayMode { SINGLE, SEPARATE, NB_DMODES, LINE, BAR, DOT, NB_MODES, COMBINED, SEPARATE, NB_MODES } |
enum | DataMode { MAGNITUDE, PHASE, DELAY, NB_DATA, D_MAGNITUDE, D_PHASE, D_UPHASE, NB_DMODES } |
enum | FrequencyScale { FS_LINEAR, FS_LOG, FS_RLOG, NB_FSCALES, F_LINEAR, F_LOG, NB_FSCALES } |
enum | DisplayScale { LINEAR, SQRT, CBRT, LOG, RLOG, NB_SCALES, LINEAR, SQRT, CBRT, LOG, FOURTHRT, FIFTHRT, NB_SCALES, LINEAR, LOG, NB_DISPLAY_SCALE } |
enum | ColorMode { CHANNEL, INTENSITY, RAINBOW, MORELAND, NEBULAE, FIRE, FIERY, FRUIT, COOL, MAGMA, GREEN, VIRIDIS, PLASMA, CIVIDIS, TERRAIN, NB_CLMODES, COLOR_MODE_NONE = -1, COLOR_MODE_BT709, COLOR_MODE_FCC, COLOR_MODE_BT601, COLOR_MODE_SMPTE240M, COLOR_MODE_BT2020, COLOR_MODE_COUNT } |
enum | SlideMode { REPLACE, SCROLL, NB_SLIDES, REPLACE, SCROLL, FULLFRAME, RSCROLL, LREPLACE, NB_SLIDES, REPLACE, SCROLL, FULLFRAME, RSCROLL, NB_SLIDES } |
enum | Orientation { VERTICAL, HORIZONTAL, NB_ORIENTATIONS, VERTICAL, HORIZONTAL, NB_ORIENTATIONS } |
Functions | |
AVFILTER_DEFINE_CLASS (showspectrum) | |
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 void | drawtext (AVFrame *pic, int x, int y, const char *txt, int o) |
static void | color_range (ShowSpectrumContext *s, int ch, float *yf, float *uf, float *vf) |
static void | pick_color (ShowSpectrumContext *s, float yf, float uf, float vf, float a, float *out) |
static char * | get_time (AVFilterContext *ctx, float seconds, int x) |
static float | log_scale (const float bin, const float bmin, const float bmax, const float min, const float max) |
static float | get_hz (const float bin, const float bmax, const float min, const float max, int fscale) |
static float | inv_log_scale (float bin, float bmin, float bmax, float min, float max) |
static float | bin_pos (const int bin, const int num_bins, const float min, const float max) |
static float | get_scale (AVFilterContext *ctx, int scale, float a) |
static float | get_iscale (AVFilterContext *ctx, int scale, float a) |
static int | draw_legend (AVFilterContext *ctx, int samples) |
static float | get_value (AVFilterContext *ctx, int ch, int y) |
static int | plot_channel_lin (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
static int | plot_channel_log (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
static int | config_output (AVFilterLink *outlink) |
static int | calc_channel_magnitudes (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
static int | calc_channel_phases (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
static void | unwrap (float *x, int N, float tol, float *mi, float *ma) |
static int | calc_channel_uphases (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
static void | acalc_magnitudes (ShowSpectrumContext *s) |
static void | scale_magnitudes (ShowSpectrumContext *s, float scale) |
static void | clear_combine_buffer (ShowSpectrumContext *s, int size) |
static int | plot_spectrum_column (AVFilterLink *inlink, AVFrame *insamples) |
Variables | |
static const AVOption | showspectrum_options [] |
static const struct ColorTable | color_table [][8] |
audio to spectrum (video) transmedia filter, based on ffplay rdft showmode (by Michael Niedermayer) and lavfi/avf_showwaves (by Stefano Sabatini).
Definition in file avf_showspectrum.c.
#define OFFSET | ( | x | ) | offsetof(ShowSpectrumContext, x) |
Definition at line 110 of file avf_showspectrum.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 111 of file avf_showspectrum.c.
Definition at line 1249 of file avf_showspectrum.c.
Definition at line 1250 of file avf_showspectrum.c.
Definition at line 1251 of file avf_showspectrum.c.
Definition at line 1252 of file avf_showspectrum.c.
enum DisplayMode |
Enumerator | |
---|---|
SINGLE | |
SEPARATE | |
NB_DMODES | |
LINE | |
BAR | |
DOT | |
NB_MODES | |
COMBINED | |
SEPARATE | |
NB_MODES |
Definition at line 48 of file avf_showspectrum.c.
enum DataMode |
Enumerator | |
---|---|
MAGNITUDE | |
PHASE | |
DELAY | |
NB_DATA | |
D_MAGNITUDE | |
D_PHASE | |
D_UPHASE | |
NB_DMODES |
Definition at line 49 of file avf_showspectrum.c.
enum FrequencyScale |
Enumerator | |
---|---|
FS_LINEAR | |
FS_LOG | |
FS_RLOG | |
NB_FSCALES | |
F_LINEAR | |
F_LOG | |
NB_FSCALES |
Definition at line 50 of file avf_showspectrum.c.
enum DisplayScale |
Enumerator | |
---|---|
LINEAR | |
SQRT | |
CBRT | |
LOG | |
RLOG | |
NB_SCALES | |
LINEAR | |
SQRT | |
CBRT | |
LOG | |
FOURTHRT | |
FIFTHRT | |
NB_SCALES | |
LINEAR | |
LOG | |
NB_DISPLAY_SCALE |
Definition at line 51 of file avf_showspectrum.c.
enum ColorMode |
Definition at line 52 of file avf_showspectrum.c.
enum SlideMode |
Enumerator | |
---|---|
REPLACE | |
SCROLL | |
NB_SLIDES | |
REPLACE | |
SCROLL | |
FULLFRAME | |
RSCROLL | |
LREPLACE | |
NB_SLIDES | |
REPLACE | |
SCROLL | |
FULLFRAME | |
RSCROLL | |
NB_SLIDES |
Definition at line 53 of file avf_showspectrum.c.
enum Orientation |
Enumerator | |
---|---|
VERTICAL | |
HORIZONTAL | |
NB_ORIENTATIONS | |
VERTICAL | |
HORIZONTAL | |
NB_ORIENTATIONS |
Definition at line 54 of file avf_showspectrum.c.
AVFILTER_DEFINE_CLASS | ( | showspectrum | ) |
|
static |
Definition at line 290 of file avf_showspectrum.c.
|
static |
Definition at line 341 of file avf_showspectrum.c.
|
static |
Definition at line 372 of file avf_showspectrum.c.
Definition at line 472 of file avf_showspectrum.c.
Referenced by draw_legend(), and plot_spectrum_column().
|
static |
Definition at line 506 of file avf_showspectrum.c.
Referenced by plot_channel_lin(), and plot_channel_log().
|
static |
Definition at line 568 of file avf_showspectrum.c.
Referenced by draw_legend(), plot_channel_lin(), and plot_channel_log().
|
static |
Definition at line 612 of file avf_showspectrum.c.
Referenced by draw_legend(), and plot_spectrum_column().
|
static |
Definition at line 627 of file avf_showspectrum.c.
Referenced by get_hz().
|
static |
Definition at line 634 of file avf_showspectrum.c.
Referenced by draw_legend().
|
static |
Definition at line 648 of file avf_showspectrum.c.
Referenced by bin_pos().
Definition at line 655 of file avf_showspectrum.c.
Referenced by plot_channel_log().
|
static |
Definition at line 660 of file avf_showspectrum.c.
Referenced by get_value().
|
static |
Definition at line 695 of file avf_showspectrum.c.
Referenced by draw_legend().
|
static |
Definition at line 729 of file avf_showspectrum.c.
Referenced by config_output().
|
static |
Definition at line 929 of file avf_showspectrum.c.
Referenced by plot_channel_lin(), and plot_channel_log().
|
static |
Definition at line 953 of file avf_showspectrum.c.
Referenced by config_output().
|
static |
Definition at line 976 of file avf_showspectrum.c.
Referenced by config_output().
|
static |
Definition at line 1007 of file avf_showspectrum.c.
|
static |
Definition at line 1254 of file avf_showspectrum.c.
|
static |
Definition at line 1269 of file avf_showspectrum.c.
|
static |
Definition at line 1283 of file avf_showspectrum.c.
Referenced by calc_channel_uphases().
|
static |
Definition at line 1304 of file avf_showspectrum.c.
|
static |
Definition at line 1323 of file avf_showspectrum.c.
|
static |
Definition at line 1337 of file avf_showspectrum.c.
|
static |
Definition at line 1349 of file avf_showspectrum.c.
Referenced by plot_spectrum_column().
|
static |
Definition at line 1360 of file avf_showspectrum.c.
|
static |
Definition at line 113 of file avf_showspectrum.c.
|
static |
Referenced by pick_color().