diff --git a/lib_com/cnst.h b/lib_com/cnst.h index ae476a02eccc338036772a4dcaba51fa5f164a53..40a4710579dd35f964601e1becd5fa77e89dd6a6 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 9a564035bf0ad7fdd765c89230a7f83e939d6109..6a9861f02e0bd12c9d6893535260703d4528457c 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 1f5a90673381e512c6a3c34edcfb2f2db7c0c451..c1357a7f7470346a038bfbd316f75d589c0e4e7b 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 2a15da648800e5dd9e19d2a28b55fd8a04039249..1ae2f48c66cd2a6c0af1b76c4765d7594a3b03f5 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 27b05ef6a1929d9884f068fca9d170642aefdace..42a17cb9cbefa40eb58b1e9d246f9c48fc1292a7 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 2c1022920e3ed134cb6e80da01d7e23f1ee09d8a..b543761491bd57c201045f9c42280183bda1feaa 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_init_enc.c b/lib_enc/ivas_init_enc.c index 5eadb0f1eb3078183cd3f15a9b4ee51a8f223686..33f0f7da02acec0c7347a9cc79b005d06dfb538b 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; } } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index e648484808f03cf754c3fc9898431b85021bd6f1..942dd14c999b07d44c2e8608ce33633d630a90ea 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 e1016c7cf432007d2f2a7b852fe42855258328f2..de0451d3bc63d17a62bf119c6059203aed678ab0 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