Loading lib_com/ivas_cnst.h +10 −1 Original line number Diff line number Diff line Loading @@ -334,11 +334,20 @@ typedef enum #define PARAM_ISM_MAX_CHAN 16 #define PARAM_ISM_HYS_BUF_SIZE 10 /* ISM DTX */ #ifdef DISCRETE_ISM_DTX_CNG #define ISM_DTX_COH_SCA_BITS 4 #endif #ifdef PARAM_ISM_DTX_CNG #define PARAM_ISM_DTX_COH_SCA_BITS 4 #define PARAM_ISM_DTX_COH_SCA_BITS 4 // VE!!!!! to be removed #define PARAM_ISM_DTX_AZI_BITS 5 #define PARAM_ISM_DTX_ELE_BITS 4 #endif #ifdef DISCRETE_ISM_DTX_CNG #define ISM_DTX_ENER_BITS 4 #define ISM_DTX_COH_SCA_BITS 4 #endif typedef enum { Loading lib_com/ivas_ism_config.c +68 −0 Original line number Diff line number Diff line Loading @@ -490,3 +490,71 @@ ISM_MODE ivas_ism_mode_select( return ism_mode; } #ifdef DISCRETE_ISM_DTX_CNG /*-------------------------------------------------------------------* * update_last_metadata() * * Store last metadata values *-------------------------------------------------------------------*/ void update_last_metadata( const int16_t num_obj, /* i : number of objects */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ const int16_t updt_flag[] /* i : last metadata update flag */ ) { int16_t ch; for ( ch = 0; ch < num_obj; ch++ ) { if ( updt_flag[ch] == 1 ) { hIsmMeta[ch]->last_azimuth = hIsmMeta[ch]->azimuth; hIsmMeta[ch]->last_elevation = hIsmMeta[ch]->elevation; } } return; } /*----------------------------------------------------------------* * ivas_get_ism_sid_quan_bitbudget() * * Set quantization bits based on the number of coded objects *----------------------------------------------------------------*/ /*! r: low resolution flag */ int16_t ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ int16_t *nBits_elevation, /* o : number of Q bits for elevation */ int16_t *nBits_ener, /* o : number of Q bits for energy */ int16_t *nBits_coh, /* o : number of Q bits for coherence */ int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ) { int16_t low_res_q; low_res_q = 0; *nBits_azimuth = ISM_AZIMUTH_NBITS; *nBits_elevation = ISM_ELEVATION_NBITS; *nBits_ener = ISM_DTX_ENER_BITS; *nBits_coh = ISM_DTX_COH_SCA_BITS; *nBits_sce_id = 1; if ( num_obj >= 3 ) { low_res_q = 1; *nBits_azimuth = PARAM_ISM_DTX_AZI_BITS; *nBits_elevation = PARAM_ISM_DTX_ELE_BITS; *nBits_ener = ISM_DTX_ENER_BITS - 1; *nBits_coh = ISM_DTX_COH_SCA_BITS - 1; *nBits_sce_id = 2; } return low_res_q; } #endif lib_com/ivas_prot.h +89 −25 Original line number Diff line number Diff line Loading @@ -878,6 +878,9 @@ ivas_error ivas_ism_metadata_dec( const int16_t bfi, /* i : bfi flag */ int16_t nb_bits_metadata[], /* o : number of metadata bits */ ISM_MODE ism_mode, /* i : ISM mode */ #ifdef DISCRETE_ISM_DTX_CNG int16_t *ism_dtx_hangover_cnt, /* i/o: DTX hangover counter */ #endif const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ ); Loading Loading @@ -954,11 +957,45 @@ ivas_error ivas_ism_dtx_open( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); #ifdef DISCRETE_ISM_DTX_CNG /*! r: indication of DTX frame */ int16_t ivas_ism_dtx_enc_COMMON( ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ const int16_t num_obj, /* i : number of objects */ const int16_t nchan_transport, /* i : number of transport channels */ int16_t vad_flag[MAX_NUM_OBJECTS], /* i : VAD flag */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ int16_t md_diff_flag[], /* o : metadata differential flag */ int16_t *sid_flag /* o : indication of SID frame */ ); #endif /*! r: indication of DTX frame */ int16_t ivas_ism_dtx_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ int16_t *sid_flag /* o : indication of SID frame */ ); ivas_error ivas_ism_dtx_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ int16_t *nb_bits_metadata /* o : number of metadata bits */ ); #ifdef DISCRETE_ISM_DTX_CNG void ivas_ism_metadata_sid_enc( ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ const int16_t flag_noisy_speech, /* i : noisy speech flag */ const int16_t num_obj, /* i : number of objects */ const int16_t nchan_transport, /* i : number of transport channels */ const ISM_MODE ism_mode, /* i : ISM mode */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ const int16_t sid_flag, /* i : indication of SID frame */ const int16_t md_diff_flag[], /* i : metadata differental flag */ BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ int16_t nb_bits_metadata[] /* o : number of metadata bits */ ); #endif // VE!!!!! void ivas_param_ism_metadata_dtx_enc( BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i : ISM metadata handles */ Loading @@ -966,6 +1003,21 @@ void ivas_param_ism_metadata_dtx_enc( PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ ); #ifdef DISCRETE_ISM_DTX_CNG ivas_error ivas_ism_metadata_sid_dec( SCE_DEC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ const int32_t ism_total_brate, /* i : ISms total bitrate */ const int16_t bfi, /* i : bfi flag */ const int16_t num_obj, /* i : number of objects */ const int16_t nchan_transport, /* i : number of transport channels */ const ISM_MODE ism_mode, /* i : ISM mode */ int16_t *flag_noisy_speech, /* o : noisy speech flag */ int16_t *sce_id_dtx, /* o : SCE DTX ID */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ int16_t nb_bits_metadata[] /* o : number of metadata bits */ ); #endif // VE!!!!! void ivas_param_ism_metadata_dtx_dec( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); Loading @@ -981,18 +1033,30 @@ void ivas_param_ism_compute_noisy_speech_flag( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); /*! r: indication of DTX frame */ int16_t ivas_ism_dtx_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ int16_t *sid_flag /* o : indication of SID frame */ ); void ivas_ism_coh_estim_dtx_enc( ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ const int16_t nchan_transport, /* i : number of transport channels */ const int16_t input_frame /* i : input frame length */ ); #ifdef DISCRETE_ISM_DTX_CNG void update_last_metadata( const int16_t num_obj, /* i : number of objects */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ const int16_t updt_flag[] /* i : last metadata update flag */ ); /*! r: low resolution flag */ int16_t ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ int16_t *nBits_elevation, /* o : number of Q bits for elevation */ int16_t *nBits_ener, /* o : number of Q bits for energy */ int16_t *nBits_coh, /* o : number of Q bits for coherence */ int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ); #endif #endif /*----------------------------------------------------------------------------------* Loading lib_com/ivas_stat_com.h +8 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,14 @@ typedef struct int16_t last_elevation_idx; /* last frame index of coded elevation */ int16_t elevation_diff_cnt; /* FEC counter of consecutive differentially elevation coded frames */ #ifdef DISCRETE_ISM_DTX_CNG float last_azimuth; /* last Q azimuth value */ float last_elevation; /* last Q elevation value */ float last_true_azimuth; /* last true Q azimuth value */ float last_true_elevation; /* last true Q elevation value */ #endif } ISM_METADATA_FRAME, *ISM_METADATA_HANDLE; Loading lib_com/options.h +4 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,10 @@ #define SMOOTH_WITH_TRANS_DET #endif #define DISCRETE_ISM_DTX_CNG /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif Loading
lib_com/ivas_cnst.h +10 −1 Original line number Diff line number Diff line Loading @@ -334,11 +334,20 @@ typedef enum #define PARAM_ISM_MAX_CHAN 16 #define PARAM_ISM_HYS_BUF_SIZE 10 /* ISM DTX */ #ifdef DISCRETE_ISM_DTX_CNG #define ISM_DTX_COH_SCA_BITS 4 #endif #ifdef PARAM_ISM_DTX_CNG #define PARAM_ISM_DTX_COH_SCA_BITS 4 #define PARAM_ISM_DTX_COH_SCA_BITS 4 // VE!!!!! to be removed #define PARAM_ISM_DTX_AZI_BITS 5 #define PARAM_ISM_DTX_ELE_BITS 4 #endif #ifdef DISCRETE_ISM_DTX_CNG #define ISM_DTX_ENER_BITS 4 #define ISM_DTX_COH_SCA_BITS 4 #endif typedef enum { Loading
lib_com/ivas_ism_config.c +68 −0 Original line number Diff line number Diff line Loading @@ -490,3 +490,71 @@ ISM_MODE ivas_ism_mode_select( return ism_mode; } #ifdef DISCRETE_ISM_DTX_CNG /*-------------------------------------------------------------------* * update_last_metadata() * * Store last metadata values *-------------------------------------------------------------------*/ void update_last_metadata( const int16_t num_obj, /* i : number of objects */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ const int16_t updt_flag[] /* i : last metadata update flag */ ) { int16_t ch; for ( ch = 0; ch < num_obj; ch++ ) { if ( updt_flag[ch] == 1 ) { hIsmMeta[ch]->last_azimuth = hIsmMeta[ch]->azimuth; hIsmMeta[ch]->last_elevation = hIsmMeta[ch]->elevation; } } return; } /*----------------------------------------------------------------* * ivas_get_ism_sid_quan_bitbudget() * * Set quantization bits based on the number of coded objects *----------------------------------------------------------------*/ /*! r: low resolution flag */ int16_t ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ int16_t *nBits_elevation, /* o : number of Q bits for elevation */ int16_t *nBits_ener, /* o : number of Q bits for energy */ int16_t *nBits_coh, /* o : number of Q bits for coherence */ int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ) { int16_t low_res_q; low_res_q = 0; *nBits_azimuth = ISM_AZIMUTH_NBITS; *nBits_elevation = ISM_ELEVATION_NBITS; *nBits_ener = ISM_DTX_ENER_BITS; *nBits_coh = ISM_DTX_COH_SCA_BITS; *nBits_sce_id = 1; if ( num_obj >= 3 ) { low_res_q = 1; *nBits_azimuth = PARAM_ISM_DTX_AZI_BITS; *nBits_elevation = PARAM_ISM_DTX_ELE_BITS; *nBits_ener = ISM_DTX_ENER_BITS - 1; *nBits_coh = ISM_DTX_COH_SCA_BITS - 1; *nBits_sce_id = 2; } return low_res_q; } #endif
lib_com/ivas_prot.h +89 −25 Original line number Diff line number Diff line Loading @@ -878,6 +878,9 @@ ivas_error ivas_ism_metadata_dec( const int16_t bfi, /* i : bfi flag */ int16_t nb_bits_metadata[], /* o : number of metadata bits */ ISM_MODE ism_mode, /* i : ISM mode */ #ifdef DISCRETE_ISM_DTX_CNG int16_t *ism_dtx_hangover_cnt, /* i/o: DTX hangover counter */ #endif const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ ); Loading Loading @@ -954,11 +957,45 @@ ivas_error ivas_ism_dtx_open( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); #ifdef DISCRETE_ISM_DTX_CNG /*! r: indication of DTX frame */ int16_t ivas_ism_dtx_enc_COMMON( ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ const int16_t num_obj, /* i : number of objects */ const int16_t nchan_transport, /* i : number of transport channels */ int16_t vad_flag[MAX_NUM_OBJECTS], /* i : VAD flag */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ int16_t md_diff_flag[], /* o : metadata differential flag */ int16_t *sid_flag /* o : indication of SID frame */ ); #endif /*! r: indication of DTX frame */ int16_t ivas_ism_dtx_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ int16_t *sid_flag /* o : indication of SID frame */ ); ivas_error ivas_ism_dtx_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ int16_t *nb_bits_metadata /* o : number of metadata bits */ ); #ifdef DISCRETE_ISM_DTX_CNG void ivas_ism_metadata_sid_enc( ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ const int16_t flag_noisy_speech, /* i : noisy speech flag */ const int16_t num_obj, /* i : number of objects */ const int16_t nchan_transport, /* i : number of transport channels */ const ISM_MODE ism_mode, /* i : ISM mode */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ const int16_t sid_flag, /* i : indication of SID frame */ const int16_t md_diff_flag[], /* i : metadata differental flag */ BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ int16_t nb_bits_metadata[] /* o : number of metadata bits */ ); #endif // VE!!!!! void ivas_param_ism_metadata_dtx_enc( BSTR_ENC_HANDLE hBstr, /* i/o: bitstream handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i : ISM metadata handles */ Loading @@ -966,6 +1003,21 @@ void ivas_param_ism_metadata_dtx_enc( PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ ); #ifdef DISCRETE_ISM_DTX_CNG ivas_error ivas_ism_metadata_sid_dec( SCE_DEC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ const int32_t ism_total_brate, /* i : ISms total bitrate */ const int16_t bfi, /* i : bfi flag */ const int16_t num_obj, /* i : number of objects */ const int16_t nchan_transport, /* i : number of transport channels */ const ISM_MODE ism_mode, /* i : ISM mode */ int16_t *flag_noisy_speech, /* o : noisy speech flag */ int16_t *sce_id_dtx, /* o : SCE DTX ID */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ int16_t nb_bits_metadata[] /* o : number of metadata bits */ ); #endif // VE!!!!! void ivas_param_ism_metadata_dtx_dec( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); Loading @@ -981,18 +1033,30 @@ void ivas_param_ism_compute_noisy_speech_flag( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); /*! r: indication of DTX frame */ int16_t ivas_ism_dtx_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ int16_t *sid_flag /* o : indication of SID frame */ ); void ivas_ism_coh_estim_dtx_enc( ISM_DTX_HANDLE hISMDTX, /* i/o: ISM DTX handle */ SCE_ENC_HANDLE hSCE[MAX_SCE], /* i/o: SCE encoder structure */ const int16_t nchan_transport, /* i : number of transport channels */ const int16_t input_frame /* i : input frame length */ ); #ifdef DISCRETE_ISM_DTX_CNG void update_last_metadata( const int16_t num_obj, /* i : number of objects */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ const int16_t updt_flag[] /* i : last metadata update flag */ ); /*! r: low resolution flag */ int16_t ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ int16_t *nBits_elevation, /* o : number of Q bits for elevation */ int16_t *nBits_ener, /* o : number of Q bits for energy */ int16_t *nBits_coh, /* o : number of Q bits for coherence */ int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ); #endif #endif /*----------------------------------------------------------------------------------* Loading
lib_com/ivas_stat_com.h +8 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,14 @@ typedef struct int16_t last_elevation_idx; /* last frame index of coded elevation */ int16_t elevation_diff_cnt; /* FEC counter of consecutive differentially elevation coded frames */ #ifdef DISCRETE_ISM_DTX_CNG float last_azimuth; /* last Q azimuth value */ float last_elevation; /* last Q elevation value */ float last_true_azimuth; /* last true Q azimuth value */ float last_true_elevation; /* last true Q elevation value */ #endif } ISM_METADATA_FRAME, *ISM_METADATA_HANDLE; Loading
lib_com/options.h +4 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,10 @@ #define SMOOTH_WITH_TRANS_DET #endif #define DISCRETE_ISM_DTX_CNG /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif