Commit b1a5077e authored by multrus's avatar multrus
Browse files

[cleanup] accept DFT_STEREO_SPAR_MIXING, DFT_STEREO_SPAR_MIXING_DEBUG, FIX_345_MSAN_ERROR

parent b8937cfb
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -585,11 +585,7 @@ typedef enum

#define STEREO_DFT_RES_BW_MAX                   66                          /*Maximum number of bin for residual signal in each frame (res_cod_band_max == 6 in 48kHz)*/

#ifdef DFT_STEREO_SPAR_MIXING
#define SBA_DIRAC_STEREO_NUM_BANDS              12
#else
#define SBA_DIRAC_STEREO_NUM_BANDS              5
#endif

#define SBA_DIRAC_NRG_SMOOTH_LONG               10
#define SBA_DIRAC_NRG_SMOOTH_SHORT              3
+0 −8
Original line number Diff line number Diff line
@@ -1071,10 +1071,8 @@ ivas_error stereo_dft_dec_create(
    const int32_t element_brate,                                /* i  : element bitrate                     */
    const int32_t output_Fs,                                    /* i  : output sampling rate                */
    const int16_t sba_dirac_stereo_flag                         /* i  : signal stereo output for SBA DirAC  */
#ifdef DFT_STEREO_SPAR_MIXING
    ,
    const int16_t nchan_transport
#endif
);

void stereo_dft_dec_reset(
@@ -1118,13 +1116,11 @@ void stereo_dft_dec(
    float *input_mem,                                           /* i/o: mem of buffer DFT analysis          */
    STEREO_CNG_DEC_HANDLE hStereoCng,                           /* i/o: Stereo CNG data structure           */
    const int16_t sba_dirac_stereo_flag                         /* i  : signal stereo output for SBA DirAC  */
#ifdef DFT_STEREO_SPAR_MIXING
    ,
    ivas_spar_md_dec_state_t *hMdDec,                          /* SPAR MD handle for upmixing */
    int16_t cross_fade_start_offset,                           /* i: SPAR mixer delay compensation */
    int32_t output_Fs,                                          /* i: Fs for delay calculation */
    int16_t nchan_transport            /* i: number of transpor channels */
#endif
);

void stereo_dft_res_ecu(
@@ -3208,10 +3204,8 @@ void ivas_sba_dirac_stereo_dec(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    float output[CPE_CHANNELS][L_FRAME48k],                     /* o  : output synthesis signal                 */
    const int16_t output_frame                                  /* i  : output frame length per channel         */
#ifdef DFT_STEREO_SPAR_MIXING
    ,
    const int16_t mcmasa
#endif
);

void ivas_sba_dirac_stereo_config(
@@ -3220,12 +3214,10 @@ void ivas_sba_dirac_stereo_config(

void ivas_sba_dirac_stereo_smooth_parameters(
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft                       /* i/o: encoder DFT stereo handle               */
#ifdef DFT_STEREO_SPAR_MIXING
    ,
    ivas_spar_md_dec_state_t *hMdDec,                           /* i/o: SPAR MD handle for upmixing */
    int16_t cross_fade_start_offset,                            /* i: SPAR mixer delay compensation */
    int32_t output_Fs                                           /* i: Fs for delay calculation */
#endif
);

void ivas_sba2mc_cldfb(
+0 −5
Original line number Diff line number Diff line
@@ -151,13 +151,8 @@
#define FIX_329_ENABLE_TD_RENDERER_REVERB_MC            /* Eri: Enable reverb for TD renderer for 5.1 and 7.1 with headtracking enabled for IVAS_dec */


#define DFT_STEREO_SPAR_MIXING
#ifdef DFT_STEREO_SPAR_MIXING
#define FIX_345_MSAN_ERROR                           /* FhG: Fix memory sanitizer error in PLC modes */
#define FIX_347_DTX_CRASH                            /* FhG: Fix crash that can happen with DTX */
/*#define DFT_STEREO_SPAR_MIXING_DEBUG*/             /* more debugging output for DFT_STEREO_SPAR_MIXING_DEBUG */
#define DISABLE_RES_CHANNELS_MCT                     /* decode only W and residual for Y when outputting to stereo */
#endif

#define FIX_343_TO_UPPER                                /* VA: issue 343: safeguard for function to_upper() */

+0 −20
Original line number Diff line number Diff line
@@ -449,11 +449,7 @@ ivas_error ivas_core_dec(
         *---------------------------------------------------------------------*/

        /* save synth and output in case of SBA DirAC stereo output as core switching is done outside of core decoder */
#ifdef DFT_STEREO_SPAR_MIXING
        if ( sba_dirac_stereo_flag && st->element_mode != IVAS_CPE_MDCT && !( st->core_brate == SID_2k40 && st->cng_type == FD_CNG ) )
#else
        if ( sba_dirac_stereo_flag && !( st->core_brate == SID_2k40 && st->cng_type == FD_CNG ) )
#endif
        {
            mvr2r( synth[n], hSCE->save_synth, output_frame );
        }
@@ -676,11 +672,7 @@ ivas_error ivas_core_dec(
            }
        }

#ifdef DFT_STEREO_SPAR_MIXING
        if ( sba_dirac_stereo_flag && st->element_mode != IVAS_CPE_MDCT )
#else
        if ( sba_dirac_stereo_flag )
#endif
        {
            /* for SBA DirAC stereo output DFT Stereo core switching and updates are done in ivas_sba_dirac_stereo_dec() as hCPE is not available at this point */
            break;
@@ -695,28 +687,16 @@ ivas_error ivas_core_dec(

        if ( st->element_mode != IVAS_CPE_DFT )
        {
#ifdef DFT_STEREO_SPAR_MIXING
            if ( st->element_mode != IVAS_CPE_MDCT || sba_dirac_stereo_flag )
#else
            if ( st->element_mode != IVAS_CPE_MDCT )
#endif
            {
#ifdef DFT_STEREO_SPAR_MIXING
                ivas_post_proc( hSCE, hCPE, n, synth[n], NULL, output_frame, sba_dirac_stereo_flag );
#else
                ivas_post_proc( hSCE, hCPE, n, synth[n], NULL, output_frame, 0 );
#endif
            }

            /* update OLA buffers - needed for switching to DFT stereo */
#ifdef DFT_STEREO_SPAR_MIXING
            if ( !sba_dirac_stereo_flag )
            {
                stereo_td2dft_update( hCPE, n, output[n], synth[n], hb_synth[n], output_frame );
            }
#else
            stereo_td2dft_update( hCPE, n, output[n], synth[n], hb_synth[n], output_frame );
#endif
        }
        else /* IVAS_CPE_DFT */
        {
+0 −16
Original line number Diff line number Diff line
@@ -361,11 +361,7 @@ ivas_error ivas_cpe_dec(

    if ( hCPE->element_mode != IVAS_CPE_DFT || ( hCPE->nchan_out == 1 && hCPE->hStereoDft->hConfig->res_cod_mode == STEREO_DFT_RES_COD_OFF ) )
    {
#ifdef DFT_STEREO_SPAR_MIXING
        if ( ( error = ivas_core_dec( st_ivas, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB, NULL, st_ivas->sba_dirac_stereo_flag ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_core_dec( st_ivas, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB, NULL, 0 ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -411,10 +407,8 @@ ivas_error ivas_cpe_dec(
        else
        {
            stereo_dft_dec( hCPE->hStereoDft, sts[0], DFT, hCPE->input_mem[1], hCPE->hStereoCng, 0
#ifdef DFT_STEREO_SPAR_MIXING
                            ,
                            0, 0, 0, 0
#endif
            );
        }

@@ -463,9 +457,7 @@ ivas_error ivas_cpe_dec(
    /*----------------------------------------------------------------*
     * Synthesis synchronization between CPE modes
     *----------------------------------------------------------------*/
#ifdef DFT_STEREO_SPAR_MIXING
    if ( !st_ivas->sba_dirac_stereo_flag )
#endif
    {
        synchro_synthesis( ivas_total_brate, hCPE, output, output_frame, 0 );
    }
@@ -684,9 +676,7 @@ ivas_error create_cpe_dec(
    for ( n = 0; n < CPE_CHANNELS; n++ )
    {
        if ( st_ivas->sba_dirac_stereo_flag
#ifdef DFT_STEREO_SPAR_MIXING
             && st_ivas->nchan_transport == 1
#endif
        )
        {
            /* for SBA DirAC stereo output CPE element is only used for upmix, core coder is found in SCE element used for core decoding */
@@ -719,17 +709,11 @@ ivas_error create_cpe_dec(
     * DFT stereo initialization
     *-----------------------------------------------------------------*/

#ifdef DFT_STEREO_SPAR_MIXING
    if ( hCPE->element_mode == IVAS_CPE_DFT || ( st_ivas->sba_dirac_stereo_flag && hCPE->cpe_id == 0 ) )
#else
    if ( hCPE->element_mode == IVAS_CPE_DFT || st_ivas->sba_dirac_stereo_flag )
#endif
    {
        if ( ( error = stereo_dft_dec_create( &( hCPE->hStereoDft ), hCPE->element_brate, output_Fs, st_ivas->sba_dirac_stereo_flag
#ifdef DFT_STEREO_SPAR_MIXING
                                              ,
                                              st_ivas->nchan_transport
#endif
                                              ) ) != IVAS_ERR_OK )
        {
            return error;
Loading