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

fade audio filter More...

#include "framequeue.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  AudioFadeContext
 

Macros

#define FF_INTERNAL_FIELDS   1
 
#define OFFSET(x)   offsetof(AudioFadeContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define CUBE(a)   ((a)*(a)*(a))
 
#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,
  LOSI, NB_CURVES
}
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static double fade_gain (int curve, int64_t index, int64_t range)
 
static int config_output (AVFilterLink *outlink)
 

Detailed Description

fade audio filter

Definition in file af_afade.c.

Macro Definition Documentation

#define FF_INTERNAL_FIELDS   1

Definition at line 26 of file af_afade.c.

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

Definition at line 62 of file af_afade.c.

Definition at line 63 of file af_afade.c.

#define CUBE (   a)    ((a)*(a)*(a))

Referenced by fade_gain().

#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) \
{ \
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; \
} \
} \
}
channels
Definition: aptx.c:30
#define src
Definition: vp8dsp.c:254
uint8_t
#define s(width, name)
Definition: cbs_vp9.c:257
GLint GLenum type
Definition: opengl_enc.c:105
int
static double c[64]
static double fade_gain(int curve, int64_t index, int64_t range)
Definition: af_afade.c:98
void INT64 start
Definition: avisynth_c.h:690
for(j=16;j >0;--j)
const char * name
Definition: opengl_enc.c:103

Definition at line 167 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, int64_t 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; \
} \
}
channels
Definition: aptx.c:30
#define src
Definition: vp8dsp.c:254
uint8_t
#define s(width, name)
Definition: cbs_vp9.c:257
GLint GLenum type
Definition: opengl_enc.c:105
int
static double c[64]
static double fade_gain(int curve, int64_t index, int64_t range)
Definition: af_afade.c:98
void INT64 start
Definition: avisynth_c.h:690
for(j=16;j >0;--j)
const char * name
Definition: opengl_enc.c:103

Definition at line 185 of file af_afade.c.

Enumeration Type Documentation

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

Definition at line 60 of file af_afade.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)
static

Definition at line 65 of file af_afade.c.

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

Definition at line 98 of file af_afade.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 211 of file af_afade.c.