FFmpeg
af_afir.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Paul B Mahol
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVFILTER_AFIR_H
22 #define AVFILTER_AFIR_H
23 
24 #include "libavutil/common.h"
25 #include "libavutil/float_dsp.h"
26 #include "libavutil/opt.h"
27 #include "libavcodec/avfft.h"
28 
29 #include "audio.h"
30 #include "avfilter.h"
31 #include "formats.h"
32 #include "internal.h"
33 
34 typedef struct AudioFIRSegment {
36  int part_size;
42 
44  int *part_index;
45 
52 
55 
56 typedef struct AudioFIRDSPContext {
57  void (*fcmul_add)(float *sum, const float *t, const float *c,
58  ptrdiff_t len);
60 
61 typedef struct AudioFIRContext {
62  const AVClass *class;
63 
64  float wet_gain;
65  float dry_gain;
66  float length;
67  int gtype;
68  float ir_gain;
69  int ir_format;
70  float max_ir_len;
71  int response;
72  int w, h;
75  int minp;
76  int maxp;
77  int nb_irs;
78  int selir;
79 
80  float gain;
81 
82  int eof_coeffs[32];
84  int nb_taps;
87  int one2many;
88 
91 
93  AVFrame *ir[32];
96  int64_t pts;
97 
100 
102 
105 
106 #endif /* AVFILTER_AFIR_H */
AudioFIRContext::nb_segments
int nb_segments
Definition: af_afir.h:90
AudioFIRContext::frame_rate
AVRational frame_rate
Definition: af_afir.h:73
opt.h
AudioFIRSegment::block_size
int block_size
Definition: af_afir.h:37
AudioFIRContext::ir_format
int ir_format
Definition: af_afir.h:69
AudioFIRContext::eof_coeffs
int eof_coeffs[32]
Definition: af_afir.h:82
AudioFIRContext::in
AVFrame * in
Definition: af_afir.h:92
AudioFIRContext::video
AVFrame * video
Definition: af_afir.h:94
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:300
AudioFIRSegment::buffer
AVFrame * buffer
Definition: af_afir.h:48
AudioFIRContext::wet_gain
float wet_gain
Definition: af_afir.h:64
AudioFIRSegment::input_offset
int input_offset
Definition: af_afir.h:41
AudioFIRDSPContext::fcmul_add
void(* fcmul_add)(float *sum, const float *t, const float *c, ptrdiff_t len)
Definition: af_afir.h:57
AudioFIRContext::ir_gain
float ir_gain
Definition: af_afir.h:68
AudioFIRSegment::part_size
int part_size
Definition: af_afir.h:36
AudioFIRSegment::input_size
int input_size
Definition: af_afir.h:40
AudioFIRContext::nb_channels
int nb_channels
Definition: af_afir.h:85
formats.h
AudioFIRSegment::coeff
AVFrame * coeff
Definition: af_afir.h:49
AudioFIRSegment::block
AVFrame * block
Definition: af_afir.h:47
AudioFIRContext::min_part_size
int min_part_size
Definition: af_afir.h:95
ff_afir_init_x86
void ff_afir_init_x86(AudioFIRDSPContext *s)
Definition: af_afir_init.c:30
AudioFIRSegment
Definition: af_afir.h:34
AudioFIRContext::maxp
int maxp
Definition: af_afir.h:76
AudioFIRContext::nb_taps
int nb_taps
Definition: af_afir.h:84
s
#define s(width, name)
Definition: cbs_vp9.c:257
AudioFIRContext::response
int response
Definition: af_afir.h:71
AudioFIRContext::nb_irs
int nb_irs
Definition: af_afir.h:77
AudioFIRContext::gtype
int gtype
Definition: af_afir.h:67
AudioFIRContext::minp
int minp
Definition: af_afir.h:75
AudioFIRSegment::sum
AVFrame * sum
Definition: af_afir.h:46
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
ff_afir_init
void ff_afir_init(AudioFIRDSPContext *s)
Definition: af_afir.c:826
avfft.h
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
float_dsp.h
AudioFIRSegment::output
AVFrame * output
Definition: af_afir.h:51
AudioFIRSegment::irdft
RDFTContext ** irdft
Definition: af_afir.h:53
AudioFIRContext::max_ir_len
float max_ir_len
Definition: af_afir.h:70
AudioFIRContext::gain
float gain
Definition: af_afir.h:80
AudioFIRContext::fdsp
AVFloatDSPContext * fdsp
Definition: af_afir.h:99
AudioFIRDSPContext
Definition: af_afir.h:56
AVFloatDSPContext
Definition: float_dsp.h:24
AudioFIRContext::w
int w
Definition: af_afir.h:72
AudioFIRContext::length
float length
Definition: af_afir.h:66
AudioFIRContext::h
int h
Definition: af_afir.h:72
AudioFIRContext::one2many
int one2many
Definition: af_afir.h:87
internal.h
AudioFIRSegment::rdft
RDFTContext ** rdft
Definition: af_afir.h:53
AudioFIRSegment::input
AVFrame * input
Definition: af_afir.h:50
AudioFIRContext::ir
AVFrame * ir[32]
Definition: af_afir.h:93
AudioFIRSegment::coeff_size
int coeff_size
Definition: af_afir.h:39
RDFTContext
Definition: rdft.h:28
common.h
AudioFIRSegment::nb_partitions
int nb_partitions
Definition: af_afir.h:35
len
int len
Definition: vorbis_enc_data.h:452
AudioFIRContext::afirdsp
AudioFIRDSPContext afirdsp
Definition: af_afir.h:98
AudioFIRSegment::fft_length
int fft_length
Definition: af_afir.h:38
AudioFIRContext::ir_channel
int ir_channel
Definition: af_afir.h:74
AudioFIRContext::nb_coef_channels
int nb_coef_channels
Definition: af_afir.h:86
AudioFIRContext
Definition: af_afir.h:61
AudioFIRContext::have_coeffs
int have_coeffs
Definition: af_afir.h:83
avfilter.h
AudioFIRContext::seg
AudioFIRSegment seg[1024]
Definition: af_afir.h:89
audio.h
AudioFIRContext::dry_gain
float dry_gain
Definition: af_afir.h:65
AudioFIRContext::selir
int selir
Definition: af_afir.h:78
AudioFIRContext::pts
int64_t pts
Definition: af_afir.h:96
AudioFIRSegment::output_offset
int * output_offset
Definition: af_afir.h:43
AudioFIRSegment::part_index
int * part_index
Definition: af_afir.h:44