Commit e6cb9b3d authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Set cldfb_bin[0] to epsilon when it is zero.

parent 2b5ba25a
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@
#define TEMP_FIX_2088_MSAN_INIT_ERROR                        /* Eri: Temporary fix for Issue 2088 - MSAN error. Will come with later port of JBM+Split rendering update */
#define FIX_2092_ASSERT_IN_OMASA_RENDER                      /* FhG, Nokia: Fix LTV crash due to overflow in OMASA EXT output */
#define FIX_2084_FLOATING_POINT_LEFTOVERS                    /* FhG: convert floating-point leftovers in IVAS_ENC_FeedObjectMetadata() */
#define FIX_ASSERT_IN_OMASA_BITRATE_SWITSCHING               /* FhG: Replace L_shl with L_shl_sat to prevent overflow when calculating scale factors for very small numbers in the logarithmic domain */
#define FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING          /* FhG: Replace L_shl with L_shl_sat to prevent overflow when calculating scale factors for very small numbers in the logarithmic domain */
/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
+5 −5
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ void bw_detect_fx(
            move32();                                            /* Q31 */
            cldfb_bin_Exp[0] = add( cldfb_bin_Exp[0], CLDFBscalingFactor_EXP );
            move16();
#ifndef FIX_ASSERT_IN_OMASA_BITRATE_SWITSCHING
#ifdef FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING
            if ( cldfb_bin[0] == 0 )
            {
                cldfb_bin[0] = L_deposit_l( 1 );
@@ -131,7 +131,7 @@ void bw_detect_fx(
            }
#endif
            L_tmp = BASOP_Util_Log2( cldfb_bin[0] ); /*(log2(660423549*2^(-31))/64)*2^31*/
#ifdef FIX_ASSERT_IN_OMASA_BITRATE_SWITSCHING
#ifdef FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING
            L_tmp = L_add_sat( L_tmp, L_shl_sat( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
#else
            L_tmp = L_add_sat( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ) );     /* Q25 */
@@ -165,7 +165,7 @@ void bw_detect_fx(
                        move32();
                    }
                    L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/
#ifdef FIX_ASSERT_IN_OMASA_BITRATE_SWITSCHING
#ifdef FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING
                    L_tmp = L_add( L_tmp, L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
#else
                    L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
@@ -208,7 +208,7 @@ void bw_detect_fx(
                        move32();
                    }
                    L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/
#ifdef FIX_ASSERT_IN_OMASA_BITRATE_SWITSCHING
#ifdef FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING
                    L_tmp = L_add( L_tmp, L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
#else
                    L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
@@ -245,7 +245,7 @@ void bw_detect_fx(
                        move32();
                    }
                    L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/
#ifdef FIX_ASSERT_IN_OMASA_BITRATE_SWITSCHING
#ifdef FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING
                    L_tmp = L_add( L_tmp, L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
#else
                    L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */