From 035c755b4ef3b25daadc9e5a81a845dde6b3930c Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Wed, 12 Jul 2017 04:49:21 +0100 Subject: opusenc: use float_dsp for transient mdcts vector_fmul_reverse requires padding the window at the front Signed-off-by: Rostislav Pehlivanov --- libavcodec/opusenc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libavcodec/opusenc.c') diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index 8aba291..6cefd33 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -210,17 +210,15 @@ static void celt_frame_mdct(OpusEncContext *s, CeltFrame *f) int i, t, ch; float *win = s->scratch; - /* I think I can use s->dsp->vector_fmul_window for transients at least */ if (f->transient) { for (ch = 0; ch < f->channels; ch++) { CeltBlock *b = &f->block[ch]; float *src1 = b->overlap; for (t = 0; t < f->blocks; t++) { float *src2 = &b->samples[CELT_OVERLAP*t]; - for (i = 0; i < CELT_OVERLAP; i++) { - win[ i] = src1[i]*ff_celt_window[i]; - win[CELT_OVERLAP + i] = src2[i]*ff_celt_window[CELT_OVERLAP - i - 1]; - } + s->dsp->vector_fmul(win, src1, ff_celt_window, CELT_OVERLAP); + s->dsp->vector_fmul_reverse(&win[CELT_OVERLAP], src2, + ff_celt_window - 8, CELT_OVERLAP + 8); src1 = src2; s->mdct[0]->mdct(s->mdct[0], b->coeffs + t, win, f->blocks); } -- cgit v1.1