]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/opusdec.c
Merge commit 'be1db21ba88fe86036fea9f8d2c1a5f47c2a0a7e'
[ffmpeg] / libavcodec / opusdec.c
index ec793c6c471d94854910b2e0ddeeb73eae7d4e5b..1110302f9c0b9302763df076856fc97d377fccd9 100644 (file)
@@ -47,6 +47,8 @@
 #include "internal.h"
 #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,
@@ -62,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)
@@ -167,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;
 
@@ -278,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;
 
@@ -646,7 +646,6 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
     /* find out the channel configuration */
     ret = ff_opus_parse_extradata(avctx, c);
     if (ret < 0) {
-        av_freep(&c->channel_maps);
         av_freep(&c->fdsp);
         return ret;
     }