diff --git a/apps/decoder.c b/apps/decoder.c index bbbee76c883f924717f62aa12f8957bef5d562a1..c29a85f40dd963ca8ee4140c65e92b502d98a70e 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 9a6a9d4c5bd9154708db4152dbd247a2eadda310..6b22caab021a2a21191828476291a47d51897c0c 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 af6090168f1f9032c345a85f06700b5a27fef31d..2e206ab2ff3539ce2e453bedfec7fe7602e2b835 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2075,6 +2075,7 @@ static ivas_error doSanityChecks_IVAS( } #ifdef DEBUGGING +#ifndef REMOVE_FORCE_SUBFRAME_BIN if ( st_ivas->hDecoderConfig->forceSubframeBinauralization ) { /* Note about resolution of Binaural Renderers: * @@ -2087,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" ); diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 7c6ac19f7ea56bf0c5e5f52953dbf55faac41c84..3c9bf13abfcf97db57ee8cda38c115c58ac5dcd9 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 a1fee7f0fd9371c0820a909c35c4f534b145d16d..a6a4778bea8381df0b30182b4c797e2eb8b9af8c 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 d3035af0b57c61a6780227366e26ce5112caa76f..e41937b3b1e38fb7fedf5116113a3a73829f5a94 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 81d449615177be9d6421ceac804c4cf7dc0ff7ce..1ea76d4fb2ca9f392ce6531c06bbaa0baf56842c 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2370,8 +2370,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 95b9a814eca1d4bb44a4623a087a33f236d9289e..84bef3a7e23260ada1586a7ea20f950db6f31a6e 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