summaryrefslogtreecommitdiff
path: root/libavcodec/opusdec.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-02-11 00:25:07 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-02-14 06:15:36 +0000
commit07b78340dd1e6a8147585e31b2dae106d608eca2 (patch)
tree715de22fb49090d42c1e9b954739978fb262d38d /libavcodec/opusdec.c
parente538108c219d7b3628a9ec33d85bf252ee70c957 (diff)
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 <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/opusdec.c')
-rw-r--r--libavcodec/opusdec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index 556acfe2df..1110302f9c 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -48,6 +48,7 @@
#include "mathops.h"
#include "opus.h"
#include "opustab.h"
+#include "opus_celt.h"
static const uint16_t silk_frame_duration_ms[16] = {
10, 20, 40, 60,
@@ -63,8 +64,6 @@ static const int silk_resample_delay[] = {
4, 8, 11, 11, 11
};
-static const uint8_t celt_band_end[] = { 13, 17, 17, 19, 21 };
-
static int get_silk_samplerate(int config)
{
if (config < 4)
@@ -168,7 +167,7 @@ static int opus_decode_redundancy(OpusStreamContext *s, const uint8_t *data, int
ret = ff_celt_decode_frame(s->celt, &s->redundancy_rc,
s->redundancy_output,
s->packet.stereo + 1, 240,
- 0, celt_band_end[s->packet.bandwidth]);
+ 0, ff_celt_band_end[s->packet.bandwidth]);
if (ret < 0)
goto fail;
@@ -279,7 +278,7 @@ static int opus_decode_frame(OpusStreamContext *s, const uint8_t *data, int size
s->packet.stereo + 1,
s->packet.frame_duration,
(s->packet.mode == OPUS_MODE_HYBRID) ? 17 : 0,
- celt_band_end[s->packet.bandwidth]);
+ ff_celt_band_end[s->packet.bandwidth]);
if (ret < 0)
return ret;