diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-02-11 00:25:06 +0000 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-02-14 06:15:36 +0000 |
commit | e538108c219d7b3628a9ec33d85bf252ee70c957 (patch) | |
tree | 796c62422dbc5f3e555d84ce57557729c7a8c900 /libavcodec/opus_pvq.h | |
parent | d2119f624d392f53f80c3d36ffaadca23aef8a10 (diff) | |
download | ffmpeg-e538108c219d7b3628a9ec33d85bf252ee70c957.tar.gz |
opus_celt: move quantization and band decoding to opus_pvq.c
A huge amount can be reused by the encoder, as the only thing
which needs to be done would be to add a 10 line celt_icwrsi,
a wrapper around it (celt_alg_quant) and templating the
ff_celt_decode_band to replace entropy decoding functions
with entropy encoding.
There is no performance loss but in fact a performance gain of
around 6% which is caused by the compiler being able to optimize
the decoding more efficiently.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/opus_pvq.h')
-rw-r--r-- | libavcodec/opus_pvq.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libavcodec/opus_pvq.h b/libavcodec/opus_pvq.h new file mode 100644 index 0000000000..1083f35db9 --- /dev/null +++ b/libavcodec/opus_pvq.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2012 Andrew D'Addesio + * Copyright (c) 2013-2014 Mozilla Corporation + * Copyright (c) 2016 Rostislav Pehlivanov <atomnuker@gmail.com> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_OPUS_PVQ_H +#define AVCODEC_OPUS_PVQ_H + +#include "opus.h" +#include "opus_celt.h" + +/* Decodes a band using PVQ */ +uint32_t ff_celt_decode_band(CeltContext *s, OpusRangeCoder *rc, const int band, + float *X, float *Y, int N, int b, uint32_t blocks, + float *lowband, int duration, float *lowband_out, int level, + float gain, float *lowband_scratch, int fill); + +#endif /* AVCODEC_OPUS_PVQ_H */ |