Unified · Split
| @@ -141,7 +141,7 @@ typedef struct AudioRNNContext { · 140 unmodified lines | |||
| 141 | DenoiseState *st; | 141 | DenoiseState *st; |
| 142 | 142 | ||
| 143 | DECLARE_ALIGNED(32, float, window)[WINDOW_SIZE]; | 143 | DECLARE_ALIGNED(32, float, window)[WINDOW_SIZE]; |
| 144 | float dct_table[NB_BANDS*NB_BANDS]; | 144 | DECLARE_ALIGNED(32, float, dct_table)[FFALIGN(NB_BANDS, 4)][FFALIGN(NB_BANDS, 4)]; |
| 145 | 145 | ||
| 146 | RNNModel *model; | 146 | RNNModel *model; |
| 147 | 147 | ||
| @@ -991,11 +991,9 @@ static void pitch_search(const float *x_lp, float *y, · 843 unmodified lines | |||
| 991 | static void dct(AudioRNNContext *s, float *out, const float *in) | 991 | static void dct(AudioRNNContext *s, float *out, const float *in) |
| 992 | { | 992 | { |
| 993 | for (int i = 0; i < NB_BANDS; i++) { | 993 | for (int i = 0; i < NB_BANDS; i++) { |
| 994 | float sum = 0.f; | 994 | float sum; |
| 995 | 995 | ||
| 996 | for (int j = 0; j < NB_BANDS; j++) { | 996 | sum = s->fdsp->scalarproduct_float(in, s->dct_table[i], FFALIGN(NB_BANDS, 4)); |
| 997 | sum += in[j] * s->dct_table[j * NB_BANDS + i]; | ||
| 998 | } | ||
| 999 | out[i] = sum * sqrtf(2.f / 22); | 997 | out[i] = sum * sqrtf(2.f / 22); |
| 1000 | } | 998 | } |
| 1001 | } | 999 | } |
| @@ -1006,7 +1004,7 @@ static int compute_frame_features(AudioRNNContext *s, DenoiseState *st, AVComple · 4 unmodified lines | |||
| 1006 | float E = 0; | 1004 | float E = 0; |
| 1007 | float *ceps_0, *ceps_1, *ceps_2; | 1005 | float *ceps_0, *ceps_1, *ceps_2; |
| 1008 | float spec_variability = 0; | 1006 | float spec_variability = 0; |
| 1009 | float Ly[NB_BANDS]; | 1007 | LOCAL_ALIGNED_32(float, Ly, [NB_BANDS]); |
| 1010 | LOCAL_ALIGNED_32(float, p, [WINDOW_SIZE]); | 1008 | LOCAL_ALIGNED_32(float, p, [WINDOW_SIZE]); |
| 1011 | float pitch_buf[PITCH_BUF_SIZE>>1]; | 1009 | float pitch_buf[PITCH_BUF_SIZE>>1]; |
| 1012 | int pitch_index; | 1010 | int pitch_index; |
| @@ -1348,7 +1346,7 @@ static float rnnoise_channel(AudioRNNContext *s, DenoiseState *st, float *out, c · 335 unmodified lines | |||
| 1348 | AVComplexFloat P[WINDOW_SIZE]; | 1346 | AVComplexFloat P[WINDOW_SIZE]; |
| 1349 | float x[FRAME_SIZE]; | 1347 | float x[FRAME_SIZE]; |
| 1350 | float Ex[NB_BANDS], Ep[NB_BANDS]; | 1348 | float Ex[NB_BANDS], Ep[NB_BANDS]; |
| 1351 | float Exp[NB_BANDS]; | 1349 | LOCAL_ALIGNED_32(float, Exp, [NB_BANDS]); |
| 1352 | float features[NB_FEATURES]; | 1350 | float features[NB_FEATURES]; |
| 1353 | float g[NB_BANDS]; | 1351 | float g[NB_BANDS]; |
| 1354 | float gf[FREQ_SIZE]; | 1352 | float gf[FREQ_SIZE]; |
| @@ -1476,9 +1474,9 @@ static av_cold int init(AVFilterContext *ctx) · 121 unmodified lines | |||
| 1476 | 1474 | ||
| 1477 | for (int i = 0; i < NB_BANDS; i++) { | 1475 | for (int i = 0; i < NB_BANDS; i++) { |
| 1478 | for (int j = 0; j < NB_BANDS; j++) { | 1476 | for (int j = 0; j < NB_BANDS; j++) { |
| 1479 | s->dct_table[i*NB_BANDS + j] = cosf((i + .5f) * j * M_PI / NB_BANDS); | 1477 | s->dct_table[j][i] = cosf((i + .5f) * j * M_PI / NB_BANDS); |
| 1480 | if (j == 0) | 1478 | if (j == 0) |
| 1481 | s->dct_table[i*NB_BANDS + j] *= sqrtf(.5); | 1479 | s->dct_table[j][i] *= sqrtf(.5); |
| 1482 | } | 1480 | } |
| 1483 | } | 1481 | } |
| 1484 | 1482 | ||