[FFmpeg-devel] [PATCH] opus_celt: move quantization and band decoding to opus_pvq.c
atomnuker at gmail.com
Thu Nov 10 07:01:44 EET 2016
On 10 November 2016 at 03:13, Rostislav Pehlivanov <atomnuker at gmail.com>
> 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
> nearly 6% which is caused by the compiler being able to optimize
> the decoding more efficiently.
> This commit also removes a redundant declaration (ff_celt_window2
> was already defined in opus.h but was not removed with the commit
> which split the tables away to opustab.h).
> Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>
> libavcodec/Makefile | 2 +-
> libavcodec/opus.h | 12 -
> libavcodec/opus_celt.c | 828 +-----------------------------
> libavcodec/opus_celt.h | 103 ++++++
> libavcodec/opus_pvq.c | 729 +++++++++++++++++++++++++++++++++++++++++++
> libavcodec/opus_pvq.h | 65 ++++
> libavcodec/opusdec.c | 1 +
> 7 files changed, 910 insertions(+), 830 deletions(-)
> create mode 100644 libavcodec/opus_celt.h
> create mode 100644 libavcodec/opus_pvq.c
> create mode 100644 libavcodec/opus_pvq.h
Actually, I don't like how the CELT decoder now has an exposed state. I
think the names the
CELT decoder uses for/in its contexts are confusing. So I'll remove
opus_celt.h and instead
give ff_celt_decode_band a pointer to the remaining bits, the TF change and
the IS flag
manually rather than as a context. That way it would be less painful to
the function for the encoder.
Changed that locally.
More information about the ffmpeg-devel