Commit 81d2b405 authored by vasilache's avatar vasilache
Browse files

fix 819 masa2total

parent 315a2539
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1222,7 +1222,11 @@ enum
#define MASA_TRANSP_BITS                        1
#define NO_BITS_MASA_ISM_NO_OBJ                 2
#ifdef IVAS_FLOAT_FIXED
#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL
#define MASA2TOTAL_THR                          0.9799999f
#else
#define MASA2TOTAL_THR                          0.98f
#endif
#define MASA2TOTAL_THR_Q30                      1052266987 // 0.98f in Q30
//Maximum error in float to fixed conversion : 0.005%
//Assuming the accuracy of 99.995%
+1 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@

#define NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES /* FhG: issue 1133: skip de-whitening of bg noise shape after frameloss period if the first good frame is an SID */
#define NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID /* FhG: issue 1133: in TCX PLC, don't scale hHQ_core->old_out after applying fade to noise in burst frame error */
#define NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL

/* ##################### End NON-BE switches ########################### */
#define FIX_740_HQ_CORE_OVA // Proposed fix to solve overlap and add issue for HQ_CORE
+7 −1
Original line number Diff line number Diff line
@@ -7654,7 +7654,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 NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL
    int32_t int_tmp;
#endif

    bits_pos = hMetaData->nb_bits_tot;
    k = 0;
@@ -7805,6 +7807,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 NON_BE_FIX_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++;
        }
    }