Commit f4fda707 authored by vaclav's avatar vaclav
Browse files

fix for MC format with HR + sanity checks for invalid bitstream signaling

parent 6e2889ab
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ ivas_error ivas_td_binaural_open(

#ifdef FIX_HRTF_LOAD
    if ( st_ivas->hHrtfTD == NULL && st_ivas->hDecoderConfig->Opt_HRTF_binary &&
         ( st_ivas->ivas_format != SBA_ISM_FORMAT ) // ToDo: temporary hack to avoid ASAN errors -> see issue #xx
         ( st_ivas->ivas_format != SBA_ISM_FORMAT ) // ToDo: temporary hack to avoid ASAN errors -> see issue #1202
    )
    {
        return IVAS_ERROR( IVAS_ERR_INTERNAL, "HRTF binary file present but not used in TD renderer" );
+6 −4
Original line number Diff line number Diff line
@@ -1076,7 +1076,7 @@ ivas_error IVAS_DEC_ReadFormat(
    ISM_MODE ism_mode_old;
    MC_MODE mc_mode_old;
    int16_t nchan_transport_old;
    AUDIO_CONFIG intern_config_old;
    AUDIO_CONFIG intern_config_old, transport_config_old;
    RENDERER_TYPE renderer_type_old;

    if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
@@ -1090,6 +1090,7 @@ ivas_error IVAS_DEC_ReadFormat(
    mc_mode_old = st_ivas->mc_mode;
    nchan_transport_old = st_ivas->nchan_transport;
    intern_config_old = st_ivas->intern_config;
    transport_config_old = st_ivas->transport_config;
    renderer_type_old = st_ivas->renderer_type;

    if ( st_ivas->ivas_format == MONO_FORMAT )
@@ -1157,11 +1158,11 @@ ivas_error IVAS_DEC_ReadFormat(
            render what still fits in the new granularity */
            int16_t tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs );

            // st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue 1200
            // st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200

            if ( st_ivas->ivas_format == MASA_FORMAT )
            {
                st_ivas->nchan_ism = 0; // ToDo: temporary hack to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue 1199
                st_ivas->nchan_ism = 0; // ToDo: temporary hack to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1199
            }

            if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity )
@@ -1178,6 +1179,7 @@ ivas_error IVAS_DEC_ReadFormat(
    st_ivas->mc_mode = mc_mode_old;
    st_ivas->nchan_transport = nchan_transport_old;
    st_ivas->intern_config = intern_config_old;
    st_ivas->transport_config = transport_config_old;
    st_ivas->renderer_type = renderer_type_old;

    return IVAS_ERR_OK;
@@ -3115,7 +3117,7 @@ ivas_error IVAS_DEC_HRTF_binary_close(
    if ( st_ivas->hDecoderConfig->Opt_HRTF_binary && st_ivas->ini_frame > 0 )
    {
        if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) &&
             ( hIvasDec->st_ivas->ivas_format != SBA_ISM_FORMAT ) // ToDo: temporary hack to avoid ASAN errors -> see issue #xx
             ( hIvasDec->st_ivas->ivas_format != SBA_ISM_FORMAT ) // ToDo: temporary hack to avoid ASAN errors -> see issue #1202
        )
        {
            ivas_HRTF_binary_close( &st_ivas->hHrtfTD );