Loading lib_com/ivas_cnst.h +4 −0 Original line number Diff line number Diff line Loading @@ -1131,7 +1131,11 @@ enum #define MASA_TRANSP_BITS 1 #define NO_BITS_MASA_ISM_NO_OBJ 2 #ifdef NON_BE_FIX_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 Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ #define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */ #define NON_BE_FIX_807_MASA_DTX_BRSW /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */ #define NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold */ /* #################### End FIXES switches ############################ */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ Loading lib_dec/ivas_qmetadata_dec.c +18 −6 Original line number Diff line number Diff line Loading @@ -580,7 +580,6 @@ int16_t ivas_qmetadata_dec_decode( bits_dir_target += bits_dir_raw; bits_dir_used += bits_dir; } /* move 2 dir data to its correct subband */ Loading Loading @@ -923,7 +922,6 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512( /* Decode quantized directions frame-wise */ ivas_qmetadata_raw_decode_dir_512( q_direction, bitstream, index, nbands, start_band, sph_grid16 ); } if ( hQMetaData->no_directions == 2 ) Loading Loading @@ -4119,7 +4117,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 NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL int32_t int_tmp; #endif /* Setup coding parameters */ n_streams = 1; len_stream = nbands * nblocks; Loading Loading @@ -4174,6 +4174,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 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++; } } Loading @@ -4185,6 +4189,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 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 } } } Loading @@ -4196,6 +4204,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 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 } } } Loading lib_enc/ivas_qmetadata_enc.c +8 −7 Original line number Diff line number Diff line Loading @@ -165,7 +165,6 @@ ivas_error ivas_qmetadata_enc_encode( error = IVAS_ERR_OK; /* Save initial position in bitstream */ bit_pos_0 = hMetaData->nb_bits_tot; bit_pos_start = bit_pos_0; Loading Loading @@ -442,8 +441,6 @@ ivas_error ivas_qmetadata_enc_encode( } extra_bits = hQMetaData->metadata_max_bits - ( hMetaData->nb_bits_tot - bit_pos_0 ); } /* Requantized directions */ Loading Loading @@ -2657,7 +2654,6 @@ static int16_t ivas_qmetadata_reorder_azimuth_index( { /* for North and South poles, a single azimuth direction exists */ azimuth_index_reordered = 0; } return azimuth_index_reordered; Loading Loading @@ -5277,7 +5273,6 @@ static void transform_azimuth_dir2( } static int16_t divide_GR_orders( const int16_t *q_idx, const int16_t GR1, Loading Loading @@ -5575,7 +5570,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; Loading Loading @@ -5726,6 +5723,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++; } } Loading Loading
lib_com/ivas_cnst.h +4 −0 Original line number Diff line number Diff line Loading @@ -1131,7 +1131,11 @@ enum #define MASA_TRANSP_BITS 1 #define NO_BITS_MASA_ISM_NO_OBJ 2 #ifdef NON_BE_FIX_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 Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ #define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */ #define NON_BE_FIX_807_MASA_DTX_BRSW /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */ #define NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold */ /* #################### End FIXES switches ############################ */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ Loading
lib_dec/ivas_qmetadata_dec.c +18 −6 Original line number Diff line number Diff line Loading @@ -580,7 +580,6 @@ int16_t ivas_qmetadata_dec_decode( bits_dir_target += bits_dir_raw; bits_dir_used += bits_dir; } /* move 2 dir data to its correct subband */ Loading Loading @@ -923,7 +922,6 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512( /* Decode quantized directions frame-wise */ ivas_qmetadata_raw_decode_dir_512( q_direction, bitstream, index, nbands, start_band, sph_grid16 ); } if ( hQMetaData->no_directions == 2 ) Loading Loading @@ -4119,7 +4117,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 NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL int32_t int_tmp; #endif /* Setup coding parameters */ n_streams = 1; len_stream = nbands * nblocks; Loading Loading @@ -4174,6 +4174,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 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++; } } Loading @@ -4185,6 +4189,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 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 } } } Loading @@ -4196,6 +4204,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 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 } } } Loading
lib_enc/ivas_qmetadata_enc.c +8 −7 Original line number Diff line number Diff line Loading @@ -165,7 +165,6 @@ ivas_error ivas_qmetadata_enc_encode( error = IVAS_ERR_OK; /* Save initial position in bitstream */ bit_pos_0 = hMetaData->nb_bits_tot; bit_pos_start = bit_pos_0; Loading Loading @@ -442,8 +441,6 @@ ivas_error ivas_qmetadata_enc_encode( } extra_bits = hQMetaData->metadata_max_bits - ( hMetaData->nb_bits_tot - bit_pos_0 ); } /* Requantized directions */ Loading Loading @@ -2657,7 +2654,6 @@ static int16_t ivas_qmetadata_reorder_azimuth_index( { /* for North and South poles, a single azimuth direction exists */ azimuth_index_reordered = 0; } return azimuth_index_reordered; Loading Loading @@ -5277,7 +5273,6 @@ static void transform_azimuth_dir2( } static int16_t divide_GR_orders( const int16_t *q_idx, const int16_t GR1, Loading Loading @@ -5575,7 +5570,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; Loading Loading @@ -5726,6 +5723,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++; } } Loading