Commit a4d676be authored by emerit's avatar emerit
Browse files

Merge with diegetic

parent c21c8dc6
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@
#include <stdint.h>
#include "options.h"
#include "prot.h"
#ifdef ISM_NO_DIEGETIC_PAN
#include "ivas_prot.h"
#endif
#include "ivas_prot_rend.h"
#include <math.h>
#include "ivas_rom_com.h"
@@ -410,8 +413,8 @@ ivas_error TDREND_GetMix(
        {
            float mixer_left = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f;
            float mixer_rigth = 1.f - mixer_left;
            v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], mixer_rigth, output_buf[1], subframe_length );
            v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], mixer_left, output_buf[0], subframe_length );
            v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], mixer_rigth, output_buf[1], subframe_length );
        }
#endif
    }
@@ -508,6 +511,20 @@ void TDREND_Update_object_positions(
            TDREND_MIX_SRC_SetPos( hBinRendererTd, nS, Pos );
            TDREND_MIX_SRC_SetDirAtten( hBinRendererTd, nS, DirAtten_p );
#ifdef ISM_NO_DIEGETIC_PAN
#ifdef TD5
            if ( hIsmMetaData[nS]->radius == 0 )
            {
                Pos[0] = 0;
                Pos[1] = sinf( hIsmMetaData[nS]->azimuth * PI_OVER_180 );
                Pos[2] = 0;
                TDREND_MIX_SRC_SetPos( hBinRendererTd, nS, Pos );
                TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NO_DIEGETIC );
            }
            else
            {
                TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING );
            }
#else
            if ( hBinRendererTd->Sources[nS]->no_diegtic_pan > 3 )
            {
                Pos[0] = 0;
@@ -539,10 +556,10 @@ void TDREND_Update_object_positions(
                    hBinRendererTd->Sources[nS]->no_diegtic_pan = 0;
                }
            }
#endif
#else
            TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING );
#endif

            TDREND_MIX_SRC_SetDir( hBinRendererTd, nS, Dir );
        }
    }
@@ -670,7 +687,11 @@ ivas_error ivas_td_binaural_open_ext(
    hTransSetup.ls_azimuth = customLsInput->ls_azimuth;
    hTransSetup.ls_elevation = customLsInput->ls_elevation;

#ifdef TD5
    return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, hRendCfg->directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns );
#else
    return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns );
#endif
}


+3 −1
Original line number Diff line number Diff line
@@ -704,7 +704,9 @@ void TDREND_SRC_Init(
    Src_p->azim_prev = 0.0f;
    Src_p->elev_prev = 0.0f;
#ifdef ISM_NO_DIEGETIC_PAN
#ifndef TD5
    Src_p->no_diegtic_pan = 0;
#endif
#endif

    return;
+2 −0
Original line number Diff line number Diff line
@@ -618,8 +618,10 @@ typedef struct
    float mem_hrf_right[SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1];
    float Gain;
#ifdef ISM_NO_DIEGETIC_PAN
#ifndef TD5
    int16_t no_diegtic_pan;
#endif
#endif
} TDREND_SRC_t;

/* Top level TD binaural renderer handle */