From 5ff3fb0a9d51369f85f4b49c46727492b9b5630c Mon Sep 17 00:00:00 2001 From: "Malenovsky, Vladimir" Date: Tue, 25 Nov 2025 13:51:49 +0100 Subject: [PATCH 1/4] remove unused psNoiseGen and related components --- Workspace_msvc/lib_isar.vcxproj | 1 - Workspace_msvc/lib_isar.vcxproj.filters | 3 -- lib_com/options.h | 1 + lib_dec/lib_dec.c | 18 ++++---- lib_isar/isar_NoiseGen.c | 55 ------------------------- lib_isar/isar_lcld_decoder.c | 28 ++++++++++--- lib_isar/isar_lcld_prot.h | 2 + 7 files changed, 34 insertions(+), 74 deletions(-) delete mode 100644 lib_isar/isar_NoiseGen.c diff --git a/Workspace_msvc/lib_isar.vcxproj b/Workspace_msvc/lib_isar.vcxproj index 5bee827041..0a4ed6c01f 100644 --- a/Workspace_msvc/lib_isar.vcxproj +++ b/Workspace_msvc/lib_isar.vcxproj @@ -148,7 +148,6 @@ - diff --git a/Workspace_msvc/lib_isar.vcxproj.filters b/Workspace_msvc/lib_isar.vcxproj.filters index b2dc7ffc70..a416b60b55 100644 --- a/Workspace_msvc/lib_isar.vcxproj.filters +++ b/Workspace_msvc/lib_isar.vcxproj.filters @@ -24,9 +24,6 @@ isar_c - - isar_c - isar_c diff --git a/lib_com/options.h b/lib_com/options.h index 9e2052b43b..249ebaeb3e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -185,6 +185,7 @@ #define FIX_1437_LC3PLUS_EXTREND_HIRES /* FhG: fix external renderer split bitstream header writing causing a crash for LC3plus High-res mode */ #define FIX_1318_ROOM_SIZE_CMD_LINE /* Philips/Nokia: Default room sizes support */ +#define FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR /* Dolby: remove unused noise generator from ISAR */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index de95304301..6ac4cb365c 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3742,15 +3742,15 @@ static ivas_error feedAcousticEnvPI( st_ivas = hIvasDec->st_ivas; #ifdef DEBUGGING - hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; - if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) - { - hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; - } - if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) - { - hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; - } + //hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; + //if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) + //{ + // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; + //} + //if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) + //{ + // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; + //} #endif /* Ignore if AE ID already in use */ if ( hRenderConfig->roomAcoustics.aeID == hAcoustEnvPI.aeid ) diff --git a/lib_isar/isar_NoiseGen.c b/lib_isar/isar_NoiseGen.c deleted file mode 100644 index 963cbd377a..0000000000 --- a/lib_isar/isar_NoiseGen.c +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#include -#include "options.h" -#include -#include "prot.h" -#include "isar_lcld_prot.h" -#include "wmc_auto.h" - - -/*------------------------------------------------------------------------------------------* - * Function DeleteNoiseGen() - * - * - *------------------------------------------------------------------------------------------*/ - -void DeleteNoiseGen( NoiseGen *psNoiseGen ) -{ - free( psNoiseGen->pfNoiseBuffer ); - free( psNoiseGen ); - - return; -} - -extern float GetNoise( NoiseGen *psNoiseGen ); diff --git a/lib_isar/isar_lcld_decoder.c b/lib_isar/isar_lcld_decoder.c index 8d6931541f..6cbdeda1c7 100644 --- a/lib_isar/isar_lcld_decoder.c +++ b/lib_isar/isar_lcld_decoder.c @@ -101,8 +101,9 @@ struct LCLD_DECODER int32_t ***pppiQLCLDImag; PredictionDecoder *psPredictionDecoder; - +#ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR NoiseGen *psNoiseGen; +#endif }; @@ -582,7 +583,9 @@ ivas_error CreateLCLDDecoder( { return error; } +#ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR psLCLDDecoder->psNoiseGen = NULL; /* CreateNoiseGen(); No noise fill for now*/ +#endif *psLCLDDecoder_out = psLCLDDecoder; return IVAS_ERR_OK; @@ -744,10 +747,12 @@ void DeleteLCLDDecoder( psLCLDDecoder->psPredictionDecoder = NULL; } +#ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR if ( psLCLDDecoder->psNoiseGen != NULL ) { DeleteNoiseGen( psLCLDDecoder->psNoiseGen ); } +#endif free( psLCLDDecoder ); } @@ -766,7 +771,11 @@ static void ApplyRMSEnvelope( const int32_t iNumBands, const int32_t *piBandwidt static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, int32_t **ppiSignReal, int32_t **ppiSignImag, float **ppfReal, float **ppfImag, const int32_t *piBandwidths ); -static void InvQuantizeSpectrum( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, int32_t **ppiAlloc, int32_t **ppiQReal, int32_t **ppiQImag, float **ppfReal, float **ppfImag, NoiseGen *psNoiseGen ); +static void InvQuantizeSpectrum( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, int32_t **ppiAlloc, int32_t **ppiQReal, int32_t **ppiQImag, float **ppfReal, float **ppfImag +#ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR + , NoiseGen *psNoiseGen +#endif +); static void InvMSCoding( const int32_t iNumBlocks, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiffs, const int32_t *piMSPredCoefs, float ***pppfReal, float ***pppfImag ); @@ -1022,8 +1031,11 @@ int32_t DecodeLCLDFrame( psLCLDDecoder->pppiAlloc[n], psLCLDDecoder->pppiQLCLDReal[n], psLCLDDecoder->pppiQLCLDImag[n], - pppfLCLDReal[n], pppfLCLDImag[n], - psLCLDDecoder->psNoiseGen ); + pppfLCLDReal[n], pppfLCLDImag[n] +#ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR + ,psLCLDDecoder->psNoiseGen +#endif + ); ReplaceSign( psLCLDDecoder->iNumBlocks, psLCLDDecoder->iNumBands, psLCLDDecoder->pppiLCLDSignReal[n], @@ -1172,8 +1184,10 @@ static void InvQuantizeSpectrum( int32_t **ppiQReal, int32_t **ppiQImag, float **ppfReal, - float **ppfImag, - NoiseGen *psNoiseGen /* Pass in NULL to switch off noise gen */ + float **ppfImag +#ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR + ,NoiseGen *psNoiseGen /* Pass in NULL to switch off noise gen */ +#endif ) { int32_t b, k, n; @@ -1209,6 +1223,7 @@ static void InvQuantizeSpectrum( iFBOffset++; } } +#ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR else if ( psNoiseGen != NULL ) { for ( m = 0; m < piBandwidths[b]; m++ ) @@ -1219,6 +1234,7 @@ static void InvQuantizeSpectrum( iFBOffset++; } } +#endif else { iFBOffset += piBandwidths[b]; diff --git a/lib_isar/isar_lcld_prot.h b/lib_isar/isar_lcld_prot.h index 3e9c0527a9..95c6adcb34 100644 --- a/lib_isar/isar_lcld_prot.h +++ b/lib_isar/isar_lcld_prot.h @@ -164,6 +164,7 @@ int32_t CountMSBits( const int32_t *piMSPredCoef ); +#ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR /*----------------------------------------------------------------------------------* * NoiseGen prototypes @@ -192,6 +193,7 @@ inline float GetNoise( NoiseGen *psNoiseGen ) return fNoiseSample; } +#endif /*----------------------------------------------------------------------------------* * PereptualModel prototypes -- GitLab From 8c6f3206671cfe1edde2fd7f1e8048d4919f0715 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 25 Nov 2025 13:54:16 +0100 Subject: [PATCH 2/4] clang format --- lib_dec/lib_dec.c | 14 +++++++------- lib_isar/isar_lcld_decoder.c | 9 ++++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 6ac4cb365c..4756d246b2 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3742,15 +3742,15 @@ static ivas_error feedAcousticEnvPI( st_ivas = hIvasDec->st_ivas; #ifdef DEBUGGING - //hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; - //if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) + // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; + // if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) //{ - // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; - //} - //if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) + // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; + // } + // if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) //{ - // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; - //} + // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; + // } #endif /* Ignore if AE ID already in use */ if ( hRenderConfig->roomAcoustics.aeID == hAcoustEnvPI.aeid ) diff --git a/lib_isar/isar_lcld_decoder.c b/lib_isar/isar_lcld_decoder.c index 6cbdeda1c7..773adb6acd 100644 --- a/lib_isar/isar_lcld_decoder.c +++ b/lib_isar/isar_lcld_decoder.c @@ -773,7 +773,8 @@ static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, static void InvQuantizeSpectrum( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, int32_t **ppiAlloc, int32_t **ppiQReal, int32_t **ppiQImag, float **ppfReal, float **ppfImag #ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR - , NoiseGen *psNoiseGen + , + NoiseGen *psNoiseGen #endif ); @@ -1033,7 +1034,8 @@ int32_t DecodeLCLDFrame( psLCLDDecoder->pppiQLCLDImag[n], pppfLCLDReal[n], pppfLCLDImag[n] #ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR - ,psLCLDDecoder->psNoiseGen + , + psLCLDDecoder->psNoiseGen #endif ); @@ -1186,7 +1188,8 @@ static void InvQuantizeSpectrum( float **ppfReal, float **ppfImag #ifndef FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR - ,NoiseGen *psNoiseGen /* Pass in NULL to switch off noise gen */ + , + NoiseGen *psNoiseGen /* Pass in NULL to switch off noise gen */ #endif ) { -- GitLab From 103d853f77da407de0cdac5c088295dc11bfa4a6 Mon Sep 17 00:00:00 2001 From: "Malenovsky, Vladimir" Date: Tue, 25 Nov 2025 14:05:10 +0100 Subject: [PATCH 3/4] put back debugging code --- lib_dec/lib_dec.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 4756d246b2..7507719c07 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3742,15 +3742,15 @@ static ivas_error feedAcousticEnvPI( st_ivas = hIvasDec->st_ivas; #ifdef DEBUGGING - // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; - // if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) - //{ - // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; - // } - // if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) - //{ - // hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; - // } + hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; + if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) + { + hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; + } + if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) + { + hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; + } #endif /* Ignore if AE ID already in use */ if ( hRenderConfig->roomAcoustics.aeID == hAcoustEnvPI.aeid ) -- GitLab From 772a41c4b29ce8bcd6e825d863a38cf154b4d00e Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 25 Nov 2025 14:12:09 +0100 Subject: [PATCH 4/4] clang format --- lib_dec/lib_dec.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 7507719c07..de95304301 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3742,15 +3742,15 @@ static ivas_error feedAcousticEnvPI( st_ivas = hIvasDec->st_ivas; #ifdef DEBUGGING - hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; - if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) + hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; + if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) { - hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; - } - if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) + hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_FASTCONV; + } + if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) { - hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; - } + hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; + } #endif /* Ignore if AE ID already in use */ if ( hRenderConfig->roomAcoustics.aeID == hAcoustEnvPI.aeid ) -- GitLab