FFmpeg
|
#include <float.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"
#include "libavutil/tx.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "formats.h"
Go to the source code of this file.
Data Structures | |
struct | DenseLayer |
struct | GRULayer |
struct | RNNModel |
struct | RNNState |
struct | DenoiseState |
struct | AudioRNNContext |
struct | ThreadData |
Used for passing data between threads. More... | |
Macros | |
#define | FRAME_SIZE_SHIFT 2 |
#define | FRAME_SIZE (120<<FRAME_SIZE_SHIFT) |
#define | WINDOW_SIZE (2*FRAME_SIZE) |
#define | FREQ_SIZE (FRAME_SIZE + 1) |
#define | PITCH_MIN_PERIOD 60 |
#define | PITCH_MAX_PERIOD 768 |
#define | PITCH_FRAME_SIZE 960 |
#define | PITCH_BUF_SIZE (PITCH_MAX_PERIOD+PITCH_FRAME_SIZE) |
#define | SQUARE(x) ((x)*(x)) |
#define | NB_BANDS 22 |
#define | CEPS_MEM 8 |
#define | NB_DELTA_CEPS 6 |
#define | NB_FEATURES (NB_BANDS+3*NB_DELTA_CEPS+2) |
#define | WEIGHTS_SCALE (1.f/256) |
#define | MAX_NEURONS 128 |
#define | ACTIVATION_TANH 0 |
#define | ACTIVATION_SIGMOID 1 |
#define | ACTIVATION_RELU 2 |
#define | Q15ONE 1.0f |
#define | F_ACTIVATION_TANH 0 |
#define | F_ACTIVATION_SIGMOID 1 |
#define | F_ACTIVATION_RELU 2 |
#define | FREE_MAYBE(ptr) do { if (ptr) free(ptr); } while (0) |
#define | FREE_DENSE(name) |
#define | FREE_GRU(name) |
#define | ALLOC_LAYER(type, name) |
#define | INPUT_VAL(name) |
#define | INPUT_ACTIVATION(name) |
#define | INPUT_ARRAY(name, len) |
#define | INPUT_ARRAY3(name, len0, len1, len2) |
#define | NEW_LINE() |
#define | INPUT_DENSE(name) |
#define | INPUT_GRU(name) |
#define | RNN_MOVE(dst, src, n) (memmove((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) )) |
#define | RNN_CLEAR(dst, n) (memset((dst), 0, (n)*sizeof(*(dst)))) |
#define | RNN_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) )) |
#define | INPUT_SIZE 42 |
#define | OFFSET(x) offsetof(AudioRNNContext, x) |
#define | AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM |
Functions | |
static void | rnnoise_model_free (RNNModel *model) |
static int | rnnoise_model_from_file (FILE *f, RNNModel **rnn) |
static int | query_formats (AVFilterContext *ctx) |
static int | config_input (AVFilterLink *inlink) |
static void | biquad (float *y, float mem[2], const float *x, const float *b, const float *a, int N) |
static void | forward_transform (DenoiseState *st, AVComplexFloat *out, const float *in) |
static void | inverse_transform (DenoiseState *st, float *out, const AVComplexFloat *in) |
static void | compute_band_energy (float *bandE, const AVComplexFloat *X) |
static void | compute_band_corr (float *bandE, const AVComplexFloat *X, const AVComplexFloat *P) |
static void | frame_analysis (AudioRNNContext *s, DenoiseState *st, AVComplexFloat *X, float *Ex, const float *in) |
static void | frame_synthesis (AudioRNNContext *s, DenoiseState *st, float *out, const AVComplexFloat *y) |
static void | xcorr_kernel (const float *x, const float *y, float sum[4], int len) |
static float | celt_inner_prod (const float *x, const float *y, int N) |
static void | celt_pitch_xcorr (const float *x, const float *y, float *xcorr, int len, int max_pitch) |
static int | celt_autocorr (const float *x, float *ac, const float *window, int overlap, int lag, int n) |
static void | celt_lpc (float *lpc, const float *ac, int p) |
static void | celt_fir5 (const float *x, const float *num, float *y, int N, float *mem) |
static void | pitch_downsample (float *x[], float *x_lp, int len, int C) |
static void | dual_inner_prod (const float *x, const float *y01, const float *y02, int N, float *xy1, float *xy2) |
static float | compute_pitch_gain (float xy, float xx, float yy) |
static float | remove_doubling (float *x, int maxperiod, int minperiod, int N, int *T0_, int prev_period, float prev_gain) |
static void | find_best_pitch (float *xcorr, float *y, int len, int max_pitch, int *best_pitch) |
static void | pitch_search (const float *x_lp, float *y, int len, int max_pitch, int *pitch) |
static void | dct (AudioRNNContext *s, float *out, const float *in) |
static int | compute_frame_features (AudioRNNContext *s, DenoiseState *st, AVComplexFloat *X, AVComplexFloat *P, float *Ex, float *Ep, float *Exp, float *features, const float *in) |
static void | interp_band_gain (float *g, const float *bandE) |
static void | pitch_filter (AVComplexFloat *X, const AVComplexFloat *P, const float *Ex, const float *Ep, const float *Exp, const float *g) |
static float | tansig_approx (float x) |
static float | sigmoid_approx (float x) |
static void | compute_dense (const DenseLayer *layer, float *output, const float *input) |
static void | compute_gru (AudioRNNContext *s, const GRULayer *gru, float *state, const float *input) |
static void | compute_rnn (AudioRNNContext *s, RNNState *rnn, float *gains, float *vad, const float *input) |
static float | rnnoise_channel (AudioRNNContext *s, DenoiseState *st, float *out, const float *in, int disabled) |
static int | rnnoise_channels (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
static int | filter_frame (AVFilterLink *inlink, AVFrame *in) |
static int | activate (AVFilterContext *ctx) |
static int | open_model (AVFilterContext *ctx, RNNModel **model) |
static av_cold int | init (AVFilterContext *ctx) |
static void | free_model (AVFilterContext *ctx, int n) |
static int | process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags) |
static av_cold void | uninit (AVFilterContext *ctx) |
AVFILTER_DEFINE_CLASS (arnndn) | |
Variables | |
static const uint8_t | eband5ms [] |
static const uint8_t | second_check [16] = {0, 0, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2} |
static const float | tansig_table [201] |
static const AVFilterPad | inputs [] |
static const AVFilterPad | outputs [] |
static const AVOption | arnndn_options [] |
const AVFilter | ff_af_arnndn |
#define FRAME_SIZE_SHIFT 2 |
Definition at line 47 of file af_arnndn.c.
#define FRAME_SIZE (120<<FRAME_SIZE_SHIFT) |
Definition at line 48 of file af_arnndn.c.
#define WINDOW_SIZE (2*FRAME_SIZE) |
Definition at line 49 of file af_arnndn.c.
#define FREQ_SIZE (FRAME_SIZE + 1) |
Definition at line 50 of file af_arnndn.c.
#define PITCH_MIN_PERIOD 60 |
Definition at line 52 of file af_arnndn.c.
#define PITCH_MAX_PERIOD 768 |
Definition at line 53 of file af_arnndn.c.
#define PITCH_FRAME_SIZE 960 |
Definition at line 54 of file af_arnndn.c.
#define PITCH_BUF_SIZE (PITCH_MAX_PERIOD+PITCH_FRAME_SIZE) |
Definition at line 55 of file af_arnndn.c.
#define SQUARE | ( | x | ) | ((x)*(x)) |
Definition at line 57 of file af_arnndn.c.
#define NB_BANDS 22 |
Definition at line 59 of file af_arnndn.c.
#define CEPS_MEM 8 |
Definition at line 61 of file af_arnndn.c.
#define NB_DELTA_CEPS 6 |
Definition at line 62 of file af_arnndn.c.
#define NB_FEATURES (NB_BANDS+3*NB_DELTA_CEPS+2) |
Definition at line 64 of file af_arnndn.c.
#define WEIGHTS_SCALE (1.f/256) |
Definition at line 66 of file af_arnndn.c.
#define MAX_NEURONS 128 |
Definition at line 68 of file af_arnndn.c.
#define ACTIVATION_TANH 0 |
Definition at line 70 of file af_arnndn.c.
#define ACTIVATION_SIGMOID 1 |
Definition at line 71 of file af_arnndn.c.
#define ACTIVATION_RELU 2 |
Definition at line 72 of file af_arnndn.c.
#define Q15ONE 1.0f |
Definition at line 74 of file af_arnndn.c.
#define F_ACTIVATION_TANH 0 |
Definition at line 154 of file af_arnndn.c.
#define F_ACTIVATION_SIGMOID 1 |
Definition at line 155 of file af_arnndn.c.
#define F_ACTIVATION_RELU 2 |
Definition at line 156 of file af_arnndn.c.
#define FREE_DENSE | ( | name | ) |
#define FREE_GRU | ( | name | ) |
#define INPUT_VAL | ( | name | ) |
#define INPUT_ACTIVATION | ( | name | ) |
#define INPUT_ARRAY3 | ( | name, | |
len0, | |||
len1, | |||
len2 | |||
) |
#define NEW_LINE | ( | ) |
#define INPUT_DENSE | ( | name | ) |
#define INPUT_GRU | ( | name | ) |
Definition at line 407 of file af_arnndn.c.
#define RNN_CLEAR | ( | dst, | |
n | |||
) | (memset((dst), 0, (n)*sizeof(*(dst)))) |
Definition at line 408 of file af_arnndn.c.
Definition at line 409 of file af_arnndn.c.
#define INPUT_SIZE 42 |
Definition at line 1332 of file af_arnndn.c.
#define OFFSET | ( | x | ) | offsetof(AudioRNNContext, x) |
Definition at line 1596 of file af_arnndn.c.
Definition at line 1597 of file af_arnndn.c.
|
static |
Definition at line 158 of file af_arnndn.c.
Referenced by free_model(), and rnnoise_model_from_file().
Definition at line 188 of file af_arnndn.c.
Referenced by open_model().
|
static |
Definition at line 331 of file af_arnndn.c.
|
static |
Definition at line 350 of file af_arnndn.c.
Referenced by process_command().
|
static |
Definition at line 393 of file af_arnndn.c.
Referenced by rnnoise_channel().
|
static |
Definition at line 411 of file af_arnndn.c.
Referenced by compute_frame_features(), and frame_analysis().
|
static |
Definition at line 426 of file af_arnndn.c.
Referenced by frame_synthesis().
|
static |
Definition at line 449 of file af_arnndn.c.
Referenced by compute_frame_features(), frame_analysis(), and pitch_filter().
|
static |
Definition at line 474 of file af_arnndn.c.
Referenced by compute_frame_features().
|
static |
Definition at line 499 of file af_arnndn.c.
Referenced by compute_frame_features().
|
static |
Definition at line 511 of file af_arnndn.c.
Referenced by rnnoise_channel().
|
inlinestatic |
Definition at line 528 of file af_arnndn.c.
Referenced by celt_pitch_xcorr().
|
inlinestatic |
Definition at line 597 of file af_arnndn.c.
Referenced by celt_pitch_xcorr(), pitch_search(), and remove_doubling().
|
static |
Definition at line 608 of file af_arnndn.c.
Referenced by celt_autocorr(), and pitch_search().
|
static |
Definition at line 629 of file af_arnndn.c.
Referenced by pitch_downsample().
|
static |
Definition at line 667 of file af_arnndn.c.
Referenced by pitch_downsample().
|
static |
Definition at line 700 of file af_arnndn.c.
Referenced by pitch_downsample().
Definition at line 743 of file af_arnndn.c.
Referenced by compute_frame_features().
|
inlinestatic |
Definition at line 785 of file af_arnndn.c.
Referenced by remove_doubling().
|
static |
Definition at line 799 of file af_arnndn.c.
Referenced by remove_doubling().
|
static |
Definition at line 805 of file af_arnndn.c.
Referenced by compute_frame_features().
|
static |
Definition at line 908 of file af_arnndn.c.
Referenced by pitch_search().
|
static |
Definition at line 955 of file af_arnndn.c.
Referenced by compute_frame_features().
|
static |
Definition at line 1012 of file af_arnndn.c.
Referenced by compute_frame_features(), dct_error(), and ff_mpadsp_init().
|
static |
Definition at line 1022 of file af_arnndn.c.
Referenced by rnnoise_channel().
|
static |
Definition at line 1130 of file af_arnndn.c.
Referenced by pitch_filter(), and rnnoise_channel().
|
static |
Definition at line 1145 of file af_arnndn.c.
Referenced by rnnoise_channel().
|
inlinestatic |
Definition at line 1220 of file af_arnndn.c.
Referenced by compute_dense(), compute_gru(), and sigmoid_approx().
|
inlinestatic |
Definition at line 1248 of file af_arnndn.c.
Referenced by compute_dense(), and compute_gru().
|
static |
Definition at line 1253 of file af_arnndn.c.
Referenced by compute_rnn().
|
static |
Definition at line 1281 of file af_arnndn.c.
Referenced by compute_rnn().
|
static |
Definition at line 1334 of file af_arnndn.c.
Referenced by rnnoise_channel().
|
static |
Definition at line 1362 of file af_arnndn.c.
Referenced by rnnoise_channels().
|
static |
Definition at line 1410 of file af_arnndn.c.
Referenced by filter_frame().
|
static |
Definition at line 1429 of file af_arnndn.c.
Referenced by activate().
|
static |
Definition at line 1451 of file af_arnndn.c.
|
static |
Definition at line 1473 of file af_arnndn.c.
Referenced by init(), and process_command().
|
static |
Definition at line 1495 of file af_arnndn.c.
|
static |
Definition at line 1524 of file af_arnndn.c.
Referenced by process_command(), and uninit().
|
static |
Definition at line 1538 of file af_arnndn.c.
|
static |
Definition at line 1568 of file af_arnndn.c.
AVFILTER_DEFINE_CLASS | ( | arnndn | ) |
|
static |
Definition at line 444 of file af_arnndn.c.
Referenced by compute_band_corr(), compute_band_energy(), and interp_band_gain().
|
static |
Definition at line 804 of file af_arnndn.c.
Referenced by remove_doubling().
|
static |
Definition at line 1176 of file af_arnndn.c.
Referenced by tansig_approx().
|
static |
Definition at line 1581 of file af_arnndn.c.
|
static |
Definition at line 1589 of file af_arnndn.c.
|
static |
Definition at line 1599 of file af_arnndn.c.
const AVFilter ff_af_arnndn |
Definition at line 1608 of file af_arnndn.c.