Loading .clang-format +9 −0 Original line number Diff line number Diff line Loading @@ -84,5 +84,14 @@ SpacesInCStyleCastParentheses: false SpacesInParentheses: true SpacesInSquareBrackets: false Standard: Cpp11 StatementMacros: - IF # - ELSE IF # - ELSE # Note that ELSE cannot be used here as it would break ELSE IF into two lines. - SWITCH - CASE - FOR - WHILE - DO TabWidth: 8 UseTab: Never apps/decoder.c +0 −16 Original line number Diff line number Diff line Loading @@ -163,9 +163,7 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); #ifdef FIX_FMSW_DEC_EXT static ivas_error updateOnFormatSwitching( IVAS_DEC_HANDLE hIvasDec, IVAS_DEC_BS_FORMAT *pBsFormat, const char *outputWavFilename, MasaFileWriter **ppMasaWriter, IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], int16_t *pNumOutChannels, uint16_t *pNumObj, const bool delayCompensationEnabled ); #endif /*------------------------------------------------------------------------------------------* Loading Loading @@ -2027,11 +2025,7 @@ static ivas_error decodeG192( int16_t isSplitRend, isSplitCoded; IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; #ifdef FIX_FMSW_DEC_EXT bool restartNeeded = false; #else bool restartNeeded; #endif #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) Loading Loading @@ -2418,7 +2412,6 @@ static ivas_error decodeG192( } } #ifdef FIX_FMSW_DEC_EXT /* Output writing update in case of format switching and EXTERNAL output */ if ( restartNeeded && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { Loading @@ -2428,7 +2421,6 @@ static ivas_error decodeG192( goto cleanup; } } #endif /* Write current frame */ if ( decodedGoodFrame ) Loading Loading @@ -2823,11 +2815,7 @@ static ivas_error decodeVoIP( int16_t i; IVAS_DEC_HANDLE hIvasDec = *phIvasDec; #ifdef FIX_FMSW_DEC_EXT bool restartNeeded = false; #else bool restartNeeded; #endif IVAS_RTP ivasRtp = { 0 }; IVAS_RTP srRtp = { 0 }; IVAS_RTP_SR_INFO srInfo = { true, false, 0, 20, IVAS_SR_TRANSPORT_LCLD }; Loading Loading @@ -3314,7 +3302,6 @@ static ivas_error decodeVoIP( } } #ifdef FIX_FMSW_DEC_EXT /* Output writing update in case of format switching and EXTERNAL output */ if ( restartNeeded && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { Loading @@ -3324,7 +3311,6 @@ static ivas_error decodeVoIP( goto cleanup; } } #endif /* Write current frame */ if ( !srRtp.hPack && decodedGoodFrame ) Loading Loading @@ -3934,7 +3920,6 @@ static ivas_error load_hrtf_from_file( return IVAS_ERR_OK; } #ifdef FIX_FMSW_DEC_EXT /*---------------------------------------------------------------------* * updateOnFormatSwitching() Loading Loading @@ -4008,6 +3993,5 @@ static ivas_error updateOnFormatSwitching( return IVAS_ERR_OK; } #endif #undef WMC_TOOL_SKIP lib_com/basop_util.c +37 −3 Original line number Diff line number Diff line Loading @@ -2720,25 +2720,59 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ Word16 len, /* i: buffer len to process */ #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH Word16 *exp, /* o: result exponent */ const Word16 is_ivas ) /* i: flag indicating IVAS to maintain EVS BE */ #else Word16 *exp ) /* o: result exponent */ #endif { Word32 L_sum; Word16 shift, shift1, i; shift = getScaleFactor32( bufX32, len ); /* current available headroom */ #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 1 ) ) { shift = sub( shift, sub( 15, norm_s( len ) ) ); /* reduced required headroom */ } ELSE { shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom */ } #else shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom */ #endif L_sum = 0; /* Clear accu */ move32(); FOR( i = 0; i < len; i++ ) { #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 1 ) ) { L_sum = L_add( L_sum, Mpy_32_16_1( L_shl( bufX32[i], shift ), bufY16[i] ) ); } ELSE { L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] ); } #else L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] ); #endif } shift1 = norm_l( L_sum ); L_sum = L_shl( L_sum, shift1 ); /* return value */ shift = sub( add( bufX32_exp, bufY16_exp ), add( shift, shift1 ) ); #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 0 ) ) { shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */ } #else shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */ #endif /* In case of NULL result, we want to have a 0 exponent too */ if ( L_sum == 0 ) shift = 0; Loading lib_com/basop_util.h +6 −1 Original line number Diff line number Diff line Loading @@ -864,7 +864,12 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ Word16 len, /* i: buffer len to process */ #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH Word16 *exp, /* o: result exponent */ const Word16 is_ivas ); /* i: flag indicating IVAS to maintain EVS BE */ #else Word16 *exp ); /* o: result exponent */ #endif /*!********************************************************************** \brief Converts linear factor or energy to Decibel Loading lib_com/cng_exc_fx.c +359 −357 Original line number Diff line number Diff line Loading @@ -147,9 +147,11 @@ void CNG_exc_fx( move16(); } } ELSE{ ELSE { /* normal CNG update */ IF( *last_allow_cn_step == 0 ){ IF( *last_allow_cn_step == 0 ) { /**lp_ener = (float)(A2 * *Enew + (1-A2) * *lp_ener);*/ L_tmp_ener = Mult_32_16( *Enew, A2 ); L_tmp_ener = Madd_32_16( L_tmp_ener, *lp_ener, OmA2 ); Loading Loading
.clang-format +9 −0 Original line number Diff line number Diff line Loading @@ -84,5 +84,14 @@ SpacesInCStyleCastParentheses: false SpacesInParentheses: true SpacesInSquareBrackets: false Standard: Cpp11 StatementMacros: - IF # - ELSE IF # - ELSE # Note that ELSE cannot be used here as it would break ELSE IF into two lines. - SWITCH - CASE - FOR - WHILE - DO TabWidth: 8 UseTab: Never
apps/decoder.c +0 −16 Original line number Diff line number Diff line Loading @@ -163,9 +163,7 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); #ifdef FIX_FMSW_DEC_EXT static ivas_error updateOnFormatSwitching( IVAS_DEC_HANDLE hIvasDec, IVAS_DEC_BS_FORMAT *pBsFormat, const char *outputWavFilename, MasaFileWriter **ppMasaWriter, IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], int16_t *pNumOutChannels, uint16_t *pNumObj, const bool delayCompensationEnabled ); #endif /*------------------------------------------------------------------------------------------* Loading Loading @@ -2027,11 +2025,7 @@ static ivas_error decodeG192( int16_t isSplitRend, isSplitCoded; IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; #ifdef FIX_FMSW_DEC_EXT bool restartNeeded = false; #else bool restartNeeded; #endif #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) Loading Loading @@ -2418,7 +2412,6 @@ static ivas_error decodeG192( } } #ifdef FIX_FMSW_DEC_EXT /* Output writing update in case of format switching and EXTERNAL output */ if ( restartNeeded && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { Loading @@ -2428,7 +2421,6 @@ static ivas_error decodeG192( goto cleanup; } } #endif /* Write current frame */ if ( decodedGoodFrame ) Loading Loading @@ -2823,11 +2815,7 @@ static ivas_error decodeVoIP( int16_t i; IVAS_DEC_HANDLE hIvasDec = *phIvasDec; #ifdef FIX_FMSW_DEC_EXT bool restartNeeded = false; #else bool restartNeeded; #endif IVAS_RTP ivasRtp = { 0 }; IVAS_RTP srRtp = { 0 }; IVAS_RTP_SR_INFO srInfo = { true, false, 0, 20, IVAS_SR_TRANSPORT_LCLD }; Loading Loading @@ -3314,7 +3302,6 @@ static ivas_error decodeVoIP( } } #ifdef FIX_FMSW_DEC_EXT /* Output writing update in case of format switching and EXTERNAL output */ if ( restartNeeded && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { Loading @@ -3324,7 +3311,6 @@ static ivas_error decodeVoIP( goto cleanup; } } #endif /* Write current frame */ if ( !srRtp.hPack && decodedGoodFrame ) Loading Loading @@ -3934,7 +3920,6 @@ static ivas_error load_hrtf_from_file( return IVAS_ERR_OK; } #ifdef FIX_FMSW_DEC_EXT /*---------------------------------------------------------------------* * updateOnFormatSwitching() Loading Loading @@ -4008,6 +3993,5 @@ static ivas_error updateOnFormatSwitching( return IVAS_ERR_OK; } #endif #undef WMC_TOOL_SKIP
lib_com/basop_util.c +37 −3 Original line number Diff line number Diff line Loading @@ -2720,25 +2720,59 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ Word16 len, /* i: buffer len to process */ #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH Word16 *exp, /* o: result exponent */ const Word16 is_ivas ) /* i: flag indicating IVAS to maintain EVS BE */ #else Word16 *exp ) /* o: result exponent */ #endif { Word32 L_sum; Word16 shift, shift1, i; shift = getScaleFactor32( bufX32, len ); /* current available headroom */ #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 1 ) ) { shift = sub( shift, sub( 15, norm_s( len ) ) ); /* reduced required headroom */ } ELSE { shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom */ } #else shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom */ #endif L_sum = 0; /* Clear accu */ move32(); FOR( i = 0; i < len; i++ ) { #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 1 ) ) { L_sum = L_add( L_sum, Mpy_32_16_1( L_shl( bufX32[i], shift ), bufY16[i] ) ); } ELSE { L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] ); } #else L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] ); #endif } shift1 = norm_l( L_sum ); L_sum = L_shl( L_sum, shift1 ); /* return value */ shift = sub( add( bufX32_exp, bufY16_exp ), add( shift, shift1 ) ); #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 0 ) ) { shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */ } #else shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */ #endif /* In case of NULL result, we want to have a 0 exponent too */ if ( L_sum == 0 ) shift = 0; Loading
lib_com/basop_util.h +6 −1 Original line number Diff line number Diff line Loading @@ -864,7 +864,12 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ Word16 len, /* i: buffer len to process */ #ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH Word16 *exp, /* o: result exponent */ const Word16 is_ivas ); /* i: flag indicating IVAS to maintain EVS BE */ #else Word16 *exp ); /* o: result exponent */ #endif /*!********************************************************************** \brief Converts linear factor or energy to Decibel Loading
lib_com/cng_exc_fx.c +359 −357 Original line number Diff line number Diff line Loading @@ -147,9 +147,11 @@ void CNG_exc_fx( move16(); } } ELSE{ ELSE { /* normal CNG update */ IF( *last_allow_cn_step == 0 ){ IF( *last_allow_cn_step == 0 ) { /**lp_ener = (float)(A2 * *Enew + (1-A2) * *lp_ener);*/ L_tmp_ener = Mult_32_16( *Enew, A2 ); L_tmp_ener = Madd_32_16( L_tmp_ener, *lp_ener, OmA2 ); Loading