Unverified Commit 1cf4cd60 authored by norvell's avatar norvell
Browse files

Merge branch 'main' into...

Merge branch 'main' into basop-2235-td-renderer-mismatch-between-model-data-word16-and-calculations-word32
parents 8442c51c 94fd13cb
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -913,6 +913,9 @@ static bool parseCmdlIVAS_dec(
    arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192;
    arg->non_diegetic_pan_enabled = false;
    arg->non_diegetic_pan_gain = 0.f;
#ifdef FIX_2318_CLANG_DECODER
    arg->non_diegetic_pan_gain_fx = 0;
#endif
    arg->tsmEnabled = false;
    arg->render_num_subframes = IVAS_RENDER_NUM_SUBFR_20MS;
    arg->aeSequence.count = 0;
+24 −6
Original line number Diff line number Diff line
@@ -180,12 +180,14 @@ IF( GT_16( element_mode, IVAS_SCE ) )
{
    return;
}

/*---------------------------------------------------------------------*
 * Generate white noise vector
 *---------------------------------------------------------------------*/

/*for ( i=0; i<L_frame; i++ )exc2[i] = (float)own_random( seed );*/
Random_Fill( seed, L_frame, exc2, 4 );

/*------------------------------------------------------------*
 * Insert random variation for excitation energy
 *  (random variation is scaled according to *lp_ener value)
@@ -240,6 +242,7 @@ FOR( i_subfr = 0; i_subfr < L_frame; i_subfr += L_SUBFR )
        move16();
    }
}

IF( NE_16( Opt_AMR_WB, 1 ) )
{
    Copy( exc2, exc3, L_FRAME16k );
@@ -538,7 +541,6 @@ IF( NE_16( Opt_AMR_WB, 1 ) )
    }
    L_tmp2 = L_shr( L_tmp2, sub( add( Q_exc, Q_exc ), 5 ) ); /*Q6*/


    /*  enr = (*lp_ener)/enr; */
    /*  ftmp = sqrt(enr); */
    L_tmp = L_max( 1, *lp_ener ); /*Q6*/
@@ -592,12 +594,15 @@ ELSE
return;
}


/*-------------------------------------------------------*
 * cng_params_postupd_fx
 *
 * Post-update of CNG parameters
 *-------------------------------------------------------*/

void cng_params_postupd_fx(
#ifndef HARM_NON_LINEARITY
    const Word16 ho_circ_ptr,          /* i  : pointer for CNG averaging buffers                  Q0    */
    Word16 *cng_buf_cnt,               /* i/o: counter for CNG store buffers                      Q0    */
    const Word16 *const cng_exc2_buf,  /* i  : Excitation buffer                                  Q_exc */
@@ -702,6 +707,7 @@ void cng_params_postupd_fx(
}

void cng_params_postupd_ivas_fx(
#endif
    const Word16 ho_circ_ptr,          /* i  : pointer for CNG averaging buffers                  Q0    */
    Word16 *cng_buf_cnt,               /* i/o: counter for CNG store buffers                      Q0    */
    const Word16 *const cng_exc2_buf,  /* i  : Excitation buffer                                  Q_exc */
@@ -781,7 +787,6 @@ void cng_params_postupd_ivas_fx(
        }
        ELSE
        {

            CNG_mode = get_cng_mode( last_active_brate );

            /* att = 1/pow(2,ENR_ATT_fx[CNG_mode]); */
@@ -828,6 +833,7 @@ void cng_params_postupd_ivas_fx(
 *
 * update CNG parameters
 *-------------------------------------------------------*/
#ifndef HARM_NON_LINEARITY
void cng_params_upd_fx(
    const Word16 lsp_new[],        /* i  : LSP aprameters                                     Q15   */
    const Word16 exc2[],           /* i  : current enhanced excitation                        Q_exc */
@@ -997,8 +1003,13 @@ void cng_params_upd_fx(

    return;
}
#endif

#ifdef HARM_NON_LINEARITY
void cng_params_upd_fx(
#else
void cng_params_upd_ivas_fx(
#endif
    const Word16 lsp_new[],         /* i  : LSP aprameters                                     Q15   */
    const Word16 exc2[],            /* i  : current enhanced excitation                        Q_exc */
    const Word16 L_frame,           /* i  : frame length                                       Q0    */
@@ -1008,7 +1019,7 @@ void cng_params_upd_ivas_fx(
    Word16 ho_lsp_circ[],           /* o  : old LSP buffer for CNG averaging                   Q15   */
    const Word16 Q_exc,             /* i  : Q value of excitation                                    */
    const Word16 enc_dec_flag,      /* i  : Flag indicating encoder or decoder (ENC,DEC)             */
    Word32 ho_env_circ[],           /* i/o: Envelope buffer                                    Q(6+shift)    */
    Word32 ho_env_circ[],           /* i/o: Envelope buffer                            Q6/Q(6+shift) */
    Word16 *cng_buf_cnt,            /* i/o: Counter of postponed FFT-processing instances            */
    Word16 cng_exc2_buf[],          /* i/o: Excitation buffer                                  Q_exc */
    Word16 cng_Qexc_buf[],          /* i/o: Q_exc buffer                                       Q0    */
@@ -1176,10 +1187,17 @@ void cng_params_upd_ivas_fx(
        /* update the circular buffer of old residual envelope */
        /* Copy32( env, &(ho_env_circ[add(shl(*ho_circ_ptr,4),shl(*ho_circ_ptr,2))]), NUM_ENV_CNG ); */
        Copy32( env, &( ho_env_circ[( *ho_circ_ptr ) * NUM_ENV_CNG] ), NUM_ENV_CNG );
#ifdef HARM_NON_LINEARITY
        IF( NE_16( element_mode, EVS_MONO ) )
#endif
        {
            scale_sig32( &( ho_env_circ[( *ho_circ_ptr ) * NUM_ENV_CNG] ), NUM_ENV_CNG, shift ); // Q(6+shift)
        }
    }

    *ho_circ_size = add( *ho_circ_size, 1 );
    move16();

    if ( GT_16( *ho_circ_size, HO_HIST_SIZE ) )
    {
        *ho_circ_size = HO_HIST_SIZE;
+12 −0
Original line number Diff line number Diff line
@@ -1150,11 +1150,19 @@ void highband_exc_dct_in_ivas_fx(
    test();
    IF( bfi || LT_32( core_brate, 6000 ) || ( LT_32( core_brate, 8600 ) && EQ_16( coder_type, UNVOICED ) ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 13107, MBANDS_GN ); /*0.4 in Q15 */
#else
        set16_fx( noisepb, 13107, last_bin ); /*0.4 in Q15 */
#endif
    }
    ELSE IF( EQ_16( GSC_IVAS_mode, 3 ) || ( GSC_IVAS_mode > 0 && EQ_16( GSC_noisy_speech, 1 ) ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 13107 /*0.4f*/, MBANDS_GN16k );
#else
        set16_fx( noisepb, 13107 /*0.4f*/, last_bin );
#endif
    }
    ELSE
    {
@@ -1171,7 +1179,11 @@ void highband_exc_dct_in_ivas_fx(

    IF( GSC_IVAS_mode == 0 && GSC_noisy_speech && !bfi && LE_16( element_mode, IVAS_SCE ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 3277, MBANDS_GN );
#else
        set16_fx( noisepb, 3277, last_bin );
#endif
    }

    test();
+14 −2
Original line number Diff line number Diff line
@@ -5856,7 +5856,11 @@ ivas_error ivas_mct_enc_fx(
    const Word16 nb_bits_metadata                               /* i  : number of metadata bits                 */
);

#ifdef FIX_2344_ALIGN_PREPROC
void ivas_compute_core_buffers_fx(
#else
ivas_error ivas_compute_core_buffers_fx(
#endif
    Encoder_State *st,                                          /* i/o: encoder state structure                  */
    Word16 **inp16k_out_fx,                                     /* o  : ptr. to inp. signal in the current frame */
    Word16 *old_inp_16k_fx,                                     /* i/o: buffer of old input signal @ 16kHz       */
@@ -5870,7 +5874,7 @@ ivas_error ivas_compute_core_buffers_fx(
    Word32 epsP[M + 1],                                         /* i/o: LP prediction errors                     */
    Word16 lsp_new_fx[M],                                       /* i/o: LSPs at the end of the frame             */
    Word16 lsp_mid_fx[M],                                       /* i/o: LSPs in the middle of the frame          */
    Word16 Q_old_inp_16k,
    const Word16 Q_old_inp_16k,
    Word16 Q_r[2],
    Word16 *Q_new 
);
@@ -5961,7 +5965,11 @@ void ivas_mct_enc_close_fx(
    MCT_ENC_HANDLE *hMCT                                        /* i/o: MCT encoder structure                   */
);

#ifdef FIX_2344_ALIGN_PREPROC
void pre_proc_front_ivas_fx(
#else
ivas_error pre_proc_front_ivas_fx(
#endif
    SCE_ENC_HANDLE hSCE,                                           /* i/o: SCE encoder structure                                    */
    CPE_ENC_HANDLE hCPE,                                           /* i/o: CPE encoder structure                                    */
    const Word32 element_brate,                                    /* i  : SCE/CPE element bitrate                                  Q0*/
@@ -6017,7 +6025,11 @@ ivas_error pre_proc_front_ivas_fx(
    Word16 *Q_new                                                  /* i/o : Q factor of speech buffers                              */
);

#ifdef FIX_2344_ALIGN_PREPROC
void pre_proc_ivas_fx(
#else
ivas_error pre_proc_ivas_fx(
#endif
    Encoder_State *st,                                          /* i/o: encoder state structure                                */
    const Word16 last_element_mode,                             /* i  : last element mode                                    Q0*/
    const Word32 element_brate,                                 /* i  : element bitrate                                      Q0*/
+16 −0
Original line number Diff line number Diff line
@@ -98,10 +98,24 @@
#define REMOVE_UNUSED_CODE_IVAS_DEC                     /* VA: remove unused code in ivas_jbm_dec_tc_fx() */
#define FIX_2294_CLANG_18_WARNINGS_ENC                  /* VA: Fix some encoder clang-18 warnings, desc. in 2294 */
#define REMOVE_CAM_FROM_IVAS                            /* VA: basop issue 210: remove obsoelte CAM code from IVAS */
#define FIX_2318_CLANG_DECODER                          /* VA: basop issue 2318: Initialize command-line parameter arg.non_diegetic_pan_gain_fx */
#define OPT_BE_2311_HARM_GSC_GAIN                       /* VA: issue 2311: BE part of the GSC gain harmonization pipeline #70380 shows the BE */
#define HARM_CORECODER_UPDT                             /* VA: basop issue 2342: Remove duplicated code in core-coder common update functions */
#define HARM_CORE_SW                                    /* VA: basop issue 2314: Remove duplicated code in the core switching */
#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 */
#define FIX_FLOAT_1501_UNIT_VALUE_IN_OMASA              /* Nokia: Fix float issue 1501, uninitialized value in ivas_masa_combine_directions for OMASA */
#define FIX_BASOP_2323_DIRAC_ENC_WRONG_INIT             /* Nokia/FhG: basop issue 2323: Use correct init size */
#define FIX_BASOP_2324_MISSING_SET_TO_ZERO              /* Nokia: basop issue 2324: Fix issue by setting the exponent to zero where it should be */
#define FIX_BASOP_2326_WRONG_SIG_LENGTH                 /* Nokia: basop issue 2326: Fix issue by using correct signal length in multiple places */
#define FIX_BASOP_2327_WRONG_LOOP_END                   /* Nokia: basop inssue 2327: Correct loop end to solve MSAN error */
#define FIX_BASOP_2328_MSAN_WRONG_ASSIGNMENT            /* Nokia: basop issue 2328: Fix MSAN error by correcting the variable assignment */
#define FIX_BASOP_2329_UNINIT_VALUE                     /* Nokia: basop issue 2329: Fix issue by checking for structure instead of length */
#define FIX_BASOP_2332_ASAN_OVERFLOW_IN_EXT_DIRAC_REND  /* Nokia: basop issue 2332: Uses predefined memory sizes instead computing wrong */
#define FIX_BASOP_2333_MCMASA_ANA_MEMORY_LEAK           /* Nokia: basop issue 2333: Add missing free for direction_vector_e to ivas_mcmasa_ana_fx.c */
#define HARM_COREDECODER_FUNCTIONS                      /* VA: basop issue 2347: Remove various duplicated code in core-decoder  */

/* #################### End BE switches ################################## */

@@ -118,6 +132,8 @@
#define OPT_2308_FIND_TARGET                            /* VA: Issue 2308, Speeds up computation and improve accuracy of the impulse response */
#define OPT_NBE_2311_HARM_GSC_GAIN                      /* VA: issue 2311: non-BE part of the GSC gain harmonization */
#define FIX_2261_REMOVE_LP_RESCALING                    /* VA: Remove of unnecessary lpc coefficient rescaling */
#define FIX_2320_OOB_SCE_SWITCHING                      /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */
#define FIX_2302_LSF_CDBK_THRESHOLD                     /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision  */

/* ##################### End NON-BE switches ########################### */

Loading