From 4d43b592102caf86fe05724724bc1f74c414693b Mon Sep 17 00:00:00 2001 From: ragot Date: Thu, 22 Sep 2022 02:12:51 +0200 Subject: [PATCH] fixed handling of PCA input/output --- lib_com/ivas_cnst.h | 4 ++++ lib_dec/ivas_spar_decoder.c | 12 ------------ lib_enc/ivas_spar_encoder.c | 12 ------------ 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 6cfb9fb305..6d37913a10 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1004,7 +1004,11 @@ enum /* IVAS 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_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 4f48e10a09..493ca539a0 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -971,22 +971,10 @@ void ivas_spar_dec_upmixer( if ( hSpar->hPCA != NULL ) { -#ifdef SPAR_SCALING_HARMONIZATION - for ( out_ch = 0; out_ch < num_in_ingest; out_ch++ ) - { - v_multc( output[out_ch], MDFT_NORM_SCALING, output[out_ch], output_frame ); - } -#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 /* Dump audio signal after ivas_pca_dec */ ivas_spar_dump_signal_wav( output_frame, NULL, output, num_in_ingest, spar_foa_dec_wav[2], "ivas_pca_dec()" ); -#endif -#ifdef SPAR_SCALING_HARMONIZATION - for ( out_ch = 0; out_ch < num_in_ingest; out_ch++ ) - { - v_multc( output[out_ch], PCM16_TO_FLT_FAC, output[out_ch], output_frame ); - } #endif } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 6e05d741ad..46e957a3f1 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -789,19 +789,7 @@ static ivas_error ivas_spar_enc_process( if ( hSpar->hPCA != NULL ) { -#ifdef SPAR_SCALING_HARMONIZATION - for ( int16_t out_ch = 0; out_ch < FOA_CHANNELS; out_ch++ ) - { - v_multc( p_pcm_tmp[out_ch], MDFT_NORM_SCALING, p_pcm_tmp[out_ch], input_frame ); - } -#endif ivas_pca_enc( hEncoderConfig, hSpar->hPCA, hMetaData, p_pcm_tmp, input_frame, FOA_CHANNELS ); -#ifdef SPAR_SCALING_HARMONIZATION - for ( int16_t out_ch = 0; out_ch < FOA_CHANNELS; out_ch++ ) - { - v_multc( p_pcm_tmp[out_ch], PCM16_TO_FLT_FAC, p_pcm_tmp[out_ch], input_frame ); - } -#endif } else { -- GitLab