Commit 128cb148 authored by Manuel Jander's avatar Manuel Jander
Browse files

Improve accuracy of no_phi_masa_inv_fx table and remove all other azimuth/elevation roundings.

parent 3ecdfa85
Loading
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
};
+7 −7
Original line number Diff line number Diff line
@@ -1446,7 +1446,7 @@ void ivas_qmetadata_to_dirac_fx(
            {
                FOR( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b )
                {
#ifdef FIX_1379_MASA_ANGLE_ROUND
#ifdef FIX_1379_MASA_ANGLE_ROUND_NOT
                    hSpatParamRendCom->azimuth[meta_write_index][b] = round_fx( L_shr( q_direction->band_data[band].azimuth_fx[block], 6 ) );
                    move16();
                    hSpatParamRendCom->elevation[meta_write_index][b] = round_fx( L_shr( q_direction->band_data[band].elevation_fx[block], 6 ) );
@@ -1501,7 +1501,7 @@ void ivas_qmetadata_to_dirac_fx(
                {
                    FOR( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b )
                    {
#ifdef FIX_1379_MASA_ANGLE_ROUND
#ifdef FIX_1379_MASA_ANGLE_ROUND_NOT
                        hSpatParamRendCom->azimuth2[meta_write_index][b] = round_fx( L_shr( q_direction->band_data[band].azimuth_fx[block], 6 ) );
                        move16();
                        hSpatParamRendCom->elevation2[meta_write_index][b] = round_fx( L_shr( q_direction->band_data[band].elevation_fx[block], 6 ) );
@@ -1718,7 +1718,7 @@ void ivas_qmetadata_to_dirac_fx(

                        IF( hodirac_flag )
                        {
#ifdef FIX_1379_MASA_ANGLE_ROUND
#ifdef FIX_1379_MASA_ANGLE_ROUND_NOT
                            azi = round_fx( L_shr( ( L_add( azimuth_fx, ONE_IN_Q21 ) ), 6 ) );
                            ele = round_fx( L_shr( ( L_add( elevation_fx, ONE_IN_Q21 ) ), 6 ) );
#else
@@ -1760,7 +1760,7 @@ void ivas_qmetadata_to_dirac_fx(
                            final_1_32 = BASOP_Util_Add_Mant32Exp( final_1_32, final_1_exp, ONE_IN_Q30, 0, &final_1_exp ); /*0.5 in q31*/
                            final_2_32 = BASOP_Util_Add_Mant32Exp( final_2_32, final_2_exp, ONE_IN_Q30, 0, &final_2_exp );

#ifdef FIX_1379_MASA_ANGLE_ROUND
#ifdef FIX_1379_MASA_ANGLE_ROUND_NOT
                            azi = round_fx( L_shr( final_1_32, sub( sub( 31, final_1_exp ), 16 ) ) );
                            ele = round_fx( L_shr( final_2_32, sub( sub( 31, final_2_exp ), 16 ) ) );
#else
@@ -3626,7 +3626,7 @@ 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
#ifndef FIX_1379_MASA_ANGLE_ROUND_NOT
                Word16 az1, el1;
#endif
                Word16 n_slots_to_render;
@@ -3662,14 +3662,14 @@ 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
#ifndef FIX_1379_MASA_ANGLE_ROUND_NOT
                        az1 = extract_h( az1_32 );
                        el1 = extract_h( el1_32 );
#endif

                        IF( st_ivas->hEFAPdata != NULL )
                        {
#ifdef FIX_1379_MASA_ANGLE_ROUND
#ifdef FIX_1379_MASA_ANGLE_ROUND_NOT
                            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