Commit e6b766c3 authored by vaclav's avatar vaclav
Browse files

Initialize arrays per each entry

parent e5f1900f
Loading
Loading
Loading
Loading
+31 −8
Original line number Diff line number Diff line
@@ -1003,14 +1003,6 @@ int main(
#endif
    const int16_t frameSize_smpls = (int16_t) ( ( args.framing_5ms ? 5 : 20 ) * args.sampleRate / 1000 );

    IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 };
    IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 };
    IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 };
    IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 };
#ifdef SPLIT_REND_WITH_HEAD_ROT
    IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] = { 0 };
#endif

    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, ( args.framing_5ms ) ? 1 : 4 ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
@@ -1157,6 +1149,37 @@ int main(
        }
    }

    IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS];
    IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS];
    IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS];
    IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS];
#ifdef SPLIT_REND_WITH_HEAD_ROT
    IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS];
#endif

    for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ )
    {
        mcIds[i] = 0u;
    }
    for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; i++ )
    {
        ismIds[i] = 0u;
    }
    for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ )
    {
        sbaIds[i] = 0u;
    }
    for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ )
    {
        masaIds[i] = 0u;
    }
#ifdef SPLIT_REND_WITH_HEAD_ROT
    for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ )
    {
        splitBinIds[i] = 0u;
    }
#endif

    for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i )
    {
        if ( ( error = IVAS_REND_AddInput( hIvasRend, args.inConfig.multiChannelBuses[i].audioConfig, &mcIds[i] ) ) != IVAS_ERR_OK )
+6 −1
Original line number Diff line number Diff line
@@ -682,7 +682,12 @@ static void ivas_get_Wscaling_factor(
{
    int16_t b, ch;
    float dm_f_local, abs_val;
    float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH] = { 0 };
    float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH];

    for ( ch = 0; ch < IVAS_SPAR_MAX_CH; ch++ )
    {
        set_zero( postpred_cov_re[ch], IVAS_SPAR_MAX_CH );
    }

    if ( dtx_vad == 0 )
    {
+7 −1
Original line number Diff line number Diff line
@@ -88,11 +88,17 @@ static void ivas_transient_det_init(
    const int32_t sampling_rate       /* i  : sampling rate             */
)
{
    float filt_coeff_arr[3][IVAS_BIQUAD_FILT_LEN << 1] = { { 0 } };
    int16_t i;
    float filt_coeff_arr[3][IVAS_BIQUAD_FILT_LEN << 1];

    hTranDet->in_duck_gain = 1.0f;
    hTranDet->out_duck_gain = 1.0f;

    for ( i = 0; i < 3; i++ )
    {
        set_zero( filt_coeff_arr[i], IVAS_BIQUAD_FILT_LEN << 1 );
    }

    switch ( sampling_rate )
    {
        case 48000:
+3 −2
Original line number Diff line number Diff line
@@ -743,7 +743,7 @@ void GenShapedSHBExcitation(
    float mix_factor, old_fact, new_fact, fact, old_scale, new_scale, step_scale;
    float c0, c1, c2, c3, c4, c5, g1, g2, g, den;
    float EnvWhiteExc16k[L_FRAME16k], EnvExc16kWhtnd[L_FRAME16k];
    float EnvWhiteExc16k_4k[L_FRAME4k] = { 0 }, EnvExc16kWhtnd_4k[L_FRAME4k] = { 0 };
    float EnvWhiteExc16k_4k[L_FRAME4k], EnvExc16kWhtnd_4k[L_FRAME4k];
    int16_t flag_plosive;
    float delta;
    float c0_part[NUM_SHB_SUBGAINS], c1_part[NUM_SHB_SUBGAINS], c2_part[NUM_SHB_SUBGAINS], c3_part[NUM_SHB_SUBGAINS], c4_part[NUM_SHB_SUBGAINS], c5_part[NUM_SHB_SUBGAINS];
@@ -752,6 +752,8 @@ void GenShapedSHBExcitation(

    set_f( zero_mem, 0, LPC_SHB_ORDER );
    set_f( wht_fil_mem, 0, LPC_WHTN_ORDER );
    set_f( EnvWhiteExc16k_4k, 0, L_FRAME4k );
    set_f( EnvExc16kWhtnd_4k, 0, L_FRAME4k );

    /* Mirror the spectrum */
    for ( i = 0; i < L_FRAME32k; i++ )
@@ -762,7 +764,6 @@ void GenShapedSHBExcitation(
    /* Decimate by 2 */
    Decimate_allpass_steep( exc32k, mem_genSHBexc_filt_down_shb, 2 * L_FRAME16k, exc16k );


    autocorr( exc16k, R, LPC_WHTN_ORDER + 1, L_FRAME16k, win_flatten, 0, 1, 1 );

    /* Ensure R[0] isn't zero when entering Levinson-Durbin */
+5 −4
Original line number Diff line number Diff line
@@ -156,8 +156,8 @@ void stereo_mdct_core_dec(
    float *x[CPE_CHANNELS][2];

    /*needed to allocate N_MAX to prevent stereo switching crash */
    float x_0_buf[CPE_CHANNELS][N_MAX] = { { 0.0f } };
    float *x_0[CPE_CHANNELS][2];
    float x_0_buf[CPE_CHANNELS][N_MAX];
    float *x_0[CPE_CHANNELS][NB_DIV];

    /* Concealment */
    int16_t bfi;
@@ -166,8 +166,8 @@ void stereo_mdct_core_dec(
    int16_t L_frame[CPE_CHANNELS], L_frameTCX[CPE_CHANNELS], nSubframes[CPE_CHANNELS];

    /* TCX */
    int16_t fUseTns[CPE_CHANNELS][2]; /*two entries for each channel in case of TCX 10 */
    STnsData tnsData[CPE_CHANNELS][2];
    int16_t fUseTns[CPE_CHANNELS][NB_DIV];
    STnsData tnsData[CPE_CHANNELS][NB_DIV];
    int16_t tcx_offset[CPE_CHANNELS];
    int16_t tcx_offsetFB[CPE_CHANNELS];
    int16_t left_rect[CPE_CHANNELS];
@@ -204,6 +204,7 @@ void stereo_mdct_core_dec(
        x[ch][0] = &signal_out_tmp[ch][0];
        x[ch][1] = &signal_out_tmp[ch][0] + L_FRAME_PLUS / 2;

        set_zero( x_0_buf[ch], N_MAX );
        x_0[ch][0] = &x_0_buf[ch][0];
        x_0[ch][1] = &x_0_buf[ch][0] + L_FRAME48k / 2;
        nTnsBitsTCX10[ch][0] = 0;
Loading