diff --git a/lib_com/options.h b/lib_com/options.h index fb1ee3c7d3425fd39453145edd8ff5f9728bffcf..8941f3321304a2220e67dc5a7dc951f2972fc154 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -110,6 +110,7 @@ #define FIX_BASOP_2350_HARM_0B_BWE_2 /* VA: basop issue 2350: Simplify calling of hf_synth_fx() */ #define FIX_2349_HARM_FIND_UV /* VA: basop issue 2349: harmonization of find_uv() function */ #define FIX_2364_HARM_MULT_HARM /* VA: basop issue 2364 : harmonizing multi_harm_fx function */ +#define FIX_2363_FIND_WSP /* VA: basop issue 2363 : harmonizing find_wsp function */ #define FIX_2370_UNUSED_BUFFERS_CORE_ENC /* VA: basop issue 2370: remove temporary input buffers in core-encoder */ #define FIX_2376_FIX_USAN_PRE_PROC /* VA: basop issue 2376: Resolve "USAN: SEGV in ivas_compute_core_buffers_fx() */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 68b9be4402fe5b7f5115e8ce7d635885d59c55db..cf36b5c6542b8096970df2e7c88f29ae128426e0 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -11027,7 +11027,7 @@ void bands_and_bit_alloc_ivas_fx( const Word16 element_mode, /* i : element mode */ const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ); - +#ifndef FIX_2363_FIND_WSP void ivas_find_wsp_fx( const Word16 L_frame, /* i : length of the frame Q0*/ const Word16 L_subfr, /* i : length of subframe Q0*/ @@ -11041,6 +11041,7 @@ void ivas_find_wsp_fx( const Word16 gamma, /* i : weighting factor Q15 */ const Word16 L_look /* i : look-ahead Q0*/ ); +#endif Word16 RCcontextMapping_encode2_estimate_bandWise_start_fx( Word16 *x, /* Q0 */ diff --git a/lib_enc/find_uv_fx.c b/lib_enc/find_uv_fx.c index 78c3d9f3ac80071fd5a1460bcc52373f3c896ae8..66b5eac772c4757d17f5fe0124eb8de3a9f0928f 100644 --- a/lib_enc/find_uv_fx.c +++ b/lib_enc/find_uv_fx.c @@ -739,7 +739,7 @@ Word16 find_uv_fx( *-----------------------------------------------------------------*/ #ifdef FIX_2349_HARM_FIND_UV - IF( st_fx->element_mode == EVS_MONO ) /* Overwrite DE3 in case of EVS */ + IF( st_fx->element_mode == EVS_MONO ) /* Overwrite dE3 in case of EVS */ { dE3 = sub( Etot, hNoiseEst->Etot_last_fx ); /*Q8*/ } @@ -1108,8 +1108,8 @@ Word16 find_uv_fx( { st_fx->rf_mode = 0; move16(); - /* Current frame cannot be compressed to pack the partial redundancy;*/ + /* Current frame cannot be compressed to pack the partial redundancy */ IF( NE_16( st_fx->rf_mode, st_fx->Opt_RF_ON ) ) /* can happen only for EVS format */ { #ifdef FIX_2349_HARM_FIND_UV diff --git a/lib_enc/find_wsp_fx.c b/lib_enc/find_wsp_fx.c index 6e75c36c2ce874ceb10b13e29c04967fdf12dc7f..e2353c45513fdada3288c965d678ed9ac089c22a 100644 --- a/lib_enc/find_wsp_fx.c +++ b/lib_enc/find_wsp_fx.c @@ -77,7 +77,7 @@ void find_wsp_fx( deemph_fx( &wsp[L_frame], preemph_fac, lookahead, &wtmp ); } } - +#ifndef FIX_2363_FIND_WSP /*-------------------------------------------------------------------* * ivas_find_wsp_fx() * @@ -134,3 +134,4 @@ void ivas_find_wsp_fx( deemph_fx( &wsp_fx[L_frame], tilt_fact, L_look, &tmp_fx ); return; } +#endif diff --git a/lib_enc/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index e8f0631bdc0b6bbd960c0679c2d5ed4f43b5bccf..b8d10c06fb496818ff397ea9ca7f0d3df6fda3dd 100644 --- a/lib_enc/ivas_core_pre_proc_front_fx.c +++ b/lib_enc/ivas_core_pre_proc_front_fx.c @@ -1086,7 +1086,11 @@ ivas_error pre_proc_front_ivas_fx( move16(); move16(); +#ifndef FIX_2363_FIND_WSP ivas_find_wsp_fx( L_FRAME, L_SUBFR, NB_SUBFR, A_fx, Aw_fx, inp_12k8_fx, TILT_FAC_FX, wsp_fx, &st->mem_wsp_fx, GAMMA1, L_LOOK_12k8 ); +#else + find_wsp_fx( A_fx, inp_12k8_fx, wsp_fx, &st->mem_wsp_fx, TILT_FAC_FX, L_FRAME, L_LOOK_12k8, L_SUBFR, Aw_fx, GAMMA1, NB_SUBFR ); +#endif Word16 Q_wsp = *Q_new; move16(); diff --git a/lib_enc/ivas_core_pre_proc_fx.c b/lib_enc/ivas_core_pre_proc_fx.c index 142931191e09704237ff3c5f5ce171c11d0c16c1..e6dc79e2fa955b2c9e019409a90bfd786d92467d 100644 --- a/lib_enc/ivas_core_pre_proc_fx.c +++ b/lib_enc/ivas_core_pre_proc_fx.c @@ -1256,7 +1256,11 @@ ivas_error ivas_compute_core_buffers_fx( * Compute Weighted Input *---------------------------------------------------------------*/ +#ifndef FIX_2363_FIND_WSP ivas_find_wsp_fx( L_FRAME16k, L_SUBFR, NB_SUBFR16k, A_fx, Aw_fx, st->speech_enc_pe, PREEMPH_FAC_16k, st->wspeech_enc, &st->mem_wsp_enc, st->gamma, L_LOOK_16k ); +#else + find_wsp_fx( A_fx, st->speech_enc_pe, st->wspeech_enc, &st->mem_wsp_enc, PREEMPH_FAC_16k, L_FRAME16k, L_LOOK_16k, L_SUBFR, Aw_fx, st->gamma, NB_SUBFR16k ); +#endif } /*-----------------------------------------------------------------* diff --git a/lib_enc/ivas_front_vad_fx.c b/lib_enc/ivas_front_vad_fx.c index ba7c84a16ca31e8bdb82f7589a5a80de986aad4a..b4447f2a16260b259a7f4fa5664e73dc8ae754f8 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -634,7 +634,12 @@ ivas_error front_vad_spar_fx( st->mem_wsp_fx = (Word16) shl_sat( st->mem_wsp_fx, Q_inp_12k8 - st->mem_wsp_q ); /* Q_inp_12k8 */ st->mem_wsp_q = Q_inp_12k8; move16(); + +#ifndef FIX_2363_FIND_WSP ivas_find_wsp_fx( L_FRAME, L_SUBFR, NB_SUBFR, A_fx, Aw_fx, inp_12k8_fx, TILT_FAC_FX, wsp_fx, &st->mem_wsp_fx, GAMMA1, L_LOOK_12k8 ); +#else + find_wsp_fx( A_fx, inp_12k8_fx, wsp_fx, &st->mem_wsp_fx, TILT_FAC_FX, L_FRAME, L_LOOK_12k8, L_SUBFR, Aw_fx, GAMMA1, NB_SUBFR ); +#endif IF( st->vad_flag == 0 ) { diff --git a/lib_enc/multi_harm_fx.c b/lib_enc/multi_harm_fx.c index a042bcbc475ff9ffd1233642e3fe6f87912366b9..79a2efca6b57134e49fb0dc2c6259bbb21cfe885 100644 --- a/lib_enc/multi_harm_fx.c +++ b/lib_enc/multi_harm_fx.c @@ -9,11 +9,17 @@ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" + +/*-----------------------------------------------------------------* + * Local constants + *-----------------------------------------------------------------*/ + #define THR_CORR_FX ( 56 << 15 ) /* 56 in Q15 starting threshold of multi-harm. correlation */ #define THR_CORR_MAX_FX 30720 /* 60 in Q9 upper threshold of multi-harm. correlation */ #define THR_CORR_MIN_FX 25088 /* 49 in Q9 lower threshold of multi-harm. correlation */ #define THR_CORR_STEP_FX 102 /* 0.2 in Q9 step for the threshold of multi-harm. correlation */ + /*---------------------------------------------------------------------* * multi_harm() *