diff --git a/apps/renderer.c b/apps/renderer.c index 6f5bebe8ae14dead48e8e3cf3e8369c6cd9c070a..8256f1e467ba927f5fd9c46fdf1250ac3395db6c 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -76,9 +76,7 @@ #define IVAS_MAX16B_FX 32767 #define IVAS_MIN16B_FX ( -32768 ) -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS #define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f ) -#endif #if !defined( DEBUGGING ) && !defined( WMOPS ) static @@ -665,7 +663,6 @@ static void setupWithSingleFormatInput( positionProvider->numObjects = args.inConfig.numAudioObjects; for ( int16_t i = 0; i < positionProvider->numObjects; ++i ) { -#ifdef FIX_1376_MISSING_ISM_METADATA /* Check if path to metadata file was given */ if ( isEmptyString( args.inMetadataFilePaths[i] ) ) { @@ -674,18 +671,11 @@ static void setupWithSingleFormatInput( } /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string contains "NULL" */ -#else - /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string is empty or contains "NULL" */ -#endif char charBuf[FILENAME_MAX]; strncpy( charBuf, args.inMetadataFilePaths[i], min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1 ); charBuf[min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1] = '\0'; to_upper( charBuf ); -#ifdef FIX_1376_MISSING_ISM_METADATA if ( strncmp( charBuf, "NULL", 4 ) == 0 ) -#else - if ( isEmptyString( args.inMetadataFilePaths[i] ) || strncmp( charBuf, "NULL", 4 ) == 0 ) -#endif { continue; } @@ -1304,30 +1294,22 @@ int main( } } -#ifndef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS - /* Set the total number of objects */ -#endif if ( args.inConfig.numAudioObjects > 0 ) { -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Set the total number of objects */ -#endif if ( ( error = IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Set the metadata delay for objects */ -#endif IF( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* For OMASA input and BINAURAL output, apply a gain to objects to match the loudness with MASA part */ if ( args.inConfig.numMasaBuses > 0 && args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL ) @@ -1337,7 +1319,6 @@ int main( args.inConfig.audioObjects[i].gain_dB += OMASA_TDREND_MATCHING_GAIN_DB; } } -#endif } IVAS_REND_LfePanMtx lfePanMatrix; @@ -1373,7 +1354,6 @@ int main( { masaIds[i] = 0u; } -#ifdef NONBE_1377_REND_DIRATT_CONF #ifdef FIX_1377_HANDLE_ERROR_CODE if ( ( error = IVAS_REND_SetObjectIDs( hIvasRend ) ) != IVAS_ERR_OK ) { @@ -1382,7 +1362,6 @@ int main( } #else IVAS_REND_SetObjectIDs( hIvasRend ); -#endif #endif for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) @@ -3893,20 +3872,10 @@ static void parseCombinedFormatInput( inConfig->numAmbisonicsBuses = 1; inConfig->ambisonicsBuses[0].audioConfig = audioConfig; inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects; -#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS inConfig->ambisonicsBuses[0].gain_dB = 0.f; -#else - inConfig->ambisonicsBuses[0].gain_dB = -6.f; -#endif *configString += 4; /* Modify input gain for objects too */ -#ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS - for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i ) - { - inConfig->audioObjects[i].gain_dB = -6.f; - } -#endif } else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 97dd19f18105dfc973816c5a85c67b62a91c46b3..ed4bd3f1e737daf416d2c9d053bf96749adec96a 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -668,9 +668,7 @@ enum #define ACELP_TCX_TRANS_NS 1250000 /* Duration of the ACELP->TCX overlap - 1.25 ms */ #define L_FRAME_MAX L_FRAME48k /* Max 20ms frame size @48kHz */ #define L_FRAME_PLUS 1200 /* Max frame size (long TCX frame) */ -#ifdef FIX_1320_STACK_CPE_DECODER #define L_FRAME_PLUS_INTERNAL 800 /* Max frame size (long TCX frame) at maximum internal sampling rate */ -#endif #define L_MDCT_OVLP_MAX NS2SA( 48000, ACELP_LOOK_NS ) /* = Max mdct overlap */ #define N_TCX10_MAX 480 /* Max size of TCX10 MDCT spectrum */ #define BITS_TEC 1 /* number of bits for TEC */ diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 335721a0afaaf6ffa515a3eeedfba766409c46ce..a41ff84f5743aa388c32bcfddb5ca5665e9ea188 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -192,13 +192,8 @@ typedef enum #define JBM_CLDFB_SLOTS_IN_SUBFRAME_LOG2 2 /* To be used for shift operation instead of division */ #define MAX_JBM_CLDFB_TIMESLOTS 32 #define DEFAULT_JBM_CLDFB_TIMESLOTS 16 -#ifdef JBM_MEMORY_OPT #define MAX_JBM_L_FRAME48k ( IVAS_MAX_FRAME_SIZE * 2 ) /* 1920: max. time-scaled frame buffer length (per channel) in samples */ #define MAX_JBM_L_FRAME_NS 40000000L /* 40 ms: time-scaled frame size in ns, proportional to MAX_JBM_L_FRAME48k */ -#else -#define MAX_JBM_L_FRAME48k 1920 -#define MAX_JBM_L_FRAME_NS 40000000L -#endif #define MAX_SPAR_INTERNAL_CHANNELS IVAS_SPAR_MAX_CH #define MAX_CLDFB_DIGEST_CHANNELS 3 /* == maximum of ParamISM TCs and ParamMC TCs */ diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 64209e04edeef2c95179df46b9de550fb8deb32c..563fdeb367b47f902fe2777819ab69832515aee6 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -128,9 +128,7 @@ typedef enum IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT, IVAS_ERR_NO_FILE_OPEN, IVAS_ERR_SAMPLING_RATE_UNKNOWN, -#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT, -#endif /*----------------------------------------* * renderer (lib_rend only) * @@ -278,10 +276,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Invalid input format"; case IVAS_ERR_INVALID_INDEX: return "Invalid index"; -#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK case IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT: return "Euler angles were detected in the input but only Quaternions are supported"; -#endif default: break; } diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index db13b368bcdad53b0a58feec8190799320ba7f06..1adc3d5de24fe3ce9fca12ef2e56146831ecb8bb 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -1044,12 +1044,7 @@ void ivas_omasa_separate_object_render_jbm_fx( const UWord16 nSamplesRendered, /* i : number of samples rendered */ Word32 input_fx_in[][L_FRAME48k], /* i : separated object signal */ Word32 *output_fx[], /* o : rendered time signal */ -#ifdef FIX_1330_JBM_MEMORY const Word16 subframes_rendered /* i : number of subframes rendered */ -#else - const Word16 subframes_rendered, /* i : number of subframes rendered */ - const Word16 slots_rendered /* i : number of CLDFB slots rendered */ -#endif ); void get_panning_gain_fx( @@ -2079,7 +2074,6 @@ UWord32 ivas_syn_output_fx( Word16 *synth_out /* o : integer 16 bits synthesis signal */ ); -#ifdef JBM_MEMORY_OPT void ivas_buffer_interleaved_to_deinterleaved_fx( Word32 *audio, /* i/o: audio buffer */ const Word16 n_channels, /* i : number of channels */ @@ -2094,7 +2088,6 @@ void ivas_buffer_deinterleaved_to_interleaved_fx( Word32 *audio_out /* o : interleaved audio buffer */ ); -#endif void stereo_tcx_core_dec_fx( Decoder_State *st, /* i/o: decoder state structure */ const FRAME_MODE frameMode, /* i : Decoder frame mode */ @@ -2309,13 +2302,8 @@ void ivas_dirac_dec_render_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output_fx[], /* i/o: synthesized core-coder transport channels/DirAC output */ const Word16 nchan_transport, /* i : number of transport channels */ -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX], Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] -#else - Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], - Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] -#endif ); void ivas_dirac_dec_render_fx( @@ -4005,28 +3993,15 @@ void inverseMS_fx( const Word32 norm_fac /* i : normalization factor Q31*/ ); -#ifndef JBM_MEMORY_OPT -void ivas_syn_output_f_fx( - Word32 *synth[], /* i/o: Word32 synthesis signal */ - const Word16 output_frame, /* i : output frame length (one channel) */ - const Word16 n_channels, /* i : number of output channels */ - Word32 *synth_out /* o : integer 16 bits synthesis signal */ -); -#endif ivas_error ivas_init_encoder_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); ivas_error ivas_output_buff_dec_fx( Word32 *p_output_fx[], /* i/o: output audio buffers */ -#ifdef FIX_1330_JBM_MEMORY const Word16 nchan_out_buff, /* i : number of output channels */ const Word16 Opt_tsm, /* i : TSM option flag */ DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */ -#else - const Word16 nchan_out_buff_old, /* i : previous frame number of output channels */ - const Word16 nchan_out_buff /* i : number of output channels */ - #endif ); ivas_error ivas_dec_get_format_fx( @@ -6191,10 +6166,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const Word16 nSamplesForRendering, /* i : number of TC samples available for rendering */ Word16 *nSamplesResidual /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ -#ifndef JBM_MEMORY_OPT - , - Word32 *data_fx /* i/o: transport channels/output synthesis signal */ -#endif ); void ivas_dec_prepare_renderer_fx( diff --git a/lib_com/ivas_tools_fx.c b/lib_com/ivas_tools_fx.c index 973837ac0afa15a9f554639079b0c04044a3f653..d8ea700fc00a643717937206685483a912fef52b 100644 --- a/lib_com/ivas_tools_fx.c +++ b/lib_com/ivas_tools_fx.c @@ -149,7 +149,6 @@ UWord32 ivas_syn_output_fx( return noClipping; /*Q0*/ } -#ifdef JBM_MEMORY_OPT /*-------------------------------------------------------------------* * ivas_buffer_interleaved_to_deinterleaved() @@ -202,25 +201,19 @@ void ivas_buffer_deinterleaved_to_interleaved_fx( ) { Word16 ch, m; -#ifdef FIX_1330_JBM_MEMORY Word32 buffer[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* temp buffer needed when "*audio[]" and "*audio_out[]" are the same */ FOR( ch = 0; ch < n_channels; ch++ ) { Copy32( audio[ch], buffer[ch], frame_length ); } -#endif FOR( ch = 0; ch < n_channels; ch++ ) { FOR( m = 0; m < frame_length; m++ ) { -#ifdef FIX_1330_JBM_MEMORY audio_out[m * n_channels + ch] = buffer[ch][m]; -#else - audio_out[m * n_channels + ch] = audio[ch][m]; -#endif move32(); } } @@ -228,42 +221,6 @@ void ivas_buffer_deinterleaved_to_interleaved_fx( return; } -#else - -/*-------------------------------------------------------------------* - * ivas_syn_output_f() - * - * Output ivas synthesis signal with compensation for saturation - * returns number of clipped samples - *-------------------------------------------------------------------*/ - -/*! r: number of clipped samples */ -void ivas_syn_output_f_fx( - Word32 *synth[], /* i/o: float synthesis signal Q11*/ - const Word16 output_frame, /* i : output frame length (one channel) Q0*/ - const Word16 n_channels, /* i : number of output channels Q0*/ - Word32 *synth_out /* o : integer 16 bits synthesis signal Q11*/ -) -{ - Word16 i, n; - - /*-----------------------------------------------------------------* - * float to integer conversion with saturation control - *-----------------------------------------------------------------*/ - - FOR( n = 0; n < n_channels; n++ ) - { - FOR( i = 0; i < output_frame; i++ ) - { - synth_out[( ( i * n_channels ) + n )] = synth[n][i]; /*Q11*/ - move16(); - } - } - - return; -} - -#endif /*-------------------------------------------------------------------* * mvr2r_inc() diff --git a/lib_com/options.h b/lib_com/options.h index 67f7d8cc9a5081f50b9b2d48aa5a7b51ffb7fe53..34abbfeebf23fe85ba5a947ffc0888d271aec57c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -114,37 +114,20 @@ /* #################### Start BASOP porting switches ############################ */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define NONBE_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328 */ -#define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ -#define FIX_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */ -#define NONBE_FIX_1376_MDCT_CONCEALMENT /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */ -#define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ #define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ #define FIX_1053_REVERB_RECONFIGURATION #define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_938_COMPILER_WARNING /* FhG: Fix compiler warning in ivas_mdct_core_reconstruct() */ -#define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ #define FIX_1385_INIT_IGF_STOP_FREQ /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */ #define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ #define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ #define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ #define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ #define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ -#define FIX_1288_SPLIT_REND_XSAN /* Dlb: Fix asan, msan and usan issues in split rendering mode*/ -#define FIX_NCHAN_BUFFERS /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */ -#define FIX_RENDERER_STACK /* VA: issue 1322: reduction of renderers' buffers size */ -#define JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ -#define NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */ -#define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ -#define CODE_IMPROVEMENTS -#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */ -#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ -#define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ #define FIX_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ @@ -160,9 +143,7 @@ #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES // Nokia: Fix 1399_1400 issue in float, this is essential for the BASOP porting #define OBJ_EDIT_BASOP -#define FIX_1372_OSBA_OBJECT_EDITING /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */ #define FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES /* Nokia: Issue 2140, fixes three different sanitizer issues persisting in object editing code. */ -#define NONBE_FIX_1172_OBJ_EDIT_JBM /* VA: issue 1172: fix OMASA object editing in JBM */ #define FIX_2193_ISM_GAINS_WITH_OE /* FhG: fix issue 2193: use edited angles in ISM gain calculation */ #define FIX_2192_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ diff --git a/lib_dec/dec_LPD_fx.c b/lib_dec/dec_LPD_fx.c index 6a06df2678b6e665c8bc76554d4def55120bf8da..de1e3ea0d0023b2786ff73d12dff622e6e1c9c8c 100644 --- a/lib_dec/dec_LPD_fx.c +++ b/lib_dec/dec_LPD_fx.c @@ -36,11 +36,7 @@ void decoder_LPD_fx( ) { Word16 *param_lpc; -#ifdef FIX_1320_STACK_CPE_DECODER Word16 synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - Word16 synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif Word16 *synth; Word16 synth_bufFB[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; Word16 *synthFB; @@ -118,11 +114,7 @@ void decoder_LPD_fx( synth = synth_buf + hTcxDec->old_synth_len; /*st->old_synth: Q_0*/ Copy( hTcxDec->old_synth, synth_buf, hTcxDec->old_synth_len ); -#ifdef FIX_1320_STACK_CPE_DECODER set16_fx( synth, 0, L_FRAME_PLUS_INTERNAL + M ); -#else - set16_fx( synth, 0, L_FRAME_PLUS + M ); -#endif synthFB = synth_bufFB + hTcxDec->old_synth_lenFB; Copy( hTcxDec->old_synthFB_fx, synth_bufFB, hTcxDec->old_synth_lenFB ); diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index ae955c5edb8e8abb653d57d33c6706d95c93ce28..23f75172ae29d8910a7d23dd7ec1ec39b8d048a0 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -76,12 +76,8 @@ ivas_error ivas_core_dec_fx( set16_fx( tmp_buffer_fx, 0, L_FRAME48k ); Word16 tmps, incr; -#ifdef FIX_1320_STACK_CPE_DECODER Word16 flag_bwe_bws, flaf_swb_tbe; Word32 *bwe_exc_extended_fx[CPE_CHANNELS] = { NULL, NULL }; -#else - Word32 bwe_exc_extended_fx[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET]; -#endif Word16 voice_factors_fx[CPE_CHANNELS][NB_SUBFR16k]; // Q15 Word16 core_switching_flag[CPE_CHANNELS]; @@ -296,9 +292,7 @@ ivas_error ivas_core_dec_fx( set16_fx( voice_factors_fx[n], 0, NB_SUBFR16k ); set32_fx( hb_synth_32_fx[n], 0, L_FRAME48k ); set16_fx( hb_synth_16_fx[n], 0, L_FRAME48k ); -#ifdef FIX_1320_STACK_CPE_DECODER bwe_exc_extended_fx[n] = hb_synth_32_fx[n]; /* note: reuse the buffer */ -#endif /*------------------------------------------------------------------* * Decision matrix (selection of technologies) @@ -1003,7 +997,6 @@ ivas_error ivas_core_dec_fx( Word16 Q_input, Q_hb_synth_fx, Q_synth_fx; Word16 Q_syn_hb, sf; -#ifdef FIX_1320_STACK_CPE_DECODER flaf_swb_tbe = 0; move16(); test(); @@ -1019,7 +1012,6 @@ ivas_error ivas_core_dec_fx( flaf_swb_tbe = 1; move16(); } -#endif sf = getScaleFactor32( output_32_fx[n], L_FRAME48k ); @@ -1058,14 +1050,10 @@ ivas_error ivas_core_dec_fx( } /* Memories Re-Scaling */ -#ifdef FIX_1320_STACK_CPE_DECODER IF( !flaf_swb_tbe ) { -#endif Copy_Scale_sig_16_32_no_sat( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, sub( Q11, Q_hb_synth_fx ) ); // Q11 -#ifdef FIX_1320_STACK_CPE_DECODER } -#endif Copy_Scale_sig_16_32_no_sat( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_input ) ); // Q11 // Q_input can get value <= -5 Copy_Scale_sig_16_32_no_sat( synth_16_fx[n], synth_32_fx[n], output_frame, sub( Q11, Q_synth_fx ) ); // Q11 @@ -1083,42 +1071,19 @@ ivas_error ivas_core_dec_fx( * SWB(FB) BWE decoding *---------------------------------------------------------------------*/ -#ifdef FIX_1320_STACK_CPE_DECODER test(); test(); test(); test(); flag_bwe_bws = ( GE_32( output_Fs, 32000 ) && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && st->bfi == 0 ); move16(); -#endif Q_white_exc = 0; move16(); -#ifdef FIX_1320_STACK_CPE_DECODER test(); test(); IF( flaf_swb_tbe ) -#else - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - IF( EQ_16( st->extl, SWB_TBE ) || EQ_16( st->extl, FB_TBE ) || ( NE_16( st->coder_type, AUDIO ) && NE_16( st->coder_type, INACTIVE ) && GE_32( st->core_brate, SID_2k40 ) && EQ_16( st->core, ACELP_CORE ) && !st->con_tcx && GE_32( output_Fs, 32000 ) && GT_16( st->bwidth, NB ) && st->bws_cnt > 0 ) ) -#endif { /* SWB TBE decoder */ ivas_swb_tbe_dec_fx( st, hStereoICBWE, bwe_exc_extended_fx[n], st->Q_exc, voice_factors_fx[n], old_syn_12k8_16k_fx[n], tmp_buffer_fx /*fb_exc*/, hb_synth_32_fx[n], pitch_buf_fx[n], &Q_white_exc ); @@ -1139,11 +1104,7 @@ ivas_error ivas_core_dec_fx( fb_tbe_dec_ivas_fx( st, tmp_buffer_fx /*fb_exc*/, Q_white_exc, hb_synth_32_fx[n], 0, tmp_buffer_fx /*fb_synth_ref*/, Q_white_exc, output_frame ); } } -#ifdef FIX_1320_STACK_CPE_DECODER ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) || flag_bwe_bws ) -#else - ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) || ( GE_32( output_Fs, 32000 ) && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && !st->ppp_mode_dec && !( EQ_16( st->nelp_mode_dec, 1 ) && EQ_16( st->bfi, 1 ) ) ) ) -#endif { /* SWB BWE decoder */ Q_syn_hb = swb_bwe_dec_fx32( st, output_32_fx[n], synth_32_fx[n], hb_synth_32_fx[n], use_cldfb_for_dft, output_frame ); @@ -1153,7 +1114,6 @@ ivas_error ivas_core_dec_fx( Copy_Scale_sig_32_16( hBWE_FD->L_old_wtda_swb_fx32, hBWE_FD->L_old_wtda_swb_fx, output_frame, sub( hBWE_FD->old_wtda_swb_fx_exp, Q11 ) ); // old_wtda_swb_fx_exp } -#ifdef FIX_1320_STACK_CPE_DECODER test(); test(); test(); @@ -1161,7 +1121,6 @@ ivas_error ivas_core_dec_fx( { set32_fx( hb_synth_32_fx[n], 0, L_FRAME48k ); } -#endif /*---------------------------------------------------------------------* * FEC - recovery after lost HQ core (smoothing of the BWE component) @@ -1253,38 +1212,6 @@ ivas_error ivas_core_dec_fx( } } -#ifndef FIX_1320_STACK_CPE_DECODER - IF( EQ_16( st->element_mode, EVS_MONO ) ) - { - /*----------------------------------------------------------------* - * BFI waveform adjustment - *----------------------------------------------------------------*/ - - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - IF( EQ_16( st->core, ACELP_CORE ) && !st->bfi && st->prev_bfi && GE_32( st->last_total_brate, HQ_48k ) && EQ_16( st->last_codec_mode, MODE2 ) && ( EQ_16( st->last_core_bfi, TCX_20_CORE ) || EQ_16( st->last_core_bfi, TCX_10_CORE ) ) && EQ_16( st->hPlcInfo->concealment_method, TCX_NONTONAL ) && LT_16( st->hPlcInfo->nbLostCmpt, 4 ) ) - { - tmps = NS2SA_FX2( output_Fs, DELAY_CLDFB_NS ); - IF( st->hTonalMDCTConc->q_lastPcmOut != 0 ) - { - Scale_sig( st->hTonalMDCTConc->secondLastPcmOut, shr( st->hPlcInfo->L_frameTCX, 1 ), negate( st->hTonalMDCTConc->q_lastPcmOut ) ); - Scale_sig( st->hTonalMDCTConc->lastPcmOut, st->hPlcInfo->L_frameTCX, negate( st->hTonalMDCTConc->q_lastPcmOut ) ); - st->hTonalMDCTConc->q_lastPcmOut = 0; - move16(); - } - waveform_adj2_fix( st->hPlcInfo, st->hTonalMDCTConc->secondLastPcmOut, synth_16_fx[n] + tmps, tmps, add( st->hPlcInfo->nbLostCmpt, 1 ), st->bfi ); - - st->hPlcInfo->Pitch_fx = 0; - move16(); - } - } -#endif /*----------------------------------------------------------------* * Transition and synchronization of BWE components *----------------------------------------------------------------*/ @@ -1303,21 +1230,8 @@ ivas_error ivas_core_dec_fx( } ELSE { -#ifndef FIX_1320_STACK_CPE_DECODER - test(); - IF( EQ_16( st->extl, SWB_BWE_HIGHRATE ) || EQ_16( st->extl, FB_BWE_HIGHRATE ) ) - { - /* HR SWB BWE on top of ACELP@16kHz */ - tmps = NS2SA_FX2( output_Fs, DELAY_BWE_TOTAL_NS ); - } - ELSE - { -#endif - /* TBE on top of ACELP@16kHz */ - tmps = NS2SA_FX2( output_Fs, MAX_DELAY_TBE_NS - DELAY_SWB_TBE_16k_NS ); -#ifndef FIX_1320_STACK_CPE_DECODER - } -#endif + /* TBE on top of ACELP@16kHz */ + tmps = NS2SA_FX2( output_Fs, MAX_DELAY_TBE_NS - DELAY_SWB_TBE_16k_NS ); } /* Smooth transitions when switching between different technologies */ @@ -1542,12 +1456,7 @@ ivas_error ivas_core_dec_fx( test(); test(); test(); -#ifdef FIX_1320_STACK_CPE_DECODER IF( st->hTcxDec != NULL && ( ( ( st->core == ACELP_CORE ) && !( EQ_16( st->bfi, 1 ) && EQ_16( st->con_tcx, 1 ) ) ) || EQ_16( st->core, HQ_CORE ) ) ) -#else - test(); - IF( ( EQ_16( st->codec_mode, MODE1 ) && st->hTcxDec != NULL ) && ( ( ( st->core == ACELP_CORE ) && !( EQ_16( st->bfi, 1 ) && EQ_16( st->con_tcx, 1 ) ) ) || EQ_16( st->core, HQ_CORE ) ) ) -#endif { Word16 exp_prev_synth_buffer = 0, exp_old_out = 0, exp_delay_buf_out = 0, exp_ouput = 0, exp_synth_history = 0; move16(); diff --git a/lib_dec/ivas_cpe_dec_fx.c b/lib_dec/ivas_cpe_dec_fx.c index 3b6f9d91f42f076040467a30c11adcf5c16765ea..7a134d59bed246fc942c44990d849f1ae34fed71 100644 --- a/lib_dec/ivas_cpe_dec_fx.c +++ b/lib_dec/ivas_cpe_dec_fx.c @@ -51,9 +51,7 @@ static void read_stereo_mode_and_bwidth_fx( CPE_DEC_HANDLE hCPE, const Decoder_S static void stereo_mode_combined_format_dec_fx( const Decoder_Struct *st_ivas, CPE_DEC_HANDLE hCPE ); -#ifdef FIX_1320_STACK_CPE_DECODER static ivas_error stereo_dft_dec_main( CPE_DEC_HANDLE hCPE, const Word32 ivas_total_brate, const Word16 n_channels, Word32 *p_res_buf_fx, Word32 *output[], Word32 outputHB[][L_FRAME48k], const Word16 output_frame, const Word32 output_Fs ); -#endif /*--------------------------------------------------------------------------* @@ -75,12 +73,7 @@ ivas_error ivas_cpe_dec_fx( Word16 last_bwidth; Word16 tdm_ratio_idx; Word32 outputHB_fx[CPE_CHANNELS][L_FRAME48k]; /* buffer for output HB synthesis, both channels */ /* Q11 */ -#ifdef FIX_1320_STACK_CPE_DECODER - Word32 *res_buf_fx = NULL; /* Q8 */ -#else - Word16 q_res_buf; - Word32 res_buf_fx[STEREO_DFT_N_8k]; /* Q(q_res_buf) */ -#endif + Word32 *res_buf_fx = NULL; /* Q8 */ CPE_DEC_HANDLE hCPE; STEREO_DFT_CONFIG_DATA_HANDLE hConfigDft; Decoder_State **sts; @@ -91,10 +84,6 @@ ivas_error ivas_cpe_dec_fx( error = IVAS_ERR_OK; move32(); -#ifndef FIX_1320_STACK_CPE_DECODER - q_res_buf = Q8; - move16(); -#endif push_wmops( "ivas_cpe_dec" ); @@ -353,10 +342,8 @@ ivas_error ivas_cpe_dec_fx( } ELSE { -#ifdef FIX_1320_STACK_CPE_DECODER res_buf_fx = outputHB_fx[0]; /* note: temporarily reused buffer */ -#endif test(); IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { @@ -619,177 +606,10 @@ ivas_error ivas_cpe_dec_fx( test(); IF( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) && !( EQ_16( hCPE->nchan_out, 1 ) && EQ_16( hConfigDft->res_cod_mode, STEREO_DFT_RES_COD_OFF ) ) ) { -#ifdef FIX_1320_STACK_CPE_DECODER IF( NE_32( ( error = stereo_dft_dec_main( hCPE, ivas_total_brate, n_channels, res_buf_fx, output, outputHB_fx, output_frame, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) { return error; } -#else - Word32 DFT_fx[CPE_CHANNELS][STEREO_DFT_BUF_MAX]; // q_dft - set32_fx( DFT_fx[0], 0, STEREO_DFT_BUF_MAX ); - set32_fx( DFT_fx[1], 0, STEREO_DFT_BUF_MAX ); - - /* core decoder */ - IF( NE_32( ( error = ivas_core_dec_fx( NULL, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB_fx, DFT_fx, 0 ) ), IVAS_ERR_OK ) ) - { - return error; - } - - // Scaling of DFT's - Word16 shift; - Word32 tmp1, tmp2; - Word16 shift1, shift2; - maximum_abs_32_fx( DFT_fx[0], STEREO_DFT_BUF_MAX, &tmp1 ); - maximum_abs_32_fx( DFT_fx[1], STEREO_DFT_BUF_MAX, &tmp2 ); - - IF( tmp1 == 0 ) - { - shift1 = Q31; - move16(); - } - ELSE - { - shift1 = norm_l( tmp1 ); - } - IF( tmp2 == 0 ) - { - shift2 = Q31; - move16(); - } - ELSE - { - shift2 = norm_l( tmp2 ); - } - shift = s_min( shift1, shift2 ); - - IF( NE_16( shift, 31 ) ) - { - shift = sub( add( hCPE->hStereoDft->q_dft, shift ), Q17 ); /* Q17 for guard bits */ - - IF( GT_16( shift, hCPE->hStereoDft->q_dft ) ) - { - Scale_sig32( DFT_fx[0], STEREO_DFT_BUF_MAX, sub( shift, hCPE->hStereoDft->q_dft ) ); // shift - Scale_sig32( DFT_fx[1], STEREO_DFT_BUF_MAX, sub( shift, hCPE->hStereoDft->q_dft ) ); // shift - hCPE->hStereoDft->q_dft = shift; - move16(); - } - } - ELSE - { - hCPE->hStereoDft->q_dft = Q8; - move16(); - } - - /* DFT Stereo residual decoding */ - test(); - IF( hCPE->hStereoDft->res_cod_band_max > 0 && !st_ivas->bfi ) - { - Word16 q; - Word16 q_out_DFT[2]; - - q = Q11; - move16(); - - Copy_Scale_sig_32_16( hCPE->hCoreCoder[0]->old_pitch_buf_fx, hCPE->hCoreCoder[0]->old_pitch_buf_16_fx, ( ( 2 * NB_SUBFR16k ) + 2 ), -( Q10 ) ); // Q16->Q6 - - stereo_dft_dec_res_fx( hCPE, res_buf_fx, q_res_buf, output[1] ); - - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->old_pitch_buf_16_fx, hCPE->hCoreCoder[0]->old_pitch_buf_fx, ( ( 2 * NB_SUBFR16k ) + 2 ), 10 ); // Q6->Q16 - - Scale_sig32( output[1], L_FRAME8k, ( Q11 - Q15 ) ); // Q15 -> Q11 - - q_out_DFT[0] = q_out_DFT[1] = hCPE->hStereoDft->q_dft; - move16(); - move16(); - - stereo_dft_dec_analyze_fx( hCPE, output[1], DFT_fx, 1, L_FRAME8k, output_frame, DFT_STEREO_DEC_ANA_LB, 0, 0, &q, q_out_DFT ); - - Scale_sig32( DFT_fx[1], STEREO_DFT_BUF_MAX, sub( hCPE->hStereoDft->q_dft, q_out_DFT[1] ) ); // q_dft - } - - /* DFT stereo CNG */ - { - Word16 q_dft; - - q_dft = hCPE->hStereoDft->q_dft; - move16(); - - stereo_dtf_cng_fx( hCPE, ivas_total_brate, DFT_fx, output_frame, q_dft ); - } - - /* decoding */ - IF( EQ_16( hCPE->nchan_out, 1 ) ) - { - IF( EQ_16( hCPE->hStereoDft->first_frame, 1 ) ) - { - hCPE->hStereoDft->q_smoothed_nrg = hCPE->hStereoDft->q_dft; - move16(); - FOR( Word16 ii = 0; ii < (Word16) ( sizeof( hCPE->hStereoDft->q_DFT_past_DMX_fx ) / sizeof( hCPE->hStereoDft->q_DFT_past_DMX_fx[0] ) ); ii++ ) - { - hCPE->hStereoDft->q_DFT_past_DMX_fx[ii] = hCPE->hStereoDft->q_dft; - move16(); - } - hCPE->hStereoDft->first_frame = 0; - move16(); - } - - scale_sig32( hCPE->hStereoDft->res_cod_mem_fx, STEREO_DFT_OVL_8k, sub( hCPE->hStereoDft->q_dft, hCPE->hStereoDft->q_res_cod_mem_fx ) ); // q_dft - hCPE->hStereoDft->q_res_cod_mem_fx = hCPE->hStereoDft->q_dft; - move16(); - stereo_dft_unify_dmx_fx( hCPE->hStereoDft, sts[0], DFT_fx, hCPE->input_mem_fx[1], hCPE->hStereoCng->prev_sid_nodata ); - scale_sig32( hCPE->hStereoDft->res_cod_mem_fx, STEREO_DFT_OVL_8k, sub( Q15, hCPE->hStereoDft->q_res_cod_mem_fx ) ); // Q15 - hCPE->hStereoDft->q_res_cod_mem_fx = Q15; - move16(); - } - ELSE - { - { - IF( EQ_16( hCPE->hStereoDft->first_frame, 1 ) ) - { - hCPE->hStereoDft->q_smoothed_nrg = hCPE->hStereoDft->q_dft; - move16(); - FOR( Word16 ii = 0; ii < (Word16) ( sizeof( hCPE->hStereoDft->q_DFT_past_DMX_fx ) / sizeof( hCPE->hStereoDft->q_DFT_past_DMX_fx[0] ) ); ii++ ) - { - hCPE->hStereoDft->q_DFT_past_DMX_fx[ii] = hCPE->hStereoDft->q_dft; - move16(); - } - hCPE->hStereoDft->first_frame = 0; - move16(); - } - - scale_sig32( hCPE->hStereoDft->res_cod_mem_fx, STEREO_DFT_OVL_8k, sub( hCPE->hStereoDft->q_dft, hCPE->hStereoDft->q_res_cod_mem_fx ) ); // q_dft - hCPE->hStereoDft->q_res_cod_mem_fx = hCPE->hStereoDft->q_dft; - move16(); - } - stereo_dft_dec_fx( hCPE->hStereoDft, sts[0], DFT_fx, hCPE->input_mem_fx[1], hCPE->hStereoCng, 0, 0, 0, 0, 0, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); - scale_sig32( hCPE->hStereoDft->res_cod_mem_fx, STEREO_DFT_OVL_8k, sub( Q15, hCPE->hStereoDft->q_res_cod_mem_fx ) ); // Q15 - hCPE->hStereoDft->q_res_cod_mem_fx = Q15; - move16(); - } - - FOR( n = 0; n < hCPE->nchan_out; n++ ) - { - Scale_sig32( output[n], L_FRAME48k, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft - scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, STEREO_DFT32MS_OVL_NS ), sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft - hCPE->q_output_mem_fx[n] = hCPE->hStereoDft->q_dft; - move16(); - } - - /* synthesis iFFT */ - FOR( n = 0; n < hCPE->nchan_out; n++ ) - { - stereo_dft_dec_synthesize_fx( hCPE, DFT_fx, n, output[n], output_frame ); - } - - // delete below - FOR( n = 0; n < hCPE->nchan_out; n++ ) - { - Scale_sig32( output[n], L_FRAME48k, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 - scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 - hCPE->q_output_mem_fx[n] = Q11; - move16(); - } -#endif } ELSE IF( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) ) { @@ -893,7 +713,6 @@ ivas_error ivas_cpe_dec_fx( return error; } -#ifdef FIX_1320_STACK_CPE_DECODER /*------------------------------------------------------------------------- * stereo_dft_dec_main() @@ -1068,11 +887,7 @@ static ivas_error stereo_dft_dec_main( FOR( n = 0; n < hCPE->nchan_out; n++ ) { -#ifdef FIX_1330_JBM_MEMORY - Scale_sig32( output[n], output_frame, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft -#else - Scale_sig32( output[n], L_FRAME48k, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft -#endif + Scale_sig32( output[n], output_frame, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( output_Fs, STEREO_DFT32MS_OVL_NS ), sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft hCPE->q_output_mem_fx[n] = hCPE->hStereoDft->q_dft; move16(); @@ -1086,11 +901,7 @@ static ivas_error stereo_dft_dec_main( FOR( n = 0; n < hCPE->nchan_out; n++ ) { -#ifdef FIX_1330_JBM_MEMORY - Scale_sig32( output[n], output_frame, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 -#else - Scale_sig32( output[n], L_FRAME48k, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 -#endif + Scale_sig32( output[n], output_frame, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( output_Fs, STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 hCPE->q_output_mem_fx[n] = Q11; move16(); @@ -1099,7 +910,6 @@ static ivas_error stereo_dft_dec_main( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------- * create_cpe_dec_fx() diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index e00d4e351739e184bf0b841db6427c5538329fa7..11d80c14f8e8a71579487da489cd5edbba0db5e8 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2076,12 +2076,8 @@ void ivas_dirac_dec_render_fx( move16(); SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; Word32 *output_fx_local[MAX_OUTPUT_CHANNELS]; -#ifdef FIX_RENDERER_STACK Word32 *p_output_fx[MAX_OUTPUT_CHANNELS]; Word32 output_fx_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - Word32 output_fx_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k] = { 0 }; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; @@ -2089,11 +2085,7 @@ void ivas_dirac_dec_render_fx( FOR( ch = 0; ch < nchan_intern; ch++ ) { output_fx_local[ch] = output_fx_local_buff[ch]; -#ifdef FIX_RENDERER_STACK p_output_fx[ch] = output_fx[ch]; -#else - set_zero_fx( output_fx_local[ch], nSamplesAsked ); -#endif } slot_size = NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); // cL @@ -2122,7 +2114,6 @@ void ivas_dirac_dec_render_fx( FOR( ch = 0; ch < nchan_intern; ch++ ) { -#ifdef FIX_RENDERER_STACK /* move to output */ test(); test(); @@ -2132,26 +2123,12 @@ void ivas_dirac_dec_render_fx( } p_output_fx[ch] += n_samples_sf; -#else - output_fx_local[ch] += n_samples_sf; -#endif } /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } -#ifndef FIX_RENDERER_STACK - FOR( ch = 0; ch < nchan_intern; ch++ ) - { - test(); - test(); - IF( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( ( EQ_16( st_ivas->hDirACRend->hOutSetup.separateChannelIndex, ch ) || EQ_16( add( st_ivas->hDirACRend->hOutSetup.separateChannelIndex, 1 ), ch ) ) ) ) ) - { - Copy32( output_fx_local_buff[ch], output_fx[ch], *nSamplesRendered ); - } - } -#endif /* clang-format off */ IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) ) { @@ -2175,7 +2152,6 @@ void ivas_dirac_dec_render_fx( /* clang-format on */ -#ifdef FIX_1319_STACK_SBA_DECODER /*------------------------------------------------------------------------- * Local functions to perform binaural rendering with optimized stack *------------------------------------------------------------------------*/ @@ -2266,7 +2242,6 @@ static void binRenderer_fx( return; } -#endif /*------------------------------------------------------------------------- @@ -2279,14 +2254,8 @@ void ivas_dirac_dec_render_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output_buf_fx[], /* i/o: synthesized core-coder transport channels/DirAC output Q(6-1)*/ const Word16 nchan_transport, /* i : number of transport channels */ -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX], - Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] -#else - Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], /*Q6*/ - Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] /*Q6*/ -#endif -) + Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] ) { Word16 i, ch, idx_in, idx_lfe; DIRAC_DEC_HANDLE hDirAC; @@ -2297,17 +2266,10 @@ void ivas_dirac_dec_render_sf_fx( Word16 slot_idx_start, slot_idx_start_cldfb_synth, md_idx; /*CLDFB: last output channels reserved to LFT for CICPx*/ -#ifdef FIX_1319_STACK_SBA_DECODER Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_RealBuffer_Binaural_fx[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural_fx[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#else - Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif Word16 index = 0, num_freq_bands = 0; move16(); move16(); @@ -2324,10 +2286,6 @@ void ivas_dirac_dec_render_sf_fx( Word16 surCohRatio_q_fx = 0, temp_q = 0; move16(); move16(); -#ifndef FIX_1319_STACK_SBA_DECODER - Word32 Cldfb_RealBuffer_Temp_fx[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Temp_fx[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#endif #ifndef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES Word16 cldfb_buf_q; #endif @@ -2822,19 +2780,11 @@ void ivas_dirac_dec_render_sf_fx( { q_temp_cldfb = Q11; move16(); -#ifdef FIX_1319_STACK_SBA_DECODER cldfbAnalysis_ts_fx_fixed_q( &( st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][hSpatParamRendCom->num_freq_bands * index_slot] ), Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */ Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */ hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch], &q_temp_cldfb ); -#else - cldfbAnalysis_ts_fx_fixed_q( &st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][offset], - Cldfb_RealBuffer_Temp_fx[ch][slot_idx], - Cldfb_ImagBuffer_Temp_fx[ch][slot_idx], - hSpatParamRendCom->num_freq_bands, - st_ivas->cldfbAnaDec[ch], &q_temp_cldfb ); -#endif } q_cldfb = q_temp_cldfb; move16(); @@ -2842,14 +2792,10 @@ void ivas_dirac_dec_render_sf_fx( IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) { -#ifdef FIX_1319_STACK_SBA_DECODER #ifdef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &q_cldfb, hSpatParamRendCom->num_freq_bands, subframe_idx ); #else ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); -#endif -#else - ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Temp_fx, Cldfb_ImagBuffer_Temp_fx, &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); #endif } } @@ -2883,13 +2829,8 @@ void ivas_dirac_dec_render_sf_fx( { FOR( ch = 0; ch < nchan_transport; ch++ ) { -#ifdef FIX_1319_STACK_SBA_DECODER Copy32( Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], Cldfb_RealBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); Copy32( Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], Cldfb_ImagBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); -#else - Copy32( Cldfb_RealBuffer_Temp_fx[ch][slot_idx], Cldfb_RealBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); - Copy32( Cldfb_ImagBuffer_Temp_fx[ch][slot_idx], Cldfb_ImagBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); -#endif } } ELSE @@ -3863,7 +3804,6 @@ void ivas_dirac_dec_render_sf_fx( } /* Perform binaural rendering, output in Q6 format */ -#ifdef FIX_1319_STACK_SBA_DECODER test(); IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { @@ -3893,45 +3833,14 @@ void ivas_dirac_dec_render_sf_fx( binRenderer_fx( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx ); } -#else - IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { - IF( st_ivas->hSplitBinRend->hCldfbDataOut != NULL ) - { - FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) - { - FOR( ch = 0; ch < st_ivas->hBinRenderer->nInChannels; ch++ ) - { - Copy32( Cldfb_RealBuffer_fx[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer_fx[ch][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands ); - Copy32( Cldfb_ImagBuffer_fx[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer_fx[ch][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands ); - } - } - st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config; - move16(); - } - } - - /*Binaural output in Q6 format*/ - ivas_binRenderer_fx( st_ivas->hBinRenderer, - ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, - st_ivas->hCombinedOrientationData, - hSpatParamRendCom->subframe_nbslots[subframe_idx], - Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, - Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q ); -#endif /* Inverse CLDFB*/ FOR( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { /* open CLDFB buffer up to CLDFB_NO_CHANNELS_MAX bands for 48kHz */ Word32 *synth_fx = &output_buf_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands]; -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *RealBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; Word32 *ImagBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; -#else - Word32 *RealBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; - Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; -#endif FOR( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe_idx]; i++ ) { RealBuffer_fx[i] = Cldfb_RealBuffer_Binaural_fx[0][ch][i]; @@ -3977,13 +3886,8 @@ void ivas_dirac_dec_render_sf_fx( } ELSE { -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *RealBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; Word32 *ImagBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; -#else - Word32 *RealBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; - Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; -#endif Word16 outchannels; idx_in = 0; diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 984f02ece1139d7654e2b95bec5b25f5147b3e59..90b5c7baae66b76fc7c7c7c2dca960e7990415ce 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1693,9 +1693,7 @@ ivas_error ivas_init_decoder_fx( Word16 sce_id, cpe_id; Word16 numCldfbAnalyses, numCldfbSyntheses; Word16 granularity, n_channels_transport_jbm; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#endif Word32 output_Fs, ivas_total_brate, tmp_br, tmp32; Word32 delay_ns; AUDIO_CONFIG output_config; @@ -3215,32 +3213,11 @@ ivas_error ivas_init_decoder_fx( * Allocate output audio buffers *-----------------------------------------------------------------*/ -#ifdef FIX_1330_JBM_MEMORY nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) { return error; } -#else -#ifdef FIX_NCHAN_BUFFERS - k = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); - FOR( n = 0; n < k; n++ ) -#else - FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); n++ ) -#endif - { - /* note: these are intra-frame heap memories */ - IF( ( st_ivas->p_output_fx[n] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for output audio buffer!\n" ) ); - } - set32_fx( st_ivas->p_output_fx[n], 0, 48000 / FRAMES_PER_SEC ); - } - FOR( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) - { - st_ivas->p_output_fx[n] = NULL; - } -#endif return error; } @@ -3721,15 +3698,7 @@ void ivas_destroy_dec_fx( /* output audio buffers */ FOR( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ ) { -#ifdef FIX_1330_JBM_MEMORY st_ivas->p_output_fx[i] = NULL; -#else - IF( st_ivas->p_output_fx[i] != NULL ) - { - free( st_ivas->p_output_fx[i] ); - st_ivas->p_output_fx[i] = NULL; - } -#endif } #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index 5d8e1f7054a0567714f4466a7322e80cf69c4727..4537b384078329dd47d40a02b300be63b0232b09 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -59,11 +59,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( Word16 tc_nchan_tc_new; Word16 tc_nchan_allocate_new; Word16 tc_granularity_new; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff, nchan_out_buff_old; -#endif nCPE_old = st_ivas->nCPE; move16(); @@ -78,9 +74,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); st_ivas->ism_mode = ism_mode; move16(); -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#endif IF( NE_32( ( error = ivas_ism_config_fx( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ), IVAS_ERR_OK ) ) { @@ -309,18 +302,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( return error; } -#ifndef FIX_1330_JBM_MEMORY - /*-----------------------------------------------------------------* - * output audio buffers - *-----------------------------------------------------------------*/ - - nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); - - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif /*-----------------------------------------------------------------* * JBM TC buffers *-----------------------------------------------------------------*/ @@ -373,7 +354,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( Copy( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } -#ifdef FIX_1330_JBM_MEMORY /*-----------------------------------------------------------------* * output audio buffers @@ -384,7 +364,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( { return error; } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index 85d333c94ea8f504218d68e940f131902fe812d1..2e2a257a11a96837fc296c79ea672c18ac0cc540 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -218,25 +218,11 @@ void ivas_ism_render_sf_fx( ism_md_subframe_update_jbm = sub( st_ivas->hTcBuffer->nb_subframes, 2 ); } -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm ) + FOR( i = 0; i < num_objects; i++ ) { - FOR( i = 0; i < num_objects; i++ ) - { - p_tc_fx[i] = &st_ivas->hTcBuffer->tc_fx[i][tc_offset]; // Q11 - } + Copy32( &output_fx[i][tc_offset], tc_local_fx[i], n_samples_to_render ); + p_tc_fx[i] = tc_local_fx[i]; } - ELSE - { -#endif - FOR( i = 0; i < num_objects; i++ ) - { - Copy32( &output_fx[i][tc_offset], tc_local_fx[i], n_samples_to_render ); - p_tc_fx[i] = tc_local_fx[i]; - } -#ifndef FIX_1330_JBM_MEMORY - } -#endif FOR( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) { @@ -511,12 +497,7 @@ void ivas_omasa_separate_object_render_jbm_fx( const UWord16 nSamplesRendered, /* i : number of samples rendered */ Word32 input_fx_in[][L_FRAME48k], /* i : separated object signal Q11*/ Word32 *output_fx[], /* o : rendered time signal Q11*/ -#ifdef FIX_1330_JBM_MEMORY - const Word16 subframes_rendered /* i : number of subframes rendered */ -#else - const Word16 subframes_rendered, /* i : number of subframes rendered */ - const Word16 slots_rendered /* i : number of CLDFB slots rendered */ -#endif + const Word16 subframes_rendered /* i : number of subframes rendered */ ) { VBAP_HANDLE hVBAPdata; @@ -565,34 +546,16 @@ void ivas_omasa_separate_object_render_jbm_fx( move16(); } -#ifndef FIX_1330_JBM_MEMORY - offsetSamples = i_mult( slots_rendered, hSpatParamRendCom->slot_size ); -#endif FOR( j = 0; j < nchan_out_woLFE + num_lfe; j++ ) { output_fx_local[j] = output_fx[j]; } -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - FOR( obj = 0; obj < num_objects; obj++ ) - { - input_fx[obj] = &st_ivas->hTcBuffer->tc_fx[obj + 2][offsetSamples]; - move32(); - } - } - ELSE + FOR( obj = 0; obj < num_objects; obj++ ) { -#endif - FOR( obj = 0; obj < num_objects; obj++ ) - { - input_fx[obj] = input_fx_in[obj]; - move32(); - } -#ifndef FIX_1330_JBM_MEMORY + input_fx[obj] = input_fx_in[obj]; + move32(); } -#endif slots_to_render = idiv1616( nSamplesRendered, hSpatParamRendCom->slot_size ); first_sf = subframes_rendered; diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 853ea9aac4ac3084a90f523194358fb9bc21df2a..018bdeeec0ace8b56330348e7f3aadff8eddc341 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -804,10 +804,8 @@ ivas_error ivas_jbm_dec_tc_fx( { Scale_sig32( p_output_fx[n], output_frame, sub( Q11, output_q ) ); // Q11 } -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP st_ivas->hCPE[0]->q_output_mem_fx[0] = output_q; st_ivas->hCPE[0]->q_output_mem_fx[1] = output_q; -#endif } } ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) @@ -1520,25 +1518,12 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const Word16 nSamplesForRendering, /* i : number of TC samples available for rendering */ Word16 *nSamplesResidual /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ -#ifndef JBM_MEMORY_OPT - , - Word32 *data /* i : transport channels */ -#endif ) { -#ifdef JBM_MEMORY_OPT Word32 tmp_buf_fx[MAX_JBM_L_FRAME48k]; Word32 *p_data_fx[FOA_CHANNELS + MAX_NUM_OBJECTS]; -#else - Word32 data_fx[MAX_CLDFB_DIGEST_CHANNELS][MAX_JBM_L_FRAME48k]; /* buffer for transport channels that will be directly converted with the CLDFB */ - Word32 *p_data_fx[MAX_CLDFB_DIGEST_CHANNELS]; -#endif Word16 n, n_render_timeslots, n_ch_cldfb; -#ifdef FIX_1330_JBM_MEMORY Word16 ch, offset, len_offset; -#else - Word16 ch; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; @@ -1550,7 +1535,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( IF( st_ivas->hDecoderConfig->Opt_tsm ) { -#ifdef JBM_MEMORY_OPT Word16 n_samples_still_available; Word16 n_ch_full_copy, n_ch_res_copy; @@ -1564,7 +1548,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( n_ch_full_copy = s_min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); n_ch_res_copy = sub( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); -#ifdef FIX_1330_JBM_MEMORY /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': in case of 'length(hTcBuffer->tc[]) < length(p_output_f[])', reset of TC buffers pointers is needed after ivas_buffer_interleaved_to_deinterleaved() */ @@ -1583,7 +1566,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( } } -#endif FOR( ch = 0; ch < n_ch_full_copy; ch++ ) { Copy32( hTcBuffer->tc_fx[ch], tmp_buf_fx, nSamplesForRendering ); @@ -1604,52 +1586,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( Copy32( tmp_buf_fx + nSamplesForRendering - *nSamplesResidual, hTcBuffer->tc_buffer_old_fx[ch], *nSamplesResidual ); } } -#else - Word16 n_samples_still_available, m; - Word16 n_ch_full_copy; - Word16 n_ch_res_copy; - - FOR( n = 0; n < n_ch_cldfb; n++ ) - { - p_data_fx[n] = &data_fx[n][0]; - } - - n_samples_still_available = sub( hTcBuffer->n_samples_buffered, hTcBuffer->n_samples_rendered ); - hTcBuffer->n_samples_buffered = add( add( n_samples_still_available, nSamplesForRendering ), hTcBuffer->n_samples_discard ); - hTcBuffer->n_samples_available = i_mult( hTcBuffer->n_samples_granularity, idiv1616( hTcBuffer->n_samples_buffered, hTcBuffer->n_samples_granularity ) ); - *nSamplesResidual = sub( hTcBuffer->n_samples_buffered, hTcBuffer->n_samples_available ); - move16(); - move16(); - move16(); - n_ch_full_copy = s_min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); - n_ch_res_copy = sub( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); - - FOR( ch = 0; ch < n_ch_full_copy; ch++ ) - { - set32_fx( hTcBuffer->tc_fx[ch], 0, hTcBuffer->n_samples_discard ); - Copy32( hTcBuffer->tc_fx[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc_fx[ch] + hTcBuffer->n_samples_discard, n_samples_still_available ); - FOR( m = 0; m < nSamplesForRendering; m++ ) - { - hTcBuffer->tc_fx[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * hTcBuffer->nchan_transport_jbm + ch]; - move32(); - } - } - - IF( n_ch_res_copy > 0 ) - { - FOR( ; ch < hTcBuffer->nchan_transport_jbm; ch++ ) - { - Copy32( hTcBuffer->tc_fx[ch], p_data_fx[ch], n_samples_still_available ); - - FOR( m = 0; m < nSamplesForRendering; m++ ) - { - p_data_fx[ch][n_samples_still_available + m] = data[m * hTcBuffer->nchan_transport_jbm + ch]; - move32(); - } - Copy32( p_data_fx[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc_fx[ch], *nSamplesResidual ); - } - } -#endif n_render_timeslots = idiv1616( st_ivas->hTcBuffer->n_samples_available, st_ivas->hTcBuffer->n_samples_granularity ); } @@ -1661,16 +1597,8 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( move16(); } -#ifdef FIX_NCHAN_BUFFERS -#ifdef JBM_MEMORY_OPT ch = s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); -#else - ch = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#endif FOR( n = 0; n < ch; n++ ) -#else - FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) -#endif { hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; /* note: buffers needed in the TD decorellator */ move16(); @@ -1763,11 +1691,7 @@ ivas_error ivas_jbm_dec_render_fx( IF( !st_ivas->hDecoderConfig->Opt_tsm ) { -#ifdef JBM_MEMORY_OPT FOR( n = 0; n < MAX_INTERN_CHANNELS; n++ ) -#else - FOR( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ ) -#endif { st_ivas->hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; } @@ -2193,12 +2117,6 @@ ivas_error ivas_jbm_dec_render_fx( FOR( i = 0; i < nchan_in; i++ ) { scale_sig32( p_output_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - scale_sig32( p_tc_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor - } -#endif } } ELSE @@ -2211,45 +2129,22 @@ ivas_error ivas_jbm_dec_render_fx( IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) -#else - IF( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } } ELSE { -#ifdef FIX_1330_JBM_MEMORY IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), - IVAS_ERR_OK ) ) -#endif { return error; } // Todo main-pc update: This might be needed also in the split rendering path -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - IF( NE_16( exp, *st_ivas->hCrendWrapper->p_io_qfactor ) ) - { - FOR( i = 0; i < nchan_in; i++ ) - { - scale_sig32( p_tc_fx[i], *nSamplesRendered, sub( *st_ivas->hCrendWrapper->p_io_qfactor, exp ) ); - } - } - } -#endif ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_tc_fx, p_output_fx ); } @@ -2267,13 +2162,6 @@ ivas_error ivas_jbm_dec_render_fx( { scale_sig32( p_output_fx[i], *nSamplesRendered, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q11 } -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm && crendInPlaceRotation ) - { - n = 0; - move16(); - } -#endif FOR( i = n; i < nchan_in; i++ ) { @@ -2647,7 +2535,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( { Word16 ch_idx; -#ifdef JBM_MEMORY_OPT /* render available full slots (with new lower granularity) */ FOR( ch_idx = 0; ch_idx < s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) { @@ -2659,16 +2546,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render ); #endif } -#else - /* render what is still there with zero padding */ - FOR( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - /* move it at the beginning of the TC buffer with zero padding */ - Copy32( hTcBuffer->tc_fx[ch_idx] + hTcBuffer->n_samples_rendered, hTcBuffer->tc_fx[ch_idx], n_samples_to_render ); - set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render ); - Copy32( hTcBuffer->tc_fx[ch_idx] + hTcBuffer->n_samples_rendered + n_samples_to_render, hTcBuffer->tc_fx[ch_idx] + hTcBuffer->n_samples_granularity, n_samples_still_available ); - } -#endif /* simple change of the slot info */ hTcBuffer->num_slots = 1; @@ -2816,13 +2693,11 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( IF( EQ_16( ism_mode_old, ISM_MASA_MODE_DISC ) ) { Word32 *tc_local_fx[MAX_NUM_OBJECTS]; -#ifdef NONBE_1302_FIX_OMASA_JBM_FLUSH Word16 last_dirac_md_idx; UWord16 nSamplesAvailableNext; ISM_MODE ism_mode_orig; RENDERER_TYPE renderer_type_orig; Word32 ivas_total_brate; -#endif /* copy from ISM delay buffer to the correct place in TCs */ move16(); @@ -2832,7 +2707,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( Copy32( st_ivas->hMasaIsmData->delayBuffer_fx[ch_idx], tc_local_fx[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); /*Q11*/ } -#ifdef NONBE_1302_FIX_OMASA_JBM_FLUSH /* to render flushed samples, use configuration from the last received frame */ ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; renderer_type_orig = st_ivas->renderer_type; @@ -2859,12 +2733,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( st_ivas->ism_mode = ism_mode_orig; st_ivas->renderer_type = renderer_type_orig; st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate; -#else - IF( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif } } ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) @@ -3470,7 +3338,6 @@ Word16 ivas_jbm_dec_get_render_granularity_fx( return render_granularity; } -#ifdef JBM_MEMORY_OPT /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_audio_allocate() @@ -3490,9 +3357,7 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx( IF( Opt_tsm ) { n_samp_full = NS2SA_FX2( output_Fs, MAX_JBM_L_FRAME_NS ); -#ifdef FIX_1330_JBM_MEMORY n_samp_full = s_max( n_samp_full, L_FRAME48k ); /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': ensure minimal length */ -#endif #ifdef FIX_2174_JBM_BASOP_ALIGNMENT n_samp_residual = sub( hTcBuffer->n_samples_granularity, 1 ); #else @@ -3566,10 +3431,8 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx( } } -#ifdef FIX_1330_JBM_MEMORY hTcBuffer->tc_buffer2_fx = NULL; -#endif return IVAS_ERR_OK; } @@ -3607,19 +3470,16 @@ static void ivas_jbm_dec_tc_audio_deallocate_fx( hTcBuffer->tc_buffer_old_fx[ch_idx] = NULL; } } -#ifdef FIX_1330_JBM_MEMORY IF( hTcBuffer->tc_buffer2_fx != NULL ) { free( hTcBuffer->tc_buffer2_fx ); hTcBuffer->tc_buffer2_fx = NULL; } -#endif } return; } -#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_buffer_open() @@ -3636,17 +3496,9 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( const Word16 n_samples_granularity /* i : granularity of the renderer/buffer */ ) { -#ifndef JBM_MEMORY_OPT - Word16 nsamp_to_allocate; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; Word16 nMaxSlotsPerSubframe; -#ifdef JBM_MEMORY_OPT ivas_error error; -#else - Word16 nchan_residual; - Word16 ch_idx; -#endif Word16 tmp, tmp_e; Word32 tmp32; @@ -3667,9 +3519,6 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( move16(); hTcBuffer->nchan_buffer_full = nchan_full; move16(); -#ifndef JBM_MEMORY_OPT - nchan_residual = sub( nchan_transport_internal, nchan_full ); -#endif hTcBuffer->n_samples_granularity = n_samples_granularity; move16(); hTcBuffer->n_samples_available = 0; @@ -3688,10 +3537,6 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( move16(); hTcBuffer->nb_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; move16(); -#ifndef JBM_MEMORY_OPT - nsamp_to_allocate = 0; - move16(); -#endif tmp32 = L_mult0( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, hTcBuffer->n_samples_granularity ); // Q0 tmp = BASOP_Util_Divide3232_Scale( st_ivas->hDecoderConfig->output_Fs, tmp32, &tmp_e ); @@ -3703,75 +3548,10 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( set16_fx( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set16_fx( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); -#ifdef JBM_MEMORY_OPT IF( ( error = ivas_jbm_dec_tc_audio_allocate_fx( hTcBuffer, st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->Opt_tsm ) ) != IVAS_ERR_OK ) { return error; } -#else - { - Word16 n_samp_full, n_samp_residual; - Word32 offset; - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - n_samp_full = add( NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ), sub( hTcBuffer->n_samples_granularity, 1 ) ); - n_samp_residual = sub( hTcBuffer->n_samples_granularity, 1 ); - } - ELSE - { - /* n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); */ - n_samp_full = extract_l( Mpy_32_32( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - n_samp_residual = 0; - move16(); - } - - nsamp_to_allocate = mult0( hTcBuffer->nchan_buffer_full, n_samp_full ); - nsamp_to_allocate = add( nsamp_to_allocate, mult0( nchan_residual, n_samp_residual ) ); - - IF( nsamp_to_allocate == 0 ) - { - hTcBuffer->tc_buffer_fx = NULL; - - FOR( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = NULL; - } - } - ELSE - { - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - /* note: the maximum buffer length is for OSBA DISC mode with ISMs -> 15*(1920+239)=32385 samples */ - IF( ( hTcBuffer->tc_buffer_fx = (Word32 *) malloc( nsamp_to_allocate * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); - } - set32_fx( hTcBuffer->tc_buffer_fx, 0, nsamp_to_allocate ); - - offset = 0; - move16(); - FOR( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; - offset = L_add( offset, n_samp_full ); - } - FOR( ; ch_idx < hTcBuffer->nchan_transport_internal; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; - offset = L_add( offset, n_samp_residual ); - } - FOR( ; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = NULL; - } - } - ELSE - { - hTcBuffer->tc_buffer_fx = NULL; - } - } - } -#endif st_ivas->hTcBuffer = hTcBuffer; @@ -3794,22 +3574,14 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( const Word16 n_samples_granularity /* i : new granularity of the renderer/buffer */ ) { -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP Word16 ch_idx, num_tc_buffer_mem, n_samples_still_available; Word32 tc_buffer_mem[MAX_INTERN_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES - 1]; -#endif -#ifdef JBM_MEMORY_OPT ivas_error error; -#else - Word16 nsamp_to_allocate, n_samp_full, n_samp_residual, offset, nchan_residual; - Word16 ch_idx; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; move16(); -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP num_tc_buffer_mem = 0; move16(); n_samples_still_available = 0; @@ -3830,7 +3602,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( } } -#endif /* if granularity changes, adapt subframe_nb_slots */ IF( NE_16( n_samples_granularity, hTcBuffer->n_samples_granularity ) ) { @@ -3861,13 +3632,9 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( move16(); hTcBuffer->nchan_buffer_full = nchan_full; move16(); -#ifndef JBM_MEMORY_OPT - nchan_residual = sub( nchan_transport_internal, nchan_full ); -#endif hTcBuffer->n_samples_granularity = n_samples_granularity; move16(); -#ifdef JBM_MEMORY_OPT /* reallocate TC audio buffers */ ivas_jbm_dec_tc_audio_deallocate_fx( hTcBuffer ); @@ -3876,79 +3643,13 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( { return error; } -#else - /* realloc buffers */ - IF( hTcBuffer->tc_buffer_fx != NULL ) - { - free( hTcBuffer->tc_buffer_fx ); - hTcBuffer->tc_buffer_fx = NULL; - } - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - n_samp_full = ( add( NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ), sub( hTcBuffer->n_samples_granularity, 1 ) ) ); - n_samp_residual = sub( hTcBuffer->n_samples_granularity, 1 ); - } - ELSE - { - n_samp_full = extract_l( Mult_32_16( st_ivas->hDecoderConfig->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); - n_samp_residual = 0; - move16(); - } - - nsamp_to_allocate = imult1616( hTcBuffer->nchan_buffer_full, n_samp_full ); - nsamp_to_allocate = add( nsamp_to_allocate, imult1616( nchan_residual, n_samp_residual ) ); - - IF( nsamp_to_allocate == 0 ) - { - hTcBuffer->tc_buffer_fx = NULL; - FOR( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = NULL; - } - } - ELSE - { - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - IF( ( hTcBuffer->tc_buffer_fx = (Word32 *) malloc( nsamp_to_allocate * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory FOR JBM TC Buffer\n" ) ); - } - set32_fx( hTcBuffer->tc_buffer_fx, 0, nsamp_to_allocate ); - - offset = 0; - move16(); - FOR( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; - offset = add( offset, n_samp_full ); - } - FOR( ; ch_idx < hTcBuffer->nchan_transport_internal; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; - offset = add( offset, n_samp_residual ); - } - FOR( ; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = NULL; - } - } - ELSE - { - hTcBuffer->tc_buffer_fx = NULL; - } - } -#endif - -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* propagate samples of the TC buffer from the previous frame */ FOR( ch_idx = 0; ch_idx < num_tc_buffer_mem; ch_idx++ ) { Copy32( tc_buffer_mem[ch_idx], hTcBuffer->tc_buffer_old_fx[ch_idx], n_samples_still_available ); } -#endif return IVAS_ERR_OK; } @@ -3995,12 +3696,8 @@ static void ivas_jbm_dec_tc_buffer_playout_fx( FOR( ch_idx = 0; ch_idx < st_ivas->hTcBuffer->nchan_transport_jbm; ch_idx++ ) { -#ifdef FIX_1330_JBM_MEMORY output_fx[ch_idx] = st_ivas->hTcBuffer->tc_fx[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered; move32(); -#else - Copy32( st_ivas->hTcBuffer->tc_fx[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered, output_fx[ch_idx], *nSamplesRendered ); -#endif } st_ivas->hTcBuffer->subframes_rendered = last_sf; @@ -4020,26 +3717,9 @@ void ivas_jbm_dec_tc_buffer_close_fx( DECODER_TC_BUFFER_HANDLE *phTcBuffer /* i/o: TC buffer handle */ ) { -#ifndef JBM_MEMORY_OPT - Word16 i; -#endif IF( *phTcBuffer != NULL ) { -#ifdef JBM_MEMORY_OPT ivas_jbm_dec_tc_audio_deallocate_fx( *phTcBuffer ); -#else - - FOR( i = 0; i < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; i++ ) - { - ( *phTcBuffer )->tc_fx[i] = NULL; - } - - IF( ( *phTcBuffer )->tc_buffer_fx != NULL ) - { - free( ( *phTcBuffer )->tc_buffer_fx ); - ( *phTcBuffer )->tc_buffer_fx = NULL; - } -#endif free( *phTcBuffer ); *phTcBuffer = NULL; diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 2b6ccf1efb578897cbea67f372004e34c2f05577..b41036a5d6cfa4016b10116de0e2983b1ef7a529 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1689,13 +1689,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( Decoder_State **sts; UWord32 ivas_total_brate, last_ivas_total_brate; Word16 numCldfbAnalyses_old, numCldfbSyntheses_old; -#ifdef FIX_NCHAN_BUFFERS -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff_old, nchan_out_buff; -#endif -#endif ivas_error error; Word32 ism_total_brate; Word16 pos_idx; @@ -1704,11 +1698,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( move32(); last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; move32(); -#ifdef FIX_NCHAN_BUFFERS -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#endif -#endif test(); test(); @@ -1976,7 +1965,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( } ELSE { -#ifdef FIX_NCHAN_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS; move16(); test(); @@ -1985,9 +1973,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; move16(); } -#else - tc_nchan_to_allocate = shl( BINAURAL_CHANNELS, 1 ); -#endif } test(); @@ -2054,7 +2039,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( } } -#ifdef FIX_NCHAN_BUFFERS /*-----------------------------------------------------------------* * output audio buffers *-----------------------------------------------------------------*/ @@ -2063,17 +2047,12 @@ ivas_error ivas_masa_dec_reconfigure_fx( IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) /* note: switching with OMASA is addressed in ivas_omasa_dec_config() */ { nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) -#endif { return error; } } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 8970a0820904cf20ecdd92d6e0fb12e46b3f8a2c..49b4edb18da9f3fb6818340b9afb7e2eab1f3db3 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -902,19 +902,12 @@ static ivas_error ivas_mc_dec_reconfig_fx( Word16 tc_nchan_tc_new; Word16 tc_nchan_allocate_new; Word16 tc_granularity_new; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff_old, nchan_out_buff; -#endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; move32(); nchan_transport_old = st_ivas->nchan_transport; move16(); -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#endif last_mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( st_ivas->transport_config ), st_ivas->hDecoderConfig->last_ivas_total_brate ); /* NB: this assumes that LS config remains the same between frames */ /* temporally set the current mc_mode back to the previous one to make sure the following call to @@ -1555,7 +1548,6 @@ static ivas_error ivas_mc_dec_reconfig_fx( test(); IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_16( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) { -#ifdef FIX_NCHAN_BUFFERS tc_nchan_allocate_new = BINAURAL_CHANNELS; move16(); test(); @@ -1568,10 +1560,6 @@ static ivas_error ivas_mc_dec_reconfig_fx( { tc_nchan_allocate_new = add( tc_nchan_allocate_new, 1 ); } -#else - tc_nchan_allocate_new = BINAURAL_CHANNELS * 2; - move16(); -#endif tc_nchan_full_new = tc_nchan_allocate_new; move16(); } @@ -1649,11 +1637,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) -#endif { return error; } diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index b951258852201ff1da3b8077675d4bf8cfc2e630..e7507607ffd3d9971450a4d93ca30ed91cb69446 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1104,11 +1104,7 @@ void ivas_mdct_core_reconstruct_fx( Word16 L_frame_global[CPE_CHANNELS], L_frame_globalTCX[CPE_CHANNELS]; /* Synth */ -#ifdef FIX_1320_STACK_CPE_DECODER Word16 synth_buf_fx[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - Word16 synth_buf_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif Word16 *synth_fx; Word16 synth_bufFB_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; Word16 *synthFB_fx; @@ -1179,11 +1175,7 @@ void ivas_mdct_core_reconstruct_fx( } q_syn = st->hTcxDec->q_old_synth; move16(); -#ifdef FIX_1320_STACK_CPE_DECODER set16_fx( synth_fx, 0, L_FRAME_PLUS_INTERNAL + M ); -#else - set16_fx( synth_fx, 0, L_FRAME_PLUS + M ); -#endif set16_fx( synthFB_fx, 0, L_FRAME_PLUS + M ); IF( st->core != ACELP_CORE ) { @@ -1273,11 +1265,7 @@ void ivas_mdct_core_reconstruct_fx( // norm(synth_buf) >= q_syn - q_win // norm(synth_buf) + q_win >= q_syn -#ifdef FIX_1320_STACK_CPE_DECODER sf = s_min( getScaleFactor16( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS_INTERNAL ), M ) ), getScaleFactor16( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ) ) ); -#else - sf = s_min( getScaleFactor16( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS ), M ) ), getScaleFactor16( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ) ) ); -#endif q_syn = add( sub( sf, 1 ), s_min( q_win, q_winFB ) ); st->Q_syn = q_syn; move16(); @@ -1287,12 +1275,8 @@ void ivas_mdct_core_reconstruct_fx( sf = s_min( getScaleFactor16( st->hHQ_core->old_out_fx, L_FRAME48k ), getScaleFactor16( st->hHQ_core->old_out_LB_fx, L_FRAME32k ) ); st->Q_syn = add( sf, s_min( q_win, q_winFB ) ); -#ifdef FIX_1320_STACK_CPE_DECODER Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS_INTERNAL ), M ), sub( q_syn, q_win ) ); // st->hTcxDec->q_old_synth -> q_syn -#else - Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS ), M ), sub( q_syn, q_win ) ); // st->hTcxDec->q_old_synth -> q_syn -#endif - Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_syn, q_winFB ) ); // st->hTcxDec->q_old_synth -> q_syn + Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_syn, q_winFB ) ); // st->hTcxDec->q_old_synth -> q_syn // Scale_sig( st->syn, M + 1, add( st->Q_syn, 2 ) ); Scale_sig( st->syn, M + 1, sub( st->Q_syn, q_win ) ); @@ -1422,16 +1406,9 @@ void ivas_mdct_core_reconstruct_fx( Copy_Scale_sig_16_32_no_sat( st->p_bpf_noise_buf, st->p_bpf_noise_buf_32, st->L_frame, Q11 ); // Q0 -> Q11 } -#ifndef FIX_938_COMPILER_WARNING - IF( signal_outFB_fx[ch] != NULL ) - { -#endif - Copy( synthFB_fx, signal_outFB_fx[ch], st->hTcxDec->L_frameTCX ); - e_sig[ch] = sub( 15, q_syn + st->Q_syn_factor ); - move16(); -#ifndef FIX_938_COMPILER_WARNING - } -#endif + Copy( synthFB_fx, signal_outFB_fx[ch], st->hTcxDec->L_frameTCX ); + e_sig[ch] = sub( 15, q_syn + st->Q_syn_factor ); + move16(); /* updates */ st->last_voice_factor_fx = 0; @@ -1701,7 +1678,6 @@ void ivas_mdct_core_tns_ns_fx( q_x = add( q_x, 1 ); } -#ifdef NONBE_FIX_1376_MDCT_CONCEALMENT /* 2025-09-07, mul: in case of PLC, applying SNS up to L_spec might not be enough: In case the transition frame from DTX after an inactive period is lost, L_spec is assumed to represent a regular TCX frame, @@ -1709,9 +1685,6 @@ void ivas_mdct_core_tns_ns_fx( in case this is not necessary, x[] is filled with zeros, and the multiplication is not causing any additional harm */ v_multc_fx( x_fx[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sns_int_scf_fx[FDNS_NPTS - 1], x_fx[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sub( s_max( L_spec[ch], L_frameTCX[ch] ), st->hTcxCfg->psychParamsCurrent->nBins ) ); -#else - v_multc_fx( x_fx[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sns_int_scf_fx[FDNS_NPTS - 1], x_fx[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sub( L_spec[ch], st->hTcxCfg->psychParamsCurrent->nBins ) ); -#endif q_2 = sub( add( q_x, q_sns_int_scf ), 31 ); Scale_sig32( &x_fx[ch][k][0], st->hTcxCfg->psychParamsCurrent->nBins, sub( q_2, q_x ) ); diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 7df8ddfef39e13e8ed3f750d3526919d7c30fba8..0c6c13d1941603b0625d87b8ae5c4a136065ea61 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -497,11 +497,7 @@ ivas_error ivas_omasa_dec_config_fx( Word32 brate_SCE, brate_CPE; ISM_MODE ism_mode_old; IVAS_FORMAT ivas_format_orig; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff, nchan_out_buff_old; -#endif ivas_error error; RENDERER_TYPE old_renderer_type; @@ -522,10 +518,6 @@ ivas_error ivas_omasa_dec_config_fx( st_ivas->ivas_format = st_ivas->last_ivas_format; move16(); ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); - move16(); -#endif st_ivas->ivas_format = ivas_format_orig; move16(); @@ -757,7 +749,6 @@ ivas_error ivas_omasa_dec_config_fx( /* ISM renderer handle + ISM data handle */ ivas_omasa_separate_object_renderer_close( st_ivas ); } -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP IF( EQ_32( old_renderer_type, RENDERER_MONO_DOWNMIX ) ) { @@ -769,7 +760,6 @@ ivas_error ivas_omasa_dec_config_fx( Scale_sig32( hTcBuffer->tc_buffer_old_fx[k], n_samples_still_available, st_ivas->hCPE[0]->q_output_mem_fx[0] - Q11 ); } } -#endif } IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ) @@ -834,11 +824,7 @@ ivas_error ivas_omasa_dec_config_fx( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1115,92 +1101,65 @@ void ivas_omasa_dirac_rend_jbm_fx( ) { Word16 subframes_rendered; -#ifndef FIX_1330_JBM_MEMORY - Word16 slots_rendered; -#endif Word16 n; Word32 data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#ifndef FIX_1330_JBM_MEMORY + *nSamplesRendered = s_min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); + test(); - IF( !st_ivas->hDecoderConfig->Opt_tsm ) + IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) { -#endif - *nSamplesRendered = s_min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); - - test(); - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) - { - Copy32( &output_fx[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); + Copy32( &output_fx[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) + IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) #else -#ifdef FIX_1330_JBM_MEMORY IF( !st_ivas->hDecoderConfig->Opt_tsm && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#else - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#endif #endif + { + /* Gain separated object, if edited */ + FOR( n = 0; n < st_ivas->nchan_ism; n++ ) { - /* Gain separated object, if edited */ - FOR( n = 0; n < st_ivas->nchan_ism; n++ ) + test(); + IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] && EQ_16( st_ivas->hMasaIsmData->idx_separated_ism, n ) ) { - test(); - IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] && EQ_16( st_ivas->hMasaIsmData->idx_separated_ism, n ) ) - { - v_multc_fx_16( data_separated_objects[0], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[0], *nSamplesRendered ); // Q = 8 - Scale_sig32( data_separated_objects[0], *nSamplesRendered, Q3 ); // Q = 11 - } + v_multc_fx_16( data_separated_objects[0], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[0], *nSamplesRendered ); // Q = 8 + Scale_sig32( data_separated_objects[0], *nSamplesRendered, Q3 ); // Q = 11 } } } - ELSE + } + ELSE + { + FOR( n = 0; n < st_ivas->nchan_ism; n++ ) { - FOR( n = 0; n < st_ivas->nchan_ism; n++ ) - { - Copy32( &output_fx[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); + Copy32( &output_fx[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); - /* Gain discrete objects, if edited */ + /* Gain discrete objects, if edited */ #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES - IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) + IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) #else -#ifdef FIX_1330_JBM_MEMORY IF( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) -#else - IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) #endif -#endif - { - v_multc_fx_16( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[n], *nSamplesRendered ); // Q = 8 - Scale_sig32( data_separated_objects[n], *nSamplesRendered, Q3 ); // Q = 11 - } + { + v_multc_fx_16( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[n], *nSamplesRendered ); // Q = 8 + Scale_sig32( data_separated_objects[n], *nSamplesRendered, Q3 ); // Q = 11 } + } - /* Gain MASA part, if edited in G192. MASA gaining with VOIP is done in ivas_dec_prepare_renderer() */ -#ifdef FIX_1330_JBM_MEMORY - IF( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->masa_gain_is_edited ) -#else - IF( st_ivas->hMasaIsmData->masa_gain_is_edited ) -#endif + /* Gain MASA part, if edited in G192. MASA gaining with VOIP is done in ivas_dec_prepare_renderer() */ + IF( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->masa_gain_is_edited ) + { + FOR( n = 0; n < CPE_CHANNELS; n++ ) { - FOR( n = 0; n < CPE_CHANNELS; n++ ) - { - v_multc_fx_16( output_fx[n], st_ivas->hMasaIsmData->gain_masa_edited_fx, output_fx[n], *nSamplesRendered ); // Q = 8 - Scale_sig32( output_fx[n], *nSamplesRendered, Q3 ); // Q = 11 - } + v_multc_fx_16( output_fx[n], st_ivas->hMasaIsmData->gain_masa_edited_fx, output_fx[n], *nSamplesRendered ); // Q = 8 + Scale_sig32( output_fx[n], *nSamplesRendered, Q3 ); // Q = 11 } } -#ifndef FIX_1330_JBM_MEMORY } -#endif subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; move16(); -#ifndef FIX_1330_JBM_MEMORY - slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; - move16(); -#endif ivas_dirac_dec_render_fx( st_ivas, nchan_transport, nSamplesAsked, nSamplesRendered, nSamplesAvailable, output_fx ); @@ -1209,11 +1168,7 @@ void ivas_omasa_dirac_rend_jbm_fx( scale_sig32( st_ivas->hIsmRendererData->prev_gains_fx[ind1], MAX_OUTPUT_CHANNELS, -1 ); // Q30 -> Q29 } -#ifdef FIX_1330_JBM_MEMORY ivas_omasa_separate_object_render_jbm_fx( st_ivas, *nSamplesRendered, data_separated_objects, output_fx, subframes_rendered ); -#else - ivas_omasa_separate_object_render_jbm_fx( st_ivas, *nSamplesRendered, data_separated_objects, output_fx, subframes_rendered, slots_rendered ); -#endif FOR( Word16 ind1 = 0; ind1 < MAX_NUM_OBJECTS; ind1++ ) { diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index f81a8e8a2303743eb55adb8edf1effccfbb527fb..20cd3d414870dd4ec11ea57f8ea61255f5abcb87 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -296,69 +296,35 @@ ivas_error ivas_osba_render_sf_fx( ) { Word16 n; -#ifdef FIX_1330_JBM_MEMORY Word32 output_sba[MAX_OUTPUT_CHANNELS][L_FRAME48k]; Word32 *p_output_sba[MAX_OUTPUT_CHANNELS]; -#else - Word32 output_ism[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - Word32 *p_output_ism[MAX_OUTPUT_CHANNELS]; -#endif ivas_error error; FOR( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) { -#ifdef FIX_1330_JBM_MEMORY p_output_sba[n] = output_sba[n]; -#else - p_output_ism[n] = &output_ism[n][0]; -#endif } -#ifndef FIX_1330_JBM_MEMORY - if ( !st_ivas->hDecoderConfig->Opt_tsm ) - { - Word16 tc_offset; - tc_offset = st_ivas->hTcBuffer->n_samples_rendered; - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - v_shr( &p_output[n][tc_offset], Q11 - Q11, &output_ism[n][tc_offset], nSamplesAsked ); // Q11 - } - } -#endif -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output_sba ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output ) ), IVAS_ERR_OK ) ) -#endif { return error; } IF( NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { -#ifdef FIX_1330_JBM_MEMORY ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); -#else - ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_ism, *nSamplesRendered ); -#endif } FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { IF( NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { -#ifdef FIX_1330_JBM_MEMORY v_add_fx_no_hdrm( p_output[n], p_output_sba[n], p_output[n], *nSamplesRendered ); -#else - v_add_fx_no_hdrm( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered ); -#endif } -#ifdef FIX_1330_JBM_MEMORY ELSE { Copy32( p_output_sba[n], p_output[n], *nSamplesRendered ); } -#endif } return IVAS_ERR_OK; diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index 793ed74d41975a096287520710b216ab6d029ddc..c4a1b0de109f168d1d6bdd22b9b9c2a4c7f0999b 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -118,12 +118,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( Word32 ivas_total_brate; Word32 last_ivas_total_brate; Word16 num_channels, num_md_sub_frames; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff, nchan_out_buff_old; - Word16 sba_analysis_order_old_flush; -#endif DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; ISM_MODE ism_mode_old; @@ -136,19 +131,12 @@ ivas_error ivas_sba_dec_reconfigure_fx( move32(); last_ivas_total_brate = st_ivas->last_active_ivas_total_brate; move32(); -#ifndef FIX_1330_JBM_MEMORY - sba_analysis_order_old_flush = st_ivas->sba_analysis_order; - move16(); -#endif /*-----------------------------------------------------------------* * Set SBA high-level parameters * Save old SBA high-level parameters *-----------------------------------------------------------------*/ -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, sba_analysis_order_old_flush, last_ivas_total_brate ); -#endif ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); nchan_hp20_old = getNumChanSynthesis( st_ivas ); @@ -707,11 +695,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); /*Q0*/ -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -849,7 +833,6 @@ ivas_error ivas_sba_dec_render_fx( hSpatParamRendCom = st_ivas->hSpatParamRendCom; nchan_internal = ivas_sba_get_nchan_metadata_fx( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); nchan_out = add( st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hIntSetup.num_lfe ); /*Q0*/ -#ifdef FIX_NCHAN_BUFFERS IF( EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) { nchan_out = s_max( nchan_internal, st_ivas->hDecoderConfig->nchan_out ); @@ -858,17 +841,14 @@ ivas_error ivas_sba_dec_render_fx( { nchan_out = s_max( nchan_internal, sub( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_ism ) ); } -#ifdef FIX_1372_OSBA_OBJECT_EDITING ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { nchan_out = BINAURAL_CHANNELS; move16(); } -#endif } nchan_out = s_min( nchan_out, ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); -#endif FOR( ch = 0; ch < nchan_out; ch++ ) { output_fx_local[ch] = output_fx[ch]; /*Q11*/ diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index 4161c57facdaa66619ea97e3f328f5a9977d1d6a..864d0543821e666566163296335a36ffc999ea3b 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -1683,25 +1683,15 @@ void ivas_spar_dec_upmixer_sf_fx( ) { Word16 cldfb_band, num_cldfb_bands, numch_in, numch_out; -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *cldfb_in_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]; Word32 *cldfb_in_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]; -#else - Word32 *cldfb_in_ts_re_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX]; - Word32 *cldfb_in_ts_im_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX]; -#endif Word16 i, b, ts, out_ch, in_ch; Word16 num_spar_bands, spar_band, nchan_transport; Word16 num_in_ingest, split_band; Word16 slot_size, slot_idx_start; Word16 md_idx; -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *p_tc_fx[HOA3_CHANNELS]; Word32 Pcm_tmp_fx[HOA3_CHANNELS][2 /* Re, Im*/ * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - Word32 *p_tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; - Word32 Pcm_tmp_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; -#endif Word16 numch_out_dirac; Word32 mixer_mat_fx[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; Word16 b_skip_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; @@ -1745,13 +1735,7 @@ void ivas_spar_dec_upmixer_sf_fx( p_tc_fx[i] = st_ivas->hTcBuffer->tc_fx[( i + nchan_ism )] + prod; /*Q11*/ } -#ifdef FIX_1372_OSBA_OBJECT_EDITING IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#else - test(); - test(); - IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) && EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#endif { FOR( i = 0; i < nchan_ism; i++ ) { @@ -1793,21 +1777,13 @@ void ivas_spar_dec_upmixer_sf_fx( * Prepare CLDFB buffers *---------------------------------------------------------------------*/ -#ifdef FIX_1319_STACK_SBA_DECODER set_zero_fx( &Pcm_tmp_fx[0][0], HOA3_CHANNELS * 2 * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ); -#else - set_zero_fx( &Pcm_tmp_fx[0][0], ( MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ) * L_FRAME48k ); -#endif /* set-up pointers */ IF( NE_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) ) { /* at this point, output channels are used as intermediate procesing buffers */ -#ifdef FIX_1319_STACK_SBA_DECODER FOR( in_ch = 0; in_ch < HOA3_CHANNELS; in_ch++ ) -#else - FOR( in_ch = 0; in_ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; in_ch++ ) -#endif { FOR( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) { diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index df8607cb5fbbdb9ecc2cc3d86569b65200e6956e..b2e5ecc9ba71cb0bc4b5ffbe613cb4ae092d5157 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1017,16 +1017,10 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { -#ifdef JBM_MEMORY_OPT Word32 *tc_buffer_old_fx[MAX_INTERN_CHANNELS]; /* TC audio samples not rendered in the previous frame */ -#endif - Word32 *tc_buffer_fx; /* the buffer itself */ -#ifdef JBM_MEMORY_OPT - Word32 *tc_fx[MAX_INTERN_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ -#else - Word32 *tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc Q11 for ivas */ -#endif - Word16 no_channels; /*Stores no of channels in tc_fx with values*/ + Word32 *tc_buffer_fx; /* the buffer itself */ + Word32 *tc_fx[MAX_INTERN_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ + Word16 no_channels; /*Stores no of channels in tc_fx with values*/ Word16 q_tc_fx; TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ Word16 nchan_transport_jbm; /* number of TCs after TC decoding */ @@ -1044,10 +1038,8 @@ typedef struct decoder_tc_buffer_structure Word16 num_slots; Word16 n_samples_discard; /* number of samples to discard from the beginning of the output */ -#ifdef FIX_1330_JBM_MEMORY Word32 *tc_buffer2_fx; /* non-scaled buffer of output audio - needed only when '*tc_buffer* is not long enough */ -#endif } DECODER_TC_BUFFER, *DECODER_TC_BUFFER_HANDLE; typedef struct jbm_metadata_structure diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index 6ee4bfe1899b36e77e6d4878d8e367ee5d6aaacf..e24c7695125328c1f44045f1d6c0bb5bbcf20632 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -226,11 +226,7 @@ void stereo_tcx_core_dec_fx( Word16 pit_gain_fx[NB_SUBFR16k]; /*Synth*/ -#ifdef FIX_1320_STACK_CPE_DECODER Word16 synth_buf_fx[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - Word16 synth_buf_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif Word16 *synth_fx; Word16 synth_bufFB_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; Word16 *synthFB_fx; @@ -305,11 +301,7 @@ void stereo_tcx_core_dec_fx( synthFB_fx = synth_bufFB_fx + hTcxDec->old_synth_lenFB; Copy_Scale_sig( hTcxDec->old_synth, synth_buf_fx, hTcxDec->old_synth_len, negate( st->Q_syn ) ); /* q_old_synth - st->Q_syn */ Copy( hTcxDec->old_synthFB_fx, synth_bufFB_fx, hTcxDec->old_synth_lenFB ); /* q_old_synthFB */ -#ifdef FIX_1320_STACK_CPE_DECODER set16_fx( synth_fx, 0, L_FRAME_PLUS_INTERNAL + M ); -#else - set16_fx( synth_fx, 0, L_FRAME_PLUS + M ); -#endif set16_fx( synthFB_fx, 0, L_FRAME_PLUS + M ); /*--------------------------------------------------------------------------------* diff --git a/lib_dec/jbm_pcmdsp_apa.h b/lib_dec/jbm_pcmdsp_apa.h index 98dd104c270fac938feced5ac51495e2103eabf6..2c3bc84c8d6e6b55768812b66cce52ff12001743 100644 --- a/lib_dec/jbm_pcmdsp_apa.h +++ b/lib_dec/jbm_pcmdsp_apa.h @@ -50,14 +50,9 @@ */ /* size of IO buffers (a_in[], a_out[]) for apa_exec() */ -#ifdef JBM_MEMORY_OPT #define APA_BUF_PER_CHANNEL ( IVAS_MAX_FRAME_SIZE * 2 ) /* == twice the max. frame length */ #define APA_MAX_NUM_CHANNELS ( 12 ) /* == MAX_TRANSPORT_CHANNELS */ -#else -#define APA_BUF_PER_CHANNEL ( IVAS_MAX_FRAME_SIZE * 3 ) -#define APA_MAX_NUM_CHANNELS 16 -#endif -#define APA_BUF ( APA_BUF_PER_CHANNEL * APA_MAX_NUM_CHANNELS ) +#define APA_BUF ( APA_BUF_PER_CHANNEL * APA_MAX_NUM_CHANNELS ) /* min/max sampling rate [Hz] */ #define APA_MIN_RATE 1000 diff --git a/lib_dec/jbm_pcmdsp_apa_fx.c b/lib_dec/jbm_pcmdsp_apa_fx.c index bc9ef573f8339baec7b10a82e745e8852cc3d8a8..14cf7dff39a5ceadfcd4e40c6e4d3a19cff1fdf6 100644 --- a/lib_dec/jbm_pcmdsp_apa_fx.c +++ b/lib_dec/jbm_pcmdsp_apa_fx.c @@ -130,7 +130,7 @@ struct apa_state_t #ifdef FIX_2173_UBSAN_IN_JBM_PCMDSP_APA Word16 last_pitch; /* last pitch/sync position */ #else - UWord16 last_pitch; /* last pitch/sync position */ + UWord16 last_pitch; /* last pitch/sync position */ #endif UWord16 bad_frame_count; /* # frames before quality threshold is lowered */ UWord16 good_frame_count; /* # scaled frames */ @@ -694,11 +694,7 @@ UWord8 apa_exec_fx( ) { UWord16 i; -#ifdef JBM_MEMORY_OPT Word16 frm_in[CPE_CHANNELS * APA_BUF / APA_MAX_NUM_CHANNELS]; /* in EVS, 2 output channels */ /* NOTE: this buffer could be smaller if alocated dynamically based on the actual sampling rate and number of channels */ -#else - Word16 frm_in[APA_BUF]; /* TODO(mcjbm): this buffer could be smaller - always allocates space for 16 channels */ -#endif UWord16 l_frm_out; Word16 l_rem; Word32 dl_scaled, dl_copied, l_frm_out_target; @@ -914,11 +910,7 @@ UWord8 apa_exec_ivas_fx( ) { UWord16 i; -#ifdef JBM_MEMORY_OPT Word16 frm_in[APA_BUF]; /* NOTE: this buffer could be smaller if alocated dynamically based on the actual sampling rate and number of channels */ -#else - Word16 frm_in[APA_BUF]; /* TODO(mcjbm): this buffer could be smaller - always allocates space for 16 channels */ -#endif UWord16 l_frm_out; Word16 l_rem; Word32 dl_scaled, dl_copied, l_frm_out_target; diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 82d52ca009e6be00a69456dae46b16417982ca4f..dec6a92422e82d5ac6b3deb477ef26d7a35e8b3b 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -85,9 +85,6 @@ struct IVAS_DEC Word16 tsm_max_scaling; Word16 timeScalingDone; /* have we done already one TSM in a 20ms frame? */ Word16 tsm_quality; /*Q14*/ -#ifndef JBM_MEMORY_OPT - Word32 *apaExecBuffer_fx; /* Buffer for APA scaling */ -#endif PCMDSP_APA_HANDLE hTimeScaler; bool needNewFrame; bool hasBeenFedFrame; @@ -166,9 +163,6 @@ ivas_error IVAS_DEC_Open( hIvasDec = *phIvasDec; hIvasDec->hVoIP = NULL; -#ifndef JBM_MEMORY_OPT - hIvasDec->apaExecBuffer_fx = NULL; -#endif hIvasDec->hTimeScaler = NULL; hIvasDec->tsm_scale = 100; hIvasDec->tsm_max_scaling = 0; @@ -442,12 +436,6 @@ void IVAS_DEC_Close( apa_exit( &( *phIvasDec )->hTimeScaler ); -#ifndef JBM_MEMORY_OPT - IF( ( *phIvasDec )->apaExecBuffer_fx != NULL ) - { - free( ( *phIvasDec )->apaExecBuffer_fx ); - } -#endif IF( ( *phIvasDec )->flushbuffer != NULL ) { free( ( *phIvasDec )->flushbuffer ); @@ -4185,7 +4173,6 @@ ivas_error IVAS_DEC_ReadFormat( return IVAS_ERR_OK; } -#ifdef JBM_MEMORY_OPT /*---------------------------------------------------------------------* * apa_exec_evs_wrapper( ) @@ -4231,7 +4218,6 @@ static ivas_error apa_exec_evs_wrapper( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* @@ -4268,12 +4254,8 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } st_ivas = hIvasDec->st_ivas; -#ifdef JBM_MEMORY_OPT test(); isInitialized_voip = hIvasDec->hTimeScaler != NULL; -#else - isInitialized_voip = hIvasDec->apaExecBuffer_fx != NULL; -#endif test(); IF( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) /* wait for the first good frame */ @@ -4338,50 +4320,16 @@ ivas_error IVAS_DEC_GetSamplesDecoder( return IVAS_ERR_UNKNOWN; } -#ifdef JBM_MEMORY_OPT /* convert deinterleaved decoded TC audio channels buffer to an interleaved one */ ivas_buffer_deinterleaved_to_interleaved_fx( st_ivas->p_output_fx, nTransportChannels, hIvasDec->nSamplesFrame, st_ivas->hTcBuffer->tc_buffer_fx ); -#else - ivas_syn_output_f_fx( st_ivas->p_output_fx, hIvasDec->nSamplesFrame, nTransportChannels, hIvasDec->apaExecBuffer_fx ); -#endif IF( EQ_16( (Word16) hIvasDec->mode, IVAS_DEC_MODE_EVS ) ) { -#ifdef JBM_MEMORY_OPT apa_exec_evs_wrapper( hIvasDec, nTransportChannels, &nTimeScalerOutSamples ); -#else - Word16 tmp_apaExecBuffer[APA_BUF]; - FOR( Word32 i = 0; i < APA_BUF_PER_CHANNEL * nTransportChannels; ++i ) - { -#ifdef JBM_MEMORY_OPT - tmp_apaExecBuffer[i] = extract_l( L_shr( st_ivas->hTcBuffer->tc_buffer_fx[i], Q11 ) ); // Q0 -#else - tmp_apaExecBuffer[i] = extract_l( L_shr( hIvasDec->apaExecBuffer_fx[i], Q11 ) ); // Q0 -#endif - } - - IF( apa_exec_fx( hIvasDec->hTimeScaler, tmp_apaExecBuffer, (UWord16) imult3216( hIvasDec->nSamplesFrame, nTransportChannels ), (UWord16) hIvasDec->tsm_max_scaling, tmp_apaExecBuffer, &nTimeScalerOutSamples ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - - FOR( Word32 i = 0; i < APA_BUF_PER_CHANNEL * nTransportChannels; ++i ) - { -#ifdef JBM_MEMORY_OPT - st_ivas->hTcBuffer->tc_buffer_fx[i] = L_shl( tmp_apaExecBuffer[i], Q11 ); // Q11 -#else - hIvasDec->apaExecBuffer_fx[i] = L_shl( tmp_apaExecBuffer[i], Q11 ); // Q11 -#endif - } -#endif } ELSE { -#ifdef JBM_MEMORY_OPT IF( apa_exec_ivas_fx( hIvasDec->hTimeScaler, st_ivas->hTcBuffer->tc_buffer_fx, (UWord16) imult3216( hIvasDec->nSamplesFrame, nTransportChannels ), (UWord16) hIvasDec->tsm_max_scaling, st_ivas->hTcBuffer->tc_buffer_fx, &nTimeScalerOutSamples ) != 0 ) -#else - IF( apa_exec_ivas_fx( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer_fx, (UWord16) imult3216( hIvasDec->nSamplesFrame, nTransportChannels ), (UWord16) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer_fx, &nTimeScalerOutSamples ) != 0 ) -#endif { return IVAS_ERR_UNKNOWN; } @@ -4391,11 +4339,9 @@ ivas_error IVAS_DEC_GetSamplesDecoder( nSamplesTcsScaled = idiv1616U( extract_l( nTimeScalerOutSamples ), nTransportChannels ); hIvasDec->timeScalingDone = 1; move16(); -#ifdef JBM_MEMORY_OPT /* convert interleaved time-scaled TC audio channels buffer to deinterleaved one */ ivas_buffer_interleaved_to_deinterleaved_fx( st_ivas->hTcBuffer->tc_buffer_fx, nTransportChannels, nSamplesTcsScaled, NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); -#endif } else { @@ -4406,11 +4352,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( * Feed decoded transport channels samples to the renderer *-----------------------------------------------------------------*/ -#ifdef JBM_MEMORY_OPT ivas_jbm_dec_feed_tc_to_renderer_fx( st_ivas, nSamplesTcsScaled, &nResidualSamples ); -#else - ivas_jbm_dec_feed_tc_to_renderer_fx( st_ivas, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer_fx ); -#endif IF( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -5019,18 +4961,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hIsmMetaData[obj]->edited_radius_fx = hIvasEditableParameters.ism_metadata[obj].radius_fx; move32(); #endif -#ifndef NONBE_FIX_1172_OBJ_EDIT_JBM - st_ivas->hIsmMetaData[obj]->azimuth_fx = hIvasEditableParameters.ism_metadata[obj].azimuth_fx; - move32(); - st_ivas->hIsmMetaData[obj]->elevation_fx = hIvasEditableParameters.ism_metadata[obj].elevation_fx; - move32(); - st_ivas->hIsmMetaData[obj]->yaw_fx = hIvasEditableParameters.ism_metadata[obj].yaw_fx; - move32(); - st_ivas->hIsmMetaData[obj]->pitch_fx = hIvasEditableParameters.ism_metadata[obj].pitch_fx; - move32(); - st_ivas->hIsmMetaData[obj]->radius_fx = hIvasEditableParameters.ism_metadata[obj].radius_fx; - move32(); -#endif #ifdef FIX_GAIN_EDIT_LIMITS test(); IF( GT_32( hIvasEditableParameters.ism_metadata[obj].gain_fx, EDIT_GAIN_MAX_Q29 ) ) @@ -6267,9 +6197,6 @@ static ivas_error apa_setup( const bool isInitialized_voip, const UWord16 nTransportChannels ) { -#ifndef JBM_MEMORY_OPT - Word16 apa_buffer_size; -#endif UWord16 l_ts; l_ts = (UWord16) hIvasDec->st_ivas->hTcBuffer->n_samples_granularity; @@ -6283,12 +6210,6 @@ static ivas_error apa_setup( Word32 startQuality; startQuality = L_shl( L_deposit_l( hIvasDec->tsm_quality ), Q2 ); /* Q14 --> Q16*/ -#ifndef JBM_MEMORY_OPT - apa_buffer_size = APA_BUF_PER_CHANNEL; - - move16(); - /* get current renderer type*/ -#endif hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; IF( EQ_32( hDecoderConfig->output_Fs, 8000 ) ) @@ -6339,14 +6260,6 @@ static ivas_error apa_setup( return IVAS_ERR_INIT_ERROR; } } -#ifndef JBM_MEMORY_OPT - IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - - set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ); -#endif } ELSE { @@ -6354,16 +6267,6 @@ static ivas_error apa_setup( { return IVAS_ERR_INIT_ERROR; } -#ifndef JBM_MEMORY_OPT - apa_buffer_size = APA_BUF_PER_CHANNEL; - move16(); - free( hIvasDec->apaExecBuffer_fx ); - IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ); -#endif } hIvasDec->nTransportChannelsOld = nTransportChannels; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 705b52fdbe6963a277a96cd101239741dcefeb4a..9683cd74355e44a84c262d7409a4d7fce5ebd28e 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -371,7 +371,6 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( Word16 nchan_to_allocate; Word16 n_samples_granularity; -#ifdef FIX_NCHAN_BUFFERS nchan_to_allocate = BINAURAL_CHANNELS; move16(); IF( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) @@ -383,10 +382,6 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( { nchan_to_allocate = add( nchan_to_allocate, 1 ); } -#else - nchan_to_allocate = 2 * BINAURAL_CHANNELS; - move16(); -#endif if ( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { nchan_to_allocate = add( BINAURAL_CHANNELS, st_ivas->nchan_ism ); @@ -517,21 +512,13 @@ void ivas_dirac_dec_binaural_render_fx( UWord16 nchan_out; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; Word32 *output_fx_local[MAX_OUTPUT_CHANNELS]; -#ifndef FIX_RENDERER_STACK - Word32 output_fx_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - Word16 output_length; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; nchan_out = BINAURAL_CHANNELS; move16(); FOR( ch = 0; ch < nchan_out; ch++ ) { -#ifdef FIX_RENDERER_STACK output_fx_local[ch] = output_fx[ch]; -#else - output_fx_local[ch] = output_fx_local_buff[ch]; -#endif } slot_size = NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); @@ -550,10 +537,6 @@ void ivas_dirac_dec_binaural_render_fx( last_sf = add( last_sf, 1 ); } -#ifndef FIX_RENDERER_STACK - output_length = 0; - move16(); -#endif FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { n_samples_sf = imult1616( slot_size, hSpatParamRendCom->subframe_nbslots[subframe_idx] ); @@ -565,19 +548,10 @@ void ivas_dirac_dec_binaural_render_fx( output_fx_local[ch] += n_samples_sf; } -#ifndef FIX_RENDERER_STACK - output_length = add( output_length, n_samples_sf ); -#endif /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } -#ifndef FIX_RENDERER_STACK - FOR( ch = 0; ch < nchan_out; ch++ ) - { - Copy32( output_fx_local_buff[ch], output_fx[ch], output_length ); - } -#endif IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) ) { hSpatParamRendCom->dirac_read_idx = add( hSpatParamRendCom->dirac_read_idx, DEFAULT_JBM_SUBFRAMES_5MS ) % hSpatParamRendCom->dirac_md_buffer_length; diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index c2e6b73fc6ec8a2bb5d0e44e309f347fd6ae550e..dd99c0070055fe74b7b4d7a45cb0d31a37d98cd7 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -631,16 +631,10 @@ ivas_error TDREND_Update_object_positions_fx( const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ ) { -#ifndef NONBE_1377_REND_DIRATT_CONF - TDREND_DirAtten_t *DirAtten_p; -#endif Word16 nS; Word32 Pos_fx[3]; // Q25 Word32 Dir_fx[3]; // Q30 ivas_error error; -#ifndef NONBE_1377_REND_DIRATT_CONF - DirAtten_p = hBinRendererTd->DirAtten_p; -#endif /* For each source, write the frame data to the source object*/ FOR( nS = 0; nS < num_src; nS++ ) @@ -665,12 +659,6 @@ ivas_error TDREND_Update_object_positions_fx( { return error; } -#ifndef NONBE_1377_REND_DIRATT_CONF - IF( NE_32( ( error = TDREND_MIX_SRC_SetDirAtten_fx( hBinRendererTd, nS, DirAtten_p ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif if ( ( error = TDREND_MIX_SRC_SetGain( hBinRendererTd, nS, hIsmMetaData[nS]->gain_fx ) ) != IVAS_ERR_OK ) // TODO: Check Gain has correct Q-value { return error; @@ -825,9 +813,7 @@ ivas_error ivas_td_binaural_open_ext_fx( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 outFs, -#ifdef NONBE_1377_REND_DIRATT_CONF const Word16 object_id, /* i: Object ID */ -#endif Word16 *SrcInd, Word16 *num_src ) { @@ -877,11 +863,7 @@ ivas_error ivas_td_binaural_open_ext_fx( if ( NULL != hRendCfg ) { -#ifdef NONBE_1377_REND_DIRATT_CONF directivity_fx = hRendCfg->directivity_fx + 3 * object_id; /* Address calculation -- no BASOPs */ -#else - directivity_fx = hRendCfg->directivity_fx; -#endif distAtt_fx = hRendCfg->distAtt_fx; } diff --git a/lib_rend/ivas_omasa_ana_fx.c b/lib_rend/ivas_omasa_ana_fx.c index ea4dadb73f183cb19f1089190ba8561d0d9f8928..9c209f036805932146d628f892bdc80f0a71c15a 100644 --- a/lib_rend/ivas_omasa_ana_fx.c +++ b/lib_rend/ivas_omasa_ana_fx.c @@ -676,13 +676,10 @@ static void ivas_omasa_dmx_fx( } set16_fx( data_e, 0, 4 ); set16_fx( in_e, 0, 960 ); -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING max_e = 0; -#endif FOR( i = 0; i < nchan_ism; i++ ) { -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING IF( EQ_16( nchan_transport, 1 ) ) { FOR( j = 0; j < input_frame; j++ ) @@ -749,66 +746,8 @@ static void ivas_omasa_dmx_fx( move32(); } } -#else - azimuth_fx = extract_l( L_shr( ism_azimuth_fx[i], Q22 ) ); // Q0 - elevation_fx = extract_l( L_shr( ism_elevation_fx[i], Q22 ) ); // Q0 - - ivas_ism_get_stereo_gains_fx( azimuth_fx, elevation_fx, &gains_fx[0], &gains_fx[1] ); - - /* Downmix using the panning gains */ - FOR( j = 0; j < nchan_transport; j++ ) - { - test(); - IF( abs_s( gains_fx[j] ) > 0 || L_abs( prev_gains_fx[i][j] ) > 0 ) - { - FOR( k = 0; k < input_frame; k++ ) - { - g1_fx = interpolator_fx[k]; // Q15 - move16(); - scale = BASOP_Util_Add_MantExp( 16384, 1, negate( g1_fx ), 0, &g2_fx ); - - tmp1 = mult( g1_fx, gains_fx[j] ); - tmp2 = mult( g2_fx, (Word16) L_shr( prev_gains_fx[i][j], 16 ) ); // Q: ( ( ( 15 - scale ) + ( Q31 - Q16 ) ) - Q15 ) -> ( 15 - scale ) - scale = BASOP_Util_Add_MantExp( tmp1, 0, tmp2, scale, &tmp1 ); - - L_tmp = data_in_f_fx[i][k]; // data_in_q - move32(); - tmp_e = sub( 31, *data_in_q ); - move16(); - - L_tmp = Mpy_32_16_1( L_tmp, tmp1 ); - scale = add( scale, tmp_e ); - - data_out_f_fx[j][k] = BASOP_Util_Add_Mant32Exp( data_out_f_fx[j][k], data_e[j], L_tmp, scale, &in_e[k] ); - move32(); - } - max_e = in_e[0]; - move16(); - FOR( l = 1; l < L_FRAME48k; l++ ) - { - IF( LT_16( max_e, in_e[l] ) ) - { - max_e = in_e[l]; - move16(); - } - } - - FOR( l = 0; l < L_FRAME48k; l++ ) - { - data_out_f_fx[j][l] = L_shr( data_out_f_fx[j][l], sub( max_e, in_e[l] ) ); // exponent: max_e, Q: ( 15 - max_e ) - move32(); - } - data_e[j] = max_e; - move16(); - } - - prev_gains_fx[i][j] = L_deposit_h( gains_fx[j] ); // Q31 - move32(); - } -#endif } -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING IF( NE_16( nchan_transport, 1 ) ) { max_e = data_e[0]; @@ -831,41 +770,15 @@ static void ivas_omasa_dmx_fx( } } } -#else - max_e = data_e[0]; - move16(); - FOR( i = 1; i < nchan_transport; i++ ) - { - IF( LT_16( max_e, data_e[i] ) ) - { - max_e = data_e[i]; - move16(); - } - } - - FOR( i = 0; i < nchan_transport; i++ ) - { - FOR( j = 0; j < input_frame; j++ ) - { - data_out_f_fx[i][j] = L_shr( data_out_f_fx[i][j], sub( max_e, data_e[i] ) ); // exponent: max_e, Q: ( 15 - max_e ) - move32(); - } - } -#endif FOR( i = 0; i < nchan_transport; i++ ) { Copy32( data_out_f_fx[i], data_in_f_fx[i], input_frame ); -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING IF( NE_16( nchan_transport, 1 ) ) { *data_in_q = sub( 31, max_e ); move16(); } -#else - *data_in_q = sub( 31, max_e ); - move16(); -#endif } return; diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index 5969fac17a9c3759237d166a9b106069a66acc2b..053cb43c1e4ee0083dd07e708cd709cc14e3fd99 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -318,11 +318,7 @@ Word16 ivas_get_nchan_buffers_dec_fx( output_config = st_ivas->hDecoderConfig->output_config; move16(); -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = st_ivas->nchan_transport; -#else - nchan_out_buff = MAX_OUTPUT_CHANNELS; -#endif move16(); IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ) @@ -336,7 +332,6 @@ Word16 ivas_get_nchan_buffers_dec_fx( } ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_ism ); test(); @@ -344,49 +339,16 @@ Word16 ivas_get_nchan_buffers_dec_fx( { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - nchan_out_buff = st_ivas->nchan_ism; - move16(); - - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS Word16 nchan_internal; nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); nchan_out_buff = s_max( nchan_internal, st_ivas->hDecoderConfig->nchan_out ); -#else - Word16 nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - move16(); - - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - nchan_out_buff = s_max( nchan_out_buff, nchan_internal ); -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); test(); @@ -395,64 +357,13 @@ Word16 ivas_get_nchan_buffers_dec_fx( nchan_out_buff = 2 * BINAURAL_CHANNELS; move16(); } -#else - nchan_out_buff = CPE_CHANNELS; - move16(); - - test(); - test(); - test(); - test(); - test(); - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) || 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 ) ) - { - nchan_out_buff = shl( CPE_CHANNELS, 1 ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - test(); - test(); - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && GT_16( st_ivas->nchan_ism, 0 ) && LT_16( st_ivas->nchan_ism, 5 ) ) /* Last condition needed only in BASOP */ - { - nchan_out_buff = add( st_ivas->nchan_ism, CPE_CHANNELS ); - } -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = s_max( st_ivas->hDecoderConfig->nchan_out, add( st_ivas->nchan_transport, st_ivas->nchan_ism ) ); -#else - nchan_out_buff = add( st_ivas->nchan_ism, CPE_CHANNELS ); - - test(); - test(); - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( BINAURAL_CHANNELS, st_ivas->nchan_ism ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS Word16 nchan_internal; nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); @@ -473,51 +384,9 @@ Word16 ivas_get_nchan_buffers_dec_fx( { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - Word16 nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); - nchan_out_buff = add( st_ivas->nchan_ism, st_ivas->nchan_transport ); - - IF( st_ivas->hMCT != NULL ) - { - nchan_out_buff = shl( shr( add( nchan_out_buff, 1 ), 1 ), 1 ); /* ensure odd number of channels in MCT */ - } - - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - - test(); - IF( EQ_32( st_ivas->renderer_type, RENDERER_OSBA_AMBI ) || EQ_32( st_ivas->renderer_type, RENDERER_OSBA_LS ) ) - { - nchan_out_buff = s_max( add( nchan_out_buff, st_ivas->nchan_ism ), audioCfg2channels( output_config ) ); /* needed for ivas_sba_upmixer_renderer() */ - } - ELSE - { - nchan_out_buff = s_max( add( nchan_out_buff, st_ivas->nchan_ism ), audioCfg2channels( output_config ) ); /* needed for ivas_spar_dec_upmixer_sf() which is based on 'nchan_out' */ - } - } - ELSE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = add( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_ism ); /*take into account sba_ch_idx' in ivas_dec() */ - } - - test(); - IF( !( EQ_32( output_config, IVAS_AUDIO_CONFIG_MONO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( nchan_internal, st_ivas->nchan_ism ) ); - } - nchan_out_buff = s_min( nchan_out_buff, MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ); -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); IF( st_ivas->hOutSetup.separateChannelEnabled ) @@ -534,19 +403,6 @@ Word16 ivas_get_nchan_buffers_dec_fx( { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } test(); @@ -566,18 +422,12 @@ Word16 ivas_get_nchan_buffers_dec_fx( *-------------------------------------------------------------------*/ ivas_error ivas_output_buff_dec_fx( - Word32 *p_output_fx[], /* i/o: output audio buffers */ -#ifdef FIX_1330_JBM_MEMORY + Word32 *p_output_fx[], /* i/o: output audio buffers */ const Word16 nchan_out_buff, /* i : number of output channels */ const Word16 Opt_tsm, /* i : TSM option flag */ DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */ -#else - const Word16 nchan_out_buff_old, /* i : previous frame number of output channels */ - const Word16 nchan_out_buff /* i : number of output channels */ -#endif ) { -#ifdef FIX_1330_JBM_MEMORY Word16 ch, nchan_tc_jbm, nsamp_to_allocate, n_samp_full, offset; FOR( ch = 0; ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch++ ) @@ -639,37 +489,6 @@ ivas_error ivas_output_buff_dec_fx( offset = add( offset, n_samp_full ); } } -#else - Word16 ch; - - IF( GT_16( nchan_out_buff, nchan_out_buff_old ) ) - { - FOR( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ ) - { -#ifdef FIX_NCHAN_BUFFERS -#ifdef DEBUGGING - if ( p_output_fx[ch] != NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Memory for floating-point output audio buffer is already allocated!\n" ) ); - } -#endif -#endif - /* note: these are intra-frame heap memories */ - IF( ( p_output_fx[ch] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for output audio buffer!\n" ) ); - } - } - } - ELSE - { - FOR( ch = nchan_out_buff; ch < nchan_out_buff_old; ch++ ) - { - free( p_output_fx[ch] ); - p_output_fx[ch] = NULL; - } - } -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index e257ccd126ca3de2fc931e00fd99463a3e21c82b..a1e6f5167a5af0437288a3768f0f72a30c759418 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -683,9 +683,7 @@ ivas_error ivas_td_binaural_open_ext_fx( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 output_Fs, -#ifdef NONBE_1377_REND_DIRATT_CONF const Word16 object_id, /* i : Object ID */ -#endif Word16 *SrcInd, Word16 *num_src ); diff --git a/lib_rend/ivas_rom_rend_fx.c b/lib_rend/ivas_rom_rend_fx.c index 0579e68a4e712ac4be9ebf724325b6be41c604dd..fd56885f90226357265c27ffd3d1c1ccdf82d0b6 100644 --- a/lib_rend/ivas_rom_rend_fx.c +++ b/lib_rend/ivas_rom_rend_fx.c @@ -81,15 +81,9 @@ const Word32 ap_lattice_coeffs_2_fx[132] /* Q31 */ = { 1360843264, 1462880896, const Word32 ap_lattice_coeffs_3_fx[66] /* Q31 */ = { 1360843264, 1462880896, -106124344, 615715776, 313579872, 290773568, -880779712, -444026592, -1410828032, -218497872, 936944960, 729753600, -282142848, -1661606912, -647739072, 703431872, 713452032, 442076704, 1541038592, -1186205568, -322414592, 117158120, 514363136, -1392593792, -1550156800, 406684000, 146426176, 13348758, 165409920, 83060376, 909276800, -233341280, 927820288, -890434752, 596656832, 898691840, 167097856, -607873152, -766668864, 9951439, -950562176, -799540352, 866157440, 521887904, 675097984, 954584384, 746287104, 1065244224, 232804400, 1007990144, -365686400, 700745408, 369704352, 945610048, 125449552, 729442240, -418684160, 1054884800, -604078592, -92599496, -1036132928, -719417728, -721895936, 421913952, -353525216, 950242176}; const Word32 * const ap_lattice_coeffs_fx[DIRAC_DECORR_NUM_SPLIT_BANDS] = { -#ifdef CODE_IMPROVEMENTS ap_lattice_coeffs_1_fx, ap_lattice_coeffs_2_fx, ap_lattice_coeffs_3_fx, -#else - &ap_lattice_coeffs_1_fx[0], - &ap_lattice_coeffs_2_fx[0], - &ap_lattice_coeffs_3_fx[0], -#endif }; const Word16 ap_split_frequencies_fx[DIRAC_DECORR_NUM_SPLIT_BANDS + 1]/*Q14*/ = { diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 4959a3a3ce4e3fefbaebe81f81a306caf6c54525..1dd238afd2d49c8d381a1387dab5e85e6d4e6ca3 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -152,11 +152,9 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( const IVAS_CUSTOM_LS_DATA layout /* i : custom loudspeaker layout for input */ ); -#ifdef NONBE_1377_REND_DIRATT_CONF ivas_error IVAS_REND_SetObjectIDs( IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ ); -#endif ivas_error IVAS_REND_SetInputGain_fx( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index b1953ce964d9c3b8e2577f0d491801ad5246e549..b70cdcadb92b01ef968b8efd983a3f7217c9720e 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -138,9 +138,7 @@ typedef struct Word32 nonDiegeticPanGain_fx; /* Q31 */ OMASA_ANA_HANDLE hOMasa; UWord16 total_num_objects; -#ifdef NONBE_1377_REND_DIRATT_CONF Word16 object_id; -#endif Word16 ism_metadata_delay_ms_fx; /* Q0 */ } input_ism; @@ -1854,11 +1852,7 @@ static ivas_error setRendInputActiveIsm( test(); IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { -#ifdef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1891,11 +1885,7 @@ static ivas_error setRendInputActiveIsm( /* Open TD renderer wrappers */ FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { -#ifdef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1929,11 +1919,7 @@ static ivas_error setRendInputActiveIsm( } ELSE { -#ifdef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2871,11 +2857,7 @@ static ivas_error initMcBinauralRendering( { Word16 SrcInd[MAX_NUM_TDREND_CHANNELS]; Word16 num_src; -#ifdef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2911,11 +2893,7 @@ static ivas_error initMcBinauralRendering( /* Open TD renderer wrappers */ FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { -#ifdef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -4199,7 +4177,6 @@ static ivas_error getConstInputById( return IVAS_ERR_OK; } -#ifdef CODE_IMPROVEMENTS static void *getInputByIndex_fx( void *inputsArray, const size_t index, @@ -4224,57 +4201,31 @@ static void *getInputByIndex_fx( /* include a final return to make the linter happy and avoid problems with wmc_tool (see #1355) */ return NULL; } -#endif static ivas_error findFreeInputSlot_fx( -#ifdef CODE_IMPROVEMENTS void *inputs, const IVAS_REND_AudioConfigType inputType, -#else - const void *inputs, - const int32_t inputStructSize, -#endif const Word32 maxInputs, Word32 *inputIndex ) { -#ifdef CODE_IMPROVEMENTS /* Using a void pointer and a separately provided type is a hack for this function to be reusable for arrays of any input type (input_ism, input_mc, input_sba, input_masa). Assumptions: - input_base is always the first member in the input struct - memory alignments of original input type and input_base are the same */ -#else - /* Using a void pointer and a separately provided size is a hack for this function - to be reusable for arrays of any input type (input_ism, input_mc, input_sba, input_masa). - Assumptions: - - input_base is always the first member in the input struct - - provided size is correct - */ -#endif Word32 i; bool canAddInput; -#ifndef CODE_IMPROVEMENTS - const UWord8 *pByte; -#endif const input_base *pInputBase; canAddInput = false; move16(); /* Find first unused input in array */ -#ifdef CODE_IMPROVEMENTS FOR( i = 0; i < maxInputs; ++i ) -#else - FOR( i = 0, pByte = inputs; i < maxInputs; ++i, pByte += inputStructSize ) -#endif { -#ifdef CODE_IMPROVEMENTS pInputBase = (const input_base *) getInputByIndex_fx( inputs, i, inputType ); -#else - pInputBase = (const input_base *) pByte; -#endif IF( EQ_32( pInputBase->inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { @@ -4549,11 +4500,7 @@ ivas_error IVAS_REND_AddInput_fx( ivas_error error; Word32 maxNumInputsOfType; void *inputsArray; -#ifdef CODE_IMPROVEMENTS IVAS_REND_AudioConfigType inputType; -#else - Word32 inputStructSize; -#endif ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA *, hrtf_handles *hrtfs ); void ( *setInputDelay )( void *, bool ); Word32 inputIndex; @@ -4588,19 +4535,12 @@ ivas_error IVAS_REND_AddInput_fx( } -#ifdef CODE_IMPROVEMENTS inputType = getAudioConfigType( inConfig ); SWITCH( inputType ) -#else - SWITCH( getAudioConfigType( inConfig ) ) -#endif { case IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED: maxNumInputsOfType = RENDERER_MAX_ISM_INPUTS; inputsArray = hIvasRend->inputsIsm; -#ifndef CODE_IMPROVEMENTS - inputStructSize = sizeof( *hIvasRend->inputsIsm ); -#endif activateInput = setRendInputActiveIsm; setInputDelay = setRendInputDelayIsm; move32(); @@ -4609,9 +4549,6 @@ ivas_error IVAS_REND_AddInput_fx( case IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED: maxNumInputsOfType = RENDERER_MAX_MC_INPUTS; inputsArray = hIvasRend->inputsMc; -#ifndef CODE_IMPROVEMENTS - inputStructSize = sizeof( *hIvasRend->inputsMc ); -#endif activateInput = setRendInputActiveMc; setInputDelay = setRendInputDelayMc; move32(); @@ -4620,9 +4557,6 @@ ivas_error IVAS_REND_AddInput_fx( case IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS: maxNumInputsOfType = RENDERER_MAX_SBA_INPUTS; inputsArray = hIvasRend->inputsSba; -#ifndef CODE_IMPROVEMENTS - inputStructSize = sizeof( *hIvasRend->inputsSba ); -#endif activateInput = setRendInputActiveSba; setInputDelay = setRendInputDelaySba; move32(); @@ -4631,9 +4565,6 @@ ivas_error IVAS_REND_AddInput_fx( case IVAS_REND_AUDIO_CONFIG_TYPE_MASA: maxNumInputsOfType = RENDERER_MAX_MASA_INPUTS; inputsArray = hIvasRend->inputsMasa; -#ifndef CODE_IMPROVEMENTS - inputStructSize = sizeof( *hIvasRend->inputsMasa ); -#endif activateInput = setRendInputActiveMasa; setInputDelay = setRendInputDelayMasa; move32(); @@ -4643,32 +4574,20 @@ ivas_error IVAS_REND_AddInput_fx( return IVAS_ERR_INVALID_INPUT_FORMAT; } - /* Find first free input in array corresponding to input type */ -#ifdef CODE_IMPROVEMENTS + /* Find first free input in array corresponding to input type */ IF( NE_32( ( error = findFreeInputSlot_fx( inputsArray, inputType, maxNumInputsOfType, &inputIndex ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = findFreeInputSlot_fx( inputsArray, inputStructSize, maxNumInputsOfType, &inputIndex ) ), IVAS_ERR_OK ) ) -#endif { return error; } *inputId = makeInputId( inConfig, inputIndex ); move16(); -#ifdef CODE_IMPROVEMENTS IF( NE_32( ( error = activateInput( getInputByIndex_fx( inputsArray, inputIndex, inputType ), inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ), IVAS_ERR_OK ) ) -#endif { return error; } -#ifdef CODE_IMPROVEMENTS setInputDelay( getInputByIndex_fx( inputsArray, inputIndex, inputType ), splitPreRendCldfb ); -#else - setInputDelay( (Word8 *) inputsArray + inputStructSize * inputIndex, splitPreRendCldfb ); -#endif /* set global maximum delay after adding an input */ setMaxGlobalDelayNs( hIvasRend ); @@ -4754,7 +4673,6 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return IVAS_ERR_OK; } -#ifdef NONBE_1377_REND_DIRATT_CONF /*-------------------------------------------------------------------* * IVAS_REND_SetObjectIDs() @@ -4782,7 +4700,6 @@ ivas_error IVAS_REND_SetObjectIDs( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * IVAS_REND_SetInputGain() diff --git a/lib_util/mime_io.c b/lib_util/mime_io.c index 87ce9d13143af4edd5c3ef7e8c1e34f1d8147eab..3e837ca45df96aeaae64cd5f344f72578e048699 100644 --- a/lib_util/mime_io.c +++ b/lib_util/mime_io.c @@ -317,11 +317,7 @@ static bool readByte( FILE *file, uint8_t *value ) static bool readLong( FILE *file, uint16_t *value ) { char buffer[4] = { 0 }; -#ifdef CODE_IMPROVEMENTS if ( fread( buffer, 1, 4, file ) != 1U ) -#else - if ( fread( buffer, 4, 1, file ) != 1U ) -#endif { return false; } diff --git a/lib_util/rotation_file_reader.c b/lib_util/rotation_file_reader.c index 9746c69ac41e10f01edcfd7d708fae77acfadea4..4385a9f831cb63e632620295e765060f6e67afd3 100644 --- a/lib_util/rotation_file_reader.c +++ b/lib_util/rotation_file_reader.c @@ -197,14 +197,12 @@ ivas_error ExternalOrientationFileReading( } ( externalOrientationReader->frameCounter )++; -#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Only Quaternion orientations are supported, raise an error if Euler angles are detected in the input */ if ( w == -3.0f ) { return IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT; } -#endif pQuaternion->w_fx = float_to_fix( w, Q29 ); pQuaternion->x_fx = float_to_fix( x, Q29 ); diff --git a/lib_util/rtpdump.c b/lib_util/rtpdump.c index 5c9faf59a7f34f6bad82ebb3a12aed30379d77d7..cbb6fb1f623de7484d3170a5347095e72d7f0940 100644 --- a/lib_util/rtpdump.c +++ b/lib_util/rtpdump.c @@ -81,11 +81,7 @@ static unsigned char *parseByte( unsigned char *buffer, unsigned char *value ) static int readLong( FILE *file, unsigned int *value ) { char buffer[4] = { 0 }; -#ifdef CODE_IMPROVEMENTS if ( fread( buffer, 1, 4, file ) != 1U ) -#else - if ( fread( buffer, 4, 1, file ) != 1U ) -#endif { return -1; } @@ -101,11 +97,7 @@ static int readLong( FILE *file, unsigned int *value ) static int readShort( FILE *file, unsigned short *value ) { char buffer[2] = { 0 }; -#ifdef CODE_IMPROVEMENTS if ( fread( buffer, 1, 2, file ) != 1U ) -#else - if ( fread( buffer, 2, 1, file ) != 1U ) -#endif { return -1; } diff --git a/lib_util/tinywavein_c.h b/lib_util/tinywavein_c.h index 179c676a81b274098fabbe5050c2c977572c82ec..1ff6f26bb78438b2fbb835e483f99c1d46128dce 100644 --- a/lib_util/tinywavein_c.h +++ b/lib_util/tinywavein_c.h @@ -54,22 +54,14 @@ #define __TWI_SUCCESS ( 0 ) #define __TWI_ERROR ( -1 ) -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveInHandle -#else -typedef struct __tinyWaveInHandle -#endif { FILE *theFile; fpos_t dataChunkPos; uint32_t position; uint32_t length; uint32_t bps; -#ifdef CODE_IMPROVEMENTS } tinyWaveInHandle, WAVEFILEIN; -#else -} __tinyWaveInHandle, WAVEFILEIN; -#endif typedef struct { diff --git a/lib_util/tinywaveout_c.h b/lib_util/tinywaveout_c.h index 70373e3cca0850aacd3849376765690d3980927a..a3982ba19cdda311fea397ad5fb6b139c8d83c0e 100644 --- a/lib_util/tinywaveout_c.h +++ b/lib_util/tinywaveout_c.h @@ -70,27 +70,15 @@ #endif #endif -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveOutHeader -#else -typedef struct __tinyWaveOutHeader -#endif { uint32_t riffType; /* 'RIFF' */ uint32_t riffSize; /* file size */ uint32_t waveType; /* 'WAVE' */ -#ifdef CODE_IMPROVEMENTS } tinyWaveOutHeader; -#else -} __tinyWaveOutHeader; -#endif -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveOutFmtChunk -#else -typedef struct __tinyWaveOutFmtChunk -#endif { uint32_t formatType; uint32_t formatSize; @@ -103,32 +91,16 @@ typedef struct __tinyWaveOutFmtChunk uint16_t bitsPerSample; /* wav fmt ext hdr here */ -#ifdef CODE_IMPROVEMENTS } tinyWaveOutFmtChunk; -#else -} __tinyWaveOutFmtChunk; -#endif -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveOutDataChunk -#else -typedef struct __tinyWaveOutDataChunk -#endif { uint32_t dataType; uint32_t dataSize; -#ifdef CODE_IMPROVEMENTS } tinyWaveOutDataChunk; -#else -} __tinyWaveOutDataChunk; -#endif -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveOutHandle -#else -typedef struct __tinyWaveOutHandle -#endif { FILE *theFile; uint32_t dataSize; @@ -137,11 +109,7 @@ typedef struct __tinyWaveOutHandle uint32_t dataChunkOffset; uint32_t bps; uint32_t clipCount; -#ifdef CODE_IMPROVEMENTS } tinyWaveOutHandle, WAVEFILEOUT; -#else -} __tinyWaveOutHandle, WAVEFILEOUT; -#endif /*--- local protos --------------------------------------------------*/ static __inline uint32_t BigEndian32( char, char, char, char ); @@ -164,15 +132,9 @@ static WAVEFILEOUT *CreateBWF( /* ,const uint32_t writeWaveExt */ ) { WAVEFILEOUT *self; -#ifdef CODE_IMPROVEMENTS tinyWaveOutHeader whdr; tinyWaveOutFmtChunk wfch; tinyWaveOutDataChunk wdch; -#else - __tinyWaveOutHeader whdr; - __tinyWaveOutFmtChunk wfch; - __tinyWaveOutDataChunk wdch; -#endif uint32_t blockAlignment = 0; uint32_t ByteCnt = 0; /* Byte counter for fwrite */