Commit fdc89e4d authored by emerit's avatar emerit
Browse files

Merge branch 'float-1548-Harmonize-non-diegetic-panning-law-in-ISM-and-renderer' into 'main'

[non-be][renderer-non-BE][allow-regression] Float 1548 harmonize non diegetic panning law in ism and renderer

See merge request !2899
parents 71deb78c e2d8ec4f
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3179,7 +3179,13 @@ static void IsmPositionProvider_getNextFrame(
            objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0;
        }


#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        /* Wrap azimuth to lie within (0, 360] range */
#else
        /* Wrap azimuth to lie within (-180, 180] range */
#endif

        while ( LT_32( objectMetadataBuffer->positions[objIdx].azimuth_fx, 0 ) )
        {
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_add( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
@@ -3189,6 +3195,14 @@ static void IsmPositionProvider_getNextFrame(
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_sub( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
        }

#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
        IF( objectMetadataBuffer->positions[objIdx].non_diegetic_flag && objectMetadataBuffer->positions[objIdx].azimuth_fx >= DEG_180_IN_Q22 )
        {
            /* Wrap azimuth to lie within [-180, 180) range for non-diegetic panning */
            objectMetadataBuffer->positions[objIdx].azimuth_fx = L_sub( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 );
        }
#endif

        /* Clamp elevation to lie within [-90, 90] range (can't be wrapped easily) */
        objectMetadataBuffer->positions[objIdx].elevation_fx = L_min( L_max( objectMetadataBuffer->positions[objIdx].elevation_fx, -DEG_90_IN_Q22 ), DEG_90_IN_Q22 );

+3 −0
Original line number Diff line number Diff line
@@ -1948,6 +1948,9 @@ typedef enum
#define ONE_IN_Q31                              0x7fffffff
#define ONE_IN_Q45                              (Word64)0x200000000000
#define ONE_IN_Q62                              (Word64)0x4000000000000000
#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
#define MINUS_ONE_IN_Q31                        ( -2147483647 - 1 ) /* same as (Word32)0x80000000 */
#endif

#define MAX_WORD16                              32767

+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@
#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_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW     /* Orange: float issue 1548: Harmonize non diegetic panning law in ISM and renderers */
#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_1452_DEFAULT_REVERB                         /* Nokia/Philips/FhG: Fix default room presets and their usage in renderer */
+0 −2
Original line number Diff line number Diff line
@@ -320,11 +320,9 @@ void ivas_apply_non_diegetic_panning_fx(
    const Word16 output_frame              /* i  : output frame length per channel      */
)
{

    Word16 pan = add( mult_r( non_diegetic_pan_gain_fx, 32 ), 32 ); // 0.5.Q15 = 16384                             // Q15
    v_multc_fx_16( input_f_fx, cos_table_129[pan], output_fx[1], output_frame );
    v_multc_fx_16( input_f_fx, cos_table_129[64 - pan], output_fx[0], output_frame );


    return;
}
+2 −0
Original line number Diff line number Diff line
@@ -49,7 +49,9 @@
#define SVD_ZERO_FLUSH_THRESHOLD_FX ( 0 )
#define CONVERGENCE_FACTOR_FX       214748 /* factor for SVD convergence (as per latest float code: 1.0e-04f) */

#ifndef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW
#define MINUS_ONE_IN_Q31 ( -2147483647 - 1 )
#endif

/*-----------------------------------------------------------------------*
 * Local function prototypes
Loading