Commit 23739172 authored by vasilache's avatar vasilache
Browse files

fix 1048

parent fd323b3f
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1197,6 +1197,10 @@ enum
#define MASA_RATIO_TOLERANCE                    0.1f
#define MASA_RATIO_THRESHOLD                    0.015f
#define MASA_ANGLE_TOLERANCE                    0.5f
#ifdef  NON_BE_FIX_1048_THRESHOLD_COH_BASOP
#define MASA_SUR_COH_THRESHOLD                  1e-7f
#define MASA_SUR_COH_PRECISION                  1e7f
#endif
#define MASA_LIMIT_NO_BANDS_SUR_COH             8
#define MINIMUM_BIT_BUDGET_NORMAL_META          100
#define DIFF_DFRATIO_2BIT_LIMIT_IDX_HODIRAC     4
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@
/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */

#define NON_BE_FIX_1048_THRESHOLD_COH_BASOP             /* Nokia: Fix 1048 replace comparison with 0 with comparison to threshold, to align with BASOP*/

/* ##################### End NON-BE switches ########################### */

+8 −1
Original line number Diff line number Diff line
@@ -4070,6 +4070,10 @@ static int16_t read_surround_coherence_hr(
    IVAS_QDIRECTION *q_direction;
    int16_t min_index;
    int16_t d, idx;
#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP
    int32_t int_error_ratio_surr;
#endif

    coding_subbands = hQMetaData->q_direction[0].cfg.nbands;
    q_direction = hQMetaData->q_direction;

@@ -4092,7 +4096,10 @@ static int16_t read_surround_coherence_hr(
            {
                error_ratio_surr = 1.0f - q_direction[0].band_data[j].energy_ratio[sf];
            }

#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP
            int_error_ratio_surr = rint( MASA_SUR_COH_PRECISION * error_ratio_surr );
            error_ratio_surr = (float) ( int_error_ratio_surr * MASA_SUR_COH_THRESHOLD );
#endif
            if ( error_ratio_surr <= 0 )
            {
                error_ratio_surr = 0;
+7 −3
Original line number Diff line number Diff line
@@ -4926,7 +4926,9 @@ static int16_t encode_surround_coherence_hr(
    int16_t max_val = 0, nbits_max;
    int16_t no_cv_shift[MASA_MAXIMUM_CODING_SUBBANDS], min_idx;
    int16_t idx16;

#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP
    int32_t int_error_ratio_surr;
#endif
    coding_subbands = hQMetaData->q_direction[0].cfg.nbands;
    all_coherence_zero = hQMetaData->all_coherence_zero;
    q_direction = &( hQMetaData->q_direction[0] );
@@ -4955,8 +4957,10 @@ static int16_t encode_surround_coherence_hr(
                {
                    error_ratio_surr = 1.0f - q_direction[0].band_data[j].energy_ratio[sf];
                }


#ifdef NON_BE_FIX_1048_THRESHOLD_COH_BASOP
                int_error_ratio_surr = rint( MASA_SUR_COH_PRECISION * error_ratio_surr );
                error_ratio_surr = (float) ( int_error_ratio_surr * MASA_SUR_COH_THRESHOLD );
#endif
                if ( error_ratio_surr <= 0 )
                {
                    error_ratio_surr = 0;