diff --git a/apps/renderer.c b/apps/renderer.c index deda26e8ae45228a17661fbad7d7b0a9b2bdd4a4..26c4b349d2b8e436a01db2d5d3dda8a9f86f0d31 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -564,7 +564,6 @@ static void setupWithSingleFormatInput( positionProvider->numObjects = args.inConfig.numAudioObjects; for ( int16_t i = 0; i < positionProvider->numObjects; ++i ) { -#ifdef FIX_1376_MISSING_ISM_METADATA /* Check if path to metadata file was given */ if ( isEmptyString( args.inMetadataFilePaths[i] ) ) { @@ -573,18 +572,11 @@ static void setupWithSingleFormatInput( } /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string contains "NULL" */ -#else - /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string is empty or contains "NULL" */ -#endif char charBuf[FILENAME_MAX]; strncpy( charBuf, args.inMetadataFilePaths[i], min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1 ); charBuf[min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1] = '\0'; to_upper( charBuf ); -#ifdef FIX_1376_MISSING_ISM_METADATA if ( strncmp( charBuf, "NULL", 4 ) == 0 ) -#else - if ( isEmptyString( args.inMetadataFilePaths[i] ) || strncmp( charBuf, "NULL", 4 ) == 0 ) -#endif { continue; } @@ -2592,6 +2584,7 @@ static CmdlnArgs defaultArgs( const char *executableName ) { CmdlnArgs args; + int16_t i; strncpy( args.executableName, executableName, RENDERER_MAX_CLI_ARG_LENGTH ); clearString( args.inputFilePath ); @@ -2610,11 +2603,7 @@ static CmdlnArgs defaultArgs( args.outConfig.outSetupCustom.num_lfe = 0; args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; -#ifdef FIX_1376_MISSING_ISM_METADATA - for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) -#else - for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) -#endif + for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) { clearString( args.inMetadataFilePaths[i] ); } @@ -2651,7 +2640,7 @@ static CmdlnArgs defaultArgs( args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS; args.syncMdDelay = 0; - for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) + for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { args.directivityPatternId[i] = 65535; } diff --git a/lib_com/options.h b/lib_com/options.h index 42f17f9081d30208ab776204fc4410ba465a39b3..48b031d6041b16ac07682357ebc33e964c6b5db1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,9 +163,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ -#define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */ -#define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ #define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ #define FIX_1371_EARLY_PART_INIT_FASTCONV /* Nokia: fix uninitialized variable in FASTCONV path of binaural reverb init */ @@ -179,9 +176,8 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define NONBE_SVD_OPTIMIZATION - #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/hq_lr_dec.c b/lib_dec/hq_lr_dec.c index b2febc4956579c776195f9119a10a0bc38ef0164..e50bd127d78b5e29f92f8cf55952344fd5a3f3a1 100644 --- a/lib_dec/hq_lr_dec.c +++ b/lib_dec/hq_lr_dec.c @@ -262,14 +262,10 @@ void hq_lr_dec( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); -#ifdef FIX_1348_OVERFLOW #ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */ #else - Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#endif -#else - Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */ + Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ #endif Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) ); } diff --git a/lib_dec/ivas_svd_dec.c b/lib_dec/ivas_svd_dec.c index 8957c8e060846c7c5473e7c8ce8fb3fd3422a07d..12a98e87e954da5b1b676f6dab3a23541db55419 100644 --- a/lib_dec/ivas_svd_dec.c +++ b/lib_dec/ivas_svd_dec.c @@ -60,17 +60,9 @@ static float GivensRotation( const float x, const float z ); -#ifdef NONBE_SVD_OPTIMIZATION static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *g ); -#else -static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g ); -#endif -#ifdef NONBE_SVD_OPTIMIZATION static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *g ); -#else -static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g ); -#endif static void singularVectorsAccumulationLeft( float singularVectors_Left[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC ); @@ -497,27 +489,16 @@ static void HouseholderReduction( float *eps_x ) { int16_t nCh; -#ifdef NONBE_SVD_OPTIMIZATION float g_left = 0.0f; float g_right = 0.0f; -#else - float sig_x = 0.0f; - float g = 0.0f; -#endif - /* Bidiagonal Reduction for every channel */ for ( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */ { -#ifdef NONBE_SVD_OPTIMIZATION secDiag[nCh] = g_right; /* from the previous channel */ biDiagonalReductionLeft( singularVectors_Left, nChannelsL, nChannelsC, nCh, &g_left ); singularValues[nCh] = g_left; biDiagonalReductionRight( singularVectors_Left, nChannelsL, nChannelsC, nCh, &g_right ); -#else - biDiagonalReductionLeft( singularVectors_Left, singularValues, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g ); - biDiagonalReductionRight( singularVectors_Left, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g ); -#endif *eps_x = max( *eps_x, ( fabsf( singularValues[nCh] ) + fabsf( secDiag[nCh] ) ) ); } @@ -535,7 +516,7 @@ static void HouseholderReduction( * * *-------------------------------------------------------------------------*/ -#ifdef NONBE_SVD_OPTIMIZATION + static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, @@ -553,7 +534,6 @@ static void biDiagonalReductionLeft( { norm_x = 0.0f; - for ( jCh = currChannel; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][currChannel] ); @@ -586,78 +566,7 @@ static void biDiagonalReductionLeft( return; } -#else -static void biDiagonalReductionLeft( - float singularVectors[][MAX_OUTPUT_CHANNELS], - float singularValues[MAX_OUTPUT_CHANNELS], - float secDiag[MAX_OUTPUT_CHANNELS], - const int16_t nChannelsL, - const int16_t nChannelsC, - const int16_t currChannel, - float *sig_x, - float *g ) -{ - int16_t iCh, jCh, idx; - float norm_x, f, r; - - secDiag[currChannel] = ( *sig_x ) * ( *g ); - - /* Setting values to 0 */ - ( *sig_x ) = 0.0f; - ( *g ) = 0.0f; - - if ( currChannel < nChannelsL ) /* i <= m */ - { - idx = currChannel; - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - ( *sig_x ) += fabsf( singularVectors[jCh][currChannel] ); - } - if ( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ - { - norm_x = 0.0f; - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][currChannel] = ( singularVectors[jCh][currChannel] / maxWithSign( ( *sig_x ) ) ); - norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][currChannel] ); - } - ( *g ) = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x ); - r = ( *g ) * singularVectors[currChannel][idx] - norm_x; - singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - ( *g ) ); - - for ( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ - { - norm_x = 0.0f; - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][iCh] ); - } - - f = norm_x / maxWithSign( r ); - - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][iCh] += ( f * singularVectors[jCh][currChannel] ); - } - } - - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][currChannel] = ( singularVectors[jCh][currChannel] * ( *sig_x ) ); - } - } - - singularValues[currChannel] = ( ( *sig_x ) * ( *g ) ); - } - - return; -} -#endif /*------------------------------------------------------------------------- * biDiagonalReductionRight() @@ -665,7 +574,6 @@ static void biDiagonalReductionLeft( * *-------------------------------------------------------------------------*/ -#ifdef NONBE_SVD_OPTIMIZATION static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, @@ -714,75 +622,7 @@ static void biDiagonalReductionRight( return; } -#else -static void biDiagonalReductionRight( - float singularVectors[][MAX_OUTPUT_CHANNELS], - float secDiag[MAX_OUTPUT_CHANNELS], - const int16_t nChannelsL, - const int16_t nChannelsC, - const int16_t currChannel, - float *sig_x, - float *g ) -{ - int16_t iCh, jCh, idx; - - float norm_x, r; - /* Setting values to 0 */ - ( *sig_x ) = 0.0f; - ( *g ) = 0.0f; - - if ( currChannel < nChannelsL && currChannel != ( nChannelsC - 1 ) ) /* i <=m && i !=n */ - { - idx = currChannel + 1; - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - ( *sig_x ) += fabsf( singularVectors[currChannel][jCh] ); - } - - if ( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ - { - norm_x = 0.0f; - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */ - { - singularVectors[currChannel][jCh] = ( singularVectors[currChannel][jCh] / maxWithSign( ( *sig_x ) ) ); - norm_x += ( singularVectors[currChannel][jCh] * singularVectors[currChannel][jCh] ); - } - ( *g ) = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x ); - r = ( *g ) * singularVectors[currChannel][idx] - norm_x; - singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - ( *g ) ); - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - secDiag[jCh] = singularVectors[currChannel][jCh] / maxWithSign( r ); - } - - for ( iCh = currChannel + 1; iCh < nChannelsL; iCh++ ) /* nChannelsL */ - { - norm_x = 0.0f; - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - norm_x += ( singularVectors[iCh][jCh] * singularVectors[currChannel][jCh] ); - } - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - singularVectors[iCh][jCh] += ( norm_x * secDiag[jCh] ); - } - } - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - singularVectors[currChannel][jCh] = ( singularVectors[currChannel][jCh] * ( *sig_x ) ); - } - } - } - - return; -} -#endif /*------------------------------------------------------------------------- * singularVectorsAccumulationLeft() diff --git a/lib_enc/hq_lr_enc.c b/lib_enc/hq_lr_enc.c index be0a2254c5ecb1dee68c0d425086d6f275ffd813..13637fdbd2873f7c1c7b4a7ccc854ee4d6b2511b 100644 --- a/lib_enc/hq_lr_enc.c +++ b/lib_enc/hq_lr_enc.c @@ -336,14 +336,10 @@ void hq_lr_enc( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); -#ifdef FIX_1369_HQ_LR_OVERFLOW #ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */ #else - Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#endif -#else - Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */ + Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ #endif Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) ); }