diff --git a/lib_com/options.h b/lib_com/options.h index 5b454dba8a0bc080425e4a666bddbd7f90e7126e..2512ff1d0cfb05b0488be3f7e68b19779a2f547f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -97,6 +97,7 @@ #define FIX_2437_HARMONIZE_ENCODERINDEX /* FhG: basop issue 2437 EncoderIndex_ivas_fx() and EncoderIndex_fx()*/ #define FIX_2385_GETTCXONLY /* FhG: issue 2385 : harmonizing getTcxonly_ivas_fx() and getTcxonly_ivas_fx() functions */ #define FIX_2196_UNREACHABLE_CODE_IN_OSBA_STEREO_OUTPUT /* FhG: remove unreachable code in ivas_osba_stereo_add_channels */ +#define FIX_OUTPUT_FRAME /* VA: harmonize "output_frame" parameter usage to correspond to FLP */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/amr_wb_dec_fx.c b/lib_dec/amr_wb_dec_fx.c index 3806f8c2a920021b5ce46b0a7d6d7d62c7539b25..076fa9f7d0e83fa9df3ac86b13b8329475e48504 100644 --- a/lib_dec/amr_wb_dec_fx.c +++ b/lib_dec/amr_wb_dec_fx.c @@ -136,8 +136,12 @@ ivas_error amr_wb_dec_fx( move16(); st_fx->coder_type = GENERIC; move16(); +#ifdef FIX_OUTPUT_FRAME + output_frame = extract_l( Mult_32_16( st_fx->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); +#else output_frame = st_fx->output_frame_fx; /*Q0*/ move16(); /* frame length of the input signal */ +#endif st_fx->bpf_off = 0; move16(); diff --git a/lib_dec/core_dec_init_fx.c b/lib_dec/core_dec_init_fx.c index c8ff02d0af1f2b773edb1120e0a3bd4704abf64c..a71fe3d3e3d4cf40ec0837782131db01552a301c 100644 --- a/lib_dec/core_dec_init_fx.c +++ b/lib_dec/core_dec_init_fx.c @@ -747,7 +747,11 @@ void open_decoder_LPD_fx( test(); IF( EQ_16( st->core, ACELP_CORE ) && EQ_16( st->last_core, HQ_CORE ) ) { +#ifdef FIX_OUTPUT_FRAME + frame_ener_fx( st->hTcxDec->L_frameTCX, UNVOICED_CLAS, st->previoussynth_fx, -1, &st->enr_old_fx, 1, 0, 0, 0 ); +#else frame_ener_fx( st->output_frame_fx, UNVOICED_CLAS, st->previoussynth_fx, -1, &st->enr_old_fx, 1, 0, 0, 0 ); +#endif } } ELSE @@ -1182,8 +1186,10 @@ void open_decoder_LPD_ivas_fx( { st->hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); move16(); +#ifndef FIX_OUTPUT_FRAME st->output_frame_fx = st->hTcxDec->L_frameTCX; /* Q0 */ move16(); +#endif if ( st->ini_frame == 0 ) { st->L_frameTCX_past = st->hTcxDec->L_frameTCX; @@ -1806,9 +1812,13 @@ void open_decoder_LPD_ivas_fx( test(); IF( st->core == ACELP_CORE && EQ_16( st->last_core, HQ_CORE ) ) { +#ifdef FIX_OUTPUT_FRAME + frame_ener_fx( st->hTcxDec->L_frameTCX, UNVOICED_CLAS, st->previoussynth_fx, -1, &st->enr_old_fx, 1, 0, 0, 0 ); +#else st->output_frame_fx = st->hTcxDec->L_frameTCX; /* Q0 */ move16(); frame_ener_fx( st->output_frame_fx, UNVOICED_CLAS, st->previoussynth_fx, -1, &st->enr_old_fx, 1, 0, 0, 0 ); +#endif } } ELSE diff --git a/lib_dec/core_dec_switch_fx.c b/lib_dec/core_dec_switch_fx.c index 5c824532e509ffcadec103225bc849184731f1e0..94b4ae0b40a5aa52c5ef78ba1569c5ebfbd661dd 100644 --- a/lib_dec/core_dec_switch_fx.c +++ b/lib_dec/core_dec_switch_fx.c @@ -338,8 +338,10 @@ void mode_switch_decoder_LPD_ivas_fx( { st->hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); /* Q0 */ move16(); +#ifndef FIX_OUTPUT_FRAME st->output_frame_fx = st->hTcxDec->L_frameTCX; /* Q0 */ move16(); +#endif } IF( st->hTcxCfg != NULL ) diff --git a/lib_dec/evs_dec_fx.c b/lib_dec/evs_dec_fx.c index 97be28a27de5989804772fadb3d9a1771f017f44..554e4e575e524ec8e652179e78ef5d6a422781e1 100644 --- a/lib_dec/evs_dec_fx.c +++ b/lib_dec/evs_dec_fx.c @@ -97,7 +97,11 @@ ivas_error evs_dec_fx( move16(); } +#ifdef FIX_OUTPUT_FRAME + output_frame = extract_l( Mult_32_16( st_fx->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); +#else output_frame = st_fx->output_frame_fx; /*Q0*/ +#endif move16(); core_switching_flag = 0; diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index cbf28203793ef8e8b8876e4b530c97a315ad1297..25b72bb8205e538185f95c5eca23537c5b11eb3c 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -5587,10 +5587,14 @@ static ivas_error evs_dec_main_fx( hCoreCoder = st_ivas->hSCE[0]->hCoreCoder; hCoreCoder[0]->total_brate = st_ivas->hDecoderConfig->ivas_total_brate; move32(); +#ifdef FIX_OUTPUT_FRAME + nOutSamples = extract_l( Mult_32_16( st_ivas->hDecoderConfig->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); +#else hCoreCoder[0]->output_frame_fx = extract_l( Mult_32_16( hCoreCoder[0]->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); // Q0 move16(); nOutSamples = hCoreCoder[0]->output_frame_fx; move16(); +#endif mdct_switching_dec_fx( hCoreCoder[0] ); diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index eafc5dd8a2cae335c68025f2f52f2d68ea8d9667..655aae6aec5cd7b40fb16a21637ecd25e19b0cbd 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -1027,14 +1027,16 @@ typedef struct Decoder_State Word16 mdct_sw; /* MDCT switching indicator */ Word16 last_codec_mode; /* last used codec mode */ - UWord16 *bit_stream; /* pointer to bitstream buffer */ - Word16 next_bit_pos; /* position of the next bit to be read from the bitstream */ - Word16 bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ - Word16 sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ - Word16 amrwb_rfc4867_flag; /* MIME from rfc4867 is used */ - Word16 BER_detect; /* flag to signal detected bit error in the bitstream */ - Word32 output_Fs; /* output sampling rate */ - Word16 output_frame_fx; /* Output frame length Q0*/ + UWord16 *bit_stream; /* pointer to bitstream buffer */ + Word16 next_bit_pos; /* position of the next bit to be read from the bitstream */ + Word16 bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ + Word16 sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ + Word16 amrwb_rfc4867_flag; /* MIME from rfc4867 is used */ + Word16 BER_detect; /* flag to signal detected bit error in the bitstream */ + Word32 output_Fs; /* output sampling rate */ +#ifndef FIX_OUTPUT_FRAME + Word16 output_frame_fx; /* Output frame length Q0*/ +#endif Word32 total_brate; /* total bitrate in kbps of the codec */ Word32 last_total_brate; /* last total bitrate in kbps of the codec */ Word32 last_total_brate_ber; /* last total bitrate in kbps of the codec - used only when first frame is lost and BER is detected afterwards */ @@ -1505,7 +1507,6 @@ typedef struct Decoder_State Word16 igf; CLDFB_SCALE_FACTOR scaleFactor; - /*----------------------------------------------------------------------------------* * TEC *----------------------------------------------------------------------------------*/