Loading lib_com/basop_util.c +5 −0 Original line number Diff line number Diff line Loading @@ -1276,7 +1276,12 @@ Word16 getCosWord16R2( /* The negation cannot overflow, sine is in range [0x0..0x7FFF] */ BASOP_SATURATE_WARNING_OFF sine = negate( sine ); /* Saturation has been included based on the recommendation from the PC group */ #ifdef BASOP_NOGLOB result = msu_r_sat( L_mult( sine, residual ), cosine, -32768 ); #else result = msu_r( L_mult( sine, residual ), cosine, -32768 ); #endif BASOP_SATURATE_WARNING_ON return result; Loading lib_com/cnst.h +9 −3 Original line number Diff line number Diff line Loading @@ -2068,6 +2068,7 @@ typedef enum _DCTTYPE #define ENV_ADJ_INCL 5 /* Inclination for mapping between attenuation region width and attenuation limit */ #define ENV_SMOOTH_FAC 0.1f /* Smoothing factor for envelope stability measure */ #define ENV_SMOOTH_FAC_FX ((Word16)0x0CCD) #define L_STAB_TBL 10 /* Number of elements in stability transition table */ #define LUMPED_ENV_SMOOTH_FAC_FX ((Word16)10089) /* Q19 (no typo error), 0.1/sqrt(27) */ #define CMPLMNT_ENV_SMOOTH_FAC_FX ((Word16)29491) /* Q15 0.9 */ Loading @@ -2089,6 +2090,11 @@ typedef enum _DCTTYPE #define STAB_FAC_EST1 1.093f /* stab_fac HQ estimation coefficient 1 */ #define STAB_FAC_EST2 (-5.84e-05f) /* stab_fac HQ estimation coefficient 2, including Q12 scaling */ #define STAB_FAC_EST3 0.125f /* stab_fac HQ estimation coefficient 3 */ #ifdef IVAS_FLOAT_FIXED #define STAB_FAC_EST1_FX ((Word32)0x45F3B646) /* stab_fac HQ estimation coefficient 1 */ #define STAB_FAC_EST2_FX ((Word32)0xFFFF0B0D) /* stab_fac HQ estimation coefficient 2, including Q12 scaling */ #define STAB_FAC_EST3_FX ((Word32)0x10000000) /* stab_fac HQ estimation coefficient 3 */ #endif // IVAS_FLOAT_FIXED #define ATT_LIM_HANGOVER 150 /* Number of hangover frames for disabling stability dependent attenuation */ #define DELTA_TH 5.0f /* Delta energy threshold for transient detection for envelope stability */ Loading lib_com/float_to_fix_ops.c +10 −10 Original line number Diff line number Diff line Loading @@ -1047,9 +1047,9 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( FOR( i = 0; i < M; i++ ) { st->lsf_cng[i] = (Word16) floatToFixed( st->lsf_cng_float[i] * 2.56f / st->scale, 0 ); st->lsf_adaptive_mean_fx[i] = (Word16) floatToFixed( st->lsf_adaptive_mean[i] * 2.56f / st->scale, 0 ); st->lsfoldbfi0_fx[i] = (Word16) floatToFixed( st->lsfoldbfi0[i] * 2.56f / st->scale, 0 ); st->lsfoldbfi1_fx[i] = (Word16) floatToFixed( st->lsfoldbfi1[i] * 2.56f / st->scale, 0 ); st->lsf_adaptive_mean_fx[i] = (Word16) floatToFixed( st->lsf_adaptive_mean[i] * 2.56f / st->scale_lsfbfi, 0 ); st->lsfoldbfi0_fx[i] = (Word16) floatToFixed( st->lsfoldbfi0[i] * 2.56f / st->scale_lsfbfi, 0); st->lsfoldbfi1_fx[i] = (Word16)floatToFixed(st->lsfoldbfi1[i] * 2.56f / st->scale_lsfbfi, 0 ); } IF( st->hTcxLtpDec ) { Loading Loading @@ -1178,7 +1178,7 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( } for ( i = 0; i < M; i++ ) { st->lsf_adaptive_mean_fx[i] = (Word16) ( st->lsf_adaptive_mean[i] * ( 2.56f / st->scale ) ); st->lsf_adaptive_mean_fx[i] = (Word16) ( st->lsf_adaptive_mean[i] * ( 2.56f / st->scale_lsfbfi) ); } st->stab_fac_fx = (Word16) floatToFixed( st->stab_fac, Q15 ); Loading Loading @@ -1660,9 +1660,9 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( // st->lsf_adaptive_mean[i] = fixedToFloat( L_mult( st->lsf_adaptive_mean_fx[i], 100 ), 9 ); // st->lsfoldbfi0[i] = fixedToFloat( L_mult( st->lsfoldbfi0_fx[i], 100 ), 9 ); // st->lsfoldbfi1[i] = fixedToFloat( L_mult( st->lsfoldbfi1_fx[i], 100 ), 9 ); st->lsf_adaptive_mean[i] = (float) st->lsf_adaptive_mean_fx[i] / ( 2.56f / st->scale ); st->lsfoldbfi1[i] = (float) st->lsfoldbfi1_fx[i] / ( 2.56f / st->scale ); st->lsfoldbfi0[i] = (float) st->lsfoldbfi0_fx[i] / ( 2.56f / st->scale ); st->lsf_adaptive_mean[i] = (float) st->lsf_adaptive_mean_fx[i] / ( 2.56f / st->scale_lsfbfi); st->lsfoldbfi1[i] = (float)st->lsfoldbfi1_fx[i] / (2.56f / st->scale_lsfbfi); st->lsfoldbfi0[i] = (float)st->lsfoldbfi0_fx[i] / (2.56f / st->scale_lsfbfi); } st->old_enr_LP_float = fixedToFloat( st->old_enr_LP, Q_old_enr_LP ); st->enr_old = fixedToFloat( st->enr_old_fx, 0 ); Loading Loading @@ -1823,9 +1823,9 @@ void fixed_to_float_stereo_tcx_core_dec( { st->mem_MA[p] = (float) st->mem_MA_fx[p] / 2.56f; st->mem_AR[p] = (float) st->mem_AR_fx[p] / 2.56f; st->lsf_adaptive_mean[p] = (float) st->lsf_adaptive_mean_fx[p] / ( 2.56f / st->scale ); st->lsfoldbfi1[p] = (float) st->lsfoldbfi1_fx[p] / ( 2.56f / st->scale ); st->lsfoldbfi0[p] = (float) st->lsfoldbfi0_fx[p] / ( 2.56f / st->scale ); st->lsf_adaptive_mean[p] = (float) st->lsf_adaptive_mean_fx[p] / ( 2.56f / st->scale_lsfbfi); st->lsfoldbfi1[p] = (float) st->lsfoldbfi1_fx[p] / ( 2.56f / st->scale_lsfbfi); st->lsfoldbfi0[p] = (float) st->lsfoldbfi0_fx[p] / ( 2.56f / st->scale_lsfbfi); st->lsf_q_cng_float[p] = (float) st->lsf_q_cng[p] / ( 2.56f / st->scale ); st->old_lsf_q_cng_float[p] = (float) st->old_lsf_q_cng[p] / ( 2.56f / st->scale ); } Loading lib_com/ivas_masa_com.c +23 −20 Original line number Diff line number Diff line Loading @@ -793,6 +793,7 @@ void masa_sample_rate_band_correction_fx( FOR( band = 1; band < config->numCodingBands + 1; band++ ) { highBand = band_mapping[band]; move16(); IF( GE_16( highBand, (Word16) maxBand ) ) { Loading @@ -813,6 +814,7 @@ void masa_sample_rate_band_correction_fx( } band_mapping[band] = maxBand; move16(); BREAK; } Loading Loading @@ -880,6 +882,7 @@ void masa_sample_rate_band_correction_fx( FOR( band = hQMetaData->numCodingBands; band < MASA_FREQUENCY_BANDS; band++ ) { hExtOutMeta->directionIndex[0][sf][band] = SPH_IDX_FRONT; move16(); hExtOutMeta->directToTotalRatio[0][sf][band] = 0u; hExtOutMeta->spreadCoherence[0][sf][band] = 0u; Loading lib_com/ivas_prot.h +8 −11 Original line number Diff line number Diff line Loading @@ -3702,6 +3702,7 @@ void ivas_qmetadata_to_dirac( int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); #endif #ifndef IVAS_FLOAT_FIXED ivas_error ivas_qmetadata_open( IVAS_QMETADATA_HANDLE *hQMetaData /* i/o: q_metadata handle */ ); Loading @@ -3716,6 +3717,8 @@ ivas_error ivas_qmetadata_allocate_memory( void ivas_qmetadata_close( IVAS_QMETADATA_HANDLE *hQMetaData /* i/o: q_metadata handle */ ); #endif void restore_metadata_buffer( BSTR_ENC_HANDLE hMetaData, Loading @@ -3735,11 +3738,6 @@ void ivas_qmetadata_azimuth_elevation_to_direction_vector( const float el, /* i : elevation */ float *dv /* o : direction vector */ ); void ivas_qmetadata_azimuth_elevation_to_direction_vector_fx( const Word32 az, /* i : azimuth */ const Word32 el, /* i : elevation */ Word32 *dv /* o : direction vector */ ); void ivas_qmetadata_direction_vector_to_azimuth_elevation( const float *dv, /* i : direction vector */ Loading @@ -3747,12 +3745,6 @@ void ivas_qmetadata_direction_vector_to_azimuth_elevation( float *el /* o : elevation */ ); void ivas_qmetadata_direction_vector_to_azimuth_elevation_fx( const Word32 *dv, /* i : direction vector */ const Word32 div_q, Word32 *az, /* o : azimuth */ Word32 *el /* o : elevation */ ); ivas_error only_reduce_bits_direction( int16_t *reduce_bits_out, IVAS_QDIRECTION *q_direction, /* i/o: quantized direction structure */ Loading Loading @@ -3904,12 +3896,14 @@ void deindex_spherical_component( const MC_LS_SETUP mc_format /* i : channel format if in MC-mode */ ); #ifndef IVAS_FLOAT_FIXED void small_reduction_direction( IVAS_QDIRECTION *q_direction, /* i/o: quantized direction structure */ uint16_t bits_dir[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES], /* i : bit allocation in tF tiles */ const int16_t raw_flag[MASA_MAXIMUM_CODING_SUBBANDS], /* i : raw/EC coding indicator for each subband*/ int16_t *diff /* i/o: number of bits that need to be reduced */ ); #endif uint16_t ivas_qmetadata_reorder_generic( const int16_t signed_value Loading @@ -3921,6 +3915,8 @@ int16_t ivas_qmetadata_dereorder_generic( ); #endif #ifndef IVAS_FLOAT_FIXED /*! r: projected azimuth index */ int16_t ivas_dirac_project_azimuth_index( const int16_t az_idx, /* i : azimuth index */ Loading @@ -3941,6 +3937,7 @@ int16_t ivas_chan_project_elevation_index( const int16_t el_alph, /* i : number of elevation symbols */ const int16_t el_alph_proj /* i : size of projected alphabet */ ); #endif void ivas_dirac_param_est_enc( DIRAC_ENC_HANDLE hDirAC, Loading Loading
lib_com/basop_util.c +5 −0 Original line number Diff line number Diff line Loading @@ -1276,7 +1276,12 @@ Word16 getCosWord16R2( /* The negation cannot overflow, sine is in range [0x0..0x7FFF] */ BASOP_SATURATE_WARNING_OFF sine = negate( sine ); /* Saturation has been included based on the recommendation from the PC group */ #ifdef BASOP_NOGLOB result = msu_r_sat( L_mult( sine, residual ), cosine, -32768 ); #else result = msu_r( L_mult( sine, residual ), cosine, -32768 ); #endif BASOP_SATURATE_WARNING_ON return result; Loading
lib_com/cnst.h +9 −3 Original line number Diff line number Diff line Loading @@ -2068,6 +2068,7 @@ typedef enum _DCTTYPE #define ENV_ADJ_INCL 5 /* Inclination for mapping between attenuation region width and attenuation limit */ #define ENV_SMOOTH_FAC 0.1f /* Smoothing factor for envelope stability measure */ #define ENV_SMOOTH_FAC_FX ((Word16)0x0CCD) #define L_STAB_TBL 10 /* Number of elements in stability transition table */ #define LUMPED_ENV_SMOOTH_FAC_FX ((Word16)10089) /* Q19 (no typo error), 0.1/sqrt(27) */ #define CMPLMNT_ENV_SMOOTH_FAC_FX ((Word16)29491) /* Q15 0.9 */ Loading @@ -2089,6 +2090,11 @@ typedef enum _DCTTYPE #define STAB_FAC_EST1 1.093f /* stab_fac HQ estimation coefficient 1 */ #define STAB_FAC_EST2 (-5.84e-05f) /* stab_fac HQ estimation coefficient 2, including Q12 scaling */ #define STAB_FAC_EST3 0.125f /* stab_fac HQ estimation coefficient 3 */ #ifdef IVAS_FLOAT_FIXED #define STAB_FAC_EST1_FX ((Word32)0x45F3B646) /* stab_fac HQ estimation coefficient 1 */ #define STAB_FAC_EST2_FX ((Word32)0xFFFF0B0D) /* stab_fac HQ estimation coefficient 2, including Q12 scaling */ #define STAB_FAC_EST3_FX ((Word32)0x10000000) /* stab_fac HQ estimation coefficient 3 */ #endif // IVAS_FLOAT_FIXED #define ATT_LIM_HANGOVER 150 /* Number of hangover frames for disabling stability dependent attenuation */ #define DELTA_TH 5.0f /* Delta energy threshold for transient detection for envelope stability */ Loading
lib_com/float_to_fix_ops.c +10 −10 Original line number Diff line number Diff line Loading @@ -1047,9 +1047,9 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( FOR( i = 0; i < M; i++ ) { st->lsf_cng[i] = (Word16) floatToFixed( st->lsf_cng_float[i] * 2.56f / st->scale, 0 ); st->lsf_adaptive_mean_fx[i] = (Word16) floatToFixed( st->lsf_adaptive_mean[i] * 2.56f / st->scale, 0 ); st->lsfoldbfi0_fx[i] = (Word16) floatToFixed( st->lsfoldbfi0[i] * 2.56f / st->scale, 0 ); st->lsfoldbfi1_fx[i] = (Word16) floatToFixed( st->lsfoldbfi1[i] * 2.56f / st->scale, 0 ); st->lsf_adaptive_mean_fx[i] = (Word16) floatToFixed( st->lsf_adaptive_mean[i] * 2.56f / st->scale_lsfbfi, 0 ); st->lsfoldbfi0_fx[i] = (Word16) floatToFixed( st->lsfoldbfi0[i] * 2.56f / st->scale_lsfbfi, 0); st->lsfoldbfi1_fx[i] = (Word16)floatToFixed(st->lsfoldbfi1[i] * 2.56f / st->scale_lsfbfi, 0 ); } IF( st->hTcxLtpDec ) { Loading Loading @@ -1178,7 +1178,7 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( } for ( i = 0; i < M; i++ ) { st->lsf_adaptive_mean_fx[i] = (Word16) ( st->lsf_adaptive_mean[i] * ( 2.56f / st->scale ) ); st->lsf_adaptive_mean_fx[i] = (Word16) ( st->lsf_adaptive_mean[i] * ( 2.56f / st->scale_lsfbfi) ); } st->stab_fac_fx = (Word16) floatToFixed( st->stab_fac, Q15 ); Loading Loading @@ -1660,9 +1660,9 @@ void stereo_tcx_dec_mode_switch_reconf_To_fixed_2( // st->lsf_adaptive_mean[i] = fixedToFloat( L_mult( st->lsf_adaptive_mean_fx[i], 100 ), 9 ); // st->lsfoldbfi0[i] = fixedToFloat( L_mult( st->lsfoldbfi0_fx[i], 100 ), 9 ); // st->lsfoldbfi1[i] = fixedToFloat( L_mult( st->lsfoldbfi1_fx[i], 100 ), 9 ); st->lsf_adaptive_mean[i] = (float) st->lsf_adaptive_mean_fx[i] / ( 2.56f / st->scale ); st->lsfoldbfi1[i] = (float) st->lsfoldbfi1_fx[i] / ( 2.56f / st->scale ); st->lsfoldbfi0[i] = (float) st->lsfoldbfi0_fx[i] / ( 2.56f / st->scale ); st->lsf_adaptive_mean[i] = (float) st->lsf_adaptive_mean_fx[i] / ( 2.56f / st->scale_lsfbfi); st->lsfoldbfi1[i] = (float)st->lsfoldbfi1_fx[i] / (2.56f / st->scale_lsfbfi); st->lsfoldbfi0[i] = (float)st->lsfoldbfi0_fx[i] / (2.56f / st->scale_lsfbfi); } st->old_enr_LP_float = fixedToFloat( st->old_enr_LP, Q_old_enr_LP ); st->enr_old = fixedToFloat( st->enr_old_fx, 0 ); Loading Loading @@ -1823,9 +1823,9 @@ void fixed_to_float_stereo_tcx_core_dec( { st->mem_MA[p] = (float) st->mem_MA_fx[p] / 2.56f; st->mem_AR[p] = (float) st->mem_AR_fx[p] / 2.56f; st->lsf_adaptive_mean[p] = (float) st->lsf_adaptive_mean_fx[p] / ( 2.56f / st->scale ); st->lsfoldbfi1[p] = (float) st->lsfoldbfi1_fx[p] / ( 2.56f / st->scale ); st->lsfoldbfi0[p] = (float) st->lsfoldbfi0_fx[p] / ( 2.56f / st->scale ); st->lsf_adaptive_mean[p] = (float) st->lsf_adaptive_mean_fx[p] / ( 2.56f / st->scale_lsfbfi); st->lsfoldbfi1[p] = (float) st->lsfoldbfi1_fx[p] / ( 2.56f / st->scale_lsfbfi); st->lsfoldbfi0[p] = (float) st->lsfoldbfi0_fx[p] / ( 2.56f / st->scale_lsfbfi); st->lsf_q_cng_float[p] = (float) st->lsf_q_cng[p] / ( 2.56f / st->scale ); st->old_lsf_q_cng_float[p] = (float) st->old_lsf_q_cng[p] / ( 2.56f / st->scale ); } Loading
lib_com/ivas_masa_com.c +23 −20 Original line number Diff line number Diff line Loading @@ -793,6 +793,7 @@ void masa_sample_rate_band_correction_fx( FOR( band = 1; band < config->numCodingBands + 1; band++ ) { highBand = band_mapping[band]; move16(); IF( GE_16( highBand, (Word16) maxBand ) ) { Loading @@ -813,6 +814,7 @@ void masa_sample_rate_band_correction_fx( } band_mapping[band] = maxBand; move16(); BREAK; } Loading Loading @@ -880,6 +882,7 @@ void masa_sample_rate_band_correction_fx( FOR( band = hQMetaData->numCodingBands; band < MASA_FREQUENCY_BANDS; band++ ) { hExtOutMeta->directionIndex[0][sf][band] = SPH_IDX_FRONT; move16(); hExtOutMeta->directToTotalRatio[0][sf][band] = 0u; hExtOutMeta->spreadCoherence[0][sf][band] = 0u; Loading
lib_com/ivas_prot.h +8 −11 Original line number Diff line number Diff line Loading @@ -3702,6 +3702,7 @@ void ivas_qmetadata_to_dirac( int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); #endif #ifndef IVAS_FLOAT_FIXED ivas_error ivas_qmetadata_open( IVAS_QMETADATA_HANDLE *hQMetaData /* i/o: q_metadata handle */ ); Loading @@ -3716,6 +3717,8 @@ ivas_error ivas_qmetadata_allocate_memory( void ivas_qmetadata_close( IVAS_QMETADATA_HANDLE *hQMetaData /* i/o: q_metadata handle */ ); #endif void restore_metadata_buffer( BSTR_ENC_HANDLE hMetaData, Loading @@ -3735,11 +3738,6 @@ void ivas_qmetadata_azimuth_elevation_to_direction_vector( const float el, /* i : elevation */ float *dv /* o : direction vector */ ); void ivas_qmetadata_azimuth_elevation_to_direction_vector_fx( const Word32 az, /* i : azimuth */ const Word32 el, /* i : elevation */ Word32 *dv /* o : direction vector */ ); void ivas_qmetadata_direction_vector_to_azimuth_elevation( const float *dv, /* i : direction vector */ Loading @@ -3747,12 +3745,6 @@ void ivas_qmetadata_direction_vector_to_azimuth_elevation( float *el /* o : elevation */ ); void ivas_qmetadata_direction_vector_to_azimuth_elevation_fx( const Word32 *dv, /* i : direction vector */ const Word32 div_q, Word32 *az, /* o : azimuth */ Word32 *el /* o : elevation */ ); ivas_error only_reduce_bits_direction( int16_t *reduce_bits_out, IVAS_QDIRECTION *q_direction, /* i/o: quantized direction structure */ Loading Loading @@ -3904,12 +3896,14 @@ void deindex_spherical_component( const MC_LS_SETUP mc_format /* i : channel format if in MC-mode */ ); #ifndef IVAS_FLOAT_FIXED void small_reduction_direction( IVAS_QDIRECTION *q_direction, /* i/o: quantized direction structure */ uint16_t bits_dir[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES], /* i : bit allocation in tF tiles */ const int16_t raw_flag[MASA_MAXIMUM_CODING_SUBBANDS], /* i : raw/EC coding indicator for each subband*/ int16_t *diff /* i/o: number of bits that need to be reduced */ ); #endif uint16_t ivas_qmetadata_reorder_generic( const int16_t signed_value Loading @@ -3921,6 +3915,8 @@ int16_t ivas_qmetadata_dereorder_generic( ); #endif #ifndef IVAS_FLOAT_FIXED /*! r: projected azimuth index */ int16_t ivas_dirac_project_azimuth_index( const int16_t az_idx, /* i : azimuth index */ Loading @@ -3941,6 +3937,7 @@ int16_t ivas_chan_project_elevation_index( const int16_t el_alph, /* i : number of elevation symbols */ const int16_t el_alph_proj /* i : size of projected alphabet */ ); #endif void ivas_dirac_param_est_enc( DIRAC_ENC_HANDLE hDirAC, Loading