Commit fd9ae9fd authored by Jouni Paulus's avatar Jouni Paulus
Browse files

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

Merge remote-tracking branch 'origin/main' into 585-masa-2tc-dtx-to-ext-output-has-transition-artifacts
parents f2f21f2c 528fa2d3
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1582,14 +1582,22 @@ typedef enum
typedef enum
{
    TDREND_POSTYPE_ABSOLUTE,                                                /* The source position is in absolute coordinates  */
#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT
    TDREND_POSTYPE_NON_DIEGETIC                                             /* The source position is non-diegetic */
#else
    TDREND_POSTYPE_RELATIVE_TO_LISTENER                                     /* The source position is relative to the listener */
#endif
} TDREND_PosType_t;

typedef enum
{
    TDREND_PLAYSTATUS_INITIAL,
#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT
    TDREND_PLAYSTATUS_PLAYING,
    TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC
#else
    TDREND_PLAYSTATUS_PLAYING
#endif
} TDREND_PlayStatus_t;

typedef enum

lib_com/options.h

100644 → 100755
+2 −0
Original line number Diff line number Diff line
@@ -163,6 +163,8 @@
#define FIX_UNCLR_ISSUE                                 /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */
#define FIX_TCX_LOWRATE_LIMITATION                      /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */
#define FIX_575_LOW_OVERLAP_PLC_RECOVERY                /* FhG: Issue 575 fix for PLC and transistion to TCX5*/
#define FIX_550_FIRST_FRAME_ACCESS                      /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */
#define FIX_550_FIRST_FRAME_ACCESS_ALT                  /* Eri: Issue 550: Should be merged with FIX_550_FIRST_FRAME_ACCESS above, or accepted at the same time */
#define FIX_569_TD_FILTER_LENGTH                        /* Eri: Issue 569: If an HRTF binary file exceeds the SFX_SPAT_BIN_MAX_FILTER_LENGTH the decoder crashes. This truncates the filter when generated from the model.  */
#define ISM_FB_16k4                                     /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */
#define FIX_580_PARAMMC_ENER_BURSTS                     /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */
+49 −0
Original line number Diff line number Diff line
@@ -291,6 +291,21 @@ ivas_error ivas_td_binaural_renderer_unwrap(
            hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE;
            c_indx++;
        }
#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT
#ifdef FIX_550_FIRST_FRAME_ACCESS
        if ( ivas_format == ISM_FORMAT )
        {
            if ( hIsmMetaData[nS]->non_diegetic_flag )
            {
                TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC );
            }
            else
            {
                TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING );
            }
        }
#endif
#endif
    }

    for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ )
@@ -316,6 +331,19 @@ ivas_error ivas_td_binaural_renderer_unwrap(
        {
            return error;
        }

#ifdef FIX_550_FIRST_FRAME_ACCESS
        /* Advance subframe pointer */
        c_indx = 0;
        for ( nS = 0; nS < num_src; nS++ )
        {
            if ( !( ivas_format == MC_FORMAT && nS == lfe_idx ) ) /* Skip LFE for MC */
            {
                hBinRendererTd->Sources[c_indx]->InputFrame_p += subframe_length;
                c_indx++;
            }
        }
#endif
    }

    if ( hReverb != NULL )
@@ -352,7 +380,9 @@ ivas_error TDREND_GetMix(
    float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH];
    float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH];
    int16_t intp_count;
#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT
    float pan_left, pan_right;
#endif
    int16_t subframe_update_flag;

    subframe_update_flag = subframe_idx == ism_md_subframe_update;
@@ -389,13 +419,20 @@ ivas_error TDREND_GetMix(
            error = TDREND_REND_RenderSourceHRFilt( Src_p, hrf_left_delta, hrf_right_delta, intp_count, output_buf, subframe_length );
        }

#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT
        if ( ( SrcRend_p->InputAvailable == TRUE ) && ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC ) )
        {
            pan_left = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f;
            pan_right = 1.f - pan_left;
#ifdef FIX_550_FIRST_FRAME_ACCESS
            v_multc_acc( Src_p->InputFrame_p, pan_left, output_buf[0], subframe_length );
            v_multc_acc( Src_p->InputFrame_p, pan_right, output_buf[1], subframe_length );
#else
            v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_left, output_buf[0], subframe_length );
            v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_right, output_buf[1], subframe_length );
#endif
        }
#endif
    }

    /* Populate output variable */
@@ -472,11 +509,23 @@ void TDREND_Update_object_positions(
                Pos[1] = hIsmMetaData[nS]->azimuth / 90.f;
                Pos[2] = 0;
                TDREND_MIX_SRC_SetPos( hBinRendererTd, nS, Pos );
#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT
                hBinRendererTd->Sources[nS]->SrcSpatial_p->PosType = TDREND_POSTYPE_NON_DIEGETIC;
#else
#ifndef FIX_550_FIRST_FRAME_ACCESS
                TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC );
#endif
#endif
            }
            else
            {
#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT
                hBinRendererTd->Sources[nS]->SrcSpatial_p->PosType = TDREND_POSTYPE_ABSOLUTE;
#else
#ifndef FIX_550_FIRST_FRAME_ACCESS
                TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING );
#endif
#endif
            }
            TDREND_MIX_SRC_SetDir( hBinRendererTd, nS, Dir );
        }
+2 −0
Original line number Diff line number Diff line
@@ -79,7 +79,9 @@ ivas_error TDREND_REND_RenderSourceHRFilt(
    v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length );
    v_add( RightOutputFrame, output_buf[1], output_buf[1], subframe_length );

#ifndef FIX_550_FIRST_FRAME_ACCESS
    Src_p->InputFrame_p += subframe_length; /* Increment input pointer */
#endif


    return IVAS_ERR_OK;
+4 −0
Original line number Diff line number Diff line
@@ -309,7 +309,11 @@ ivas_error TDREND_MIX_AddSrc(
    }
    else
    {
#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT
        if ( ( PosType < TDREND_POSTYPE_ABSOLUTE ) || ( PosType > TDREND_POSTYPE_NON_DIEGETIC ) )
#else
        if ( ( PosType < TDREND_POSTYPE_ABSOLUTE ) || ( PosType > TDREND_POSTYPE_RELATIVE_TO_LISTENER ) )
#endif
        {
            return ( IVAS_ERROR( IVAS_ERR_INTERNAL, "Invalid position type!\n" ) );
        }
Loading