Commit 6bedfe13 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch...

Merge branch '1379-increase-accuracy-of-azimuth-and-elevation-angles-in-masa-metadata-with-dirac-rendering' into 'main'

Resolve "Increase accuracy of azimuth and elevation angles in MASA metadata with dirac rendering" [allow regression]

Closes #1379

See merge request !1272
parents a6ac7971 9b586f31
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1545,6 +1545,7 @@ const Word16 ivas_param_mc_quant_icc_fx[PARAM_MC_SZ_ICC_QUANTIZER] = {

/* from 1 to 11 bits*/ /*q factor = 8*/
const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = {
#ifndef FIX_1379_MASA_ANGLE_ROUND
    { 1073741824 },
    { 536870912 },
    { 536870912, 1073741824 },
@@ -1556,8 +1557,22 @@ const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = {
    { 44739242, 45691141, 47721858, 52377649, 61356675, 76695844, 107374182, 178956970, 1073741824, 2147483647 },
    { 35791394, 35791394, 37025580, 38347922, 39768215, 42949672, 46684427, 52377649, 59652323, 71582788, 93368854, 126322567, 214748364, 2147483647 },
    { 24129029, 24129029, 24403223, 24970740, 25565281, 26512143, 27889398, 29417584, 31580641, 34087042, 37675151, 42107522, 48806446, 56512727, 71582788, 93368854, 143165576, 268435456, 2147483647 }
#else
    { 1073741824 },
    { 536870912 },
    { 536870912, 1073741824 },
    { 268435456, 536870912 },
    { 178956971, 306783378, 1073741824, 2147483647 },
    { 153391689, 165191050, 238609294, 1073741824, 2147483647 },
    { 97612893, 102261126, 126322568, 195225786, 715827883, 2147483647 },
    { 65075262, 67108864, 74051160, 93368854, 126322568, 238609294, 2147483647 },
    { 44739243, 45691141, 47721859, 52377650, 61356676, 76695845, 107374182, 178956971, 1073741824, 2147483647 },
    { 35791394, 35791394, 37025580, 38347922, 39768216, 42949673, 46684427, 52377650, 59652324, 71582788, 93368854, 126322568, 214748365, 2147483647 },
    { 24129030, 24129030, 24403223, 24970740, 25565282, 26512144, 27889398, 29417584, 31580642, 34087042, 37675152, 42107523, 48806447, 56512728, 71582788, 93368854, 143165577, 268435456, 2147483647 },
#endif
};


const Word32 azimuth_cb_fx[8] = {
    0, -754974720, -377487360, 377487360, -188743680, 188743680, -566231040, 566231040
};

lib_com/options.h

100755 → 100644
+3 −1
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@

#define FIX_1378_ACELP_OUT_OF_BOUNDS

#define FIX_1379_MASA_ANGLE_ROUND

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
//#define OPT_STEREO_32KBPS_V1                    /* Optimization made in stereo decoding path for 32kbps decoding */
#define OPT_AVOID_STATE_BUF_RESCALE             /* Optimization made to avoid rescale of synth state buffer */
+9 −0
Original line number Diff line number Diff line
@@ -3829,7 +3829,9 @@ void ivas_dirac_dec_render_sf_fx(
            {
                Word16 j, k, j2, l;
                Word16 num_objects, nchan_out_woLFE, lfe_index;
#ifndef FIX_1379_MASA_ANGLE_ROUND
                Word16 az1, el1;
#endif
                Word16 n_slots_to_render;
                Word16 n_samples_to_render;
                Word16 interp_offset;
@@ -3863,13 +3865,20 @@ void ivas_dirac_dec_render_sf_fx(
                        Word16 el_q0 = extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, Q22 ) );
                        Word32 az1_32, el1_32;
                        rotateAziEle_fixed( az_q0, el_q0, &az1_32, &el1_32, st_ivas->hCombinedOrientationData->Rmat_fx[0], st_ivas->hIntSetup.is_planar_setup );
#ifndef FIX_1379_MASA_ANGLE_ROUND
                        az1 = extract_h( az1_32 );
                        el1 = extract_h( el1_32 );
#endif

                        IF( st_ivas->hEFAPdata != NULL )
                        {
#ifdef FIX_1379_MASA_ANGLE_ROUND
                            const Word32 azi_fx = L_shl( az1_32, Q22 - Q16 ); // Q16 -> Q22
                            const Word32 ele_fx = L_shl( el1_32, Q22 - Q16 ); // Q16 -> Q22
#else
                            const Word32 azi_fx = L_shl( az1, Q22 ); // Q0 -> Q22
                            const Word32 ele_fx = L_shl( el1, Q22 ); // Q0 -> Q22
#endif
                            efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], azi_fx, ele_fx, EFAP_MODE_EFAP );
                        }
                    }