Commit 9703b023 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

bring back to state e1d19cec

parent 9712808d
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@

#define SUPPORT_JBM_TRACEFILE                   /* Support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */

#define WMOPS                                   /* Activate complexity and memory counters */
/*#define WMOPS*/                                   /* Activate complexity and memory counters */
#ifdef WMOPS
/*#define WMOPS_PER_FRAME*/                     /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */
/*#define WMOPS_DETAIL*/                        /* Output detailed complexity printout for every function. Increases runtime overhead */
@@ -89,7 +89,13 @@
//#define HARM_SCE_INIT
#define DIV32_OPT_NEWTON                               /* FhG: faster 32 by 32 bit division */ 
#define	MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE /* FhG: reduce WMOPS of Cy calculation in ivas_param_mc_param_est_enc_fx() by using 64 Bit addition. Obsoletes IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE. */
#define FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat            /*FhG: reduces WMOPS - bit-exact*/
#define FIX_1439_SPEEDUP_stereo_icBWE_dec_fx                    /*FhG: reduces WMOPS - bit-exact*/
#define FIX_1439_SPEEDUP_ivas_swb_tbe_dec_fx                    /*FhG: reduces WMOPS - bit-exact*/
#define FIX_1439_SPEEDUP_synthesise_fb_high_band_fx             /*FhG: reduces WMOPS - bit-exact*/

#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic              /*FhG: reduces maintenance complexity & reduces WMOPS & prepares STAGE2 patch*/
//#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2       /*FhG: reduces WMOPS* /
//#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1

#endif
+2 −7
Original line number Diff line number Diff line
@@ -3266,7 +3266,7 @@ void wb_tbe_extras_reset_synth_fx( Word16 state_lsyn_filt_shb[], Word16 state_ls
void elliptic_bpf_48k_generic_fx(
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
    int isIVAS,
    int isIVAS;
#endif
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    Word16 IsUpsampled3,
@@ -3292,12 +3292,7 @@ void synthesise_fb_high_band_fx(
    Word16 *prev_fbbwe_ratio,   /* o  : previous frame energy for FEC                       */
    Word32 bpf_memory[][4],     /* i/o: memory for elliptic bpf 48k                         */
    Word16 bpf_memory_Q[],
    Word16 Qout
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
    ,
    Word16 isIVAS
#endif
);
    Word16 Qout );
void prep_tbe_exc_fx(
    const Word16 L_frame_fx, /* i : length of the frame */
+11 −51
Original line number Diff line number Diff line
@@ -116,12 +116,12 @@ ivas_error ivas_core_dec_fx(

    error = IVAS_ERR_OK;
    move32();
    push_wmops( "ivas_core_dec (ICD)" );
    push_wmops( "ivas_core_dec" );

    /*------------------------------------------------------------------*
     * General initialization
     *-----------------------------------------------------------------*/
    push_wmops( "ICD init" );

    use_cldfb_for_dft = 0;
    move16();
    tdm_LRTD_flag = -1;
@@ -370,9 +370,7 @@ ivas_error ivas_core_dec_fx(
    {
        save_hb_synth_32_fx = NULL;
    }
    pop_wmops(); /*push_wmops( "ICD init" );*/

    push_wmops( "ICD SID, sanity" );
    /*------------------------------------------------------------------*
     * Decode SID for MDCT-Stereo DTX mode
     *-----------------------------------------------------------------*/
@@ -400,9 +398,7 @@ ivas_error ivas_core_dec_fx(
    {
        ivas_combined_format_brate_sanity_fx( element_brate, sts[0]->core, sts[0]->total_brate, &( sts[0]->core_brate ), &( sts[0]->inactive_coder_type_flag ), &tmps );
    }
    pop_wmops(); /*push_wmops( "ICD SID, sanity" );*/

    push_wmops( "ICD Coredec" );
    /*------------------------------------------------------------------*
     * Core Decoding
     *-----------------------------------------------------------------*/
@@ -487,7 +483,6 @@ ivas_error ivas_core_dec_fx(

        IF( st->core == ACELP_CORE )
        {
            push_wmops( "ICD ACELP" );
            /* ACELP core decoder */
            Word16 old_syn_12k8_16k_fx_16[L_FRAME16k];
            Word16 save_hb_synth_fx_arr[L_FRAME48k], *save_hb_synth_16_fx;
@@ -560,7 +555,6 @@ ivas_error ivas_core_dec_fx(
            }

            Copy_Scale_sig_16_32_DEPREC( old_syn_12k8_16k_fx_16, old_syn_12k8_16k_fx[n], L_FRAME16k, Q11 - ( -Q1 ) ); // Q(11 - (-1))
            pop_wmops();                                                                                              /*push_wmops( "ICD ACELP" );*/
        }

        Copy_Scale_sig_32_16( st->previoussynth_fx_32, st->previoussynth_fx, L_FRAME48k, 0 ); // Q0
@@ -569,7 +563,6 @@ ivas_error ivas_core_dec_fx(
        test();
        IF( ( EQ_16( st->core, TCX_20_CORE ) || EQ_16( st->core, TCX_10_CORE ) ) && NE_16( st->element_mode, IVAS_CPE_MDCT ) )
        {
            push_wmops( "ICD TCX" );
            Word16 Qsyn_temp;
            IVAS_FORMAT ivas_format;

@@ -624,12 +617,10 @@ ivas_error ivas_core_dec_fx(
            }
            st->hBPF->pst_mem_deemp_err_fx = extract_l( st->mem_error );
            move16();
            pop_wmops(); /*push_wmops( "ICD TCX" );*/
        }

        IF( EQ_16( st->core, HQ_CORE ) )
        {
            push_wmops( "ICD HQ decoding" );
            /* HQ core decoder */
            Word16 Q_output;

@@ -643,7 +634,6 @@ ivas_error ivas_core_dec_fx(
            Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_output ) ); // Q11
            Scale_sig( synth_16_fx[n], output_frame, negate( Q_synth ) );                                      // Q0
            Scale_sig( output_16_fx[n], L_FRAME48k, negate( Q_output ) );                                      // Q0
            pop_wmops();                                                                                       /*push_wmops( "ICD HQ decoding" );*/
        }

        /*---------------------------------------------------------------------*
@@ -661,7 +651,7 @@ ivas_error ivas_core_dec_fx(
        }

    } /* n_channels loop */
    pop_wmops(); /*push_wmops( "ICD Coredec" );*/


    /*---------------------------------------------------------------------*
     * MDCT stereo: joint TCX Core Decoding
@@ -669,7 +659,6 @@ ivas_error ivas_core_dec_fx(

    IF( EQ_16( sts[0]->element_mode, IVAS_CPE_MDCT ) )
    {
        push_wmops( "ICD jTCX Coredec" );
        /* active-frame decoding */
        IF( GT_32( sts[0]->core_brate, SID_2k40 ) )
        {
@@ -798,7 +787,6 @@ ivas_error ivas_core_dec_fx(
                }
            }
        }
        pop_wmops(); /*push_wmops( "ICD jTCX Coredec" );*/
    }

    /*---------------------------------------------------------------------*
@@ -808,7 +796,6 @@ ivas_error ivas_core_dec_fx(
    test();
    IF( EQ_16( sts[0]->element_mode, IVAS_CPE_TD ) && hStereoCng != NULL )
    {
        push_wmops( "ICD Stereo CNG Updates" );
        /* To be cleaned up once the caller function is converted // These changes are for system testing of fixed changes made */
        Word16 Q_c_PS_LT, Q_output;
        Word32 c_PS_LT_fx;
@@ -824,14 +811,12 @@ ivas_error ivas_core_dec_fx(
        stereo_cng_compute_PScorr_fx( output_32_fx[0], output_32_fx[1], &Q_output, &c_PS_LT_fx, Q_c_PS_LT, sts[0]->L_frame, sts[1]->L_frame );

        hStereoCng->c_PS_LT_fx = extract_h( c_PS_LT_fx );
        pop_wmops(); /*push_wmops( "ICD Stereo CNG Updates" );*/
    }

    /*---------------------------------------------------------------------*
     * Postprocessing, BWEs and updates
     *---------------------------------------------------------------------*/

    push_wmops( "ICD Postproc, BWE, updates (ICD PP)" );
    FOR( n = 0; n < n_channels; n++ )
    {
        st = sts[n];
@@ -842,7 +827,6 @@ ivas_error ivas_core_dec_fx(
         * TD-BWE for ACELP to TCX transitions
         *---------------------------------------------------------------------*/

        push_wmops( "ICD PP TDBWE ACELPTCX trans" );
        /*core_switching_post_dec*/
        Q_synth = sub( 15, e_sig[0] );

@@ -916,12 +900,11 @@ ivas_error ivas_core_dec_fx(
            Copy_Scale_sig_16_32_no_sat( hBWE_TD->mem_resamp_HB_fx, hBWE_TD->mem_resamp_HB_fx_32, INTERP_3_1_MEM_LEN, sub( Q11, hBWE_TD->prev_Qx ) );                            // Q11
            Copy( hBWE_TD->mem_resamp_HB_fx, hBWE_TD->state_32and48k_WB_upsample_fx, ( 2 * ALLPASSSECTIONS_STEEP ) );
        }
        pop_wmops(); /*push_wmops( "ICD PP TDBWE ACELPTCX trans" );*/

        /*---------------------------------------------------------------------*
         * Postprocessing for ACELP/MDCT core switching
         *---------------------------------------------------------------------*/
        push_wmops( "ICD PP ACELP/MDCT switch" );

        /* save synth and output in case of SBA DirAC stereo output as core switching is done outside of core decoder */
        test();
        test();
@@ -956,12 +939,11 @@ ivas_error ivas_core_dec_fx(
        {
            Copy( sts[0]->previoussynth_fx, sts[1]->previoussynth_fx, st->hTcxDec->L_frameTCX );
        }
        pop_wmops(); /*push_wmops( "ICD PP ACELP/MDCT switch" );*/

        /*---------------------------------------------------------------------*
         * Pre-processing for bandwidth switching
         *---------------------------------------------------------------------*/
        push_wmops( "ICD PP BWswitch preproc" );

        ivas_bw_switching_pre_proc_fx( st, last_element_brate, nchan_out, old_syn_12k8_16k_fx[n], old_syn_fx, q_audio );

        IF( st->hHQ_core == NULL )
@@ -1008,13 +990,12 @@ ivas_error ivas_core_dec_fx(
            hBWE_FD->prev_flag = hBWE_FD->prev_flag;
            move16();
        }
        pop_wmops(); /*push_wmops( "ICD PP BWswitch preproc" );*/

        /*---------------------------------------------------------------------*
         * WB TBE decoding
         * WB BWE decoding
         *---------------------------------------------------------------------*/
        push_wmops( "ICD PP TBE/BWE" );

        Word16 Q_input, Q_hb_synth_fx, Q_synth_fx;
        Word16 Q_syn_hb, sf;

@@ -1042,9 +1023,8 @@ ivas_error ivas_core_dec_fx(
        IF( EQ_16( st->extl, WB_TBE ) )
        {
            /* WB TBE decoder */
            push_wmops( "ICD PP TBE/BWE wb_tbe_dec" );

            ivas_wb_tbe_dec_fx( st, st->coder_type, bwe_exc_extended_fx[n], st->Q_exc, voice_factors_fx[n], hb_synth_16_fx[n], &Q_hb_synth_fx );
            pop_wmops(); /*push_wmops( "ICD PP TBE/BWE wb_tbe_dec" );*/
        }
        ELSE IF( EQ_16( st->element_mode, IVAS_CPE_TD ) && EQ_16( n, 1 ) && !tdm_LRTD_flag && NE_16( st->extl, -1 ) && st->bws_cnt == 0 && st->extl_brate == 0 )
        {
@@ -1052,10 +1032,8 @@ ivas_error ivas_core_dec_fx(
        }
        ELSE IF( EQ_16( st->extl, WB_BWE ) && st->bws_cnt == 0 )
        {
            push_wmops( "ICD PP TBE/BWE wb_bwe_dec" );
            /* WB BWE decoder */
            Q_hb_synth_fx = ivas_wb_bwe_dec_fx( st, output_16_fx[n], synth_16_fx[n], hb_synth_16_fx[n], use_cldfb_for_dft, output_frame, voice_factors_fx[n], pitch_buf_fx[n], &Q_synth_fx );
            pop_wmops(); /*push_wmops( "ICD PP TBE/BWE wb_bwe_dec" );*/
        }

        /* Memories  Re-Scaling */
@@ -1099,10 +1077,8 @@ ivas_error ivas_core_dec_fx(
        test();
        IF( EQ_16( st->extl, SWB_TBE ) || EQ_16( st->extl, FB_TBE ) || ( NE_16( st->coder_type, AUDIO ) && NE_16( st->coder_type, INACTIVE ) && GE_32( st->core_brate, SID_2k40 ) && EQ_16( st->core, ACELP_CORE ) && !st->con_tcx && GE_32( output_Fs, 32000 ) && GT_16( st->bwidth, NB ) && st->bws_cnt > 0 ) )
        {
            push_wmops( "ICD PP TBE/BWE swb_tbe_dec" );
            /* SWB TBE decoder */
            ivas_swb_tbe_dec_fx( st, hStereoICBWE, bwe_exc_extended_fx[n], st->Q_exc, voice_factors_fx[n], old_syn_12k8_16k_fx[n], tmp_buffer_fx /*fb_exc*/, hb_synth_32_fx[n], pitch_buf_fx[n], &Q_white_exc );
            pop_wmops(); /*push_wmops( "ICD PP TBE/BWE swb_tbe_dec" );*/

            Copy_Scale_sig_16_32_no_sat( hBWE_TD->syn_overlap_fx, hBWE_TD->syn_overlap_fx_32, L_SHB_LAHEAD, sub( Q11, hBWE_TD->prev_Q_bwe_syn2 ) ); // Q11
            Copy_Scale_sig_32_16( hBWE_TD->old_tbe_synth_fx_32, hBWE_TD->old_tbe_synth_fx, L_SHB_TRANSITION_LENGTH, sub( hBWE_TD->prev_Qx, Q11 ) ); // prev_Qx
@@ -1117,22 +1093,18 @@ ivas_error ivas_core_dec_fx(
            /* FB TBE decoder */
            IF( EQ_16( st->extl, FB_TBE ) )
            {
                push_wmops( "ICD PP TBE/BWE fb_tbe_dec" );
                fb_tbe_dec_ivas_fx( st, tmp_buffer_fx /*fb_exc*/, Q_white_exc, hb_synth_32_fx[n], 0, tmp_buffer_fx /*fb_synth_ref*/, Q_white_exc, output_frame );
                pop_wmops(); /*push_wmops( "ICD PP TBE/BWE fb_tbe_dec" );*/
            }
        }
        ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) || ( GE_32( output_Fs, 32000 ) && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && !st->ppp_mode_dec && !( EQ_16( st->nelp_mode_dec, 1 ) && EQ_16( st->bfi, 1 ) ) ) )
        {
            /* SWB BWE decoder */
            push_wmops( "ICD PP TBE/BWE swb_bwe_dec" );
            Q_syn_hb = swb_bwe_dec_fx32( st, output_32_fx[n], synth_32_fx[n], hb_synth_32_fx[n], use_cldfb_for_dft, output_frame );
            pop_wmops();                                                          /*push_wmops( "ICD PP TBE/BWE swb_bwe_dec" );*/

            Scale_sig32( hb_synth_32_fx[n], output_frame, sub( Q11, Q_syn_hb ) ); // Q11

            Copy_Scale_sig_32_16( hBWE_FD->L_old_wtda_swb_fx32, hBWE_FD->L_old_wtda_swb_fx, output_frame, sub( hBWE_FD->old_wtda_swb_fx_exp, Q11 ) ); // old_wtda_swb_fx_exp
        }
        pop_wmops(); /*push_wmops( "ICD PP TBE/BWE" );*/

        /*---------------------------------------------------------------------*
         * FEC - recovery after lost HQ core (smoothing of the BWE component)
@@ -1171,7 +1143,6 @@ ivas_error ivas_core_dec_fx(
        test();
        IF( ( GE_16( output_frame, L_FRAME32k ) && st->hTdCngDec != NULL ) || ( EQ_16( st->element_mode, IVAS_CPE_DFT ) && GE_16( st->bwidth, SWB ) && st->hTdCngDec != NULL ) )
        {
            push_wmops( "ICD PP SWB CNG" );
            /* SHB CNG decoder */
            Word16 synth_fxl[960]; /* Q-2 */
            Word16 q;
@@ -1193,7 +1164,6 @@ ivas_error ivas_core_dec_fx(

            Scale_sig( hBWE_TD->state_lpc_syn_fx, LPC_SHB_ORDER, negate( sub( Q8, hBWE_TD->prev_Q_bwe_syn ) ) ); // Q0
            Copy_Scale_sig_16_32_no_sat( hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx, hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx_32, 2 * ALLPASSSECTIONS_STEEP, negate( sub( hBWE_TD->prev_Q_bwe_syn2, Q11 ) ) );
            pop_wmops(); /*        push_wmops( "ICD PP SWB CNG" );*/
        }

        /*-------------------------------------------------------------------*
@@ -1203,7 +1173,6 @@ ivas_error ivas_core_dec_fx(
        test();
        IF( n == 0 && GE_16( st->element_mode, IVAS_CPE_DFT ) )
        {
            push_wmops( "ICD PP IC-BWE" );
            Word16 q;
            q = 11;
            move16();
@@ -1225,12 +1194,10 @@ ivas_error ivas_core_dec_fx(
                Scale_sig32( hb_synth_32_fx[0], output_frame, sub( Q11, q ) ); // Q11
                Scale_sig32( hb_synth_32_fx[1], output_frame, sub( Q11, q ) ); // Q11
            }
            pop_wmops(); /*push_wmops( "ICD PP IC-BWE" );*/
        }

        IF( EQ_16( st->element_mode, EVS_MONO ) )
        {
            push_wmops( "ICD PP BFI" );
            /*----------------------------------------------------------------*
             * BFI waveform adjustment
             *----------------------------------------------------------------*/
@@ -1258,7 +1225,6 @@ ivas_error ivas_core_dec_fx(
                st->hPlcInfo->Pitch_fx = 0;
                move16();
            }
            pop_wmops(); /*push_wmops( "ICD PP BFI" );*/
        }

        /*----------------------------------------------------------------*
@@ -1271,7 +1237,6 @@ ivas_error ivas_core_dec_fx(
        test();
        IF( ( NE_16( st->extl, -1 ) && ( NE_16( st->extl, IGF_BWE ) || st->last_core == ACELP_CORE ) ) || ( st->bws_cnt > 0 && st->core == ACELP_CORE ) )
        {
            push_wmops( "ICD PP Sync BWE" );
            /* Calculate an additional delay of extension layer components to be synchronized with ACELP synthesis */
            IF( EQ_16( st->L_frame, L_FRAME ) )
            {
@@ -1425,7 +1390,6 @@ ivas_error ivas_core_dec_fx(
                st->hTdCngDec->last_shb_ener_fx_32 = L_shl_sat( L_tmp, sub( exp, 20 ) ); /*Q11*/
                move32();
            }
            pop_wmops(); /*push_wmops( "ICD PP Sync BWE" );*/
        }

        test();
@@ -1441,7 +1405,7 @@ ivas_error ivas_core_dec_fx(
         * - core switching in DFT stereo
         * - updates for potential TD->DFT stereo switching
         *----------------------------------------------------------------*/
        push_wmops( "ICD PP TCXLTP" );

        IF( st->hHQ_core != NULL )
        {
            Copy_Scale_sig_16_32_no_sat( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( Q11, st->hHQ_core->Q_old_wtda_LB ) ); // Q11
@@ -1498,7 +1462,6 @@ ivas_error ivas_core_dec_fx(
        }

        Copy32( synth_32_fx[n], output_32_fx[n], output_frame );
        pop_wmops(); /*push_wmops( "ICD PP TCXLTP" );*/

        /*--------------------------------------------------------*
         * Common updates
@@ -1507,7 +1470,6 @@ ivas_error ivas_core_dec_fx(
        Word16 exp_max;
        Word32 output_fx_loc[L_FRAME48k];

        push_wmops( "ICD PP commonupdates" );
        exp_max = 0;
        move16();

@@ -1562,8 +1524,6 @@ ivas_error ivas_core_dec_fx(

        Scale_sig( st->delay_buf_out_fx, NS2SA_FX2( st->output_Fs, DELAY_CLDFB_NS ), negate( exp_max ) ); // Q0

        pop_wmops(); /*push_wmops( "ICD PP commonupdates" );*/

    } /* n_channels loop */

    FOR( n = 0; n < n_channels; n++ )
@@ -1582,7 +1542,7 @@ ivas_error ivas_core_dec_fx(
            move16();
        }
    }
    pop_wmops(); /*push_wmops( "ICD Postproc, BWE, updates (ICD PP)" );*/

    pop_wmops();
    return error;
}
+3 −17
Original line number Diff line number Diff line
@@ -96,13 +96,12 @@ ivas_error ivas_jbm_dec_tc_fx(

    CPE_DEC_HANDLE hCPE;
    SCE_DEC_HANDLE hSCE;
    push_wmops( "ivas_jbm_dec_tc (JBM)" );
    push_wmops( "ivas_jbm_dec_tc" );

    /*----------------------------------------------------------------*
     * Initialization of local vars after struct has been set
     *----------------------------------------------------------------*/

    push_wmops( "JBM init" );
    output_Fs = st_ivas->hDecoderConfig->output_Fs;
    move32();
    nchan_out = st_ivas->hTcBuffer->nchan_transport_jbm;
@@ -135,7 +134,7 @@ ivas_error ivas_jbm_dec_tc_fx(
    }

    Word16 ch;
    pop_wmops(); /*push_wmops( "JBM init" );*/


    /*----------------------------------------------------------------*
     * Decoding + pre-rendering
@@ -153,7 +152,6 @@ ivas_error ivas_jbm_dec_tc_fx(
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) )
    {
        push_wmops( "JBM STEREO" );
        st_ivas->hCPE[0]->element_brate = ivas_total_brate;
        move32();
        Word16 q_output = 11;
@@ -194,11 +192,9 @@ ivas_error ivas_jbm_dec_tc_fx(
                Scale_sig32( p_output_fx[i], output_frame, negate( s ) ); // Q11
            }
        }
        pop_wmops(); /*push_wmops( "JBM STEREO" );*/
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) )
    {
        push_wmops( "JBM ISM" );
        /* Metadata decoding and configuration */
        test();
        IF( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) || EQ_32( ivas_total_brate, FRAME_NO_DATA ) )
@@ -283,11 +279,9 @@ ivas_error ivas_jbm_dec_tc_fx(
                Scale_sig32( p_output_fx[i], output_frame, 1 ); // Q-1 -> Q
            }
        }
        pop_wmops(); /*push_wmops( "JBM ISM" );*/
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_FORMAT ) )
    {
        push_wmops( "JBM SBA/MASA" );
        set16_fx( nb_bits_metadata, 0, MAX_SCE );


@@ -694,11 +688,9 @@ ivas_error ivas_jbm_dec_tc_fx(
                Scale_sig32( p_output_fx[i], output_frame, 1 ); // Q-1 -> Q
            }
        }
        pop_wmops(); /*push_wmops( "JBM SBA/MASA" );*/
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) )
    {
        push_wmops( "JBM MASA_ISM" );
        Word16 nchan_ism, nchan_transport_ism;
        Word16 dirac_bs_md_write_idx;

@@ -829,11 +821,9 @@ ivas_error ivas_jbm_dec_tc_fx(
                Scale_sig32( p_output_fx[n], output_frame, sub( Q11, output_q ) ); // Q11
            }
        }
        pop_wmops(); /*push_wmops( "JBM MASA_ISM" );*/
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
    {
        push_wmops( "JBM SBA_ISM" );
        Word16 nchan_ism, sba_ch_idx;

        set16_fx( nb_bits_metadata, 0, MAX_SCE + 1 );
@@ -1102,11 +1092,10 @@ ivas_error ivas_jbm_dec_tc_fx(
                v_add_32( p_output_fx[n], p_output_fx[n + s_max( nchan_out, nchan_ism )], p_output_fx[n], output_frame );
            }
        }
        pop_wmops(); /*push_wmops( "JBM SBA_ISM" );*/
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) )
    {
        push_wmops( "JBM MC" );

        // st = (st_ivas->nSCE > 0) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0];
        IF( st_ivas->nSCE > 0 )
        {
@@ -1479,7 +1468,6 @@ ivas_error ivas_jbm_dec_tc_fx(
                ivas_mono_stereo_downmix_mcmasa_fx( st_ivas, p_output_fx, output_frame );
            }
        }
        pop_wmops(); /*push_wmops( "JBM MC" );*/
    }

    /*----------------------------------------------------------------*
@@ -1488,9 +1476,7 @@ ivas_error ivas_jbm_dec_tc_fx(

    IF( EQ_16( st_ivas->hDecoderConfig->Opt_tsm, 1 ) )
    {
        push_wmops( "JBM syn_out" );
        ivas_syn_output_f_fx( p_output_fx, output_frame, st_ivas->hTcBuffer->nchan_transport_jbm, data_fx );
        pop_wmops(); /*push_wmops( "JBM syn_out" );*/
    }
    ELSE
    {
+3 −26
Original line number Diff line number Diff line
@@ -4644,12 +4644,7 @@ void fb_tbe_dec_fx(
    fb_exc_energy = sum2_fx_mod( fb_exc, L_FRAME16k );

    /* FB TBE synthesis */
    synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
                                ,
                                0 /*isIVAS*/
#endif
    );
    synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp );

    /* add the fb_synth component to the hb_synth component */
    /*  v_add_fx( hb_synth, fb_synth, hb_synth, L_FRAME48k );*/
@@ -4718,14 +4713,7 @@ void fb_tbe_dec_ivas_fx(
    fb_exc_energy = sum2_fx_mod( fb_exc, L_FRAME16k );

    /* FB TBE synthesis */
    push_wmops( "synthesise_fb_high_band" );
    synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
                                ,
                                1 /*isIVAS*/
#endif
    );
    pop_wmops(); /*push_wmops( "synthesise_fb_high_band" );*/
    synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp );

    test();
    IF( GE_16( st->element_mode, IVAS_CPE_DFT ) && ( st->idchan == 0 ) )
@@ -5529,7 +5517,6 @@ void ivas_swb_tbe_dec_fx(

    hBWE_TD = st->hBWE_TD;


    /* initializations */
    GainFrame_fx = 0;
    move32();
@@ -6340,7 +6327,6 @@ void ivas_swb_tbe_dec_fx(
        }
    }
    ener_fx = s_max( 1, round_fx_sat( L_shl_sat( L_ener, sub( 18, shl( Q_bwe_exc, 1 ) ) ) ) ); /* Q2: 2*Q_bwe_exc+18-2*Q_bwe_exc-16 */

    /* WB/SWB bandwidth switching */
    IF( st->bws_cnt > 0 )
    {
@@ -6658,6 +6644,7 @@ void ivas_swb_tbe_dec_fx(
    hBWE_TD->prev_Q_bwe_syn = Q_bwe_exc;
    move16();


    /* Gain shape smoothing after quantization */
    test();
    IF( EQ_32( st->extl_brate, SWB_TBE_1k10 ) || EQ_32( st->extl_brate, SWB_TBE_1k75 ) )
@@ -7007,16 +6994,11 @@ void ivas_swb_tbe_dec_fx(
        move32();
    }

    push_wmops( "ICD PP TBE/BWE swb_tbe_dec PART A" );
    push_wmops( "ICD PP TBE/BWE swb_tbe_dec PART A.1" );

    /* generate 32kHz SHB synthesis from 12.8(16)kHz signal */
    GenSHBSynth_fx32( shaped_shb_excitation_fx_32, error_fx, hBWE_TD->genSHBsynth_Hilbert_Mem_fx, hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx_32, st->L_frame, &( hBWE_TD->syn_dm_phase ) );
    Copy_Scale_sig_32_16( st->hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx_32, st->hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx, 2 * ALLPASSSECTIONS_STEEP, -( Q11 - Q_bwe_exc ) );
    Copy32( error_fx + L_FRAME32k - L_SHB_TRANSITION_LENGTH, hBWE_TD->old_tbe_synth_fx_32, L_SHB_TRANSITION_LENGTH );
    pop_wmops(); /*push_wmops( "ICD PP TBE/BWE swb_tbe_dec PART A.1" );*/

    push_wmops( "ICD PP TBE/BWE swb_tbe_dec PART A.2" );
    /* resample SHB synthesis (if needed) and scale down */
    synth_scale_fx = 32767;
    move16(); /* 1.0 in Q15 */
@@ -7120,9 +7102,7 @@ void ivas_swb_tbe_dec_fx(

        Decimate_allpass_steep_fx32( error_fx, hBWE_TD->mem_resamp_HB_32k_fx_32, L_FRAME32k, synth_fx );
    }
    pop_wmops(); /*push_wmops( "ICD PP TBE/BWE swb_tbe_dec PART A.2" );*/

    push_wmops( "ICD PP TBE/BWE swb_tbe_dec PART A.3" );
    /* Update previous frame parameters for FEC */
    Copy( lsf_shb_fx, hBWE_TD->lsp_prevfrm_fx, LPC_SHB_ORDER );
    IF( EQ_16( st->codec_mode, MODE1 ) )
@@ -7159,9 +7139,6 @@ void ivas_swb_tbe_dec_fx(
    move16();
    hBWE_TD->prev_Qx = Q_bwe_exc;
    move16();
    pop_wmops(); /*push_wmops( "ICD PP TBE/BWE swb_tbe_dec PART A.3" );*/

    pop_wmops(); /*push_wmops( "ICD PP TBE/BWE swb_tbe_dec PART A" );*/

    return;
}
Loading