diff --git a/lib_com/options.h b/lib_com/options.h index 1ecb07333a4821f7ade5b1824198e506eacbaac6..0497514205d43da27035fbfba981f89f1d5f4e21 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -124,6 +124,7 @@ #define HARMONIZE_DoRTFTn /* VA: harmonize functions DoRTFTn_fx() and DoRTFTn_fx_ivas() */ #define FIX_1574_EFAP_CODE_LINT /* FhG: float issue 1574: Code quality fixes in ivas_efap.c */ #define FIX_BASOP_2529_MASA_RATIO_SCALINGS /* Nokia: BASOP issue 2529: Fix MASA ratio scalings and verifications */ +#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index f9858f413029b12694e4c1794c21b0c992581815..910f5f4230523ac883bb6d1a2bd9d9fc0daf2441 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -158,10 +158,29 @@ ivas_error ISAR_PRE_REND_open( } ELSE { +#ifndef FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE Word16 iNumBlocksPerFrame; iNumBlocksPerFrame = ( CLDFB_NO_COL_MAX * pSplitRendConfig->codec_frame_size_ms ) / 20; +#else + Word16 iNumBlocksPerFrame, iNumLCLDIterationsPerFrame; + IF( GT_16( pSplitRendConfig->codec_frame_size_ms, 0 ) ) + { + iNumLCLDIterationsPerFrame = (Word16) pSplitRendConfig->isar_frame_size_ms / ( pSplitRendConfig->codec_frame_size_ms ); + iNumLCLDIterationsPerFrame = s_max( 1, iNumLCLDIterationsPerFrame ); + iNumBlocksPerFrame = ( CLDFB_NO_COL_MAX * pSplitRendConfig->codec_frame_size_ms ) / 20; + } + else + { + iNumLCLDIterationsPerFrame = 1; + iNumBlocksPerFrame = CLDFB_NO_COL_MAX; + } +#endif +#ifndef FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE IF( ( error = isar_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitRendWrapper->multiBinPoseData.poseCorrectionMode ), iNumBlocksPerFrame, 1 ) ) != IVAS_ERR_OK ) +#else + IF( ( error = isar_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitRendWrapper->multiBinPoseData.poseCorrectionMode ), iNumBlocksPerFrame, iNumLCLDIterationsPerFrame ) ) != IVAS_ERR_OK ) +#endif { return error; }