Commit 6a653a4a authored by vaclav's avatar vaclav
Browse files

Merge branch 'Cleaning_of_accepted_switches_from_2022-09-29_call' into 'main'

Cleaning of accepted switches from 2022-09-29 call

See merge request !158
parents 6256d892 b47a17ef
Loading
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -1013,13 +1013,9 @@ enum
#define IVAS_DECORR_PARM_LOOKAHEAD_TAU          2e-3f
#define IVAS_DECORR_PARM_APD_TAU                20e-3f

/* IVAS PCA */
/* IVAS SBA PCA */
#define IVAS_PCA_NB_SUBR                        20 /* 80 -> 0.25 ms, 40 -> 0.5 ms... */
#ifdef SPAR_SCALING_HARMONIZATION
#define IVAS_PCA_COV_THRES                      3e-5f
#else
#define IVAS_PCA_COV_THRES                      1e-9f
#endif
#define IVAS_PCA_QUAT_EPS                       1e-7f
#define IVAS_PCA_QBITS                          19
#define IVAS_PCA_N1                             91
+1 −7
Original line number Diff line number Diff line
@@ -238,11 +238,9 @@ uint32_t ivas_syn_output(
    int16_t *synth_out                                          /* o  : integer 16 bits synthesis signal        */
);

#ifdef FIX_I98_HANDLES_TO_NULL
void ivas_initialize_handles_enc(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);
#endif

ivas_error ivas_init_encoder(
    Encoder_Struct *st_ivas,                                    /* i/o: IVAS encoder structure                  */
@@ -3724,9 +3722,6 @@ void ivas_spar_config(
void ivas_sba_upmixer_renderer(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder struct                     */
    float output[][L_FRAME48k],                                 /* i/o: transport/output audio channels         */
#ifndef SPAR_SCALING_HARMONIZATION
    const int16_t nchan_remapped,                               /* i  : num channels after remapping of TCs     */
#endif
    const int16_t output_frame                                  /* i  : output frame length                     */
);

@@ -5469,8 +5464,7 @@ float rand_triangular_signed(
#ifdef ALIGN_SID_SIZE
void dtx_read_padding_bits(
    DEC_CORE_HANDLE st,
    int16_t num_bits
);
    int16_t num_bits );
#endif

#endif /* IVAS_PROT_H */
+2 −10
Original line number Diff line number Diff line
@@ -141,24 +141,16 @@
#endif
#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 FIX_IVAS_185_MDCT_ST_PLC_FADEOUT*/            /* IVAS-185 fix bug in TCX-PLC fadeout for MDCT-Stereo and improve fadeout by fading to background noise instead of white noise */
/*#define FIX_I1_113*/                                  /* under review : MCT bit distribution optimization for SBA high bitrates*/

#define SPAR_SCALING_HARMONIZATION                      /* Issue 80: Changes to harmonize scaling in spar */
#define FIX_I98_HANDLES_TO_NULL                         /* Issue 98: do the setting of all handles to NULL in one place */
#define FIX_I106_TDREND_5MS                             /* Issue 106: 5 ms update rate in TD object renderer */
#define QUANTISE_REAL_FCN_CLEAN_UP                      /*Clean up the ivas_quantise_real_values() function*/

#define FIX_I74_BW_LIMITATION_ALT                       /* issue 74: Propagate bitrate induced BW limitation to hEncoderConfig. Ensures BE between explicit BW limitation using "-max_band <BW>" and BW limited by bitrate; alternative fix */
#define FIX_I74_CLEANING                                /* issue 74: remove redundant function call in ivas_cpe_enc() */
#define ALIGN_SID_SIZE                                  /* Issue 111: make all DTX modes use one SID frame bitrate (5.2 kbps) */
#define FIX_135_MDCT_STEREO_MODE_UNINITIALIZED          /* Issue 135: fix uninitialized value usage in SBA MDCT-Stereo core with PLC */

#define SPAR_SCALING_HARMONIZATION                      /* issue 80: Changes to harmonize scaling in spar */

#define ALIGN_SID_SIZE                                  /* Issue 111: make all DTX modes use one SID frame bitrate (5.2 kbps) */

#define FIX_135_MDCT_STEREO_MODE_UNINITIALIZED          /* Issue 135: fix uninitialized value usage in SBA MDCT-Stereo core with PLC */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+1 −5
Original line number Diff line number Diff line
@@ -348,11 +348,7 @@ ivas_error ivas_dec(
        }
        else /* SBA_MODE_SPAR */
        {
            ivas_sba_upmixer_renderer( st_ivas, output,
#ifndef SPAR_SCALING_HARMONIZATION
                                       nchan_remapped,
#endif
                                       output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */
            ivas_sba_upmixer_renderer( st_ivas, output, output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */
        }
    }
    else if ( st_ivas->ivas_format == MC_FORMAT )
+13 −81
Original line number Diff line number Diff line
@@ -719,61 +719,6 @@ ivas_error ivas_init_decoder(
        }
    }

#ifndef FIX_I98_HANDLES_TO_NULL
#if 0
    /*-----------------------------------------------------------------*
     * Dummy pointers to decoder handles
     *-----------------------------------------------------------------*/

    for ( i = 0; i < MAX_SCE; i++ )
    {
        st_ivas->hSCE[i] = NULL;
    }

    for ( i = 0; i < MAX_CPE; i++ )
    {
        st_ivas->hCPE[i] = NULL;
    }

    /* ISm metadata handles */
    for ( n = 0; n < MAX_NUM_OBJECTS; n++ )
    {
        st_ivas->hIsmMetaData[n] = NULL;
    }

    /* DirAC handle */
    st_ivas->hDirAC = NULL;
    st_ivas->sba_dirac_stereo_flag = 0;

    /* SPAR handle */
    st_ivas->hSpar = NULL;

    /* MASA decoder structure */
    st_ivas->hMasa = NULL;

    /* Q metadata handle */
    st_ivas->hQMetaData = NULL;

    /* MCT handles */
    st_ivas->hMCT = NULL;
    st_ivas->hParamMC = NULL;

    /* LFE handle */
    st_ivas->hLFE = NULL;

    /* renderers handles */
    st_ivas->hBinRenderer = NULL;       /* fastconf binaural renderer */
    st_ivas->hDiracDecBin = NULL;       /* parametric binaural renderer */
    st_ivas->hLsSetUpConversion = NULL; /* MC converter */
    st_ivas->hEFAPdata = NULL;          /* EFAP handle */
    st_ivas->hVBAPdata = NULL;          /* VBAP handle */
    st_ivas->hIsmRendererData = NULL;   /* ISm renderer */
    st_ivas->hBinRendererTd = NULL;     /* TD ISm binaural renderer */
    st_ivas->hMonoDmxRenderer = NULL;   /* Mono downmix renderer */
    st_ivas->hHrtf = NULL;              /* Crend hrtf data */
    st_ivas->hCrend = NULL;             /* Crend renderer */
#endif
#endif
    /*-----------------------------------------------------------------*
     * Allocate and initalize SCE/CPE and other handles
     *-----------------------------------------------------------------*/
@@ -810,6 +755,7 @@ ivas_error ivas_init_decoder(
        {
            reset_indices_dec( st_ivas->hCPE[cpe_id]->hCoreCoder[n] );
        }

        /* init EFAP for custom LS output and set hTransSetup */
        if ( output_config == AUDIO_CONFIG_LS_CUSTOM )
        {
@@ -856,12 +802,11 @@ ivas_error ivas_init_decoder(
    }
    else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT )
    {
        {

        if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK )
        {
            return error;
        }
        }

        if ( st_ivas->ivas_format == MASA_FORMAT )
        {
@@ -878,6 +823,7 @@ ivas_error ivas_init_decoder(
                {
                    return error;
                }

                if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->hOutSetup.is_loudspeaker_setup )
                {
                    if ( ( error = ivas_sba_get_hoa_dec_matrix( st_ivas->hOutSetup, &st_ivas->hoa_dec_mtx, st_ivas->hIntSetup.ambisonics_order ) ) != IVAS_ERR_OK )
@@ -898,6 +844,7 @@ ivas_error ivas_init_decoder(
                    {
                        return error;
                    }

                    for ( k = 0; k < DIRAC_MAX_NBANDS; k++ )
                    {
                        st_ivas->hSpar->dirac_to_spar_md_bands[k] = st_ivas->hDirAC->dirac_to_spar_md_bands[k];
@@ -962,6 +909,7 @@ ivas_error ivas_init_decoder(
            {
                return error;
            }

            reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] );
        }

@@ -972,7 +920,6 @@ ivas_error ivas_init_decoder(
                return error;
            }


            for ( n = 0; n < CPE_CHANNELS; n++ )
            {
                reset_indices_dec( st_ivas->hCPE[cpe_id]->hCoreCoder[n] );
@@ -1043,7 +990,6 @@ ivas_error ivas_init_decoder(
                    return error;
                }


                for ( n = 0; n < CPE_CHANNELS; n++ )
                {
                    reset_indices_dec( st_ivas->hCPE[cpe_id]->hCoreCoder[n] );
@@ -1065,12 +1011,12 @@ ivas_error ivas_init_decoder(
                    return error;
                }
            }

            if ( ( error = ivas_param_mc_dec_open( st_ivas ) ) != IVAS_ERR_OK )
            {
                return error;
            }


            for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ )
            {
                if ( ( error = create_cpe_dec( st_ivas, cpe_id, ivas_total_brate / ( st_ivas->nSCE + st_ivas->nCPE ) ) ) != IVAS_ERR_OK )
@@ -1078,7 +1024,6 @@ ivas_error ivas_init_decoder(
                    return error;
                }


                for ( n = 0; n < CPE_CHANNELS; n++ )
                {
                    reset_indices_dec( st_ivas->hCPE[cpe_id]->hCoreCoder[n] );
@@ -1107,7 +1052,6 @@ ivas_error ivas_init_decoder(
                return error;
            }


            st_ivas->sba_dirac_stereo_flag = ( st_ivas->nchan_transport == 1 && output_config == AUDIO_CONFIG_STEREO );

            if ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_MCMASA_MONO_STEREO )
@@ -1148,6 +1092,7 @@ ivas_error ivas_init_decoder(
                        return error;
                    }
                }

                reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] );
            }

@@ -1156,6 +1101,7 @@ ivas_error ivas_init_decoder(
                if ( st_ivas->hOutSetup.separateChannelEnabled )
                {
                    st_ivas->element_mode_init = IVAS_CPE_MDCT;

                    if ( ( error = create_cpe_dec( st_ivas, cpe_id, ivas_total_brate - st_ivas->hSCE[0]->element_brate ) ) != IVAS_ERR_OK )
                    {
                        return error;
@@ -1164,11 +1110,13 @@ ivas_error ivas_init_decoder(
                else
                {
                    st_ivas->element_mode_init = IVAS_CPE_MDCT;

                    if ( ( error = create_cpe_dec( st_ivas, cpe_id, ivas_total_brate / ( st_ivas->nSCE + st_ivas->nCPE ) ) ) != IVAS_ERR_OK )
                    {
                        return error;
                    }
                }

                for ( n = 0; n < CPE_CHANNELS; n++ )
                {
                    reset_indices_dec( st_ivas->hCPE[cpe_id]->hCoreCoder[n] );
@@ -1256,6 +1204,7 @@ ivas_error ivas_init_decoder(
        {
            return error;
        }

        if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on )
        {
            if ( ( st_ivas->hCrend = (CREND_HANDLE) count_malloc( sizeof( CREND_DATA ) ) ) == NULL )
@@ -1545,12 +1494,7 @@ void ivas_initialize_handles_dec(
        st_ivas->hCPE[i] = NULL;
    }

#ifdef FIX_I98_HANDLES_TO_NULL
    st_ivas->bit_stream = NULL;
#else
    st_ivas->nSCE = 0;
    st_ivas->nCPE = 0;
#endif
    st_ivas->mem_hp20_out = NULL;
    st_ivas->hLimiter = NULL;

@@ -1561,9 +1505,6 @@ void ivas_initialize_handles_dec(
    }

    /* spatial coding handles */
#ifndef FIX_I98_HANDLES_TO_NULL
    st_ivas->hIsmRendererData = NULL;
#endif
    st_ivas->hDirAC = NULL;
    st_ivas->hSpar = NULL;
    st_ivas->hMasa = NULL;
@@ -1856,7 +1797,6 @@ void ivas_init_dec_get_num_cldfb_instances(
            {
                *numCldfbAnalyses = st_ivas->hSpar->hFbMixer->fb_cfg->num_in_chans;


                if ( st_ivas->hOutSetup.is_loudspeaker_setup && st_ivas->renderer_type == RENDERER_DIRAC )
                {
                    *numCldfbSyntheses = st_ivas->hOutSetup.nchan_out_woLFE;
@@ -2062,17 +2002,9 @@ static ivas_error doSanityChecks_IVAS(
#endif

#ifdef DEBUGGING
#ifdef FIX_I98_HANDLES_TO_NULL
    if ( ( st_ivas->hDecoderConfig->Opt_HRTF_binary || st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || output_config != AUDIO_CONFIG_BINAURAL || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) )
#else
    if ( ( st_ivas->hHrtfTD != NULL || st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || output_config != AUDIO_CONFIG_BINAURAL || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) )
#endif
#else
#ifdef FIX_I98_HANDLES_TO_NULL
    if ( st_ivas->hDecoderConfig->Opt_HRTF_binary && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || output_config != AUDIO_CONFIG_BINAURAL || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) ) )
#else
    if ( st_ivas->hHrtfTD != NULL && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || output_config != AUDIO_CONFIG_BINAURAL || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) ) )
#endif
#endif
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration: Time Domain object renderer not supported in this configuration" );
Loading