From 9890784fc887e8de1aeadf596c2a1f0e4b857389 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 25 Nov 2025 14:02:30 +0100 Subject: [PATCH 1/3] remove unused psNoiseGen and related components from ISAR --- lib_com/options.h | 1 + lib_isar/isar_NoiseGen.c | 55 ------------------------------------ lib_isar/isar_lcld_decoder.c | 28 ++++++++++++++---- lib_isar/isar_lcld_prot.h | 6 ++-- 4 files changed, 27 insertions(+), 63 deletions(-) delete mode 100644 lib_isar/isar_NoiseGen.c diff --git a/lib_com/options.h b/lib_com/options.h index 0f23d8082..75ccc1d63 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -116,6 +116,7 @@ #define NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Nokia: fix basop issue 2233: Fix differing rtpdump streams */ #define NONBE_FIX_2237_ZERO_CURR_NOISE_PROBLEM /* FhG: Modify sum of hTonalMDCTConc->curr_noise_nrg to avoid inaccurate zero */ +#define FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR /* Dolby: Remove unused psNoiseGen from ISAR */ /* ################### End FIXES switches ########################### */ diff --git a/lib_isar/isar_NoiseGen.c b/lib_isar/isar_NoiseGen.c deleted file mode 100644 index 363e758ff..000000000 --- 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_fx.h" -#include "isar_lcld_prot.h" -#include "wmc_auto.h" - - -/*------------------------------------------------------------------------------------------* - * Function DeleteNoiseGen() - * - * - *------------------------------------------------------------------------------------------*/ - -void DeleteNoiseGen( NoiseGen *psNoiseGen ) -{ - free( psNoiseGen->pfNoiseBuffer ); - free( psNoiseGen ); - - return; -} - -extern Word32 GetNoise_fx( NoiseGen *psNoiseGen ); diff --git a/lib_isar/isar_lcld_decoder.c b/lib_isar/isar_lcld_decoder.c index 8bb931e3f..1868b9d95 100644 --- a/lib_isar/isar_lcld_decoder.c +++ b/lib_isar/isar_lcld_decoder.c @@ -106,8 +106,9 @@ struct LCLD_DECODER PredictionDecoder *psPredictionDecoder; - +#ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR NoiseGen *psNoiseGen; +#endif }; static void CreateDecodeTable( LCLDDecoder *psLCLDDecoder, Word32 num, const UWord16 ( *ppuiEncTable )[2], Word32 iSize, Word32 iReadLength, UWord32 *iTables ); @@ -604,7 +605,9 @@ ivas_error CreateLCLDDecoder( { return error; } +#ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR psLCLDDecoder->psNoiseGen = NULL; /* CreateNoiseGen(); No noise fill for now*/ +#endif *psLCLDDecoder_out = psLCLDDecoder; return IVAS_ERR_OK; @@ -766,10 +769,12 @@ void DeleteLCLDDecoder( psLCLDDecoder->psPredictionDecoder = NULL; } +#ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR IF( psLCLDDecoder->psNoiseGen != NULL ) { DeleteNoiseGen( psLCLDDecoder->psNoiseGen ); } +#endif free( psLCLDDecoder ); } @@ -788,7 +793,11 @@ static void ApplyRMSEnvelope_fx( const Word32 iNumBands, const Word32 *piBandwid static void ReplaceSign_fx( const Word32 iNumBlocks, const Word32 iNumLCLDBands, Word32 **ppiSignReal, Word32 **ppiSignImag, Word32 **ppfReal, Word32 **ppfImag, const Word32 *piBandwidths ); -static void InvQuantizeSpectrum_fx( const Word32 iNumGroups, const Word32 *piGroupLengths, const Word32 iNumBands, const Word32 *piBandwidths, Word32 **ppiAlloc, Word32 **ppiQReal, Word32 **ppiQImag, Word32 **ppfReal, Word32 **ppfImag, NoiseGen *psNoiseGen ); +static void InvQuantizeSpectrum_fx( const Word32 iNumGroups, const Word32 *piGroupLengths, const Word32 iNumBands, const Word32 *piBandwidths, Word32 **ppiAlloc, Word32 **ppiQReal, Word32 **ppiQImag, Word32 **ppfReal, Word32 **ppfImag +#ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR + , NoiseGen *psNoiseGen +#endif +); static void InvMSCoding_fx( const Word32 iNumBlocks, const Word32 iNumBands, const Word32 *piBandwidths, const Word32 iMSMode, const Word32 *piMSFlags, const Word32 *piLRPhaseDiffs, const Word32 *piMSPredCoefs, Word32 ***pppfReal, Word32 ***pppfImag ); @@ -1010,8 +1019,11 @@ Word32 DecodeLCLDFrame( psLCLDDecoder->pppiAlloc[n], psLCLDDecoder->pppiQLCLDReal[n], psLCLDDecoder->pppiQLCLDImag[n], - pppfLCLDReal_fx[n], pppfLCLDImag_fx[n], - psLCLDDecoder->psNoiseGen ); + pppfLCLDReal_fx[n], pppfLCLDImag_fx[n] +#ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR + ,psLCLDDecoder->psNoiseGen +#endif + ); ReplaceSign_fx( psLCLDDecoder->iNumBlocks, psLCLDDecoder->iNumBands, psLCLDDecoder->pppiLCLDSignReal[n], @@ -1281,8 +1293,10 @@ static void InvQuantizeSpectrum_fx( Word32 **ppiQReal, Word32 **ppiQImag, Word32 **ppfReal, - Word32 **ppfImag, - NoiseGen *psNoiseGen /* Pass in NULL to switch off noise gen */ + Word32 **ppfImag +#ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR + ,NoiseGen *psNoiseGen /* Pass in NULL to switch off noise gen */ +#endif ) { Word32 b, k, n; @@ -1322,6 +1336,7 @@ static void InvQuantizeSpectrum_fx( iFBOffset++; } } +#ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR ELSE IF( psNoiseGen != NULL ) { FOR( m = 0; m < piBandwidths[b]; m++ ) @@ -1333,6 +1348,7 @@ static void InvQuantizeSpectrum_fx( iFBOffset++; } } +#endif ELSE { iFBOffset = L_add( iFBOffset, piBandwidths[b] ); diff --git a/lib_isar/isar_lcld_prot.h b/lib_isar/isar_lcld_prot.h index 00c185901..90d0c1d63 100644 --- a/lib_isar/isar_lcld_prot.h +++ b/lib_isar/isar_lcld_prot.h @@ -170,6 +170,8 @@ Word32 CountMSBits( ); +#ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR + /*----------------------------------------------------------------------------------* * NoiseGen prototypes *----------------------------------------------------------------------------------*/ @@ -190,13 +192,13 @@ inline Word32 GetNoise_fx( NoiseGen *psNoiseGen ) { Word32 fNoiseSample; - fNoiseSample = (Word32) (psNoiseGen->pfNoiseBuffer[psNoiseGen->iNoiseBufferIndex]* (1<<14)); + fNoiseSample = (Word32) (psNoiseGen->pfNoiseBuffer[psNoiseGen->iNoiseBufferIndex] * (1<<14)); psNoiseGen->iNoiseBufferIndex++; psNoiseGen->iNoiseBufferIndex &= psNoiseGen->iNoiseBufferMask; return fNoiseSample; } - +#endif /*----------------------------------------------------------------------------------* * PereptualModel prototypes -- GitLab From 071c55b4645f769eaba94fa38242165969b59d6f Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 25 Nov 2025 14:02:59 +0100 Subject: [PATCH 2/3] remove also from .vcxproj file --- Workspace_msvc/lib_isar.vcxproj | 1 - 1 file changed, 1 deletion(-) diff --git a/Workspace_msvc/lib_isar.vcxproj b/Workspace_msvc/lib_isar.vcxproj index 0271901c8..20c636309 100644 --- a/Workspace_msvc/lib_isar.vcxproj +++ b/Workspace_msvc/lib_isar.vcxproj @@ -133,7 +133,6 @@ - -- GitLab From 358046a569bbcdac6c5ce29e8f90bf968f057bc2 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 25 Nov 2025 14:14:17 +0100 Subject: [PATCH 3/3] clang format --- lib_isar/isar_lcld_decoder.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib_isar/isar_lcld_decoder.c b/lib_isar/isar_lcld_decoder.c index 1868b9d95..85db837ce 100644 --- a/lib_isar/isar_lcld_decoder.c +++ b/lib_isar/isar_lcld_decoder.c @@ -795,7 +795,8 @@ static void ReplaceSign_fx( const Word32 iNumBlocks, const Word32 iNumLCLDBands, static void InvQuantizeSpectrum_fx( const Word32 iNumGroups, const Word32 *piGroupLengths, const Word32 iNumBands, const Word32 *piBandwidths, Word32 **ppiAlloc, Word32 **ppiQReal, Word32 **ppiQImag, Word32 **ppfReal, Word32 **ppfImag #ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR - , NoiseGen *psNoiseGen + , + NoiseGen *psNoiseGen #endif ); @@ -1021,7 +1022,8 @@ Word32 DecodeLCLDFrame( psLCLDDecoder->pppiQLCLDImag[n], pppfLCLDReal_fx[n], pppfLCLDImag_fx[n] #ifndef FIX_1872_REMOVE_UNUSED_PSNOISEGEN_ISAR - ,psLCLDDecoder->psNoiseGen + , + psLCLDDecoder->psNoiseGen #endif ); @@ -1295,7 +1297,8 @@ static void InvQuantizeSpectrum_fx( Word32 **ppfReal, Word32 **ppfImag #ifndef FIX_1872_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