From bb107b99c6d554776268e77a13b9569699f21377 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 29 Sep 2022 14:43:59 +0200 Subject: [PATCH 1/2] Clean out accepted switches --- lib_com/ivas_cnst.h | 6 +- lib_com/ivas_prot.h | 8 +-- lib_com/options.h | 12 +--- lib_dec/ivas_dec.c | 6 +- lib_dec/ivas_init_dec.c | 94 ++++--------------------- lib_dec/ivas_sba_rendering.c | 48 +------------ lib_dec/lib_dec.c | 38 ---------- lib_enc/ivas_agc_enc.c | 20 ------ lib_enc/ivas_cpe_enc.c | 8 --- lib_enc/ivas_init_enc.c | 61 +--------------- lib_enc/ivas_spar_encoder.c | 30 ++------ lib_enc/lib_enc.c | 133 ++--------------------------------- 12 files changed, 35 insertions(+), 429 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 2df702fade..2db2a46511 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -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 diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 6996e4a298..10516239c9 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -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 */ diff --git a/lib_com/options.h b/lib_com/options.h index 1db9d4c2cf..7f07d86a9c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 " 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 */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index ff6df585ef..7d54047014 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -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 ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index d0f4e7ceb1..5b42032201 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -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,11 +802,10 @@ 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 ) { - if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) - { - return error; - } + 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" ); diff --git a/lib_dec/ivas_sba_rendering.c b/lib_dec/ivas_sba_rendering.c index 49f3555c6f..92e50de535 100644 --- a/lib_dec/ivas_sba_rendering.c +++ b/lib_dec/ivas_sba_rendering.c @@ -205,49 +205,16 @@ static void ivas_sba_mtx_mult( 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 */ + const int16_t output_frame /* i : output frame length */ ) { -#ifdef SPAR_SCALING_HARMONIZATION - int16_t i; -#else - int16_t i, ch, nchan_out; -#endif + int16_t i, nchan_internal; float temp; - int16_t nchan_internal; wmops_sub_start( "ivas_sba_upmixer_renderer" ); nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order ); -#ifndef SPAR_SCALING_HARMONIZATION - nchan_out = st_ivas->hDecoderConfig->nchan_out; -#endif -#ifndef SPAR_SCALING_HARMONIZATION - for ( ch = 0; ch < nchan_remapped; ch++ ) - { - for ( i = 0; i < output_frame; i++ ) - { - temp = output[ch][i]; - temp = floorf( temp + 0.5f ); - - if ( temp > MAX16B_FLT ) - { - temp = MAX16B_FLT; - } - else if ( temp < ( -1.0f * PCM16_TO_FLT_FAC ) ) - { - temp = ( -1.0f * PCM16_TO_FLT_FAC ); - } - temp *= ( 1.0f / PCM16_TO_FLT_FAC ); - output[ch][i] = temp; - } - } -#endif - if ( st_ivas->nchan_transport >= 3 ) { /*convert WYZX downmix to WYXZ*/ @@ -267,17 +234,6 @@ void ivas_sba_upmixer_renderer( ivas_sba_linear_renderer( output, output_frame, st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hDecoderConfig->output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ); } -#ifndef SPAR_SCALING_HARMONIZATION - for ( ch = 0; ch < nchan_out; ch++ ) - { - for ( i = 0; i < output_frame; i++ ) - { - output[ch][i] = output[ch][i] * PCM16_TO_FLT_FAC; - } - } -#endif - - wmops_sub_end(); return; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 52e54a5663..fa2bb2b763 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -250,50 +250,14 @@ void IVAS_DEC_Close( if ( ( *phIvasDec )->hVoIP ) { IVAS_DEC_Close_VoIP( ( *phIvasDec )->hVoIP ); -#ifdef FIX_I98_HANDLES_TO_NULL ( *phIvasDec )->hVoIP = NULL; -#else - count_free( ( *phIvasDec )->hVoIP ); -#endif } -#ifdef FIX_I98_HANDLES_TO_NULL if ( ( *phIvasDec )->st_ivas ) { ivas_destroy_dec( ( *phIvasDec )->st_ivas ); ( *phIvasDec )->st_ivas = NULL; } -#else - if ( ( *phIvasDec )->isInitialized ) - { - if ( ( *phIvasDec )->st_ivas ) - { - ivas_destroy_dec( ( *phIvasDec )->st_ivas ); - } - } - else - { - if ( ( *phIvasDec )->st_ivas->hDecoderConfig != NULL ) - { - count_free( ( *phIvasDec )->st_ivas->hDecoderConfig ); - ( *phIvasDec )->st_ivas->hDecoderConfig = NULL; - } - - - if ( ( *phIvasDec )->st_ivas->hHeadTrackData != NULL ) - { - count_free( ( *phIvasDec )->st_ivas->hHeadTrackData ); - ( *phIvasDec )->st_ivas->hHeadTrackData = NULL; - } - - ivas_render_config_close( &( ( *phIvasDec )->st_ivas->hRenderConfig ) ); - - ivas_HRTF_binary_close( &( *phIvasDec )->st_ivas->hHrtfTD ); - count_free( ( *phIvasDec )->st_ivas ); - } - - ( *phIvasDec )->st_ivas = NULL; -#endif count_free( *phIvasDec ); *phIvasDec = NULL; @@ -1504,9 +1468,7 @@ static void IVAS_DEC_Close_VoIP( pcmdsp_fifo_destroy( &hVoIP->hFifoAfterTimeScaler ); -#ifdef FIX_I98_HANDLES_TO_NULL count_free( hVoIP ); -#endif return; } diff --git a/lib_enc/ivas_agc_enc.c b/lib_enc/ivas_agc_enc.c index c3c68efc72..3ed7bb6d2f 100644 --- a/lib_enc/ivas_agc_enc.c +++ b/lib_enc/ivas_agc_enc.c @@ -242,11 +242,7 @@ void ivas_agc_enc_process( if ( !isClipped ) { -#ifdef SPAR_SCALING_HARMONIZATION if ( ( ppPcm_out[i][j] > ( 1.f - pState->minDelta ) * PCM16_TO_FLT_FAC ) || ( ppPcm_out[i][j] < MIN16B_FLT ) ) -#else - if ( ( ppPcm_out[i][j] > ( 1.f - pState->minDelta ) ) || ( ppPcm_out[i][j] < -1.f ) ) -#endif { if ( j < offset ) { @@ -282,11 +278,7 @@ void ivas_agc_enc_process( maxGain = max( smoothedMaxAbsVal, MaxAbsVal ) * pState->gain_state[i].lastGain * 2.f; -#ifdef SPAR_SCALING_HARMONIZATION if ( maxGain < ( 1.f - pState->minDelta ) * PCM16_TO_FLT_FAC ) -#else - if ( maxGain < 1.f - pState->minDelta ) -#endif { pState->gain_state[i].gainExpVal = -1; } @@ -321,11 +313,7 @@ void ivas_agc_enc_process( { int16_t isCompensated = FALSE; pState->gain_data[i].gainException = FALSE; -#ifdef SPAR_SCALING_HARMONIZATION pState->gain_state[i].gainExpVal = (int16_t) ceilf( -logf( actualMaxAbsVal * MDFT_NORM_SCALING ) / logf( pState->agc_com.winFunc[MaxAbsValIdx] ) ); -#else - pState->gain_state[i].gainExpVal = (int16_t) ceilf( -logf( actualMaxAbsVal ) / logf( pState->agc_com.winFunc[MaxAbsValIdx] ) ); -#endif while ( !isCompensated ) { @@ -336,11 +324,7 @@ void ivas_agc_enc_process( { tmpSignal = ppPcm_out[i][idx] * powf( pState->agc_com.winFunc[idx], (float) pState->gain_state[i].gainExpVal ); -#ifdef SPAR_SCALING_HARMONIZATION if ( ( tmpSignal > ( 1.f - pState->minDelta ) * PCM16_TO_FLT_FAC ) || ( tmpSignal < MIN16B_FLT ) ) -#else - if ( ( tmpSignal > ( 1.f - pState->minDelta ) ) || ( tmpSignal < -1.f ) ) -#endif { isCompensated = FALSE; break; @@ -390,11 +374,7 @@ void ivas_agc_enc_process( } else { -#ifdef SPAR_SCALING_HARMONIZATION pState->gain_state[i].gainExpVal = (int16_t) ( -floorf( -logf( ( actualMaxAbsVal + pState->minDelta ) * MDFT_NORM_SCALING ) * INV_LOG_2 ) ); -#else - pState->gain_state[i].gainExpVal = (int16_t) ( -floorf( -logf( actualMaxAbsVal + pState->minDelta ) * INV_LOG_2 ) ); -#endif pState->gain_state[i].gainExpVal = min( gainExpValMaxRange, pState->gain_state[i].gainExpVal ); gain = powf( 2.0f, -1.0f * pState->gain_state[i].gainExpVal ); diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index df94fe44ab..96b5ba8777 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -344,14 +344,6 @@ ivas_error ivas_cpe_enc( sts[0]->total_brate = ( sts[0]->bits_frame_nominal + 10 ) * FRAMES_PER_SEC; /* add small overhead; st[0]->total_brate used in coder_type_modif() */ -#ifndef FIX_I74_CLEANING - if ( ( sts[0]->last_bwidth < max_bwidth ) || ( sts[0]->last_core_brate <= SID_2k40 ) ) /* IVAS_fmToDo: TBV - BWD output is not known here yet !!! */ - { - /* reconfigure in case of BW switching or if last frame was a SID/NO_DATA with coarse partitioning */ - hCPE->hStereoDft->nbands = stereo_dft_band_config( hCPE->hStereoDft->band_limits, hCPE->hStereoDft->hConfig->band_res, hCPE->hStereoDft->NFFT, ENC ); - } -#endif - /* Update DFT Stereo memories */ stereo_dft_enc_update( hCPE->hStereoDft, sts[0]->max_bwidth #ifdef DEBUG_MODE_DFT diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 8d9f7e445e..e4db2ce2a1 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -238,7 +238,6 @@ void copy_encoder_config( } -#ifdef FIX_I98_HANDLES_TO_NULL /*------------------------------------------------------------------------- * ivas_initialize_handles_enc() * @@ -298,7 +297,6 @@ void ivas_initialize_handles_enc( return; } -#endif /*-------------------------------------------------------------------* @@ -339,58 +337,7 @@ ivas_error ivas_init_encoder( st_ivas->mc_mode = MC_MODE_NONE; st_ivas->sba_mode = SBA_MODE_NONE; -#ifdef FIX_I98_HANDLES_TO_NULL st_ivas->nchan_transport = -1; -#else - /*-----------------------------------------------------------------* - * Dummy pointers to max. number of SCEs and CPEs - *-----------------------------------------------------------------*/ - - st_ivas->nchan_transport = -1; - - 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; - } - - /* Q Metadata handle */ - st_ivas->hQMetaData = NULL; - - /* DirAC handle */ - st_ivas->hDirAC = NULL; - - /* SPAR handle */ - st_ivas->hSpar = NULL; - - /* MASA encoder handle */ - st_ivas->hMasa = NULL; - - /* MCT handle */ - st_ivas->hMCT = NULL; - - /* Parametric MC handle */ - st_ivas->hParamMC = NULL; - - /* Multi-channel MASA handle */ - st_ivas->hMcMasa = NULL; - - /* Stereo downmix for EVS encoder handle */ - st_ivas->hStereoDmxEVS = NULL; - - /* LFE handle */ - st_ivas->hLFE = NULL; -#endif /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles @@ -480,11 +427,9 @@ ivas_error ivas_init_encoder( } else if ( ivas_format == SBA_FORMAT || ivas_format == MASA_FORMAT ) { + if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) { - if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } if ( ivas_format == SBA_FORMAT ) @@ -651,6 +596,7 @@ ivas_error ivas_init_encoder( else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { ivas_mcmasa_setNumTransportChannels( &( st_ivas->nchan_transport ), &( hEncoderConfig->element_mode_init ), ivas_total_brate ); + if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) { return error; @@ -1054,4 +1000,3 @@ void ivas_destroy_enc( return; } - diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 46e957a3f1..a0fa6d4b4a 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -278,9 +278,6 @@ ivas_error ivas_spar_enc( ) { ENCODER_CONFIG_HANDLE hEncoderConfig; -#ifndef SPAR_SCALING_HARMONIZATION - int16_t ch; -#endif ivas_error error; error = IVAS_ERR_OK; @@ -292,14 +289,6 @@ ivas_error ivas_spar_enc( return error; } -#ifndef SPAR_SCALING_HARMONIZATION - /* normalize input channels */ - for ( ch = 0; ch < hEncoderConfig->nchan_inp; ch++ ) - { - v_multc( data_f[ch], MDFT_NORM_SCALING, data_f[ch], input_frame ); - } -#endif - if ( hEncoderConfig->sba_planar ) { ivas_sba_zero_vert_comp( data_f, st_ivas->sba_analysis_order, hEncoderConfig->sba_planar, input_frame ); @@ -880,20 +869,13 @@ static ivas_error ivas_spar_enc_process( order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order]; - for ( i = 0; i < input_frame; i++ ) + for ( j = 0; j < nchan_transport; j++ ) { - for ( j = 0; j < nchan_transport; j++ ) - { -#ifndef SPAR_SCALING_HARMONIZATION - data_f[order[j]][i] = p_pcm_tmp[j][i] * PCM16_TO_FLT_FAC; -#else - data_f[order[j]][i] = p_pcm_tmp[j][i]; -#endif - } - for ( ; j < IVAS_SPAR_MAX_DMX_CHS; j++ ) - { - data_f[order[j]][i] = 0; - } + mvr2r( p_pcm_tmp[j], data_f[order[j]], input_frame ); + } + for ( ; j < IVAS_SPAR_MAX_DMX_CHS; j++ ) + { + set_f( data_f[order[j]], 0.0f, input_frame ); } wmops_sub_end(); diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index ef5c621fec..0525c7c1db 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -62,10 +62,8 @@ struct IVAS_ENC int16_t Opt_RF_ON_loc; int16_t rf_fec_offset_loc; bool ismMetadataProvided[MAX_NUM_OBJECTS]; - bool maxBandwidthUser; /* Was a specific max bandwith selected by the user? */ -#ifdef FIX_I74_BW_LIMITATION_ALT - IVAS_ENC_BANDWIDTH newBandwidthApi; /* maximum encoded bandwidth, as set on API level */ -#endif + bool maxBandwidthUser; /* Was a specific max bandwith selected by the user? */ + IVAS_ENC_BANDWIDTH newBandwidthApi; /* maximum encoded bandwidth, as set on API level */ }; /*---------------------------------------------------------------------* @@ -79,9 +77,6 @@ static ivas_error setChannelAwareConfig( IVAS_ENC_HANDLE hIvasEnc, const IVAS_EN static int16_t getInputBufferSize( const Encoder_Struct *st_ivas ); static ivas_error doCommonConfigureChecks( IVAS_ENC_HANDLE hIvasEnc ); static ivas_error doCommonSetterChecks( IVAS_ENC_HANDLE hIvasEnc ); -#ifndef FIX_I74_BW_LIMITATION_ALT -static void updateBandwidthFromFs( const ENCODER_CONFIG_HANDLE hEncoderConfig ); -#endif static ivas_error sanitizeBandwidth( const IVAS_ENC_HANDLE hIvasEnc ); static void init_encoder_config( ENCODER_CONFIG_HANDLE hEncoderConfig ); static void resetIsmMetadataProvidedFlags( IVAS_ENC_HANDLE hIvasEnc ); @@ -177,14 +172,8 @@ ivas_error IVAS_ENC_Open( /* initialize encoder Config. handle */ init_encoder_config( st_ivas->hEncoderConfig ); -#ifdef FIX_I98_HANDLES_TO_NULL /* initialize pointers to handles to NULL */ ivas_initialize_handles_enc( st_ivas ); -#else - st_ivas->hEncoderConfig->ivas_total_brate = ACELP_12k65; - st_ivas->hEncoderConfig->Opt_SC_VBR = 0; - st_ivas->hEncoderConfig->last_Opt_SC_VBR = 0; -#endif /* set high-level parameters */ st_ivas->mc_mode = MC_MODE_NONE; @@ -836,10 +825,6 @@ static ivas_error configureEncoder( hEncoderConfig->input_Fs = inputFs; -#ifndef FIX_I74_BW_LIMITATION_ALT - updateBandwidthFromFs( hEncoderConfig ); -#endif - /*-----------------------------------------------------------------* * Channel-aware mode *-----------------------------------------------------------------*/ @@ -904,12 +889,10 @@ static ivas_error configureEncoder( return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "PCA supported at SBA FOA 256 kbps only." ); } -#ifdef FIX_I74_BW_LIMITATION_ALT if ( ( error = sanitizeBandwidth( hIvasEnc ) ) != IVAS_ERR_OK ) { return error; } -#endif /*-----------------------------------------------------------------* * Finalize initialization @@ -963,7 +946,7 @@ ivas_error IVAS_ENC_GetDelay( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - *delay = NS2SA( hEncoderConfig->input_Fs, ( int32_t )( get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) + 0.5f ) ); + *delay = NS2SA( hEncoderConfig->input_Fs, (int32_t) ( get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) + 0.5f ) ); *delay *= hEncoderConfig->nchan_inp; @@ -981,7 +964,7 @@ static int16_t getInputBufferSize( const Encoder_Struct *st_ivas /* i : IVAS encoder handle */ ) { - return ( int16_t )( st_ivas->hEncoderConfig->input_Fs * st_ivas->hEncoderConfig->nchan_inp / FRAMES_PER_SEC ); + return (int16_t) ( st_ivas->hEncoderConfig->input_Fs * st_ivas->hEncoderConfig->nchan_inp / FRAMES_PER_SEC ); } @@ -1048,12 +1031,10 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( return IVAS_ERR_INVALID_INPUT_BUFFER_SIZE; } -#ifdef FIX_I74_BW_LIMITATION_ALT if ( ( error = sanitizeBandwidth( hIvasEnc ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( hEncoderConfig->ivas_format == ISM_FORMAT ) { @@ -1427,12 +1408,8 @@ static ivas_error printConfigInfo_enc( { Encoder_Struct *st_ivas; ENCODER_CONFIG_HANDLE hEncoderConfig; -#ifndef FIX_I74_BW_LIMITATION_ALT - char max_bwidth_string[4]; -#else int16_t newBandwidthApi; ivas_error error; -#endif st_ivas = hIvasEnc->st_ivas; hEncoderConfig = st_ivas->hEncoderConfig; @@ -1573,44 +1550,18 @@ static ivas_error printConfigInfo_enc( * Print potential limitation of audio bandwidth *-----------------------------------------------------------------*/ -#ifdef FIX_I74_BW_LIMITATION_ALT if ( ( error = bandwidthApiToInternal( hIvasEnc->newBandwidthApi, &newBandwidthApi ) ) != IVAS_ERR_OK ) { return error; } -#else - switch ( hEncoderConfig->max_bwidth ) - { - case NB: - strncpy( max_bwidth_string, "NB\0", sizeof( max_bwidth_string ) ); - break; - case WB: - strncpy( max_bwidth_string, "WB\0", sizeof( max_bwidth_string ) ); - break; - case SWB: - strncpy( max_bwidth_string, "SWB\0", sizeof( max_bwidth_string ) ); - break; - case FB: - strncpy( max_bwidth_string, "FB\0", sizeof( max_bwidth_string ) ); - break; - } -#endif if ( st_ivas->hEncoderConfig->Opt_SC_VBR && !hEncoderConfig->Opt_DTX_ON ) { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "\nError: SC-VBR 5900 bps not supported without DTX\n\n" ); } -#ifndef FIX_I74_BW_LIMITATION_ALT - if ( hIvasEnc->maxBandwidthUser ) - { - fprintf( stdout, "\nBandwidth limited to %s.\n", max_bwidth_string ); - } -#endif - if ( hEncoderConfig->ivas_format == MONO_FORMAT ) { -#ifdef FIX_I74_BW_LIMITATION_ALT if ( newBandwidthApi != hEncoderConfig->max_bwidth ) { if ( newBandwidthApi == FB ) @@ -1630,32 +1581,9 @@ static ivas_error printConfigInfo_enc( fprintf( stdout, "\nSWB coding not supported below %.2f kbps. Switching to WB.\n", ACELP_9k60 / 1000.f ); } } -#else - if ( hEncoderConfig->max_bwidth == FB && hEncoderConfig->ivas_total_brate < ACELP_16k40 ) - { - fprintf( stdout, "\nFB coding not supported below %.2f kbps. ", ACELP_16k40 / 1000.f ); - if ( hEncoderConfig->ivas_total_brate < ACELP_9k60 ) - { - fprintf( stdout, "Switching to WB.\n" ); - } - else - { - fprintf( stdout, "Switching to SWB.\n" ); - } - } - - if ( hEncoderConfig->max_bwidth == SWB && hEncoderConfig->ivas_total_brate < ACELP_9k60 ) - { - fprintf( stdout, "\nSWB coding not supported below %.2f kbps. Switching to WB.", ACELP_9k60 / 1000.f ); - } -#endif /* in case of 8kHz input sampling or "-max_band NB", require the total bitrate to be below 24.40 kbps */ -#ifdef FIX_I74_BW_LIMITATION_ALT if ( ( newBandwidthApi == NB || hEncoderConfig->input_Fs == 8000 ) && hEncoderConfig->ivas_total_brate > ACELP_24k40 ) -#else - if ( ( hEncoderConfig->max_bwidth == NB || hEncoderConfig->input_Fs == 8000 ) && hEncoderConfig->ivas_total_brate > ACELP_24k40 ) -#endif { fprintf( stdout, "\nError: Unsupported mode NB %d bps, NB mode supports rates 5900-24400 bps\n\n", hEncoderConfig->ivas_total_brate ); return IVAS_ERR_INVALID_BITRATE; @@ -1663,11 +1591,7 @@ static ivas_error printConfigInfo_enc( } else { -#ifdef FIX_I74_BW_LIMITATION_ALT if ( newBandwidthApi != hEncoderConfig->max_bwidth ) -#else - if ( hEncoderConfig->max_bwidth == FB && hEncoderConfig->ivas_total_brate < MIN_BRATE_FB_STEREO ) -#endif { fprintf( stdout, "\nFB coding not supported below %.2f kbps. Switching to SWB.\n", MIN_BRATE_FB_STEREO / 1000.f ); } @@ -1877,36 +1801,7 @@ static ivas_error doCommonSetterChecks( return IVAS_ERR_OK; } -#ifndef FIX_I74_BW_LIMITATION_ALT -/*---------------------------------------------------------------------* - * updateBandwidthFromFs() - * - * - *---------------------------------------------------------------------*/ -static void updateBandwidthFromFs( - const ENCODER_CONFIG_HANDLE hEncoderConfig ) -{ - /* Prevent st_ivas->max_bwidth from being higher than Fs/2 */ - if ( hEncoderConfig->input_Fs == 8000 && hEncoderConfig->max_bwidth > NB ) - { - hEncoderConfig->max_bwidth = NB; - } - else if ( hEncoderConfig->input_Fs == 16000 && hEncoderConfig->max_bwidth > WB ) - { - hEncoderConfig->max_bwidth = WB; - } - else if ( hEncoderConfig->input_Fs == 32000 && hEncoderConfig->max_bwidth > SWB ) - { - hEncoderConfig->max_bwidth = SWB; - } - - return; -} -#endif - - -#ifdef FIX_I74_BW_LIMITATION_ALT /*---------------------------------------------------------------------* * sanitizeBandwidth() * @@ -1915,7 +1810,7 @@ static void updateBandwidthFromFs( static ivas_error sanitizeBandwidth( const IVAS_ENC_HANDLE hIvasEnc ) -{ +{ ENCODER_CONFIG_HANDLE hEncoderConfig; int16_t max_bwidth_tmp; @@ -1940,7 +1835,7 @@ static ivas_error sanitizeBandwidth( /* NB coding not supported in IVAS. Switching to WB. */ if ( max_bwidth_tmp == NB && hEncoderConfig->ivas_format != UNDEFINED_FORMAT && hEncoderConfig->ivas_format != MONO_FORMAT ) { - if ( hEncoderConfig->input_Fs >= 16000 ) + if ( hEncoderConfig->input_Fs >= 16000 ) { max_bwidth_tmp = WB; } @@ -2000,7 +1895,6 @@ static ivas_error sanitizeBandwidth( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* @@ -2025,9 +1919,7 @@ static ivas_error setBandwidth( return error; } -#ifdef FIX_I74_BW_LIMITATION_ALT hIvasEnc->newBandwidthApi = newBandwidth; -#endif /* NB coding not supported in IVAS. Switching to WB. */ if ( newBandwidth == NB && hEncoderConfig->ivas_format != UNDEFINED_FORMAT && hEncoderConfig->ivas_format != MONO_FORMAT ) @@ -2041,15 +1933,6 @@ static ivas_error setBandwidth( hIvasEnc->switchingActive = true; } -#ifndef FIX_I74_BW_LIMITATION_ALT - /* Limit bandwidth to half of sampling rate - only possible if - * sampling rate has already been set via configure function */ - if ( hIvasEnc->isConfigured ) - { - updateBandwidthFromFs( hIvasEnc->st_ivas->hEncoderConfig ); - } -#endif - return IVAS_ERR_OK; } @@ -2217,18 +2100,14 @@ static void init_encoder_config( ENCODER_CONFIG_HANDLE hEncoderConfig /* o : configuration structure */ ) { -#ifdef FIX_I98_HANDLES_TO_NULL hEncoderConfig->ivas_total_brate = ACELP_12k65; -#endif hEncoderConfig->max_bwidth = SWB; hEncoderConfig->input_Fs = 16000; hEncoderConfig->nchan_inp = 1; hEncoderConfig->element_mode_init = EVS_MONO; hEncoderConfig->ivas_format = UNDEFINED_FORMAT; -#ifdef FIX_I98_HANDLES_TO_NULL hEncoderConfig->Opt_SC_VBR = 0; hEncoderConfig->last_Opt_SC_VBR = 0; -#endif hEncoderConfig->Opt_AMR_WB = 0; hEncoderConfig->Opt_DTX_ON = 0; hEncoderConfig->Opt_RF_ON = 0; -- GitLab From b47a17effeb0828d498f8850b53b1d47a49b1948 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 29 Sep 2022 14:55:03 +0200 Subject: [PATCH 2/2] formatting - clang-format --- lib_dec/ivas_objectRenderer.c | 20 ++++++++++---------- lib_dec/ivas_objectRenderer_hrFilt.c | 8 ++++---- lib_dec/ivas_objectRenderer_sfx.c | 6 +++--- lib_dec/ivas_stereo_cng_dec.c | 2 +- lib_enc/ivas_cpe_enc.c | 1 - lib_enc/ivas_sce_enc.c | 4 +--- lib_enc/ivas_stereo_cng_enc.c | 2 +- 7 files changed, 20 insertions(+), 23 deletions(-) diff --git a/lib_dec/ivas_objectRenderer.c b/lib_dec/ivas_objectRenderer.c index f4b024b38a..eb7ee0d733 100644 --- a/lib_dec/ivas_objectRenderer.c +++ b/lib_dec/ivas_objectRenderer.c @@ -394,11 +394,11 @@ static ivas_error TDREND_GetMix( float output[][L_FRAME48k], /* i/o: ISm object synth / rendered output in 0,1 */ #ifdef FIX_I106_TDREND_5MS const int16_t subframe_length, /* i/o: subframe length */ - const int32_t output_Fs, /* i : Output sampling rate */ - const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ + const int32_t output_Fs, /* i : Output sampling rate */ + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ #else const int16_t output_frame, /* i/o: Output frame length */ - const int32_t output_Fs /* i : Output sampling rate */ + const int32_t output_Fs /* i : Output sampling rate */ #endif ) { @@ -472,7 +472,7 @@ static ivas_error TDREND_GetMix( #ifdef FIX_I106_TDREND_5MS /* Clear the PoseUpdated and Source position update flags */ #else - /* Clear the mixer update flags */ + /* Clear the mixer update flags */ #endif TDREND_Clear_Update_flags( hBinRendererTd ); @@ -510,8 +510,8 @@ static void TDREND_Clear_Update_flags( *---------------------------------------------------------------------*/ static void TDREND_Update_object_positions( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float output[][L_FRAME48k] /* i/o: SCE/MC channels */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k] /* i/o: SCE/MC channels */ ) { TDREND_DirAtten_t *DirAtten_p; @@ -553,11 +553,11 @@ static void TDREND_Update_object_positions( TDREND_MIX_SRC_SetPos( st_ivas->hBinRendererTd, nS, Pos ); TDREND_MIX_SRC_SetDirAtten( st_ivas->hBinRendererTd, nS, DirAtten_p ); TDREND_MIX_SRC_SetPlayState( st_ivas->hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING ); - + TDREND_MIX_SRC_SetDir( st_ivas->hBinRendererTd, nS, Dir ); } } - + return; } @@ -568,8 +568,8 @@ static void TDREND_Update_object_positions( *---------------------------------------------------------------------*/ static void TDREND_Update_listener_orientation( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t subframe_idx /* i: subframe index*/ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const int16_t subframe_idx /* i: subframe index*/ ) { float Pos[3]; diff --git a/lib_dec/ivas_objectRenderer_hrFilt.c b/lib_dec/ivas_objectRenderer_hrFilt.c index 1c0afd9eda..404be200e2 100644 --- a/lib_dec/ivas_objectRenderer_hrFilt.c +++ b/lib_dec/ivas_objectRenderer_hrFilt.c @@ -344,9 +344,9 @@ void TDREND_HRFILT_SetFiltSet( ivas_error TDREND_REND_RenderSourceHRFilt( #ifdef FIX_I106_TDREND_5MS - TDREND_SRC_t *Src_p, /* i/o: The source to be rendered */ + TDREND_SRC_t *Src_p, /* i/o: The source to be rendered */ #else - const TDREND_SRC_t *Src_p, /* i/o: The source to be rendered */ + const TDREND_SRC_t *Src_p, /* i/o: The source to be rendered */ #endif #ifdef TDREND_HRTF_TABLE_METHODS BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ @@ -359,7 +359,7 @@ ivas_error TDREND_REND_RenderSourceHRFilt( const int16_t output_frame, /* i : Output frame length in use */ #endif - const int32_t output_Fs /* i : Output sample rate */ + const int32_t output_Fs /* i : Output sample rate */ ) { TDREND_SRC_REND_t *SrcRend_p; @@ -406,7 +406,7 @@ ivas_error TDREND_REND_RenderSourceHRFilt( v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length ); v_add( RightOutputFrame, output_buf[1], output_buf[1], subframe_length ); - Src_p->InputFrame_p += subframe_length; /* Increment input pointer -- todo: should we remove this and input the current subframe instead? */ + Src_p->InputFrame_p += subframe_length; /* Increment input pointer -- todo: should we remove this and input the current subframe instead? */ #else LeftOutputFrame_p = LeftOutputFrame; diff --git a/lib_dec/ivas_objectRenderer_sfx.c b/lib_dec/ivas_objectRenderer_sfx.c index b8d2befc37..442091db0f 100644 --- a/lib_dec/ivas_objectRenderer_sfx.c +++ b/lib_dec/ivas_objectRenderer_sfx.c @@ -1025,10 +1025,10 @@ void TDREND_SFX_SpatBin_Execute_Main( --------------------------------------------------------------------*/ static void TDREND_SFX_SpatBin_Execute( - SFX_SpatBin_t *SfxSpatBin_p, /* i/o: Spatial parameters struct */ - const float *InBuffer_p, /* i : Input buffer */ + SFX_SpatBin_t *SfxSpatBin_p, /* i/o: Spatial parameters struct */ + const float *InBuffer_p, /* i : Input buffer */ #ifdef DEBUGGING - const int16_t NoOfInputSamples, /* i : Length of input buffer */ + const int16_t NoOfInputSamples, /* i : Length of input buffer */ #endif const int16_t NoOfRequestedOutputSamples, /* i : Length of output */ float *LeftOutBuffer_p, /* o : Rendered left channel */ diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index fea12053c3..491a88da3f 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -92,7 +92,7 @@ void stereo_dft_dec_sid_coh( #ifdef ALIGN_SID_SIZE /* TODO: still use old number of bits to keep bitexactness in output */ - nr_of_sid_stereo_bits = ( 4400/*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; + nr_of_sid_stereo_bits = ( 4400 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; #else nr_of_sid_stereo_bits = ( IVAS_SID_4k4 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 96b5ba8777..08c45af220 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -115,7 +115,6 @@ ivas_error ivas_cpe_enc( input_Fs = hEncoderConfig->input_Fs; ivas_total_brate = hEncoderConfig->ivas_total_brate; - /*------------------------------------------------------------------* * Initialization - general *-----------------------------------------------------------------*/ diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 1657665f99..4a4c24fa4e 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -238,13 +238,11 @@ ivas_error ivas_sce_enc( * Encoder *----------------------------------------------------------------*/ - if ( ( error = ivas_core_enc( hSCE, NULL, NULL, 1, old_inp_12k8, old_inp_16k, Etot, ener, A, Aw, epsP, lsp_new, lsp_mid, vad_hover_flag, attack_flag, realBuffer, imagBuffer, old_wsp, loc_harm, cor_map_sum, vad_flag_dtx, enerBuffer, fft_buff, 0, - flag_16k_smc ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_core_enc( hSCE, NULL, NULL, 1, old_inp_12k8, old_inp_16k, Etot, ener, A, Aw, epsP, lsp_new, lsp_mid, vad_hover_flag, attack_flag, realBuffer, imagBuffer, old_wsp, loc_harm, cor_map_sum, vad_flag_dtx, enerBuffer, fft_buff, 0, flag_16k_smc ) ) != IVAS_ERR_OK ) { return error; } - /*----------------------------------------------------------------* * Common updates *----------------------------------------------------------------*/ diff --git a/lib_enc/ivas_stereo_cng_enc.c b/lib_enc/ivas_stereo_cng_enc.c index 5db60b5238..9176f9ad2f 100644 --- a/lib_enc/ivas_stereo_cng_enc.c +++ b/lib_enc/ivas_stereo_cng_enc.c @@ -150,7 +150,7 @@ void stereo_dft_enc_sid_coh( #ifdef ALIGN_SID_SIZE /* TODO: still use old number of bits to keep bitexactness in output */ - nr_of_sid_stereo_bits = ( 4400/*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; + nr_of_sid_stereo_bits = ( 4400 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; #else nr_of_sid_stereo_bits = ( IVAS_SID_4k4 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; #endif -- GitLab