Commit 6d6e033e authored by vaclav's avatar vaclav
Browse files

- Merge branch '1079-allocate-isar-data-handle-dynamically' of...

- Merge branch '1079-allocate-isar-data-handle-dynamically' of https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec into 1079-allocate-isar-data-handle-dynamically
parents e2572235 fa2c7664
Loading
Loading
Loading
Loading
+30 −46
Original line number Diff line number Diff line
@@ -345,11 +345,6 @@ void IVAS_DEC_Close(
        ( *phIvasDec )->hVoIP = NULL;
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT
    /* destroy Split binaural renderer (ISAR) handle */
    ivas_destroy_handle_isar( &( *phIvasDec )->st_ivas->hSplitBinRend );
#endif

    if ( ( *phIvasDec )->st_ivas )
    {
        ivas_destroy_dec( ( *phIvasDec )->st_ivas );
@@ -514,17 +509,6 @@ ivas_error IVAS_DEC_Configure(
        return error;
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT
    /* create ISAR handle */
    if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        if ( ( error = ivas_create_handle_isar( &st_ivas->hSplitBinRend ) ) != IVAS_ERR_OK )
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for ISAR handle" );
        }
    }
#endif

    if ( hIvasDec->mode == IVAS_DEC_MODE_EVS )
    {
        hIvasDec->st_ivas->ivas_format = MONO_FORMAT;
@@ -3988,36 +3972,6 @@ PCM_RESOLUTION pcm_type_API_to_internal(
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_is_split_rendering_enabled()
 *
 *
 *---------------------------------------------------------------------*/

int16_t IVAS_DEC_is_split_rendering_enabled(
    IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle  */
)
{
    Decoder_Struct *st_ivas;
    int16_t isSplitRend;

    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }
    st_ivas = hIvasDec->st_ivas;
    isSplitRend = 0;

    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ||
         ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) )
    {
        isSplitRend = 1;
    }

    return isSplitRend;
}


/*-------------------------------------------------------------------*
 * ivas_create_handle_isar()
 *
@@ -4072,6 +4026,36 @@ static void ivas_destroy_handle_isar(
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_is_split_rendering_enabled()
 *
 *
 *---------------------------------------------------------------------*/

int16_t IVAS_DEC_is_split_rendering_enabled(
    IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle  */
)
{
    Decoder_Struct *st_ivas;
    int16_t isSplitRend;

    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }
    st_ivas = hIvasDec->st_ivas;
    isSplitRend = 0;

    if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ||
         ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) )
    {
        isSplitRend = 1;
    }

    return isSplitRend;
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_is_split_rendering_coded_out()
 *