diff options
Diffstat (limited to 'lib/rbcodec')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/celt.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/celt.c b/lib/rbcodec/codecs/libopus/celt/celt.c index d91b8689b5..74ebee91b4 100644 --- a/lib/rbcodec/codecs/libopus/celt/celt.c +++ b/lib/rbcodec/codecs/libopus/celt/celt.c | |||
@@ -2296,6 +2296,9 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, opus_val16 * OPUS_R | |||
2296 | RESTORE_STACK; | 2296 | RESTORE_STACK; |
2297 | } | 2297 | } |
2298 | 2298 | ||
2299 | #define FREQ_X_BUF_SIZE (2*8*120) /* stereo * nbShortMdcts * shortMdctSize */ | ||
2300 | static celt_sig s_freq[FREQ_X_BUF_SIZE] IBSS_ATTR MEM_ALIGN_ATTR; /* 7680 byte */ | ||
2301 | static celt_norm s_X[FREQ_X_BUF_SIZE] IBSS_ATTR MEM_ALIGN_ATTR; /* 3840 byte */ | ||
2299 | int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *data, int len, opus_val16 * OPUS_RESTRICT pcm, int frame_size, ec_dec *dec) | 2302 | int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *data, int len, opus_val16 * OPUS_RESTRICT pcm, int frame_size, ec_dec *dec) |
2300 | { | 2303 | { |
2301 | int c, i, N; | 2304 | int c, i, N; |
@@ -2398,8 +2401,18 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat | |||
2398 | if (effEnd > st->mode->effEBands) | 2401 | if (effEnd > st->mode->effEBands) |
2399 | effEnd = st->mode->effEBands; | 2402 | effEnd = st->mode->effEBands; |
2400 | 2403 | ||
2401 | ALLOC(freq, IMAX(CC,C)*N, celt_sig); /**< Interleaved signal MDCTs */ | 2404 | /**< Interleaved signal MDCTs */ |
2402 | ALLOC(X, C*N, celt_norm); /**< Interleaved normalised MDCTs */ | 2405 | if (FREQ_X_BUF_SIZE >= IMAX(CC,C)*N) |
2406 | freq = s_freq; | ||
2407 | else | ||
2408 | ALLOC(freq, IMAX(CC,C)*N, celt_sig); | ||
2409 | |||
2410 | /**< Interleaved normalised MDCTs */ | ||
2411 | if (FREQ_X_BUF_SIZE >= C*N) | ||
2412 | X = s_X; | ||
2413 | else | ||
2414 | ALLOC(X, C*N, celt_norm); | ||
2415 | |||
2403 | ALLOC(bandE, st->mode->nbEBands*C, celt_ener); | 2416 | ALLOC(bandE, st->mode->nbEBands*C, celt_ener); |
2404 | c=0; do | 2417 | c=0; do |
2405 | for (i=0;i<M*st->mode->eBands[st->start];i++) | 2418 | for (i=0;i<M*st->mode->eBands[st->start];i++) |