Commit 6fb2fa21 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into 128-add-a-test-to-merge-pipeline-for-commits-behind-target-branch
parents de7912d5 a55e7d9e
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5458,7 +5458,7 @@ void TonalMdctConceal_create_concealment_noise(
    const int16_t idchan,
    const int16_t subframe_idx,
    const int16_t core,
    const int16_t crossfade_gain,
    const float crossfade_gain,
    const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode
);

+31 −25
Original line number Diff line number Diff line
@@ -53,8 +53,8 @@ static ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRenderer
#endif
static void TDREND_Clear_Update_flags( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd );
#ifdef FIX_I106_TDREND_5MS
static void TDREND_Update_listener_orientation( Decoder_Struct *st_ivas, const int16_t subframe_idx );
static void TDREND_Update_object_positions( Decoder_Struct *st_ivas, float output[][L_FRAME48k] );
static void TDREND_Update_listener_orientation( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, const int16_t headRotEnabled, const Quaternion *headPosition );
static void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, const int16_t numSources, const IVAS_FORMAT in_format, const ISM_METADATA_HANDLE *hIsmMetaData, float output[][L_FRAME48k] );
#endif

/*---------------------------------------------------------------------*
@@ -342,12 +342,14 @@ void ObjRenderIVASFrame(

#ifdef FIX_I106_TDREND_5MS
    /* Update object position(s) */
    TDREND_Update_object_positions( st_ivas, output );
    TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, st_ivas->ivas_format, st_ivas->hIsmMetaData, output );

    for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ )
    {
        /* Update the listener's location/orientation */
        TDREND_Update_listener_orientation( st_ivas, subframe_idx );
        TDREND_Update_listener_orientation( st_ivas->hBinRendererTd,
                                            st_ivas->hDecoderConfig->Opt_Headrotation,
                                            ( st_ivas->hHeadTrackData != NULL ) ? &st_ivas->hHeadTrackData->Quaternions[subframe_idx] : NULL );

        if ( ( st_ivas->hRenderConfig != NULL ) && ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) )
        {
@@ -510,7 +512,10 @@ static void TDREND_Clear_Update_flags(
 *---------------------------------------------------------------------*/

static void TDREND_Update_object_positions(
    Decoder_Struct *st_ivas,   /* i/o: IVAS decoder structure    */
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle              */
    const int16_t numSources,                          /* i  : Number of sources to render      */
    const IVAS_FORMAT in_format,                       /* i  : Format of input sources          */
    const ISM_METADATA_HANDLE *hIsmMetaData,           /* i  : Input metadata for ISM objects   */
    float output[][L_FRAME48k]                         /* i/o: SCE/MC channels                  */
)
{
@@ -520,27 +525,27 @@ static void TDREND_Update_object_positions(
    float Dir[3];
    int16_t c_indx;

    DirAtten_p = st_ivas->hBinRendererTd->DirAtten_p;
    DirAtten_p = hBinRendererTd->DirAtten_p;

    /* For each source, write the frame data to the source object*/
    c_indx = 0;
    for ( nS = 0; nS < st_ivas->nchan_transport; nS++ )
    for ( nS = 0; nS < numSources; nS++ )
    {
        if ( !( st_ivas->ivas_format == MC_FORMAT && nS == LFE_CHANNEL ) ) /* Skip LFE for MC */
        if ( !( in_format == MC_FORMAT && nS == LFE_CHANNEL ) ) /* Skip LFE for MC */
        {
            st_ivas->hBinRendererTd->Sources[c_indx]->InputFrame_p = output[nS];
            st_ivas->hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE;
            hBinRendererTd->Sources[c_indx]->InputFrame_p = output[nS];
            hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE;
            c_indx++;
        }

        if ( st_ivas->ivas_format == ISM_FORMAT )
        if ( in_format == ISM_FORMAT )
        {

            /* Update the source positions */
            /* Source position and direction */
            Pos[0] = cosf( st_ivas->hIsmMetaData[nS]->elevation * PI_OVER_180 ) * cosf( st_ivas->hIsmMetaData[nS]->azimuth * PI_OVER_180 );
            Pos[1] = cosf( st_ivas->hIsmMetaData[nS]->elevation * PI_OVER_180 ) * sinf( st_ivas->hIsmMetaData[nS]->azimuth * PI_OVER_180 );
            Pos[2] = sinf( st_ivas->hIsmMetaData[nS]->elevation * PI_OVER_180 );
            Pos[0] = cosf( hIsmMetaData[nS]->elevation * PI_OVER_180 ) * cosf( hIsmMetaData[nS]->azimuth * PI_OVER_180 );
            Pos[1] = cosf( hIsmMetaData[nS]->elevation * PI_OVER_180 ) * sinf( hIsmMetaData[nS]->azimuth * PI_OVER_180 );
            Pos[2] = sinf( hIsmMetaData[nS]->elevation * PI_OVER_180 );
            Dir[0] = 1.0f;
            Dir[1] = 0.0f;
            Dir[2] = 0.0f;
@@ -550,11 +555,11 @@ static void TDREND_Update_object_positions(
            DirAtten_p->ConeOuterAngle = 360.0f;
            DirAtten_p->ConeOuterGain = 1.0f;

            TDREND_MIX_SRC_SetPos( st_ivas->hBinRendererTd, nS, Pos );
            TDREND_MIX_SRC_SetDirAtten( st_ivas->hBinRendererTd, nS, DirAtten_p );
            TDREND_MIX_SRC_SetPlayState( st_ivas->hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING );
            TDREND_MIX_SRC_SetPos( hBinRendererTd, nS, Pos );
            TDREND_MIX_SRC_SetDirAtten( hBinRendererTd, nS, DirAtten_p );
            TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING );

            TDREND_MIX_SRC_SetDir( st_ivas->hBinRendererTd, nS, Dir );
            TDREND_MIX_SRC_SetDir( hBinRendererTd, nS, Dir );
        }
    }

@@ -568,8 +573,9 @@ static void TDREND_Update_object_positions(
 *---------------------------------------------------------------------*/

static void TDREND_Update_listener_orientation(
    Decoder_Struct *st_ivas,   /* i/o: IVAS decoder structure    */
    const int16_t subframe_idx /*  i: subframe index*/
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle    */
    const int16_t headRotEnabled,                      /* i  : Headrotation flag     */
    const Quaternion *headPosition                     /* i  : Head Position         */
)
{
    float Pos[3];
@@ -583,10 +589,10 @@ static void TDREND_Update_listener_orientation(
    Pos[1] = 0.0f;
    Pos[2] = 0.0f;

    if ( st_ivas->hHeadTrackData != NULL )
    if ( headRotEnabled )
    {
        /* Obtain head rotation matrix */
        QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[subframe_idx], Rmat );
        QuatToRotMat( *headPosition, Rmat );
        /* Apply rotation matrix to looking vector [1;0;0] */
        FrontVec[0] = Rmat[0][0];
        FrontVec[1] = Rmat[0][1];
@@ -609,8 +615,8 @@ static void TDREND_Update_listener_orientation(
    }

    /* Set the listener position and orientation:*/
    TDREND_MIX_LIST_SetPos( st_ivas->hBinRendererTd, Pos );
    TDREND_MIX_LIST_SetOrient( st_ivas->hBinRendererTd, FrontVec, UpVec );
    TDREND_MIX_LIST_SetPos( hBinRendererTd, Pos );
    TDREND_MIX_LIST_SetOrient( hBinRendererTd, FrontVec, UpVec );

    return;
}
+2 −2
Original line number Diff line number Diff line
@@ -1001,7 +1001,7 @@ void TonalMdctConceal_create_concealment_noise(
    const int16_t idchan,
    const int16_t subframe_idx,
    const int16_t core,
    const int16_t crossfade_gain,
    const float crossfade_gain,
    const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode )
{
    STEREO_MDCT_DEC_DATA_HANDLE hStereoMdct;
@@ -1191,7 +1191,7 @@ void TonalMdctConceal_whiten_noise_shape(
        sns_interpolate_scalefactors( scfs_bg, scf, DEC );
        scfs_for_shaping = &scfs_int[0];
    }
    else if ( whitening_mode == ON_FIRST_GOOD_FRAME )
    else /* whitening_mode == ON_FIRST_GOOD_FRAME */
    {
        scfs_for_shaping = &scfs_bg[0];
    }