Commit 4188ad0b authored by TYAGIRIS's avatar TYAGIRIS
Browse files

sanitizer fixes

parent 396a290f
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2280,6 +2280,10 @@ cleanup:
    RotationFileReader_close( &headRotReader );
    RotationFileReader_close( &externalOrientationFileReader );
    RotationFileReader_close( &referenceRotReader );
#ifdef SPLIT_REND_LCLD_5MS
    SplitRendBFIFileReader_close( &splitRendBFIReader );
#endif

    Vector3PairFileReader_close( &referenceVectorReader );
#ifndef NONBE_FIX_BINARY_BINAURAL_READING
    hrtfFileReader_close( &hrtfFileReader );
+7 −0
Original line number Diff line number Diff line
@@ -3735,6 +3735,13 @@ ivas_error IVAS_DEC_GetSplitRendBits(
    splitRendBits->pose_correction = hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits->pose_correction;
    splitRendBits->codec_frame_size_ms = hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits->codec_frame_size_ms;

#ifdef SPLIT_REND_LCLD_5MS
    /* data consumed, free it */
    free( hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits );
    hIvasDec->st_ivas->hSplitBinRend.hSplitRendBits = NULL;
#endif


    return IVAS_ERR_OK;
}

+3 −1
Original line number Diff line number Diff line
@@ -1806,7 +1806,9 @@ void ivas_rend_closeCldfbRend(
    }

    ivas_binRenderer_close( &pCldfbRend->hCldfbRend );

#ifdef SPLIT_REND_LCLD_5MS
    ivas_binaural_hrtf_close( &pCldfbRend->hHrtfFastConv );
#endif
    ivas_HRTF_fastconv_binary_close( &pCldfbRend->hHrtfFastConv );

    return;
+45 −1
Original line number Diff line number Diff line
@@ -713,7 +713,11 @@ void DeleteLCLDDecoder( LCLDDecoder *psLCLDDecoder )

static void ApplyRMSEnvelope( const int32_t iNumBands, const int32_t *piBandwidths, const int32_t iNumGroups, const int32_t *piGroupLengths, int32_t **ppiRMSEnvelope, float **ppfReal, float **ppfImag );

#ifdef SPLIT_REND_LCLD_5MS
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 );
#else
static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumLCLDBands, int32_t **ppiSignReal, int32_t **ppiSignImag, float **ppfReal, float **ppfImag );
#endif

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 );

@@ -819,10 +823,17 @@ int32_t DecodeLCLDFrame(
                             pppfLCLDReal[n], pppfLCLDImag[n],
                             psLCLDDecoder->psNoiseGen );

#ifdef SPLIT_REND_LCLD_5MS
        ReplaceSign( psLCLDDecoder->iNumBlocks, psLCLDDecoder->iNumBands,
                     psLCLDDecoder->pppiLCLDSignReal[n],
                     psLCLDDecoder->pppiLCLDSignImag[n],
                     pppfLCLDReal[n], pppfLCLDImag[n], psLCLDDecoder->piBandwidths );
#else
        ReplaceSign( psLCLDDecoder->iNumBlocks, LCLD_BANDS,
                     psLCLDDecoder->pppiLCLDSignReal[n],
                     psLCLDDecoder->pppiLCLDSignImag[n],
                     pppfLCLDReal[n], pppfLCLDImag[n] );
#endif
    }
#ifdef DEBUG_WRITE_PREDICTORS
    {
@@ -915,7 +926,16 @@ static void ApplyRMSEnvelope(
    return;
}


#ifdef SPLIT_REND_LCLD_5MS
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 )
#else
static void ReplaceSign(
    const int32_t iNumBlocks,
    const int32_t iNumLCLDBands,
@@ -923,11 +943,34 @@ static void ReplaceSign(
    int32_t **ppiSignImag,
    float **ppfReal,
    float **ppfImag )
#endif
{
    int32_t b, n;
#ifdef SPLIT_REND_LCLD_5MS
    int32_t m, idx;
#endif

    for ( n = 0; n < iNumBlocks; n++ )
    {
#ifdef SPLIT_REND_LCLD_5MS
        idx = 0;
        for ( b = 0; b < iNumLCLDBands; b++ )
        {
            for ( m = 0; m < piBandwidths[b]; m++ )
            {
                if ( ppiSignReal[n][idx] == 1 )
                {
                    ppfReal[n][idx] = -ppfReal[n][idx];
                }

                if ( ppiSignImag[n][idx] == 1 )
                {
                    ppfImag[n][idx] = -ppfImag[n][idx];
                }
                idx++;
            }
        }
#else
        for ( b = 0; b < iNumLCLDBands; b++ )
        {
            if ( ppiSignReal[n][b] == 1 )
@@ -940,6 +983,7 @@ static void ReplaceSign(
                ppfImag[n][b] = -ppfImag[n][b];
            }
        }
#endif
    }

    return;