diff --git a/lib_com/options.h b/lib_com/options.h index c5f15d71185f1bb127e1d05ecdf04ba7ff93aa04..b1c2051294a501d1ed5838eb98dc27e2a035bbc2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -104,6 +104,7 @@ #define HARM_PREPROC /* VA: basop issue 2339: Remove duplicated code in the core-coder DTX */ #define HARM_NON_LINEARITY /* VA: basop issue 2345: Remove duplicated code in core-coder: non_linearity_fx() and LP CNG */ #define FIX_2344_ALIGN_PREPROC /* VA: basop issue 2344: Align pre_proc_ivas() between FLP and BASOP */ +#define FIX_2334_HARM_CODER_MODIF /* VA: basop issue 2334 : harmonizing coder_modif_function */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_cpe_enc_fx.c b/lib_enc/ivas_cpe_enc_fx.c index f81c6d7ad0740ab902851a72502b81977d16bdbb..ef7e3f83e5aeb2ff359da221543632237b4473fe 100644 --- a/lib_enc/ivas_cpe_enc_fx.c +++ b/lib_enc/ivas_cpe_enc_fx.c @@ -1133,7 +1133,11 @@ ivas_error ivas_cpe_enc_fx( IF( ( NE_16( hCPE->element_mode, IVAS_CPE_DFT ) && NE_16( hCPE->element_mode, IVAS_CPE_TD ) ) || n == 0 ) /* modify coder_type of primary channel */ { /* limit coder_type depending on the bitrate */ +#ifndef FIX_2334_HARM_CODER_MODIF coder_type_modif_ivas_fx( sts[n], relE_fx[n] ); +#else + coder_type_modif_fx( sts[n], relE_fx[n] ); +#endif } } diff --git a/lib_enc/ivas_ism_enc_fx.c b/lib_enc/ivas_ism_enc_fx.c index eb8271bfd9d85a1136b0e10227c78c4a86757be2..02d0b86f0d0acce29b4340ff070cf7666376f9dc 100644 --- a/lib_enc/ivas_ism_enc_fx.c +++ b/lib_enc/ivas_ism_enc_fx.c @@ -453,8 +453,11 @@ ivas_error ivas_ism_enc_fx( } /* modify the coder_type depending on the total_brate per channel */ +#ifndef FIX_2334_HARM_CODER_MODIF coder_type_modif_ivas_fx( st, relE_fx[sce_id][0] ); - +#else + coder_type_modif_fx( st, relE_fx[sce_id][0] ); +#endif /*----------------------------------------------------------------* * Encoder *----------------------------------------------------------------*/ diff --git a/lib_enc/ivas_sce_enc_fx.c b/lib_enc/ivas_sce_enc_fx.c index 091dce1481502274fd42996968cfe05364739ce6..4d639c961ca13c7ce256ecd3481d68b59c778e90 100644 --- a/lib_enc/ivas_sce_enc_fx.c +++ b/lib_enc/ivas_sce_enc_fx.c @@ -364,8 +364,11 @@ ivas_error ivas_sce_enc_fx( move16(); /* modify the coder_type depending on the total_brate per channel */ +#ifndef FIX_2334_HARM_CODER_MODIF coder_type_modif_ivas_fx( st, relE_fx[0] ); - +#else + coder_type_modif_fx( st, relE_fx[0] ); +#endif /*----------------------------------------------------------------* * Encoder *----------------------------------------------------------------*/ diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 451cf3bc679e90281971ee149378b0f5437efe1f..d6caa478065aae98a15f8916c3e5cedb1afe2041 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -1217,11 +1217,12 @@ void coder_type_modif_fx( const Word16 relE /* i : frame relative E to the long term average */ ); +#ifndef FIX_2334_HARM_CODER_MODIF void coder_type_modif_ivas_fx( Encoder_State *st, /* i/o: encoder state structure */ const Word16 relE /* i : frame relative E to the long term average */ ); - +#endif void speech_music_clas_init_fx( SP_MUS_CLAS_HANDLE hSpMusClas /* i/o: speech/music classifier handle */ ); diff --git a/lib_enc/sig_clas_fx.c b/lib_enc/sig_clas_fx.c index 990fad0db6851a9f6e6b3358c594b1c1058ffcd9..b4d41c4055d402db5abd52c86c0f671b37f13c7d 100644 --- a/lib_enc/sig_clas_fx.c +++ b/lib_enc/sig_clas_fx.c @@ -545,7 +545,7 @@ void select_TC_fx( * * Coder type modification *-------------------------------------------------------------------*/ - +#ifndef FIX_2334_HARM_CODER_MODIF void coder_type_modif_fx( Encoder_State *st, /* i/o: encoder state structure */ const Word16 relE /* i : frame relative E to the long term average Q8*/ @@ -687,6 +687,9 @@ void coder_type_modif_fx( return; } void coder_type_modif_ivas_fx( +#else +void coder_type_modif_fx( +#endif Encoder_State *st, /* i/o: encoder state structure */ const Word16 relE /* i : frame relative E to the long term average */ ) @@ -774,7 +777,23 @@ void coder_type_modif_ivas_fx( hSC_VBR->vbr_generic_ho = 0; move16(); } - +#ifdef FIX_2334_HARM_CODER_MODIF + IF( NE_16( st->element_mode, EVS_MONO ) ) + { + hSC_VBR->last_7k2_coder_type = st->coder_type; + move16(); + test(); + if ( st->localVAD == 0 && EQ_16( st->coder_type, UNVOICED ) ) + { + hSC_VBR->last_7k2_coder_type = GENERIC; + move16(); + } + } +#endif + } +#ifdef FIX_2334_HARM_CODER_MODIF + IF( EQ_16( st->element_mode, EVS_MONO ) ) + { hSC_VBR->last_7k2_coder_type = st->coder_type; move16(); test(); @@ -784,6 +803,7 @@ void coder_type_modif_ivas_fx( move16(); } } +#endif IF( st->element_mode == 0 ) { diff --git a/lib_enc/vad_fx.c b/lib_enc/vad_fx.c index 2e03bc59edd04158dac8291236ce68b9a85d25dd..21abc589d2fa29c17b1ba5faf7dd8de3ece5b806 100644 --- a/lib_enc/vad_fx.c +++ b/lib_enc/vad_fx.c @@ -762,8 +762,11 @@ Word16 wb_vad_fx( st_fx->max_band = 19; move16(); } - +#ifdef FIX_2334_HARM_CODER_MODIF + IF( st_fx->Opt_SC_VBR || ( !st_fx->Opt_SC_VBR && st_fx->element_mode == EVS_MONO ) ) /* this keep 26.444 BE */ +#else IF( 1 ) // st_fx->Opt_SC_VBR ) /* this keep 26.444 BE */ +#endif { last_7k2_coder_type = st_fx->hSC_VBR->last_7k2_coder_type; move16();