From 07b78340dd1e6a8147585e31b2dae106d608eca2 Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Sat, 11 Feb 2017 00:25:07 +0000 Subject: opus_celt: rename structures to better names and reorganize them This is meant to be applied on top of my previous patch which split PVQ into celt_pvq.c and made opus_celt.h Essentially nothing has been changed other than renaming CeltFrame to CeltBlock (CeltFrame had absolutely nothing at all to do with a frame) and CeltContext to CeltFrame. 3 variables have been put in CeltFrame as they make more sense there rather than being passed around as arguments. The coefficients have been moved to the CeltBlock structure (why the hell were they in CeltContext and not in CeltFrame??). Now the encoder would be able to use the exact context the decoder uses (plus a couple of extra fields in there). FATE passes, no slowdowns, etc. Signed-off-by: Rostislav Pehlivanov --- libavcodec/opus.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'libavcodec/opus.h') diff --git a/libavcodec/opus.h b/libavcodec/opus.h index be042497ea..c3cbaec35d 100644 --- a/libavcodec/opus.h +++ b/libavcodec/opus.h @@ -62,7 +62,9 @@ static const uint8_t opus_default_extradata[30] = { enum OpusMode { OPUS_MODE_SILK, OPUS_MODE_HYBRID, - OPUS_MODE_CELT + OPUS_MODE_CELT, + + OPUS_MODE_NB }; enum OpusBandwidth { @@ -70,12 +72,14 @@ enum OpusBandwidth { OPUS_BANDWIDTH_MEDIUMBAND, OPUS_BANDWIDTH_WIDEBAND, OPUS_BANDWIDTH_SUPERWIDEBAND, - OPUS_BANDWIDTH_FULLBAND + OPUS_BANDWIDTH_FULLBAND, + + OPUS_BANDWITH_NB }; typedef struct SilkContext SilkContext; -typedef struct CeltContext CeltContext; +typedef struct CeltFrame CeltFrame; typedef struct OpusPacket { int packet_size; /**< packet size */ @@ -100,7 +104,7 @@ typedef struct OpusStreamContext { OpusRangeCoder rc; OpusRangeCoder redundancy_rc; SilkContext *silk; - CeltContext *celt; + CeltFrame *celt; AVFloatDSPContext *fdsp; float silk_buf[2][960]; @@ -185,14 +189,4 @@ int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, enum OpusBandwidth bandwidth, int coded_channels, int duration_ms); -int ff_celt_init(AVCodecContext *avctx, CeltContext **s, int output_channels); - -void ff_celt_free(CeltContext **s); - -void ff_celt_flush(CeltContext *s); - -int ff_celt_decode_frame(CeltContext *s, OpusRangeCoder *rc, - float **output, int coded_channels, int frame_size, - int startband, int endband); - #endif /* AVCODEC_OPUS_H */ -- cgit v1.2.3