Commit a1475f7c authored by vasilache's avatar vasilache
Browse files

Issue 1231 fix - align to Basop

parent f0fab958
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1141,7 +1141,12 @@ enum

#define MASA_TRANSP_BITS                        1
#define NO_BITS_MASA_ISM_NO_OBJ                 2

#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
#define MASA_HEADER_BITS                        2
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@

#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
@@ -4359,7 +4359,9 @@ void ivas_omasa_decode_masa_to_total(
    float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS],
        dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS];
    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;
@@ -4414,6 +4416,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++;
        }
    }
@@ -4425,6 +4431,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
            }
        }
    }
@@ -4436,6 +4446,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
            }
        }
    }
+7 −1
Original line number Diff line number Diff line
@@ -6035,7 +6035,9 @@ void ivas_omasa_encode_masa_to_total(
    float dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS];
    int16_t bits_pos, nb_bits;
    int16_t n_streams, len_stream;

#ifdef NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL
    int32_t int_tmp;
#endif
#ifdef DEBUG_MODE_QMETADATA
    static FILE *pF = NULL;
    static FILE *pF_ratio = NULL;
@@ -6196,6 +6198,10 @@ void ivas_omasa_encode_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++;
        }
    }