Commit 479270d0 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

ivas_mc_dec_reconfig conversion, ivas_cpe and ivas_jbm cleanup

[x] TonalMDCTConceal_INSTANCE structure cleanup
[x] ivas_cpe and ivas_jbm cleanup
[x] ivas_mc_dec_reconfig, ivas_lfe_plc converted to fixed point
parent ff8313e0
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -297,6 +297,7 @@
    <ClCompile Include="..\lib_dec\ivas_lfe_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_lfe_dec_fx.c" />
    <ClCompile Include="..\lib_dec\ivas_lfe_plc.c" />
    <ClCompile Include="..\lib_dec\ivas_lfe_plc_fx.c" />
    <ClCompile Include="..\lib_dec\ivas_ls_custom_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_masa_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_mcmasa_dec.c" />
+12 −12
Original line number Diff line number Diff line
@@ -694,10 +694,10 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2(
        }

        //st->hTcxDec->tcxltp_last_gain_unmodified = (Word16) floatToFixed( st->hTcxDec->tcxltp_last_gain_unmodified_float, 15 );
        if ( st->hTonalMDCTConc != NULL )
        {
            floatToFixed_arr( st->hTonalMDCTConc->secondLastPcmOut_float, st->hTonalMDCTConc->secondLastPcmOut, 0, st->hTonalMDCTConc->nSamples );
        }
        //if ( st->hTonalMDCTConc != NULL )
        //{
        //    floatToFixed_arr( st->hTonalMDCTConc->secondLastPcmOut_float, st->hTonalMDCTConc->secondLastPcmOut, 0, st->hTonalMDCTConc->nSamples );
        //}

        st->Q_syn = 0;

@@ -721,10 +721,10 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2(

        floatToFixed_arr( st->hHQ_core->old_out + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), st->hHQ_core->old_out_fx + NS2SA( st->output_Fs, N_ZERO_MDCT_NS ), 0, NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS ) );

        if ( !st->tcxonly )
        {
            floatToFixed_arr( st->p_bpf_noise_buf_float, st->p_bpf_noise_buf, 0, L_FRAME_16k );
        }
        //if ( !st->tcxonly )
        //{
        //    floatToFixed_arr( st->p_bpf_noise_buf_float, st->p_bpf_noise_buf, 0, L_FRAME_16k );
        //}

        st->mem_error = st->hBPF->pst_mem_deemp_err_fx;
           
@@ -829,10 +829,10 @@ void fixed_to_float_stereo_tcx_core_dec(

    //fixedToFloat_arr( hTcxDec->old_synthFB_fx, hTcxDec->old_synthFB, 0, NS2SA_fx2( st->output_Fs, PH_ECU_LOOKAHEAD_NS ) + hTcxDec->old_synth_lenFB );

    if ( !st->tcxonly )
    {
        fixedToFloat_arr( st->p_bpf_noise_buf, st->p_bpf_noise_buf_float, 0, L_FRAME_16k );
    }
    //if ( !st->tcxonly )
    //{
    //    fixedToFloat_arr( st->p_bpf_noise_buf, st->p_bpf_noise_buf_float, 0, L_FRAME_16k );
    //}

    st->hBPF->pst_mem_deemp_err_fx = (Word16)st->mem_error;
    /*=================================*/
+4 −4
Original line number Diff line number Diff line
@@ -1046,15 +1046,15 @@ typedef enum

/* Common SPAR metadata constants */
#define IVAS_ACTIVEW_DM_F_SCALE                 0.5f
#define IVAS_ACTIVEW_DM_F_SCALE_FX              IVAS_ACTIVEW_DM_F_SCALE * ONE_IN_Q31
#define IVAS_ACTIVEW_DM_F_SCALE_FX              (1073741824) /* 0.5f in Q31 */
#define IVAS_ACTIVEW_DM_F_SCALE_DTX             0.25f
#define IVAS_ACTIVEW_DM_F_SCALE_DTX_FX          IVAS_ACTIVEW_DM_F_SCALE_DTX * ONE_IN_Q31
#define IVAS_ACTIVEW_DM_F_SCALE_DTX_FX          (536870912) /* 0.25f in Q31 */
#define IVAS_ACTIVEW_DM_F_SCALE_VLBR            0.25f
#define IVAS_ACTIVEW_DM_F_SCALE_VLBR_FX         IVAS_ACTIVEW_DM_F_SCALE_VLBR * ONE_IN_Q31
#define IVAS_ACTIVEW_DM_F_SCALE_VLBR_FX         (536870912) /* 0.25f in Q31 */
#define IVAS_SPAR_FOA_DFLT_FREQ_PER_CHAN        24000

#define IVAS_SPAR_DYN_ACTIVEW_THRESH           (0.0039f)
#define IVAS_SPAR_DYN_ACTIVEW_THRESH_FX        IVAS_SPAR_DYN_ACTIVEW_THRESH * ONE_IN_Q31
#define IVAS_SPAR_DYN_ACTIVEW_THRESH_FX        (8375186) /* 0.0039f in Q31 */
#define IVAS_SPAR_SIDE_CH_DYN_ACTIVEW_THRESH   (32.0f)

#define MAX_QUANT_STRATS                        3
+12 −10
Original line number Diff line number Diff line
@@ -73,8 +73,10 @@ void ivas_tda_fx(

    FOR( i = 0; i < len_by_2; i++ )
    {
        pOut[i] = L_sub(pIn[len_by_2 + i], pIn[len_by_2 - i - 1]);
        pOut[len_by_2 + i] = L_add(pIn[length * 2 - i - 1], pIn[length + i]);
        pOut[i] = L_sub( pIn[add( len_by_2, i )], pIn[sub( sub( len_by_2, i ), 1 )] );
        move32();
        pOut[add( len_by_2, i )] = L_add( pIn[sub( sub( i_mult( length, 2 ), i ), 1 )], pIn[add( length, i )] );
        move32();
    }

    return;
@@ -111,17 +113,17 @@ void ivas_dct_windowing_fx(

    FOR( i = 0; i < fade_len; i++ )
    {
        pOut_buf[zero_pad_len + i] = Mult_32_32(pOut_buf[zero_pad_len + i], pWindow_coeffs[i]);
        pOut_buf[add( zero_pad_len, i )] = Mult_32_32( pOut_buf[add( zero_pad_len, i )], pWindow_coeffs[i] );
    }

    rem_len = full_len - ( zero_pad_len * 3 + fade_len );
    rem_len = sub( full_len, ( add( i_mult( zero_pad_len, 3 ), fade_len ) ) );

    FOR( i = 0; i < rem_len; i++ )
    {
        pOut_buf[zero_pad_len * 3 + fade_len + i] = Mult_32_32(pOut_buf[zero_pad_len * 3 + fade_len + i], pWindow_coeffs[fade_len - i - 1]);
        pOut_buf[add( add( i_mult( zero_pad_len, 3 ), fade_len ), i )] = Mult_32_32( pOut_buf[add( add( i_mult( zero_pad_len, 3 ), fade_len ), i )], pWindow_coeffs[sub( sub( fade_len, i ), 1 )] );
    }

    set32_fx(&pOut_buf[full_len], 0, frame_len - full_len);
    set32_fx( &pOut_buf[full_len], 0, sub( frame_len, full_len ) );

    return;
}
+11 −2
Original line number Diff line number Diff line
@@ -4127,8 +4127,7 @@ ivas_error ivas_cldfb_dec_reconfig_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                */
    const Word16 nchan_transport_old,                          /* i  : number of TCs in previous frame                       */
    Word16 numCldfbAnalyses_old,                               /* i  : number of CLDFB analysis instances in previous frame  */
    const Word16 numCldfbSyntheses_old,                         /* i  : number of CLDFB synthesis instances in previous frame */
    const Word16 Q_cldfbSynDec
    const Word16 numCldfbSyntheses_old                         /* i  : number of CLDFB synthesis instances in previous frame */
);
#endif // IVAS_FLOAT_FIXED

@@ -4630,6 +4629,11 @@ void ivas_param_mc_enc(
    float *data_f[],                                            /* i/o: input/transport MC data                             */
    const int16_t input_frame                                   /* i  : input frame length                                  */
);
#ifdef IVAS_FLOAT_FIXED
ivas_error ivas_param_mc_dec_open_fx(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure  */
);
#endif // IVAS_FLOAT_FIXED

ivas_error ivas_param_mc_dec_open(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                              */
@@ -4644,6 +4648,11 @@ ivas_error ivas_param_mc_dec_reconfig_fx(
ivas_error ivas_param_mc_dec_reconfig(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                              */
);
#ifdef IVAS_FLOAT_FIXED
void ivas_param_mc_dec_close_fx(
	PARAM_MC_DEC_HANDLE *hParamMC_out /* i/o: Parametric MC decoder handle   */
);
#endif // IVAS_FLOAT_FIXED

void ivas_param_mc_dec_close(
    PARAM_MC_DEC_HANDLE *hParamMC                               /* i/o: Parametric MC decoder handle                        */
Loading