Commit c860fc69 authored by vaclav's avatar vaclav
Browse files

accept FIX_1285_RENDER_CONFIG_PTR_COMPARE, FIX_1298_MEMORY_OPT_IVAS_CORE_ENC, SIMPLIFY_IVAS_CORE

parent e8b06066
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -160,9 +160,7 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP               /* FhG: Add error check for unsupported config: split rendering with VoIP mode */
#define FIX_1285_RENDER_CONFIG_PTR_COMPARE              /* Philips: Warning about pointer comparison in the render config reader */
#define FIX_1298_MEMORY_OPT_IVAS_CORE_ENC               /* VA: issue 1298: Memory saving in ivas_core_enc() */
#define SIMPLIFY_IVAS_CORE                              /* VA: simplify ivas core coder functions */


/* #################### End BE switches ################################## */

+4 −7
Original line number Diff line number Diff line
@@ -5909,9 +5909,6 @@ ivas_error core_switching_post_dec(
    float *synth,                        /* i/o: output synthesis                        */
    float *output,                       /* i/o: LB synth/upsampled LB synth             */
    float output_mem[],                  /* i  : OLA memory from last TCX/HQ frame       */
#ifndef SIMPLIFY_IVAS_CORE
    const IVAS_FORMAT ivas_format, /* i  : IVAS format                             */
#endif
    const int16_t use_cldfb_for_dft,     /* i  : flag to use of CLDFB for DFT Stereo     */
    const int16_t output_frame,          /* i  : frame length                            */
    const int16_t core_switching_flag,   /* i  : ACELP->HQ switching frame flag          */
+4 −11
Original line number Diff line number Diff line
@@ -557,9 +557,6 @@ ivas_error core_switching_post_dec(
    float *synth,                        /* i/o: output synthesis                    */
    float *output,                       /* i/o: LB synth/upsampled LB synth         */
    float output_mem[],                  /* i  : OLA memory from last TCX/HQ frame   */
#ifndef SIMPLIFY_IVAS_CORE
    const IVAS_FORMAT ivas_format, /* i  : IVAS format                         */
#endif
    const int16_t use_cldfb_for_dft,     /* i  : flag to use of CLDFB for DFT Stereo */
    const int16_t output_frame,          /* i  : frame length                        */
    const int16_t core_switching_flag,   /* i  : ACELP->HQ switching flag            */
@@ -681,11 +678,7 @@ ivas_error core_switching_post_dec(
                    synth[i + delay_comp] = ( synth[i + delay_comp] * i + ( tmpDelta - i ) * st->previoussynth[i + delay_comp] ) / tmpDelta;
                }

#ifdef SIMPLIFY_IVAS_CORE
                if ( ( st->element_mode == IVAS_CPE_MDCT || ( st->is_ism_format && st->core == TCX_20_CORE /* <- means TCX in general, TCX10 is forbidden after ACELP */ ) ) && st->last_core_brate <= SID_2k40 && st->core_brate > SID_2k40 )
#else
                if ( ( st->element_mode == IVAS_CPE_MDCT || ( ivas_format == ISM_FORMAT && st->core == TCX_20_CORE /* <- means TCX in general, TCX10 is forbidden after ACELP */ ) ) && st->last_core_brate <= SID_2k40 && st->core_brate > SID_2k40 )
#endif
                {
                    /* smooth transitions to avoid pops in car noise items */
                    smoothTransitionDtxToTcx( synth, output_frame, delay_comp );
+0 −4
Original line number Diff line number Diff line
@@ -274,11 +274,7 @@ ivas_error evs_dec(
         * Postprocessing for ACELP/MDCT core switching
         *---------------------------------------------------------------------*/

#ifdef SIMPLIFY_IVAS_CORE
        if ( ( error = core_switching_post_dec( st, synth, NULL, NULL, 0, output_frame, core_switching_flag, 0, -1, EVS_MONO ) ) != IVAS_ERR_OK )
#else
        if ( ( error = core_switching_post_dec( st, synth, NULL, NULL, 0, MONO_FORMAT, output_frame, core_switching_flag, 0, -1, EVS_MONO ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
+0 −48
Original line number Diff line number Diff line
@@ -70,9 +70,7 @@ ivas_error ivas_core_dec(
    Decoder_State **sts, *st;
    STEREO_ICBWE_DEC_HANDLE hStereoICBWE;
    STEREO_TD_DEC_DATA_HANDLE hStereoTD;
#ifdef SIMPLIFY_IVAS_CORE
    STEREO_CNG_DEC_HANDLE hStereoCng;
#endif
    int16_t sharpFlag[CPE_CHANNELS];
    float synth[CPE_CHANNELS][L_FRAME48k];
    float tmp_buffer[L_FRAME48k];
@@ -118,9 +116,7 @@ ivas_error ivas_core_dec(
        last_element_brate = hSCE->last_element_brate; /* note: this parameter is unused */
        last_element_mode = IVAS_SCE;
        hStereoTD = NULL;
#ifdef SIMPLIFY_IVAS_CORE
        hStereoCng = NULL;
#endif
        p_output_mem = NULL;
        nchan_out = 1;
        if ( st_ivas != NULL && st_ivas->ivas_format == ISM_FORMAT )
@@ -139,9 +135,7 @@ ivas_error ivas_core_dec(
        last_element_mode = hCPE->last_element_mode;
        hStereoICBWE = hCPE->hStereoICBWE;
        hStereoTD = hCPE->hStereoTD;
#ifdef SIMPLIFY_IVAS_CORE
        hStereoCng = hCPE->hStereoCng;
#endif
        p_output_mem = hCPE->output_mem[1];
        nchan_out = hCPE->nchan_out;

@@ -235,11 +229,7 @@ ivas_error ivas_core_dec(
    } /* n_channels loop */

    /* MDCT stereo -> DFT stereo switching */
#ifdef SIMPLIFY_IVAS_CORE
    if ( last_element_mode == IVAS_CPE_MDCT && sts[0]->element_mode == IVAS_CPE_DFT )
#else
    if ( hCPE != NULL && hCPE->last_element_mode == IVAS_CPE_MDCT && hCPE->element_mode == IVAS_CPE_DFT )
#endif
    {
        int16_t ovl, fade_len;
        if ( sts[0]->L_frame != sts[0]->last_L_frame )
@@ -256,17 +246,10 @@ ivas_error ivas_core_dec(
        }
    }

#ifdef SIMPLIFY_IVAS_CORE
    if ( hStereoCng != NULL )
    {
        hStereoCng->flag_cna_fade = 0;
    }
#else
    if ( hCPE != NULL && hCPE->hStereoCng != NULL )
    {
        hCPE->hStereoCng->flag_cna_fade = 0;
    }
#endif

    save_hb_synth = NULL;
    if ( sba_dirac_stereo_flag && hSCE && sts[0]->total_brate <= SID_2k40 && sts[0]->cng_type == FD_CNG )
@@ -296,11 +279,7 @@ ivas_error ivas_core_dec(

    if ( hCPE != NULL && hCPE->element_mode == IVAS_CPE_DFT && hCPE->brate_surplus > 0 )
    {
#ifdef SIMPLIFY_IVAS_CORE
        ivas_combined_format_brate_sanity( element_brate, sts[0]->core, sts[0]->total_brate, &( sts[0]->core_brate ), &( sts[0]->inactive_coder_type_flag ), &tmps );
#else
        ivas_combined_format_brate_sanity( hCPE->element_brate, sts[0]->core, sts[0]->total_brate, &( sts[0]->core_brate ), &( sts[0]->inactive_coder_type_flag ), &tmps );
#endif
    }

    /*------------------------------------------------------------------*
@@ -369,11 +348,7 @@ ivas_error ivas_core_dec(
        if ( st->core == ACELP_CORE )
        {
            /* ACELP core decoder */
#ifdef SIMPLIFY_IVAS_CORE
            if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lspQ_PCh, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hStereoCng, read_sid_info ) ) != IVAS_ERR_OK )
#else
            if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lspQ_PCh, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hCPE == NULL ? NULL : hCPE->hStereoCng, read_sid_info ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -445,17 +420,10 @@ ivas_error ivas_core_dec(
     * Stereo CNG updates
     *---------------------------------------------------------------------*/

#ifdef SIMPLIFY_IVAS_CORE
    if ( sts[0]->element_mode == IVAS_CPE_TD && hStereoCng != NULL )
    {
        stereo_cng_compute_PScorr( output, &hStereoCng->c_PS_LT, sts[0]->L_frame, sts[1]->L_frame );
    }
#else
    if ( sts[0]->element_mode == IVAS_CPE_TD && hCPE->hStereoCng != NULL )
    {
        stereo_cng_compute_PScorr( output, &hCPE->hStereoCng->c_PS_LT, sts[0]->L_frame, sts[1]->L_frame );
    }
#endif

    /*---------------------------------------------------------------------*
     * Postprocessing, BWEs and updates
@@ -494,11 +462,7 @@ ivas_error ivas_core_dec(
            mvr2r( synth[n], hSCE->save_synth, output_frame );
        }

#ifdef SIMPLIFY_IVAS_CORE
        if ( ( error = core_switching_post_dec( st, synth[n], output[n], p_output_mem, use_cldfb_for_dft, output_frame, 0 /*core_switching_flag*/, sba_dirac_stereo_flag, nchan_out, last_element_mode ) ) != IVAS_ERR_OK )
#else
        if ( ( error = core_switching_post_dec( st, synth[n], output[n], p_output_mem, ( st_ivas != NULL ) ? st_ivas->ivas_format : UNDEFINED_FORMAT, use_cldfb_for_dft, output_frame, 0 /*core_switching_flag*/, sba_dirac_stereo_flag, nchan_out, ( hCPE != NULL ) ? hCPE->last_element_mode : IVAS_SCE ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -510,11 +474,7 @@ ivas_error ivas_core_dec(
        }

        /* if we transition from inactive to active coding in MDCT-Stereo DTX and the output format is mono DMX, we need to sync the upsampled buffer between channels here */
#ifdef SIMPLIFY_IVAS_CORE
        if ( n == 0 && st->element_mode == IVAS_CPE_MDCT && st->last_core == ACELP_CORE && st->core != ACELP_CORE && ( nchan_out == 1 || last_element_mode == IVAS_CPE_DFT ) )
#else
        if ( n == 0 && st->element_mode == IVAS_CPE_MDCT && st->last_core == ACELP_CORE && st->core != ACELP_CORE && ( nchan_out == 1 || ( hCPE != NULL && hCPE->last_element_mode == IVAS_CPE_DFT ) ) )
#endif
        {
            mvr2r( sts[0]->previoussynth, sts[1]->previoussynth, st->hTcxDec->L_frameTCX );
        }
@@ -689,11 +649,7 @@ ivas_error ivas_core_dec(
                mvr2r( tmp_buffer, st->hb_prev_synth_buffer, tmps );
            }

#ifdef SIMPLIFY_IVAS_CORE
            if ( ( st->element_mode != IVAS_CPE_TD && !use_cldfb_for_dft ) || ( st->element_mode == IVAS_CPE_TD && tdm_LRTD_flag ) )
#else
            if ( ( st->element_mode != IVAS_CPE_TD && !use_cldfb_for_dft ) || ( hCPE->element_mode == IVAS_CPE_TD && tdm_LRTD_flag ) )
#endif
            {
                /* Delay hb_synth */
                delay_signal( hb_synth[n], output_frame, st->hb_prev_synth_buffer, tmps );
@@ -746,11 +702,7 @@ ivas_error ivas_core_dec(
        }
        else /* IVAS_CPE_DFT */
        {
#ifdef SIMPLIFY_IVAS_CORE
            if ( last_element_mode == IVAS_CPE_MDCT )
#else
            if ( hCPE->last_element_mode == IVAS_CPE_MDCT )
#endif
            {
                stereo_mdct2dft_update( hCPE, output[0], synth[0] );
            }
Loading