Commit adaf54fd authored by sagnowski's avatar sagnowski
Browse files

Handle leftover TODOs

parent 49bfaa83
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -827,15 +827,15 @@ typedef struct renderer_struct
#ifndef FIX_1119_SPLIT_RENDERING_VOIP
typedef struct
{
    float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][2 * CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][2 * CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];

} ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA, *ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE;
#endif

typedef struct
{
#ifdef FIX_1119_SPLIT_RENDERING_VOIP // TODO 1119: This double space should not be needed - we always output 20ms of content
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][2 * CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][2 * CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
#else
+12 −8
Original line number Diff line number Diff line
@@ -1909,8 +1909,6 @@ static ivas_error isar_render_poses(
    {
        return error;
    }

    // TODO: 1119 - Check if this early return can be simplified. ATM we early return through two stack frames.
    if ( !hIvasDec->hasBeenFedFirstGoodFrame )
    {
        return IVAS_ERR_OK;
@@ -2076,7 +2074,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
    {
        return error;
    }
    // TODO: 1119 - Check if this early return can be simplified. ATM we early return through two stack frames.
    if ( !hIvasDec->hasBeenFedFirstGoodFrame )
    {
        return IVAS_ERR_OK;
@@ -2090,7 +2087,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
    /* convert to int16 with limiting for BINAURAL_SPLIT_PCM */
    if ( pcm_out_flag )
    {
        // TODO: 1119 - remove duplicated if/else branches
        if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS )
        {
#ifndef DISABLE_LIMITER
@@ -3931,7 +3927,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples
                }
            }

// TODO: 1119 - extract to a function?
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
            if ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||  hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
            {
@@ -3964,7 +3959,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples
        }
    }

// TODO: 1119 - extract to a function?
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    if ( hIvasDec->hasDecodedFirstGoodFrame && 
       ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
@@ -5447,7 +5441,7 @@ static ivas_error ivas_dec_init_split_rend(
    int16_t cldfb_in_flag, pcm_out_flag;
    int16_t mixed_td_cldfb_flag;
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    int16_t i, num_poses;
    int16_t i, num_poses, cldfb_buffer_capacity;
#endif

    pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
@@ -5468,10 +5462,20 @@ static ivas_error ivas_dec_init_split_rend(

    if ( cldfb_in_flag )
    {
        if ( st_ivas->hDecoderConfig->Opt_tsm )
        {
            /* With TSM we need more space for stretched frames */
            cldfb_buffer_capacity = CLDFB_NO_COL_MAX * 2;
        }
        else
        {
            cldfb_buffer_capacity = CLDFB_NO_COL_MAX;
        }

        for ( i = 0; i < (int16_t) ( num_poses * BINAURAL_CHANNELS ); ++i )
        {
            /* note: this is intra-frame heap memory */
            error = CLDFB_RB_Open( &st_ivas->hSplitBinRend->hMultiBinCldfbData[i], 2 * CLDFB_NO_COL_MAX ); /* TODO: 2x space to fit scaled frames is only needed in VoIP mode */
            error = CLDFB_RB_Open( &st_ivas->hSplitBinRend->hMultiBinCldfbData[i], cldfb_buffer_capacity );
            if ( error != IVAS_ERR_OK )
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for split rendering structure" );