FFmpeg
Loading...
Searching...
No Matches
af_afade.c File Reference

fade audio filter More...

#include "config_components.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"

Go to the source code of this file.

Data Structures

struct  AudioFadeContext
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define TFLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define CUBE(a)
 
#define FADE_PLANAR(name, type)
 
#define FADE(name, type)
 
#define SCALE_PLANAR(name, type)
 
#define SCALE(name, type)
 

Enumerations

enum  CurveType {
  NONE = -1 , TRI , QSIN , ESIN ,
  HSIN , LOG , IPAR , QUA ,
  CUB , SQU , CBR , PAR ,
  EXP , IQSIN , IHSIN , DESE ,
  DESI , LOSI , SINC , ISINC ,
  QUAT , QUATR , QSIN2 , HSIN2 ,
  NB_CURVES
}
 

Functions

static double fade_gain (int curve, int64_t index, int64_t range, double silence, double unity)
 
static int config_output (AVFilterLink *outlink)
 

Variables

static enum AVSampleFormat sample_fmts []
 

Detailed Description

fade audio filter

Definition in file af_afade.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 64 of file af_afade.c.

◆ FLAGS

Definition at line 65 of file af_afade.c.

◆ TFLAGS

◆ CUBE

#define CUBE ( a)
Value:
((a)*(a)*(a))
int a

Referenced by fade_gain().

◆ FADE_PLANAR

#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, int64_t range,int curve,\
double silence, double unity) \
{ \
int i, c; \
\
for (i = 0; i < nb_samples; i++) { \
double gain = fade_gain(curve, start + i * dir,range,silence,unity);\
for (c = 0; c < channels; c++) { \
type *d = (type *)dst[c]; \
const type *s = (type *)src[c]; \
\
d[i] = s[i] * gain; \
} \
} \
}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
static double fade_gain(int curve, int64_t index, int64_t range, double silence, double unity)
Definition af_afade.c:76
channels
Definition aptx.h:31
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
long long int64_t
Definition coverity.c:34
cl_device_type type
enum AVColorRange range
const char * name
Definition qsvenc.c:142
#define src
Definition vp8dsp.c:248
static double c[64]

Definition at line 166 of file af_afade.c.

◆ FADE

#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, int64_t range, int curve, \
double silence, double unity) \
{ \
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,silence,unity);\
for (c = 0; c < channels; c++, k++) \
d[k] = s[k] * gain; \
} \
}

Definition at line 185 of file af_afade.c.

Referenced by config_output(), and xfade_opencl_load().

◆ SCALE_PLANAR

#define SCALE_PLANAR ( name,
type )
Value:
static void scale_samples_## name ##p(uint8_t **dst, uint8_t * const *src, \
int nb_samples, int channels, \
double gain) \
{ \
int i, c; \
\
for (i = 0; i < nb_samples; i++) { \
for (c = 0; c < channels; c++) { \
type *d = (type *)dst[c]; \
const type *s = (type *)src[c]; \
\
d[i] = s[i] * gain; \
} \
} \
}

Definition at line 212 of file af_afade.c.

◆ SCALE

#define SCALE ( name,
type )
Value:
static void scale_samples_## name (uint8_t **dst, uint8_t * const *src, \
int nb_samples, int channels, double gain)\
{ \
type *d = (type *)dst[0]; \
const type *s = (type *)src[0]; \
int i, c, k = 0; \
\
for (i = 0; i < nb_samples; i++) { \
for (c = 0; c < channels; c++, k++) \
d[k] = s[k] * gain; \
} \
}

Definition at line 229 of file af_afade.c.

Enumeration Type Documentation

◆ CurveType

enum CurveType
Enumerator
NONE 
TRI 
QSIN 
ESIN 
HSIN 
LOG 
IPAR 
QUA 
CUB 
SQU 
CBR 
PAR 
EXP 
IQSIN 
IHSIN 
DESE 
DESI 
LOSI 
SINC 
ISINC 
QUAT 
QUATR 
QSIN2 
HSIN2 
NB_CURVES 

Definition at line 62 of file af_afade.c.

Function Documentation

◆ fade_gain()

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

Definition at line 76 of file af_afade.c.

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 253 of file af_afade.c.

Variable Documentation

◆ sample_fmts

enum AVSampleFormat sample_fmts[]
static
Initial value:
= {
}
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition samplefmt.h:66
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition samplefmt.h:64
@ AV_SAMPLE_FMT_FLT
float
Definition samplefmt.h:60
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition samplefmt.h:65
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition samplefmt.h:59
@ AV_SAMPLE_FMT_NONE
Definition samplefmt.h:56
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition samplefmt.h:67
@ AV_SAMPLE_FMT_DBL
double
Definition samplefmt.h:61
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition samplefmt.h:58

Definition at line 68 of file af_afade.c.