Loading lib_com/cnst.h +13 −1 Original line number Diff line number Diff line Loading @@ -156,11 +156,20 @@ #define MIN16B ( -32768 ) #define MAX16B_FLT 32767.0f #define MIN16B_FLT ( -32768.0f ) #ifdef IVAS_FLOAT_FIXED #define MIN16B_FLT_FX -32768 //Q0 #define MIN16B_FLT_FX_IN_Q11 -67108864//Q11 #define MIN16B_FLT_FX_IN_Q15 -1073741824//Q15 #endif #define PCM16_TO_FLT_FAC 32768.0f #ifdef IVAS_FLOAT_FIXED #define PCM16_TO_FLT_FAC_FX 32768 #define PCM16_TO_FLT_FAC_FX 32768 //Q0 #endif // IVAS_FLOAT_FIXED #define MDFT_NORM_SCALING ( 1.0f / PCM16_TO_FLT_FAC ) #ifdef IVAS_FLOAT_FIXED #define MDFT_NORM_SCALING_FX 65536 //Q31 #define LOG2_MDFT_NORM_SCALING_FX -503316448 //Q25 #endif #define MAX_FRAME_COUNTER 200 #define MAX_BITS_PER_FRAME 10240 /* Bits per frame for max. bitrate 512kbps, == IVAS_MAX_BITS_PER_FRAME */ Loading Loading @@ -734,6 +743,9 @@ enum #define L_HP20_MEM 4 /* HP20 filter memory length */ #define CLDFB_NO_CHANNELS_MAX 60 /* CLDFB resampling - max number of CLDFB channels, == IVAS_CLDFB_NO_CHANNELS_MAX */ #ifdef IVAS_FLOAT_FIXED #define CLDFB_NO_CHANNELS_MAX_FX 30720 /*Q9*/ #endif #define CLDFB_NO_COL_MAX 16 /* CLDFB resampling - max number of CLDFB col., == IVAS_CLDFB_NO_COL_MAX */ #define CLDFB_NO_COL_MAX_SWITCH 6 /* CLDFB resampling - max number of CLDFB col. for switching */ #define CLDFB_NO_COL_MAX_SWITCH_BFI 10 /* CLDFB resampling - max number of CLDFB col. for switching, BFI */ Loading lib_com/common_api_types.h +3 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,9 @@ typedef struct _IVAS_RENDER_CONFIG { IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics; float directivity[IVAS_MAX_NUM_OBJECTS * 3]; #ifdef IVAS_FLOAT_FIXED Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15} #endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; #endif /* COMMON_API_TYPES_H */ lib_com/ivas_ism_com.c +53 −4 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include "ivas_prot_fx.h" #include "prot_fx1.h" #define IVAS_FLOAT_FIXED_TO_BE_REMOVED /*-----------------------------------------------------------------------* * Local constants Loading Loading @@ -734,30 +735,51 @@ ivas_error ivas_ism_config_fx( * Reset ISM metadata parameters *-------------------------------------------------------------------*/ #ifdef IVAS_FLOAT_FIXED void ivas_ism_reset_metadata( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { #ifdef IVAS_FLOAT_FIXED hIsmMeta->azimuth_fx = 0; move32(); hIsmMeta->elevation_fx = 0; move32(); hIsmMeta->yaw_fx = 0; move32(); hIsmMeta->pitch_fx = 0; move32(); hIsmMeta->radius_fx = 1 << 9; #endif // To be removed later ///////////////////// move16(); #ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED hIsmMeta->azimuth = 0.0f; hIsmMeta->elevation = 0.0f; hIsmMeta->yaw = 0.0f; hIsmMeta->pitch = 0.0f; hIsmMeta->radius = 1.0f; //////////////////////////////////////////// #endif hIsmMeta->ism_metadata_flag = 0; move16(); hIsmMeta->non_diegetic_flag = 0; move16(); return; } #else void ivas_ism_reset_metadata( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { hIsmMeta->azimuth = 0.0f; hIsmMeta->elevation = 0.0f; hIsmMeta->yaw = 0.0f; hIsmMeta->pitch = 0.0f; hIsmMeta->radius = 1.0f; hIsmMeta->ism_metadata_flag = 0; hIsmMeta->non_diegetic_flag = 0; return; } #endif /*-------------------------------------------------------------------* * ivas_ism_reset_metadata_API() Loading Loading @@ -1006,6 +1028,32 @@ ISM_MODE ivas_ism_mode_select( * Deallocate ISM metadata handles * ---------------------------------------------------------------*/ #ifdef IVAS_FLOAT_FIXED void ivas_ism_metadata_close( ISM_METADATA_HANDLE hIsmMetaData[], /* i/o: object metadata handles */ const Word16 first_idx /* i : index of first handle to deallocate */ ) { Word16 n; test(); IF( hIsmMetaData == NULL || *hIsmMetaData == NULL ) { return; } FOR( n = first_idx; n < MAX_NUM_OBJECTS; n++ ) { IF( hIsmMetaData[n] != NULL ) { free( hIsmMetaData[n] ); hIsmMetaData[n] = NULL; } } return; } #else void ivas_ism_metadata_close( ISM_METADATA_HANDLE hIsmMetaData[], /* i/o: object metadata handles */ const int16_t first_idx /* i : index of first handle to deallocate */ Loading @@ -1029,6 +1077,7 @@ void ivas_ism_metadata_close( return; } #endif /*-------------------------------------------------------------------* Loading lib_com/ivas_prot.h +41 −2 Original line number Diff line number Diff line Loading @@ -3554,12 +3554,22 @@ void ivas_mdct_core_tns_ns( const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0) */ ); #ifdef IVAS_FLOAT_FIXED void ivas_mct_core_dec( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE decoder structure */ const Word16 nCPE, /* i : number of CPEs */ Word32 *signal_out_fx[], Word16 q_x[MCT_MAX_CHANNELS] ); #else void ivas_mct_core_dec( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE decoder structure */ const int16_t nCPE, /* i : number of CPEs */ float *signal_out[] /* o : synthesis @internal_FS */ ); #endif void ivas_mct_dec_mct( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ Loading Loading @@ -4819,16 +4829,46 @@ int16_t ivas_agc_enc_get_flag( const int16_t nchan_transport /* i : number of transport channels */ ); #ifdef IVAS_FLOAT_FIXED Word16 ivas_agc_enc_get_flag_fx( const Word16 nchan_transport /* i : number of transport channels */ ); #endif ivas_error ivas_spar_agc_enc_open( ivas_agc_enc_state_t **hAgcEnc, /* i/o: AGC decoder handle */ const int32_t input_Fs, /* i : input sampling rate */ const int16_t nchan_inp /* i : number of input channels */ ); #ifdef IVAS_FLOAT_FIXED ivas_error ivas_spar_agc_enc_open_fx( ivas_agc_enc_state_t **hAgcEnc, /* i/o: SPAR AGC encoder handle */ const Word32 input_Fs, /* i : input sampling rate */ const Word16 nchan_inp /* i : number of input channels */ ); #endif void ivas_spar_agc_enc_close( ivas_agc_enc_state_t **hAgcEnc /* i/o: AGC encoder handle */ ); #ifdef IVAS_FLOAT_FIXED void ivas_spar_agc_enc_close_fx( ivas_agc_enc_state_t **hAgcEnc /* i/o: SPAR AGC encoder handle */ ); void ivas_agc_enc_process_fx( ivas_agc_enc_state_t *hAgcEnc, /* i/o: AGC encoder handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */ Word32 **ppPcm_in, /* i : input audio channels */ Word32 **ppPcm_out, /* o : output audio channels */ const Word16 n_channels, /* i : number of channels */ const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */ Word16 *q_ppPcm ); #endif void ivas_agc_enc_process( ivas_agc_enc_state_t *hAgcEnc, /* i/o: AGC encoder handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */ Loading Loading @@ -6642,8 +6682,7 @@ void ivas_omasa_modify_masa_energy_ratios( ivas_error ivas_td_binaural_open_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word16 * SrcInd, /*Temporarily used to store the updated value of SrcInd*/ Word16 *num_src, Word16 *directivity_fx Word16 *num_src ); #endif // IVAS_FLOAT_FIXED Loading lib_com/ivas_prot_fx.h +22 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,14 @@ ivas_error ivas_omasa_ism_metadata_dec_fx( const Word16 dirac_bs_md_write_idx, /* i : DirAC bitstream write index */ Word16 nb_bits_metadata[] /* o : number of ISM metadata bits */ ); ivas_error ivas_omasa_dec_config_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ UWord16 *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ Word16 Q_cldfbSynDec, /* i : Q factor for cldfb state */ Word16 *num_src, Word16 SrcInd[MAX_NUM_TDREND_CHANNELS], Word16 *data /* o : output synthesis signal */ ); #endif void ivas_omasa_modify_masa_energy_ratios_fx( Loading Loading @@ -564,6 +572,20 @@ void ivas_jbm_dec_get_adapted_subframes_fx( Word16 *nb_subframes /* i/o: number of subframes in the frame */ ); void ivas_jbm_dec_copy_tc_no_tsm_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle Q0 */ Word32 *tc_fx[], /* i : transport channels Q11 */ const Word16 output_frame /* i : output frame size Q0 */ ); void ivas_ism_param_dec_tc_gain_ajust_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const UWord16 nSamples, /* i : number of samples to be compensate */ const UWord16 nFadeLength, /* i : length of the crossfade in samples */ Word32 *transport_channels_f[], /* i : synthesized core-coder transport channels/DirAC output Q_tc*/ Word16 *Q_tc /* i/o : Q of input tc buffer */ ); #ifdef IVAS_FLOAT_FIXED /*! r: number of bits read */ Word16 read_GR0( Loading Loading
lib_com/cnst.h +13 −1 Original line number Diff line number Diff line Loading @@ -156,11 +156,20 @@ #define MIN16B ( -32768 ) #define MAX16B_FLT 32767.0f #define MIN16B_FLT ( -32768.0f ) #ifdef IVAS_FLOAT_FIXED #define MIN16B_FLT_FX -32768 //Q0 #define MIN16B_FLT_FX_IN_Q11 -67108864//Q11 #define MIN16B_FLT_FX_IN_Q15 -1073741824//Q15 #endif #define PCM16_TO_FLT_FAC 32768.0f #ifdef IVAS_FLOAT_FIXED #define PCM16_TO_FLT_FAC_FX 32768 #define PCM16_TO_FLT_FAC_FX 32768 //Q0 #endif // IVAS_FLOAT_FIXED #define MDFT_NORM_SCALING ( 1.0f / PCM16_TO_FLT_FAC ) #ifdef IVAS_FLOAT_FIXED #define MDFT_NORM_SCALING_FX 65536 //Q31 #define LOG2_MDFT_NORM_SCALING_FX -503316448 //Q25 #endif #define MAX_FRAME_COUNTER 200 #define MAX_BITS_PER_FRAME 10240 /* Bits per frame for max. bitrate 512kbps, == IVAS_MAX_BITS_PER_FRAME */ Loading Loading @@ -734,6 +743,9 @@ enum #define L_HP20_MEM 4 /* HP20 filter memory length */ #define CLDFB_NO_CHANNELS_MAX 60 /* CLDFB resampling - max number of CLDFB channels, == IVAS_CLDFB_NO_CHANNELS_MAX */ #ifdef IVAS_FLOAT_FIXED #define CLDFB_NO_CHANNELS_MAX_FX 30720 /*Q9*/ #endif #define CLDFB_NO_COL_MAX 16 /* CLDFB resampling - max number of CLDFB col., == IVAS_CLDFB_NO_COL_MAX */ #define CLDFB_NO_COL_MAX_SWITCH 6 /* CLDFB resampling - max number of CLDFB col. for switching */ #define CLDFB_NO_COL_MAX_SWITCH_BFI 10 /* CLDFB resampling - max number of CLDFB col. for switching, BFI */ Loading
lib_com/common_api_types.h +3 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,9 @@ typedef struct _IVAS_RENDER_CONFIG { IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics; float directivity[IVAS_MAX_NUM_OBJECTS * 3]; #ifdef IVAS_FLOAT_FIXED Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15} #endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; #endif /* COMMON_API_TYPES_H */
lib_com/ivas_ism_com.c +53 −4 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include "ivas_prot_fx.h" #include "prot_fx1.h" #define IVAS_FLOAT_FIXED_TO_BE_REMOVED /*-----------------------------------------------------------------------* * Local constants Loading Loading @@ -734,30 +735,51 @@ ivas_error ivas_ism_config_fx( * Reset ISM metadata parameters *-------------------------------------------------------------------*/ #ifdef IVAS_FLOAT_FIXED void ivas_ism_reset_metadata( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { #ifdef IVAS_FLOAT_FIXED hIsmMeta->azimuth_fx = 0; move32(); hIsmMeta->elevation_fx = 0; move32(); hIsmMeta->yaw_fx = 0; move32(); hIsmMeta->pitch_fx = 0; move32(); hIsmMeta->radius_fx = 1 << 9; #endif // To be removed later ///////////////////// move16(); #ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED hIsmMeta->azimuth = 0.0f; hIsmMeta->elevation = 0.0f; hIsmMeta->yaw = 0.0f; hIsmMeta->pitch = 0.0f; hIsmMeta->radius = 1.0f; //////////////////////////////////////////// #endif hIsmMeta->ism_metadata_flag = 0; move16(); hIsmMeta->non_diegetic_flag = 0; move16(); return; } #else void ivas_ism_reset_metadata( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { hIsmMeta->azimuth = 0.0f; hIsmMeta->elevation = 0.0f; hIsmMeta->yaw = 0.0f; hIsmMeta->pitch = 0.0f; hIsmMeta->radius = 1.0f; hIsmMeta->ism_metadata_flag = 0; hIsmMeta->non_diegetic_flag = 0; return; } #endif /*-------------------------------------------------------------------* * ivas_ism_reset_metadata_API() Loading Loading @@ -1006,6 +1028,32 @@ ISM_MODE ivas_ism_mode_select( * Deallocate ISM metadata handles * ---------------------------------------------------------------*/ #ifdef IVAS_FLOAT_FIXED void ivas_ism_metadata_close( ISM_METADATA_HANDLE hIsmMetaData[], /* i/o: object metadata handles */ const Word16 first_idx /* i : index of first handle to deallocate */ ) { Word16 n; test(); IF( hIsmMetaData == NULL || *hIsmMetaData == NULL ) { return; } FOR( n = first_idx; n < MAX_NUM_OBJECTS; n++ ) { IF( hIsmMetaData[n] != NULL ) { free( hIsmMetaData[n] ); hIsmMetaData[n] = NULL; } } return; } #else void ivas_ism_metadata_close( ISM_METADATA_HANDLE hIsmMetaData[], /* i/o: object metadata handles */ const int16_t first_idx /* i : index of first handle to deallocate */ Loading @@ -1029,6 +1077,7 @@ void ivas_ism_metadata_close( return; } #endif /*-------------------------------------------------------------------* Loading
lib_com/ivas_prot.h +41 −2 Original line number Diff line number Diff line Loading @@ -3554,12 +3554,22 @@ void ivas_mdct_core_tns_ns( const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0) */ ); #ifdef IVAS_FLOAT_FIXED void ivas_mct_core_dec( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE decoder structure */ const Word16 nCPE, /* i : number of CPEs */ Word32 *signal_out_fx[], Word16 q_x[MCT_MAX_CHANNELS] ); #else void ivas_mct_core_dec( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE decoder structure */ const int16_t nCPE, /* i : number of CPEs */ float *signal_out[] /* o : synthesis @internal_FS */ ); #endif void ivas_mct_dec_mct( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ Loading Loading @@ -4819,16 +4829,46 @@ int16_t ivas_agc_enc_get_flag( const int16_t nchan_transport /* i : number of transport channels */ ); #ifdef IVAS_FLOAT_FIXED Word16 ivas_agc_enc_get_flag_fx( const Word16 nchan_transport /* i : number of transport channels */ ); #endif ivas_error ivas_spar_agc_enc_open( ivas_agc_enc_state_t **hAgcEnc, /* i/o: AGC decoder handle */ const int32_t input_Fs, /* i : input sampling rate */ const int16_t nchan_inp /* i : number of input channels */ ); #ifdef IVAS_FLOAT_FIXED ivas_error ivas_spar_agc_enc_open_fx( ivas_agc_enc_state_t **hAgcEnc, /* i/o: SPAR AGC encoder handle */ const Word32 input_Fs, /* i : input sampling rate */ const Word16 nchan_inp /* i : number of input channels */ ); #endif void ivas_spar_agc_enc_close( ivas_agc_enc_state_t **hAgcEnc /* i/o: AGC encoder handle */ ); #ifdef IVAS_FLOAT_FIXED void ivas_spar_agc_enc_close_fx( ivas_agc_enc_state_t **hAgcEnc /* i/o: SPAR AGC encoder handle */ ); void ivas_agc_enc_process_fx( ivas_agc_enc_state_t *hAgcEnc, /* i/o: AGC encoder handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */ Word32 **ppPcm_in, /* i : input audio channels */ Word32 **ppPcm_out, /* o : output audio channels */ const Word16 n_channels, /* i : number of channels */ const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */ Word16 *q_ppPcm ); #endif void ivas_agc_enc_process( ivas_agc_enc_state_t *hAgcEnc, /* i/o: AGC encoder handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */ Loading Loading @@ -6642,8 +6682,7 @@ void ivas_omasa_modify_masa_energy_ratios( ivas_error ivas_td_binaural_open_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word16 * SrcInd, /*Temporarily used to store the updated value of SrcInd*/ Word16 *num_src, Word16 *directivity_fx Word16 *num_src ); #endif // IVAS_FLOAT_FIXED Loading
lib_com/ivas_prot_fx.h +22 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,14 @@ ivas_error ivas_omasa_ism_metadata_dec_fx( const Word16 dirac_bs_md_write_idx, /* i : DirAC bitstream write index */ Word16 nb_bits_metadata[] /* o : number of ISM metadata bits */ ); ivas_error ivas_omasa_dec_config_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ UWord16 *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ Word16 Q_cldfbSynDec, /* i : Q factor for cldfb state */ Word16 *num_src, Word16 SrcInd[MAX_NUM_TDREND_CHANNELS], Word16 *data /* o : output synthesis signal */ ); #endif void ivas_omasa_modify_masa_energy_ratios_fx( Loading Loading @@ -564,6 +572,20 @@ void ivas_jbm_dec_get_adapted_subframes_fx( Word16 *nb_subframes /* i/o: number of subframes in the frame */ ); void ivas_jbm_dec_copy_tc_no_tsm_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle Q0 */ Word32 *tc_fx[], /* i : transport channels Q11 */ const Word16 output_frame /* i : output frame size Q0 */ ); void ivas_ism_param_dec_tc_gain_ajust_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const UWord16 nSamples, /* i : number of samples to be compensate */ const UWord16 nFadeLength, /* i : length of the crossfade in samples */ Word32 *transport_channels_f[], /* i : synthesized core-coder transport channels/DirAC output Q_tc*/ Word16 *Q_tc /* i/o : Q of input tc buffer */ ); #ifdef IVAS_FLOAT_FIXED /*! r: number of bits read */ Word16 read_GR0( Loading