diff options
author | Jan Buethe <jbuethe@amazon.de> | 2023-12-13 17:35:31 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-12-20 07:01:30 +0300 |
commit | b370b0779661793c3a52743282ab749c7428e640 (patch) | |
tree | af71906b4bc96d19919eae5e7aab0315d1160190 | |
parent | 3b2dd696e15b1724a3edb178885ef03e6daad83f (diff) |
minor fixes
-rw-r--r-- | dnn/osce.c | 16 | ||||
-rw-r--r-- | silk/dec_API.c | 11 |
2 files changed, 11 insertions, 16 deletions
@@ -343,7 +343,6 @@ static int init_nolace(NoLACE *hNoLACE, const WeightArray *weights) static void reset_nolace_state(NoLACEState *state) { - printf("nolace reset\n"); OPUS_CLEAR(state, 1); init_adacomb_state(&state->cf1_state); @@ -819,31 +818,27 @@ void osce_init(silk_OSCE_struct *hOSCE, int method) #endif } +#ifdef USE_WEIGHTS_FILE int osce_load_models(silk_OSCE_struct *hOSCE, const unsigned char *data, int len) { WeightArray *list; int ret = 0; - printf("[loading model weights] %p, %d\n", data, parse_weights(&list, data, len)); #ifndef DISABLE_LACE if (ret == 0) {ret = init_lace(&hOSCE->model.lace, list);} #endif - printf("ret: %d\n", ret); - #ifndef DISABLE_LACE if (ret == 0) {ret = init_nolace(&hOSCE->model.nolace, list);} #endif - printf("ret: %d\n", ret); - osce_reset(hOSCE, OSCE_DEFAULT_METHOD); free(list); return ret; } - +#endif void osce_enhance_frame( silk_decoder_state *psDec, /* I/O Decoder state */ @@ -860,13 +855,6 @@ void osce_enhance_frame( int periods[4]; int i; - (void) arch; - static int counter = 0; - - if (counter ++ % 50 == 0){ - osce_reset(&psDec->osce, psDec->osce.method); - } - /* enhancement only implemented for 20 ms frame at 16kHz */ if (psDec->fs_kHz != 16 || psDec->nb_subfr != 4) { diff --git a/silk/dec_API.c b/silk/dec_API.c index 8af8c32d..134b3c38 100644 --- a/silk/dec_API.c +++ b/silk/dec_API.c @@ -56,15 +56,22 @@ typedef struct { opus_int silk_LoadOSCEModels(void *decState, const unsigned char *data, int len) { +#if defined(ENABLE_OSCE) && defined(USE_WEIGHTS_FILE) opus_int n, ret = SILK_NO_ERROR; -#ifdef ENABLE_OSCE + silk_decoder_state *channel_state = ((silk_decoder *)decState)->channel_state; for ( n = 0; n < DECODER_NUM_CHANNELS; n++ ) { ret |= osce_load_models(&channel_state[n].osce, data, len); } -#endif + return ret; +#else + (void) decState; + (void) data; + (void) len; + return SILK_NO_ERROR; +#endif } opus_int silk_Get_Decoder_Size( /* O Returns error code */ |