#include "acelp_filters.h"
#include "lsp.h"
#include "libavutil/lzo.h"
-#include "avfft.h"
-#include "fft.h"
+#include "dct.h"
+#include "rdft.h"
+#include "sinewin.h"
#define MAX_BLOCKS 8 ///< maximum number of blocks per frame
#define MAX_LSPS 16 ///< maximum filter order
///< by postfilter
float denoise_filter_cache[MAX_FRAMESIZE];
int denoise_filter_cache_size; ///< samples in #denoise_filter_cache
- DECLARE_ALIGNED(16, float, tilted_lpcs_pf)[0x80];
+ DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x80];
///< aligned buffer for LPC tilting
- DECLARE_ALIGNED(16, float, denoise_coeffs_pf)[0x80];
+ DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x80];
///< aligned buffer for denoise coefficients
- DECLARE_ALIGNED(16, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16];
+ DECLARE_ALIGNED(32, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16];
///< aligned buffer for postfilter speech
///< synthesis
/**
};
int cntr[8], n, res;
- memset(vbm_tree, 0xff, sizeof(vbm_tree));
+ memset(vbm_tree, 0xff, sizeof(vbm_tree[0]) * 25);
memset(cntr, 0, sizeof(cntr));
for (n = 0; n < 17; n++) {
res = get_bits(gb, 3);
int n, idx;
/* Create frequency power spectrum of speech input (i.e. RDFT of LPCs) */
- ff_rdft_calc(&s->rdft, lpcs);
+ s->rdft.rdft_calc(&s->rdft, lpcs);
#define log_range(var, assign) do { \
float tmp = log10f(assign); var = tmp; \
max = FFMAX(max, tmp); min = FFMIN(min, tmp); \
* is a sinus input) by doing a phase shift (in theory, H(sin())=cos()).
* Hilbert_Transform(RDFT(x)) = Laplace_Transform(x), which calculates the
* "moment" of the LPCs in this filter. */
- ff_dct_calc(&s->dct, lpcs);
- ff_dct_calc(&s->dst, lpcs);
+ s->dct.dct_calc(&s->dct, lpcs);
+ s->dst.dct_calc(&s->dst, lpcs);
/* Split out the coefficient indexes into phase/magnitude pairs */
idx = 255 + av_clip(lpcs[64], -255, 255);
coeffs[1] = last_coeff;
/* move into real domain */
- ff_rdft_calc(&s->irdft, coeffs);
+ s->irdft.rdft_calc(&s->irdft, coeffs);
/* tilt correction and normalize scale */
memset(&coeffs[remainder], 0, sizeof(coeffs[0]) * (128 - remainder));
/* apply coefficients (in frequency spectrum domain), i.e. complex
* number multiplication */
memset(&synth_pf[size], 0, sizeof(synth_pf[0]) * (128 - size));
- ff_rdft_calc(&s->rdft, synth_pf);
- ff_rdft_calc(&s->rdft, coeffs);
+ s->rdft.rdft_calc(&s->rdft, synth_pf);
+ s->rdft.rdft_calc(&s->rdft, coeffs);
synth_pf[0] *= coeffs[0];
synth_pf[1] *= coeffs[1];
for (n = 1; n < 64; n++) {
synth_pf[n * 2] = v1 * coeffs[n * 2] - v2 * coeffs[n * 2 + 1];
synth_pf[n * 2 + 1] = v2 * coeffs[n * 2] + v1 * coeffs[n * 2 + 1];
}
- ff_rdft_calc(&s->irdft, synth_pf);
+ s->irdft.rdft_calc(&s->irdft, synth_pf);
}
/* merge filter output with the history of previous runs */
*data_size = 0;
/* Packets are sometimes a multiple of ctx->block_align, with a packet
- * header at each ctx->block_align bytes. However, FFmpeg's ASF demuxer
+ * header at each ctx->block_align bytes. However, Libav's ASF demuxer
* feeds us ASF packets, which may concatenate multiple "codec" packets
* in a single "muxer" packet, so we artificially emulate that by
* capping the packet size at ctx->block_align. */