Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-05-10 08:47:44 +0300
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-05-16 13:22:07 +0300
commit8e7e74df93d18c903164a67c861a428bd4244cb1 (patch)
tree53bc9d9c22ee0a41bbac22560acafc0025829e60 /libavcodec/opus_celt.c
parente6ec482b429b241de0fb3088d87e28777d70ded5 (diff)
opus_pvq: port to allow for SIMD functions
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/opus_celt.c')
-rw-r--r--libavcodec/opus_celt.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c
index aee8ddc616..feb604d9af 100644
--- a/libavcodec/opus_celt.c
+++ b/libavcodec/opus_celt.c
@@ -753,15 +753,15 @@ static void celt_decode_bands(CeltFrame *f, OpusRangeCoder *rc)
}
if (f->dual_stereo) {
- cm[0] = ff_celt_decode_band(f, rc, i, X, NULL, band_size, b / 2, f->blocks,
+ cm[0] = f->pvq->decode_band(f->pvq, f, rc, i, X, NULL, band_size, b / 2, f->blocks,
effective_lowband != -1 ? norm + (effective_lowband << f->size) : NULL, f->size,
norm + band_offset, 0, 1.0f, lowband_scratch, cm[0]);
- cm[1] = ff_celt_decode_band(f, rc, i, Y, NULL, band_size, b/2, f->blocks,
+ cm[1] = f->pvq->decode_band(f->pvq, f, rc, i, Y, NULL, band_size, b/2, f->blocks,
effective_lowband != -1 ? norm2 + (effective_lowband << f->size) : NULL, f->size,
norm2 + band_offset, 0, 1.0f, lowband_scratch, cm[1]);
} else {
- cm[0] = ff_celt_decode_band(f, rc, i, X, Y, band_size, b, f->blocks,
+ cm[0] = f->pvq->decode_band(f->pvq, f, rc, i, X, Y, band_size, b, f->blocks,
effective_lowband != -1 ? norm + (effective_lowband << f->size) : NULL, f->size,
norm + band_offset, 0, 1.0f, lowband_scratch, cm[0]|cm[1]);
cm[1] = cm[0];
@@ -984,6 +984,8 @@ void ff_celt_free(CeltFrame **f)
for (i = 0; i < FF_ARRAY_ELEMS(frm->imdct); i++)
ff_mdct15_uninit(&frm->imdct[i]);
+ ff_celt_pvq_uninit(&frm->pvq);
+
av_freep(&frm->dsp);
av_freep(f);
}
@@ -1006,11 +1008,12 @@ int ff_celt_init(AVCodecContext *avctx, CeltFrame **f, int output_channels)
frm->avctx = avctx;
frm->output_channels = output_channels;
- for (i = 0; i < FF_ARRAY_ELEMS(frm->imdct); i++) {
- ret = ff_mdct15_init(&frm->imdct[i], 1, i + 3, -1.0f);
- if (ret < 0)
+ for (i = 0; i < FF_ARRAY_ELEMS(frm->imdct); i++)
+ if ((ret = ff_mdct15_init(&frm->imdct[i], 1, i + 3, -1.0f)) < 0)
goto fail;
- }
+
+ if ((ret = ff_celt_pvq_init(&frm->pvq)) < 0)
+ goto fail;
frm->dsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
if (!frm->dsp) {