Commit 1587c073 authored by hsd's avatar hsd
Browse files

Merge remote-tracking branch...

Merge remote-tracking branch 'upstream_3gppforge/109-harmonize-head-and-orientation-tracking-tmpmerge' into mmc/109-with-acoustic-front-upstream-rc-tmpmerge
parents aa86e88b 01a65056
Loading
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -78,6 +78,19 @@ void ivas_td_binaural_renderer(
                                      st_ivas->hCrend,
#endif
                                      st_ivas->transport_config,
                                      st_ivas->hDecoderConfig->output_Fs, st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format,
                                      st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL, output, output_frame );
                                      st_ivas->hDecoderConfig->output_Fs,
                                      st_ivas->hBinRendererTd,
                                      st_ivas->nchan_transport,
                                      LFE_CHANNEL,
                                      st_ivas->ivas_format,
                                      st_ivas->hIsmMetaData,
                                      st_ivas->hDecoderConfig->Opt_Headrotation,
                                      ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL,
                                      output,
                                      output_frame
#ifdef FIX_I109_ORIENTATION_TRACKING
                                      ,
                                      st_ivas->hHeadTrackData->OrientationTracker
#endif
    );
}
+34 −3
Original line number Diff line number Diff line
@@ -240,6 +240,10 @@ void ivas_td_binaural_renderer_unwrap(
    const IVAS_QUATERNION *Quaternions,                /* i  : Head tracking data per subframe      */
    float output[][L_FRAME48k],                        /* i/o: SCE channels / Binaural synthesis    */
    const int16_t output_frame                         /* i  : output frame length                  */
#ifdef FIX_I109_ORIENTATION_TRACKING
    ,
    ivas_orient_trk_state_t *pOTR /* i/o: orientation tracker handle           */
#endif
)
{
    int16_t subframe_length;
@@ -274,7 +278,18 @@ void ivas_td_binaural_renderer_unwrap(
    for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ )
    {
        /* Update the listener's location/orientation */
#ifdef FIX_I109_ORIENTATION_TRACKING
        if ( pOTR != NULL )
        {
            if ( ivas_orient_trk_Process( pOTR, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &trackedHeadOrientation ) != IVAS_ERR_OK )
            {
                exit( -1 );
            }
        }
        TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( pOTR != NULL ) ? &trackedHeadOrientation : NULL );
#else
        TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL );
#endif

        if ( ( hRenderConfig != NULL ) && ( hRenderConfig->roomAcoustics.late_reverb_on ) )
        {
@@ -640,9 +655,25 @@ ivas_error ivas_td_binaural_renderer_ext(
#endif
    output_Fs = output_frame * 50;

    ivas_td_binaural_renderer_unwrap( NULL, 1, NULL, transport_config, output_Fs, pTDRend->hBinRendererTd, num_src, lfe_idx,
                                      ivas_format, hIsmMetaData, headRotData->headRotEnabled, ( headRotData != NULL ) ? headRotData->headPositions : NULL,
                                      output, output_frame );
    ivas_td_binaural_renderer_unwrap( NULL,
                                      1,
                                      NULL,
                                      transport_config,
                                      output_Fs,
                                      pTDRend->hBinRendererTd,
                                      num_src,
                                      lfe_idx,
                                      ivas_format,
                                      hIsmMetaData,
                                      headRotData->headRotEnabled,
                                      ( headRotData != NULL ) ? headRotData->headPositions : NULL,
                                      output,
                                      output_frame
#ifdef FIX_I109_ORIENTATION_TRACKING
                                      ,
                                      headRotData->hOrientationTracker
#endif
    );

    pop_wmops();

+4 −0
Original line number Diff line number Diff line
@@ -234,6 +234,10 @@ void ivas_td_binaural_renderer_unwrap(
    const IVAS_QUATERNION *Quaternions,                         /* i  : Head tracking data per subframe         */
    float output[][L_FRAME48k],                                 /* i/o: SCE channels / Binaural synthesis       */
    const int16_t output_frame                                  /* i  : output frame length                     */
#ifdef FIX_I109_ORIENTATION_TRACKING
    ,
    ivas_orient_trk_state_t *pOTR                               /* i/o: orientation tracker handle              */
#endif
);

ivas_error ivas_td_binaural_renderer_ext(