Commit e79e78e0 authored by vasilache's avatar vasilache Committed by emerit
Browse files

Issue 1231 fix - align to Basop

parent 52064e05
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1141,8 +1141,12 @@ enum

#define MASA_TRANSP_BITS                        1
#define NO_BITS_MASA_ISM_NO_OBJ                 2
#define MASA2TOTAL_THR                          0.98f

#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL
#define MASA2TOTAL_THR                          0.9799999f
#else
#define MASA2TOTAL_THR                          0.98f
#endif
#define BITS_MASA2TOTTAL_DCT0                   6
#define STEP_M2T                                0.1f
#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL 
+3 −5
Original line number Diff line number Diff line
@@ -168,11 +168,9 @@
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_GSC_BSTR                              /* VA: issue 1264: Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */
#define NONBE_1273_ISM_METADATA_COUNTER                 /* VA: issue 1273: fix counter overflow in ISM metadata encoder */
#define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD      /* VA/Eri: issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */


#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR       /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH             /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */
#define NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL        /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold to be aligned with BASOP*/
/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+15 −1
Original line number Diff line number Diff line
@@ -4400,7 +4400,9 @@ void ivas_omasa_decode_masa_to_total(
        dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS];
#endif
    int16_t n_streams, len_stream;

#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL
    int32_t int_tmp;
#endif
    /* Setup coding parameters */
    n_streams = 1;
    len_stream = nbands * nblocks;
@@ -4540,6 +4542,10 @@ void ivas_omasa_decode_masa_to_total(
        {
            masa_to_total_energy_ratio[i][j] = max( 0.0f, q_dct_data[k] );
            masa_to_total_energy_ratio[i][j] = min( 1.0f, masa_to_total_energy_ratio[i][j] );
#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL
            int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] );
            masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD );
#endif
            k++;
        }
    }
@@ -4551,6 +4557,10 @@ void ivas_omasa_decode_masa_to_total(
            for ( j = 0; j < nbands; j++ )
            {
                masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[0][j];
#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL
                int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] );
                masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD );
#endif
            }
        }
    }
@@ -4562,6 +4572,10 @@ void ivas_omasa_decode_masa_to_total(
            for ( i = 0; i < nblocks; i++ )
            {
                masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[i][0];
#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL
                int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] );
                masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD );
#endif
            }
        }
    }
+1 −6
Original line number Diff line number Diff line
@@ -6039,13 +6039,8 @@ void ivas_omasa_encode_masa_to_total(

    int16_t bits_pos, nb_bits;
    int16_t n_streams, len_stream;

#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL
    Word32 q_dct_data_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS],
        dct_data_tmp_fx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS];

    int64_t step_fx;
    step_fx = STEP_M2T_FX;
    int32_t int_tmp;
#endif
#ifdef DEBUG_MODE_QMETADATA
    static FILE *pF = NULL;