Commit a0470362 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

fix delay mismatch bug in lc3plus and pcm mode when input is cldfb and...

fix delay mismatch bug in lc3plus and pcm mode when input is cldfb and simplify isar integration with ivas
parent 88e36897
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ typedef struct _ISAR_SPLIT_REND_CONFIG
                              2 - (2dof correction. By default YAW and PITCH correction)
                              3 - (3dof correction. By default YAW, PITCH and ROLL correction)
                              */
    int16_t codec_delay_ms;   /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/
    int32_t codec_delay_us;   /*look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t isar_frame_size_ms; /* ISAR bit stream frame size in milliseconds */
#endif
+8 −83
Original line number Diff line number Diff line
@@ -78,11 +78,13 @@ static ivas_error ivas_dec_reconfig_split_rend(
)
{
    ivas_error error;
    int16_t cldfb_in_flag, num_ch, ch, isCldfbNeeded, i, pcm_out_flag;
    int16_t cldfb_in_flag, mixed_td_cldfb_flag, i;
    SPLIT_REND_WRAPPER *hSplitRendWrapper;

    hSplitRendWrapper = &st_ivas->hSplitBinRend->splitrend;
    pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;

    ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &hSplitRendWrapper->multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS );

    cldfb_in_flag = 0;

    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ||
@@ -93,91 +95,14 @@ static ivas_error ivas_dec_reconfig_split_rend(
        cldfb_in_flag = 1;
    }

    ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &hSplitRendWrapper->multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS );

    isCldfbNeeded = 0;

    mixed_td_cldfb_flag = 0;
    if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) ||
         ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) )
    {
        cldfb_in_flag = 0;
    }

    if ( st_ivas->renderer_type != RENDERER_DISABLE )
    {
        if ( cldfb_in_flag == 0 )
        {
            isCldfbNeeded = 1;
        }
        else if ( st_ivas->hRenderConfig->split_rend_config.codec == ISAR_SPLIT_REND_CODEC_LC3PLUS && cldfb_in_flag )
        {
            isCldfbNeeded = 1;
        }
        else if ( pcm_out_flag && cldfb_in_flag )
        {
            isCldfbNeeded = 1;
        }
    }
    else if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan )
    {
        isCldfbNeeded = 1;
    }

    if ( isCldfbNeeded == 1 && hSplitRendWrapper->hCldfbHandles == NULL )
    {
        if ( ( hSplitRendWrapper->hCldfbHandles = (CLDFB_HANDLES_WRAPPER_HANDLE) malloc( sizeof( CLDFB_HANDLES_WRAPPER ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB handles\n" ) );
        }

        num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS;
        for ( ch = 0; ch < num_ch; ch++ )
        {
            hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL;
        }

        num_ch = hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS;

        for ( ch = 0; ch < num_ch; ch++ )
        {
            if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not open CLDFB handles\n" ) );
            }
        }

        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
            if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] ), CLDFB_SYNTHESIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
    }
    else if ( isCldfbNeeded == 0 && hSplitRendWrapper->hCldfbHandles != NULL )
    {
        num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS;
        for ( ch = 0; ch < num_ch; ch++ )
        {
            if ( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] != NULL )
            {
                deleteCldfb( &hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] );
                hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL;
            }
        }

        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
            if ( hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] != NULL )
            {
                deleteCldfb( &hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] );
                hSplitRendWrapper->hCldfbHandles->cldfbSyn[ch] = NULL;
            }
        mixed_td_cldfb_flag = 1;
    }

        free( hSplitRendWrapper->hCldfbHandles );
        hSplitRendWrapper->hCldfbHandles = NULL;
    }
    error = ISAR_PRE_REND_reconfig_CLDFB( &st_ivas->hSplitBinRend->splitrend, &st_ivas->hRenderConfig->split_rend_config, cldfb_in_flag, mixed_td_cldfb_flag );

    if ( ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) &&
         ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV || st_ivas->ivas_format != SBA_ISM_FORMAT ) &&
@@ -193,7 +118,7 @@ static ivas_error ivas_dec_reconfig_split_rend(
        }
    }

    return IVAS_ERR_OK;
    return error;
}


+4 −13
Original line number Diff line number Diff line
@@ -1125,8 +1125,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
    ivas_error error;
    ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend;
    int16_t max_band;
    int16_t pcm_out_flag;
    int16_t td_input;
    int16_t numPoses;
    int16_t slots_rendered, slots_rendered_new;
    int16_t ro_md_flag;
@@ -1225,8 +1223,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
    }

    max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 );
    pcm_out_flag = ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
    td_input = st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC;

    if ( st_ivas->hBinRendererTd != NULL )
    {
@@ -1249,24 +1245,19 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
        Quaternion.z = 0.0f;
    }
    if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hSplitBinRend->splitrend,
                                                          &st_ivas->hRenderConfig->split_rend_config,
                                                          Quaternion,
                                                          st_ivas->hRenderConfig->split_rend_config.splitRendBitRate,
                                                          st_ivas->hRenderConfig->split_rend_config.codec,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                          st_ivas->hRenderConfig->split_rend_config.isar_frame_size_ms,
#endif
                                                          st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms,
                                                          splitRendBits,
                                                          Cldfb_RealBuffer_Binaural,
                                                          Cldfb_ImagBuffer_Binaural,
                                                          max_band, pOutput, 1, !td_input, pcm_out_flag, ro_md_flag ) ) != IVAS_ERR_OK )
                                                          max_band, pOutput, ro_md_flag ) ) != IVAS_ERR_OK )

    {
        return error;
    }

    /* convert to int16 with limiting for BINAURAL_SPLIT_PCM */
    if ( pcm_out_flag )
    if ( hSplitBinRend->splitrend.pcm_out_flag )
    {
        if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS )
        {
@@ -2140,7 +2131,7 @@ static ivas_error copyRendererConfigStruct(
    hRCout->split_rend_config.splitRendBitRate = SPLIT_REND_768k;
    hRCout->split_rend_config.dof = 3;
    hRCout->split_rend_config.hq_mode = 0;
    hRCout->split_rend_config.codec_delay_ms = 0;
    hRCout->split_rend_config.codec_delay_us = 0;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    hRCout->split_rend_config.isar_frame_size_ms = 20;
#endif
+2 −7
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ ivas_error split_renderer_open_lc3plus(
void isar_splitBinPreRendClose(
    ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend );

void lc3plusTimeAlignCldfbPoseCorr(
void IsarTimeAlignCldfbPoseCorr(
    SPLIT_REND_WRAPPER *hSplitBin,
    float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] );
@@ -267,17 +267,12 @@ void isar_rend_CldfbSplitPreRendProcess(

ivas_error isar_renderMultiTDBinToSplitBinaural(
    SPLIT_REND_WRAPPER *hSplitBin,
    ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    const IVAS_QUATERNION headPosition,
    const int32_t SplitRendBitRate,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    const int16_t isar_frame_size_ms,
#endif
    const int16_t codec_frame_size_ms,
    ISAR_SPLIT_REND_BITS_HANDLE pBits,
    const int16_t max_bands,
    float *in[],
    const int16_t low_res_pre_rend_rot,
    const int16_t pcm_out_flag,
    const int16_t ro_md_flag );

void isar_init_multi_bin_pose_data(
+48 −48
Original line number Diff line number Diff line
@@ -2004,7 +2004,8 @@ ivas_error split_renderer_open_lc3plus(
        assert( hSplitRendWrapper->lc3plusDelaySamples % ( OutSampleRate / FRAMES_PER_SEC / CLDFB_NO_COL_MAX ) == 0 );
        assert( hSplitRendWrapper->lc3plusDelaySamples / ( OutSampleRate / FRAMES_PER_SEC / CLDFB_NO_COL_MAX ) == 2 );

        delayBufferLength = 2 /* Columns */ * 2 /* real and imag */ * CLDFB_NO_CHANNELS_MAX;
        hSplitRendWrapper->NumColsDelay = 2; /* Columns */
        delayBufferLength = hSplitRendWrapper->NumColsDelay * 2 /* real and imag */ * CLDFB_NO_CHANNELS_MAX;
        for ( i = 0; i < hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++i )
        {
            if ( ( hSplitRendWrapper->lc3plusDelayBuffers[i] = malloc( delayBufferLength * sizeof( float ) ) ) == NULL )
@@ -2099,17 +2100,12 @@ ivas_error splitRendLc3plusEncodeAndWrite(

ivas_error isar_renderMultiTDBinToSplitBinaural(
    SPLIT_REND_WRAPPER *hSplitBin,
    ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    const IVAS_QUATERNION headPosition,
    const int32_t SplitRendBitRate,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    const int16_t isar_frame_size_ms,
#endif
    const int16_t codec_frame_size_ms,
    ISAR_SPLIT_REND_BITS_HANDLE pBits,
    const int16_t max_bands,
    float *in[],
    const int16_t low_res_pre_rend_rot,
    const int16_t pcm_out_flag,
    const int16_t ro_md_flag )
{
    ivas_error error;
@@ -2125,6 +2121,12 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
    float *in_delayed[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS];
    int16_t i;
    int32_t num_slots;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t frame_size;
    int32_t pcm_delay_samples;

    frame_size = (int16_t) ( ( hSplitBin->output_Fs * pSplitRendConfig->isar_frame_size_ms ) / 1000 );
#endif

    push_wmops( "isar_renderMultiTDBinToSplitBinaural" );

@@ -2132,18 +2134,24 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
    num_poses = hSplitBin->multiBinPoseData.num_poses;

    useLc3plus = hSplitBin->hLc3plusEnc != NULL;

    pcm_delay_samples = 0;
    if ( useLc3plus )
    {
        /*this should always have the time resolution of pose correction MD. Note that this does not change frame size of LC3plus*/
        int16_t frame_size = (int16_t) ( hSplitBin->hLc3plusEnc->config.samplerate / (int32_t) FRAMES_PER_SECOND );
        pcm_delay_samples = hSplitBin->lc3plusDelaySamples;
    }
    else if ( hSplitBin->pcm_out_flag && pSplitRendConfig->codec_delay_us > 0 )
    {
        pcm_delay_samples = ( pSplitRendConfig->codec_delay_us * hSplitBin->output_Fs ) / 1000000;
    }

    if ( pcm_delay_samples > 0 )
    {
        for ( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i )
        {
            /* Artificially delay input to head pose correction analysis by LC3plus coding delay, so that audio and metadata are in sync after decoding */
            mvr2r( hSplitBin->lc3plusDelayBuffers[i] + frame_size, hSplitBin->lc3plusDelayBuffers[i], (int16_t) hSplitBin->lc3plusDelaySamples );
            /* Artificially delay input to head pose correction analysis by coding delay, so that audio and metadata are in sync after decoding */
            mvr2r( hSplitBin->lc3plusDelayBuffers[i] + frame_size, hSplitBin->lc3plusDelayBuffers[i], (int16_t) pcm_delay_samples );
            in_delayed[i] = hSplitBin->lc3plusDelayBuffers[i];
            mvr2r( in[i], hSplitBin->lc3plusDelayBuffers[i] + hSplitBin->lc3plusDelaySamples, frame_size );
            mvr2r( in[i], hSplitBin->lc3plusDelayBuffers[i] + pcm_delay_samples, frame_size );
        }
    }
    else
@@ -2157,7 +2165,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
    actual_md_bits = pBits->bits_written;
#endif
    if ( ( hSplitBin->multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) || ( !useLc3plus && !pcm_out_flag ) )
    if ( ( hSplitBin->multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) || ( !useLc3plus && !hSplitBin->pcm_out_flag ) )
    {
        num_slots = ( hSplitBin->multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) ? CLDFB_NO_COL_MAX : ( hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations );
        num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels;
@@ -2195,7 +2203,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(

    if ( hSplitBin->multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB )
    {
        target_md_bits = isar_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out_flag ) * L_FRAME48k / 48000;
        target_md_bits = isar_get_split_rend_md_target_brate( pSplitRendConfig->splitRendBitRate, hSplitBin->pcm_out_flag ) * L_FRAME48k / 48000;

#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
        actual_md_bits = pBits->bits_written;
@@ -2204,23 +2212,23 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
        isar_rend_CldfbSplitPreRendProcess( hSplitBin->hBinHrSplitPreRend, headPosition, &hSplitBin->multiBinPoseData, Cldfb_In_BinReal, Cldfb_In_BinImag, pBits, target_md_bits, low_res_pre_rend_rot, ro_md_flag );
    }

    if ( pcm_out_flag == 0 )
    if ( hSplitBin->pcm_out_flag == 0 )
    {
        pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode;
        pBits->codec = useLc3plus ? ISAR_SPLIT_REND_CODEC_LC3PLUS : ISAR_SPLIT_REND_CODEC_LCLD;

        if ( !useLc3plus )
        {
            available_bits = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC );
            available_bits = ( pSplitRendConfig->splitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC );
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
            available_bits -= pBits->bits_written;
#else
            actual_md_bits = pBits->bits_written - actual_md_bits;
            available_bits -= actual_md_bits;
#endif
            pBits->codec_frame_size_ms = codec_frame_size_ms;
            pBits->codec_frame_size_ms = pSplitRendConfig->codec_frame_size_ms;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
            pBits->isar_frame_size_ms = isar_frame_size_ms;
            pBits->isar_frame_size_ms = pSplitRendConfig->isar_frame_size_ms;
#endif

            isar_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal, Cldfb_In_BinImag, available_bits, pBits );
@@ -2229,7 +2237,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
        {
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
            available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written;
            available_bits = ( pSplitRendConfig->splitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written;
            if ( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, available_bits, in ) ) != IVAS_ERR_OK )
#else
            available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written;
@@ -2250,20 +2258,20 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
    }

    /*zero pad*/
    if ( pcm_out_flag )
    if ( hSplitBin->pcm_out_flag )
    {
        bit_len = SplitRendBitRate / FRAMES_PER_SEC;
        bit_len = pSplitRendConfig->splitRendBitRate / FRAMES_PER_SEC;
    }
    else
    {
        if ( !useLc3plus )
        {
            bit_len = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC );
            bit_len = ( pSplitRendConfig->splitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC );
        }
        else
        {
            bit_len = hSplitBin->hLc3plusEnc->config.isar_frame_duration_us / 1000;
            bit_len = SplitRendBitRate * bit_len / 1000;
            bit_len = pSplitRendConfig->splitRendBitRate * bit_len / 1000;
        }
    }

@@ -2284,13 +2292,11 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
 *
 *------------------------------------------------------------------------*/

void lc3plusTimeAlignCldfbPoseCorr(
void IsarTimeAlignCldfbPoseCorr(
    SPLIT_REND_WRAPPER *hSplitBin,
    float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] )
{
    float Cldfb_In_BinReal_tmp[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][2][CLDFB_NO_CHANNELS_MAX];
    float Cldfb_In_BinImag_tmp[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][2][CLDFB_NO_CHANNELS_MAX];
    int16_t pose, ch, slot_idx;
    float *bufRead, *bufWrite;

@@ -2298,40 +2304,34 @@ void lc3plusTimeAlignCldfbPoseCorr(
    {
        for ( ch = 0; ch < BINAURAL_CHANNELS; ++ch )
        {
            bufRead = hSplitBin->lc3plusDelayBuffers[pose * BINAURAL_CHANNELS + ch];
            bufWrite = bufRead;
            bufWrite = hSplitBin->lc3plusDelayBuffers[pose * BINAURAL_CHANNELS + ch];
            bufRead = bufWrite + ( 2 * CLDFB_NO_COL_MAX * CLDFB_NO_CHANNELS_MAX );

            /* Save last 2 columns for next frame */
            for ( slot_idx = 0; slot_idx < 2; ++slot_idx )
            for ( slot_idx = CLDFB_NO_COL_MAX; slot_idx < hSplitBin->NumColsDelay; ++slot_idx )
            {
                mvr2r( Cldfb_In_BinReal[pose * BINAURAL_CHANNELS + ch][CLDFB_NO_COL_MAX - 2 + slot_idx], Cldfb_In_BinReal_tmp[pose][ch][slot_idx], CLDFB_NO_CHANNELS_MAX );
                mvr2r( Cldfb_In_BinImag[pose * BINAURAL_CHANNELS + ch][CLDFB_NO_COL_MAX - 2 + slot_idx], Cldfb_In_BinImag_tmp[pose][ch][slot_idx], CLDFB_NO_CHANNELS_MAX );
                mvr2r( bufRead, bufWrite, 2 * CLDFB_NO_CHANNELS_MAX );
                bufRead += 2 * CLDFB_NO_CHANNELS_MAX;
                bufWrite += 2 * CLDFB_NO_CHANNELS_MAX;
            }

            /* Delay existing columns by 2 slots */
            for ( slot_idx = CLDFB_NO_COL_MAX - 2 - 1; slot_idx >= 0; --slot_idx )
            bufWrite = hSplitBin->lc3plusDelayBuffers[pose * BINAURAL_CHANNELS + ch];
            bufWrite += ( 2 * ( hSplitBin->NumColsDelay - CLDFB_NO_COL_MAX ) * CLDFB_NO_CHANNELS_MAX );
            for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; ++slot_idx )
            {
                mvr2r( Cldfb_In_BinReal[pose * BINAURAL_CHANNELS + ch][slot_idx], Cldfb_In_BinReal[pose * BINAURAL_CHANNELS + ch][slot_idx + 2], CLDFB_NO_CHANNELS_MAX );
                mvr2r( Cldfb_In_BinImag[pose * BINAURAL_CHANNELS + ch][slot_idx], Cldfb_In_BinImag[pose * BINAURAL_CHANNELS + ch][slot_idx + 2], CLDFB_NO_CHANNELS_MAX );
                mvr2r( Cldfb_In_BinReal[pose * BINAURAL_CHANNELS + ch][slot_idx], bufWrite, CLDFB_NO_CHANNELS_MAX );
                bufWrite += CLDFB_NO_CHANNELS_MAX;
                mvr2r( Cldfb_In_BinImag[pose * BINAURAL_CHANNELS + ch][slot_idx], bufWrite, CLDFB_NO_CHANNELS_MAX );
                bufWrite += CLDFB_NO_CHANNELS_MAX;
            }

            /* Fill 2 first columns from buffer */
            for ( slot_idx = 0; slot_idx < 2; ++slot_idx )
            bufRead = hSplitBin->lc3plusDelayBuffers[pose * BINAURAL_CHANNELS + ch];
            for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; ++slot_idx )
            {
                mvr2r( bufRead, Cldfb_In_BinReal[pose * BINAURAL_CHANNELS + ch][slot_idx], CLDFB_NO_CHANNELS_MAX );
                bufRead += CLDFB_NO_CHANNELS_MAX;
                mvr2r( bufRead, Cldfb_In_BinImag[pose * BINAURAL_CHANNELS + ch][slot_idx], CLDFB_NO_CHANNELS_MAX );
                bufRead += CLDFB_NO_CHANNELS_MAX;
            }

            /* Copy last 2 columns to buffer */
            for ( slot_idx = 0; slot_idx < 2; ++slot_idx )
            {
                mvr2r( Cldfb_In_BinReal_tmp[pose][ch][slot_idx], bufWrite, CLDFB_NO_CHANNELS_MAX );
                bufWrite += CLDFB_NO_CHANNELS_MAX;
                mvr2r( Cldfb_In_BinImag_tmp[pose][ch][slot_idx], bufWrite, CLDFB_NO_CHANNELS_MAX );
                bufWrite += CLDFB_NO_CHANNELS_MAX;
            }
        }
    }

Loading