diff --git a/apps/decoder.c b/apps/decoder.c index 9a20474542dd7c9c05aec360909f544ebb6c735a..228cc3df4471e023b8734b9b2ead72961dcd9942 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -420,8 +420,12 @@ int main( #ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; #ifdef FIX_745_FIX_DATA_TYPE_CONVERSION +#ifdef LIB_DEC_REVISION + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#endif #else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain_fx, arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index f32acd9ad9a21fee510d937b4fe47c11235e5922..c05cf21dd5c56797cc11efa9700fa1b14572c7b7 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -4205,8 +4205,10 @@ Word64 var_32_fx( ); ivas_error ivas_jbm_dec_tc_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +#ifndef LIB_DEC_REVISION Word32 *data_fx +#endif ); ivas_error ivas_jbm_dec_flush_renderer_fx( diff --git a/lib_com/options.h b/lib_com/options.h index 8977a4d1e89b840bfcdeb0cba117008ef6a93c3f..1e47e8a68260b610243fd0c5b3d695f33562d59b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,6 +175,8 @@ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ #define FIX_1959_assert_in_gain_enc_mless_fx /* VA: Fix saturation introduced by the usage of the non-EVS basop operators =, the saturation was expected */ +#define LIB_DEC_REVISION /* VA: cleaning and simplification of lib_dec.c */ + /* #################### End BASOP porting switches ############################ */ #endif diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 6fe8fd9b0b55621b9113d9e59437f68dfa5c28b2..32b5a87441d49694fdb12c4d1881416aa971ef44 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -78,8 +78,10 @@ static Word16 ceil_fx16( Word16 inp, Word16 Q ) *--------------------------------------------------------------------------*/ ivas_error ivas_jbm_dec_tc_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - Word32 *data_fx /*Q11*/ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +#ifndef LIB_DEC_REVISION + Word32 *data_fx /*Q11*/ +#endif ) { Word16 ch, n, output_frame, nchan_out, i, ii; @@ -1504,11 +1506,15 @@ ivas_error ivas_jbm_dec_tc_fx( * Write IVAS transport channels *----------------------------------------------------------------*/ +#ifdef LIB_DEC_REVISION + IF( st_ivas->hDecoderConfig->Opt_tsm == 0 ) +#else IF( EQ_16( st_ivas->hDecoderConfig->Opt_tsm, 1 ) ) { ivas_syn_output_f_fx( p_output_fx, output_frame, st_ivas->hTcBuffer->nchan_transport_jbm, data_fx ); } ELSE +#endif { /* directly copy to tc buffers */ /*note : the q of cldfb buffers (imag/real) are needed to be Q_p_output - 5 here 6 is taken for that*/ diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index cc5185a72d7055d7a402f81fc013002a37e3daa7..968195b39af7746b25343b53a92ee90a351aa4a2 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -106,7 +106,9 @@ ivas_error IVAS_DEC_Configure( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const UWord32 sampleRate, /* i : output sampling frequency */ const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ +#ifndef LIB_DEC_REVISION const bool tsmEnabled, /* i : enable time scale modification */ + #endif const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ const bool customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const bool hrtfReaderEnabled, /* i : enable HRTF binary file input */ @@ -265,11 +267,19 @@ ivas_error IVAS_DEC_VoIP_SetScale( const Word16 scale /* i : TSM scale to set */ ); +#ifdef VARIABLE_SPEED_DECODING +#ifdef LIB_DEC_REVISION +ivas_error IVAS_DEC_EnableTsm( + IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ +); +#endif + ivas_error IVAS_DEC_TSM_SetQuality( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const Word16 quality /* i : target TSM quality Q14 */ ); +#endif /*! r: error code */ ivas_error IVAS_DEC_VoIP_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -423,12 +433,13 @@ ivas_error IVAS_DEC_HasDecodedFirstGoodFrame( bool *hasDecodedFirstGoodFrame /* o : flag indicating if the decoder has decoded a good frame since it was configured */ ); +#ifndef LIB_DEC_REVISION /*! r: error code */ ivas_error IVAS_DEC_GetPcmFrameSize( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ Word32 *pcmFrameSize /* o : total size of the PCM output frame. This takes into account the number of output channels Q0 */ ); - +#endif /*! r: true if decoder has no data in VoIP jitter buffer */ bool IVAS_DEC_VoIP_IsEmpty( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 66a890eda277db79c394fcdf04967013a0d618af..f77af14396af4c8e690c07eb7b54122aec54f9ab 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -55,7 +55,9 @@ struct IVAS_DEC_VOIP { +#ifndef LIB_DEC_REVISION UWord16 nSamplesFrame; /* Total number of samples in a frame (includes number of channels) */ +#endif JB4_HANDLE hJBM; UWord16 lastDecodedWasActive; JB4_DATAUNIT_HANDLE hCurrentDataUnit; /* Points to the currently processed data unit */ @@ -79,8 +81,10 @@ struct IVAS_DEC bool isInitialized; Word16 bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ - bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ - Word16 tsm_scale; /* scale for TSM operation */ +#ifdef DEBUGGING + bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ +#endif + Word16 tsm_scale; /* scale for TSM operation */ Word16 tsm_max_scaling; Word16 timeScalingDone; /* have we done already one TSM in a 20ms frame? */ Word16 tsm_quality; /*Q14*/ @@ -90,31 +94,50 @@ struct IVAS_DEC bool hasBeenFedFrame; bool updateOrientation; UWord16 nSamplesAvailableNext; +#ifndef LIB_DEC_REVISION Word16 nSamplesRendered; +#endif Word16 nTransportChannelsOld; Word16 amrwb_rfc4867_flag; /* MIME from rfc4867 is used */ Word16 sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ Word16 prev_ft_speech; /* RXDTX handler: previous frametype flag for G.192 format AMRWB SID_FIRST detection */ Word16 CNG; /* RXDTX handler: CNG=1, nonCNG=0 */ + + uint16_t nSamplesFlushed; + void *flushbuffer; + bool hasBeenPreparedRendering; }; /*---------------------------------------------------------------------* * Local function declarations *---------------------------------------------------------------------*/ +#ifdef LIB_DEC_REVISION +static void ivas_destroy_handle_VoIP( IVAS_DEC_VOIP *hVoIP ); +#else static void IVAS_DEC_Close_VoIP( IVAS_DEC_VOIP *hVoIP ); +#endif #ifdef SUPPORT_JBM_TRACEFILE static void store_JbmData( IVAS_DEC_VOIP *hVoIP, JB4_DATAUNIT_HANDLE dataUnit, const UWord32 systemTimestamp_ms, const UWord16 extBufferedSamples, const Word32 output_Fs ); #endif +#ifdef LIB_DEC_REVISION +static ivas_error evs_dec_main_fx( Decoder_Struct *st_ivas ); +#else static ivas_error evs_dec_main_fx( Decoder_Struct *st_ivas, const Word16 nOutSamples, Word32 *floatBuf, Word16 *pcmBuf ); +#endif static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, Word16 *bitstream_format_internal, Word16 *sdp_hf_only, const bool is_voip_enabled ); static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig ); +#ifdef LIB_DEC_REVISION +static ivas_error ivas_dec_setup_all_fx( IVAS_DEC_HANDLE hIvasDec, uint8_t *nTransportChannels, const int16_t isSplitRend, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); +static ivas_error apa_setup_fx( IVAS_DEC_HANDLE hIvasDec, const bool isInitialized_voip, const uint16_t nTransportChannels ); +#else static ivas_error IVAS_DEC_VoIP_reconfigure( IVAS_DEC_HANDLE hIvasDec, const UWord16 nTransportChannels, const UWord16 l_ts ); static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, UWord16 *nTcBufferGranularity, UWord8 *nTransportChannels, UWord8 *nOutChannels, UWord16 *nSamplesRendered, Word16 *data ); static ivas_error IVAS_DEC_GetTcSamples( IVAS_DEC_HANDLE hIvasDec, Word32 *pcmBuf_fx, Word16 *nOutSamples ); static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, const Word16 nSamplesForRendering, Word16 *nSamplesResidual, Word32 *pcmBuf ); static ivas_error IVAS_DEC_GetRenderedSamples( IVAS_DEC_HANDLE hIvasDec, const UWord16 nSamplesForRendering, UWord16 *nSamplesRendered, UWord16 *nSamplesAvailableNext, Word16 *pcmBuf ); static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( IVAS_DEC_HANDLE hIvasDec, Word16 *nSamplesBuffered ); +#endif static Word16 get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const Word16 nSamplesRendered ); static ivas_error isar_set_split_rend_setup( ISAR_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, const ISAR_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); @@ -369,7 +392,7 @@ static void init_decoder_config( /*---------------------------------------------------------------------* * IVAS_DEC_Close( ) * - * + * Deallocate IVAS decoder memory handles *---------------------------------------------------------------------*/ void IVAS_DEC_Close( @@ -385,7 +408,11 @@ void IVAS_DEC_Close( IF( ( *phIvasDec )->hVoIP ) { +#ifdef LIB_DEC_REVISION + ivas_destroy_handle_VoIP( ( *phIvasDec )->hVoIP ); +#else IVAS_DEC_Close_VoIP( ( *phIvasDec )->hVoIP ); +#endif ( *phIvasDec )->hVoIP = NULL; } @@ -446,20 +473,46 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat( return IVAS_DEC_BS_UNKOWN; } +#ifdef LIB_DEC_REVISION + +/*---------------------------------------------------------------------* + * create_flush_buffer() + * + * Create flush buffer - needed for binaural outputs with TSM or in VoIP mode + *---------------------------------------------------------------------*/ + +static ivas_error create_flush_buffer( + IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ +) +{ + hIvasDec->flushbuffer = (void *) malloc( CPE_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( int16_t ) ); + if ( hIvasDec->flushbuffer == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate JBM flush buffer" ); + } + + set_s( (int16_t *) hIvasDec->flushbuffer, 0, CPE_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); + + return IVAS_ERR_OK; +} + +#endif /*---------------------------------------------------------------------* * IVAS_DEC_Configure( ) * * Decoder configuration - * legacy code behavior: if no output format set, then it's EVS mono + * legacy behavior: if no output format set, then it's EVS mono *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_Configure( #ifdef FIX_745_FIX_DATA_TYPE_CONVERSION - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const UWord32 sampleRate, /* i : output sampling frequency */ - const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ - const bool tsmEnabled, /* i : enable time scale modification */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const UWord32 sampleRate, /* i : output sampling frequency */ + const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ +#ifndef LIB_DEC_REVISION + const bool tsmEnabled, /* i : enable time scale modification */ +#endif const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ const bool customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const bool hrtfReaderEnabled, /* i : enable HRTF binary file input */ @@ -553,7 +606,9 @@ ivas_error IVAS_DEC_Configure( } #ifdef FIX_745_FIX_DATA_TYPE_CONVERSION +#ifndef LIB_DEC_REVISION hDecoderConfig->Opt_tsm = (Word16) tsmEnabled; +#endif hDecoderConfig->Opt_LsCustom = (Word16) customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = (Word16) enableHeadRotation; #else @@ -665,7 +720,7 @@ ivas_error IVAS_DEC_Configure( /*---------------------------------------------------------------------* * IVAS_DEC_EnableSplitRendering( ) * - * Intitialize Split rendering + * Update IVAS decoder config. if Split rendering is enabled *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_EnableSplitRendering( @@ -695,7 +750,7 @@ ivas_error IVAS_DEC_EnableSplitRendering( /*---------------------------------------------------------------------* * get_render_framesize_ms( ) * - * Get the 5ms flag + * Get render framesize in ms *---------------------------------------------------------------------*/ static Word16 get_render_frame_size_ms( @@ -721,7 +776,7 @@ static Word16 get_render_frame_size_ms( /*---------------------------------------------------------------------* * IVAS_DEC_SetRenderFramesize( ) * - * Get the 5ms flag + * Set render framesize *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_SetRenderFramesize( @@ -751,10 +806,11 @@ ivas_error IVAS_DEC_SetRenderFramesize( return IVAS_ERR_OK; } + /*---------------------------------------------------------------------* * IVAS_DEC_GetGetRenderFramesize( ) * - * Get the 5ms flag + * Get render framesize *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetRenderFramesize( @@ -883,7 +939,7 @@ ivas_error IVAS_DEC_GetReferencesUpdateFrequency( /*---------------------------------------------------------------------* * IVAS_DEC_GetGetNumOrientationSubframes( ) * - * Get the number of subframes for head/ecernal orientation per render frame + * Get the number of subframes for head/external orientation per render frame *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetNumOrientationSubframes( @@ -930,10 +986,13 @@ ivas_error IVAS_DEC_EnableVoIP( hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; +#ifdef DEBUGGING hIvasDec->Opt_VOIP = 1; +#endif hDecoderConfig->Opt_tsm = 1; move16(); move16(); + IF( NE_16( (Word16) hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); @@ -953,8 +1012,10 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->hVoIP->lastDecodedWasActive = 0; move16(); hIvasDec->hVoIP->hCurrentDataUnit = NULL; +#ifndef LIB_DEC_REVISION hIvasDec->hVoIP->nSamplesFrame = (UWord16) Mpy_32_16_1( hDecoderConfig->output_Fs, INV_FRAME_PER_SEC_Q15 ); move16(); +#endif hIvasDec->hVoIP->nSamplesRendered20ms = 0; move16(); @@ -1095,9 +1156,13 @@ ivas_error IVAS_DEC_FeedFrame_Serial( hIvasDec->needNewFrame = false; hIvasDec->hasBeenFedFrame = true; +#ifndef LIB_DEC_REVISION hIvasDec->nSamplesRendered = 0; +#endif hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; +#ifndef LIB_DEC_REVISION move16(); +#endif move16(); move16(); move16(); @@ -1125,6 +1190,7 @@ ivas_error IVAS_DEC_GetSamples( Word16 nOutSamplesElse, nSamplesToRender; UWord16 nSamplesRendered, nSamplesRendered_loop, l_ts, nTimeScalerOutSamples; UWord8 nTransportChannels, nOutChannels; + Decoder_Struct *st_ivas; nSamplesRendered = 0; nOutChannels = 0; @@ -1143,13 +1209,15 @@ ivas_error IVAS_DEC_GetSamples( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } + st_ivas = hIvasDec->st_ivas; + IF( hIvasDec->updateOrientation ) { /*----------------------------------------------------------------* * Combine orientations *----------------------------------------------------------------*/ - IF( NE_32( ( error = combine_external_and_head_orientations_dec( hIvasDec->st_ivas->hHeadTrackData, hIvasDec->st_ivas->hExtOrientationData, hIvasDec->st_ivas->hCombinedOrientationData ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = combine_external_and_head_orientations_dec( st_ivas->hHeadTrackData, st_ivas->hExtOrientationData, st_ivas->hCombinedOrientationData ) ), IVAS_ERR_OK ) ) { return error; } @@ -1158,11 +1226,11 @@ ivas_error IVAS_DEC_GetSamples( * Binaural split rendering setup *----------------------------------------------------------------*/ - IF( EQ_32( hIvasDec->st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( hIvasDec->st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - IF( hIvasDec->st_ivas->hCombinedOrientationData != NULL ) + IF( st_ivas->hCombinedOrientationData != NULL ) { - isar_set_split_rend_ht_setup_fx( &hIvasDec->st_ivas->hSplitBinRend->splitrend, hIvasDec->st_ivas->hCombinedOrientationData->Quaternions, hIvasDec->st_ivas->hCombinedOrientationData->Rmat_fx ); + isar_set_split_rend_ht_setup_fx( &st_ivas->hSplitBinRend->splitrend, hIvasDec->st_ivas->hCombinedOrientationData->Quaternions, hIvasDec->st_ivas->hCombinedOrientationData->Rmat_fx ); } } @@ -1185,11 +1253,11 @@ ivas_error IVAS_DEC_GetSamples( test(); /* check if we are still at the beginning with bad frames, put out zeroes, keep track of subframes */ - IF( !hIvasDec->isInitialized && hIvasDec->st_ivas->bfi ) + IF( !hIvasDec->isInitialized && st_ivas->bfi ) { hIvasDec->hasBeenFedFrame = false; move16(); - set16_fx( pcmBuf, 0, imult1616( hIvasDec->st_ivas->hDecoderConfig->nchan_out, nSamplesAsked ) ); + set16_fx( pcmBuf, 0, imult1616( st_ivas->hDecoderConfig->nchan_out, nSamplesAsked ) ); hIvasDec->nSamplesRendered = add( hIvasDec->nSamplesRendered, nSamplesAsked ); move16(); *nOutSamples = nSamplesAsked; @@ -1223,24 +1291,68 @@ ivas_error IVAS_DEC_GetSamples( Word16 nResidualSamples, nSamplesTcsScaled; nSamplesRendered = add( nSamplesRendered, nSamplesRendered_loop ); +#ifndef LIB_DEC_REVISION test(); - IF( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm && NE_16( (Word16) nTransportChannels, hIvasDec->nTransportChannelsOld ) ) + IF( st_ivas->hDecoderConfig->Opt_tsm && NE_16( (Word16) nTransportChannels, hIvasDec->nTransportChannelsOld ) ) { IF( NE_32( ( error = IVAS_DEC_VoIP_reconfigure( hIvasDec, nTransportChannels, l_ts ) ), IVAS_ERR_OK ) ) { return error; } } +#endif + +#ifdef LIB_DEC_REVISION + /*-----------------------------------------------------------------* + * IVAS decoder: decode transport channels and metadata + *-----------------------------------------------------------------*/ + + if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) + { + if ( ( error = evs_dec_main_fx( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else if ( hIvasDec->mode == IVAS_DEC_MODE_IVAS ) + { + if ( ( error = ivas_jbm_dec_tc( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + + hIvasDec->isInitialized = true; /* Initialization done in ivas_dec() */ + } + if ( hIvasDec->hasBeenFedFirstGoodFrame ) + { + hIvasDec->hasDecodedFirstGoodFrame = true; + } +#else /* IVAS decoder */ IF( NE_32( ( error = IVAS_DEC_GetTcSamples( hIvasDec, hIvasDec->apaExecBuffer_fx, &nOutSamplesElse ) ), IVAS_ERR_OK ) ) { return error; } +#endif - /* JBM */ - IF( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) + /*-----------------------------------------------------------------* + * JBM + *-----------------------------------------------------------------*/ + + IF( st_ivas->hDecoderConfig->Opt_tsm ) { +#ifdef LIB_DEC_REVISION + if ( nTransportChannels != hIvasDec->nTransportChannelsOld ) + { + if ( ( error = apa_setup_fx( hIvasDec, isInitialized_voip, nTransportChannels ) ) != IVAS_ERR_OK ) + { + return error; + } + } + +#endif + IF( apa_set_scale_fx( hIvasDec->hTimeScaler, hIvasDec->tsm_scale ) != 0 ) { return IVAS_ERR_UNKNOWN; @@ -1269,6 +1381,11 @@ ivas_error IVAS_DEC_GetSamples( { return IVAS_ERR_UNKNOWN; } + +#ifdef LIB_DEC_REVISION + ivas_syn_output_f( hIvasDec->st_ivas->p_output_fx, hIvasDec->nSamplesFrame, nTransportChannels, hIvasDec->apaExecBuffer_fx ); + +#endif } assert( LE_32( (Word32) nTimeScalerOutSamples, APA_BUF ) ); nSamplesTcsScaled = idiv1616U( extract_l( nTimeScalerOutSamples ), nTransportChannels ); @@ -1284,7 +1401,10 @@ ivas_error IVAS_DEC_GetSamples( dbgwrite( &nTimeScalerOutSamples, sizeof( uint16_t ), 1, 1, "./res/JBM_nTimeScaleOutSamples.dat" ); #endif - /* Feed decoded transport channels samples to the renderer */ + /*-----------------------------------------------------------------* + * Feed decoded transport channels samples to the renderer + *-----------------------------------------------------------------*/ + IF( NE_32( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer_fx ) ), IVAS_ERR_OK ) ) { return error; @@ -1293,8 +1413,7 @@ ivas_error IVAS_DEC_GetSamples( dbgwrite( &nResidualSamples, sizeof( int16_t ), 1, 1, "./res/JBM_nResidualSamples.dat" ); #endif - - IF( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) + IF( st_ivas->hDecoderConfig->Opt_tsm ) { /* feed residual samples to TSM for the next call */ IF( apa_set_renderer_residual_samples( hIvasDec->hTimeScaler, (UWord16) nResidualSamples ) != 0 ) @@ -1340,7 +1459,7 @@ return IVAS_ERR_OK; /*---------------------------------------------------------------------* * IVAS_DEC_GetSplitBinauralBitstream( ) * - * + * Get split-rendering bitstream *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetSplitBinauralBitstream( @@ -1417,8 +1536,8 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( move16(); IF( NE_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_20MS ) && - ( EQ_32( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) || - EQ_16( hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof, 0 ) ) ) + ( EQ_32( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) || + EQ_16( st_ivas->hRenderConfig->split_rend_config.dof, 0 ) ) ) { numSamplesPerChannelToDecode = (Word16) ( output_Fs / FRAMES_PER_SEC ); // TODO remove division numSamplesPerChannelToDecode = (Word16) ( numSamplesPerChannelToDecode / MAX_PARAM_SPATIAL_SUBFRAMES ); // TODO remove division @@ -1698,6 +1817,7 @@ static ivas_error IVAS_DEC_Setup( { return error; } + test(); IF( ( st_ivas->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_PARAMMC ) ) { @@ -1832,7 +1952,11 @@ static ivas_error IVAS_DEC_GetTcSamples( IF( EQ_16( (Word16) hIvasDec->mode, IVAS_DEC_MODE_EVS ) ) { +#ifdef LIB_DEC_REVISION + IF( NE_32( ( error = evs_dec_main_fx( st_ivas ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = evs_dec_main_fx( st_ivas, *nOutSamples, pcmBuf_fx, NULL ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -1885,7 +2009,11 @@ static ivas_error IVAS_DEC_GetTcSamples( } /* Function call: ivas_jbm_dec_tc function */ +#ifdef LIB_DEC_REVISION + IF( NE_32( ( error = ivas_jbm_dec_tc_fx( st_ivas ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_jbm_dec_tc_fx( st_ivas, pcmBuf_fx ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -2135,7 +2263,7 @@ ivas_error IVAS_DEC_GetFormat( /*---------------------------------------------------------------------* * getInputBufferSize() * - * + * Get size of output buffer in samples *---------------------------------------------------------------------*/ static Word16 getOutputBufferSize( @@ -2170,7 +2298,7 @@ static Word16 getOutputBufferSize( /*---------------------------------------------------------------------* * IVAS_DEC_GetOutputBufferSize() * - * + * Returns size of output buffer in samples *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetOutputBufferSize( @@ -2460,7 +2588,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( /*---------------------------------------------------------------------* * IVAS_DEC_FeedRefRotData( ) * - * Feed the decoder with the reference rotation + * Feed the decoder with the reference rotation data *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedRefRotData( @@ -2809,7 +2937,7 @@ static ivas_error copyRendererConfigStruct( /*---------------------------------------------------------------------* * IVAS_DEC_GetRenderConfig( ) * - * + * Return renderer configuration parameters handle *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetRenderConfig( @@ -2829,6 +2957,12 @@ ivas_error IVAS_DEC_GetRenderConfig( } +/*---------------------------------------------------------------------* + * IVAS_DEC_GetDefaultRenderConfig( ) + * + * Return default renderer configuration parameters + *---------------------------------------------------------------------*/ + /*! r: error code*/ ivas_error IVAS_DEC_GetDefaultRenderConfig( IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render config handle */ @@ -2850,7 +2984,7 @@ ivas_error IVAS_DEC_GetDefaultRenderConfig( /*---------------------------------------------------------------------* * IVAS_DEC_FeedRenderConfig( ) * - * + * Set renderer configuration (acoustic environment) parameters *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedRenderConfig( @@ -2859,6 +2993,7 @@ ivas_error IVAS_DEC_FeedRenderConfig( ) { RENDER_CONFIG_HANDLE hRenderConfig; + Decoder_Struct *st_ivas; ivas_error error; test(); @@ -2869,6 +3004,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( } hRenderConfig = hIvasDec->st_ivas->hRenderConfig; + st_ivas = hIvasDec->st_ivas; + #ifndef FIX_587_DEFAULT_REVERB hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; #endif @@ -2902,9 +3039,9 @@ ivas_error IVAS_DEC_FeedRenderConfig( /* Re-initialize reverb instance if already available */ /* TD renderer Jot reverberator */ - IF( hIvasDec->st_ivas->hReverb != NULL ) + IF( st_ivas->hReverb != NULL ) { - IF( ( error = ivas_reverb_open_fx( &hIvasDec->st_ivas->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hRenderConfig, hIvasDec->st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } @@ -2913,9 +3050,9 @@ ivas_error IVAS_DEC_FeedRenderConfig( /* CREND Jot reverberator */ test(); test(); - IF( hIvasDec->st_ivas->hCrendWrapper != NULL && hIvasDec->st_ivas->hCrendWrapper->hCrend[0] != NULL && hIvasDec->st_ivas->hCrendWrapper->hCrend[0]->hReverb != NULL ) + IF( st_ivas->hCrendWrapper != NULL && st_ivas->hCrendWrapper->hCrend[0] != NULL && st_ivas->hCrendWrapper->hCrend[0]->hReverb != NULL ) { - IF( ( error = ivas_reverb_open_fx( &hIvasDec->st_ivas->hCrendWrapper->hCrend[0]->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hRenderConfig, hIvasDec->st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_reverb_open_fx( &st_ivas->hCrendWrapper->hCrend[0]->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } @@ -2923,13 +3060,13 @@ ivas_error IVAS_DEC_FeedRenderConfig( test(); /* FB reverberator */ - IF( hIvasDec->st_ivas->hDiracDecBin[0] != NULL && hIvasDec->st_ivas->hDiracDecBin[0]->hReverb != NULL ) + IF( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->hReverb != NULL ) { - ivas_binaural_reverb_close_fx( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ) ); + ivas_binaural_reverb_close_fx( &( st_ivas->hDiracDecBin[0]->hReverb ) ); #ifdef FIX_1139_REV_COLORATION_SHORT_T60 - IF( ( error = ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_binaural_reverb_init( &( st_ivas->hDiracDecBin[0]->hReverb ), st_ivas->hHrtfStatistics, st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) #else - IF( ( error = ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_binaural_reverb_init( &( st_ivas->hDiracDecBin[0]->hReverb ), st_ivas->hHrtfStatistics, st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, NULL, NULL ) ) != IVAS_ERR_OK ) #endif { return error; @@ -2938,13 +3075,13 @@ ivas_error IVAS_DEC_FeedRenderConfig( test(); /* Fastconv CLDFB reverberator */ - IF( hIvasDec->st_ivas->hBinRenderer != NULL && hIvasDec->st_ivas->hBinRenderer->hReverb != NULL ) + IF( st_ivas->hBinRenderer != NULL && st_ivas->hBinRenderer->hReverb != NULL ) { - ivas_binaural_reverb_close_fx( &( hIvasDec->st_ivas->hBinRenderer->hReverb ) ); + ivas_binaural_reverb_close_fx( &( st_ivas->hBinRenderer->hReverb ) ); #ifdef FIX_1139_REV_COLORATION_SHORT_T60 - IF( ( error = ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hBinRenderer->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hBinRenderer->conv_band, hIvasDec->st_ivas->hBinRenderer->timeSlots, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_binaural_reverb_init( &( st_ivas->hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, st_ivas->hBinRenderer->conv_band, st_ivas->hBinRenderer->timeSlots, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL, NULL ) ) != IVAS_ERR_OK ) #else - IF( ( error = ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hBinRenderer->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hBinRenderer->conv_band, hIvasDec->st_ivas->hBinRenderer->timeSlots, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL ) ) != IVAS_ERR_OK ) + IF( ( error = ivas_binaural_reverb_init( &( st_ivas->hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, st_ivas->hBinRenderer->conv_band, st_ivas->hBinRenderer->timeSlots, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL ) ) != IVAS_ERR_OK ) #endif { return error; @@ -2965,7 +3102,7 @@ ivas_error IVAS_DEC_FeedRenderConfig( hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; } - IF( is_split_rendering_enabled( hIvasDec->st_ivas->hDecoderConfig, hRenderConfig ) ) + IF( is_split_rendering_enabled( st_ivas->hDecoderConfig, hRenderConfig ) ) { IF( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) { @@ -3057,7 +3194,7 @@ ivas_error IVAS_DEC_GetDelay( /*---------------------------------------------------------------------* * IVAS_DEC_HasDecodedFirstGoodFrame( ) * - * + * Return flag indicating if the decoder has decoded a good frame *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_HasDecodedFirstGoodFrame( @@ -3078,6 +3215,7 @@ ivas_error IVAS_DEC_HasDecodedFirstGoodFrame( return IVAS_ERR_OK; } +#ifndef LIB_DEC_REVISION /*---------------------------------------------------------------------* * IVAS_DEC_GetPcmFrameSize( ) @@ -3110,6 +3248,8 @@ ivas_error IVAS_DEC_GetPcmFrameSize( return IVAS_ERR_OK; } +#endif + /*---------------------------------------------------------------------* * isSidFrame( ) @@ -3136,6 +3276,13 @@ static bool isSidFrame( return false; } + +/*---------------------------------------------------------------------* + * bsCompactToSerial( ) + * + * Bitstream conversion to Byte format + *---------------------------------------------------------------------*/ + static void bsCompactToSerial( const UWord8 *compact, UWord16 *serial, @@ -3327,6 +3474,51 @@ ivas_error IVAS_DEC_VoIP_SetScale( return IVAS_ERR_OK; } +#ifdef VARIABLE_SPEED_DECODING +#ifdef LIB_DEC_REVISION + +/*---------------------------------------------------------------------* + * IVAS_DEC_EnableTsm( ) + * + * Enable Time-Scale Modification (TSM) + *---------------------------------------------------------------------*/ + +ivas_error IVAS_DEC_EnableTsm( + IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ +) +{ + AUDIO_CONFIG output_config; + ivas_error error; + + test(); + IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + hIvasDec->st_ivas->hDecoderConfig->Opt_tsm = 1; + move16(); + + /* Init flush buffer if necessary (only needed for binaural) */ + output_config = hIvasDec->st_ivas->hDecoderConfig->output_config; + + test(); + test(); + test(); + test(); + test(); + IF( hIvasDec->flushbuffer == NULL && ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) + { + IF( ( error = create_flush_buffer( hIvasDec ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + return IVAS_ERR_OK; +} + +#endif /*---------------------------------------------------------------------* * IVAS_DEC_TSM_SetQuality( ) @@ -3369,6 +3561,7 @@ ivas_error IVAS_DEC_TSM_SetQuality( return IVAS_ERR_OK; } +#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_GetSamples( ) @@ -3432,10 +3625,19 @@ ivas_error IVAS_DEC_VoIP_GetSamples( move16(); IF( hIvasDec->hasBeenFedFirstGoodFrame ) { +#ifdef LIB_DEC_REVISION + /* check if the TC buffer already exists, otherweise nothing is buffered anyway */ + if ( st_ivas->hTcBuffer != NULL ) + { + nSamplesBuffered = st_ivas->hTcBuffer->n_samples_buffered - st_ivas->hTcBuffer->n_samples_rendered; + nSamplesBuffered += hVoIP->nSamplesRendered20ms; + } +#else IF( NE_32( ( error = IVAS_DEC_GetBufferedNumberOfSamples( hIvasDec, &nSamplesBuffered ) ), IVAS_ERR_OK ) ) { return error; } +#endif } extBufferedSamples = nSamplesBuffered; @@ -3551,8 +3753,10 @@ ivas_error IVAS_DEC_VoIP_GetSamples( IF( !hIvasDec->hasBeenFedFirstGoodFrame ) { hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; +#ifndef LIB_DEC_REVISION hIvasDec->nSamplesRendered = 0; move16(); +#endif move16(); } } @@ -3595,7 +3799,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( /*---------------------------------------------------------------------* * update_voip_rendered20ms( ) * - * Function to flush remaining audio in VoIP + * pdate the number of samples that have been rendered since the last 20ms render border *---------------------------------------------------------------------*/ static void update_voip_rendered20ms( @@ -3607,7 +3811,11 @@ static void update_voip_rendered20ms( nSamplesRenderedTotal = add( hIvasDec->hVoIP->nSamplesRendered20ms, nSamplesRendered ); /* we have crossed a 20ms border, reset the time scaling done flag */ +#ifdef LIB_DEC_REVISION + IF( GE_16( nSamplesRenderedTotal, hIvasDec->nSamplesFrame ) ) +#else IF( GE_16( nSamplesRenderedTotal, hIvasDec->hVoIP->nSamplesFrame ) ) +#endif { hIvasDec->timeScalingDone = 0; move16(); @@ -3628,7 +3836,7 @@ static void update_voip_rendered20ms( /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_Flush( ) * - * Function to flush remaining audio in VoIP + * Function to flush remaining audio samples in VoIP *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_Flush( @@ -3726,12 +3934,16 @@ ivas_error IVAS_DEC_VoIP_Get_CA_offset( /*---------------------------------------------------------------------* - * IVAS_DEC_Close_VoIP( ) - * + * ivas_destroy_handle_VoIP( ) * + * Deallocate VoIP handle *---------------------------------------------------------------------*/ +#ifdef LIB_DEC_REVISION +static void ivas_destroy_handle_VoIP( +#else static void IVAS_DEC_Close_VoIP( +#endif IVAS_DEC_VOIP *hVoIP /* i/o: IVAS decoder handle */ ) { @@ -4264,6 +4476,18 @@ static ivas_error input_format_API_to_internal( } +#ifdef LIB_DEC_REVISION +/*---------------------------------------------------------------------* + * apa_setup() + * + * Setup APA decoder + *---------------------------------------------------------------------*/ + +static ivas_error apa_setup_fx( + IVAS_DEC_HANDLE hIvasDec, + const bool isInitialized_voip, + const uint16_t nTransportChannels ) +#else /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_reconfigure() * @@ -4274,6 +4498,7 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( IVAS_DEC_HANDLE hIvasDec, const UWord16 nTransportChannels, const UWord16 l_ts ) +#endif { Word16 apa_buffer_size; @@ -4283,9 +4508,10 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( IF( hIvasDec->apaExecBuffer_fx == NULL ) { DECODER_CONFIG_HANDLE hDecoderConfig; - +#ifndef LIB_DEC_REVISION IF( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { +#endif UWord16 wss, css; Word32 startQuality; @@ -4350,7 +4576,9 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( } set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ); +#ifndef LIB_DEC_REVISION } +#endif } ELSE { @@ -4472,7 +4700,7 @@ ivas_error IVAS_DEC_GetCldfbSamples( /*-------------------------------------------------------------------* * ivas_create_handle_isar() * - * Initialize IVAS decoder split rend handle + * Initialize IVAS decoder split-rendering handle *-------------------------------------------------------------------*/ static ivas_error ivas_create_handle_isar( @@ -4758,7 +4986,7 @@ static ivas_error ivas_dec_init_split_rend( /*---------------------------------------------------------------------* * IVAS_DEC_is_split_rendering_coded_out() * - * + * Return flag to indicate if split rendering is enabled *---------------------------------------------------------------------*/ Word16 IVAS_DEC_is_split_rendering_coded_out(