Commit 910d40c3 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

add wmops_sub_start/end() to rendering functions

parent 76b5671d
Loading
Loading
Loading
Loading
Loading
+62 −0
Original line number Diff line number Diff line
@@ -2767,6 +2767,8 @@ static ivas_error rotateFrameMc(
    rotation_gains gains;
    float tmp_gains[MAX_INPUT_CHANNELS];

    wmops_sub_start("rotateFrameMc");

    if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
    {
        getAudioConfigNumChannels( inConfig, &nchan );
@@ -2865,6 +2867,8 @@ static ivas_error rotateFrameMc(
        }
    }

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -2886,6 +2890,8 @@ static ivas_error rotateFrameSba(
    float tmpRot[2 * HEADROT_ORDER + 1];
    rotation_gains gains;

    wmops_sub_start("rotateFrameSba");

    getAmbisonicsOrder( inConfig, &shd_rot_max_order );

    /* subframe loop */
@@ -2960,6 +2966,7 @@ static ivas_error rotateFrameSba(
        }
    }

    wmops_sub_end();

    return IVAS_ERR_OK;
}
@@ -2972,6 +2979,8 @@ static ivas_error renderIsmToBinaural(

    ivas_error error;

    wmops_sub_start("renderIsmToBinaural");

    copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer );

    /* TODO tmu : missing: interpolation between positions, 5ms rendering */
@@ -2989,6 +2998,8 @@ static ivas_error renderIsmToBinaural(

    accumulate2dArrayToBuffer( tmpTDRendBuffer, &outAudio );

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3011,6 +3022,8 @@ static ivas_error renderIsmToBinauralRoom(
    IVAS_REND_AudioObjectPosition rotatedPos;
    const IVAS_REND_HeadRotData *headRotData;

    wmops_sub_start("renderIsmToBinauralRoom");

    headRotData = ismInput->base.ctx.pHeadRotData;
    rotatedPos = defaultObjectPosition();

@@ -3103,6 +3116,8 @@ static ivas_error renderIsmToBinauralRoom(

    count_free( tmpMcBuffer.data );

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3114,6 +3129,8 @@ static ivas_error renderIsmToMc(
    pan_vector previousPanGains;
    ivas_error error;

    wmops_sub_start("renderIsmToMc");

    /* TODO(sgi): Possible optimization: less processing needed if position didn't change */
    if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper,
                                 ismInput->currentPos.azimuth,
@@ -3138,6 +3155,8 @@ static ivas_error renderIsmToMc(
                             previousPanGains,
                             outAudio );

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3153,6 +3172,8 @@ static ivas_error renderIsmToSba(
    ivas_error error;
    error = IVAS_ERR_OK;

    wmops_sub_start("renderIsmToSba");

    if ( ( error = getAudioConfigNumChannels( outConfig, &numOutChannels ) ) != IVAS_ERR_OK )
    {
        return error;
@@ -3188,6 +3209,8 @@ static ivas_error renderIsmToSba(
                             previousPanGains,
                             outAudio );

    wmops_sub_end();

    return error;
}

@@ -3285,6 +3308,8 @@ static ivas_error renderLfeToBinaural(

    assert( ( outAudio.config.numChannels == 2 ) && "Must be binaural output" );

    wmops_sub_start("renderLfeToBinaural");

    gain = GAIN_LFE;

    if ( mcInput->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM )
@@ -3316,6 +3341,8 @@ static ivas_error renderLfeToBinaural(
        *writePtr++ += gain * ( *readPtr++ );
    }

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3331,6 +3358,8 @@ static ivas_error renderMcToBinaural(
    ivas_error error;
    IVAS_REND_AudioBuffer tmpRotBuffer;

    wmops_sub_start("renderMcToBinaural");

    headRotEnabled = mcInput->base.ctx.pHeadRotData->headRotEnabled;
    inConfig = mcInput->base.inConfig;

@@ -3392,6 +3421,7 @@ static ivas_error renderMcToBinaural(
    /* TODO tmu : needs delay compensation */
    renderLfeToBinaural( mcInput, outAudio );

    wmops_sub_end();

    return IVAS_ERR_OK;
}
@@ -3406,6 +3436,8 @@ static ivas_error renderMcToBinauralRoom(
    ivas_error error;
    IVAS_REND_AudioBuffer tmpRotBuffer;

    wmops_sub_start("renderMcToBinauralRoom");

    /* apply rotation */
    if ( mcInput->base.ctx.pHeadRotData->headRotEnabled )
    {
@@ -3445,6 +3477,8 @@ static ivas_error renderMcToBinauralRoom(
    /* TODO tmu : needs delay compensation */
    renderLfeToBinaural( mcInput, outAudio );

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3463,6 +3497,8 @@ static ivas_error renderMcCustomLsToBinauralRoom(
    IVAS_REND_AudioBuffer tmpMcBuffer;
    IVAS_REND_AudioBuffer *tmpBufPtr;

    wmops_sub_start("renderMcCustomLsToBinauralRoom");

    headRotEnabled = mcInput->base.ctx.pHeadRotData->headRotEnabled;

    /* apply rotation */
@@ -3519,6 +3555,8 @@ static ivas_error renderMcCustomLsToBinauralRoom(
    }
    count_free( tmpMcBuffer.data );

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3529,6 +3567,8 @@ static ivas_error renderMcToMc(
    int32_t i;
    IVAS_REND_AudioBuffer inAudio;

    wmops_sub_start("renderMcToMc");

    inAudio = mcInput->base.inputBuffer;

    for ( i = 0; i < inAudio.config.numChannels; ++i )
@@ -3536,6 +3576,8 @@ static ivas_error renderMcToMc(
        renderBufferChannel( inAudio, i, mcInput->panGains[i], outAudio );
    }

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3546,6 +3588,8 @@ static ivas_error renderMcToSba(
    int32_t i;
    IVAS_REND_AudioBuffer inAudio;

    wmops_sub_start("renderMcToSba");

    inAudio = mcInput->base.inputBuffer;

    for ( i = 0; i < inAudio.config.numChannels; ++i )
@@ -3553,6 +3597,8 @@ static ivas_error renderMcToSba(
        renderBufferChannel( inAudio, i, mcInput->panGains[i], outAudio );
    }

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3652,6 +3698,8 @@ static ivas_error renderSbaToMc(
    int32_t i;
    IVAS_REND_AudioBuffer inAudio;

    wmops_sub_start("renderSbaToMc");

    inAudio = sbaInput->base.inputBuffer;

    for ( i = 0; i < inAudio.config.numChannels; ++i )
@@ -3659,6 +3707,8 @@ static ivas_error renderSbaToMc(
        renderBufferChannel( inAudio, i, sbaInput->hoaDecMtx[i], outAudio );
    }

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3669,6 +3719,8 @@ static ivas_error renderSbaToSba(
    int32_t i;
    IVAS_REND_AudioBuffer inAudio;

    wmops_sub_start("renderSbaToSba");

    inAudio = sbaInput->base.inputBuffer;

    for ( i = 0; i < inAudio.config.numChannels; ++i )
@@ -3676,6 +3728,8 @@ static ivas_error renderSbaToSba(
        renderBufferChannel( inAudio, i, sbaInput->hoaDecMtx[i], outAudio );
    }

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3689,6 +3743,8 @@ static ivas_error renderSbaToBinaural(
    ivas_error error;
    IVAS_REND_AudioBuffer tmpRotBuffer;

    wmops_sub_start("renderSbaToBinaural");

    /* apply rotation */
    if ( sbaInput->base.ctx.pHeadRotData->headRotEnabled )
    {
@@ -3724,6 +3780,8 @@ static ivas_error renderSbaToBinaural(

    accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio );

    wmops_sub_end();

    return IVAS_ERR_OK;
}

@@ -3742,6 +3800,8 @@ static ivas_error renderSbaToBinauralRoom(
    IVAS_REND_AudioBuffer tmpMcBuffer;
    IVAS_REND_AudioBuffer *tmpBufPtr;

    wmops_sub_start("renderSbaToBinauralRoom");

    headRotEnabled = sbaInput->base.ctx.pHeadRotData->headRotEnabled;

    /* apply rotation */
@@ -3797,6 +3857,8 @@ static ivas_error renderSbaToBinauralRoom(
    }
    count_free( tmpMcBuffer.data );

    wmops_sub_end();

    return IVAS_ERR_OK;
}