Commit b52ecbd0 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into basop-2323-clang18-msan-use-of-uninitialized-value-in-lib_enc-ivas_dirac_enc_fx-c-1590-30
parents 93ff42e8 76c1d7a6
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;
+18 −4
Original line number Diff line number Diff line
@@ -1257,8 +1257,8 @@ int main(
    /* Set up output custom layout configuration */
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
    {
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.azimuth, args.outConfig.outSetupCustom.azimuth_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.elevation, args.outConfig.outSetupCustom.elevation_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.azimuth, args.outConfig.outSetupCustom.azimuth_fx, Q22, args.outConfig.outSetupCustom.num_spk );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.elevation, args.outConfig.outSetupCustom.elevation_fx, Q22, args.outConfig.outSetupCustom.num_spk );
        if ( ( error = IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( hIvasRend, args.outConfig.outSetupCustom ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) );
@@ -1362,8 +1362,8 @@ int main(

        if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
        {
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.azimuth, args.inConfig.inSetupCustom.azimuth_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.elevation, args.inConfig.inSetupCustom.elevation_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.azimuth, args.inConfig.inSetupCustom.azimuth_fx, Q22, args.inConfig.inSetupCustom.num_spk );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.elevation, args.inConfig.inSetupCustom.elevation_fx, Q22, args.inConfig.inSetupCustom.num_spk );
            if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in IVAS_REND_ConfigureCustomInputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) );
@@ -2763,6 +2763,13 @@ static CmdlnArgs defaultArgs(

    args.inConfig.inSetupCustom.num_spk = 0;
    args.inConfig.inSetupCustom.num_lfe = 0;
    for ( i = 0; i < RENDERER_MAX_INPUT_CHANNELS; i++ )
    {
        args.inConfig.inSetupCustom.azimuth[i] = 0.f;
        args.inConfig.inSetupCustom.azimuth_fx[i] = 0;
        args.inConfig.inSetupCustom.elevation[i] = 0.f;
        args.inConfig.inSetupCustom.elevation_fx[i] = 0;
    }
    args.inConfig.numAudioObjects = 0;
    args.inConfig.numAmbisonicsBuses = 0;
    args.inConfig.numMultiChannelBuses = 0;
@@ -2771,6 +2778,13 @@ static CmdlnArgs defaultArgs(
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID;
    args.outConfig.outSetupCustom.num_spk = 0;
    args.outConfig.outSetupCustom.num_lfe = 0;
    for ( i = 0; i < RENDERER_MAX_OUTPUT_CHANNELS; i++ )
    {
        args.outConfig.outSetupCustom.azimuth[i] = 0.f;
        args.outConfig.outSetupCustom.azimuth_fx[i] = 0;
        args.outConfig.outSetupCustom.elevation[i] = 0.f;
        args.outConfig.outSetupCustom.elevation_fx[i] = 0;
    }
    for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i )
    {
        args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID;
+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*/
Loading