Commit 12bb57e4 authored by multrus's avatar multrus
Browse files

[cleanup] accept REUSE_EVS_BE_GAINQ, REUSE_EVS_BE_GAINQ_LBR

parent 2e2e8c72
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -78,10 +78,8 @@



#define REUSE_EVS_BE_GAINQ          
#define REUSE_EVS_BE_ACELP_PITCH
#define REUSE_EVS_BE_ACELP_PITCH_PIT_Q
#define REUSE_EVS_BE_GAINQ_LBR   // BE by adding one condition, but could be harmonized in a non-BE way. There is a small difference in how Etot is computed


#define FIX_1844_MISSING_FREE                   /* FhG: add missing free in ivas_binRenderer_convModuleClose_fx() */
+0 −13
Original line number Diff line number Diff line
@@ -669,18 +669,6 @@ static void encod_gen_voic_core_switch_ivas_fx(
    /*-----------------------------------------------------------------*
     * Gain encoding
     *-----------------------------------------------------------------*/
#ifndef REUSE_EVS_BE_GAINQ
    IF( EQ_16( L_frame, L_FRAME ) )
    {
        gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame, 0, -1, xn, y1, shift_wsp, y2, code, st_fx->old_Es_pred_fx,
                                &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain );
    }
    ELSE
    {
        gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame, 0, -1, xn, y1, shift_wsp, y2, code, st_fx->old_Es_pred_fx,
                                &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain );
    }
#else
    IF( EQ_16( L_frame, L_FRAME ) )
    {
        gain_enc_mless_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame, 0, -1, xn, y1, shift_wsp, y2, code, st_fx->old_Es_pred_fx,
@@ -691,7 +679,6 @@ static void encod_gen_voic_core_switch_ivas_fx(
        gain_enc_mless_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame, 0, -1, xn, y1, shift_wsp, y2, code, st_fx->old_Es_pred_fx,
                           &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain );
    }
#endif
    gp_clip_test_gain_pit_fx( st_fx->element_mode, core_bitrate, gain_pit, st_fx->clip_var_fx );

    Lgcode = L_shl( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/
+0 −27
Original line number Diff line number Diff line
@@ -313,10 +313,8 @@ void encod_gen_voic_fx(
        {
            gain_enc_lbr_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->coder_type, i_subfr_fx, xn_fx, y1_fx, shift_wsp, y2_fx, code_fx,
                             &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, gc_mem, gp_mem, clip_gain_fx, L_SUBFR
#ifdef REUSE_EVS_BE_GAINQ_LBR
                             ,
                             st_fx->element_mode
#endif
            );
        }
        ELSE IF( GT_32( st_fx->core_brate, ACELP_32k ) )
@@ -692,37 +690,13 @@ void encod_gen_voic_ivas_fx(
        /*-----------------------------------------------------------------*
         * Gain encoding
         *-----------------------------------------------------------------*/
#ifndef REUSE_EVS_BE_GAINQ
        IF( LE_32( st_fx->core_brate, ACELP_8k00 ) )
        {
            gain_enc_lbr_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->coder_type, i_subfr_fx, xn_fx, y1_fx, shift_wsp, y2_fx, code_fx,
                                  &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, gc_mem, gp_mem, clip_gain_fx, L_SUBFR );
        }
        ELSE IF( GT_32( st_fx->core_brate, ACELP_32k ) )
        {
            gain_enc_SQ_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr_fx, xn_fx, y1_fx, y2_fx, code_fx, Es_pred_fx,
                                 &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, clip_gain_fx, shift_wsp );
        }
        ELSE
        {
            gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame, i_subfr_fx, -1, xn_fx, y1_fx, shift_wsp, y2_fx, code_fx, Es_pred_fx,
                                    &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, clip_gain_fx );
        }
#else
        IF( LE_32( st_fx->core_brate, ACELP_8k00 ) )
        {
#ifndef REUSE_EVS_BE_GAINQ_LBR
            gain_enc_lbr_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->coder_type, i_subfr_fx, xn_fx, y1_fx, shift_wsp, y2_fx, code_fx,
                                  &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, gc_mem, gp_mem, clip_gain_fx, L_SUBFR );
#else
            gain_enc_lbr_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->coder_type, i_subfr_fx, xn_fx, y1_fx, shift_wsp, y2_fx, code_fx,
                             &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, gc_mem, gp_mem, clip_gain_fx, L_SUBFR
#ifdef REUSE_EVS_BE_GAINQ_LBR
                             ,
                             st_fx->element_mode
#endif
            );
#endif
        }
        ELSE IF( GT_32( st_fx->core_brate, ACELP_32k ) )
        {
@@ -734,7 +708,6 @@ void encod_gen_voic_ivas_fx(
            gain_enc_mless_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame, i_subfr_fx, -1, xn_fx, y1_fx, shift_wsp, y2_fx, code_fx, Es_pred_fx,
                               &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, clip_gain_fx );
        }
#endif
        IF( st_fx->Opt_SC_VBR )
        {
            if ( EQ_16( hSC_VBR->last_ppp_mode, 1 ) )
+0 −13
Original line number Diff line number Diff line
@@ -334,10 +334,8 @@ void enc_pit_exc_fx(
             *-----------------------------------------------------------------*/

            gain_enc_lbr_fx( st_fx->hBstr, st_fx->acelp_cfg.gains_mode, GENERIC, i_subfr, xn, y1, shift_wsp, y2, code, &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, gc_mem, gp_mem, clip_gain, 2 * L_SUBFR
#ifdef REUSE_EVS_BE_GAINQ_LBR
                             ,
                             st_fx->element_mode
#endif
            );
        }
        ELSE
@@ -820,16 +818,10 @@ void enc_pit_exc_ivas_fx(
             * Gain encoding
             *-----------------------------------------------------------------*/

#ifndef REUSE_EVS_BE_GAINQ_LBR
            gain_enc_lbr_ivas_fx( st_fx->hBstr, st_fx->acelp_cfg.gains_mode, GENERIC, i_subfr, xn, y1, sub( shift_wsp, 1 ), y2, code, &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, gc_mem, gp_mem, clip_gain, 2 * L_SUBFR );
#else
            gain_enc_lbr_fx( st_fx->hBstr, st_fx->acelp_cfg.gains_mode, GENERIC, i_subfr, xn, y1, sub( shift_wsp, 1 ), y2, code, &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, gc_mem, gp_mem, clip_gain, 2 * L_SUBFR
#ifdef REUSE_EVS_BE_GAINQ_LBR
                             ,
                             st_fx->element_mode
#endif
            );
#endif
        }
        ELSE
        {
@@ -842,13 +834,8 @@ void enc_pit_exc_ivas_fx(
            /*-----------------------------------------------------------------*
             * Gain encoding
             *-----------------------------------------------------------------*/
#ifndef REUSE_EVS_BE_GAINQ
            gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, st_fx->L_frame, i_subfr, -1, xn, y1, sub( shift_wsp, 1 ), y2, code, Es_pred,
                                    &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain );
#else
            gain_enc_mless_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, st_fx->L_frame, i_subfr, -1, xn, y1, sub( shift_wsp, 1 ), y2, code, Es_pred,
                               &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain );
#endif
        }
        gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit, st_fx->clip_var_fx );

+0 −24
Original line number Diff line number Diff line
@@ -587,29 +587,6 @@ Word16 encod_tran_ivas_fx(
         * Test quantized gain of pitch for pitch clipping algorithm
         * Update tilt of code: 0.0 (unvoiced) to 0.5 (voiced)
         *-----------------------------------------------------------------*/
#ifndef REUSE_EVS_BE_GAINQ
        IF( Jopt_flag == 0 )
        {
            /* SQ gain_code */
            gain_enc_tc_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr, xn, y2, code, Es_pred_fx,
                                 &gain_pit, &gain_code, &gain_inov, &norm_gain_code, shift_wsp );
        }
        ELSE
        {
            IF( GT_32( st_fx->core_brate, ACELP_32k ) )
            {
                /* SQ gain_pit and gain_code */
                gain_enc_SQ_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr, xn, y1, y2, code, Es_pred_fx,
                                     &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain, shift_wsp );
            }
            ELSE
            {
                /* VQ gain_pit and gain_code */
                gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame_fx, i_subfr, tc_subfr, xn, y1, shift_wsp, y2, code, Es_pred_fx,
                                        &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain );
            }
        }
#else
        IF( Jopt_flag == 0 )
        {
            /* SQ gain_code */
@@ -631,7 +608,6 @@ Word16 encod_tran_ivas_fx(
                                   &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain );
            }
        }
#endif
        gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit, st_fx->clip_var_fx );

        Lgcode = L_shl_o( gain_code, Q_new, &Overflow ); /* scaled gain_code with Qnew -> Q16*/
Loading