Commit 542d51ad authored by multrus's avatar multrus
Browse files

extend scaling in accumulateCLDFBArrayToBuffer_fx()

parent a42b9935
Loading
Loading
Loading
Loading
+38 −11
Original line number Diff line number Diff line
@@ -469,6 +469,9 @@ static void accumulateCLDFBArrayToBuffer_fx(
    numCldfbSamples = (UWord32) shr( buffer->config.numSamplesPerChannel, 1 );
    num_bands = (UWord32) Mpy_32_32( numCldfbSamples, ONE_BY_CLDFB_NO_COL_MAX_Q31 );

    IF( LE_16( Q_diff, 0 ) )
    {

        FOR( chnlIdx = 0; chnlIdx < buffer->config.numChannels; ++chnlIdx )
        {
            FOR( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; ++slotIdx )
@@ -488,6 +491,30 @@ static void accumulateCLDFBArrayToBuffer_fx(

        *( buffer->pq_fact ) = Q_new;
        move16();
    }
    ELSE
    {

        FOR( chnlIdx = 0; chnlIdx < buffer->config.numChannels; ++chnlIdx )
        {
            FOR( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; ++slotIdx )
            {
                FOR( smplIdx = 0; smplIdx < num_bands; ++smplIdx )
                {
                    *writePtr = L_add( *writePtr, L_shr( re[chnlIdx][slotIdx][smplIdx], Q_diff ) );
                    writePtr++;
                }
                FOR( smplIdx = 0; smplIdx < num_bands; ++smplIdx )
                {
                    *writePtr = L_add( *writePtr, L_shr( im[chnlIdx][slotIdx][smplIdx], Q_diff ) );
                    writePtr++;
                }
            }
        }

        *( buffer->pq_fact ) = Q_old;
        move16();
    }

    return;
}