Commit 38a672c9 authored by Adam Mills's avatar Adam Mills
Browse files

Moving isar_split_rend_choose_default_codec() under isar_pre_rend_open()

parent 9852d61a
Loading
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -265,11 +265,12 @@ static ivas_error ivas_dec_init_split_rend(
        }
    }

    if ( ( error = isar_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, &st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, pcm_out_flag, (int16_t) st_ivas->hDecoderConfig->render_framesize ) ) != IVAS_ERR_OK )
    {
        return error;
    }
    // if ( ( error = isar_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, &st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, cldfb_in_flag, pcm_out_flag, (int16_t) st_ivas->hDecoderConfig->render_framesize ) ) != IVAS_ERR_OK )
    // {
    //     return error;
    // }

    int16_t mixed_td_cldfb_flag = 0;
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef FIX_766_OMASA_SPLIT_REND
    if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) ||
@@ -278,11 +279,11 @@ static ivas_error ivas_dec_init_split_rend(
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT )
#endif
    {
        cldfb_in_flag = 0;
        mixed_td_cldfb_flag = 1;
    }
#endif

    error = isar_pre_rend_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 );
    error = isar_pre_rend_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, mixed_td_cldfb_flag );
    return error;
}
#endif
+24 −11
Original line number Diff line number Diff line
@@ -1805,11 +1805,12 @@ static ivas_error split_renderer_open_lc3plus(

ivas_error isar_pre_rend_open(
    SPLIT_REND_WRAPPER *hSplitRendWrapper,
    const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    ISAR_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 )
    const int16_t num_subframes,
    const int16_t mixed_td_cldfb_flag )
{
    ivas_error error, ch, num_ch;
#ifndef SPLIT_REND_WITH_HEAD_ROT
@@ -1820,19 +1821,31 @@ ivas_error isar_pre_rend_open(
    cldfbMode = CLDFB_ANALYSIS;
#endif

    int16_t cldfb_in_flag_local = cldfb_in_flag;

    if ( ( error = isar_split_rend_choose_default_codec( &(pSplitRendConfig->codec), &pSplitRendConfig->codec_frame_size_ms, cldfb_in_flag_local, pcm_out_flag, (int16_t) num_subframes ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    if(mixed_td_cldfb_flag)
    {
        cldfb_in_flag_local = 0;
    }

    if ( ( error = isar_split_rend_validate_config( pSplitRendConfig, pcm_out_flag ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    if ( cldfb_in_flag == 0 )
    if ( cldfb_in_flag_local == 0 )
    {
        isCldfbNeeded = 1;
#ifndef SPLIT_REND_WITH_HEAD_ROT
        cldfbMode = CLDFB_ANALYSIS;
#endif
    }
    else if ( pSplitRendConfig->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS && cldfb_in_flag )
    else if ( pSplitRendConfig->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS && cldfb_in_flag_local )
    {
#ifdef SPLIT_REND_WITH_HEAD_ROT
        isCldfbNeeded = 1;
@@ -1841,7 +1854,7 @@ ivas_error isar_pre_rend_open(
        cldfbMode = CLDFB_SYNTHESIS;
#endif
    }
    else if ( pcm_out_flag && cldfb_in_flag )
    else if ( pcm_out_flag && cldfb_in_flag_local )
    {
#ifdef SPLIT_REND_WITH_HEAD_ROT
        isCldfbNeeded = 1;
@@ -1946,7 +1959,7 @@ ivas_error isar_pre_rend_open(
ivas_error isar_pre_rend_init(
    SPLIT_REND_WRAPPER *pSplitRendWrapper,
    IVAS_REND_AudioBuffer *pSplitRendEncBuffer,
    const ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config,
    ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config,
    IVAS_REND_HeadRotData headRotData,
    const int32_t outputSampleRate,
    const AUDIO_CONFIG outConfig,
@@ -1967,7 +1980,7 @@ ivas_error isar_pre_rend_init(
            isar_renderSplitUpdateNoCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData );
        }

        if ( ( error = isar_pre_rend_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in_flag, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, num_subframes ) ) != IVAS_ERR_OK )
        if ( ( error = isar_pre_rend_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in_flag, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, num_subframes, 0 ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -2386,10 +2399,10 @@ ivas_error isar_pre_rend_MultiBinToSplitBinaural(
    /* Needs to be done at runtime. If this was in another API function,
     * there would be no guarantee that the user did not change
     * the split rendering config before calling the main rendering function */
    if ( ( error = isar_split_rend_choose_default_codec( &splitCodec, &codec_frame_size_ms, cldfb_in_flag, pcm_out_flag, 0 ) ) != IVAS_ERR_OK )
    {
        return error;
    }
    // if ( ( error = isar_split_rend_choose_default_codec( &splitCodec, &codec_frame_size_ms, cldfb_in_flag, pcm_out_flag, 0 ) ) != IVAS_ERR_OK )
    // {
    //     return error;
    // }


    if ( cldfb_in_flag == 0 )
+4 −3
Original line number Diff line number Diff line
@@ -39,16 +39,17 @@

ivas_error isar_pre_rend_open(
    SPLIT_REND_WRAPPER *hSplitBinRend,
    const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    ISAR_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 );
    const int16_t num_subframes,
    const int16_t mixed_td_cldfb_flag );

ivas_error isar_pre_rend_init(
    SPLIT_REND_WRAPPER *pSplitRendWrapper,
    IVAS_REND_AudioBuffer *pSplitRendEncBuffer,
    const ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config,
    ISAR_SPLIT_REND_CONFIG_DATA *pSplit_rend_config,
    IVAS_REND_HeadRotData headRotData,
    const int32_t outputSampleRate,
    const IVAS_AUDIO_CONFIG outConfig,
+8 −8
Original line number Diff line number Diff line
@@ -3582,10 +3582,10 @@ ivas_error IVAS_REND_AddInput(
        int16_t cldfb_in_flag;
        cldfb_in_flag = getCldfbRendFlag( hIvasRend, getAudioConfigType( inConfig ) );

        if ( ( error = isar_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, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        {
            return error;
        }
        // if ( ( error = isar_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, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        // {
        //     return error;
        // }

        if ( ( error = isar_pre_rend_init( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        {
@@ -4424,10 +4424,10 @@ int16_t IVAS_REND_FeedRenderConfig(
        cldfb_in_flag = getCldfbRendFlag( hIvasRend, IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN );
        isar_pre_rend_close( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer );

        if ( ( error = isar_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, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        {
            return error;
        }
        // if ( ( error = isar_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, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        // {
        //     return error;
        // }

        if ( ( error = isar_pre_rend_init( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig, cldfb_in_flag, hIvasRend->num_subframes ) ) != IVAS_ERR_OK )
        {