Loading lib_com/bitstream.c +0 −86 Original line number Diff line number Diff line Loading @@ -1849,92 +1849,6 @@ static void decision_matrix_core_dec( return; } /*-------------------------------------------------------------------* * mdct_switching_dec() * * Set up MDCT core switching if indicated in the bitstream *-------------------------------------------------------------------*/ void mdct_switching_dec_ivas_fx( Decoder_State *st /* i/o: decoder state structure */ ) { if ( !st->bfi ) { if ( st->Opt_AMR_WB ) { return; } if ( st->total_brate == ACELP_13k20 || st->total_brate == ACELP_32k ) { st->mdct_sw_enable = MODE1; } else if ( ACELP_16k40 <= st->total_brate && st->total_brate <= ACELP_24k40 ) { st->mdct_sw_enable = MODE2; } if ( st->codec_mode == MODE1 && st->mdct_sw_enable == MODE1 ) { /* Read ahead core signaling */ int16_t next_bit_pos_save = st->next_bit_pos; int16_t core_save = st->core; int16_t bwidth_save = st->bwidth; decision_matrix_core_dec( st ); /* sets st->core */ if ( st->core == TCX_20_CORE ) { /* Trigger TCX */ st->codec_mode = MODE2; st->mdct_sw = MODE1; } else { /* Rewind bitstream */ st->next_bit_pos = next_bit_pos_save; if ( st->bfi ) { st->core = core_save; st->bwidth = bwidth_save; } } } else if ( st->codec_mode == MODE2 && st->mdct_sw_enable == MODE2 ) { /* Read ahead core signaling */ int16_t next_bit_pos_save = st->next_bit_pos; int16_t core_save = st->core; int16_t bwidth_save = st->bwidth; dec_prm_core( st ); /* sets st->core */ if ( st->core == HQ_CORE ) { /* Trigger HQ_CORE */ st->codec_mode = MODE1; st->mdct_sw = MODE2; } else { /* Rewind bitstream */ st->next_bit_pos = next_bit_pos_save; if ( st->bfi ) { st->core = core_save; } /* always reset bwidth, to not interfere with BER logic */ st->bwidth = bwidth_save; } } } return; } /*-------------------------------------------------------------------* * reset_elements() Loading lib_com/bitstream_fx.c +4 −172 Original line number Diff line number Diff line Loading @@ -143,29 +143,6 @@ void pack_bit( return; } /*-------------------------------------------------------------------* * unpack_bit() * * unpack a bit from packed octet *-------------------------------------------------------------------*/ static Word16 unpack_bit( UWord8 **pt, /* i/o: pointer to octet array from which bit will be read */ UWord8 *mask /* i/o: mask to indicate the bit in the octet */ ) { Word16 bit; bit = s_and( **pt, *mask ) != 0; *mask = (UWord8) shr( *mask, 1 ); move16(); IF( *mask == 0 ) { *mask = 0x80; move16(); ( *pt )++; } return bit; } /*-------------------------------------------------------------------* * rate2AMRWB_IOmode() Loading Loading @@ -945,154 +922,6 @@ return; } static void decoder_selectCodec( Decoder_State *st, /* i/o: decoder state structure */ const Word32 total_brate, /* i : total bitrate */ const Word16 bit0 ) { test(); test(); test(); test(); test(); test(); test(); test(); test(); /* check if we are in AMR-WB IO mode */ IF( EQ_32( total_brate, SID_1k75 ) || EQ_32( total_brate, ACELP_6k60 ) || EQ_32( total_brate, ACELP_8k85 ) || EQ_32( total_brate, ACELP_12k65 ) || EQ_32( total_brate, ACELP_14k25 ) || EQ_32( total_brate, ACELP_15k85 ) || EQ_32( total_brate, ACELP_18k25 ) || EQ_32( total_brate, ACELP_19k85 ) || EQ_32( total_brate, ACELP_23k05 ) || EQ_32( total_brate, ACELP_23k85 ) ) { st->Opt_AMR_WB = 1; move16(); } ELSE IF( total_brate != FRAME_NO_DATA ) { st->Opt_AMR_WB = 0; move16(); } /* select MODE1 or MODE2 */ IF( st->Opt_AMR_WB ) { st->codec_mode = MODE1; move16(); /**/ } ELSE { SWITCH( total_brate ) { case 0: st->codec_mode = st->last_codec_mode; move16(); BREAK; case 2400: st->codec_mode = st->last_codec_mode; move16(); BREAK; case 2800: st->codec_mode = MODE1; move16(); BREAK; case 7200: st->codec_mode = MODE1; move16(); BREAK; case 8000: st->codec_mode = MODE1; move16(); BREAK; case 9600: st->codec_mode = MODE2; move16(); BREAK; case 13200: st->codec_mode = MODE1; move16(); BREAK; case 16400: st->codec_mode = MODE2; move16(); BREAK; case 24400: st->codec_mode = MODE2; move16(); BREAK; case 32000: st->codec_mode = MODE1; move16(); BREAK; case 48000: st->codec_mode = MODE2; move16(); BREAK; case 64000: st->codec_mode = MODE1; move16(); BREAK; case 96000: st->codec_mode = MODE2; move16(); BREAK; case 128000: st->codec_mode = MODE2; move16(); BREAK; default: /* validate that total_brate (derived from RTP packet or a file header) is one of the defined bit rates */ st->codec_mode = st->last_codec_mode; st->bfi = 1; move16(); move16(); BREAK; } } IF( st->ini_frame == 0 ) { if ( EQ_16( st->codec_mode, -1 ) ) { st->codec_mode = MODE1; move16(); } st->last_codec_mode = st->codec_mode; move16(); } /* set SID/CNG type */ IF( EQ_32( total_brate, SID_2k40 ) ) { IF( EQ_16( bit0, G192_BIN0 ) ) { st->cng_type = LP_CNG; move16(); /* force MODE1 when selecting LP_CNG */ st->codec_mode = MODE1; move16(); } ELSE { st->cng_type = FD_CNG; move16(); test(); if ( EQ_16( st->last_codec_mode, MODE2 ) && EQ_32( st->last_total_brate, 13200 ) ) { st->codec_mode = MODE1; move16(); } } st->hTdCngDec->last_cng_type_fx = st->cng_type; /* CNG type switching at the first correctly received SID frame */ move16(); } return; } static void dec_prm_core( Decoder_State *st ) { Word16 n, frame_size_index, num_bits; Loading Loading @@ -1320,7 +1149,7 @@ static void decision_matrix_core_dec( * Set up MDCT core switching if indicated in the bit stream *-------------------------------------------------------------------*/ static void mdct_switching_dec( void mdct_switching_dec_fx( Decoder_State *st /* i/o: decoder state structure */ ) { Loading Loading @@ -1421,8 +1250,11 @@ static void mdct_switching_dec( move16(); } } return; } /*-------------------------------------------------------------------* * BRATE2IDX_fx() * Loading lib_com/prot_fx.h +1 −1 Original line number Diff line number Diff line Loading @@ -11555,7 +11555,7 @@ Decoder_State **reset_elements( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); void mdct_switching_dec_ivas_fx( void mdct_switching_dec_fx( Decoder_State *st /* i/o: decoder state structure */ ); lib_dec/lib_dec_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -3396,7 +3396,7 @@ static ivas_error evs_dec_main_fx( move32(); hCoreCoder[0]->output_frame_fx = extract_l( Mult_32_16( hCoreCoder[0]->output_Fs, 0x0290 /*Q0*/ ) ); // Q0 move16(); mdct_switching_dec_ivas_fx( hCoreCoder[0] ); mdct_switching_dec_fx( hCoreCoder[0] ); FOR( ch = 0; ch < MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; ch++ ) { Loading Loading
lib_com/bitstream.c +0 −86 Original line number Diff line number Diff line Loading @@ -1849,92 +1849,6 @@ static void decision_matrix_core_dec( return; } /*-------------------------------------------------------------------* * mdct_switching_dec() * * Set up MDCT core switching if indicated in the bitstream *-------------------------------------------------------------------*/ void mdct_switching_dec_ivas_fx( Decoder_State *st /* i/o: decoder state structure */ ) { if ( !st->bfi ) { if ( st->Opt_AMR_WB ) { return; } if ( st->total_brate == ACELP_13k20 || st->total_brate == ACELP_32k ) { st->mdct_sw_enable = MODE1; } else if ( ACELP_16k40 <= st->total_brate && st->total_brate <= ACELP_24k40 ) { st->mdct_sw_enable = MODE2; } if ( st->codec_mode == MODE1 && st->mdct_sw_enable == MODE1 ) { /* Read ahead core signaling */ int16_t next_bit_pos_save = st->next_bit_pos; int16_t core_save = st->core; int16_t bwidth_save = st->bwidth; decision_matrix_core_dec( st ); /* sets st->core */ if ( st->core == TCX_20_CORE ) { /* Trigger TCX */ st->codec_mode = MODE2; st->mdct_sw = MODE1; } else { /* Rewind bitstream */ st->next_bit_pos = next_bit_pos_save; if ( st->bfi ) { st->core = core_save; st->bwidth = bwidth_save; } } } else if ( st->codec_mode == MODE2 && st->mdct_sw_enable == MODE2 ) { /* Read ahead core signaling */ int16_t next_bit_pos_save = st->next_bit_pos; int16_t core_save = st->core; int16_t bwidth_save = st->bwidth; dec_prm_core( st ); /* sets st->core */ if ( st->core == HQ_CORE ) { /* Trigger HQ_CORE */ st->codec_mode = MODE1; st->mdct_sw = MODE2; } else { /* Rewind bitstream */ st->next_bit_pos = next_bit_pos_save; if ( st->bfi ) { st->core = core_save; } /* always reset bwidth, to not interfere with BER logic */ st->bwidth = bwidth_save; } } } return; } /*-------------------------------------------------------------------* * reset_elements() Loading
lib_com/bitstream_fx.c +4 −172 Original line number Diff line number Diff line Loading @@ -143,29 +143,6 @@ void pack_bit( return; } /*-------------------------------------------------------------------* * unpack_bit() * * unpack a bit from packed octet *-------------------------------------------------------------------*/ static Word16 unpack_bit( UWord8 **pt, /* i/o: pointer to octet array from which bit will be read */ UWord8 *mask /* i/o: mask to indicate the bit in the octet */ ) { Word16 bit; bit = s_and( **pt, *mask ) != 0; *mask = (UWord8) shr( *mask, 1 ); move16(); IF( *mask == 0 ) { *mask = 0x80; move16(); ( *pt )++; } return bit; } /*-------------------------------------------------------------------* * rate2AMRWB_IOmode() Loading Loading @@ -945,154 +922,6 @@ return; } static void decoder_selectCodec( Decoder_State *st, /* i/o: decoder state structure */ const Word32 total_brate, /* i : total bitrate */ const Word16 bit0 ) { test(); test(); test(); test(); test(); test(); test(); test(); test(); /* check if we are in AMR-WB IO mode */ IF( EQ_32( total_brate, SID_1k75 ) || EQ_32( total_brate, ACELP_6k60 ) || EQ_32( total_brate, ACELP_8k85 ) || EQ_32( total_brate, ACELP_12k65 ) || EQ_32( total_brate, ACELP_14k25 ) || EQ_32( total_brate, ACELP_15k85 ) || EQ_32( total_brate, ACELP_18k25 ) || EQ_32( total_brate, ACELP_19k85 ) || EQ_32( total_brate, ACELP_23k05 ) || EQ_32( total_brate, ACELP_23k85 ) ) { st->Opt_AMR_WB = 1; move16(); } ELSE IF( total_brate != FRAME_NO_DATA ) { st->Opt_AMR_WB = 0; move16(); } /* select MODE1 or MODE2 */ IF( st->Opt_AMR_WB ) { st->codec_mode = MODE1; move16(); /**/ } ELSE { SWITCH( total_brate ) { case 0: st->codec_mode = st->last_codec_mode; move16(); BREAK; case 2400: st->codec_mode = st->last_codec_mode; move16(); BREAK; case 2800: st->codec_mode = MODE1; move16(); BREAK; case 7200: st->codec_mode = MODE1; move16(); BREAK; case 8000: st->codec_mode = MODE1; move16(); BREAK; case 9600: st->codec_mode = MODE2; move16(); BREAK; case 13200: st->codec_mode = MODE1; move16(); BREAK; case 16400: st->codec_mode = MODE2; move16(); BREAK; case 24400: st->codec_mode = MODE2; move16(); BREAK; case 32000: st->codec_mode = MODE1; move16(); BREAK; case 48000: st->codec_mode = MODE2; move16(); BREAK; case 64000: st->codec_mode = MODE1; move16(); BREAK; case 96000: st->codec_mode = MODE2; move16(); BREAK; case 128000: st->codec_mode = MODE2; move16(); BREAK; default: /* validate that total_brate (derived from RTP packet or a file header) is one of the defined bit rates */ st->codec_mode = st->last_codec_mode; st->bfi = 1; move16(); move16(); BREAK; } } IF( st->ini_frame == 0 ) { if ( EQ_16( st->codec_mode, -1 ) ) { st->codec_mode = MODE1; move16(); } st->last_codec_mode = st->codec_mode; move16(); } /* set SID/CNG type */ IF( EQ_32( total_brate, SID_2k40 ) ) { IF( EQ_16( bit0, G192_BIN0 ) ) { st->cng_type = LP_CNG; move16(); /* force MODE1 when selecting LP_CNG */ st->codec_mode = MODE1; move16(); } ELSE { st->cng_type = FD_CNG; move16(); test(); if ( EQ_16( st->last_codec_mode, MODE2 ) && EQ_32( st->last_total_brate, 13200 ) ) { st->codec_mode = MODE1; move16(); } } st->hTdCngDec->last_cng_type_fx = st->cng_type; /* CNG type switching at the first correctly received SID frame */ move16(); } return; } static void dec_prm_core( Decoder_State *st ) { Word16 n, frame_size_index, num_bits; Loading Loading @@ -1320,7 +1149,7 @@ static void decision_matrix_core_dec( * Set up MDCT core switching if indicated in the bit stream *-------------------------------------------------------------------*/ static void mdct_switching_dec( void mdct_switching_dec_fx( Decoder_State *st /* i/o: decoder state structure */ ) { Loading Loading @@ -1421,8 +1250,11 @@ static void mdct_switching_dec( move16(); } } return; } /*-------------------------------------------------------------------* * BRATE2IDX_fx() * Loading
lib_com/prot_fx.h +1 −1 Original line number Diff line number Diff line Loading @@ -11555,7 +11555,7 @@ Decoder_State **reset_elements( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); void mdct_switching_dec_ivas_fx( void mdct_switching_dec_fx( Decoder_State *st /* i/o: decoder state structure */ );
lib_dec/lib_dec_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -3396,7 +3396,7 @@ static ivas_error evs_dec_main_fx( move32(); hCoreCoder[0]->output_frame_fx = extract_l( Mult_32_16( hCoreCoder[0]->output_Fs, 0x0290 /*Q0*/ ) ); // Q0 move16(); mdct_switching_dec_ivas_fx( hCoreCoder[0] ); mdct_switching_dec_fx( hCoreCoder[0] ); FOR( ch = 0; ch < MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; ch++ ) { Loading