From 9dc8750401998296be665e2ea70dc1e7a100f7f5 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 23 Feb 2023 14:48:45 +0100 Subject: [PATCH 1/2] Issue 355: remove obsolete "-force_subframe_bin" command-line option; under REMOVE_FORCE_SUBFRAME_BIN --- apps/decoder.c | 12 ++++++++++++ lib_com/options.h | 4 ++++ lib_dec/ivas_init_dec.c | 3 ++- lib_dec/ivas_stat_dec.h | 4 +++- lib_dec/lib_dec.c | 6 ++++++ lib_dec/lib_dec.h | 2 ++ lib_rend/lib_rend.c | 2 ++ readme.txt | 2 -- 8 files changed, 31 insertions(+), 4 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index bbbee76c88..c29a85f40d 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -105,7 +105,9 @@ typedef struct char *renderConfigFilename; #ifdef DEBUGGING +#ifndef REMOVE_FORCE_SUBFRAME_BIN bool forceSubframeBinauralization; +#endif IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ @@ -271,10 +273,14 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ +#ifdef REMOVE_FORCE_SUBFRAME_BIN + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation ) ) != IVAS_ERR_OK ) +#else #ifdef DEBUGGING if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.forceSubframeBinauralization ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation ) ) != IVAS_ERR_OK ) +#endif #endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -667,7 +673,9 @@ static bool parseCmdlIVAS_dec( float ftmp; arg->forcedRendMode = IVAS_DEC_FORCE_REND_UNFORCED; +#ifndef REMOVE_FORCE_SUBFRAME_BIN arg->forceSubframeBinauralization = false; +#endif #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif @@ -819,11 +827,13 @@ static bool parseCmdlIVAS_dec( i++; } } +#ifndef REMOVE_FORCE_SUBFRAME_BIN else if ( strcmp( argv_to_upper, "-FORCE_SUBFRAME_BIN" ) == 0 ) /* Force binauralization to subframe (5 ms) resolution */ { arg->forceSubframeBinauralization = true; i++; } +#endif #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK /*-----------------------------------------------------------------* @@ -1073,8 +1083,10 @@ static void usage_dec( void ) fprintf( stdout, "-T File : Head rotation specified by external trajectory File\n" ); fprintf( stdout, "-hrtf File : HRTF filter File used in BINAURAL output configuration\n" ); #ifdef DEBUGGING +#ifndef REMOVE_FORCE_SUBFRAME_BIN fprintf( stdout, "-force_subframe_bin : Forces parametric binauralizer code to use 5 ms time resolution even when\n" ); fprintf( stdout, " output time resolution is larger.\n" ); +#endif fprintf( stdout, "-FEC X : Insert frame erasures, X = 0-10 is the percentage\n" ); fprintf( stdout, " of erased frames, or X may be the name of binary file or \n" ); fprintf( stdout, " file with G192 headers indicating GOOD FRAME or BAD FRAME\n" ); diff --git a/lib_com/options.h b/lib_com/options.h index 9a6a9d4c5b..6b22caab02 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -148,6 +148,8 @@ #define FIX_347_DTX_CRASH /* FhG: Fix crash that can happen with DTX */ #define DISABLE_RES_CHANNELS_MCT /* decode only W and residual for Y when outputting to stereo */ #define FIX_107_5MS_SUBFRAME_RENDERING +#define REMOVE_FORCE_SUBFRAME_BIN /* Issue 355: remove obsolete "-force_subframe_bin" command-line option. */ + #define PARAM_ISM_DTX_CNG /* FhG: contribution 9 - DTX-CNG for ParamISM */ #define FIX_331_SBA_HBR_HOA_FIXES /* DLB: issue 331 - fix addressing low frequency stuttering with HOA inputs at high bitrates */ @@ -158,6 +160,8 @@ #define SMOOTH_WITH_TRANS_DET #endif + + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 7f28bc4226..128d9a5c8c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2071,6 +2071,7 @@ static ivas_error doSanityChecks_IVAS( } } +#ifndef REMOVE_FORCE_SUBFRAME_BIN #ifdef DEBUGGING if ( st_ivas->hDecoderConfig->forceSubframeBinauralization ) { @@ -2095,6 +2096,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_FORCE_MODE, "Incorrect debug configuration: Cannot force CLDFB renderer in combination with TD renderer HRTF file" ); } #endif - +#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 7c6ac19f7e..3c9bf13abf 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1133,8 +1133,10 @@ typedef struct decoder_config_structure /* temp. development parameters */ #ifdef DEBUGGING +#ifndef REMOVE_FORCE_SUBFRAME_BIN int16_t forceSubframeBinauralization; /* Flag for forcing Parametric binauralizer to subframe mode */ - int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ +#endif + int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ #endif } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a1fee7f0fd..a6a4778bea 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -223,8 +223,10 @@ static void init_decoder_config( hDecoderConfig->Opt_LsCustom = 0; hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; +#ifndef REMOVE_FORCE_SUBFRAME_BIN #ifdef DEBUGGING hDecoderConfig->forceSubframeBinauralization = 0; +#endif #endif hDecoderConfig->orientation_tracking = orientation_tracking; hDecoderConfig->no_diegetic_pan = no_diegetic_pan; @@ -390,10 +392,12 @@ ivas_error IVAS_DEC_Configure( const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation /* i : enable head rotation for binaural output */ +#ifndef REMOVE_FORCE_SUBFRAME_BIN #ifdef DEBUGGING , const int16_t forceSubframeBinauralization /* i : enable subframe binauralization */ #endif +#endif ) { Decoder_Struct *st_ivas; @@ -439,8 +443,10 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); } +#ifndef REMOVE_FORCE_SUBFRAME_BIN #ifdef DEBUGGING hDecoderConfig->forceSubframeBinauralization = forceSubframeBinauralization; +#endif #endif hDecoderConfig->Opt_LsCustom = customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = enableHeadRotation; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index d3035af0b5..e41937b3b1 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -132,10 +132,12 @@ ivas_error IVAS_DEC_Configure( const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation /* i : enable head rotation for binaural output */ +#ifndef REMOVE_FORCE_SUBFRAME_BIN #ifdef DEBUGGING , const int16_t forceSubframeBinauralization /* i : enable subframe binauralization */ #endif +#endif ); void IVAS_DEC_Close( diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8f868bd58f..306205b92c 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2369,8 +2369,10 @@ static ivas_error initMasaDummyDecForBinauralOut( } decDummy->ivas_format = MASA_FORMAT; decDummy->transport_config = AUDIO_CONFIG_INVALID; +#ifndef REMOVE_FORCE_SUBFRAME_BIN #ifdef DEBUGGING decDummy->hDecoderConfig->forceSubframeBinauralization = 0; +#endif #endif if ( ( error = ivas_dirac_dec_open( decDummy ) ) != IVAS_ERR_OK ) diff --git a/readme.txt b/readme.txt index 95b9a814ec..84bef3a7e2 100644 --- a/readme.txt +++ b/readme.txt @@ -253,8 +253,6 @@ Options: default bitstream file format is G.192 -T File : Head rotation specified by external trajectory File -hrtf File : HRTF filter File used in ISm format and BINAURAL output configuration --force_subframe_bin : Forces parametric binauralizer code to use 5 ms time resolution even when - output time resolution is larger. -FEC X : Insert frame erasures, X = 0-10 is the percentage of erased frames, or X may be the name of binary file or file with G192 headers indicating GOOD FRAME or BAD FRAME -- GitLab From b6df69e71fac8b9ffd29bdc43278f02ccad27296 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 23 Feb 2023 15:47:55 +0100 Subject: [PATCH 2/2] revert too long removal --- lib_dec/ivas_init_dec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 9cdac9bfc4..2e206ab2ff 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2074,8 +2074,8 @@ static ivas_error doSanityChecks_IVAS( } } -#ifndef REMOVE_FORCE_SUBFRAME_BIN #ifdef DEBUGGING +#ifndef REMOVE_FORCE_SUBFRAME_BIN if ( st_ivas->hDecoderConfig->forceSubframeBinauralization ) { /* Note about resolution of Binaural Renderers: * @@ -2088,7 +2088,7 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Wrong set-up: Forced subframe resolution parametric binauralization activated for non-binaural output." ); } } - +#endif if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || output_config != AUDIO_CONFIG_BINAURAL || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration: Time Domain object renderer not supported in this configuration" ); @@ -2099,6 +2099,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_FORCE_MODE, "Incorrect debug configuration: Cannot force CLDFB renderer in combination with TD renderer HRTF file" ); } #endif -#endif + return IVAS_ERR_OK; } -- GitLab