Commit fe6ab025 authored by norvell's avatar norvell
Browse files

Merge branch 'main' into 335-coverage-analysis-done-using-forced-encoder-and-decoder-modes

parents 28c2e436 763365de
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ int32_t get_delay(
    const int32_t io_fs,              /* i  : input/output sampling frequency     */
    const IVAS_FORMAT ivas_format,    /* i  : IVAS format                         */
    HANDLE_CLDFB_FILTER_BANK hCldfb,  /* i  : Handle of Cldfb analysis            */
    const int32_t binaural_latency_ns /* i  : binauralization delay in ns         */
    const int32_t binaural_latency_ns /* i  : binaural renderer HRTF delay in ns  */
)
{
    int32_t delay = 0;
+6 −0
Original line number Diff line number Diff line
@@ -570,7 +570,13 @@ typedef enum
#define NO_SYMB_GR_PRED_G                       8

#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

+22 −1
Original line number Diff line number Diff line
@@ -1059,6 +1059,10 @@ 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(
@@ -1102,6 +1106,13 @@ 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(
@@ -3201,6 +3212,10 @@ 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(
@@ -3209,6 +3224,12 @@ 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
);

ivas_error ivas_sba_get_hoa_dec_matrix(
+7 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@
#define DISABLE_ADAP_RES_COD_TMP                        /* temporary fix for IVAS-403, disables adaptive residual coding */
/*#define ITD_WINNER_GAIN_MODIFY */                     /* ITD optimization - WORK IN PROGRESS */
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */

#define SBA_BR_SWITCHING                                /* Issue 114: Changes for SBA bit rate switching with reconfiguration for bitrates with same number of transport channels*/
#ifdef SBA_BR_SWITCHING
#define SBA_BR_SWITCHING_RECONFIG                       /* Issue 114: Changes for SBA bitrate switching with reconfiguration for bitrates with different number of transport channels*/
@@ -159,6 +160,12 @@
#define FIX_310_TD_REND_DELAY                           /* Adding HRTF delay being read from ROM/Binary file, fix rounding for delay compensation in renderer */
#define FIX_334_DEBUG_BE_STEREO_SWITCHING               /* FhG: Fix non-BE issue for stereo switching when DEBUGGING is enabled */

#define DFT_STEREO_SPAR_MIXING
#ifdef DFT_STEREO_SPAR_MIXING 
/*#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

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+23 −0
Original line number Diff line number Diff line
@@ -441,7 +441,11 @@ 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 );
        }
@@ -660,7 +664,11 @@ 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;
@@ -675,13 +683,28 @@ 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 */
        {
Loading