From 77d6e5655b1bb944d00116aa327ce2bd96d37018 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 7 Sep 2022 19:02:12 +0200 Subject: [PATCH 1/2] fix typo in hSCE deallocation --- lib_enc/ivas_init_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 5eadb0f1eb..33f0f7da02 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -870,7 +870,7 @@ void ivas_destroy_enc( if ( st_ivas->hSCE[i] != NULL ) { destroy_sce_enc( st_ivas->hSCE[i] ); - st_ivas->hSCE[0] = NULL; + st_ivas->hSCE[i] = NULL; } } -- GitLab From aa880b0b005c2fffe8bc4fbf777256f0971ae50d Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 8 Sep 2022 09:56:29 +0200 Subject: [PATCH 2/2] Remove FIX_I2_BWD which was committed accidentally --- lib_com/cnst.h | 3 --- lib_com/options.h | 1 - lib_enc/bw_detect.c | 38 -------------------------------------- lib_enc/init_enc.c | 3 --- lib_enc/ivas_core_enc.c | 3 --- lib_enc/ivas_cpe_enc.c | 3 --- lib_enc/ivas_sce_enc.c | 3 --- lib_enc/stat_enc.h | 3 --- 8 files changed, 57 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index ae476a02ec..40a4710579 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -798,9 +798,6 @@ typedef enum #define BWD_COUNT_MAX 100 /* maximum value of BWD counter */ #define BWD_N_BINS_MAX 13 /* maximum number of BWD bins */ #define BWS_TRAN_PERIOD 5 /* BWS - number of frames for transition period */ -#ifdef FIX_I2_BWD -#define BWD_HIGH_BRATE_THR IVAS_256k /* BWD - threshold from which the bitrate sets bws_high_rate_flag = 1 */ -#endif #define PREEMPH_FAC 0.68f /* preemphasis factor at 12.8kHz */ #define PREEMPH_FAC_16k 0.72f diff --git a/lib_com/options.h b/lib_com/options.h index 9a564035bf..6a9861f02e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -148,7 +148,6 @@ #define FIX_ADAP_STEFI_SHIFT /* Issue 89: fix bug in parameter shift of adaptive stereo filling */ #define SPAR_SCALING_HARMONIZATION /* Issue 80: Changes to harmonize scaling in spar */ -#define FIX_I2_BWD /* Issue 2: BWD fix to more quickly react to WB -> SWB/FB change */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index 1f5a906733..c1357a7f74 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -486,44 +486,6 @@ void bw_detect( } } } -#ifdef FIX_I2_BWD - else if ( st->localVAD == 0 && st->bwd_high_brate_flag == 1 && st->input_bwidth == WB ) /* applies in IVAS only */ - { - if( st->count_SWB > 0 ) - { - st->count_SWB++; - } - - if ( st->count_FB > 0 ) - { - st->count_FB++; - } - - if ( st->last_input_bwidth == WB && st->input_Fs > 16000 ) - { - if ( st->count_SWB > BWD_COUNT_WIDER_BW ) - { - st->input_bwidth = SWB; - st->count_SWB = BWD_COUNT_MAX; - - if ( st->count_FB > BWD_COUNT_WIDER_BW ) - { - st->input_bwidth = FB; - st->count_FB = BWD_COUNT_MAX; - } - } - } - - if ( st->last_input_bwidth == SWB && st->input_Fs > 32000 ) - { - if ( st->count_FB > BWD_COUNT_WIDER_BW ) - { - st->input_bwidth = FB; - st->count_FB = BWD_COUNT_MAX; - } - } - } -#endif } /* verify that maximum encoded bandwidth (specified on the command line) is not exceeded */ diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 2a15da6488..1ae2f48c66 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -398,9 +398,6 @@ ivas_error init_encoder( st->last_bwidth = st->bwidth; st->last_bwidth_cng = st->bwidth; st->bwidth_sw_cnt = 0; -#ifdef FIX_I2_BWD - st->bwd_high_brate_flag = 0; -#endif /*-----------------------------------------------------------------* diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 27b05ef6a1..42a17cb9cb 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -443,9 +443,6 @@ ivas_error ivas_core_enc( dbgwrite( &st->count_WB, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "count_WB", n, id, ENC ) ); dbgwrite( &st->count_SWB, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "count_SWB", n, id, ENC ) ); -#ifdef FIX_I2_BWD - dbgwrite( &st->count_FB, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "count_FB", n, id, ENC ) ); -#endif #ifdef DEBUG_MODE_ACELP dbgwrite( snr_[n], sizeof( float ), 320, 1, fname( debug_dir, "snr", n, id, ENC ) ); diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 2c1022920e..b543761491 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -148,9 +148,6 @@ ivas_error ivas_cpe_enc( sts[n]->bwidth = sts[n]->last_bwidth; /* updated in BWD */ } sts[n]->rate_switching_reset = 0; -#ifdef FIX_I2_BWD - sts[n]->bwd_high_brate_flag = ivas_total_brate >= BWD_HIGH_BRATE_THR ? 1 : 0; -#endif #ifdef DEBUGGING sts[n]->force = hEncoderConfig->force; sts[n]->id_element = cpe_id + st_ivas->nSCE; diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index e648484808..942dd14c99 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -118,9 +118,6 @@ ivas_error ivas_sce_enc( st->input_bwidth = st->last_input_bwidth; /* updated in BWD */ st->bwidth = st->last_bwidth; /* updated in BWD */ st->rate_switching_reset = 0; -#ifdef FIX_I2_BWD - st->bwd_high_brate_flag = st_ivas->hEncoderConfig->ivas_total_brate >= BWD_HIGH_BRATE_THR ? 1 : 0; -#endif #ifdef DEBUGGING st->force = st_ivas->hEncoderConfig->force; st->id_element = sce_id; diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index e1016c7cf4..de0451d3bc 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -1389,9 +1389,6 @@ typedef struct enc_core_structure int16_t count_WB; int16_t count_SWB; int16_t count_FB; -#ifdef FIX_I2_BWD - int16_t bwd_high_brate_flag; -#endif /*----------------------------------------------------------------------------------* * Channel-aware mode -- GitLab