FFmpeg
Loading...
Searching...
No Matches
avf_showcwt.c File Reference
#include <float.h>
#include <math.h>
#include "libavutil/mem.h"
#include "libavutil/tx.h"
#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
#include "libavutil/cpu.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "audio.h"
#include "formats.h"
#include "video.h"
#include "avfilter.h"
#include "filters.h"

Go to the source code of this file.

Data Structures

struct  ShowCWTContext
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define DRAW_BAR_COLOR(x)
 

Enumerations

enum  FrequencyScale {
  FSCALE_LINEAR , FSCALE_LOG , FSCALE_BARK , FSCALE_MEL ,
  FSCALE_ERBS , FSCALE_SQRT , FSCALE_CBRT , FSCALE_QDRT ,
  FSCALE_FM , NB_FSCALE
}
 
enum  IntensityScale {
  ISCALE_LOG , ISCALE_LINEAR , ISCALE_SQRT , ISCALE_CBRT ,
  ISCALE_QDRT , NB_ISCALE
}
 
enum  DirectionMode {
  DIRECTION_LR , DIRECTION_RL , DIRECTION_UD , DIRECTION_DU ,
  NB_DIRECTION
}
 
enum  SlideMode { SLIDE_REPLACE , SLIDE_SCROLL , SLIDE_FRAME , NB_SLIDE }
 

Functions

 AVFILTER_DEFINE_CLASS (showcwt)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static float frequency_band (float *frequency_band, int frequency_band_count, float frequency_range, float frequency_offset, int frequency_scale, float deviation)
 
static float remap_log (ShowCWTContext *s, float value, int iscale, float log_factor)
 
static int run_channel_cwt_prepare (AVFilterContext *ctx, void *arg, int jobnr, int ch)
 
static void draw_bar (ShowCWTContext *s, int y, float Y, float U, float V)
 
static int draw (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int run_channel_cwt (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int compute_kernel (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static int output_frame (AVFilterContext *ctx)
 
static int run_channels_cwt_prepare (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int activate (AVFilterContext *ctx)
 

Variables

static const AVOption showcwt_options []
 
static const AVFilterPad showcwt_outputs []
 
const FFFilter ff_avf_showcwt
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 130 of file avf_showcwt.c.

◆ FLAGS

Definition at line 131 of file avf_showcwt.c.

◆ DRAW_BAR_COLOR

#define DRAW_BAR_COLOR ( x)
Value:
do { \
if (Y <= ht) { \
dstY[x] = 0; \
dstU[x] = 128; \
dstV[x] = 128; \
} else { \
float mul = (Y - ht) * bh[0]; \
dstY[x] = av_clip_uint8(lrintf(Y * mul * 255.f)); \
dstU[x] = av_clip_uint8(lrintf((U-0.5f) * 128.f + 128)); \
dstV[x] = av_clip_uint8(lrintf((V-0.5f) * 128.f + 128)); \
} \
} while (0)
#define U(x)
Definition vpx_arith.h:37
#define V
Definition avdct.c:32
#define Y
Definition boxblur.h:37
#define av_clip_uint8
Definition common.h:106
#define lrintf(x)
Definition libm_mips.h:72

Definition at line 365 of file avf_showcwt.c.

Referenced by draw_bar().

Enumeration Type Documentation

◆ FrequencyScale

Enumerator
FSCALE_LINEAR 
FSCALE_LOG 
FSCALE_BARK 
FSCALE_MEL 
FSCALE_ERBS 
FSCALE_SQRT 
FSCALE_CBRT 
FSCALE_QDRT 
FSCALE_FM 
NB_FSCALE 

Definition at line 37 of file avf_showcwt.c.

◆ IntensityScale

Enumerator
ISCALE_LOG 
ISCALE_LINEAR 
ISCALE_SQRT 
ISCALE_CBRT 
ISCALE_QDRT 
NB_ISCALE 

Definition at line 50 of file avf_showcwt.c.

◆ DirectionMode

Enumerator
DIRECTION_LR 
DIRECTION_RL 
DIRECTION_UD 
DIRECTION_DU 
NB_DIRECTION 

Definition at line 59 of file avf_showcwt.c.

◆ SlideMode

enum SlideMode
Enumerator
SLIDE_REPLACE 
SLIDE_SCROLL 
SLIDE_FRAME 
NB_SLIDE 

Definition at line 67 of file avf_showcwt.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( showcwt )

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 183 of file avf_showcwt.c.

Referenced by config_output().

◆ query_formats()

static int query_formats ( const AVFilterContext * ctx,
AVFilterFormatsConfig ** cfg_in,
AVFilterFormatsConfig ** cfg_out )
static

Definition at line 225 of file avf_showcwt.c.

◆ frequency_band()

static float frequency_band ( float * frequency_band,
int frequency_band_count,
float frequency_range,
float frequency_offset,
int frequency_scale,
float deviation )
static

Definition at line 245 of file avf_showcwt.c.

Referenced by config_output(), and frequency_band().

◆ remap_log()

static float remap_log ( ShowCWTContext * s,
float value,
int iscale,
float log_factor )
static

Definition at line 302 of file avf_showcwt.c.

Referenced by draw().

◆ run_channel_cwt_prepare()

static int run_channel_cwt_prepare ( AVFilterContext * ctx,
void * arg,
int jobnr,
int ch )
static

Definition at line 335 of file avf_showcwt.c.

Referenced by run_channels_cwt_prepare().

◆ draw_bar()

static void draw_bar ( ShowCWTContext * s,
int y,
float Y,
float U,
float V )
static

Definition at line 379 of file avf_showcwt.c.

Referenced by draw().

◆ draw()

◆ run_channel_cwt()

static int run_channel_cwt ( AVFilterContext * ctx,
void * arg,
int jobnr,
int nb_jobs )
static

Definition at line 641 of file avf_showcwt.c.

Referenced by activate().

◆ compute_kernel()

static int compute_kernel ( AVFilterContext * ctx)
static

Definition at line 712 of file avf_showcwt.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 801 of file avf_showcwt.c.

◆ output_frame()

static int output_frame ( AVFilterContext * ctx)
static

Definition at line 1038 of file avf_showcwt.c.

Referenced by activate().

◆ run_channels_cwt_prepare()

static int run_channels_cwt_prepare ( AVFilterContext * ctx,
void * arg,
int jobnr,
int nb_jobs )
static

Definition at line 1222 of file avf_showcwt.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 1235 of file avf_showcwt.c.

Variable Documentation

◆ showcwt_options

const AVOption showcwt_options[]
static

Definition at line 133 of file avf_showcwt.c.

◆ showcwt_outputs

const AVFilterPad showcwt_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static int config_output(AVBitStreamFilterLink *outlink)

Definition at line 1314 of file avf_showcwt.c.

◆ ff_avf_showcwt

const FFFilter ff_avf_showcwt
Initial value:
= {
.p.name = "showcwt",
.p.description = NULL_IF_CONFIG_SMALL("Convert input audio to a CWT (Continuous Wavelet Transform) spectrum video output."),
.p.priv_class = &showcwt_class,
.uninit = uninit,
.priv_size = sizeof(ShowCWTContext),
.activate = activate,
}
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition audio.c:34
static const AVFilterPad showcwt_outputs[]
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_QUERY_FUNC2(func)
Definition filters.h:241
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88

Definition at line 1322 of file avf_showcwt.c.