From 61ec1538f69740e643598f95c81eb6fe81444f53 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Aug 2022 17:25:03 +0200 Subject: [PATCH 1/8] [cleanup] accept DEC_ICA_DELAY_INTERP --- lib_com/options.h | 1 - lib_dec/ivas_stat_dec.h | 2 -- lib_dec/ivas_stereo_ica_dec.c | 8 -------- 3 files changed, 11 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 73266bde55..8b914eed47 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -135,7 +135,6 @@ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #define BITSTREAM_INDICES_MEMORY /* Don't count memory for bitstream Indice at the encoder - it is a temporary solution for development only */ -#define DEC_ICA_DELAY_INTERP /* ICA Decoder Target Delay Interpolation in TD stereo */ #define LSF_RE_USE_SECONDARY_CHANNEL /* TD stereo Secondary channel LSF Q improvement */ #ifdef LSF_RE_USE_SECONDARY_CHANNEL /*#define LSF_RE_USE_SECONDARY_CHANNEL_REUSEMODE */ /* switch to isolate the reuse mode case */ diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 18fc4b4741..1191b377bb 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -344,10 +344,8 @@ typedef struct stereo_tca_dec_data_structure int16_t corrLagStats; /* corr lag stats in current frame */ int16_t prevCorrLagStats; /* corr lag stats in previous frame */ -#ifdef DEC_ICA_DELAY_INTERP int16_t interp_dec_prevNCShift; /* NC Shift in previous frame */ int16_t interp_dec_switch_to_zero_diff; /* switch flag for interpolation */ -#endif float memChanL[L_DEC_MEM_LEN_ICA]; /* left channel input to correct at the cross-over */ float memChanR[L_DEC_MEM_LEN_ICA]; /* right channel input to correct at the cross-over */ diff --git a/lib_dec/ivas_stereo_ica_dec.c b/lib_dec/ivas_stereo_ica_dec.c index 38f160ce36..122f739dba 100644 --- a/lib_dec/ivas_stereo_ica_dec.c +++ b/lib_dec/ivas_stereo_ica_dec.c @@ -151,7 +151,6 @@ void stereo_tca_dec( /* IVAS_fmToDo: QCTodo: Need to address [16, 32] kHz @ Encoder --> 48 kHz Decoder. 48kHz-->48kHz is ok */ /*target_idx = (hStereoTCA->refChanIndx == L_CH_INDX) ? R_CH_INDX : L_CH_INDX;*/ -#ifdef DEC_ICA_DELAY_INTERP if ( hCPE->element_mode == IVAS_CPE_TD && hCPE->last_element_mode == IVAS_CPE_TD ) { if ( hStereoTCA->corrLagStats == hStereoTCA->prevCorrLagStats && hStereoTCA->interp_dec_switch_to_zero_diff == 0 ) @@ -176,7 +175,6 @@ void stereo_tca_dec( hStereoTCA->interp_dec_prevNCShift = currentNCShift; hStereoTCA->interp_dec_switch_to_zero_diff = 0; } -#endif ref = ptrChanL; target = ptrChanR; @@ -203,11 +201,7 @@ void stereo_tca_dec( } /* target signal adjustment for temporal shift variations */ -#ifdef DEC_ICA_DELAY_INTERP if ( hStereoTCA->prevCorrLagStats != hStereoTCA->corrLagStats || bothChannelShift || ( hStereoTCA->interp_dec_switch_to_zero_diff == 1 && hCPE->element_mode == IVAS_CPE_TD ) ) -#else - if ( ( hStereoTCA->prevCorrLagStats != hStereoTCA->corrLagStats ) || bothChannelShift ) -#endif { l_shift_adapt = L_SHIFT_ADAPT_16k; if ( output_Fs > 16000 ) @@ -366,10 +360,8 @@ void stereo_tca_init_dec( hStereoTCA->corrLagStats = 0; hStereoTCA->prevCorrLagStats = 0; -#ifdef DEC_ICA_DELAY_INTERP hStereoTCA->interp_dec_prevNCShift = 0; hStereoTCA->interp_dec_switch_to_zero_diff = 0; -#endif set_f( hStereoTCA->memChanL, 0.0f, L_DEC_MEM_LEN_ICA ); set_f( hStereoTCA->memChanR, 0.0f, L_DEC_MEM_LEN_ICA ); -- GitLab From bea7b87c65db5a0c15b21ffea2563115f3670b14 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Aug 2022 17:26:36 +0200 Subject: [PATCH 2/8] [cleanup] accept SIMPLIFY_SBA_RENDERING_LOGIC --- lib_com/options.h | 1 - lib_dec/ivas_dec.c | 21 --------------------- lib_dec/ivas_sba_rendering.c | 29 ----------------------------- 3 files changed, 51 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8b914eed47..9f35ac6af2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -146,7 +146,6 @@ /*#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 SIMPLIFY_SBA_RENDERING_LOGIC /* SBA rendering maintenance related to ticket #45 */ #define SBA_CLEANING /* SBA maintenance related to ticket #45 */ #define DIRAC_DRCT_GAIN_TUNING /* issue 64: tuning of DirAC energy-compensation gains */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 69ca90a79a..a103c9f45f 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -328,7 +328,6 @@ ivas_error ivas_dec( } /* Loudspeakers, Ambisonics or Binaural rendering */ -#ifdef SIMPLIFY_SBA_RENDERING_LOGIC if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { ivas_dirac_dec_binaural( st_ivas, output, nchan_remapped ); @@ -348,26 +347,6 @@ ivas_error ivas_dec( { ivas_sba_upmixer_renderer( st_ivas, output, nchan_remapped, output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */ } -#else - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->sba_mode == SBA_MODE_DIRAC ) - { - ivas_sba_linear_renderer( output, output_frame, nchan_remapped, output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ); - } - else if ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->sba_mode != SBA_MODE_SPAR ) - { - ivas_dirac_dec( st_ivas, output, nchan_remapped, NULL, NULL, -1 ); - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - ivas_dirac_dec_binaural( st_ivas, output, nchan_remapped ); - } - else if ( - ( ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) && st_ivas->sba_mode == SBA_MODE_SPAR ) || - ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) ) ) - { - ivas_sba_upmixer_renderer( st_ivas, output, nchan_remapped, output_frame ); - } -#endif } else if ( st_ivas->ivas_format == MC_FORMAT ) { diff --git a/lib_dec/ivas_sba_rendering.c b/lib_dec/ivas_sba_rendering.c index 1b8572b6fc..de61f288a9 100644 --- a/lib_dec/ivas_sba_rendering.c +++ b/lib_dec/ivas_sba_rendering.c @@ -210,11 +210,7 @@ void ivas_sba_upmixer_renderer( ) { int16_t i, ch, nchan_out; -#ifdef SIMPLIFY_SBA_RENDERING_LOGIC float temp; -#else - float clip, temp; -#endif int16_t nchan_internal; wmops_sub_start( "ivas_sba_upmixer_renderer" ); @@ -253,47 +249,22 @@ void ivas_sba_upmixer_renderer( } } -#ifdef SIMPLIFY_SBA_RENDERING_LOGIC /* Upmixer + Renderer */ -#else - /* Upmixer */ -#endif ivas_spar_dec_upmixer( st_ivas, output, nchan_internal, output_frame ); -#ifndef SIMPLIFY_SBA_RENDERING_LOGIC - /* Renderer */ - if ( st_ivas->hDirAC != NULL && st_ivas->renderer_type == RENDERER_DIRAC ) - { - nchan_out = st_ivas->hDirAC->hOutSetup.nchan_out_woLFE + st_ivas->hDirAC->hOutSetup.num_lfe; - } -#endif if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) { 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 SIMPLIFY_SBA_RENDERING_LOGIC - clip = 1.0f; -#endif for ( ch = 0; ch < nchan_out; ch++ ) { for ( i = 0; i < output_frame; i++ ) { -#ifndef SIMPLIFY_SBA_RENDERING_LOGIC - clip = max( clip, fabsf( output[ch][i] ) ); -#endif output[ch][i] = output[ch][i] * PCM16_TO_FLT_FAC; } } -#ifndef SIMPLIFY_SBA_RENDERING_LOGIC -#ifdef DEBUGGING - if ( clip > 1.0f ) - { - fprintf( stderr, "IVAS Crend Clipped: max gain = %f\n", clip ); - } -#endif -#endif wmops_sub_end(); -- GitLab From 8eb2eb26d9ed8d73149540f398f913f073d7172d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Aug 2022 17:27:55 +0200 Subject: [PATCH 3/8] [cleanup] accept SBA_CLEANING --- lib_com/ivas_cnst.h | 4 ---- lib_com/ivas_spar_com.c | 14 -------------- lib_com/options.h | 1 - lib_dec/ivas_lfe_dec.c | 8 -------- lib_dec/ivas_spar_decoder.c | 20 -------------------- lib_enc/ivas_lfe_enc.c | 8 -------- lib_enc/lib_enc.c | 7 ------- 7 files changed, 62 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index fde64164c9..0a9aad9020 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1298,11 +1298,7 @@ typedef enum #define IVAS_LFE_NUM_COEFFS_IN_SUBGRP 2 #define IVAS_LFE_MAX_NUM_DCT_PASS_BINS 8 #define IVAS_LFE_MAX_NUM_DCT_COEFFS (IVAS_LFE_MAX_NUM_DCT_PASS_BINS * IVAS_LFE_NUM_COEFFS_IN_SUBGRP) -#ifdef SBA_CLEANING #define IVAS_LFE_FADE_NS 8000000L /* 8.0 ms */ -#else -#define IVAS_LFE_FADE_LEN_SEC_FLOAT ((float)0.008) -#endif #define IVAS_MAX_NUM_QUANT_STRATS 2 #define IVAS_MAX_NUM_DCT_COEF_GROUPS 4 #define IVAS_LFE_SHIFT_BITS 5 diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index 16131fa8fb..fa691f5dba 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -53,9 +53,6 @@ #define IVAS_MDCT_SCALING_GAIN_48k 1.9699011974118126e-06f #define IVAS_MDCT_SCALING_GAIN_32k 2.9548517961177197e-06f #define IVAS_MDCT_SCALING_GAIN_16k 5.909703592235439e-06f -#ifndef SBA_CLEANING -#define IVAS_MDCT_SCALING_GAIN_8k 0.000011819f -#endif #define IVAS_FLT_EPS ( 1e-10F ) #define IVAS_DBL_EPS ( (double) 1e-20 ) @@ -159,13 +156,6 @@ float ivas_get_mdct_scaling_gain( result = IVAS_MDCT_SCALING_GAIN_16k; break; } -#ifndef SBA_CLEANING - case L_FRAME8k >> 2: - { - result = IVAS_MDCT_SCALING_GAIN_8k; - break; - } -#endif default: { assert( !"Unsupported frame length!" ); @@ -297,11 +287,7 @@ void lfe_window_init( hLFEWindow->dct_len = frame_len >> 1; /* 8ms of latency */ -#ifdef SBA_CLEANING hLFEWindow->fade_len = NS2SA( sampling_rate, IVAS_LFE_FADE_NS ); -#else - hLFEWindow->fade_len = (int16_t) ( sampling_rate * IVAS_LFE_FADE_LEN_SEC_FLOAT ); -#endif hLFEWindow->zero_pad_len = (int16_t) ( IVAS_ZERO_PAD_LEN_MULT_FAC * ( hLFEWindow->dct_len - hLFEWindow->fade_len ) ); hLFEWindow->full_len = hLFEWindow->zero_pad_len + hLFEWindow->fade_len + hLFEWindow->dct_len; diff --git a/lib_com/options.h b/lib_com/options.h index 9f35ac6af2..9e28ae0dad 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -146,7 +146,6 @@ /*#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 SBA_CLEANING /* SBA maintenance related to ticket #45 */ #define DIRAC_DRCT_GAIN_TUNING /* issue 64: tuning of DirAC energy-compensation gains */ #define FIX_34 /* Nokia: Fix bug in MASA format EXT output spherical indexing */ diff --git a/lib_dec/ivas_lfe_dec.c b/lib_dec/ivas_lfe_dec.c index fd9233c4f9..cda168a936 100644 --- a/lib_dec/ivas_lfe_dec.c +++ b/lib_dec/ivas_lfe_dec.c @@ -379,11 +379,7 @@ ivas_error ivas_create_lfe_dec( hLFE->cum_freq_models[1][3] = &ivas_str_lfe_freq_models.entropy_coder_model_coarse_sg4; /* delay calculation */ -#ifdef SBA_CLEANING hLFE->lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; -#else - hLFE->lfe_block_delay_s = IVAS_LFE_FADE_LEN_SEC_FLOAT + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; -#endif block_offset_s = BLOCK_OFFSET_MS * 0.001f; @@ -415,11 +411,7 @@ ivas_error ivas_create_lfe_dec( } hLFE->lfe_block_delay_s = hLFE->lfe_block_delay_s + low_pass_delay_dec_out; -#ifdef SBA_CLEANING hLFE->lfe_prior_buf_len = NS2SA( output_Fs, IVAS_LFE_FADE_NS ); -#else - hLFE->lfe_prior_buf_len = (int16_t) ( IVAS_LFE_FADE_LEN_SEC_FLOAT * output_Fs ); -#endif hLFE->bfi_count = 0; diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 9a0cb68ab5..5692e88314 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -118,10 +118,8 @@ ivas_error ivas_spar_dec_open( } /* PCA handle */ -#ifdef SBA_CLEANING hSpar->hPCA = NULL; if ( st_ivas->hDecoderConfig->ivas_total_brate == PCA_BRATE && sba_order_internal == 1 ) -#endif { if ( ( hSpar->hPCA = (PCA_DEC_STATE *) count_malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL ) { @@ -655,20 +653,10 @@ static void ivas_spar_dec_MD( * read PCA bits *---------------------------------------------------------------------*/ -#ifdef SBA_CLEANING if ( hSpar->hPCA != NULL ) -#else - if ( hDecoderConfig->ivas_total_brate == PCA_BRATE && sba_order == 1 ) -#endif { ivas_pca_read_bits( st0, hSpar->hPCA ); } -#ifndef SBA_CLEANING - else - { - hSpar->hPCA->pca_bypass = PCA_MODE_INACTIVE; - } -#endif /*---------------------------------------------------------------------* * Read AGC bits @@ -981,9 +969,7 @@ void ivas_spar_dec_upmixer( pState->pca_ingest_channels = num_in_ingest; #endif -#ifdef SBA_CLEANING if ( hSpar->hPCA != NULL ) -#endif { ivas_pca_dec( hSpar->hPCA, output_frame, num_in_ingest, hDecoderConfig->ivas_total_brate, hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, output ); #ifdef DEBUG_SBA_AUDIO_DUMP @@ -1130,13 +1116,7 @@ void ivas_spar_dec_upmixer( if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) { -#ifdef SBA_CLEANING ivas_dirac_dec( st_ivas, output, nchan_internal, cldfb_in_ts_re, cldfb_in_ts_im, i_sf ); -#else - nchan_transport = ivas_sba_get_nchan_metadata( st_ivas->sba_order ); // VE: == nchan_internal that is already set correctly - - ivas_dirac_dec( st_ivas, output, nchan_transport, cldfb_in_ts_re, cldfb_in_ts_im, i_sf ); -#endif } if ( st_ivas->hDirAC != NULL ) diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index feb164d201..dd9db01223 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -353,20 +353,12 @@ ivas_error ivas_create_lfe_enc( * Input memory buffer: allocate and initialize *-----------------------------------------------------------------*/ -#ifdef SBA_CLEANING if ( ( hLFE->old_wtda_audio = (float *) count_malloc( sizeof( float ) * NS2SA( input_Fs, IVAS_LFE_FADE_NS ) ) ) == NULL ) -#else - if ( ( hLFE->old_wtda_audio = (float *) count_malloc( sizeof( float ) * (int16_t) ( input_Fs * IVAS_LFE_FADE_LEN_SEC_FLOAT ) ) ) == NULL ) -#endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE memory\n" ) ); } -#ifdef SBA_CLEANING set_zero( hLFE->old_wtda_audio, NS2SA( input_Fs, IVAS_LFE_FADE_NS ) ); -#else - set_zero( hLFE->old_wtda_audio, (int16_t) ( input_Fs * IVAS_LFE_FADE_LEN_SEC_FLOAT ) ); -#endif /*-----------------------------------------------------------------* * LFE Window: allocate and initialize diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 21b1bf5765..6d53ce3ffd 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -778,9 +778,6 @@ static ivas_error configureEncoder( /* IVAS_fmToDo: needs more work in case of bitrate switching */ hEncoderConfig->sba_order = 1; } -#ifndef SBA_CLEANING - st_ivas->sba_mode = ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ); -#endif } else if ( hEncoderConfig->ivas_format == MASA_FORMAT ) { @@ -881,11 +878,7 @@ static ivas_error configureEncoder( return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." ); } -#ifdef SBA_CLEANING if ( hEncoderConfig->Opt_AGC_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ) == SBA_MODE_SPAR ) ) -#else - if ( hEncoderConfig->Opt_AGC_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR ) ) -#endif { return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "AGC supported in SBA format at bitrates >= 24.4 kbps only." ); } -- GitLab From 5e73fea802817ede4ab4dcc269d1191f0f9d48b3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Aug 2022 17:29:15 +0200 Subject: [PATCH 4/8] [cleanup] accept FIX_34 --- lib_com/options.h | 1 - lib_dec/ivas_masa_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9e28ae0dad..5b49c80de5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -148,7 +148,6 @@ #define DIRAC_DRCT_GAIN_TUNING /* issue 64: tuning of DirAC energy-compensation gains */ -#define FIX_34 /* Nokia: Fix bug in MASA format EXT output spherical indexing */ #define FIX_I54_LS_CONVERSION /* FhG: fix incorrect downmix matrix for 5_1_4 to 5_1_2 and upmix matrix for 7_1 to 7_1_4 */ #define FIX_I25_FBE_FB_BITS /* issue 25: properly skip reading of TBE FB bits when decoder output sampling rate is not 48 kHz */ #define ORDER_BITS_ADDITION /* issue 14: Transmit SBA order and planar bits at all bitrates */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index a18f68225b..91b79a614e 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -643,11 +643,7 @@ static uint16_t index_theta_phi_16( } else { -#ifdef FIX_34 theta = MASA_ANGLE_AT_EQUATOR * (float) ( id_th + 0.5f ); -#else - theta = MASA_NTOT2_FAC * (float) ( id_th + 0.5f ); -#endif if ( id_th == 1 ) { cum_n = 2 * (uint16_t) ceilf( MASA_NTOT2_FAC * ( sinf( theta ) - MASA_ASIN_OFFSET ) ); -- GitLab From 248d09eedca77cda0279939b9b2cd20aac90c199 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Aug 2022 17:31:53 +0200 Subject: [PATCH 5/8] [cleanup] accept FIX_I54_LS_CONVERSION --- lib_com/options.h | 1 - lib_dec/ivas_rom_dec.c | 25 ------------------------- lib_dec/ivas_rom_dec.h | 4 ---- 3 files changed, 30 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5b49c80de5..a0de431015 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -148,7 +148,6 @@ #define DIRAC_DRCT_GAIN_TUNING /* issue 64: tuning of DirAC energy-compensation gains */ -#define FIX_I54_LS_CONVERSION /* FhG: fix incorrect downmix matrix for 5_1_4 to 5_1_2 and upmix matrix for 7_1 to 7_1_4 */ #define FIX_I25_FBE_FB_BITS /* issue 25: properly skip reading of TBE FB bits when decoder output sampling rate is not 48 kHz */ #define ORDER_BITS_ADDITION /* issue 14: Transmit SBA order and planar bits at all bitrates */ diff --git a/lib_dec/ivas_rom_dec.c b/lib_dec/ivas_rom_dec.c index baf77c1984..39918776e6 100644 --- a/lib_dec/ivas_rom_dec.c +++ b/lib_dec/ivas_rom_dec.c @@ -580,7 +580,6 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp6[] = {43, 0.849999964f} }; -#ifdef FIX_I54_LS_CONVERSION const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp12[] = { /* First row indicates the number of non-zero elements */ @@ -595,7 +594,6 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp12[] = {48, 0.849999964f}, {57, 0.849999964f} }; -#endif const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp6[] = { @@ -637,7 +635,6 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp14[] = /* First row indicates the number of non-zero elements */ {10, 0.0f}, /* Index of non-zero element, value of non-zero element*/ -#ifdef FIX_I54_LS_CONVERSION {0, 1.000000000f}, {9, 1.000000000f}, {18, 1.000000000f}, @@ -648,18 +645,6 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp14[] = {63, 1.000000000f}, {68, 0.849999964f}, {77, 0.849999964f}, -#else - {0, 1.000000000f}, - {11, 1.000000000f}, - {22, 1.000000000f}, - {33, 1.000000000f}, - {44, 1.000000000f}, - {48, 0.849999964f}, - {55, 1.000000000f}, - {59, 0.849999964f}, - {66, 1.000000000f}, - {77, 1.000000000f}, -#endif }; const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp6[] = @@ -777,7 +762,6 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp16[] = {75, 1.0f} }; -#ifdef FIX_I54_LS_CONVERSION const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp19[] = { /* First row indicates the number of non-zero elements */ @@ -792,7 +776,6 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp19[] = {76, 1.0f}, {89, 1.0f} }; -#endif const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp19[] = { @@ -849,11 +832,7 @@ const LS_CONVERSION_MAPPING ls_conversion_mapping[LS_SETUP_CONVERSION_NUM_MAPPIN {AUDIO_CONFIG_7_1, AUDIO_CONFIG_5_1, ls_conversion_cicp12_cicp6}, {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_5_1, ls_conversion_cicp14_cicp6}, -#ifdef FIX_I54_LS_CONVERSION {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_7_1, ls_conversion_cicp14_cicp12}, -#else - {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_7_1, ls_conversion_cicp14_cicp6}, -#endif {AUDIO_CONFIG_5_1_4, AUDIO_CONFIG_5_1, ls_conversion_cicp16_cicp6}, {AUDIO_CONFIG_5_1_4, AUDIO_CONFIG_7_1, ls_conversion_cicp16_cicp12}, @@ -878,11 +857,7 @@ const LS_CONVERSION_MAPPING ls_conversion_mapping[LS_SETUP_CONVERSION_NUM_MAPPIN {AUDIO_CONFIG_7_1, AUDIO_CONFIG_5_1_2, ls_conversion_cicp12_cicp14}, {AUDIO_CONFIG_7_1, AUDIO_CONFIG_5_1_4, ls_conversion_cicp12_cicp16}, -#ifdef FIX_I54_LS_CONVERSION {AUDIO_CONFIG_7_1, AUDIO_CONFIG_7_1_4, ls_conversion_cicp12_cicp19}, -#else - {AUDIO_CONFIG_7_1, AUDIO_CONFIG_7_1_4, NULL}, -#endif {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_5_1_4, NULL}, {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_7_1_4, ls_conversion_cicp14_cicp19}, diff --git a/lib_dec/ivas_rom_dec.h b/lib_dec/ivas_rom_dec.h index a92aad2533..d85f433935 100644 --- a/lib_dec/ivas_rom_dec.h +++ b/lib_dec/ivas_rom_dec.h @@ -120,9 +120,7 @@ extern const float ls_conversion_cicpX_stereo[12][2]; extern const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp6[]; extern const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp6[]; extern const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp6[]; -#ifdef FIX_I54_LS_CONVERSION extern const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp12[]; -#endif extern const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp6[]; extern const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp14[]; extern const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp6[]; @@ -133,9 +131,7 @@ extern const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp16[]; /* Upmix matrices */ extern const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp14[]; extern const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp16[]; -#ifdef FIX_I54_LS_CONVERSION extern const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp19[]; -#endif extern const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp19[]; extern const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp19[]; -- GitLab From 8b81421b63a5ffc674e0644d43e12a9a7fc576c9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Aug 2022 17:33:00 +0200 Subject: [PATCH 6/8] [cleanup] accept FIX_I25_FBE_FB_BITS --- lib_com/options.h | 1 - lib_com/prot.h | 2 -- lib_dec/evs_dec.c | 8 -------- lib_dec/ivas_core_dec.c | 7 ------- lib_dec/swb_tbe_dec.c | 6 ------ 5 files changed, 24 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a0de431015..aa96160e07 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -148,7 +148,6 @@ #define DIRAC_DRCT_GAIN_TUNING /* issue 64: tuning of DirAC energy-compensation gains */ -#define FIX_I25_FBE_FB_BITS /* issue 25: properly skip reading of TBE FB bits when decoder output sampling rate is not 48 kHz */ #define ORDER_BITS_ADDITION /* issue 14: Transmit SBA order and planar bits at all bitrates */ diff --git a/lib_com/prot.h b/lib_com/prot.h index b91f907674..d9b238bdf0 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2777,10 +2777,8 @@ void fb_tbe_dec( const float fb_exc[], /* i : FB excitation from the SWB part */ float *hb_synth, /* i/o: high-band synthesis */ float *fb_synth_ref /* o : high-band synthesis 16-20 kHz */ -#ifdef FIX_I25_FBE_FB_BITS , const int16_t output_frame /* i: output frame length */ -#endif ); diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index 6d9f5a37e1..ce3015edf4 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -319,11 +319,7 @@ ivas_error evs_dec( /* FB TBE decoder */ if ( output_frame == L_FRAME48k && st->extl == FB_TBE ) { -#ifdef FIX_I25_FBE_FB_BITS fb_tbe_dec( st, fb_exc, hb_synth, NULL, L_FRAME48k ); -#else - fb_tbe_dec( st, fb_exc, hb_synth, NULL ); -#endif } } else if ( st->extl == SWB_BWE || st->extl == FB_BWE || ( st->output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && !st->ppp_mode_dec && !( st->nelp_mode_dec == 1 && st->bfi == 1 ) ) ) @@ -604,11 +600,7 @@ ivas_error evs_dec( if ( st->extl == FB_TBE && output_frame == L_FRAME48k ) { -#ifdef FIX_I25_FBE_FB_BITS fb_tbe_dec( st, fb_exc, hb_synth, NULL, L_FRAME48k ); -#else - fb_tbe_dec( st, fb_exc, hb_synth, NULL ); -#endif } } mvr2r( hb_synth, st->hBWE_TD->old_hb_synth, output_frame ); diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index a30813e3f7..03136783c4 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -531,17 +531,10 @@ ivas_error ivas_core_dec( swb_tbe_dec( st, hStereoICBWE, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], tmp_buffer /*fb_exc*/, hb_synth[n], pitch_buf[n] ); /* FB TBE decoder */ -#ifdef FIX_I25_FBE_FB_BITS if ( st->extl == FB_TBE ) { fb_tbe_dec( st, tmp_buffer /*fb_exc*/, hb_synth[n], tmp_buffer /*fb_synth_ref*/, output_frame ); } -#else - if ( output_frame == L_FRAME48k && st->extl == FB_TBE ) - { - fb_tbe_dec( st, tmp_buffer /*fb_exc*/, hb_synth[n], tmp_buffer /*fb_synth_ref*/ ); - } -#endif } else if ( st->extl == SWB_BWE || st->extl == FB_BWE || ( output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && !st->ppp_mode_dec && !( st->nelp_mode_dec == 1 && st->bfi == 1 ) ) ) { diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index d3e43a3d35..7d327f0057 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -1977,10 +1977,8 @@ void fb_tbe_dec( const float fb_exc[], /* i : FB excitation from the SWB part */ float *hb_synth, /* o : high-band synthesis */ float *fb_synth_ref /* o : high-band synthesis 16-20 kHz */ -#ifdef FIX_I25_FBE_FB_BITS , const int16_t output_frame /* i: output frame length */ -#endif ) { int16_t i; @@ -1990,10 +1988,8 @@ void fb_tbe_dec( hBWE_TD = st->hBWE_TD; -#ifdef FIX_I25_FBE_FB_BITS if ( output_frame == L_FRAME48k ) { -#endif /* decode FB slope information */ if ( st->extl == FB_TBE && !st->bfi ) { @@ -2011,7 +2007,6 @@ void fb_tbe_dec( { ratio = hBWE_TD->prev_fbbwe_ratio; } -#ifdef FIX_I25_FBE_FB_BITS } else { @@ -2023,7 +2018,6 @@ void fb_tbe_dec( return; } -#endif fb_exc_energy = sum2_f( fb_exc, L_FRAME16k ); -- GitLab From ae677e1d4c50afa28bbc91fff6c32e08270801a6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Aug 2022 17:34:15 +0200 Subject: [PATCH 7/8] [cleanup] accept ORDER_BITS_ADDITION --- lib_com/bitstream.c | 12 ------------ lib_com/ivas_prot.h | 4 ---- lib_com/ivas_rom_com.c | 4 ---- lib_com/ivas_spar_com.c | 16 ---------------- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 12 ------------ lib_enc/ivas_enc.c | 7 ------- lib_enc/ivas_mct_core_enc.c | 22 ---------------------- lib_enc/ivas_mct_enc.c | 4 ---- 9 files changed, 82 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index d82b3e39d7..d53a14593a 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1975,22 +1975,10 @@ ivas_error preview_indices( } else if ( st_ivas->ivas_format == SBA_FORMAT ) { -#ifndef ORDER_BITS_ADDITION - if ( ( st_ivas->sba_mode != SBA_MODE_SPAR ) || ( ( st_ivas->sba_mode == SBA_MODE_SPAR ) && ( total_brate >= IVAS_256k ) ) ) - { -#endif /* Read SBA planar flag and SBA order */ st_ivas->sba_planar = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA] == 1 ); st_ivas->sba_order = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 2] == 1 ); st_ivas->sba_order += 2 * ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 1] == 1 ); -#ifndef ORDER_BITS_ADDITION - } - else - { - st_ivas->sba_planar = 0; - st_ivas->sba_order = 1; - } -#endif ivas_sba_config( total_brate, st_ivas->sba_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ), st_ivas->sba_mode ); } } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index def66551d5..1abe8462cc 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2588,10 +2588,6 @@ void ivas_mct_core_enc( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t switch_bw, /* i : flag bandwidth switch occurance */ const int16_t lfe_bits /* i : bits spent for LFE */ -#ifndef ORDER_BITS_ADDITION - , - const SBA_MODE sba_mode /* i : SBA mode */ -#endif #ifdef FIX_I1_113 , const int16_t sba_order /* i : Ambisonic (SBA) order */ diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 00b6861c9d..dca8b961ec 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -904,11 +904,7 @@ const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN] = /* When AGC is ON additional (AGC_BITS_PER_CH+1) bits may be taken from each core-coder channel so minimum core-coder bitrate per channel can be min core-coder bitrates as per the table - AGC_BITS_PER_CH */ { 24400, 0, 1, FB, 24000, 1, WYXZ, 1, 0, -#ifndef ORDER_BITS_ADDITION - { { 16400, 15200, 24350 } }, -#else { { 16400, 14850, 24350 } }, -#endif { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, { 32000, 0, 1, FB, 24000, 1, WYXZ, 1, 0,{{ 24000, 20450, 31950 }},{ { 21, 1, 5, 1 },{ 15, 1, 5, 1 },{ 15, 1, 3, 1 } }, 0, 0, 0 }, diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index fa691f5dba..4bbf3cdfb7 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -2136,10 +2136,6 @@ void ivas_spar_set_bitrate_config( total_bits += ( int16_t )( ivas_spar_br_table_consts[table_idx].evs_brs[i][0] / FRAMES_PER_SEC ); max_bits += ( int16_t )( ivas_spar_br_table_consts[table_idx].evs_brs[i][1] / FRAMES_PER_SEC ); } -#ifndef ORDER_BITS_ADDITION - if ( ivas_total_brate >= IVAS_256k ) - { -#endif pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - total_bits; pSpar_md_cfg->max_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - max_bits; @@ -2153,18 +2149,6 @@ void ivas_spar_set_bitrate_config( pSpar_md_cfg->tgt_bits_per_blk += md_coding_bits_header; pSpar_md_cfg->max_bits_per_blk += md_coding_bits_header; -#ifndef ORDER_BITS_ADDITION - } - else - { - pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - length - total_bits; - - pSpar_md_cfg->max_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - length - max_bits; - - pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ceilf( ( 1.0f * pSpar_md_cfg->tgt_bits_per_blk * num_bands ) / IVAS_MAX_NUM_BANDS ); - pSpar_md_cfg->max_bits_per_blk = (int16_t) ceilf( ( 1.0f * pSpar_md_cfg->max_bits_per_blk * num_bands ) / IVAS_MAX_NUM_BANDS ); - } -#endif return; } diff --git a/lib_com/options.h b/lib_com/options.h index aa96160e07..da537889ed 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -148,7 +148,6 @@ #define DIRAC_DRCT_GAIN_TUNING /* issue 64: tuning of DirAC energy-compensation gains */ -#define ORDER_BITS_ADDITION /* issue 14: Transmit SBA order and planar bits at all bitrates */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index dab1ce61c1..3a0808144a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -114,10 +114,6 @@ ivas_error ivas_dec_setup( } else if ( st_ivas->ivas_format == SBA_FORMAT ) { -#ifndef ORDER_BITS_ADDITION - if ( st_ivas->sba_mode == SBA_MODE_DIRAC || ivas_total_brate >= IVAS_256k ) - { -#endif /* read Ambisonic (SBA) planar flag */ st_ivas->sba_planar = st_ivas->bit_stream[num_bits_read]; num_bits_read += SBA_PLANAR_BITS; @@ -126,14 +122,6 @@ ivas_error ivas_dec_setup( st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; num_bits_read += SBA_ORDER_BITS; -#ifndef ORDER_BITS_ADDITION - } - else - { - st_ivas->sba_planar = 0; - st_ivas->sba_order = 1; - } -#endif if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate && ivas_total_brate > IVAS_SID_4k4 ) { if ( ( error = ivas_sba_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 8317831648..461eceb4b6 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -196,10 +196,6 @@ ivas_error ivas_enc( return error; } } -#ifndef ORDER_BITS_ADDITION - if ( !( st_ivas->sba_mode == SBA_MODE_SPAR && ivas_total_brate < IVAS_256k ) ) - { -#endif st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; /* Write SBA planar flag */ @@ -207,9 +203,6 @@ ivas_error ivas_enc( /* Write SBA order */ push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_order, SBA_ORDER_BITS ); -#ifndef ORDER_BITS_ADDITION - } -#endif } else { diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 8c0aaeee49..44e28cfd68 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -201,10 +201,6 @@ void ivas_mct_core_enc( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t switch_bw, /* i : flag bandwidth switch occurance */ const int16_t lfe_bits /* i : bits spent for LFE */ -#ifndef ORDER_BITS_ADDITION - , - const SBA_MODE sba_mode /* i : SBA mode */ -#endif #ifdef FIX_I1_113 , const int16_t sba_order /* i : Ambisonic (SBA) order */ @@ -494,14 +490,7 @@ void ivas_mct_core_enc( else if ( ivas_format == SBA_FORMAT ) { nAvailBits -= IVAS_FORMAT_SIGNALING_NBITS_SBA; -#ifndef ORDER_BITS_ADDITION - if ( sba_mode != SBA_MODE_SPAR || ivas_total_brate >= IVAS_256k ) - { -#endif nAvailBits -= SBA_ORDER_BITS + SBA_PLANAR_BITS; -#ifndef ORDER_BITS_ADDITION - } -#endif } for ( cpe_id = 0, i = 0; cpe_id < nCPE; cpe_id++ ) @@ -579,18 +568,7 @@ void ivas_mct_core_enc( } #ifdef DEBUGGING -#ifndef ORDER_BITS_ADDITION - if ( ivas_format == SBA_FORMAT && sba_mode == SBA_MODE_SPAR && ivas_total_brate < IVAS_256k ) - { - format_bits = IVAS_FORMAT_SIGNALING_NBITS_SBA; - } - else - { -#endif format_bits = ( ivas_format == MC_FORMAT ? IVAS_FORMAT_SIGNALING_NBITS + MC_LS_SETUP_BITS : IVAS_FORMAT_SIGNALING_NBITS_SBA + SBA_ORDER_BITS + SBA_PLANAR_BITS ); -#ifndef ORDER_BITS_ADDITION - } -#endif mct_bits += hMCT->nBitsMCT + ( hMCT->num_lfe ? 1 : 0 ) + hMCT->nchan_out_woLFE; assert( ( total_brate + ( NBITS_BWIDTH + format_bits + mct_bits + sba_meta + lfe_bits ) * FRAMES_PER_SEC ) == ivas_total_brate ); #endif diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index 7e7bc0e0fc..3f93bbce6b 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -128,10 +128,6 @@ ivas_error ivas_mct_enc( /* joint MCT encoding */ ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE + hMCT->num_lfe, ivas_total_brate, switch_bw, ivas_format == MC_FORMAT ? (int16_t) st_ivas->hLFE->lfe_bits : 0 -#ifndef ORDER_BITS_ADDITION - , - st_ivas->sba_mode -#endif #ifdef FIX_I1_113 , st_ivas->hEncoderConfig->sba_order -- GitLab From 446d6db001981a4a4a7d7d374651f6d045621d87 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Aug 2022 17:46:55 +0200 Subject: [PATCH 8/8] [cleanup] apply clang-format --- apps/encoder.c | 2 +- lib_com/bitstream.c | 8 ++--- lib_com/ivas_entropy_coder_common.c | 8 ++--- lib_com/ivas_spar_com.c | 28 +++++++-------- lib_debug/sba_debug.c | 54 ++++++++++++++--------------- lib_dec/acelp_core_dec.c | 4 +-- lib_dec/evs_dec.c | 10 +++--- lib_dec/ivas_core_dec.c | 12 +++---- lib_dec/ivas_dirac_dec.c | 22 ++++++------ lib_dec/ivas_init_dec.c | 16 ++++----- lib_dec/ivas_reverb.c | 37 ++++++++++---------- lib_dec/ivas_reverb_filter_design.c | 2 +- lib_dec/ivas_reverb_utils.c | 2 +- lib_dec/ivas_sba_rendering.c | 2 +- lib_dec/ivas_spar_decoder.c | 3 +- lib_dec/lib_dec.c | 10 +++--- lib_dec/swb_tbe_dec.c | 4 +-- lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_enc.c | 10 +++--- lib_enc/ivas_mct_core_enc.c | 6 ++-- lib_enc/lib_enc.c | 2 +- 21 files changed, 122 insertions(+), 122 deletions(-) mode change 100644 => 100755 apps/encoder.c mode change 100644 => 100755 lib_com/bitstream.c mode change 100644 => 100755 lib_com/ivas_entropy_coder_common.c mode change 100644 => 100755 lib_com/ivas_spar_com.c mode change 100644 => 100755 lib_debug/sba_debug.c mode change 100644 => 100755 lib_dec/acelp_core_dec.c mode change 100644 => 100755 lib_dec/evs_dec.c mode change 100644 => 100755 lib_dec/ivas_core_dec.c mode change 100644 => 100755 lib_dec/ivas_dirac_dec.c mode change 100644 => 100755 lib_dec/ivas_init_dec.c mode change 100644 => 100755 lib_dec/ivas_reverb.c mode change 100644 => 100755 lib_dec/ivas_reverb_filter_design.c mode change 100644 => 100755 lib_dec/ivas_reverb_utils.c mode change 100644 => 100755 lib_dec/ivas_sba_rendering.c mode change 100644 => 100755 lib_dec/ivas_spar_decoder.c mode change 100644 => 100755 lib_dec/lib_dec.c mode change 100644 => 100755 lib_dec/swb_tbe_dec.c mode change 100644 => 100755 lib_enc/ivas_cpe_enc.c mode change 100644 => 100755 lib_enc/ivas_enc.c mode change 100644 => 100755 lib_enc/ivas_mct_core_enc.c mode change 100644 => 100755 lib_enc/lib_enc.c diff --git a/apps/encoder.c b/apps/encoder.c old mode 100644 new mode 100755 index e11b4465d3..47a6d42e30 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -470,7 +470,7 @@ int main( goto cleanup; } - if( ( error = IVAS_ENC_PrintConfig( hIvasEnc, caConfig.channelAwareModeEnabled ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_ENC_PrintConfig( hIvasEnc, caConfig.channelAwareModeEnabled ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\n IVAS_ENC_PrintConfig failed %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c old mode 100644 new mode 100755 index d53a14593a..3a4ebc80cb --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1975,10 +1975,10 @@ ivas_error preview_indices( } else if ( st_ivas->ivas_format == SBA_FORMAT ) { - /* Read SBA planar flag and SBA order */ - st_ivas->sba_planar = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA] == 1 ); - st_ivas->sba_order = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 2] == 1 ); - st_ivas->sba_order += 2 * ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 1] == 1 ); + /* Read SBA planar flag and SBA order */ + st_ivas->sba_planar = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA] == 1 ); + st_ivas->sba_order = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 2] == 1 ); + st_ivas->sba_order += 2 * ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 1] == 1 ); ivas_sba_config( total_brate, st_ivas->sba_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ), st_ivas->sba_mode ); } } diff --git a/lib_com/ivas_entropy_coder_common.c b/lib_com/ivas_entropy_coder_common.c old mode 100644 new mode 100755 index ef3dc1dab8..1bc72598e2 --- a/lib_com/ivas_entropy_coder_common.c +++ b/lib_com/ivas_entropy_coder_common.c @@ -102,8 +102,8 @@ void ivas_get_cum_freq_model( * Map the ivas_arith_pred_r_consts and ivas_huff_pred_r_consts tables *-----------------------------------------------------------------------------------------*/ -int16_t ivas_map_num_pred_r_to_idx( - const int16_t num_quant_points_pred_r, +int16_t ivas_map_num_pred_r_to_idx( + const int16_t num_quant_points_pred_r, const int16_t active_w_flag ) { int16_t pred_r_to_idx = -1; @@ -160,7 +160,7 @@ int16_t ivas_map_num_pred_r_to_idx( * Map the ivas_arith_drct_r_consts and ivas_huff_drct_r_consts tables *-----------------------------------------------------------------------------------------*/ -int16_t ivas_map_num_drct_r_to_idx( +int16_t ivas_map_num_drct_r_to_idx( const int16_t num_quant_points_drct_r ) { int16_t drct_r_to_idx = -1; @@ -192,7 +192,7 @@ int16_t ivas_map_num_drct_r_to_idx( * Map the ivas_arith_decd_r_consts and ivas_huff_decd_r_consts tables *-----------------------------------------------------------------------------------------*/ -int16_t ivas_map_num_decd_r_to_idx( +int16_t ivas_map_num_decd_r_to_idx( const int16_t num_quant_points_decd_r ) { int16_t decd_r_to_idx = -1; diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c old mode 100644 new mode 100755 index 4bbf3cdfb7..3c908c7980 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -2133,22 +2133,22 @@ void ivas_spar_set_bitrate_config( for ( i = 0; i < pSpar_md_cfg->nchan_transport; i++ ) { - total_bits += ( int16_t )( ivas_spar_br_table_consts[table_idx].evs_brs[i][0] / FRAMES_PER_SEC ); - max_bits += ( int16_t )( ivas_spar_br_table_consts[table_idx].evs_brs[i][1] / FRAMES_PER_SEC ); + total_bits += (int16_t) ( ivas_spar_br_table_consts[table_idx].evs_brs[i][0] / FRAMES_PER_SEC ); + max_bits += (int16_t) ( ivas_spar_br_table_consts[table_idx].evs_brs[i][1] / FRAMES_PER_SEC ); } - pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - total_bits; + pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - total_bits; - pSpar_md_cfg->max_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - max_bits; + pSpar_md_cfg->max_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - max_bits; - md_coding_bits_header = SPAR_NUM_CODING_STRAT_BITS + pSpar_md_cfg->quant_strat_bits; - pSpar_md_cfg->tgt_bits_per_blk -= md_coding_bits_header; - pSpar_md_cfg->max_bits_per_blk -= md_coding_bits_header; + md_coding_bits_header = SPAR_NUM_CODING_STRAT_BITS + pSpar_md_cfg->quant_strat_bits; + pSpar_md_cfg->tgt_bits_per_blk -= md_coding_bits_header; + pSpar_md_cfg->max_bits_per_blk -= md_coding_bits_header; - pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ceilf( ( 1.0f * pSpar_md_cfg->tgt_bits_per_blk * num_bands ) / IVAS_MAX_NUM_BANDS ); - pSpar_md_cfg->max_bits_per_blk = (int16_t) ceilf( ( 1.0f * pSpar_md_cfg->max_bits_per_blk * num_bands ) / IVAS_MAX_NUM_BANDS ); + pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ceilf( ( 1.0f * pSpar_md_cfg->tgt_bits_per_blk * num_bands ) / IVAS_MAX_NUM_BANDS ); + pSpar_md_cfg->max_bits_per_blk = (int16_t) ceilf( ( 1.0f * pSpar_md_cfg->max_bits_per_blk * num_bands ) / IVAS_MAX_NUM_BANDS ); - pSpar_md_cfg->tgt_bits_per_blk += md_coding_bits_header; - pSpar_md_cfg->max_bits_per_blk += md_coding_bits_header; + pSpar_md_cfg->tgt_bits_per_blk += md_coding_bits_header; + pSpar_md_cfg->max_bits_per_blk += md_coding_bits_header; return; } @@ -2179,7 +2179,7 @@ void ivas_spar_bitrate_dist( sum_core_act_bits = 0; for ( i = 0; i < nchan_transport; i++ ) { - core_bits_act[i] = ( int16_t )( ivas_spar_br_table_consts[table_idx].evs_brs[i][0] / FRAMES_PER_SEC ); + core_bits_act[i] = (int16_t) ( ivas_spar_br_table_consts[table_idx].evs_brs[i][0] / FRAMES_PER_SEC ); sum_core_act_bits += core_bits_act[i]; } @@ -2191,7 +2191,7 @@ void ivas_spar_bitrate_dist( { for ( i = 0; i < nchan_transport; i++ ) { - core_range_bits[i] = ( int16_t )( ( ivas_spar_br_table_consts[table_idx].evs_brs[i][2] - ivas_spar_br_table_consts[table_idx].evs_brs[i][0] ) / FRAMES_PER_SEC ); + core_range_bits[i] = (int16_t) ( ( ivas_spar_br_table_consts[table_idx].evs_brs[i][2] - ivas_spar_br_table_consts[table_idx].evs_brs[i][0] ) / FRAMES_PER_SEC ); core_bits_act[i] += min( residual_bits, core_range_bits[i] ); residual_bits -= core_range_bits[i]; @@ -2205,7 +2205,7 @@ void ivas_spar_bitrate_dist( { for ( i = 0; i < nchan_transport; i++ ) { - core_range_bits[i] = ( int16_t )( ( ivas_spar_br_table_consts[table_idx].evs_brs[i][0] - ivas_spar_br_table_consts[table_idx].evs_brs[i][1] ) / FRAMES_PER_SEC ); + core_range_bits[i] = (int16_t) ( ( ivas_spar_br_table_consts[table_idx].evs_brs[i][0] - ivas_spar_br_table_consts[table_idx].evs_brs[i][1] ) / FRAMES_PER_SEC ); } overflow_bits = -residual_bits; diff --git a/lib_debug/sba_debug.c b/lib_debug/sba_debug.c old mode 100644 new mode 100755 index 3526478e4d..fb3b208f3f --- a/lib_debug/sba_debug.c +++ b/lib_debug/sba_debug.c @@ -157,10 +157,10 @@ void ivas_open_agc_debug_files( int16_t agc ) } #endif -static void UpdateWave( - const uint32_t sampleRate, - const uint32_t numChannels, - const uint32_t bps, +static void UpdateWave( + const uint32_t sampleRate, + const uint32_t numChannels, + const uint32_t bps, WAVEFILEOUT *spar_wav ) { uint32_t blockAlignment = 0; @@ -182,12 +182,12 @@ static void UpdateWave( } -void ivas_spar_dump_signal_wav( - const int16_t input_frame, - float **ppPcm, - float pcm_array[IVAS_MAX_NUM_CH][L_FRAME48k], - const int16_t no_channel, - WAVEFILEOUT *wave_file, +void ivas_spar_dump_signal_wav( + const int16_t input_frame, + float **ppPcm, + float pcm_array[IVAS_MAX_NUM_CH][L_FRAME48k], + const int16_t no_channel, + WAVEFILEOUT *wave_file, char *location ) { float tmp_value; @@ -246,10 +246,10 @@ void ivas_spar_dump_signal_wav( } -void ivas_close_sba_decoder_debug_files( - const int32_t fs, - const int16_t n_ch, - const int16_t n_transport, +void ivas_close_sba_decoder_debug_files( + const int32_t fs, + const int16_t n_ch, + const int16_t n_transport, const int16_t pca_ingest_channels ) { if ( spar_foa_dec_wav[0] != NULL ) @@ -311,22 +311,22 @@ void ivas_close_sba_encoder_debug_files( void ) } -void ivas_open_sba_decoder_debug_files( - const int32_t fs, - const int16_t n_ch, +void ivas_open_sba_decoder_debug_files( + const int32_t fs, + const int16_t n_ch, const int16_t n_transport ) { int8_t fb_wav_dump_path[4][MAX_PLUG_IN_FILE_LEN] = { "", "", "", "" }; - + cstrcat( (char *) fb_wav_dump_path[0], sizeof( fb_wav_dump_path[0] ), "dec_out.wav" ); spar_foa_dec_wav[0] = CreateWav( (const char *) fb_wav_dump_path[0], fs, n_ch, 32 /* const uint32_t writeWaveExt */ ); - + cstrcat( (char *) fb_wav_dump_path[1], sizeof( fb_wav_dump_path[1] ), "agc_dec_out.wav" ); spar_foa_dec_wav[1] = CreateWav( (const char *) fb_wav_dump_path[1], fs, n_transport, 16 /* const uint32_t writeWaveExt */ ); - + cstrcat( (char *) fb_wav_dump_path[2], sizeof( fb_wav_dump_path[2] ), "pca_dec.wav" ); spar_foa_dec_wav[2] = CreateWav( (const char *) fb_wav_dump_path[2], fs, n_transport, 16 /* const uint32_t writeWaveExt */ ); - + cstrcat( (char *) fb_wav_dump_path[3], sizeof( fb_wav_dump_path[3] ), "cldfbSynthesis.wav" ); spar_foa_dec_wav[3] = CreateWav( (const char *) fb_wav_dump_path[3], fs, n_transport, 16 /* const uint32_t writeWaveExt */ ); @@ -334,15 +334,15 @@ void ivas_open_sba_decoder_debug_files( } -void ivas_open_sba_encoder_debug_files( - const int32_t fs, - const int16_t n_transport, - const char *file_tag, - const int32_t ivas_total_brate, +void ivas_open_sba_encoder_debug_files( + const int32_t fs, + const int16_t n_transport, + const char *file_tag, + const int32_t ivas_total_brate, const int16_t dtx_on ) { int8_t fb_wav_dump_path[3][MAX_PLUG_IN_FILE_LEN] = { "spar_foa_enc", "spar_foa_enc", "spar_foa_enc" }; - + if ( file_tag != NULL ) { cstrcpy( (char *) file_names[0], sizeof( file_names[0] ), (const char *) file_tag ); diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c old mode 100644 new mode 100755 index b102e302e4..7951f10d54 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -121,7 +121,7 @@ ivas_error acelp_core_dec( float *old_exc_s; /* Start of last excitation frame */ float *p_tdm_Pri_pitch_buf; int16_t local_element_mode; - ivas_error error; + ivas_error error; error = IVAS_ERR_OK; @@ -129,7 +129,7 @@ ivas_error acelp_core_dec( { /* In MDCT-Stereo DTX with mono output, we can skip CNG for the second channel, except for the first inactive frame following an active period */ return error; - } + } wmops_sub_start( "acelp_core_dec" ); diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c old mode 100644 new mode 100755 index ce3015edf4..b51ed8d6ea --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -103,7 +103,7 @@ ivas_error evs_dec( st->extl = -1; } - output_frame = ( int16_t )( st->output_Fs / FRAMES_PER_SEC ); + output_frame = (int16_t) ( st->output_Fs / FRAMES_PER_SEC ); core_switching_flag = 0; sharpFlag = 0; @@ -410,7 +410,7 @@ ivas_error evs_dec( if ( ( st->extl != st->last_extl || ( st->extl == st->last_extl && ( st->core ^ st->last_core ) == HQ_CORE ) ) && !( st->extl == SWB_CNG && st->last_extl == SWB_TBE ) ) { /* switching between BWE and TBE technologies */ - incr = ( int16_t )( L_FRAME / ( tmps + 0.5f ) ); + incr = (int16_t) ( L_FRAME / ( tmps + 0.5f ) ); for ( i = 0; i < tmps; i++ ) { hb_synth[i] *= sin_table256[i * incr]; @@ -421,7 +421,7 @@ ivas_error evs_dec( else if ( tmps < st->old_bwe_delay ) { /* the previous frame was TBE on top of ACELP@16kHz and the current frame is TBE on top of ACELP@12.8kHz */ - incr = ( int16_t )( L_FRAME / ( tmps + 0.5f ) ); + incr = (int16_t) ( L_FRAME / ( tmps + 0.5f ) ); for ( i = 0; i < tmps; i++ ) { tmp_buffer[i] = st->hb_prev_synth_buffer[i] * sin_table256[255 - i * incr] + @@ -433,7 +433,7 @@ ivas_error evs_dec( else if ( tmps > st->old_bwe_delay ) { /* the previous frame was TBE on top of ACELP@12.8kHz and the current frame is TBE on top of ACELP@16kHz */ - incr = ( int16_t )( L_FRAME / ( st->old_bwe_delay + 0.5f ) ); + incr = (int16_t) ( L_FRAME / ( st->old_bwe_delay + 0.5f ) ); for ( i = 0; i < st->old_bwe_delay; i++ ) { tmp_buffer[i] = st->hb_prev_synth_buffer[i] * sin_table256[255 - i * incr]; @@ -833,7 +833,7 @@ ivas_error evs_dec( { if ( !st->bfi && st->core == ACELP_CORE && ( st->tec_flag || st->tfa_flag ) && st->output_Fs > 8000 && st->hTECDec != NULL ) { - procTecTfa_TBE( hb_synth, st->hTECDec->pGainTemp, st->tfa_flag, st->last_core, ( int16_t )( output_frame / N_TEC_TFA_SUBFR ), st->tec_flag == 2 ? 1 : 0 ); + procTecTfa_TBE( hb_synth, st->hTECDec->pGainTemp, st->tfa_flag, st->last_core, (int16_t) ( output_frame / N_TEC_TFA_SUBFR ), st->tec_flag == 2 ? 1 : 0 ); } if ( ( ( ( !st->bfi || st->last_core == ACELP_CORE ) && st->core == ACELP_CORE ) || diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c old mode 100644 new mode 100755 index 03136783c4..de87b4c557 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -142,7 +142,7 @@ ivas_error ivas_core_dec( } output_Fs = sts[0]->output_Fs; - output_frame = ( int16_t )( output_Fs / FRAMES_PER_SEC ); + output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); for ( n = 0; n < n_channels; n++ ) { @@ -269,10 +269,10 @@ ivas_error ivas_core_dec( } if ( sts[0]->L_frame != L_FRAME16k ) { - ovl = ( int16_t )( STEREO_DFT32MS_OVL_16k * ( (float) sts[0]->L_frame / L_FRAME16k ) ); + ovl = (int16_t) ( STEREO_DFT32MS_OVL_16k * ( (float) sts[0]->L_frame / L_FRAME16k ) ); lerp( hCPE->input_mem_LB[0], hCPE->input_mem_LB[0], ovl, STEREO_DFT32MS_OVL_16k ); - fade_len = ( int16_t )( STEREO_MDCT2DFT_FADE_LEN_48k * ( (float) sts[0]->L_frame / L_FRAME16k ) ); + fade_len = (int16_t) ( STEREO_MDCT2DFT_FADE_LEN_48k * ( (float) sts[0]->L_frame / L_FRAME16k ) ); lerp( hCPE->old_outLB_mdct, hCPE->old_outLB_mdct, fade_len, STEREO_MDCT2DFT_FADE_LEN_48k ); } } @@ -622,7 +622,7 @@ ivas_error ivas_core_dec( ( st->extl != st->last_extl || ( st->extl == st->last_extl && ( st->core ^ st->last_core ) == HQ_CORE ) ) && !( st->extl == SWB_CNG && st->last_extl == SWB_TBE ) && ( st->element_mode != IVAS_CPE_TD || ( hCPE->element_mode == IVAS_CPE_TD && tdm_LRTD_flag ) ) ) { /* switching between BWE and TBE technologies */ - incr = ( int16_t )( L_FRAME / ( tmps + 0.5f ) ); + incr = (int16_t) ( L_FRAME / ( tmps + 0.5f ) ); for ( i = 0; i < tmps; i++ ) { hb_synth[n][i] *= sin_table256[i * incr]; @@ -633,7 +633,7 @@ ivas_error ivas_core_dec( else if ( tmps < st->old_bwe_delay ) { /* the previous frame was TBE on top of ACELP@16kHz and the current frame is TBE on top of ACELP@12.8kHz */ - incr = ( int16_t )( L_FRAME / ( tmps + 0.5f ) ); + incr = (int16_t) ( L_FRAME / ( tmps + 0.5f ) ); for ( i = 0; i < tmps; i++ ) { tmp_buffer[i] = st->hb_prev_synth_buffer[i] * sin_table256[255 - i * incr] + @@ -645,7 +645,7 @@ ivas_error ivas_core_dec( else if ( tmps > st->old_bwe_delay ) { /* the previous frame was TBE on top of ACELP@12.8kHz and the current frame is TBE on top of ACELP@16kHz */ - incr = ( int16_t )( L_FRAME / ( st->old_bwe_delay + 0.5f ) ); + incr = (int16_t) ( L_FRAME / ( st->old_bwe_delay + 0.5f ) ); for ( i = 0; i < st->old_bwe_delay; i++ ) { tmp_buffer[i] = st->hb_prev_synth_buffer[i] * sin_table256[255 - i * incr]; diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c old mode 100644 new mode 100755 index 02fa8c02e6..a8022aaa5d --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -260,8 +260,8 @@ ivas_error ivas_dirac_dec_config( if ( flag_config == DIRAC_OPEN ) { - hDirAC->slot_size = ( int16_t )( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); - hDirAC->subframe_nbslots = ( int16_t )( CLDFB_NO_COL_MAX * 5.f / 20.f + 0.5f ); + hDirAC->slot_size = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); + hDirAC->subframe_nbslots = (int16_t) ( CLDFB_NO_COL_MAX * 5.f / 20.f + 0.5f ); hDirAC->nb_subframes = CLDFB_NO_COL_MAX / hDirAC->subframe_nbslots; assert( hDirAC->nb_subframes <= MAX_PARAM_SPATIAL_SUBFRAMES ); } @@ -309,7 +309,7 @@ ivas_error ivas_dirac_dec_config( if ( flag_config == DIRAC_OPEN ) { - hDirAC->num_freq_bands = ( int16_t )( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); + hDirAC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hDirAC->frequency_axis = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->frequency_axis, 0.0f, hDirAC->num_freq_bands ); @@ -1282,7 +1282,7 @@ void ivas_dirac_dec_read_BS( if ( !st->bfi && ivas_total_brate > IVAS_SID_4k4 ) { next_bit_pos_orig = st->next_bit_pos; - st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 ); + st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); /* 1 bit flag for signaling metadata to read */ b = st->bit_stream[( st->next_bit_pos )--]; @@ -1388,7 +1388,7 @@ void ivas_dirac_dec_read_BS( next_bit_pos_orig = st->next_bit_pos; /* subtract mode signaling bits, since bitstream was moved after mode reading */ - st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); + st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); /* if we start with a SID frame, we need to init the azi/ele arrays.*/ if ( st->ini_frame == 0 ) @@ -1616,8 +1616,8 @@ void ivas_qmetadata_to_dirac( for ( b = band_start; b < band_end; b++ ) { tmp_write_idx_band = tmp_write_idx_param_band; - azi = ( int16_t )( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); - ele = ( int16_t )( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); + azi = (int16_t) ( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); + ele = (int16_t) ( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); /* limit the elevation to [-90, 90] */ ele = min( 90, ele ); ele = max( -90, ele ); @@ -1794,10 +1794,10 @@ void ivas_dirac_dec( { for ( i = 0; i < output_frame; i++ ) { - tmp[nchan_transport * i + n] = ( int16_t )( output_f[n][i] + 0.5f ); + tmp[nchan_transport * i + n] = (int16_t) ( output_f[n][i] + 0.5f ); } } - sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, ( int16_t )( output_frame * 0.05 ) ); + sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, (int16_t) ( output_frame * 0.05 ) ); dbgwrite( tmp, sizeof( int16_t ), nchan_transport * output_frame, 1, file_name ); } #endif @@ -3294,8 +3294,8 @@ static void computeDirectionAngles( z = *( intensity_real_z++ ) * intensityNorm; } radius = sqrtf( x * x + y * y ); - azimuth[k] = ( int16_t )( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); - elevation[k] = ( int16_t )( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); + azimuth[k] = (int16_t) ( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); + elevation[k] = (int16_t) ( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); } return; diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c old mode 100644 new mode 100755 index 3a0808144a..a682cd3c58 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -114,14 +114,14 @@ ivas_error ivas_dec_setup( } else if ( st_ivas->ivas_format == SBA_FORMAT ) { - /* read Ambisonic (SBA) planar flag */ - st_ivas->sba_planar = st_ivas->bit_stream[num_bits_read]; - num_bits_read += SBA_PLANAR_BITS; - - /* read Ambisonic (SBA) order */ - st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; - st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; - num_bits_read += SBA_ORDER_BITS; + /* read Ambisonic (SBA) planar flag */ + st_ivas->sba_planar = st_ivas->bit_stream[num_bits_read]; + num_bits_read += SBA_PLANAR_BITS; + + /* read Ambisonic (SBA) order */ + st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; + st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; + num_bits_read += SBA_ORDER_BITS; if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate && ivas_total_brate > IVAS_SID_4k4 ) { if ( ( error = ivas_sba_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_reverb.c b/lib_dec/ivas_reverb.c old mode 100644 new mode 100755 index 42a8cb81d3..e25eacff54 --- a/lib_dec/ivas_reverb.c +++ b/lib_dec/ivas_reverb.c @@ -48,7 +48,7 @@ * Local constants *------------------------------------------------------------------------------------------*/ -#define INNER_BLK_SIZE 80 /* size of data blocks used for more efficient delay line and IIR filter processing */ +#define INNER_BLK_SIZE 80 /* size of data blocks used for more efficient delay line and IIR filter processing */ /* should be a divisor of the frame length at any sampling rate and an even number*/ #define FFT_FILTER_WND_FLAT_REGION ( 0.40f ) /* flat section (==1) length of FFT filter window, in proportion to overlap */ #define FFT_FILTER_WND_TRANS_REGION ( 0.15f ) /* transition (1->0) length of FFT filter window, in proportion to overlap */ @@ -288,7 +288,7 @@ static ivas_error set_base_config( * Computes the downmix gain *-----------------------------------------------------------------------------------------*/ -static float calc_dmx_gain(void) +static float calc_dmx_gain( void ) { const float dist = DEFAULT_SRC_DIST; return sqrtf( 4.0f * EVS_PI * dist * dist / 0.001f ); @@ -747,8 +747,8 @@ static void clear_buffers( * Sets frame size and fft-filter related sizes *-----------------------------------------------------------------------------------------*/ -static void set_fft_and_datablock_sizes( - REVERB_HANDLE pState, +static void set_fft_and_datablock_sizes( + REVERB_HANDLE pState, const int16_t subframe_len ) { pState->full_block_size = subframe_len; @@ -784,13 +784,13 @@ static void set_fft_and_datablock_sizes( * Sets reverb acoustic data (room acoustics and HRTF), interpolating it to the filter grid *-----------------------------------------------------------------------------------------*/ -static void set_reverb_acoustic_data( - ivas_reverb_params_t *pParams, - const AUDIO_CONFIG input_audio_config, - const HRTFS_HANDLE hHrtf, - ivas_roomAcoustics_t *pRoomAcoustics, - const int16_t subframe_len, - const int16_t nr_fc_input, +static void set_reverb_acoustic_data( + ivas_reverb_params_t *pParams, + const AUDIO_CONFIG input_audio_config, + const HRTFS_HANDLE hHrtf, + ivas_roomAcoustics_t *pRoomAcoustics, + const int16_t subframe_len, + const int16_t nr_fc_input, const int16_t nr_fc_fft_filter ) { int16_t nr_out_ch, hrtf_idx, offset, iter_idx, bin_idx; @@ -869,8 +869,8 @@ static void set_reverb_acoustic_data( * Sets up feedback delay network system *-----------------------------------------------------------------------------------------*/ -static ivas_error setup_FDN_branches( - REVERB_HANDLE pState, +static ivas_error setup_FDN_branches( + REVERB_HANDLE pState, ivas_reverb_params_t *pParams ) { int16_t nr_coefs, branch_idx, channel_idx; @@ -936,11 +936,11 @@ static ivas_error setup_FDN_branches( *------------------------------------------------------------------------*/ ivas_error ivas_reverb_open( - REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ - const AUDIO_CONFIG input_audio_config,/* i : reverb. input audio configuration */ - const HRTFS_HANDLE hHrtf, /* i : HRTF handle */ - RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ - const int32_t output_Fs /* i : output sampling rate */ + REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ + const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ + const HRTFS_HANDLE hHrtf, /* i : HRTF handle */ + RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ + const int32_t output_Fs /* i : output sampling rate */ ) { ivas_error error; @@ -1438,4 +1438,3 @@ ivas_error ivas_reverb_process( return IVAS_ERR_OK; } - diff --git a/lib_dec/ivas_reverb_filter_design.c b/lib_dec/ivas_reverb_filter_design.c old mode 100644 new mode 100755 index 0ddb3fbbe1..0654dbfa8a --- a/lib_dec/ivas_reverb_filter_design.c +++ b/lib_dec/ivas_reverb_filter_design.c @@ -60,7 +60,7 @@ /*-------------------------------------------------------------------* * calc_min_phase() * - * Compute the minimum phase spectrum that can be derived + * Compute the minimum phase spectrum that can be derived * from the amplitude spectrum of the input. *-------------------------------------------------------------------*/ diff --git a/lib_dec/ivas_reverb_utils.c b/lib_dec/ivas_reverb_utils.c old mode 100644 new mode 100755 index eb81313426..cbc62ab542 --- a/lib_dec/ivas_reverb_utils.c +++ b/lib_dec/ivas_reverb_utils.c @@ -113,7 +113,7 @@ void ivas_reverb_prepare_cldfb_params( } ivas_reverb_get_fastconv_hrtf_set_energies( input_audio_config, use_brir, output_Fs, avg_pwr_left, avg_pwr_right ); - + for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) { pOutput_ene[idx] *= 0.5f * ( avg_pwr_left[idx] + avg_pwr_right[idx] ) * dmx_gain_2; diff --git a/lib_dec/ivas_sba_rendering.c b/lib_dec/ivas_sba_rendering.c old mode 100644 new mode 100755 index de61f288a9..41c46bccbe --- a/lib_dec/ivas_sba_rendering.c +++ b/lib_dec/ivas_sba_rendering.c @@ -313,7 +313,7 @@ void ivas_sba_mix_matrix_determiner( } } - /* AGC */ + /* AGC */ nchan_transport = hSpar->hMdDec->spar_md_cfg.nchan_transport; nchan_out = nchan_transport; ivas_agc_dec_process( hSpar->hAgcDec, output, output, nchan_transport, output_frame ); diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c old mode 100644 new mode 100755 index 5692e88314..9842097187 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -907,7 +907,8 @@ void ivas_spar_dec_upmixer( for ( i = 0; i < nchan_transport; i++ ) { tmp = roundf( output[i][j] * PCM16_TO_FLT_FAC ); - pcm = ( tmp > MAX16B_FLT ) ? MAX16B : ( tmp < MIN16B_FLT ) ? MIN16B : (short) tmp; + pcm = ( tmp > MAX16B_FLT ) ? MAX16B : ( tmp < MIN16B_FLT ) ? MIN16B + : (short) tmp; dbgwrite( &pcm, sizeof( int16_t ), 1, 1, "dmx_dec.raw" ); } } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c old mode 100644 new mode 100755 index 4128717745..fd27442c37 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -966,12 +966,12 @@ ivas_error IVAS_DEC_GetRenderConfig( hRCin = hIvasDec->st_ivas->hRenderConfig; #ifdef DEBUGGING - switch (hRCin->renderer_type_override) + switch ( hRCin->renderer_type_override ) { - case RENDER_TYPE_OVERRIDE_CREND : + case RENDER_TYPE_OVERRIDE_CREND: hRCout->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; break; - case RENDER_TYPE_OVERRIDE_FASTCONV : + case RENDER_TYPE_OVERRIDE_FASTCONV: hRCout->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; break; default: @@ -1597,7 +1597,7 @@ const char *IVAS_DEC_GetErrorMessage( case IVAS_ERR_RECONFIGURE_NOT_SUPPORTED: return "reconfigure not supported"; case IVAS_ERR_UNEXPECTED_NULL_POINTER: - return "unexpected NULL pointer"; + return "unexpected NULL pointer"; #ifdef DEBUGGING case IVAS_ERR_INVALID_FORCE_MODE: return "invalid force mode"; @@ -2058,7 +2058,7 @@ ivas_error IVAS_DEC_SetForcedRendMode( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetSbaDebugParams( - const IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *numOutputChannels, int16_t *numTransportChannels, int16_t *pca_ingest_channels ) diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c old mode 100644 new mode 100755 index 7d327f0057..03d9162e34 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -1015,11 +1015,11 @@ void swb_tbe_dec( lpc_shb[0] = 1.0; if ( st->extl_brate == SWB_TBE_1k10 || st->extl_brate == SWB_TBE_1k75 ) { - vind = ( int16_t )( mixFactors * ( ( 1 << NUM_BITS_SHB_VF ) - 1 ) ); + vind = (int16_t) ( mixFactors * ( ( 1 << NUM_BITS_SHB_VF ) - 1 ) ); } else { - vind = ( int16_t )( mixFactors * ( 1 << NUM_BITS_SHB_VF ) ); + vind = (int16_t) ( mixFactors * ( 1 << NUM_BITS_SHB_VF ) ); } /* Determine formant PF strength */ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c old mode 100644 new mode 100755 index 03a911d69f..f2d3241979 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -569,7 +569,7 @@ ivas_error ivas_cpe_enc( stereo_dft_enc_update( hCPE->hStereoDft, min( SWB, sts[0]->max_bwidth ) #ifdef DEBUG_MODE_DFT - , + , 0 #endif ); diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c old mode 100644 new mode 100755 index 461eceb4b6..75ffc5212d --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -196,13 +196,13 @@ ivas_error ivas_enc( return error; } } - st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; + st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; - /* Write SBA planar flag */ - push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_planar, SBA_PLANAR_BITS ); + /* Write SBA planar flag */ + push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_planar, SBA_PLANAR_BITS ); - /* Write SBA order */ - push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_order, SBA_ORDER_BITS ); + /* Write SBA order */ + push_indice( st->hBstr, IND_SMODE, hEncoderConfig->sba_order, SBA_ORDER_BITS ); } else { diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c old mode 100644 new mode 100755 index 44e28cfd68..1a30b231e1 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -203,7 +203,7 @@ void ivas_mct_core_enc( const int16_t lfe_bits /* i : bits spent for LFE */ #ifdef FIX_I1_113 , - const int16_t sba_order /* i : Ambisonic (SBA) order */ + const int16_t sba_order /* i : Ambisonic (SBA) order */ #endif ) { @@ -490,7 +490,7 @@ void ivas_mct_core_enc( else if ( ivas_format == SBA_FORMAT ) { nAvailBits -= IVAS_FORMAT_SIGNALING_NBITS_SBA; - nAvailBits -= SBA_ORDER_BITS + SBA_PLANAR_BITS; + nAvailBits -= SBA_ORDER_BITS + SBA_PLANAR_BITS; } for ( cpe_id = 0, i = 0; cpe_id < nCPE; cpe_id++ ) @@ -568,7 +568,7 @@ void ivas_mct_core_enc( } #ifdef DEBUGGING - format_bits = ( ivas_format == MC_FORMAT ? IVAS_FORMAT_SIGNALING_NBITS + MC_LS_SETUP_BITS : IVAS_FORMAT_SIGNALING_NBITS_SBA + SBA_ORDER_BITS + SBA_PLANAR_BITS ); + format_bits = ( ivas_format == MC_FORMAT ? IVAS_FORMAT_SIGNALING_NBITS + MC_LS_SETUP_BITS : IVAS_FORMAT_SIGNALING_NBITS_SBA + SBA_ORDER_BITS + SBA_PLANAR_BITS ); mct_bits += hMCT->nBitsMCT + ( hMCT->num_lfe ? 1 : 0 ) + hMCT->nchan_out_woLFE; assert( ( total_brate + ( NBITS_BWIDTH + format_bits + mct_bits + sba_meta + lfe_bits ) * FRAMES_PER_SEC ) == ivas_total_brate ); #endif diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c old mode 100644 new mode 100755 index 6d53ce3ffd..760ae0d353 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -707,7 +707,7 @@ static ivas_error configureEncoder( { if ( !is_IVAS_bitrate( hEncoderConfig->ivas_total_brate ) ) { - if( hEncoderConfig->Opt_SC_VBR ) + if ( hEncoderConfig->Opt_SC_VBR ) { return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Incorrect bitrate specification in IVAS [bps]: %d", ACELP_5k90 ); } -- GitLab