diff --git a/lib_com/options.h b/lib_com/options.h index 6bfe63675545869d26b63960f5671f6c88f9fb20..1225701bd9df3f7b4213b962da08794adde7a617 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,6 +175,7 @@ #define FIX_1574_EFAP_CODE_LINT /* FhG: issue 1574: Code quality fixes in ivas_efap.c */ #define FIX_FLOAT_1569_REND_RENDER_CONFIG_CHECKS /* Nokia: float issue 1569: fix render config checks in renderer */ #define FIX_1571_BFI_COPY_ARRAY_CORRECT_LEN /* FhG: issue 1571: use correct channel signal length for copying signal to buffer */ +#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 adc175a91c3c4c101e6db9ec3987a668de96f566..6ba81ec709e2ec53d95eab28aad6965fe04df78e 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -153,10 +153,29 @@ ivas_error ISAR_PRE_REND_open( } else { +#ifndef FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE int16_t iNumBlocksPerFrame; iNumBlocksPerFrame = ( CLDFB_NO_COL_MAX * pSplitRendConfig->codec_frame_size_ms ) / 20; +#else + int16_t iNumBlocksPerFrame, iNumLCLDIterationsPerFrame; + if ( pSplitRendConfig->codec_frame_size_ms > 0 ) + { + iNumLCLDIterationsPerFrame = (int16_t) pSplitRendConfig->isar_frame_size_ms / ( pSplitRendConfig->codec_frame_size_ms ); + iNumLCLDIterationsPerFrame = 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( &hSplitBinRend->hSplitBinLCLDEnc, output_Fs, BINAURAL_CHANNELS, isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitBinRend->multiBinPoseData.poseCorrectionMode ), iNumBlocksPerFrame, 1 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = isar_splitBinLCLDEncOpen( &hSplitBinRend->hSplitBinLCLDEnc, output_Fs, BINAURAL_CHANNELS, isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitBinRend->multiBinPoseData.poseCorrectionMode ), iNumBlocksPerFrame, iNumLCLDIterationsPerFrame ) ) != IVAS_ERR_OK ) +#endif { return error; }