Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -172,4 +172,5 @@ #define DOT_PROD_CHOLESKY_64BIT /* FhG: Issue 1323, optimized 64 bit implementation of dot_product_cholesky() */ #define OPT_BASOP_ADD_v1 /* optimizations to avoid usage of BASOP_Util_Add_MantExp */ #define FIX_ISSUE_1327 /* Ittiam: Fix for issue 1327: Glitch when stereo is switching from TD to FD*/ #define FIX_1379_MASA_ANGLE_ROUND #endif lib_dec/ivas_dirac_dec_fx.c +33 −0 Original line number Diff line number Diff line Loading @@ -1446,10 +1446,17 @@ 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 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 ) ); move16(); #else hSpatParamRendCom->azimuth[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].azimuth_fx[block], 6 ) ); move16(); hSpatParamRendCom->elevation[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].elevation_fx[block], 6 ) ); move16(); #endif hSpatParamRendCom->energy_ratio1_fx[meta_write_index][b] = q_direction->band_data[band].energy_ratio_fx[block]; move32(); hSpatParamRendCom->diffuseness_vector_fx[meta_write_index][b] = L_sub( ONE_IN_Q30, q_direction->band_data[band].energy_ratio_fx[block] ); Loading Loading @@ -1494,10 +1501,17 @@ 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 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 ) ); move16(); #else hSpatParamRendCom->azimuth2[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].azimuth_fx[block], 6 ) ); move16(); hSpatParamRendCom->elevation2[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].elevation_fx[block], 6 ) ); move16(); #endif hSpatParamRendCom->energy_ratio2_fx[meta_write_index][b] = q_direction->band_data[band].energy_ratio_fx[block]; move32(); hSpatParamRendCom->diffuseness_vector_fx[meta_write_index][b] = L_sub( hSpatParamRendCom->diffuseness_vector_fx[meta_write_index][b], q_direction->band_data[band].energy_ratio_fx[block] ); Loading Loading @@ -1704,8 +1718,13 @@ void ivas_qmetadata_to_dirac_fx( IF( hodirac_flag ) { #ifdef FIX_1379_MASA_ANGLE_ROUND 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 azi = extract_h( L_shr( ( L_add( azimuth_fx, ONE_IN_Q21 ) ), 6 ) ); ele = extract_h( L_shr( ( L_add( elevation_fx, ONE_IN_Q21 ) ), 6 ) ); #endif /*addition of one to compensate precision loss*/ if ( azi < 0 ) { Loading Loading @@ -1741,8 +1760,13 @@ 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 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 azi = extract_h( L_shr( final_1_32, sub( sub( 31, final_1_exp ), 16 ) ) ); ele = extract_h( L_shr( final_2_32, sub( sub( 31, final_2_exp ), 16 ) ) ); #endif /*addition of one to compensate precision loss*/ if ( azi < 0 ) Loading Loading @@ -3597,7 +3621,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; Loading Loading @@ -3631,13 +3657,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 ); } } Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -172,4 +172,5 @@ #define DOT_PROD_CHOLESKY_64BIT /* FhG: Issue 1323, optimized 64 bit implementation of dot_product_cholesky() */ #define OPT_BASOP_ADD_v1 /* optimizations to avoid usage of BASOP_Util_Add_MantExp */ #define FIX_ISSUE_1327 /* Ittiam: Fix for issue 1327: Glitch when stereo is switching from TD to FD*/ #define FIX_1379_MASA_ANGLE_ROUND #endif
lib_dec/ivas_dirac_dec_fx.c +33 −0 Original line number Diff line number Diff line Loading @@ -1446,10 +1446,17 @@ 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 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 ) ); move16(); #else hSpatParamRendCom->azimuth[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].azimuth_fx[block], 6 ) ); move16(); hSpatParamRendCom->elevation[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].elevation_fx[block], 6 ) ); move16(); #endif hSpatParamRendCom->energy_ratio1_fx[meta_write_index][b] = q_direction->band_data[band].energy_ratio_fx[block]; move32(); hSpatParamRendCom->diffuseness_vector_fx[meta_write_index][b] = L_sub( ONE_IN_Q30, q_direction->band_data[band].energy_ratio_fx[block] ); Loading Loading @@ -1494,10 +1501,17 @@ 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 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 ) ); move16(); #else hSpatParamRendCom->azimuth2[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].azimuth_fx[block], 6 ) ); move16(); hSpatParamRendCom->elevation2[meta_write_index][b] = extract_h( L_shr( q_direction->band_data[band].elevation_fx[block], 6 ) ); move16(); #endif hSpatParamRendCom->energy_ratio2_fx[meta_write_index][b] = q_direction->band_data[band].energy_ratio_fx[block]; move32(); hSpatParamRendCom->diffuseness_vector_fx[meta_write_index][b] = L_sub( hSpatParamRendCom->diffuseness_vector_fx[meta_write_index][b], q_direction->band_data[band].energy_ratio_fx[block] ); Loading Loading @@ -1704,8 +1718,13 @@ void ivas_qmetadata_to_dirac_fx( IF( hodirac_flag ) { #ifdef FIX_1379_MASA_ANGLE_ROUND 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 azi = extract_h( L_shr( ( L_add( azimuth_fx, ONE_IN_Q21 ) ), 6 ) ); ele = extract_h( L_shr( ( L_add( elevation_fx, ONE_IN_Q21 ) ), 6 ) ); #endif /*addition of one to compensate precision loss*/ if ( azi < 0 ) { Loading Loading @@ -1741,8 +1760,13 @@ 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 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 azi = extract_h( L_shr( final_1_32, sub( sub( 31, final_1_exp ), 16 ) ) ); ele = extract_h( L_shr( final_2_32, sub( sub( 31, final_2_exp ), 16 ) ) ); #endif /*addition of one to compensate precision loss*/ if ( azi < 0 ) Loading Loading @@ -3597,7 +3621,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; Loading Loading @@ -3631,13 +3657,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 ); } } Loading