diff --git a/lib_com/options.h b/lib_com/options.h index 0f1889ab8acfa7e9b9d84c7054476b11ed54f096..1fe1532b561927ff5944a72be379d5b28d9ba5a5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,6 +171,8 @@ #define NONBE_FIX_GSC_BSTR /* VA: issue 1264: Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ #define NONBE_1273_ISM_METADATA_COUNTER /* VA: issue 1273: fix counter overflow in ISM metadata encoder */ #define NONBE_1279_COUNTER_OVERFLOW /* VA: issue 1279: Avoid possible overflow of counter st->Nb_ACELP_frames */ +#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ + /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/swb_pre_proc.c b/lib_enc/swb_pre_proc.c index 610d485db4d49b2d9521338c8e9019415880ce1e..6e17526ad649d25ebb4451b939a98c4b5818291c 100644 --- a/lib_enc/swb_pre_proc.c +++ b/lib_enc/swb_pre_proc.c @@ -442,7 +442,11 @@ void swb_pre_proc( if ( st->last_extl != SWB_BWE && st->last_extl != FB_BWE ) { /* resample 48 kHz to 32kHz */ +#ifdef NONBE_1244_FIX_SWB_BWE_MEMORY + if ( ( st->last_bwidth == FB && st->element_mode == EVS_MONO ) || ( st->bwidth == FB && st->element_mode > EVS_MONO ) ) // note: once EVS i CR fixed, the condition will simplify to "if ( st->bwidth == FB )" only +#else if ( st->last_bwidth == FB ) +#endif { inner_frame = L_FRAME48k; inner_Fs = 48000;