Loading apps/renderer.c +0 −2 Original line number Diff line number Diff line Loading @@ -392,8 +392,6 @@ static char *readNextMetadataChunk( char *line, const char *delimiter ); static void parseUint8( const char *line, uint8_t *ret ); static void parseUint16( const char *line, uint16_t *ret ); static int8_t parseUint32( const char *line, uint32_t *ret ); static int8_t parseInt32( const char *line, int32_t *ret ); Loading lib_com/bitstream.c +0 −191 Original line number Diff line number Diff line Loading @@ -3266,197 +3266,6 @@ ivas_error read_indices( return error; } /*-------------------------------------------------------------------* * read_indices_mime_handle_dtx() * * Handle DTX for MIME and RTP_DUMP decoding. * Returns the actual total_brate. *-------------------------------------------------------------------*/ static Word32 read_indices_mime_handle_dtx( Decoder_State *st, int16_t *CNG, const Word16 isAMRWB_IOmode, const Word16 core_mode, Word32 total_brate, const Word16 sti, const Word16 speech_lost, Word16 no_data, const Word16 amrwb_rfc4867_flag ) { Word16 curr_ft_good_sp = 0; Word16 speech_bad = 0; Word16 sid_upd_bad = 0, sid_update = 0; Word16 amrwb_sid_first = 0; /* derived from sti SID_FIRST indicator in AMRWB payload */ /* keep st->CNG , st_bfi and total_brate updated for proper synthesis in DTX and FER */ if ( total_brate > SID_2k40 ) { if ( st->bfi != 1 ) /* so far derived from q bit in AMRWB/AMRWBIO cases */ { curr_ft_good_sp = 1; } } /* handle q_bit and lost_sp clash , assume worst case */ if ( speech_lost != 0 ) /* overrides a good q_bit */ { curr_ft_good_sp = 0; st->bfi = 1; /* override qbit */ } /* now_bfi_fx has been set based on q_bit and ToC fields */ /* SID_UPDATE check */ if ( total_brate == SID_1k75 || total_brate == SID_2k40 ) { if ( st->bfi == 0 ) { /* typically from q bit */ sid_update = 1; } else { sid_upd_bad = 1; /* may happen in saving from e.g. a CS-connection */ } } if ( isAMRWB_IOmode && total_brate == 0 && sti == 0 ) { if ( st->bfi ) { sid_upd_bad = 1; /* corrupt sid_first, signaled as bad SID */ } else { amrwb_sid_first = 1; /* 1-sti */ } } if ( sid_upd_bad != 0 && ( ( isAMRWB_IOmode != 0 && st->Opt_AMR_WB == 0 ) || /* switch to AMRWBIO */ ( isAMRWB_IOmode != 1 && st->Opt_AMR_WB == 1 ) /* switch from AMRWBIO */ ) ) { /* do not allow a normal start of CNG synthesis if this SID(with BER or FER) is a switch to/from AMRWBIO */ sid_upd_bad = 0; /* revert this detection due to AMRWBIO/EVS mode switch */ total_brate = 0; no_data = 1; assert( st->bfi == 1 ); /* bfi stays 1 */ } if ( total_brate > SID_2k40 && st->bfi == 1 ) /* typically from q bit */ { speech_bad = 1; /* initial assumption, CNG synt state decides what to actually do */ } /* all frame types decoded */ /* update CNG synthesis state */ /* Decoder can only enter CNG-synthesis for CNG frame types (sid_upd, sid_bad, sid_first) */ if ( *CNG != 0 ) { /* We were in CNG synthesis */ if ( curr_ft_good_sp != 0 ) { /* only a good speech frame makes decoder leave CNG synthesis */ *CNG = 0; } } else { /* We were in SPEECH synthesis */ /* only a received SID frame can make the decoder enter into CNG synthesis */ if ( amrwb_sid_first || sid_update || sid_upd_bad ) { *CNG = 1; } } /* Now modify bfi flag for the decoder's SPEECH/CNG synthesis logic */ /* in SPEECH synthesis, make sure to activate speech PLC for a received NO_DATA frame, no_data frames may be injected by the network or by the dejitter buffer */ /* modify bfi_flag to stay/move into the correct decoder PLC section */ if ( ( *CNG == 0 ) && ( no_data != 0 ) ) { /* treat NO_DATA received in speech synthesis as SP_LOST frames, SPEECH PLC code will now become active */ st->bfi = 1; /* total_brate= 0; always zero for no_data */ } /* in CNG */ /* handle bad speech frame(and bad SID frame) in the decoders CNG synthesis settings pair (total_brate, bfi) */ if ( ( *CNG != 0 && ( speech_bad || speech_lost || no_data ) ) || /* SP_BAD or SPEECH_LOST) --> stay in CNG */ sid_upd_bad ) /* SID_UPD_BAD --> start/stay CNG */ { st->bfi = 0; /* mark as good to not start speech PLC */ total_brate = 0; /* this zeroing needed for speech_bad, sid_bad frames */ } /* now bfi, total_brate are set by RX-DTX handler:: bfi==0, total_brate!=0 CNG or speech pending bitrate bfi==0, total_brate==0 CNG will continue or start(sid_first, sid_bad) bfi==1, total_brate!=0 speech PLC bfi==1, total_brate==0 , speech PLC */ /* handle available AMRWB/AMRWBIO MIME header ToC rate-info at startup */ if ( ( st->bfi == 1 && st->ini_frame == 0 ) && ( ( amrwb_rfc4867_flag != 0 ) || ( amrwb_rfc4867_flag == 0 && isAMRWB_IOmode != 0 ) ) ) /*AMRWB ToC */ { Word32 init_rate; init_rate = total_brate; /* default , may have been modified from original ToC value */ if ( speech_lost != 0 || no_data != 0 ) { init_rate = ACELP_12k65; /* make sure the decoder starts up in a selected AMRWB mode */ } else if ( speech_bad != 0 ) { init_rate = AMRWB_IOmode2rate[core_mode]; /* read from from ToC */ } st->total_brate = init_rate; /* not updated on bfi as decoderSelectCodec is not called below */ st->core_brate = init_rate; } return total_brate; } /*-------------------------------------------------------------------* * read_indices_mime_handle_sti_and_all_zero_bits() * * Handle STI and frames with all zero bits for MIME and RTP_DUMP decoding. *-------------------------------------------------------------------*/ static void read_indices_mime_handle_sti_and_all_zero_bits( Decoder_State *st, Word32 *total_brate, Word16 sti ) { Word16 k, sum = 0; if ( sti == 0 ) { *total_brate = 0; /* signal received SID_FIRST as a good frame with no bits */ for ( k = 0; k < 35; k++ ) { st->bfi |= st->bit_stream[k]; /* partity check of 35 zeroes, any single 1 gives BFI */ } } /* all zero bit SID_update results in a valid LP filter with extremely high LP-filter-gain */ /* all zero bits signal may be a result of CS bit errors or erronesouly injected by gateways or bad dejitter handlers */ if ( sti == 1 ) { /*sid_update received */ for ( k = 0; k < 35; k++ ) { sum += st->bit_stream[k]; /* check of 35 zeroes */ } if ( sum == 0 ) { st->bfi = 1; /* eventually becomes SID_UPD_BAD */ } } } /*-------------------------------------------------------------------* * get_rfFrameType() * Loading lib_enc/ivas_decision_matrix_enc.c +4 −0 Original line number Diff line number Diff line Loading @@ -266,7 +266,11 @@ void ivas_decision_matrix_enc( if ( st->total_brate >= MIN_BRATE_SWB_BWE /*&& (*coder_type != AUDIO || st->total_brate >= (MIN_BWE_PRI_BRATE+600))*/ || ( st->total_brate >= MIN_MIN_BRATE_LRTD_SWB_BWE && st->element_mode == IVAS_CPE_TD && st->bwidth == SWB && st->tdm_LRTD_flag ) || ( element_brate < IVAS_16k4 && st->total_brate >= MIN_MIN_BRATE_LRTD_SWB_BWE && st->element_mode == IVAS_CPE_TD && st->bwidth == SWB ) ) { #ifdef DEBUG_VLAD if (0) #else if ( ( ( ( st->sp_aud_decision1 == 1 && st->sp_aud_decision2 == 0 ) || st->coder_type == INACTIVE ) && !st->GSC_noisy_speech ) /* Note: SWB BWE is not used for GSC noisy speech */ ) #endif { st->extl = SWB_BWE; st->extl_brate = SWB_BWE_1k6; Loading Loading
apps/renderer.c +0 −2 Original line number Diff line number Diff line Loading @@ -392,8 +392,6 @@ static char *readNextMetadataChunk( char *line, const char *delimiter ); static void parseUint8( const char *line, uint8_t *ret ); static void parseUint16( const char *line, uint16_t *ret ); static int8_t parseUint32( const char *line, uint32_t *ret ); static int8_t parseInt32( const char *line, int32_t *ret ); Loading
lib_com/bitstream.c +0 −191 Original line number Diff line number Diff line Loading @@ -3266,197 +3266,6 @@ ivas_error read_indices( return error; } /*-------------------------------------------------------------------* * read_indices_mime_handle_dtx() * * Handle DTX for MIME and RTP_DUMP decoding. * Returns the actual total_brate. *-------------------------------------------------------------------*/ static Word32 read_indices_mime_handle_dtx( Decoder_State *st, int16_t *CNG, const Word16 isAMRWB_IOmode, const Word16 core_mode, Word32 total_brate, const Word16 sti, const Word16 speech_lost, Word16 no_data, const Word16 amrwb_rfc4867_flag ) { Word16 curr_ft_good_sp = 0; Word16 speech_bad = 0; Word16 sid_upd_bad = 0, sid_update = 0; Word16 amrwb_sid_first = 0; /* derived from sti SID_FIRST indicator in AMRWB payload */ /* keep st->CNG , st_bfi and total_brate updated for proper synthesis in DTX and FER */ if ( total_brate > SID_2k40 ) { if ( st->bfi != 1 ) /* so far derived from q bit in AMRWB/AMRWBIO cases */ { curr_ft_good_sp = 1; } } /* handle q_bit and lost_sp clash , assume worst case */ if ( speech_lost != 0 ) /* overrides a good q_bit */ { curr_ft_good_sp = 0; st->bfi = 1; /* override qbit */ } /* now_bfi_fx has been set based on q_bit and ToC fields */ /* SID_UPDATE check */ if ( total_brate == SID_1k75 || total_brate == SID_2k40 ) { if ( st->bfi == 0 ) { /* typically from q bit */ sid_update = 1; } else { sid_upd_bad = 1; /* may happen in saving from e.g. a CS-connection */ } } if ( isAMRWB_IOmode && total_brate == 0 && sti == 0 ) { if ( st->bfi ) { sid_upd_bad = 1; /* corrupt sid_first, signaled as bad SID */ } else { amrwb_sid_first = 1; /* 1-sti */ } } if ( sid_upd_bad != 0 && ( ( isAMRWB_IOmode != 0 && st->Opt_AMR_WB == 0 ) || /* switch to AMRWBIO */ ( isAMRWB_IOmode != 1 && st->Opt_AMR_WB == 1 ) /* switch from AMRWBIO */ ) ) { /* do not allow a normal start of CNG synthesis if this SID(with BER or FER) is a switch to/from AMRWBIO */ sid_upd_bad = 0; /* revert this detection due to AMRWBIO/EVS mode switch */ total_brate = 0; no_data = 1; assert( st->bfi == 1 ); /* bfi stays 1 */ } if ( total_brate > SID_2k40 && st->bfi == 1 ) /* typically from q bit */ { speech_bad = 1; /* initial assumption, CNG synt state decides what to actually do */ } /* all frame types decoded */ /* update CNG synthesis state */ /* Decoder can only enter CNG-synthesis for CNG frame types (sid_upd, sid_bad, sid_first) */ if ( *CNG != 0 ) { /* We were in CNG synthesis */ if ( curr_ft_good_sp != 0 ) { /* only a good speech frame makes decoder leave CNG synthesis */ *CNG = 0; } } else { /* We were in SPEECH synthesis */ /* only a received SID frame can make the decoder enter into CNG synthesis */ if ( amrwb_sid_first || sid_update || sid_upd_bad ) { *CNG = 1; } } /* Now modify bfi flag for the decoder's SPEECH/CNG synthesis logic */ /* in SPEECH synthesis, make sure to activate speech PLC for a received NO_DATA frame, no_data frames may be injected by the network or by the dejitter buffer */ /* modify bfi_flag to stay/move into the correct decoder PLC section */ if ( ( *CNG == 0 ) && ( no_data != 0 ) ) { /* treat NO_DATA received in speech synthesis as SP_LOST frames, SPEECH PLC code will now become active */ st->bfi = 1; /* total_brate= 0; always zero for no_data */ } /* in CNG */ /* handle bad speech frame(and bad SID frame) in the decoders CNG synthesis settings pair (total_brate, bfi) */ if ( ( *CNG != 0 && ( speech_bad || speech_lost || no_data ) ) || /* SP_BAD or SPEECH_LOST) --> stay in CNG */ sid_upd_bad ) /* SID_UPD_BAD --> start/stay CNG */ { st->bfi = 0; /* mark as good to not start speech PLC */ total_brate = 0; /* this zeroing needed for speech_bad, sid_bad frames */ } /* now bfi, total_brate are set by RX-DTX handler:: bfi==0, total_brate!=0 CNG or speech pending bitrate bfi==0, total_brate==0 CNG will continue or start(sid_first, sid_bad) bfi==1, total_brate!=0 speech PLC bfi==1, total_brate==0 , speech PLC */ /* handle available AMRWB/AMRWBIO MIME header ToC rate-info at startup */ if ( ( st->bfi == 1 && st->ini_frame == 0 ) && ( ( amrwb_rfc4867_flag != 0 ) || ( amrwb_rfc4867_flag == 0 && isAMRWB_IOmode != 0 ) ) ) /*AMRWB ToC */ { Word32 init_rate; init_rate = total_brate; /* default , may have been modified from original ToC value */ if ( speech_lost != 0 || no_data != 0 ) { init_rate = ACELP_12k65; /* make sure the decoder starts up in a selected AMRWB mode */ } else if ( speech_bad != 0 ) { init_rate = AMRWB_IOmode2rate[core_mode]; /* read from from ToC */ } st->total_brate = init_rate; /* not updated on bfi as decoderSelectCodec is not called below */ st->core_brate = init_rate; } return total_brate; } /*-------------------------------------------------------------------* * read_indices_mime_handle_sti_and_all_zero_bits() * * Handle STI and frames with all zero bits for MIME and RTP_DUMP decoding. *-------------------------------------------------------------------*/ static void read_indices_mime_handle_sti_and_all_zero_bits( Decoder_State *st, Word32 *total_brate, Word16 sti ) { Word16 k, sum = 0; if ( sti == 0 ) { *total_brate = 0; /* signal received SID_FIRST as a good frame with no bits */ for ( k = 0; k < 35; k++ ) { st->bfi |= st->bit_stream[k]; /* partity check of 35 zeroes, any single 1 gives BFI */ } } /* all zero bit SID_update results in a valid LP filter with extremely high LP-filter-gain */ /* all zero bits signal may be a result of CS bit errors or erronesouly injected by gateways or bad dejitter handlers */ if ( sti == 1 ) { /*sid_update received */ for ( k = 0; k < 35; k++ ) { sum += st->bit_stream[k]; /* check of 35 zeroes */ } if ( sum == 0 ) { st->bfi = 1; /* eventually becomes SID_UPD_BAD */ } } } /*-------------------------------------------------------------------* * get_rfFrameType() * Loading
lib_enc/ivas_decision_matrix_enc.c +4 −0 Original line number Diff line number Diff line Loading @@ -266,7 +266,11 @@ void ivas_decision_matrix_enc( if ( st->total_brate >= MIN_BRATE_SWB_BWE /*&& (*coder_type != AUDIO || st->total_brate >= (MIN_BWE_PRI_BRATE+600))*/ || ( st->total_brate >= MIN_MIN_BRATE_LRTD_SWB_BWE && st->element_mode == IVAS_CPE_TD && st->bwidth == SWB && st->tdm_LRTD_flag ) || ( element_brate < IVAS_16k4 && st->total_brate >= MIN_MIN_BRATE_LRTD_SWB_BWE && st->element_mode == IVAS_CPE_TD && st->bwidth == SWB ) ) { #ifdef DEBUG_VLAD if (0) #else if ( ( ( ( st->sp_aud_decision1 == 1 && st->sp_aud_decision2 == 0 ) || st->coder_type == INACTIVE ) && !st->GSC_noisy_speech ) /* Note: SWB BWE is not used for GSC noisy speech */ ) #endif { st->extl = SWB_BWE; st->extl_brate = SWB_BWE_1k6; Loading