Commit 649dbada authored by multrus's avatar multrus
Browse files

merge from main

parents 2e044a05 fa13d1ed
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1649,7 +1649,11 @@ static void resetHeadRotation(
        pPos[i].x_fx = 0;
        pPos[i].y_fx = 0;
        pPos[i].z_fx = 0;
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
        pPos[i].q_fact = 22;
#else
        pPos[i].q_fact = 25;
#endif
    }

    return;
+12 −0
Original line number Diff line number Diff line
@@ -63,6 +63,10 @@
#define IVAS_ER_LIST_HEIGHT              1.6f
#define IVAS_ER_LIST_HEIGHT_FX           6710886 /* 1.6f in Q.22 */
#define IVAS_DEFAULT_AEID                65535
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
#define IVAS_LISTENER_POSITION_MAX     327.67f
#define IVAS_LISTENER_POSITION_MAX_Q22 1374347592 /* 327.67 in Q22 */
#endif

/* JBM constants for adaptive-playout */
#define IVAS_TIME_SCALE_MIN 50  /* min. time-scaling [%] */
@@ -160,7 +164,11 @@ typedef struct
typedef struct
{
    float x, y, z;
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    Word32 x_fx, y_fx, z_fx; /* Q22, Q22, Q22 */
#else
    Word32 x_fx, y_fx, z_fx;
#endif
    Word16 q_fact;

} IVAS_VECTOR3;
@@ -351,7 +359,11 @@ typedef struct _IVAS_RENDER_CONFIG
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
    Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15}
    float distAtt[3];
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    Word32 distAtt_fx[3]; /* {Q25, Q28, Q28} */
#else
    Word32 distAtt_fx[3]; /* {Q27, Q30, Q30} */
#endif

} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;

+7 −0
Original line number Diff line number Diff line
@@ -99,6 +99,9 @@
#define FIX_BASOP_2532_cx_e                             /* FhG: Fix issue 2532 about additional exponent variable*/
#define HARMONIZE_2543_SQ_gain                          /* FhG: Harmonize SQ_gain */
#define FIX_ISSUE_2533_EXTRA_CONDITION                  /* FhG: Fix issue basop 2533 removing the extra condition*/
#define HARMONIZE_2537_SetTCXModeInfo                 /* FhG: Harmonize SetTCXModeInfo  - IVAS_VERSION OBVIOUSLY NOT FITTING FOR EVS - pipes not green */
#define HARMONIZE_2537_GetTCXMaxenergyChange            /* FhG: Harmonize GetTCXMaxenergyChange */
#define HARMONIZE_2508_InitTransientDetection          /* FhG: harmonize GetAttackForTCXDecision derivates for evs/ivas  */

/* #################### End BE switches ################################## */

@@ -106,6 +109,7 @@
/* any switch which is non-be wrt. TS 26.251 V3.0 */

#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#define FIX_BASOP_2023_TDREND_DISTATT_PRECISION         /* Eri: Basop issue 2023: Distance attenuation scaling, adding clamping of distance att input and listener position */ 
#define USE_RTPDUMP                                     /* FhG: RTPDUMP format (rtptools standard) instead of custom format */
#define FIX_FLOAT_1569_REND_RENDER_CONFIG_CHECKS        /* Nokia: float issue 1569: fix render config checks in renderer */
#define FIX_BASOP_2526_SPAR_MASA_PARAM_MAP_Q_BUG        /* Nokia: BASOP issue 2526: Fix wrong Q variable in SPAR to MASA param mapping */
@@ -118,9 +122,12 @@
#define HARMONIZE_DoRTFTn                               /* VA: harmonize functions DoRTFTn_fx() and DoRTFTn_fx_ivas() */
#define FIX_1574_EFAP_CODE_LINT                         /* FhG: float issue 1574: Code quality fixes in ivas_efap.c */
#define FIX_BASOP_2529_MASA_RATIO_SCALINGS              /* Nokia: BASOP issue 2529: Fix MASA ratio scalings and verifications */
#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */
#define FIX_BASOP_2531_MCT_CP_BITRATE                   /* FhG: BASOP issue 2531: Fix MCT cp_bitrate calculation; affects bitrate switching only */
#define FIX_BASOP_2541_OMASA_ENC_FIXES                  /* Nokia: BASOP issue 2541: Fix function ivas_encode_masaism_metadata_fx */
#define FIX_BASOP_2545_FIX_LTV_REGRESSION_2529          /* Nokia: BASOP issue 2545: Fix LTV regression caused by issue 2529 fix */
#define FIX_FLOAT_1573_POSITION_UPDATE                  /* Eri: Float issue 1573: For static orientation and listener movement, the PoseUpdated flag is cleared and prevents 5 ms update rate. */
#define FIX_BASOP_2521_DIRAC_STEREO_STEFFI_NRGS         /* FhG: BASOP issue 2521: Fix wrong porting for determination of first subframe length in ivas_sba_dirac_stereo_compute_td_stefi_nrgs() */
#define FIX_BASOP_2517_CLICK_IN_OMASA_LTV               /* FhG: BASOP #2517: preserve precision by removing one-bit headroom from Q_min and allowing saturation during buffer scaling */

/* ##################### End NON-BE switches ########################### */
+4 −0
Original line number Diff line number Diff line
@@ -264,7 +264,11 @@ ivas_error ivas_td_binaural_renderer_sf_fx(
            enableCombinedOrientation = st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx];
            move16();

#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
            /* Shifting x_fx, y_fx, z_fx to the same Q-factor as Listener_p->Pos_q (usually Q22) */
#else
            /* Shifting x_fx, y_fx, z_fx to the same Q-factor as Listener_p->Pos_q (usually Q25) */
#endif
            Word16 pos_q = st_ivas->hBinRendererTd->Listener_p->Pos_q;
            move16();
            tmp_vector_fx->x_fx = L_shr( tmp_vector_fx->x_fx, sub( tmp_vector_fx->q_fact, pos_q ) );
+60 −0
Original line number Diff line number Diff line
@@ -688,15 +688,60 @@ static void ivas_sba_dirac_stereo_compute_td_stefi_nrgs(
    const Word16 q_hb_synth )
{
    Word16 i;
#ifdef FIX_BASOP_2521_DIRAC_STEREO_STEFFI_NRGS
    Word32 hb_nrg = EPSILON_FIX;
    Word16 q_hb_nrg_subr = Q31 + Q15 - Q6; /* in case IF( ( EQ_16( core, ACELP_CORE ) && !fd_cng_flag ) || EQ_16( hStereoDft->core_hist[1], ACELP_CORE ) ) is false, we want to end up with Q31, and we subtract Q15 - Q6 below; otherwise, we set it within this condition */
    Word16 q_hb_nrg = Q31;
    Word16 shift, shift_hb_nrg_subr;
    move32();
#else
    Word32 hb_nrg = EPSILON_FIX;
    move32();
    Word32 hb_nrg2 = EPSILON_FIX;
    move32();
#endif

#ifdef FIX_BASOP_2521_DIRAC_STEREO_STEFFI_NRGS
    shift = L_norm_arr( hb_synth, output_frame );
    shift = sub( shift, shr( add( find_guarded_bits_fx( shr( output_frame, 1 ) ), 1 ), 1 ) );
#endif

    test();
    test();
    IF( ( EQ_16( core, ACELP_CORE ) && !fd_cng_flag ) || EQ_16( hStereoDft->core_hist[1], ACELP_CORE ) )
    {
#ifdef FIX_BASOP_2521_DIRAC_STEREO_STEFFI_NRGS
        Word32 L_tmp;
        Word64 W_tmp;

        W_tmp = EPSILON_FIX;
        move64();

        FOR( i = 0; i < shr( output_frame, 1 ); i++ )
        {
            L_tmp = L_shl( hb_synth[i], shift );        /* q_hb_synth + shift */
            W_tmp = W_mac_32_32( W_tmp, L_tmp, L_tmp ); /* 2 * (q_hb_synth + shift) + 1 */
        }

        hStereoDft->hb_nrg_subr_fx[0] = W_round48_L( W_shr( W_tmp, 16 ) ); /* 2 * (q_hb_synth + shift) - 31 */
        move32();

        W_tmp = EPSILON_FIX;
        move64();
        FOR( ; i < output_frame; i++ )
        {
            L_tmp = L_shl( hb_synth[i], shift );        /* q_hb_synth + shift */
            W_tmp = W_mac_32_32( W_tmp, L_tmp, L_tmp ); /* 2 * (q_hb_synth + shift) + 1 */
        }

        hStereoDft->hb_nrg_subr_fx[1] = W_round48_L( W_shr( W_tmp, 16 ) ); /* 2 * (q_hb_synth + shift) - 31 */
        move32();
        q_hb_nrg_subr = sub( shl( add( q_hb_synth, shift ), 1 ), 31 );

        hb_nrg = L_add( L_shr( hStereoDft->hb_nrg_subr_fx[0], 1 ), L_shr( hStereoDft->hb_nrg_subr_fx[1], 1 ) ); /* 2 * (q_hb_synth + shift) - 16 - 1 */
        q_hb_nrg = sub( q_hb_nrg_subr, 1 );
        move16();
#else
        FOR( i = 0; i < shr( output_frame, 2 ); i++ )
        {
            hb_nrg2 = Madd_32_32( hb_nrg2, hb_synth[i], hb_synth[i] ); /*2*q_hb_synth-31*/
@@ -719,6 +764,7 @@ static void ivas_sba_dirac_stereo_compute_td_stefi_nrgs(
        hStereoDft->hb_nrg_subr_fx[1] = hb_nrg2; /*2*q_hb_synth-31*/
        move32();
        hb_nrg = L_add( hb_nrg, hb_nrg2 );
#endif

        IF( EQ_16( hStereoDft->q_hb_stefi_sig_fx, q_hb_synth ) )
        {
@@ -747,12 +793,26 @@ static void ivas_sba_dirac_stereo_compute_td_stefi_nrgs(
        hStereoDft->hb_nrg_subr_fx[1] = 0;
        move32();
    }
#ifdef FIX_BASOP_2521_DIRAC_STEREO_STEFFI_NRGS
    shift_hb_nrg_subr = s_min( norm_l( hStereoDft->hb_nrg_subr_fx[0] ), norm_l( hStereoDft->hb_nrg_subr_fx[1] ) );

    hStereoDft->hb_nrg_subr_fx[0] = ( Mpy_32_16_1( L_shl( hStereoDft->hb_nrg_subr_fx[0], shift_hb_nrg_subr ), shl( hStereoDft->NFFT, 5 ) ) ); /* shl( ., 5) is shortcut for shl( shr( hStereoDft->NFFT, 1 ), 6 ) */ /* q_hb_nrg_subr - (15 - 6) */
    move32();
    hStereoDft->hb_nrg_subr_fx[1] = ( Mpy_32_16_1( L_shl( hStereoDft->hb_nrg_subr_fx[1], shift_hb_nrg_subr ), shl( hStereoDft->NFFT, 5 ) ) ); /* shl( ., 5) is shortcut for shl( shr( hStereoDft->NFFT, 1 ), 6 ) */ /* q_hb_nrg_subr - (15 - 6) */
    move32();
    hStereoDft->q_hb_nrg_subr = sub( add( q_hb_nrg_subr, shift_hb_nrg_subr ), Q15 - Q6 );
    hStereoDft->hb_nrg_fx[0] = hb_nrg;
    move32();
    hStereoDft->q_hb_nrg[0] = q_hb_nrg;
    move16();
#else
    hStereoDft->hb_nrg_subr_fx[0] = hStereoDft->hb_nrg_subr_fx[0]; // imult3216(hStereoDft->hb_nrg_subr_fx[0] , shr(hStereoDft->NFFT, 1)); /*hStereoDft->q_hb_nrg_subr*/
    move32();
    hStereoDft->hb_nrg_subr_fx[1] = hStereoDft->hb_nrg_subr_fx[1]; // imult3216(hStereoDft->hb_nrg_subr_fx[1] , shr(hStereoDft->NFFT, 1)); /*hStereoDft->q_hb_nrg_subr*/
    move32();
    hStereoDft->hb_nrg_fx[0] = hb_nrg;
    move32();
#endif
    hStereoDft->td_gain_fx[0] = 0;
    move32();
    hStereoDft->core_hist[0] = core; /* full signal available for DTX with FD-CNG, thus apply stereo filling on full spectrum like in TCX */
Loading