Commit 396a290f authored by TYAGIRIS's avatar TYAGIRIS
Browse files

fix 10ms framesize issues

parent 9baaf894
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -266,8 +266,11 @@ static ivas_error ivas_dec_init_split_rend(
    }
#endif

#ifdef SPLIT_REND_LCLD_5MS
    error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, (int16_t) st_ivas->hDecoderConfig->render_framesize );
#else
    error = ivas_split_renderer_open( &st_ivas->hSplitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hDecoderConfig->output_Fs, cldfb_in_flag, pcm_out_flag, st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS );

#endif
    return error;
}
#endif
+2 −1
Original line number Diff line number Diff line
@@ -1081,11 +1081,12 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
    numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses;

#ifdef SPLIT_REND_LCLD_5MS
    if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS &&
    if ( st_ivas->hDecoderConfig->render_framesize != IVAS_RENDER_FRAMESIZE_20MS &&
         ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ||
           hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof == 0 ) )
    {
        numSamplesPerChannelToDecode = (int16_t) ( output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES );
        numSamplesPerChannelToDecode *= (int16_t) st_ivas->hDecoderConfig->render_framesize;
    }
#else
    if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS && hIvasDec->st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS &&
+11 −0
Original line number Diff line number Diff line
@@ -1524,6 +1524,16 @@ void ivas_init_split_post_rend_handles(
    SPLIT_POST_REND_WRAPPER *hSplitRendWrapper 
);

#ifdef SPLIT_REND_LCLD_5MS
ivas_error ivas_split_renderer_open( 
    SPLIT_REND_WRAPPER *hSplitBinRend, 
    const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    const int32_t output_Fs, 
    const int16_t cldfb_in_flag,
    const int16_t pcm_out_flag,
    const int16_t num_subframes
);
#else
ivas_error ivas_split_renderer_open( 
    SPLIT_REND_WRAPPER *hSplitBinRend, 
    const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
@@ -1532,6 +1542,7 @@ ivas_error ivas_split_renderer_open(
    const int16_t pcm_out_flag,
    const int16_t is_5ms_frame
);
#endif

void ivas_split_renderer_close( 
    SPLIT_REND_WRAPPER *hSplitBinRend
+30 −2
Original line number Diff line number Diff line
@@ -1794,17 +1794,27 @@ void ivas_init_split_rend_handles(
 *
 *
 *------------------------------------------------------------------------*/

#ifdef SPLIT_REND_LCLD_5MS
static ivas_error split_renderer_open_lc3plus(
    SPLIT_REND_WRAPPER *hSplitRendWrapper,
    const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    const int32_t OutSampleRate,
    const int16_t num_subframes )
#else
static ivas_error split_renderer_open_lc3plus(
    SPLIT_REND_WRAPPER *hSplitRendWrapper,
    const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    const int32_t OutSampleRate,
    const int16_t is_5ms_frame )
#endif
{
    ivas_error error;
    int16_t i, delayBufferLength;
    LC3PLUS_CONFIG config;

#ifdef SPLIT_REND_LCLD_5MS
    config.lc3plus_frame_duration_us = pSplitRendConfig->codec_frame_size_ms * 1000;
    config.ivas_frame_duration_us = ( pSplitRendConfig->dof == 0 ) ? config.lc3plus_frame_duration_us * num_subframes : 20000;
#else
    if ( is_5ms_frame )
    {
        config.lc3plus_frame_duration_us = pSplitRendConfig->codec_frame_size_ms * 1000;
@@ -1815,6 +1825,7 @@ static ivas_error split_renderer_open_lc3plus(
        config.lc3plus_frame_duration_us = 5000;
        config.ivas_frame_duration_us = 20000;
    }
#endif
    config.samplerate = OutSampleRate;

    config.channels = BINAURAL_CHANNELS;
@@ -1872,6 +1883,15 @@ static ivas_error split_renderer_open_lc3plus(
 *
 *------------------------------------------------------------------------*/

#ifdef SPLIT_REND_LCLD_5MS
ivas_error ivas_split_renderer_open(
    SPLIT_REND_WRAPPER *hSplitRendWrapper,
    const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    const int32_t OutSampleRate,
    const int16_t cldfb_in_flag,
    const int16_t pcm_out_flag,
    const int16_t num_subframes )
#else
ivas_error ivas_split_renderer_open(
    SPLIT_REND_WRAPPER *hSplitRendWrapper,
    const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
@@ -1879,6 +1899,7 @@ ivas_error ivas_split_renderer_open(
    const int16_t cldfb_in_flag,
    const int16_t pcm_out_flag,
    const int16_t is_5ms_frame )
#endif
{
    ivas_error error, ch, num_ch;
#ifndef SPLIT_REND_WITH_HEAD_ROT
@@ -1985,10 +2006,17 @@ ivas_error ivas_split_renderer_open(
    {
        if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS )
        {
#ifdef SPLIT_REND_LCLD_5MS
            if ( ( error = split_renderer_open_lc3plus( hSplitRendWrapper, pSplitRendConfig, OutSampleRate, num_subframes ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#else
            if ( ( error = split_renderer_open_lc3plus( hSplitRendWrapper, pSplitRendConfig, OutSampleRate, is_5ms_frame ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#endif
        }
        else
        {
+40 −5
Original line number Diff line number Diff line
@@ -3240,8 +3240,18 @@ static void clearInputMasa(
    return;
}


#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_LCLD_5MS
static ivas_error initSplitRend(
    SPLIT_REND_WRAPPER *pSplitRendWrapper,
    IVAS_REND_AudioBuffer *pSplitRendEncBuffer,
    const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config,
    IVAS_REND_HeadRotData headRotData,
    const int32_t outputSampleRate,
    const AUDIO_CONFIG outConfig,
    const int16_t cldfb_in_flag,
    const int16_t num_subframes )
#else
static ivas_error initSplitRend(
    SPLIT_REND_WRAPPER *pSplitRendWrapper,
    IVAS_REND_AudioBuffer *pSplitRendEncBuffer,
@@ -3251,6 +3261,7 @@ static ivas_error initSplitRend(
    const AUDIO_CONFIG outConfig,
    const int16_t cldfb_in_flag,
    const int16_t is_5ms_frame )
#endif
{
    ivas_error error;
    IVAS_REND_AudioBufferConfig bufConfig;
@@ -3266,10 +3277,17 @@ static ivas_error initSplitRend(
            ivas_renderSplitUpdateNoCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData );
        }

#ifdef SPLIT_REND_LCLD_5MS
        if ( ( error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in_flag, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, num_subframes ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#else
        if ( ( error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in_flag, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, is_5ms_frame ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#endif

        /*allocate for CLDFB in and change to TD during process if needed*/
        bufConfig.numSamplesPerChannel = MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL;
@@ -4020,17 +4038,22 @@ ivas_error IVAS_REND_AddInput(
        {
            return error;
        }

        if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#else
        if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#endif

        if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, ( hIvasRend->num_subframes == 1 ) ? 1 : 0 ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#endif
    }
#endif

@@ -4917,17 +4940,22 @@ int16_t IVAS_REND_FeedRenderConfig(
        {
            return error;
        }

        if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#else
        if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#endif

        if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, ( hIvasRend->num_subframes == 1 ) ? 1 : 0 ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#endif
    }
#endif

@@ -7128,9 +7156,16 @@ static ivas_error renderSplitBinauralWithPostRot(

#ifdef SPLIT_REND_LCLD_5MS
    config.lc3plus_frame_duration_us = bits.codec_frame_size_ms * 1000;
    if ( pCombinedOrientationData->num_subframes == 1 )
    if ( pCombinedOrientationData->num_subframes != MAX_PARAM_SPATIAL_SUBFRAMES )
    {
        if ( bits.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS )
        {
            config.ivas_frame_duration_us = ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ? config.lc3plus_frame_duration_us * pCombinedOrientationData->num_subframes : 20000;
        }
        else
        {
            config.ivas_frame_duration_us = ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ? config.lc3plus_frame_duration_us : 20000;
        }
        iNumLCLDIterationsPerFrame = 1;
    }
    else