Commit 619c049f authored by vaclav's avatar vaclav
Browse files

accept object-editing switches

parent 554f97d0
Loading
Loading
Loading
Loading
+4 −41
Original line number Diff line number Diff line
@@ -3689,11 +3689,7 @@ static void do_object_editing_fx(

        if ( readInfo->bg_gain_edited )
        {
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
            editableParameters->gain_bed_fx = (Word32) ( readInfo->bg_gain * 536870912 ); /* Q29 */
#else
            editableParameters->gain_bed_fx = (Word32) readInfo->bg_gain * 536870912;                                                                                                                                                       /* Q29 */
#endif
        }

        for ( obj_idx = 0; obj_idx < editableParameters->num_obj; obj_idx++ )
@@ -3706,19 +3702,11 @@ static void do_object_editing_fx(
                    if ( readInfo->obj_azi_relative[obj_idx] )
                    {
                        /* azimuth: apply relative edit + wrap */
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                        editableParameters->ism_metadata[obj_idx].azimuth_fx = ( ( editableParameters->ism_metadata[obj_idx].azimuth_fx + (Word32) ( readInfo->obj_azi[obj_idx] * 4194304 ) + 2264924160 ) % 1509949440 ) - 754974720; /* Q22 */
#else
                        editableParameters->ism_metadata[obj_idx].azimuth_fx = ( ( editableParameters->ism_metadata[obj_idx].azimuth_fx + (Word32) readInfo->obj_azi[obj_idx] * 4194304 + 2264924160 ) % 1509949440 ) - 754974720;          /* Q22 */
#endif
                    }
                    else
                    {
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                        editableParameters->ism_metadata[obj_idx].azimuth_fx = (Word32) ( readInfo->obj_azi[obj_idx] * 4194304 ); /* Q22 */
#else
                        editableParameters->ism_metadata[obj_idx].azimuth_fx = (Word32) readInfo->obj_azi[obj_idx] * 4194304;                                                                                                               /* Q22 */
#endif
                    }
                }
                if ( readInfo->obj_ele_edited[obj_idx] )
@@ -3726,23 +3714,15 @@ static void do_object_editing_fx(
                    if ( readInfo->obj_ele_relative[obj_idx] )
                    {
                        /* elevation: apply relative edit + saturation */
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                        editableParameters->ism_metadata[obj_idx].elevation_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].elevation_fx + (Word32) ( readInfo->obj_ele[obj_idx] * 4194304 ), 377487360 ), -377487360 ); /* Q22 */
#else
                        editableParameters->ism_metadata[obj_idx].elevation_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].elevation_fx + (Word32) readInfo->obj_ele[obj_idx] * 4194304, 377487360 ), -377487360 );           /* Q22 */
#endif
                    }
                    else
                    {
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                        editableParameters->ism_metadata[obj_idx].elevation_fx = (Word32) ( readInfo->obj_ele[obj_idx] * 4194304 ); /* Q22 */
#else
                        editableParameters->ism_metadata[obj_idx].elevation_fx = (Word32) readInfo->obj_ele[obj_idx] * 4194304;                                                                                                             /* Q22 */
#endif
                    }
                }
#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA
                /* object direction editing only for diegetic objects */

                /* object orientation editing only for diegetic objects */
                if ( readInfo->obj_yaw_edited[obj_idx] )
                {
                    if ( readInfo->obj_yaw_relative[obj_idx] )
@@ -3773,12 +3753,8 @@ static void do_object_editing_fx(
                    if ( readInfo->obj_radius_relative[obj_idx] )
                    {
                        /* radius: apply relative edit + saturation */
#define SQ 9

#define SHIFT_DUE_TO_SQxSQ ( SQ - ( SQ + SQ + 1 - 16 ) ) /*  ^shift by 6  == mult by 2^6 = 64.0 */

                        Word32 L_tmp1 = L_mult( editableParameters->ism_metadata[obj_idx].radius_fx, (Word16) ( readInfo->obj_radius[obj_idx] * ( 1L << ( SQ ) ) ) ); /*SQ*SQ*/
                        Word32 L_tmp2 = L_shl_sat( L_tmp1, SHIFT_DUE_TO_SQxSQ );                                                                                      /*shift back to Q(9+16)*/
                        Word32 L_tmp2 = L_shl_sat( L_tmp1, ( 9 - ( 9 + 9 + 1 - 16 ) ) /*  ^shift by 6  == mult by 2^6 = 64.0 */ );                                    /*shift back to Q(9+16)*/
                        Word16 temp_radius = round_fx( L_tmp2 );                                                                                                      /* Q25 -> Q9 */
                        temp_radius = s_max( s_min( temp_radius, OBJ_EDIT_RADIUS_MAX_FX ), 0 );

@@ -3791,7 +3767,6 @@ static void do_object_editing_fx(
                        editableParameters->ism_metadata[obj_idx].radius_fx = (Word16) ( readInfo->obj_radius[obj_idx] * 512 ); /* Q9 */
                    }
                }
#endif
            }

            /* gain editing for all objects */
@@ -3800,23 +3775,11 @@ static void do_object_editing_fx(
                if ( readInfo->obj_gain_relative[obj_idx] )
                {
                    /* gain: apply relative edit + saturation */
#ifdef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                    editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( L_shl_sat( Mpy_32_32( editableParameters->ism_metadata[obj_idx].gain_fx, (Word32) ( readInfo->obj_gain[obj_idx] * 536870912 ) ), 2 ), OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29*Q29 -> Q27 shift back to Q29 */
#else
                    editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( L_shl_sat( Mpy_32_32( editableParameters->ism_metadata[obj_idx].gain_fx, (Word32) readInfo->obj_gain[obj_idx] * 536870912 ), 2 ), OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29*Q29 -> Q27 shift back to Q29 */
#endif
#else
                    editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].gain_fx * (Word32) readInfo->obj_gain[obj_idx] * 536870912, OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29 */
#endif
                }
                else
                {
#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE
                    editableParameters->ism_metadata[obj_idx].gain_fx = (Word32) ( readInfo->obj_gain[obj_idx] * 536870912 ); /* Q29 */
#else
                    editableParameters->ism_metadata[obj_idx].gain_fx = (Word32) readInfo->obj_gain[obj_idx] * 536870912;                                                                                                                   /* Q29 */
#endif
                }
            }
        }
+0 −4
Original line number Diff line number Diff line
@@ -197,14 +197,10 @@ typedef enum
#define MAX_SPAR_INTERNAL_CHANNELS              IVAS_SPAR_MAX_CH
#define MAX_CLDFB_DIGEST_CHANNELS               3                           /* == maximum of ParamISM TCs and ParamMC TCs */

#ifdef FIX_GAIN_EDIT_LIMITS
#define EDIT_GAIN_MIN_Q29                       33874260                    /* Minimum allowed object gain edit with parametric modes in Q29: 0.0630957f, -24 dB */
#define EDIT_GAIN_MAX_Q29                       2137321728                  /* Maximum allowed object gain edit in Q29: 3.9810719f,  +12 dB */
#define EDIT_GAIN_MIN_Q12                       258                         /* Minimum allowed object gain edit with parametric modes in Q12: 0.0630957f, -24 dB */
#define EDIT_GAIN_MAX_Q12                       16306                       /* Maximum allowed object gain edit in Q12: 3.9810719f,  +12 dB */
#endif



typedef enum
{
+0 −2
Original line number Diff line number Diff line
@@ -300,9 +300,7 @@ extern const Word32 diffuseness_thresholds_hr_fx[HR_MASA_ER_LEVELS + 1];
extern const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA];
extern const Word32 azimuth_cb_fx[8];
extern const Word32 delta_theta_masa_fx[NO_SPHERICAL_GRIDS - 2];
#ifdef OBJ_EDIT_BASOP
extern const Word32 delta_theta_masa_inv_fx[NO_SPHERICAL_GRIDS - 2];
#endif
extern const Word16 coherence_cb0_masa_Q14[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH];
extern const Word32 coherence_cb0_masa_fx[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH];
extern const Word16 coherence_cb1_masa_Q15[MASA_NO_CV_COH1 * MASA_MAXIMUM_CODING_SUBBANDS]; /* 25 */
+0 −2
Original line number Diff line number Diff line
@@ -4416,12 +4416,10 @@ const Word32 delta_theta_masa_fx[NO_SPHERICAL_GRIDS - 2] = {
    188743680, 188743680, 150994944, 106954752, 83886080, 62914560, 45214596, 28101836, 20971520
};

#ifdef OBJ_EDIT_BASOP
// Q31
const Word32 delta_theta_masa_inv_fx[NO_SPHERICAL_GRIDS - 2] = {
    47721859, 47721859, 59652324, 84215045, 107374182, 143165577, 199209986, 320519947, 429496730
};
#endif

// q = 14
const Word16 coherence_cb0_masa_Q14[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH] = {
+12 −14
Original line number Diff line number Diff line
@@ -70,10 +70,18 @@


/* ################### Start FIXES switches ########################### */

/*#define FIX_I4_OL_PITCH*/                                  /* fix open-loop pitch used for EVS core switching */
#define REMOVE_BASOP_Util_Divide3232_Scale_cadence           /* remove this division variant */
#define FIX_1990_SANITIZER_IN_REVERB_LOAD                    /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK            /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */





#define REMOVE_BASOP_Util_Divide3232_Scale_cadence           /* remove this division variant */
#define TEMP_FIX_2088_MSAN_INIT_ERROR                        /* Eri: Temporary fix for Issue 2088 - MSAN error. Will come with later port of JBM+Split rendering update */
#define FIX_2092_ASSERT_IN_OMASA_RENDER                      /* FhG, Nokia: Fix LTV crash due to overflow in OMASA EXT output */
#define FIX_2084_FLOATING_POINT_LEFTOVERS                    /* FhG: convert floating-point leftovers in IVAS_ENC_FeedObjectMetadata() */
@@ -88,11 +96,9 @@
#define FIX_2170_ASSERT_IN_FFT3                              /* Eri: Assert in fft3_fx from EVS, adding _sat */
#define FIX_2082_FP_LEFTOVERS_OMASA_DEC                      /* Nokia: fix for issue 2082, cleaning remaining floating point code */
#define FIX_2174_JBM_BASOP_ALIGNMENT                         /* VoiceAge, Nokia: Fixes to JBM BASOP implementation and alignment to float */
#define FIX_GAIN_EDIT_LIMITS                                 /* Harmonize gain edit limits for all opertation points. For all modes, limit to max +12dB. For parametric modes, limit to min -24dB. */

#define FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO          /* FhG: Reduce hStereoDft->q_smooth_buf_fx by one to prevent overflow in the subframe_band_nrg[][] calculation */
#define FIX_2015_PREMPH_SAT_ALT                              /* VA: saturation can happen during preemphasis filtering due to a too aggressive scaling factor, allows preemphis to get 1 more bit headroom */
#define FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE       /* Nokia: Fixes float  to fx conversion in decoder app with object edit file interface */
#define FIX_2070_JBM_TC_CHANNEL_RESCALING_ISSUE              /* Eri/Orange: scale_sig32 problem on p_tc_fx[] */

#define FIX_2173_UBSAN_IN_JBM_PCMDSP_APA                     /* FhG: Fix UBSAN problems in jbm_pcmdsp_apa_fx.c */
@@ -115,6 +121,8 @@
#define NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Nokia: fix basop issue 2233: Fix differing rtpdump streams */

#define NONBE_FIX_2237_ZERO_CURR_NOISE_PROBLEM              /* FhG: Modify sum of hTonalMDCTConc->curr_noise_nrg to avoid inaccurate zero */
#define FIX_BASOP_ISSUE_1585_CUT_BS_CRASH               /* FhG: Fix for BASOP issue 1585 crash of a cut bitstream, also valid for float code*/


/* ################### End FIXES switches ########################### */

@@ -122,8 +130,6 @@

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
#define FIX_1053_REVERB_RECONFIGURATION
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_1413_IGF_INIT_PRINTOUT                      /* FhG: use correct variable for IGF initiliazation */
#define FIX_1330_JBM_MEMORY_FIX                         /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */
#define FIX_1411_IGF_CRASH_BW_SWITCHING                 /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/
@@ -134,15 +140,7 @@
#define NONBE_FIX_1442_MASA_EXT_REND_ORIENT_IDX         /* Nokia: Fix issue 1442 of wrong index to combinedOrientationData */
#define BE_FIX_1391_COVERAGE_SPAR_DYN__CHANNEL          /* Dolby: Fix coverage of SBA SPAR Dynamic active W not getting hit by the tests */

// object-editing feature porting
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
/*#define TMP_FIX_OMASA_SR_BE*/                         // temporary fix to keep OMASA split-rendering BE - mul, 20251112: disabled, since this causes diffs to ivas-codec/main
#define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES             // Nokia:  Fix 1399_1400 issue in float, this is essential for the BASOP porting
#define OBJ_EDIT_BASOP
#define FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES        /* Nokia: Issue 2140, fixes three different sanitizer issues persisting in object editing code. */
#define FIX_2193_ISM_GAINS_WITH_OE                      /* FhG: fix issue 2193: use edited angles in ISM gain calculation */
#define FIX_2192_OBJ_EDITING_EXT_METADATA               /* Eri: Add support for extended metadata in object editing */
#define FIX_BASOP_ISSUE_1585_CUT_BS_CRASH               /* FhG: Fix for BASOP issue 1585 crash of a cut bitstream, also valid for float code*/


/* #################### Start NON-BE switches ############################ */

Loading