Commit 46ac1b29 authored by vaclav's avatar vaclav
Browse files

accept LOW_RATE_TRANS

parent 3bc474c0
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -202,14 +202,9 @@ ivas_error pre_proc_front_ivas(
    const int16_t flag_16k_smc,                                 /* i  : flag to indicate if the OL SMC is run at 16 kHz */
    const int16_t front_vad_flag,                               /* i  : front-VAD flag to overwrite VAD decision   */
    const int16_t force_front_vad,                              /* i  : flag to force VAD decision                 */
#ifdef LOW_RATE_TRANS
    const int16_t front_vad_dtx_flag,                           /* i  : front-VAD DTX flag to overwrite VAD decision*/
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                         */
    const int16_t ivas_format                                   /* i  : IVAS format                                */
#else
    const int16_t front_vad_dtx_flag                            /* i  : front-VAD DTX flag to overwrite VAD decision*/
   ,const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                       */    
#endif
);

ivas_error pre_proc_ivas(
@@ -626,13 +621,12 @@ void set_transient_stereo(
    float currFlatness[]                                        /* i/o: current flatness                        */
);

#ifdef LOW_RATE_TRANS
/*! r: preliminary flag to force ACELP */
int16_t transient_analysis(
    TRAN_DET_HANDLE hTranDet,                                   /* i  : handle transient detection             */
    const float cor_map_LT[],                                   /* i  : LT correlation map                     */
    const float multi_harm_limit                                /* i  : multi harminic threshold               */
);
#endif

void ivas_post_proc(
    SCE_DEC_HANDLE hSCE,                                        /* i/o: SCE decoder structure                   */
+0 −1
Original line number Diff line number Diff line
@@ -146,7 +146,6 @@
#define BRATE_SWITCHING_RENDERING                       /* Bitrate switching changes related to the renderers */
#define FIX_I59_DELAY_ROUNDING                          /* Issue 59: rounding in sample domain instead of nanosec for IVAS_ENC_GetDelay() and IVAS_DEC_GetDelay() */
#define FIX_FIX_I59                                     /* Issue 59:  small fix concerning LFE delay rounding */
#define LOW_RATE_TRANS                                  /* Eri: Contribution 20: low rate encoding of transients */
#define MC_BITRATE_SWITCHING                            /* Issue 116: support bitrate switching in MC format  */
#define SIMPLIFY_TD_BWE_RESET                           /* Issue 250: Resolve "TB-BWE state memories reset simplification"  */
#define REMOVE_ETOT_PROPAGATION                         /* Issue 251: Do not propagate Etot parameter */
+5 −16
Original line number Diff line number Diff line
@@ -45,13 +45,12 @@
#include <math.h>


#ifdef LOW_RATE_TRANS
/*---------------------------------------------------------------*
 * Local constants
 *---------------------------------------------------------------*/

#define SCE_SMC_THR 16000
#endif


/*-------------------------------------------------------------------*
 * Local function prototypes
@@ -110,14 +109,9 @@ ivas_error pre_proc_front_ivas(
    const int16_t flag_16k_smc,                                /* i  : flag to indicate if the OL SMC is run at 16 kHz */
    const int16_t front_vad_flag,                              /* i  : front-VAD flag to overwrite VAD decision */
    const int16_t force_front_vad,                             /* i  : flag to force VAD decision               */
#ifdef LOW_RATE_TRANS
    const int16_t front_vad_dtx_flag,                          /* i  : front-VAD DTX flag to overwrite VAD decision*/
    const int32_t ivas_total_brate,                            /* i  : IVAS total bitrate - for setting the DTX */
    const int16_t ivas_format                                  /* i  : IVAS format                              */
#else
    const int16_t front_vad_dtx_flag, /* i  : front-VAD DTX flag to overwrite VAD decision*/
    const int32_t ivas_total_brate    /* i  : IVAS total bitrate - for setting the DTX */
#endif
)
{
    float *inp_12k8, *new_inp_12k8; /* pointers to current frame and new data       */
@@ -844,11 +838,7 @@ ivas_error pre_proc_front_ivas(
    else if ( element_mode != IVAS_CPE_MDCT )
    {
        /* SNR-based speech/music classification */
#ifdef LOW_RATE_TRANS
        if ( ( element_mode >= IVAS_CPE_DFT && element_brate >= IVAS_24k4 ) || ( element_mode == IVAS_SCE && element_brate >= SCE_SMC_THR ) )
#else
        if ( ( element_mode >= IVAS_CPE_DFT && element_brate >= IVAS_24k4 ) || ( element_mode == IVAS_SCE && element_brate >= 16000 ) )
#endif
        {
            if ( flag_16k_smc )
            {
@@ -866,7 +856,6 @@ ivas_error pre_proc_front_ivas(
                smc_dec = ivas_acelp_tcx20_switching( st, inp_12k8, wsp, non_staX, pitch_fr, voicing_fr, currFlatness, lsp_mid, stab_fac, res_cod_SNR_M, flag_16k_smc );
            }
        }
#ifdef LOW_RATE_TRANS
        /* Switch to ACELP for non-harmonic transient signals */
        else if ( ( ( ivas_format == STEREO_FORMAT && element_brate <= IVAS_16k4 ) || ( ivas_format == ISM_FORMAT && element_brate < SCE_SMC_THR ) ) && ( loc_harm[0] != 1 ) && smc_dec == MUSIC )
        {
@@ -888,7 +877,7 @@ ivas_error pre_proc_front_ivas(
                }
            }
        }
#endif

        /* 2nd stage speech/music classification (ACELP/GSC/TCX core selection) */
#ifdef REMOVE_ETOT_PROPAGATION
        ivas_smc_mode_selection( st, element_brate, smc_dec, *relE, Etot, attack_flag, inp_12k8, S_map, flag_spitch );
+0 −7
Original line number Diff line number Diff line
@@ -435,7 +435,6 @@ ivas_error ivas_cpe_enc(

    for ( n = 0; n < n_CoreChannels; n++ )
    {
#ifdef LOW_RATE_TRANS
        error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n],
#ifndef REMOVE_ETOT_PROPAGATION
                                     &Etot[n],
@@ -444,12 +443,6 @@ ivas_error ivas_cpe_enc(
                                     &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n],
                                     fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0,
                                     ivas_total_brate, st_ivas->hEncoderConfig->ivas_format );
#else
        error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], &Etot[n], &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n],
                                     &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n],
                                     fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0,
                                     ivas_total_brate );
#endif
        if ( error != IVAS_ERR_OK )
        {
            return error;
+0 −11
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@ ivas_error ivas_ism_enc(
         * Front Pre-processing
         *----------------------------------------------------------------*/

#ifdef LOW_RATE_TRANS
        error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0],
#ifndef REMOVE_ETOT_PROPAGATION
                                     &Etot[sce_id][0],
@@ -158,16 +157,6 @@ ivas_error ivas_ism_enc(
                                     &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0],
                                     fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0,
                                     st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->hEncoderConfig->ivas_format );
#else
        error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0],
#ifndef REMOVE_ETOT_PROPAGATION
                                     &Etot[sce_id][0],
#endif
                                     &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0],
                                     &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0],
                                     fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0,
                                     st_ivas->hEncoderConfig->ivas_total_brate );
#endif
        if ( error != IVAS_ERR_OK )
        {
            return error;
Loading