Loading lib_com/bits_alloc.c +2 −0 Original line number Diff line number Diff line Loading @@ -1428,6 +1428,7 @@ static int16_t allocate_unused( *--------------------------------------------------------------------*/ /*! r: ACELP16k flag */ #ifndef IVAS_FLOAT_FIXED int16_t set_ACELP_flag_IVAS( const int16_t element_mode, /* i : element mode */ const int32_t element_brate, /* i : element bitrate */ Loading Loading @@ -1485,3 +1486,4 @@ int16_t set_ACELP_flag_IVAS( return 0; } } #endif lib_com/bits_alloc_fx.c +73 −0 Original line number Diff line number Diff line Loading @@ -1700,4 +1700,77 @@ Word16 set_ACELP_flag( } } #endif /*-------------------------------------------------------------------* * set_ACELP_flag_IVAS() * * set ACELP@16kHz flag *--------------------------------------------------------------------*/ /*! r: ACELP16k flag */ #ifdef IVAS_FLOAT_FIXED Word16 set_ACELP_flag_IVAS( const Word16 element_mode, /* i : element mode */ const Word32 element_brate, /* i : element bitrate */ const Word32 total_brate, /* i : total bitrate per channel */ const Word16 idchan, /* i : Channel id */ const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const Word16 bwidth, /* i : audio bandwidth */ const Word16 cng_type /* i : CNG type */ ) { test(); test(); test(); test(); IF( EQ_16( element_mode, IVAS_CPE_DFT ) && EQ_16( idchan, 0 ) && LE_32( total_brate, SID_2k40 ) && EQ_16( bwidth, WB ) && EQ_16( cng_type, LP_CNG ) ) { return 1; } ELSE IF( EQ_16( element_mode, IVAS_CPE_TD ) ) { test(); test(); test(); IF( GE_32( element_brate, IVAS_24k4 ) && EQ_16( idchan, 0 ) && ( EQ_16( tdm_LRTD_flag, 0 ) || GT_32( element_brate, IVAS_24k4 ) ) ) { return 1; } ELSE { return 0; } } ELSE IF( EQ_16( element_mode, IVAS_CPE_DFT ) ) { IF( GE_32( element_brate, IVAS_24k4 ) ) { return 1; } ELSE { return 0; } } ELSE IF( EQ_16( element_mode, IVAS_SCE ) ) { IF( GE_32( element_brate, SCE_CORE_16k_LOW_LIMIT ) ) { return 1; } ELSE { return 0; } } ELSE IF( GE_32( total_brate, ACELP_16k_LOW_LIMIT ) ) /* EVS_MONO */ { return 1; } ELSE { return 0; } } #endif /*#endif IVAS_CODE*/ No newline at end of file lib_com/bitstream.c +3 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,9 @@ #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "wmc_auto.h" #ifdef IVAS_FLOAT_FIXED #include "ivas_prot_fx.h" #endif #define STEP_MAX_NUM_INDICES 100 /* increase the maximum number of allowed indices in the list by this amount */ Loading lib_com/gs_gains_fx.c +10 −10 Original line number Diff line number Diff line Loading @@ -439,7 +439,7 @@ static void GSC_gain_adj_ivas_fx( /*--------------------------------------------------------------------------*/ /* INPUT ARGUMENTS : */ /* _ (Word16) pvq_bits_fx : core used Q0 */ /* _ (Word16) coder_type_fx : coding type Q0 */ /* _ (Word16) coder_type : coding type Q0 */ /* _ (Word16) core_fx : core used Q0 */ /* _ (Word16) bwidth_fx : input signal bandwidth Q0 */ /*--------------------------------------------------------------------------*/ Loading @@ -457,7 +457,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ Word16 y_gainQ_fx[], /* o : quantized gain per band */ const Word32 core_brate_fx, /* i : core used */ Word16 old_y_gain_fx[], /* i/o: AR gain quantizer for low rate */ const Word16 coder_type_fx, /* i : coding type */ const Word16 coder_type, /* i : coding type */ const Word16 bwidth_fx /* i : input signal bandwidth */ ) { Loading @@ -467,7 +467,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ test(); test(); IF( (EQ_16(coder_type_fx,AUDIO)||EQ_16(coder_type_fx,INACTIVE))&&EQ_16(bwidth_fx,NB)) IF( (EQ_16(coder_type,AUDIO)||EQ_16(coder_type,INACTIVE))&&EQ_16(bwidth_fx,NB)) { idx_g_fx = (Word16) get_next_indice( st_fx, 6 ); VDQ_vec_fx(&mean_4g_fx, Gain_meanNB_fx, Gain_mean_dicNB_fx, idx_g_fx, 1 ); Loading @@ -493,7 +493,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ VDQ_vec_fx(y_gainQ_fx+6, Mean_dic_NB_fx+6, Gain_dic3_NBHR_fx, idx_g_fx, 4 ); } test(); IF( LE_32(core_brate_fx,ACELP_9k60)&&EQ_16(coder_type_fx,INACTIVE)) IF( LE_32(core_brate_fx,ACELP_9k60)&&EQ_16(coder_type,INACTIVE)) { /* Some energy is needed in high band for stat_noise_uv_enc to be functional in inactive speech */ Loading Loading @@ -585,7 +585,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ } /* Gain adjustment to fit ACELP generic inactive coding gain at low rate */ GSC_gain_adj(coder_type_fx, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx); GSC_gain_adj(coder_type, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx); return mean_4g_fx; Loading @@ -599,7 +599,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ /*--------------------------------------------------------------------------*/ /* INPUT ARGUMENTS : */ /* _ (Word16) pvq_bits_fx : core used Q0 */ /* _ (Word16) coder_type_fx : coding type Q0 */ /* _ (Word16) coder_type : coding type Q0 */ /* _ (Word16) core_fx : core used Q0 */ /* _ (Word16) bwidth_fx : input signal bandwidth Q0 */ /*--------------------------------------------------------------------------*/ Loading @@ -617,7 +617,7 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain * Word16 y_gainQ_fx[], /* o : quantized gain per band */ const Word32 core_brate_fx, /* i : core used */ Word16 old_y_gain_fx[], /* i/o: AR gain quantizer for low rate */ const Word16 coder_type_fx, /* i : coding type */ const Word16 coder_type, /* i : coding type */ const Word16 bwidth_fx /* i : input signal bandwidth */ ) { Loading @@ -632,7 +632,7 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain * test(); test(); IF((EQ_16(coder_type_fx, AUDIO) || EQ_16(coder_type_fx, INACTIVE)) && EQ_16(bwidth_fx, NB)) IF((EQ_16(coder_type, AUDIO) || EQ_16(coder_type, INACTIVE)) && EQ_16(bwidth_fx, NB)) { idx_g_fx = (Word16)get_next_indice(st_fx, 6); VDQ_vec_fx(&mean_4g_fx, Gain_meanNB_fx, Gain_mean_dicNB_fx, idx_g_fx, 1); Loading @@ -658,7 +658,7 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain * VDQ_vec_fx(y_gainQ_fx + 6, Mean_dic_NB_fx + 6, Gain_dic3_NBHR_fx, idx_g_fx, 4); } test(); IF(LE_32(core_brate_fx, ACELP_9k60) && EQ_16(coder_type_fx, INACTIVE)) IF(LE_32(core_brate_fx, ACELP_9k60) && EQ_16(coder_type, INACTIVE)) { /* Some energy is needed in high band for stat_noise_uv_enc to be functional in inactive speech */ Loading Loading @@ -770,7 +770,7 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain * } /* Gain adjustment to fit ACELP generic inactive coding gain at low rate */ GSC_gain_adj_ivas_fx(coder_type_fx, Mbands_gn, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx); GSC_gain_adj_ivas_fx(coder_type, Mbands_gn, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx); return mean_4g_fx; Loading lib_com/gs_preech.c +2 −2 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ void pre_echo_att_fx( Word16 *exc_fx, /* i/o: Excitation of the current frame Q_new*/ const Word16 gsc_attack_flag_fx, /* i : flag signalling attack encoded by AC mode (GSC) */ const Word16 Q_new, const Word16 last_coder_type_fx, /* i : Last coding mode */ const Word16 last_coder_type, /* i : Last coding mode */ const Word16 L_frame /* i : Frame length*/ ) { Loading @@ -159,7 +159,7 @@ void pre_echo_att_fx( Word16 att_len; test(); IF(GT_16(gsc_attack_flag_fx, 0) && EQ_16(last_coder_type_fx, AUDIO)) /*gsc_attack_flag_fx does not get set for all the test cases */ IF(GT_16(gsc_attack_flag_fx, 0) && EQ_16(last_coder_type, AUDIO)) /*gsc_attack_flag_fx does not get set for all the test cases */ { /*-------------------------------------------------------------------------* * Find where the onset (attack) occurs by computing the energy per section Loading Loading
lib_com/bits_alloc.c +2 −0 Original line number Diff line number Diff line Loading @@ -1428,6 +1428,7 @@ static int16_t allocate_unused( *--------------------------------------------------------------------*/ /*! r: ACELP16k flag */ #ifndef IVAS_FLOAT_FIXED int16_t set_ACELP_flag_IVAS( const int16_t element_mode, /* i : element mode */ const int32_t element_brate, /* i : element bitrate */ Loading Loading @@ -1485,3 +1486,4 @@ int16_t set_ACELP_flag_IVAS( return 0; } } #endif
lib_com/bits_alloc_fx.c +73 −0 Original line number Diff line number Diff line Loading @@ -1700,4 +1700,77 @@ Word16 set_ACELP_flag( } } #endif /*-------------------------------------------------------------------* * set_ACELP_flag_IVAS() * * set ACELP@16kHz flag *--------------------------------------------------------------------*/ /*! r: ACELP16k flag */ #ifdef IVAS_FLOAT_FIXED Word16 set_ACELP_flag_IVAS( const Word16 element_mode, /* i : element mode */ const Word32 element_brate, /* i : element bitrate */ const Word32 total_brate, /* i : total bitrate per channel */ const Word16 idchan, /* i : Channel id */ const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const Word16 bwidth, /* i : audio bandwidth */ const Word16 cng_type /* i : CNG type */ ) { test(); test(); test(); test(); IF( EQ_16( element_mode, IVAS_CPE_DFT ) && EQ_16( idchan, 0 ) && LE_32( total_brate, SID_2k40 ) && EQ_16( bwidth, WB ) && EQ_16( cng_type, LP_CNG ) ) { return 1; } ELSE IF( EQ_16( element_mode, IVAS_CPE_TD ) ) { test(); test(); test(); IF( GE_32( element_brate, IVAS_24k4 ) && EQ_16( idchan, 0 ) && ( EQ_16( tdm_LRTD_flag, 0 ) || GT_32( element_brate, IVAS_24k4 ) ) ) { return 1; } ELSE { return 0; } } ELSE IF( EQ_16( element_mode, IVAS_CPE_DFT ) ) { IF( GE_32( element_brate, IVAS_24k4 ) ) { return 1; } ELSE { return 0; } } ELSE IF( EQ_16( element_mode, IVAS_SCE ) ) { IF( GE_32( element_brate, SCE_CORE_16k_LOW_LIMIT ) ) { return 1; } ELSE { return 0; } } ELSE IF( GE_32( total_brate, ACELP_16k_LOW_LIMIT ) ) /* EVS_MONO */ { return 1; } ELSE { return 0; } } #endif /*#endif IVAS_CODE*/ No newline at end of file
lib_com/bitstream.c +3 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,9 @@ #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "wmc_auto.h" #ifdef IVAS_FLOAT_FIXED #include "ivas_prot_fx.h" #endif #define STEP_MAX_NUM_INDICES 100 /* increase the maximum number of allowed indices in the list by this amount */ Loading
lib_com/gs_gains_fx.c +10 −10 Original line number Diff line number Diff line Loading @@ -439,7 +439,7 @@ static void GSC_gain_adj_ivas_fx( /*--------------------------------------------------------------------------*/ /* INPUT ARGUMENTS : */ /* _ (Word16) pvq_bits_fx : core used Q0 */ /* _ (Word16) coder_type_fx : coding type Q0 */ /* _ (Word16) coder_type : coding type Q0 */ /* _ (Word16) core_fx : core used Q0 */ /* _ (Word16) bwidth_fx : input signal bandwidth Q0 */ /*--------------------------------------------------------------------------*/ Loading @@ -457,7 +457,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ Word16 y_gainQ_fx[], /* o : quantized gain per band */ const Word32 core_brate_fx, /* i : core used */ Word16 old_y_gain_fx[], /* i/o: AR gain quantizer for low rate */ const Word16 coder_type_fx, /* i : coding type */ const Word16 coder_type, /* i : coding type */ const Word16 bwidth_fx /* i : input signal bandwidth */ ) { Loading @@ -467,7 +467,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ test(); test(); IF( (EQ_16(coder_type_fx,AUDIO)||EQ_16(coder_type_fx,INACTIVE))&&EQ_16(bwidth_fx,NB)) IF( (EQ_16(coder_type,AUDIO)||EQ_16(coder_type,INACTIVE))&&EQ_16(bwidth_fx,NB)) { idx_g_fx = (Word16) get_next_indice( st_fx, 6 ); VDQ_vec_fx(&mean_4g_fx, Gain_meanNB_fx, Gain_mean_dicNB_fx, idx_g_fx, 1 ); Loading @@ -493,7 +493,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ VDQ_vec_fx(y_gainQ_fx+6, Mean_dic_NB_fx+6, Gain_dic3_NBHR_fx, idx_g_fx, 4 ); } test(); IF( LE_32(core_brate_fx,ACELP_9k60)&&EQ_16(coder_type_fx,INACTIVE)) IF( LE_32(core_brate_fx,ACELP_9k60)&&EQ_16(coder_type,INACTIVE)) { /* Some energy is needed in high band for stat_noise_uv_enc to be functional in inactive speech */ Loading Loading @@ -585,7 +585,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ } /* Gain adjustment to fit ACELP generic inactive coding gain at low rate */ GSC_gain_adj(coder_type_fx, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx); GSC_gain_adj(coder_type, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx); return mean_4g_fx; Loading @@ -599,7 +599,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ /*--------------------------------------------------------------------------*/ /* INPUT ARGUMENTS : */ /* _ (Word16) pvq_bits_fx : core used Q0 */ /* _ (Word16) coder_type_fx : coding type Q0 */ /* _ (Word16) coder_type : coding type Q0 */ /* _ (Word16) core_fx : core used Q0 */ /* _ (Word16) bwidth_fx : input signal bandwidth Q0 */ /*--------------------------------------------------------------------------*/ Loading @@ -617,7 +617,7 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain * Word16 y_gainQ_fx[], /* o : quantized gain per band */ const Word32 core_brate_fx, /* i : core used */ Word16 old_y_gain_fx[], /* i/o: AR gain quantizer for low rate */ const Word16 coder_type_fx, /* i : coding type */ const Word16 coder_type, /* i : coding type */ const Word16 bwidth_fx /* i : input signal bandwidth */ ) { Loading @@ -632,7 +632,7 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain * test(); test(); IF((EQ_16(coder_type_fx, AUDIO) || EQ_16(coder_type_fx, INACTIVE)) && EQ_16(bwidth_fx, NB)) IF((EQ_16(coder_type, AUDIO) || EQ_16(coder_type, INACTIVE)) && EQ_16(bwidth_fx, NB)) { idx_g_fx = (Word16)get_next_indice(st_fx, 6); VDQ_vec_fx(&mean_4g_fx, Gain_meanNB_fx, Gain_mean_dicNB_fx, idx_g_fx, 1); Loading @@ -658,7 +658,7 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain * VDQ_vec_fx(y_gainQ_fx + 6, Mean_dic_NB_fx + 6, Gain_dic3_NBHR_fx, idx_g_fx, 4); } test(); IF(LE_32(core_brate_fx, ACELP_9k60) && EQ_16(coder_type_fx, INACTIVE)) IF(LE_32(core_brate_fx, ACELP_9k60) && EQ_16(coder_type, INACTIVE)) { /* Some energy is needed in high band for stat_noise_uv_enc to be functional in inactive speech */ Loading Loading @@ -770,7 +770,7 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain * } /* Gain adjustment to fit ACELP generic inactive coding gain at low rate */ GSC_gain_adj_ivas_fx(coder_type_fx, Mbands_gn, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx); GSC_gain_adj_ivas_fx(coder_type, Mbands_gn, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx); return mean_4g_fx; Loading
lib_com/gs_preech.c +2 −2 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ void pre_echo_att_fx( Word16 *exc_fx, /* i/o: Excitation of the current frame Q_new*/ const Word16 gsc_attack_flag_fx, /* i : flag signalling attack encoded by AC mode (GSC) */ const Word16 Q_new, const Word16 last_coder_type_fx, /* i : Last coding mode */ const Word16 last_coder_type, /* i : Last coding mode */ const Word16 L_frame /* i : Frame length*/ ) { Loading @@ -159,7 +159,7 @@ void pre_echo_att_fx( Word16 att_len; test(); IF(GT_16(gsc_attack_flag_fx, 0) && EQ_16(last_coder_type_fx, AUDIO)) /*gsc_attack_flag_fx does not get set for all the test cases */ IF(GT_16(gsc_attack_flag_fx, 0) && EQ_16(last_coder_type, AUDIO)) /*gsc_attack_flag_fx does not get set for all the test cases */ { /*-------------------------------------------------------------------------* * Find where the onset (attack) occurs by computing the energy per section Loading