Loading Workspace_msvc/lib_dec.vcxproj +1 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,7 @@ <ClCompile Include="..\lib_dec\ivas_mct_core_dec.c" /> <ClCompile Include="..\lib_dec\ivas_mct_dec.c" /> <ClCompile Include="..\lib_dec\ivas_mct_dec_mct.c" /> <ClCompile Include="..\lib_dec\ivas_mct_dec_mct_fx.c" /> <ClCompile Include="..\lib_dec\ivas_mc_paramupmix_dec.c" /> <ClCompile Include="..\lib_dec\ivas_mc_param_dec.c" /> <ClCompile Include="..\lib_dec\ivas_mc_param_dec_fx.c" /> Loading Workspace_msvc/lib_dec.vcxproj.filters +2 −0 Original line number Diff line number Diff line Loading @@ -817,6 +817,8 @@ <ClCompile Include="..\lib_dec\ivas_sns_dec_fx.c" /> <ClCompile Include="..\lib_dec\lib_dec_fx.c"> <Filter>decoder_all_c</Filter> <ClCompile Include="..\lib_dec\ivas_mct_dec_mct_fx.c"> <Filter>decoder_ivas_c</Filter> </ClCompile> <ClCompile Include="..\lib_dec\ivas_sce_dec_fx.c"> <Filter>decoder_ivas_c</Filter> Loading lib_com/ivas_cnst.h +3 −0 Original line number Diff line number Diff line Loading @@ -349,6 +349,8 @@ typedef enum #define PARAM_ISM_MAX_CHAN 16 #define PARAM_ISM_HYS_BUF_SIZE 10 #define STEP_PARAM_ISM_POW_RATIO_NBITS_Q15 (4681) /* 1.0f / (float)((1 << PARAM_ISM_POW_RATIO_NBITS) - 1) */ /* ISM DTX */ #define ISM_DTX_COH_SCA_BITS 4 #define ISM_DTX_AZI_BITS_HIGH 8 Loading Loading @@ -1154,6 +1156,7 @@ enum #define NO_BITS_MASA_ISM_NO_OBJ 2 #ifdef IVAS_FLOAT_FIXED #define MASA2TOTAL_THR 0.979965f // Temporary #define MASA2TOTAL_THR_Q30 1052229376l // 0.979965f in Q30 //Maximum error in float to fixed conversion : 0.005% //Assuming the accuracy of 99.995% //New value = 99.995 / 100 * 0.98 = 0.979951 Loading lib_com/ivas_masa_com.c +144 −0 Original line number Diff line number Diff line Loading @@ -1423,6 +1423,56 @@ int16_t valid_ratio_index( return out; } #ifdef IVAS_FLOAT_FIXED Word16 valid_ratio_index_fx( Word16 index, /* i : index to be checked */ const Word16 K, /* i : L1 norm to check against */ const Word16 len /* i : vector length */ ) { Word16 out; Word16 i, sum, elem; Word16 base[4]; sum = 0; move16(); set16_fx( base, 1, len ); FOR ( i = 1; i < len; i++ ) { base[i] = i_mult(base[i - 1], 10); } sum = 0; move16(); FOR ( i = len - 1; i >= 0; i-- ) { IF(EQ_16(index, 0)) { elem = 0; move16(); } ELSE { elem = idiv1616(index, base[i]); } sum = add(sum, elem); index = sub(index, i_mult(elem, base[i])); } IF ( LE_16(sum, K ) ) { out = 1; move16(); } ELSE { out = 0; move16(); } return out; } #endif /*--------------------------------------------------------------- * reconstruct_ism_ratios() Loading Loading @@ -1458,6 +1508,46 @@ void reconstruct_ism_ratios( } /*--------------------------------------------------------------- * reconstruct_ism_ratios_fx() * * Obtains ISM ratio values from the quantized indexes *---------------------------------------------------------------*/ void reconstruct_ism_ratios_fx( Word16 *ratio_ism_idx, /* i : index vector Q0 */ const Word16 nchan_ism, /* i : number of components/objects Q0 */ const Word16 step, /* i : quantization step Q15 */ Word32 *q_energy_ratio_ism /* o : reconstructed ISM values Q30 */ ) { int16_t i; Word32 sum; sum = 0; move32(); FOR ( i = 0; i < nchan_ism - 1; i++ ) { q_energy_ratio_ism[i] = L_shl(L_mult(ratio_ism_idx[i], step), 14); // q0 + q15 + 1 + 14 = q30; move32(); sum = L_add(sum, q_energy_ratio_ism[i]); } q_energy_ratio_ism[nchan_ism - 1] = L_sub(ONE_IN_Q30, sum); move32(); IF ( LT_32(q_energy_ratio_ism[nchan_ism - 1], 0) ) { q_energy_ratio_ism[nchan_ism - 1] = 0; move32(); } return; } /*--------------------------------------------------------------- * ivas_omasa_modify_masa_energy_ratios() * Loading Loading @@ -1534,6 +1624,60 @@ void distribute_evenly_ism( return; } #ifdef IVAS_FLOAT_FIXED /*--------------------------------------------------------------- * distribute_evenly_ism_fx() * * Obtain ISM ratio indexes for even content distribution bbetween objects *---------------------------------------------------------------*/ void distribute_evenly_ism_fx( Word16 *idx, /* o : index values */ const Word16 K, /* i : sum of indexes */ const Word16 nchan_ism /* i : number of objects */ ) { Word16 i; Word16 sum; sum = 0; move16(); FOR( i = 0; i < nchan_ism; i++ ) { IF(EQ_16(K, 0)) { idx[i] = 0; move16(); } ELSE { idx[i] = idiv1616( K, nchan_ism ); move16(); } sum = add( sum, idx[i] ); } assert( LE_16( sum, K ) ); i = 0; move16(); WHILE( LT_16( sum, K ) ) { IF( EQ_16( i, nchan_ism ) ) { i = 0; move16(); } idx[i] = add( idx[i], 1 ); move16(); sum = add( sum, 1 ); i = add( i, 1 ); } return; } #endif /*--------------------------------------------------------------- * calculate_cpe_brate_MASA_ISM() Loading lib_com/ivas_omasa_com.c +6 −5 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include <stdlib.h> #include "ivas_cnst.h" #include "ivas_prot.h" #include "ivas_prot_fx.h" #include "prot.h" #include "prot_fx1.h" #include "ivas_rom_com.h" Loading Loading @@ -903,8 +904,8 @@ static Word16 get_bits_ism( Word32 val ) void calculate_nbits_meta_fx( const Word16 nchan_ism, Word32 q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], // Qx Word32 masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], // Qx const Word32 q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], // Q30 const Word32 masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], // Q30 const Word16 numSf, const Word16 numCodingBands, Word16 *bits_ism, Loading Loading @@ -1011,7 +1012,7 @@ void ivas_get_stereo_panning_gains( #define SIN_NEG_30_DEGREES_Q15 ( (Word16) 0xC000 ) #define SIN_30_DEGREES_Q15 ( (Word16) 0x4000 ) static void get_panning_gain( void get_panning_gain( const Word16 sinAngleMapped, Word16 *panningGains ) { Loading Loading @@ -1121,10 +1122,10 @@ void ivas_get_stereo_panning_gains_fx( } WHILE( LT_16( azSubEl, -180 ) ) { azSubEl = sub( azSubEl, 360 ); azSubEl = add( azSubEl, 360 ); } // sin_az_cos_el = (ptr_sin_az[azAddEl] + ptr_sin_az[azSubEl])/2; Word16 sin_az_cos_el = extract_l( L_shr( L_add( L_deposit_l( ptr_sin_az[azAddEl] ), L_deposit_l( ptr_sin_az[azSubEl] ) ), 1 ) ); Word16 sin_az_cos_el = extract_l( L_shr( L_add( L_deposit_l( ptr_sin_az[azAddEl + 180] ), L_deposit_l( ptr_sin_az[azSubEl + 180] ) ), 1 ) ); IF( GE_16( sin_az_cos_el, SIN_30_DEGREES_Q15 ) ) { /* Left side */ Loading Loading
Workspace_msvc/lib_dec.vcxproj +1 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,7 @@ <ClCompile Include="..\lib_dec\ivas_mct_core_dec.c" /> <ClCompile Include="..\lib_dec\ivas_mct_dec.c" /> <ClCompile Include="..\lib_dec\ivas_mct_dec_mct.c" /> <ClCompile Include="..\lib_dec\ivas_mct_dec_mct_fx.c" /> <ClCompile Include="..\lib_dec\ivas_mc_paramupmix_dec.c" /> <ClCompile Include="..\lib_dec\ivas_mc_param_dec.c" /> <ClCompile Include="..\lib_dec\ivas_mc_param_dec_fx.c" /> Loading
Workspace_msvc/lib_dec.vcxproj.filters +2 −0 Original line number Diff line number Diff line Loading @@ -817,6 +817,8 @@ <ClCompile Include="..\lib_dec\ivas_sns_dec_fx.c" /> <ClCompile Include="..\lib_dec\lib_dec_fx.c"> <Filter>decoder_all_c</Filter> <ClCompile Include="..\lib_dec\ivas_mct_dec_mct_fx.c"> <Filter>decoder_ivas_c</Filter> </ClCompile> <ClCompile Include="..\lib_dec\ivas_sce_dec_fx.c"> <Filter>decoder_ivas_c</Filter> Loading
lib_com/ivas_cnst.h +3 −0 Original line number Diff line number Diff line Loading @@ -349,6 +349,8 @@ typedef enum #define PARAM_ISM_MAX_CHAN 16 #define PARAM_ISM_HYS_BUF_SIZE 10 #define STEP_PARAM_ISM_POW_RATIO_NBITS_Q15 (4681) /* 1.0f / (float)((1 << PARAM_ISM_POW_RATIO_NBITS) - 1) */ /* ISM DTX */ #define ISM_DTX_COH_SCA_BITS 4 #define ISM_DTX_AZI_BITS_HIGH 8 Loading Loading @@ -1154,6 +1156,7 @@ enum #define NO_BITS_MASA_ISM_NO_OBJ 2 #ifdef IVAS_FLOAT_FIXED #define MASA2TOTAL_THR 0.979965f // Temporary #define MASA2TOTAL_THR_Q30 1052229376l // 0.979965f in Q30 //Maximum error in float to fixed conversion : 0.005% //Assuming the accuracy of 99.995% //New value = 99.995 / 100 * 0.98 = 0.979951 Loading
lib_com/ivas_masa_com.c +144 −0 Original line number Diff line number Diff line Loading @@ -1423,6 +1423,56 @@ int16_t valid_ratio_index( return out; } #ifdef IVAS_FLOAT_FIXED Word16 valid_ratio_index_fx( Word16 index, /* i : index to be checked */ const Word16 K, /* i : L1 norm to check against */ const Word16 len /* i : vector length */ ) { Word16 out; Word16 i, sum, elem; Word16 base[4]; sum = 0; move16(); set16_fx( base, 1, len ); FOR ( i = 1; i < len; i++ ) { base[i] = i_mult(base[i - 1], 10); } sum = 0; move16(); FOR ( i = len - 1; i >= 0; i-- ) { IF(EQ_16(index, 0)) { elem = 0; move16(); } ELSE { elem = idiv1616(index, base[i]); } sum = add(sum, elem); index = sub(index, i_mult(elem, base[i])); } IF ( LE_16(sum, K ) ) { out = 1; move16(); } ELSE { out = 0; move16(); } return out; } #endif /*--------------------------------------------------------------- * reconstruct_ism_ratios() Loading Loading @@ -1458,6 +1508,46 @@ void reconstruct_ism_ratios( } /*--------------------------------------------------------------- * reconstruct_ism_ratios_fx() * * Obtains ISM ratio values from the quantized indexes *---------------------------------------------------------------*/ void reconstruct_ism_ratios_fx( Word16 *ratio_ism_idx, /* i : index vector Q0 */ const Word16 nchan_ism, /* i : number of components/objects Q0 */ const Word16 step, /* i : quantization step Q15 */ Word32 *q_energy_ratio_ism /* o : reconstructed ISM values Q30 */ ) { int16_t i; Word32 sum; sum = 0; move32(); FOR ( i = 0; i < nchan_ism - 1; i++ ) { q_energy_ratio_ism[i] = L_shl(L_mult(ratio_ism_idx[i], step), 14); // q0 + q15 + 1 + 14 = q30; move32(); sum = L_add(sum, q_energy_ratio_ism[i]); } q_energy_ratio_ism[nchan_ism - 1] = L_sub(ONE_IN_Q30, sum); move32(); IF ( LT_32(q_energy_ratio_ism[nchan_ism - 1], 0) ) { q_energy_ratio_ism[nchan_ism - 1] = 0; move32(); } return; } /*--------------------------------------------------------------- * ivas_omasa_modify_masa_energy_ratios() * Loading Loading @@ -1534,6 +1624,60 @@ void distribute_evenly_ism( return; } #ifdef IVAS_FLOAT_FIXED /*--------------------------------------------------------------- * distribute_evenly_ism_fx() * * Obtain ISM ratio indexes for even content distribution bbetween objects *---------------------------------------------------------------*/ void distribute_evenly_ism_fx( Word16 *idx, /* o : index values */ const Word16 K, /* i : sum of indexes */ const Word16 nchan_ism /* i : number of objects */ ) { Word16 i; Word16 sum; sum = 0; move16(); FOR( i = 0; i < nchan_ism; i++ ) { IF(EQ_16(K, 0)) { idx[i] = 0; move16(); } ELSE { idx[i] = idiv1616( K, nchan_ism ); move16(); } sum = add( sum, idx[i] ); } assert( LE_16( sum, K ) ); i = 0; move16(); WHILE( LT_16( sum, K ) ) { IF( EQ_16( i, nchan_ism ) ) { i = 0; move16(); } idx[i] = add( idx[i], 1 ); move16(); sum = add( sum, 1 ); i = add( i, 1 ); } return; } #endif /*--------------------------------------------------------------- * calculate_cpe_brate_MASA_ISM() Loading
lib_com/ivas_omasa_com.c +6 −5 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include <stdlib.h> #include "ivas_cnst.h" #include "ivas_prot.h" #include "ivas_prot_fx.h" #include "prot.h" #include "prot_fx1.h" #include "ivas_rom_com.h" Loading Loading @@ -903,8 +904,8 @@ static Word16 get_bits_ism( Word32 val ) void calculate_nbits_meta_fx( const Word16 nchan_ism, Word32 q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], // Qx Word32 masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], // Qx const Word32 q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], // Q30 const Word32 masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], // Q30 const Word16 numSf, const Word16 numCodingBands, Word16 *bits_ism, Loading Loading @@ -1011,7 +1012,7 @@ void ivas_get_stereo_panning_gains( #define SIN_NEG_30_DEGREES_Q15 ( (Word16) 0xC000 ) #define SIN_30_DEGREES_Q15 ( (Word16) 0x4000 ) static void get_panning_gain( void get_panning_gain( const Word16 sinAngleMapped, Word16 *panningGains ) { Loading Loading @@ -1121,10 +1122,10 @@ void ivas_get_stereo_panning_gains_fx( } WHILE( LT_16( azSubEl, -180 ) ) { azSubEl = sub( azSubEl, 360 ); azSubEl = add( azSubEl, 360 ); } // sin_az_cos_el = (ptr_sin_az[azAddEl] + ptr_sin_az[azSubEl])/2; Word16 sin_az_cos_el = extract_l( L_shr( L_add( L_deposit_l( ptr_sin_az[azAddEl] ), L_deposit_l( ptr_sin_az[azSubEl] ) ), 1 ) ); Word16 sin_az_cos_el = extract_l( L_shr( L_add( L_deposit_l( ptr_sin_az[azAddEl + 180] ), L_deposit_l( ptr_sin_az[azSubEl + 180] ) ), 1 ) ); IF( GE_16( sin_az_cos_el, SIN_30_DEGREES_Q15 ) ) { /* Left side */ Loading