Commit 23c26321 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

fix for crash in LCLD mode when codec frame size is less than isar frame size

parent 0c11e1c8
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@
#define HARMONIZE_DoRTFTn                               /* VA: harmonize functions DoRTFTn_fx() and DoRTFTn_fx_ivas() */
#define FIX_BASOP_2529_MASA_RATIO_SCALINGS              /* Nokia: BASOP issue 2529: Fix MASA ratio scalings and verifications */
#define FIX_BASOP_2525_MASA_MERGE_WRONG_ASSIGN          /* Nokia: BASOP issue 2525: Fix wrong assignment in MASA merge code */
#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 ########################### */

+19 −0
Original line number Diff line number Diff line
@@ -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;
            }