diff options
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/modes.c')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/modes.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/modes.c b/lib/rbcodec/codecs/libopus/celt/modes.c index 42e68e1cb7..390c5e8aeb 100644 --- a/lib/rbcodec/codecs/libopus/celt/modes.c +++ b/lib/rbcodec/codecs/libopus/celt/modes.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "os_support.h" | 37 | #include "os_support.h" |
38 | #include "stack_alloc.h" | 38 | #include "stack_alloc.h" |
39 | #include "quant_bands.h" | 39 | #include "quant_bands.h" |
40 | #include "cpu_support.h" | ||
40 | 41 | ||
41 | static const opus_int16 eband5ms[] = { | 42 | static const opus_int16 eband5ms[] = { |
42 | /*0 200 400 600 800 1k 1.2 1.4 1.6 2k 2.4 2.8 3.2 4k 4.8 5.6 6.8 8k 9.6 12k 15.6 */ | 43 | /*0 200 400 600 800 1k 1.2 1.4 1.6 2k 2.4 2.8 3.2 4k 4.8 5.6 6.8 8k 9.6 12k 15.6 */ |
@@ -229,6 +230,7 @@ CELTMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error) | |||
229 | opus_val16 *window; | 230 | opus_val16 *window; |
230 | opus_int16 *logN; | 231 | opus_int16 *logN; |
231 | int LM; | 232 | int LM; |
233 | int arch = opus_select_arch(); | ||
232 | ALLOC_STACK; | 234 | ALLOC_STACK; |
233 | #if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA) | 235 | #if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA) |
234 | if (global_stack==NULL) | 236 | if (global_stack==NULL) |
@@ -389,7 +391,7 @@ CELTMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error) | |||
389 | compute_pulse_cache(mode, mode->maxLM); | 391 | compute_pulse_cache(mode, mode->maxLM); |
390 | 392 | ||
391 | if (clt_mdct_init(&mode->mdct, 2*mode->shortMdctSize*mode->nbShortMdcts, | 393 | if (clt_mdct_init(&mode->mdct, 2*mode->shortMdctSize*mode->nbShortMdcts, |
392 | mode->maxLM) == 0) | 394 | mode->maxLM, arch) == 0) |
393 | goto failure; | 395 | goto failure; |
394 | 396 | ||
395 | if (error) | 397 | if (error) |
@@ -408,6 +410,8 @@ failure: | |||
408 | #ifdef CUSTOM_MODES | 410 | #ifdef CUSTOM_MODES |
409 | void opus_custom_mode_destroy(CELTMode *mode) | 411 | void opus_custom_mode_destroy(CELTMode *mode) |
410 | { | 412 | { |
413 | int arch = opus_select_arch(); | ||
414 | |||
411 | if (mode == NULL) | 415 | if (mode == NULL) |
412 | return; | 416 | return; |
413 | #ifndef CUSTOM_MODES_ONLY | 417 | #ifndef CUSTOM_MODES_ONLY |
@@ -423,7 +427,7 @@ void opus_custom_mode_destroy(CELTMode *mode) | |||
423 | } | 427 | } |
424 | #endif /* CUSTOM_MODES_ONLY */ | 428 | #endif /* CUSTOM_MODES_ONLY */ |
425 | opus_free((opus_int16*)mode->eBands); | 429 | opus_free((opus_int16*)mode->eBands); |
426 | opus_free((opus_int16*)mode->allocVectors); | 430 | opus_free((unsigned char*)mode->allocVectors); |
427 | 431 | ||
428 | opus_free((opus_val16*)mode->window); | 432 | opus_free((opus_val16*)mode->window); |
429 | opus_free((opus_int16*)mode->logN); | 433 | opus_free((opus_int16*)mode->logN); |
@@ -431,7 +435,7 @@ void opus_custom_mode_destroy(CELTMode *mode) | |||
431 | opus_free((opus_int16*)mode->cache.index); | 435 | opus_free((opus_int16*)mode->cache.index); |
432 | opus_free((unsigned char*)mode->cache.bits); | 436 | opus_free((unsigned char*)mode->cache.bits); |
433 | opus_free((unsigned char*)mode->cache.caps); | 437 | opus_free((unsigned char*)mode->cache.caps); |
434 | clt_mdct_clear(&mode->mdct); | 438 | clt_mdct_clear(&mode->mdct, arch); |
435 | 439 | ||
436 | opus_free((CELTMode *)mode); | 440 | opus_free((CELTMode *)mode); |
437 | } | 441 | } |