From b370b0779661793c3a52743282ab749c7428e640 Mon Sep 17 00:00:00 2001 From: Jan Buethe Date: Wed, 13 Dec 2023 15:35:31 +0100 Subject: minor fixes --- dnn/osce.c | 16 ++-------------- silk/dec_API.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/dnn/osce.c b/dnn/osce.c index 0bb8fb8c..108cb46e 100644 --- a/dnn/osce.c +++ b/dnn/osce.c @@ -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 */ -- cgit v1.2.3