FFmpeg
|
#include "libavutil/avassert.h"
#include "libavutil/file_open.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mem.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... | |
Functions | |
static void | rnnoise_model_free (RNNModel *model) |
static int | rnnoise_model_from_file (FILE *f, RNNModel **rnn) |
static int | query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out) |
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 AVOption | arnndn_options [] |
const AVFilter | ff_af_arnndn |
#define FRAME_SIZE_SHIFT 2 |
Definition at line 46 of file af_arnndn.c.
#define FRAME_SIZE (120<<FRAME_SIZE_SHIFT) |
Definition at line 47 of file af_arnndn.c.
#define WINDOW_SIZE (2*FRAME_SIZE) |
Definition at line 48 of file af_arnndn.c.
#define FREQ_SIZE (FRAME_SIZE + 1) |
Definition at line 49 of file af_arnndn.c.
#define PITCH_MIN_PERIOD 60 |
Definition at line 51 of file af_arnndn.c.
#define PITCH_MAX_PERIOD 768 |
Definition at line 52 of file af_arnndn.c.
#define PITCH_FRAME_SIZE 960 |
Definition at line 53 of file af_arnndn.c.
#define PITCH_BUF_SIZE (PITCH_MAX_PERIOD+PITCH_FRAME_SIZE) |
Definition at line 54 of file af_arnndn.c.
#define SQUARE | ( | x | ) | ((x)*(x)) |
Definition at line 56 of file af_arnndn.c.
#define NB_BANDS 22 |
Definition at line 58 of file af_arnndn.c.
#define CEPS_MEM 8 |
Definition at line 60 of file af_arnndn.c.
#define NB_DELTA_CEPS 6 |
Definition at line 61 of file af_arnndn.c.
#define NB_FEATURES (NB_BANDS+3*NB_DELTA_CEPS+2) |
Definition at line 63 of file af_arnndn.c.
#define WEIGHTS_SCALE (1.f/256) |
Definition at line 65 of file af_arnndn.c.
#define MAX_NEURONS 128 |
Definition at line 67 of file af_arnndn.c.
#define ACTIVATION_TANH 0 |
Definition at line 69 of file af_arnndn.c.
#define ACTIVATION_SIGMOID 1 |
Definition at line 70 of file af_arnndn.c.
#define ACTIVATION_RELU 2 |
Definition at line 71 of file af_arnndn.c.
#define Q15ONE 1.0f |
Definition at line 73 of file af_arnndn.c.
#define F_ACTIVATION_TANH 0 |
Definition at line 153 of file af_arnndn.c.
#define F_ACTIVATION_SIGMOID 1 |
Definition at line 154 of file af_arnndn.c.
#define F_ACTIVATION_RELU 2 |
Definition at line 155 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 405 of file af_arnndn.c.
Definition at line 406 of file af_arnndn.c.
Definition at line 407 of file af_arnndn.c.
#define INPUT_SIZE 42 |
Definition at line 1330 of file af_arnndn.c.
#define OFFSET | ( | x | ) | offsetof(AudioRNNContext, x) |
Definition at line 1587 of file af_arnndn.c.
Definition at line 1588 of file af_arnndn.c.
|
static |
Definition at line 157 of file af_arnndn.c.
Referenced by free_model(), and rnnoise_model_from_file().
|
static |
Definition at line 187 of file af_arnndn.c.
Referenced by open_model().
|
static |
Definition at line 330 of file af_arnndn.c.
|
static |
Definition at line 347 of file af_arnndn.c.
Referenced by process_command().
|
static |
Definition at line 391 of file af_arnndn.c.
Referenced by rnnoise_channel().
|
static |
Definition at line 409 of file af_arnndn.c.
Referenced by compute_frame_features(), and frame_analysis().
|
static |
Definition at line 424 of file af_arnndn.c.
Referenced by frame_synthesis().
|
static |
Definition at line 447 of file af_arnndn.c.
Referenced by compute_frame_features(), frame_analysis(), and pitch_filter().
|
static |
Definition at line 472 of file af_arnndn.c.
Referenced by compute_frame_features().
|
static |
Definition at line 497 of file af_arnndn.c.
Referenced by compute_frame_features().
|
static |
Definition at line 509 of file af_arnndn.c.
Referenced by rnnoise_channel().
Definition at line 526 of file af_arnndn.c.
Referenced by celt_pitch_xcorr().
Definition at line 595 of file af_arnndn.c.
Referenced by celt_pitch_xcorr(), pitch_search(), and remove_doubling().
|
static |
Definition at line 606 of file af_arnndn.c.
Referenced by celt_autocorr(), and pitch_search().
|
static |
Definition at line 627 of file af_arnndn.c.
Referenced by pitch_downsample().
Definition at line 665 of file af_arnndn.c.
Referenced by pitch_downsample().
Definition at line 698 of file af_arnndn.c.
Referenced by pitch_downsample().
Definition at line 741 of file af_arnndn.c.
Referenced by compute_frame_features().
|
inlinestatic |
Definition at line 783 of file af_arnndn.c.
Referenced by remove_doubling().
Definition at line 797 of file af_arnndn.c.
Referenced by remove_doubling().
|
static |
Definition at line 803 of file af_arnndn.c.
Referenced by compute_frame_features().
|
static |
Definition at line 906 of file af_arnndn.c.
Referenced by pitch_search().
|
static |
Definition at line 953 of file af_arnndn.c.
Referenced by compute_frame_features().
|
static |
Definition at line 1010 of file af_arnndn.c.
Referenced by compute_frame_features(), and dct_error().
|
static |
Definition at line 1020 of file af_arnndn.c.
Referenced by rnnoise_channel().
Definition at line 1128 of file af_arnndn.c.
Referenced by pitch_filter(), and rnnoise_channel().
|
static |
Definition at line 1143 of file af_arnndn.c.
Referenced by rnnoise_channel().
Definition at line 1218 of file af_arnndn.c.
Referenced by compute_dense(), compute_gru(), and sigmoid_approx().
Definition at line 1246 of file af_arnndn.c.
Referenced by compute_dense(), and compute_gru().
|
static |
Definition at line 1251 of file af_arnndn.c.
Referenced by compute_rnn().
|
static |
Definition at line 1279 of file af_arnndn.c.
Referenced by compute_rnn().
|
static |
Definition at line 1332 of file af_arnndn.c.
Referenced by rnnoise_channel().
|
static |
Definition at line 1360 of file af_arnndn.c.
Referenced by rnnoise_channels().
|
static |
Definition at line 1408 of file af_arnndn.c.
Referenced by filter_frame().
|
static |
Definition at line 1427 of file af_arnndn.c.
Referenced by activate().
|
static |
Definition at line 1449 of file af_arnndn.c.
|
static |
Definition at line 1471 of file af_arnndn.c.
Referenced by init(), and process_command().
|
static |
Definition at line 1493 of file af_arnndn.c.
|
static |
Definition at line 1522 of file af_arnndn.c.
Referenced by process_command(), and uninit().
|
static |
Definition at line 1536 of file af_arnndn.c.
|
static |
Definition at line 1566 of file af_arnndn.c.
AVFILTER_DEFINE_CLASS | ( | arnndn | ) |
|
static |
Definition at line 442 of file af_arnndn.c.
Referenced by compute_band_corr(), compute_band_energy(), and interp_band_gain().
|
static |
Definition at line 802 of file af_arnndn.c.
Referenced by remove_doubling().
|
static |
Definition at line 1174 of file af_arnndn.c.
Referenced by tansig_approx().
|
static |
Definition at line 1579 of file af_arnndn.c.
|
static |
Definition at line 1590 of file af_arnndn.c.
const AVFilter ff_af_arnndn |
Definition at line 1599 of file af_arnndn.c.