Commit f444e556 authored by Lauros Pajunen's avatar Lauros Pajunen
Browse files

Merge remote-tracking branch 'origin/main' into add-ivas-rtpdump-support

parents 9418eba8 921d8b38
Loading
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -2792,6 +2792,9 @@ enum
#define LOG2_10                               27213       /* log base 2 of 10 in Q12 */
#define LOG2_10_Q29                           1783446566  /* log base 2 of 10 in Q12 */
#define LOG10_2_Q31                           646456993   /* inverse log base 10 of 2 in Q31 */
#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA
#define INV_LOG2_10                           9864        /* 1/log2(10), Q15*/
#endif
#define MU_MA_FX                              10923       /* original prediction factor for the AMR WB tables (Q15) */

#define E_MIN_FXQ15                           115     /* Q15*/
+2 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@
#endif

/* ################### Start FIXES switches ########################### */
/*#define FIX_I4_OL_PITCH*/                                  /* fix open-loop pitch used for EVS core switching */
#define REMOVE_BASOP_Util_Divide3232_Scale_cadence           /* remove this division variant */
#define FIX_1990_SANITIZER_IN_REVERB_LOAD                    /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK            /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/
@@ -103,7 +104,7 @@
#define FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING         /* Orange: Fix for issue 2184 - to prevent one channel from becoming inaudible in the mono downmix output */
#define FIX_2148_OBJ_EDIT_ISSUE_WITH_OSBA                    /* Nokia: Add missing code to solve issue */
#define FIX_2200_ISAR_PLC_CRASH                              /* Dolby: Fix for ISAR PLC crash observed with newly added BASOP tests */

#define FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA             /* FhG: Resolve overflow by swapping the order of addition and multiplication */
/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
+37 −13
Original line number Diff line number Diff line
@@ -55,7 +55,11 @@ void bw_detect_fx(
    Word16 spect[L_FRAME48k], spect_bin[BWD_N_BINS_MAX];
    Word32 spect32[L_FRAME48k], in_win32[BWD_TOTAL_WIDTH];
    Word16 e_tmp, f_tmp;
#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA
    Word32 L_tmp, sum32, L_tmp_q_shift;
#else
    Word32 L_tmp, sum32;
#endif

    Word32 L_tmp1, L_tmp2, L_tmp3;
    Word16 scale;
@@ -131,12 +135,17 @@ void bw_detect_fx(
            }
#endif
            L_tmp = BASOP_Util_Log2( cldfb_bin[0] ); /*(log2(660423549*2^(-31))/64)*2^31*/
#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 */
#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA
            L_tmp = Mpy_32_16_1( L_tmp, INV_LOG2_10 ); // instead of adding it to L_tmp_q_shift and then multiplying by INV_LOG2_10 ( to avoid saturation ).

            L_tmp_q_shift = L_shl_sat( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ); // This term should be added to L_temp to align it to Q25
            L_tmp_q_shift = Mpy_32_16_1( L_tmp_q_shift, INV_LOG2_10 );                        // instead of adding it to L_tmp and then multiplying by INV_LOG2_10 ( to avoid saturation ).

            cldfb_bin[0] = L_add( L_tmp, L_tmp_q_shift ); /* Q25 */
#else
            L_tmp = L_add_sat( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
#endif
            cldfb_bin[0] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ );
#endif
            move32(); /* 1/log2(10) */ /* Q25 */

            /* WB: 4.4 - 7.2 kHz, 8 cldfb-bands, mid band(14) counted twice */
@@ -165,12 +174,17 @@ void bw_detect_fx(
                        move32();
                    }
                    L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/
#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 */
#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA
                    L_tmp = Mpy_32_16_1( L_tmp, INV_LOG2_10 ); // instead of adding it to L_tmp_q_shift and then multiplying by INV_LOG2_10 ( to avoid saturation ).

                    L_tmp_q_shift = L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ); // This term should be added to L_temp to align it to Q25
                    L_tmp_q_shift = Mpy_32_16_1( L_tmp_q_shift, INV_LOG2_10 );                        // instead of adding it to L_tmp and then multiplying by INV_LOG2_10 ( to avoid saturation ).

                    cldfb_bin[i] = L_add( L_tmp, L_tmp_q_shift ); /* Q25 */
#else
                    L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
#endif
                    cldfb_bin[i] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ );
#endif
                    move32(); /* 1/log2(10) */ /* Q25 */
                }
            }
@@ -208,12 +222,17 @@ void bw_detect_fx(
                        move32();
                    }
                    L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/
#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 */
#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA
                    L_tmp = Mpy_32_16_1( L_tmp, INV_LOG2_10 ); // instead of adding it to L_tmp_q_shift and then multiplying by INV_LOG2_10 ( to avoid saturation ).

                    L_tmp_q_shift = L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ); // This term should be added to L_temp to align it to Q25
                    L_tmp_q_shift = Mpy_32_16_1( L_tmp_q_shift, INV_LOG2_10 );                        // instead of adding it to L_tmp and then multiplying by INV_LOG2_10 ( to avoid saturation ).

                    cldfb_bin[i] = L_add( L_tmp, L_tmp_q_shift ); /* Q25 */
#else
                    L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
#endif
                    cldfb_bin[i] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ );
#endif
                    move32(); /* 1/log2(10) */ /* Q25 */
                }
            }
@@ -245,12 +264,17 @@ void bw_detect_fx(
                        move32();
                    }
                    L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/
#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 */
#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA
                    L_tmp = Mpy_32_16_1( L_tmp, INV_LOG2_10 ); // instead of adding it to L_tmp_q_shift and then multiplying by INV_LOG2_10 ( to avoid saturation ).

                    L_tmp_q_shift = L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ); // This term should be added to L_temp to align it to Q25
                    L_tmp_q_shift = Mpy_32_16_1( L_tmp_q_shift, INV_LOG2_10 );                        // instead of adding it to L_tmp and then multiplying by INV_LOG2_10 ( to avoid saturation ).

                    cldfb_bin[i] = L_add( L_tmp, L_tmp_q_shift ); /* Q25 */
#else
                    L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */
#endif
                    cldfb_bin[i] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ );
#endif
                    move32(); /* 1/log2(10) */ /* Q25 */
                }
            }