Loading apps/encoder.c +2 −31 Original line number Diff line number Diff line Loading @@ -1273,20 +1273,14 @@ static bool parseCmdlIVAS_enc( arg->inputFormat = IVAS_ENC_INPUT_ISM; i++; #ifdef IMPROVE_CMDLINE_ROBUSTNESS if ( i < argc - 4 ) #else if ( i < argc - 5 ) #endif { #ifdef IMPROVE_CMDLINE_ROBUSTNESS if ( !is_digits_only( argv[i] ) ) { fprintf( stderr, "Error: Number of ISM channels must be an integer number!\n\n" ); usage_enc(); return false; } #endif if ( sscanf( argv[i], "%d", &tmp ) > 0 ) { Loading @@ -1299,14 +1293,12 @@ static bool parseCmdlIVAS_enc( usage_enc(); return false; } #ifdef IMPROVE_CMDLINE_ROBUSTNESS else if ( tmp > IVAS_MAX_NUM_OBJECTS ) { fprintf( stderr, "Error: Too high number of ISM channels specified!\n\n" ); usage_enc(); return false; } #endif else { arg->inputFormatConfig.ism.numObjects = (int16_t) tmp; Loading Loading @@ -1338,11 +1330,7 @@ static bool parseCmdlIVAS_enc( } else { #ifdef IMPROVE_CMDLINE_ROBUSTNESS fprintf( stderr, "Error: not enough metadata arguments specified!\n\n" ); #else fprintf( stderr, "Error: not enough arguments\n\n" ); #endif usage_enc(); return false; } Loading @@ -1354,20 +1342,9 @@ static bool parseCmdlIVAS_enc( arg->inputFormat = IVAS_ENC_INPUT_SBA; /* SBA configuration */ if ( i < argc - 4 #ifdef IMPROVE_CMDLINE_ROBUSTNESS && is_number( argv[i] ) && sscanf( argv[i], "%d", &tmp ) > 0 #endif ) if ( i < argc - 4 && is_number( argv[i] ) && sscanf( argv[i], "%d", &tmp ) > 0 ) { #ifndef IMPROVE_CMDLINE_ROBUSTNESS if ( sscanf( argv[i], "%d", &tmp ) > 0 ) { #endif i++; #ifndef IMPROVE_CMDLINE_ROBUSTNESS } #endif } else { Loading Loading @@ -1404,14 +1381,12 @@ static bool parseCmdlIVAS_enc( if ( i < argc - 4 ) { #ifdef IMPROVE_CMDLINE_ROBUSTNESS if ( !is_digits_only( argv[i] ) ) { fprintf( stderr, "Error: Number of MASA channels must be an integer number!\n\n" ); usage_enc(); return false; } #endif if ( sscanf( argv[i], "%d", &tmp ) > 0 ) { Loading @@ -1427,11 +1402,7 @@ static bool parseCmdlIVAS_enc( arg->inputFormatConfig.masaVariant = IVAS_ENC_MASA_2CH; break; default: #ifdef IMPROVE_CMDLINE_ROBUSTNESS fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" ); #else fprintf( stderr, "Error: MASA channels must for the moment be 1 or 2.\n\n" ); #endif usage_enc(); return false; } Loading apps/renderer.c +0 −6 Original line number Diff line number Diff line Loading @@ -2432,9 +2432,7 @@ static void convertOutputBuffer( int16_t *intBuffer ) { int16_t chnl, smpl, i; #ifdef FIX_REND_ROUNDING float temp; #endif i = 0; Loading @@ -2442,7 +2440,6 @@ static void convertOutputBuffer( { for ( chnl = 0; chnl < numChannels; ++chnl ) { #ifdef FIX_REND_ROUNDING temp = floatBuffer[chnl * numSamplesPerChannel + smpl]; temp = (float) floor( temp + 0.5f ); if ( temp > MAX16B_FLT ) Loading @@ -2454,9 +2451,6 @@ static void convertOutputBuffer( temp = MIN16B_FLT; } intBuffer[i] = (int16_t) temp; #else intBuffer[i] = (int16_t) roundf( floatBuffer[chnl * numSamplesPerChannel + smpl] ); #endif ++i; } Loading lib_com/bitstream.c +0 −12 Original line number Diff line number Diff line Loading @@ -1950,24 +1950,12 @@ ivas_error preview_indices( /* read number of objects from the bitstream */ st_ivas->nchan_transport = 1; #ifdef FIX_ISM_DECODER_PRINTOUT k = (int16_t) ( ( total_brate / FRAMES_PER_SEC ) - 1 ); while ( bit_stream[k] == 1 && st_ivas->nchan_transport < MAX_NUM_OBJECTS ) { st_ivas->nchan_transport++; k--; } #else if ( total_brate != SID_2k40 && total_brate != FRAME_NO_DATA ) { k = (int16_t) ( ( total_brate / FRAMES_PER_SEC ) - 1 ); while ( bit_stream[k] == 1 && st_ivas->hDecoderConfig->nchan_out < MAX_NUM_OBJECTS ) { st_ivas->nchan_transport++; k--; } } #endif st_ivas->transport_config = AUDIO_CONFIG_EXTERNAL + st_ivas->nchan_transport; st_ivas->ism_mode = ivas_ism_mode_select( st_ivas->nchan_transport, total_brate ); Loading lib_com/ivas_cnst.h +0 −8 Original line number Diff line number Diff line Loading @@ -465,10 +465,8 @@ enum #define STEREO_DFT_OFFSET 1 #define STEREO_DFT_NBDIV 2 #ifdef FIX_ITD_CNG #define STEREO_DFT_ITD_CNG_XFADE 100 #define STEREO_DFT_ITD_CNG_XFADE_RESET 2 #endif #define STEREO_DFT_DELAY_DEC_BWE_NS ( STEREO_DFT_OFFSET * STEREO_DFT_HOP_NS - ACELP_LOOK_NS ) /* 1.25ms/2.5ms: max delay for core decoder*/ Loading Loading @@ -535,9 +533,7 @@ typedef enum #define STEREO_DFT_SID_GIPD_NBITS 2 #define STEREO_DFT_FD_FILT 0.9f #ifdef FIX_ITD_CNG #define STEREO_DFT_CNG_ITD_CNT 8 #endif /*Residual prediction*/ #define STEREO_DFT_PAST_MAX 4 Loading Loading @@ -1391,7 +1387,6 @@ typedef enum #define SFX_SPAT_BIN_MAX_FILTER_LENGTH 256 #define SPAT_BIN_MAX_INPUT_CHANNELS 1 /* Max number of input channels per source/object. Mono for now, but stereo objects may be considered. */ #ifdef FIX_ITD #define MAX_ITD 50 #define SFX_SPAT_BIN_SINC_M 5 #define SFX_SPAT_BIN_NUM_SUBSAMPLES 64 Loading @@ -1401,9 +1396,6 @@ typedef enum #define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP ) #define MAX_INTERPOLATION_STEPS 12 #define BINAURAL_TD_LATENCY_S 0.0f /* ITD fix removes TD renderer delay -- should be cleaned out */ #else #define BINAURAL_TD_LATENCY_S 0.00675f /* Binaural TD renderer latency in second == 324 samples in between 333 and 315 */ #endif /* ----- Enums - TD Renderer ----- */ Loading lib_com/ivas_ism_config.c +0 −12 Original line number Diff line number Diff line Loading @@ -199,11 +199,7 @@ ivas_error ivas_ism_config( diff = 0; for ( ch = 0; ch < n_ISms; ch++ ) { #ifdef FIX_ISM_INACTIVE_BITS int16_t limit; #else int32_t limit; #endif limit = MIN_BRATE_SWB_BWE / FRMS_PER_SECOND; if ( element_brate[ch] < MIN_BRATE_SWB_STEREO ) /* replicate function set_bw() -> check the coded audio band-width */ Loading @@ -223,20 +219,12 @@ ivas_error ivas_ism_config( else if ( ism_imp[ch] == ISM_LOW_IMP ) { tmp = (int16_t) ( BETA_ISM_LOW_IMP * bits_CoreCoder[ch] ); #ifdef FIX_ISM_INACTIVE_BITS tmp = max( limit, tmp ); #else tmp = (int16_t) max( limit, bits_CoreCoder[ch] - tmp ); #endif } else if ( ism_imp[ch] == ISM_MEDIUM_IMP ) { tmp = (int16_t) ( BETA_ISM_MEDIUM_IMP * bits_CoreCoder[ch] ); #ifdef FIX_ISM_INACTIVE_BITS tmp = max( limit, tmp ); #else tmp = (int16_t) max( limit, bits_CoreCoder[ch] - tmp ); #endif } else /* ism_imp[ch] == ISM_HIGH_IMP */ { Loading Loading
apps/encoder.c +2 −31 Original line number Diff line number Diff line Loading @@ -1273,20 +1273,14 @@ static bool parseCmdlIVAS_enc( arg->inputFormat = IVAS_ENC_INPUT_ISM; i++; #ifdef IMPROVE_CMDLINE_ROBUSTNESS if ( i < argc - 4 ) #else if ( i < argc - 5 ) #endif { #ifdef IMPROVE_CMDLINE_ROBUSTNESS if ( !is_digits_only( argv[i] ) ) { fprintf( stderr, "Error: Number of ISM channels must be an integer number!\n\n" ); usage_enc(); return false; } #endif if ( sscanf( argv[i], "%d", &tmp ) > 0 ) { Loading @@ -1299,14 +1293,12 @@ static bool parseCmdlIVAS_enc( usage_enc(); return false; } #ifdef IMPROVE_CMDLINE_ROBUSTNESS else if ( tmp > IVAS_MAX_NUM_OBJECTS ) { fprintf( stderr, "Error: Too high number of ISM channels specified!\n\n" ); usage_enc(); return false; } #endif else { arg->inputFormatConfig.ism.numObjects = (int16_t) tmp; Loading Loading @@ -1338,11 +1330,7 @@ static bool parseCmdlIVAS_enc( } else { #ifdef IMPROVE_CMDLINE_ROBUSTNESS fprintf( stderr, "Error: not enough metadata arguments specified!\n\n" ); #else fprintf( stderr, "Error: not enough arguments\n\n" ); #endif usage_enc(); return false; } Loading @@ -1354,20 +1342,9 @@ static bool parseCmdlIVAS_enc( arg->inputFormat = IVAS_ENC_INPUT_SBA; /* SBA configuration */ if ( i < argc - 4 #ifdef IMPROVE_CMDLINE_ROBUSTNESS && is_number( argv[i] ) && sscanf( argv[i], "%d", &tmp ) > 0 #endif ) if ( i < argc - 4 && is_number( argv[i] ) && sscanf( argv[i], "%d", &tmp ) > 0 ) { #ifndef IMPROVE_CMDLINE_ROBUSTNESS if ( sscanf( argv[i], "%d", &tmp ) > 0 ) { #endif i++; #ifndef IMPROVE_CMDLINE_ROBUSTNESS } #endif } else { Loading Loading @@ -1404,14 +1381,12 @@ static bool parseCmdlIVAS_enc( if ( i < argc - 4 ) { #ifdef IMPROVE_CMDLINE_ROBUSTNESS if ( !is_digits_only( argv[i] ) ) { fprintf( stderr, "Error: Number of MASA channels must be an integer number!\n\n" ); usage_enc(); return false; } #endif if ( sscanf( argv[i], "%d", &tmp ) > 0 ) { Loading @@ -1427,11 +1402,7 @@ static bool parseCmdlIVAS_enc( arg->inputFormatConfig.masaVariant = IVAS_ENC_MASA_2CH; break; default: #ifdef IMPROVE_CMDLINE_ROBUSTNESS fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" ); #else fprintf( stderr, "Error: MASA channels must for the moment be 1 or 2.\n\n" ); #endif usage_enc(); return false; } Loading
apps/renderer.c +0 −6 Original line number Diff line number Diff line Loading @@ -2432,9 +2432,7 @@ static void convertOutputBuffer( int16_t *intBuffer ) { int16_t chnl, smpl, i; #ifdef FIX_REND_ROUNDING float temp; #endif i = 0; Loading @@ -2442,7 +2440,6 @@ static void convertOutputBuffer( { for ( chnl = 0; chnl < numChannels; ++chnl ) { #ifdef FIX_REND_ROUNDING temp = floatBuffer[chnl * numSamplesPerChannel + smpl]; temp = (float) floor( temp + 0.5f ); if ( temp > MAX16B_FLT ) Loading @@ -2454,9 +2451,6 @@ static void convertOutputBuffer( temp = MIN16B_FLT; } intBuffer[i] = (int16_t) temp; #else intBuffer[i] = (int16_t) roundf( floatBuffer[chnl * numSamplesPerChannel + smpl] ); #endif ++i; } Loading
lib_com/bitstream.c +0 −12 Original line number Diff line number Diff line Loading @@ -1950,24 +1950,12 @@ ivas_error preview_indices( /* read number of objects from the bitstream */ st_ivas->nchan_transport = 1; #ifdef FIX_ISM_DECODER_PRINTOUT k = (int16_t) ( ( total_brate / FRAMES_PER_SEC ) - 1 ); while ( bit_stream[k] == 1 && st_ivas->nchan_transport < MAX_NUM_OBJECTS ) { st_ivas->nchan_transport++; k--; } #else if ( total_brate != SID_2k40 && total_brate != FRAME_NO_DATA ) { k = (int16_t) ( ( total_brate / FRAMES_PER_SEC ) - 1 ); while ( bit_stream[k] == 1 && st_ivas->hDecoderConfig->nchan_out < MAX_NUM_OBJECTS ) { st_ivas->nchan_transport++; k--; } } #endif st_ivas->transport_config = AUDIO_CONFIG_EXTERNAL + st_ivas->nchan_transport; st_ivas->ism_mode = ivas_ism_mode_select( st_ivas->nchan_transport, total_brate ); Loading
lib_com/ivas_cnst.h +0 −8 Original line number Diff line number Diff line Loading @@ -465,10 +465,8 @@ enum #define STEREO_DFT_OFFSET 1 #define STEREO_DFT_NBDIV 2 #ifdef FIX_ITD_CNG #define STEREO_DFT_ITD_CNG_XFADE 100 #define STEREO_DFT_ITD_CNG_XFADE_RESET 2 #endif #define STEREO_DFT_DELAY_DEC_BWE_NS ( STEREO_DFT_OFFSET * STEREO_DFT_HOP_NS - ACELP_LOOK_NS ) /* 1.25ms/2.5ms: max delay for core decoder*/ Loading Loading @@ -535,9 +533,7 @@ typedef enum #define STEREO_DFT_SID_GIPD_NBITS 2 #define STEREO_DFT_FD_FILT 0.9f #ifdef FIX_ITD_CNG #define STEREO_DFT_CNG_ITD_CNT 8 #endif /*Residual prediction*/ #define STEREO_DFT_PAST_MAX 4 Loading Loading @@ -1391,7 +1387,6 @@ typedef enum #define SFX_SPAT_BIN_MAX_FILTER_LENGTH 256 #define SPAT_BIN_MAX_INPUT_CHANNELS 1 /* Max number of input channels per source/object. Mono for now, but stereo objects may be considered. */ #ifdef FIX_ITD #define MAX_ITD 50 #define SFX_SPAT_BIN_SINC_M 5 #define SFX_SPAT_BIN_NUM_SUBSAMPLES 64 Loading @@ -1401,9 +1396,6 @@ typedef enum #define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP ) #define MAX_INTERPOLATION_STEPS 12 #define BINAURAL_TD_LATENCY_S 0.0f /* ITD fix removes TD renderer delay -- should be cleaned out */ #else #define BINAURAL_TD_LATENCY_S 0.00675f /* Binaural TD renderer latency in second == 324 samples in between 333 and 315 */ #endif /* ----- Enums - TD Renderer ----- */ Loading
lib_com/ivas_ism_config.c +0 −12 Original line number Diff line number Diff line Loading @@ -199,11 +199,7 @@ ivas_error ivas_ism_config( diff = 0; for ( ch = 0; ch < n_ISms; ch++ ) { #ifdef FIX_ISM_INACTIVE_BITS int16_t limit; #else int32_t limit; #endif limit = MIN_BRATE_SWB_BWE / FRMS_PER_SECOND; if ( element_brate[ch] < MIN_BRATE_SWB_STEREO ) /* replicate function set_bw() -> check the coded audio band-width */ Loading @@ -223,20 +219,12 @@ ivas_error ivas_ism_config( else if ( ism_imp[ch] == ISM_LOW_IMP ) { tmp = (int16_t) ( BETA_ISM_LOW_IMP * bits_CoreCoder[ch] ); #ifdef FIX_ISM_INACTIVE_BITS tmp = max( limit, tmp ); #else tmp = (int16_t) max( limit, bits_CoreCoder[ch] - tmp ); #endif } else if ( ism_imp[ch] == ISM_MEDIUM_IMP ) { tmp = (int16_t) ( BETA_ISM_MEDIUM_IMP * bits_CoreCoder[ch] ); #ifdef FIX_ISM_INACTIVE_BITS tmp = max( limit, tmp ); #else tmp = (int16_t) max( limit, bits_CoreCoder[ch] - tmp ); #endif } else /* ism_imp[ch] == ISM_HIGH_IMP */ { Loading