Commit 4515e871 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

clang formatting changes

parent 88d43d2c
Loading
Loading
Loading
Loading
Loading
+56 −45
Original line number Diff line number Diff line
@@ -76,7 +76,8 @@ ivas_error acelp_core_switch_dec_fx(
    set16_fx( synth_subfr_out, 0, SWITCH_MAX_GAP ); /* avoid valgrind complaining about uninitialized memory in core_switching_OLA_fx() */

    /* set multiplication factor according to the sampling rate */
    delta = 1; move16();
    delta = 1;
    move16();
    IF( GT_16( output_frame, L_FRAME16k ) )
    {
        delta = shr( output_frame, 8 );
@@ -222,7 +223,8 @@ ivas_error acelp_core_switch_dec_fx(
        cldfb_restore_memory( st_fx->cldfbBPF );

        /* CLDFB synthesis of the combined signal */
        scaleFactor.hb_scale = scaleFactor.lb_scale; move16();
        scaleFactor.hb_scale = scaleFactor.lb_scale;
        move16();

        IF( ( error = cldfb_save_memory( st_fx->cldfbSyn ) ) != IVAS_ERR_OK )
        {
@@ -464,13 +466,15 @@ ivas_error acelp_core_switch_dec_bfi_fx(
    {
        Word16 gain_buf[NB_SUBFR16k];
        Scale_sig( exc - L_EXC_MEM, L_EXC_MEM, -st_fx->Q_exc );
        st_fx->Q_exc = 0; move16();
        st_fx->Q_exc = 0;
        move16();
        /* SC-VBR */
        decod_nelp_fx( st_fx, &tmp_noise, pitch_buf, exc, exc2, voice_factors, bwe_exc, &Q_exc, st_fx->bfi, gain_buf );
        FEC_pitch = pitch_buf[3];
        move16();
        Rescale_exc( hMusicPF->dct_post_old_exc_fx, exc, NULL, st_fx->hGSCDec->last_exc_dct_in_fx, L_FRAME, 0, (Word32) 0, &Q_exc, st_fx->Q_subfr, exc2, L_FRAME, coder_type );
        st_fx->Q_exc = Q_exc; move16();
        st_fx->Q_exc = Q_exc;
        move16();
    }
    ELSE
    {
@@ -515,7 +519,8 @@ ivas_error acelp_core_switch_dec_bfi_fx(
    Copy( st_fx->mem_syn2_fx, tmp_float, M );
    syn_12k8_fx( st_fx->L_frame, Aq, exc2, syn, tmp_float, 1, Q_exc, st_fx->Q_syn );

    tmp_float32 = st_fx->enr_old_fx; move32();
    tmp_float32 = st_fx->enr_old_fx;
    move32();
    frame_ener_fx( st_fx->L_frame, st_fx->last_good, syn, shr( add( FEC_pitch, 32 ), 6 ), &tmp_float32, st_fx->L_frame, st_fx->Q_syn, 3, 0 );

    /*------------------------------------------------------------------*
@@ -557,7 +562,8 @@ ivas_error acelp_core_switch_dec_bfi_fx(
    Copy( tmp_float4, hBPF->mem_mean_pit_fx, L_TRACK_HIST );
    Copy( tmp_float5, hBPF->Track_on_hist, L_TRACK_HIST );
    Copy( tmp_float6, hBPF->vibrato_hist, L_TRACK_HIST );
    hBPF->psf_att_fx = tmp_float7; move16();
    hBPF->psf_att_fx = tmp_float7;
    move16();
    /*----------------------------------------------------------------*
     * Resamping to the output sampling frequency
     *----------------------------------------------------------------*/
@@ -570,7 +576,8 @@ ivas_error acelp_core_switch_dec_bfi_fx(
                            negate( st_fx->Q_syn ), CLDFB_NO_COL_MAX_SWITCH_BFI, workBuffer );
    cldfb_restore_memory( st_fx->cldfbAna );

    scaleFactor.hb_scale = scaleFactor.lb_scale; move16();
    scaleFactor.hb_scale = scaleFactor.lb_scale;
    move16();

    /* CLDFB synthesis of the combined signal */
    IF( ( error = cldfb_save_memory( st_fx->cldfbSyn ) ) != IVAS_ERR_OK )
@@ -705,13 +712,15 @@ ivas_error acelp_core_switch_dec_bfi_ivas_fx(
    {
        Word16 gain_buf[NB_SUBFR16k];
        Scale_sig( exc - L_EXC_MEM, L_EXC_MEM, -st_fx->Q_exc );
        st_fx->Q_exc = 0; move16();
        st_fx->Q_exc = 0;
        move16();
        /* SC-VBR */
        decod_nelp_fx( st_fx, &tmp_noise, pitch_buf, exc, exc2, voice_factors, bwe_exc, &Q_exc, st_fx->bfi, gain_buf );
        FEC_pitch = pitch_buf[3];
        move16();
        Rescale_exc( hMusicPF->dct_post_old_exc_fx, exc, NULL, st_fx->hGSCDec->last_exc_dct_in_fx, L_FRAME, 0, (Word32) 0, &Q_exc, st_fx->Q_subfr, exc2, L_FRAME, coder_type );
        st_fx->Q_exc = Q_exc; move16();
        st_fx->Q_exc = Q_exc;
        move16();
    }
    ELSE
    {
@@ -756,7 +765,8 @@ ivas_error acelp_core_switch_dec_bfi_ivas_fx(
    Copy( st_fx->mem_syn2_fx, tmp_float, M );
    syn_12k8_fx( st_fx->L_frame, Aq, exc2, syn, tmp_float, 1, Q_exc, st_fx->Q_syn );

    tmp_float32 = st_fx->enr_old_fx; move32();
    tmp_float32 = st_fx->enr_old_fx;
    move32();
    frame_ener_fx( st_fx->L_frame, st_fx->last_good, syn, shr( add( FEC_pitch, 32 ), 6 ), &tmp_float32, st_fx->L_frame, st_fx->Q_syn, 3, 0 );

    /*------------------------------------------------------------------*
@@ -872,7 +882,8 @@ static void decod_gen_voic_core_switch_fx(
    GSC_DEC_HANDLE hGSCDec;
    hGSCDec = st_fx->hGSCDec;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0; move16();
    Flag Overflow = 0;
    move16();
#endif


+82 −69
Original line number Diff line number Diff line
@@ -51,7 +51,8 @@ ivas_error amr_wb_dec_fx(
    Word32 L_tmp, L_tmp1;
    Word16 pitch_buf_fx[NB_SUBFR], Qdct, tmp_coder_type; /* floating pitch for each subframe (Q6) */
    Word16 tmp16;
    Word16 sid_bw = 0; move16();
    Word16 sid_bw = 0;
    move16();
    Word32 L_Ng_ener;
    Word16 exp2, ng_ener;

@@ -149,7 +150,8 @@ ivas_error amr_wb_dec_fx(
    move16();

    st_fx->sr_core = i_mult( st_fx->L_frame, 50 );
    st_fx->fscale_old = st_fx->fscale; move16();
    st_fx->fscale_old = st_fx->fscale;
    move16();
    st_fx->fscale = sr2fscale_fx( st_fx->sr_core );

    /* Initialization in case that the first frame is the good received AMR-WB (IO) frame */
@@ -280,17 +282,20 @@ ivas_error amr_wb_dec_fx(
        IF( EQ_16( st_fx->last_L_frame, L_FRAME32k ) )
        {
            /* (float)12800/(float)32000; */
            tmp16 = 13107; move16();
            tmp16 = 13107;
            move16();
        }
        ELSE IF( EQ_16( st_fx->last_L_frame, 512 ) )
        {
            /* (float)12800/(float)25600; */
            tmp16 = 16384; move16();
            tmp16 = 16384;
            move16();
        }
        ELSE /* st->last_L_frame == L_FRAME16k */
        {
            /* (float)12800/(float)16000; */
            tmp16 = 26214; move16();
            tmp16 = 26214;
            move16();
        }

        FOR( i = sub( NB_SUBFR16k, NB_SUBFR ); i < NB_SUBFR16k; i++ )
@@ -312,17 +317,20 @@ ivas_error amr_wb_dec_fx(
        IF( EQ_16( st_fx->bfi_pitch_frame, L_FRAME32k ) )
        {
            /* (float)12800/(float)32000; */
            tmp16 = 13107; move16();
            tmp16 = 13107;
            move16();
        }
        ELSE IF( EQ_16( st_fx->bfi_pitch_frame, 512 ) )
        {
            /* (float)12800/(float)25600; */
            tmp16 = 16384; move16();
            tmp16 = 16384;
            move16();
        }
        ELSE /* st->bfi_pitch_frame == L_FRAME16k */
        {
            /* (float)12800/(float)16000; */
            tmp16 = 26214; move16();
            tmp16 = 26214;
            move16();
        }
        st_fx->bfi_pitch_fx = mult_r( tmp16, st_fx->bfi_pitch_fx );
        st_fx->bfi_pitch_frame = L_FRAME;
@@ -388,7 +396,8 @@ ivas_error amr_wb_dec_fx(
                move16();
            }

            i = st_fx->Q_exc; move16();
            i = st_fx->Q_exc;
            move16();
            Rescale_exc( hMusicPF->dct_post_old_exc_fx, exc_fx, NULL, st_fx->hGSCDec->last_exc_dct_in_fx, st_fx->L_frame,
                         st_fx->L_frame * HIBND_ACB_L_FAC, 0, &( st_fx->Q_exc ), st_fx->Q_subfr, NULL, 0, INACTIVE );
            Rescale_mem( st_fx->Q_exc, &st_fx->prev_Q_syn, &st_fx->Q_syn, st_fx->mem_syn2_fx, st_fx->mem_syn_clas_estim_fx, delta_mem_scale,
@@ -784,7 +793,8 @@ ivas_error amr_wb_dec_fx(
#else
        ApplyFdCng_fx( syn_fx, st_fx->Q_syn, NULL, NULL, NULL, st_fx, 0, 0 );
#endif
        st_fx->hFdCngDec->hFdCngCom->frame_type_previous = st_fx->m_frame_type; move16();
        st_fx->hFdCngDec->hFdCngCom->frame_type_previous = st_fx->m_frame_type;
        move16();

        /*Noisy speech detector*/
        noisy_speech_detection_fx( st_fx->hFdCngDec, st_fx->VAD, syn_fx, st_fx->Q_syn );
@@ -1055,10 +1065,12 @@ ivas_error amr_wb_dec_fx(

    IF( waveadj_rec )
    {
        tmps = 0; move16();
        tmps = 0;
        move16();
        IF( GE_16( output_frame, L_FRAME16k ) )
        {
            tmps = NS2SA_fx2( st_fx->output_Fs, DELAY_BWE_TOTAL_NS ); move16();
            tmps = NS2SA_fx2( st_fx->output_Fs, DELAY_BWE_TOTAL_NS );
            move16();
        }

        waveform_adj2_fix( st_fx->tonalMDCTconceal.secondLastPcmOut, synth_out_fx + tmps, st_fx->plcInfo.data_noise, &st_fx->plcInfo.outx_new_n1_fx,
@@ -1076,7 +1088,8 @@ ivas_error amr_wb_dec_fx(

    {
        /* TCX-LTP Postfilter: used in AMR-WB IO to update memories and to avoid discontinuities when the past frame was TCX */
        Word16 delta = NS2SA_fx2( st_fx->output_Fs, TCXLTP_DELAY_NS ); move16();
        Word16 delta = NS2SA_fx2( st_fx->output_Fs, TCXLTP_DELAY_NS );
        move16();
        Scale_sig( hTcxLtpDec->tcxltp_mem_in, delta, sub( st_fx->Q_syn2, st_fx->Qprev_synth_buffer_fx ) );
        Scale_sig( hTcxLtpDec->tcxltp_mem_out, output_frame, sub( st_fx->Q_syn2, st_fx->Qprev_synth_buffer_fx ) );
        tcx_ltp_post( st_fx, hTcxLtpDec, ACELP_CORE, output_frame, 0, synth_out_fx, NULL );
+29 −28
Original line number Diff line number Diff line
@@ -277,7 +277,8 @@ static Word16 ari_decode_14bits_ext_fx(
    cum = L_add( L_shl( L_sub( value, low ), stat_bitsnew ), sub( shl( 1, stat_bitsnew ), 1 ) );
    IF( LT_32( cum, 0 ) )
    {
        cum = 0x7fffffff; move32();
        cum = 0x7fffffff;
        move32();
    }

    symbol = lookup_fn( cum, range, cum_freq );
+51 −48
Original line number Diff line number Diff line
@@ -132,11 +132,13 @@ static int16_t tcx_hm_dequantize_gain(
    /* safety check in case of bit errors */
    if ( !( 0 <= gain_idx && gain_idx < ( 1 << kTcxHmNumGainBits ) ) )
    {
        *gain = 0; move16();
        *gain = 0;
        move16();
        return 1;
    }

    *gain = qGains[coder_type][gain_idx]; move16();
    *gain = qGains[coder_type][gain_idx];
    move16();

    return 0;
}
@@ -293,7 +295,8 @@ void tcx_hm_decode(
    IF( tcx_hm_dequantize_gain_fx( (Word16) EQ_16( coder_type, VOICED ), prm_hm[2], &gain ) )
    {
        /* A bit error was encountered */
        *hm_bits = -1; move16();
        *hm_bits = -1;
        move16();
        return;
    }

+36 −30
Original line number Diff line number Diff line
@@ -322,7 +322,12 @@ void tcx_arith_decode_envelope_ivas_fx(
    Word16 gamma_w, gamma_uw;
    Word16 hm_bits;

    test();test();test();test();test();test();
    test();
    test();
    test();
    test();
    test();
    test();
    IF( GT_16( L_spec, N_MAX_ARI ) || ( EQ_16( st->element_mode, EVS_MONO ) && GT_16( target_bits, ( ACELP_13k20 / FRAMES_PER_SEC ) ) ) ||
        ( EQ_16( st->element_mode, IVAS_SCE ) && ( GT_16( st->bits_frame_nominal, ( LPC_SHAPED_ARI_MAX_RATE / FRAMES_PER_SEC ) ) ) ) ||
        ( GT_16( st->element_mode, IVAS_SCE ) && ( GT_16( st->bits_frame_nominal, ( LPC_SHAPED_ARI_MAX_RATE_CPE / FRAMES_PER_SEC ) ) ) ) ||
@@ -344,7 +349,8 @@ void tcx_arith_decode_envelope_ivas_fx(

    hTcxCfg = st->hTcxCfg;
    hTcxDec = st->hTcxDec;
    *signaling_bits = 0; move16();
    *signaling_bits = 0;
    move16();

    assert( hTcxDec->enableTcxLpc );
    gamma_w = MAX16B;
Loading