FFmpeg
Data Structures | Macros | Functions | Variables
af_compensationdelay.c File Reference
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "avfilter.h"
#include "audio.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  CompensationDelayContext
 

Macros

#define OFFSET(x)   offsetof(CompensationDelayContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define COMP_DELAY_MAX_DISTANCE   (100.0 * 100.0 + 100.0 * 1.0 + 1.0)
 
#define COMP_DELAY_SOUND_SPEED_KM_H(temp)   1.85325 * (643.95 * sqrt(((temp + 273.15) / 273.15)))
 
#define COMP_DELAY_SOUND_SPEED_CM_S(temp)   (COMP_DELAY_SOUND_SPEED_KM_H(temp) * (1000.0 * 100.0) /* cm/km */ / (60.0 * 60.0) /* s/h */)
 
#define COMP_DELAY_SOUND_FRONT_DELAY(temp)   (1.0 / COMP_DELAY_SOUND_SPEED_CM_S(temp))
 
#define COMP_DELAY_MAX_DELAY   (COMP_DELAY_MAX_DISTANCE * COMP_DELAY_SOUND_FRONT_DELAY(50))
 

Functions

 AVFILTER_DEFINE_CLASS (compensationdelay)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption compensationdelay_options []
 
static const AVFilterPad compensationdelay_inputs []
 
static const AVFilterPad compensationdelay_outputs []
 
AVFilter ff_af_compensationdelay
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 42 of file af_compensationdelay.c.

◆ A

Definition at line 43 of file af_compensationdelay.c.

◆ COMP_DELAY_MAX_DISTANCE

#define COMP_DELAY_MAX_DISTANCE   (100.0 * 100.0 + 100.0 * 1.0 + 1.0)

Definition at line 58 of file af_compensationdelay.c.

◆ COMP_DELAY_SOUND_SPEED_KM_H

#define COMP_DELAY_SOUND_SPEED_KM_H (   temp)    1.85325 * (643.95 * sqrt(((temp + 273.15) / 273.15)))

Definition at line 60 of file af_compensationdelay.c.

◆ COMP_DELAY_SOUND_SPEED_CM_S

#define COMP_DELAY_SOUND_SPEED_CM_S (   temp)    (COMP_DELAY_SOUND_SPEED_KM_H(temp) * (1000.0 * 100.0) /* cm/km */ / (60.0 * 60.0) /* s/h */)

Definition at line 61 of file af_compensationdelay.c.

◆ COMP_DELAY_SOUND_FRONT_DELAY

#define COMP_DELAY_SOUND_FRONT_DELAY (   temp)    (1.0 / COMP_DELAY_SOUND_SPEED_CM_S(temp))

Definition at line 62 of file af_compensationdelay.c.

◆ COMP_DELAY_MAX_DELAY

#define COMP_DELAY_MAX_DELAY   (COMP_DELAY_MAX_DISTANCE * COMP_DELAY_SOUND_FRONT_DELAY(50))

Definition at line 64 of file af_compensationdelay.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( compensationdelay  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 66 of file af_compensationdelay.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 96 of file af_compensationdelay.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 121 of file af_compensationdelay.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 164 of file af_compensationdelay.c.

Variable Documentation

◆ compensationdelay_options

const AVOption compensationdelay_options[]
static
Initial value:
= {
{ "mm", "set mm distance", OFFSET(distance_mm), AV_OPT_TYPE_INT, {.i64=0}, 0, 10, A },
{ "cm", "set cm distance", OFFSET(distance_cm), AV_OPT_TYPE_INT, {.i64=0}, 0, 100, A },
{ "m", "set meter distance", OFFSET(distance_m), AV_OPT_TYPE_INT, {.i64=0}, 0, 100, A },
{ "dry", "set dry amount", OFFSET(dry), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, A },
{ "wet", "set wet amount", OFFSET(wet), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, A },
{ "temp", "set temperature °C", OFFSET(temp), AV_OPT_TYPE_INT, {.i64=20}, -50, 50, A },
{ NULL }
}

Definition at line 45 of file af_compensationdelay.c.

◆ compensationdelay_inputs

const AVFilterPad compensationdelay_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 171 of file af_compensationdelay.c.

◆ compensationdelay_outputs

const AVFilterPad compensationdelay_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}

Definition at line 181 of file af_compensationdelay.c.

◆ ff_af_compensationdelay

AVFilter ff_af_compensationdelay
Initial value:
= {
.name = "compensationdelay",
.description = NULL_IF_CONFIG_SMALL("Audio Compensation Delay Line."),
.query_formats = query_formats,
.priv_size = sizeof(CompensationDelayContext),
.priv_class = &compensationdelay_class,
}

Definition at line 189 of file af_compensationdelay.c.

config_input
static int config_input(AVFilterLink *inlink)
Definition: af_compensationdelay.c:96
A
#define A
Definition: af_compensationdelay.c:43
compensationdelay_inputs
static const AVFilterPad compensationdelay_inputs[]
Definition: af_compensationdelay.c:171
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
CompensationDelayContext
Definition: af_compensationdelay.c:28
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_compensationdelay.c:121
NULL
#define NULL
Definition: coverity.c:32
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_compensationdelay.c:66
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
compensationdelay_outputs
static const AVFilterPad compensationdelay_outputs[]
Definition: af_compensationdelay.c:181
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_compensationdelay.c:164
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
temp
else temp
Definition: vf_mcdeint.c:256
OFFSET
#define OFFSET(x)
Definition: af_compensationdelay.c:42