FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
af_afade.c File Reference

fade audio filter More...

#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  AudioFadeContext
 

Macros

#define OFFSET(x)   offsetof(AudioFadeContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define FADE_PLANAR(name, type)
 
#define FADE(name, type)
 

Enumerations

enum  CurveType {
  TRI, QSIN, ESIN, HSIN,
  LOG, IPAR, QUA, CUB,
  SQU, CBR, PAR, EXP,
  IQSIN, IHSIN, DESE, DESI,
  NB_CURVES
}
 

Functions

 AVFILTER_DEFINE_CLASS (afade)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static double fade_gain (int curve, int64_t index, int range)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *buf)
 

Variables

static const AVOption afade_options []
 
static const AVFilterPad avfilter_af_afade_inputs []
 
static const AVFilterPad avfilter_af_afade_outputs []
 
AVFilter ff_af_afade
 

Detailed Description

fade audio filter

Definition in file af_afade.c.

Macro Definition Documentation

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

Definition at line 47 of file af_afade.c.

Definition at line 48 of file af_afade.c.

#define FADE_PLANAR (   name,
  type 
)
Value:
static void fade_samples_## name ##p(uint8_t **dst, uint8_t * const *src, \
int nb_samples, int channels, int dir, \
int64_t start, int range, int curve) \
{ \
int i, c; \
for (i = 0; i < nb_samples; i++) { \
double gain = fade_gain(curve, start + i * dir, range); \
for (c = 0; c < channels; c++) { \
type *d = (type *)dst[c]; \
const type *s = (type *)src[c]; \
\
d[i] = s[i] * gain; \
} \
} \
}
const char * s
Definition: avisynth_c.h:631
static double fade_gain(int curve, int64_t index, int range)
Definition: af_afade.c:129
uint8_t
AVS_Value src
Definition: avisynth_c.h:482
GLint GLenum type
Definition: opengl_enc.c:105
static double c[64]
void INT64 start
Definition: avisynth_c.h:553
for(j=16;j >0;--j)
const char * name
Definition: opengl_enc.c:103

Definition at line 186 of file af_afade.c.

#define FADE (   name,
  type 
)
Value:
static void fade_samples_## name (uint8_t **dst, uint8_t * const *src, \
int nb_samples, int channels, int dir, \
int64_t start, int range, int curve) \
{ \
type *d = (type *)dst[0]; \
const type *s = (type *)src[0]; \
int i, c, k = 0; \
for (i = 0; i < nb_samples; i++) { \
double gain = fade_gain(curve, start + i * dir, range); \
for (c = 0; c < channels; c++, k++) \
d[k] = s[k] * gain; \
} \
}
const char * s
Definition: avisynth_c.h:631
static double fade_gain(int curve, int64_t index, int range)
Definition: af_afade.c:129
uint8_t
AVS_Value src
Definition: avisynth_c.h:482
GLint GLenum type
Definition: opengl_enc.c:105
static double c[64]
void INT64 start
Definition: avisynth_c.h:553
for(j=16;j >0;--j)
const char * name
Definition: opengl_enc.c:103

Definition at line 204 of file af_afade.c.

Referenced by avfilter_register_all().

Enumeration Type Documentation

enum CurveType
Enumerator
TRI 
QSIN 
ESIN 
HSIN 
LOG 
IPAR 
QUA 
CUB 
SQU 
CBR 
PAR 
EXP 
IQSIN 
IHSIN 
DESE 
DESI 
NB_CURVES 

Definition at line 45 of file af_afade.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( afade  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 86 of file af_afade.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 96 of file af_afade.c.

static double fade_gain ( int  curve,
int64_t  index,
int  range 
)
static

Definition at line 129 of file af_afade.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 230 of file af_afade.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 254 of file af_afade.c.

Variable Documentation

const AVOption afade_options[]
static

Definition at line 50 of file af_afade.c.

const AVFilterPad avfilter_af_afade_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: af_afade.c:230
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_afade.c:254

Definition at line 299 of file af_afade.c.

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

Definition at line 309 of file af_afade.c.

AVFilter ff_af_afade
Initial value:
= {
.name = "afade",
.description = NULL_IF_CONFIG_SMALL("Fade in/out input audio."),
.query_formats = query_formats,
.priv_size = sizeof(AudioFadeContext),
.init = init,
.priv_class = &afade_class,
}
static const AVFilterPad avfilter_af_afade_inputs[]
Definition: af_afade.c:299
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:248
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:451
static int query_formats(AVFilterContext *ctx)
Definition: af_afade.c:96
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static const AVFilterPad avfilter_af_afade_outputs[]
Definition: af_afade.c:309
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:239
static int flags
Definition: cpu.c:47
static av_cold int init(AVFilterContext *ctx)
Definition: af_afade.c:86

Definition at line 317 of file af_afade.c.