Commit 629b1639 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

Q filter state per pose

parent 6ca11d89
Loading
Loading
Loading
Loading
Loading
+1441 −1423
Original line number Diff line number Diff line
@@ -79,10 +79,17 @@ static void ivas_binRenderer_filterModule_fx(
#endif /* OPT_BASOP_ADD_v1 */
    const Word32 *filterTapsLeftRealPtr_fx, *filterTapsLeftImagPtr_fx, *filterTapsRightRealPtr_fx, *filterTapsRightImagPtr_fx;
    Word16 shift_q;
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef OPT_BASOP_ADD_v1
    Q_filterStates = hBinRenderer->hBinRenConvModule->Q_filterStates[pos_idx];
    move16();
#endif /* OPT_BASOP_ADD_v1 */
#else
#ifdef OPT_BASOP_ADD_v1
    Q_filterStates = hBinRenderer->hBinRenConvModule->Q_filterStatesLeft;
    move16();
#endif /* OPT_BASOP_ADD_v1 */
#endif

    FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ )
    {
@@ -162,7 +169,11 @@ static void ivas_binRenderer_filterModule_fx(
                    outRealRight_fx = W_shr( outRealRight_fx, shift_q ); // Q_curr
                    outImagRight_fx = W_shr( outImagRight_fx, shift_q ); // Q_curr
#ifdef OPT_BASOP_ADD_v1
#ifdef SPLIT_REND_WITH_HEAD_ROT
                    hBinRenderer->hBinRenConvModule->Q_filterStates[pos_idx] = Q_curr;
#else
                    hBinRenderer->hBinRenConvModule->Q_filterStatesLeft = Q_curr;
#endif
                    move16();
                }
#endif /* OPT_BASOP_ADD_v1 */
@@ -369,7 +380,12 @@ static ivas_error ivas_binRenderer_convModuleOpen(
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) );
        }

#ifndef OPT_BASOP_ADD_v1
#ifdef OPT_BASOP_ADD_v1
        IF( ( hBinRenConvModule->Q_filterStates = (Word16 *) malloc( num_poses * sizeof( Word16 ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) );
        }
#else
        IF( ( hBinRenConvModule->Q_filterStatesLeft = (Word16 ****) malloc( num_poses * sizeof( Word16 *** ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) );
@@ -612,6 +628,10 @@ static ivas_error ivas_binRenderer_convModuleOpen(
        {
            for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ )
            {
#ifdef OPT_BASOP_ADD_v1
                hBinRenConvModule->Q_filterStates[pos_idx] = 31;
                move16();
#endif
                for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ )
                {
                    for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
@@ -619,10 +639,7 @@ static ivas_error ivas_binRenderer_convModuleOpen(
                        /* set the memories to zero */
                        set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx], 0, hBinRenConvModule->numTapsArray[bandIdx] );
                        set32_fx( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx][chIdx], 0, hBinRenConvModule->numTapsArray[bandIdx] );
#ifdef OPT_BASOP_ADD_v1
                    hBinRenConvModule->Q_filterStatesLeft = 31;
                    move16();
#else  /* OPT_BASOP_ADD_v1 */
#ifndef OPT_BASOP_ADD_v1
                        set16_fx( hBinRenConvModule->Q_filterStatesLeft[pos_idx][bandIdx][chIdx], 31, hBinRenConvModule->numTapsArray[bandIdx] );
#endif /* OPT_BASOP_ADD_v1 */
                    }
@@ -633,6 +650,10 @@ static ivas_error ivas_binRenderer_convModuleOpen(
        {
            for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ )
            {
#ifdef OPT_BASOP_ADD_v1
                hBinRenConvModule->Q_filterStates[pos_idx] = 31;
                move16();
#endif
                for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ )
                {
                    for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
@@ -640,10 +661,7 @@ static ivas_error ivas_binRenderer_convModuleOpen(
                        /* set the memories to zero */
                        set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[pos_idx][bandIdx][chIdx], 0, hBinRenConvModule->numTaps );
                        set32_fx( hBinRenConvModule->filterStatesLeftImag_fx[pos_idx][bandIdx][chIdx], 0, hBinRenConvModule->numTaps );
#ifdef OPT_BASOP_ADD_v1
                    hBinRenConvModule->Q_filterStatesLeft = 31;
                    move16();
#else  /* OPT_BASOP_ADD_v1 */
#ifndef OPT_BASOP_ADD_v1
                        set16_fx( hBinRenConvModule->Q_filterStatesLeft[pos_idx][bandIdx][chIdx], 31, hBinRenConvModule->numTaps );
#endif /* OPT_BASOP_ADD_v1 */
                    }
+1 −1
Original line number Diff line number Diff line
@@ -668,7 +668,7 @@ typedef struct ivas_binaural_rendering_conv_module_struct_fx
    Word32 ****filterStatesLeftReal_fx;
    Word32 ****filterStatesLeftImag_fx;
#ifdef OPT_BASOP_ADD_v1
    Word16 Q_filterStatesLeft;
    Word16 *Q_filterStates;
#else
    Word16 ****Q_filterStatesLeft;
#endif