diff --git a/apps/encoder.c b/apps/encoder.c index bcd2dcea7836c754dc025eb9a2f2a8f5c050ad3b..b3c4602b634e1d6d1ed37ce3b60409b9ba315582 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -120,11 +120,13 @@ typedef struct const char *ca_config_file; bool mimeOutput; +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR IVAS_ENC_AGC agc; #else bool agc; -#endif +#endif /* AGC_ENABLE_FOR_LBR */ +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ bool pca; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ @@ -444,11 +446,25 @@ int main( } break; case IVAS_ENC_INPUT_SBA: + if ( ( error = + IVAS_ENC_ConfigureForAmbisonics( + hIvasEnc, + arg.inputFs, + totalBitrate, + arg.max_bwidth_user, + bandwidth, + arg.dtxConfig, + arg.inputFormatConfig.sba.order, + arg.inputFormatConfig.sba.isPlanar, +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION + arg.agc, +#endif + arg.pca #ifdef DEBUG_SBA_AUDIO_DUMP - if ( ( error = IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.agc, arg.pca, &numTransportChannels ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.agc, arg.pca ) ) != IVAS_ERR_OK ) + , + &numTransportChannels #endif + ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; @@ -874,11 +890,13 @@ static void initArgStruct( EncArguments *arg ) arg->ca_config_file = NULL; arg->mimeOutput = false; +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR arg->agc = IVAS_ENC_AGC_UNDEFINED; #else arg->agc = IVAS_DEFAULT_AGC; -#endif +#endif /* AGC_ENABLE_FOR_LBR */ +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ arg->pca = false; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; @@ -1384,6 +1402,7 @@ static bool parseCmdlIVAS_enc( arg->inputFormatConfig.stereoToMonoDownmix = true; i++; } +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION else if ( strcmp( argv_to_upper, "-AGC" ) == 0 ) { i++; @@ -1409,6 +1428,7 @@ static bool parseCmdlIVAS_enc( return false; } } +#endif else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // VE: should be renamed to "-pca" { i++; @@ -1648,13 +1668,15 @@ static void usage_enc( void ) #ifdef DEBUG_SBA fprintf( stdout, "-tag : Tag name for intermediate debug files\n" ); #endif +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR fprintf( stdout, "-agc op : SBA Adaptive gain control, op = (0, 1). \n" ); fprintf( stdout, " By default op is 1 (activated) for bitrates between 24400 and 32000,\n" ); fprintf( stdout, " otherwise it is 0 (deactivated) for all other bitrates\n" ); #else fprintf( stdout, "-agc op : SBA Adaptive gain control, op = (0, 1), by default op is 0 or deactivated\n" ); -#endif +#endif /* AGC_ENABLE_FOR_LBR */ +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ fprintf( stdout, "-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" ); #ifdef DEBUGGING diff --git a/lib_com/cnst.h b/lib_com/cnst.h index e62ef001dc19266dc6f448dc3bea686ae9ce1658..be668b01c774ac67a50dff6d939a44bdac918426 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -132,6 +132,9 @@ enum{ #define MAX_V_MULT_MAT 100 /* maximum array length for the function v_mult_mat() */ +#define SBA_AGC_FORCE_ENABLE 1 +#define SBA_AGC_FORCE_DISABLE 0 +#define SBA_AGC_DEFAULT -1 /*----------------------------------------------------------------------------------* * Layers diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 58c45ee5ee0752f962207c834494e6d2070ba3aa..8d09e48bbde59f3064243a555449a3aca7f32357 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -86,6 +86,9 @@ typedef enum IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH, IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION + IVAS_ERR_INVALID_AGC, +#endif /*----------------------------------------* * input data errors * diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index dcf94d576149ce7d60badaba28a76a2f5228a2f8..fe0786f02330677360f032208e5eb1ee889e8933 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -44,9 +44,6 @@ #include "ivas_stat_dec.h" #include "ivas_stat_com.h" #include "ivas_error_utils.h" -#ifdef AGC_ENABLE_FOR_LBR -#include "lib_enc.h" -#endif /* clang-format off */ @@ -3757,9 +3754,12 @@ void ivas_sba_prototype_renderer( /* AGC */ #ifdef AGC_ENABLE_FOR_LBR -int16_t ivas_agc_enc_get_enablement_flag( - IVAS_ENC_AGC agc_configuration, /* i : configuration used when encoder was initialised from cmd line */ - int16_t nchan_transport /* i : number of transport channels */ +/*! r: AGC enable flag */ +int16_t ivas_agc_enc_get_flag( +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION + int16_t agc_configuration, /* i : AGC configuration from command-line */ +#endif + int16_t nchan_transport /* i : number of transport channels */ ); #endif diff --git a/lib_com/options.h b/lib_com/options.h index 9a03a9d509812a4cb12f2b191808a9691c688324..deb1f92ac29075845e927f840afcd5a803e34d12 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -126,6 +126,7 @@ #endif /*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ +#define DEBUG_AGC_ENCODER_CMD_OPTION /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ #endif /* #################### End DEBUGGING switches ############################ */ diff --git a/lib_enc/ivas_agc_enc.c b/lib_enc/ivas_agc_enc.c index b0012ee46924aca1ff37034cdbf48f7467a77672..53a6df3a137714123e51563ecb542de1968445c8 100644 --- a/lib_enc/ivas_agc_enc.c +++ b/lib_enc/ivas_agc_enc.c @@ -60,24 +60,42 @@ static int16_t ivas_agc_writeBits( FILE *stream, const int16_t n_channels, ivas_ #endif #ifdef AGC_ENABLE_FOR_LBR +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION /*-----------------------------------------------------------------------------------------* - * Function ivas_agc_enc_get_enablement_flag() + * Function ivas_agc_enc_get_flag() * * This function determines if AGC should be enabled or disabled. * If agc_configuration is not undefined, then this value decides on the state of * enablement, otherwise AGC is enabled only if there is one transport channel. * *-----------------------------------------------------------------------------------------*/ +#else +/*-----------------------------------------------------------------------------------------* + * Function ivas_agc_enc_get_flag() + * + * This function determines if AGC should be enabled or disabled. + * AGC is enabled only if there is one transport channel. + * + *-----------------------------------------------------------------------------------------*/ +#endif -int16_t ivas_agc_enc_get_enablement_flag( - IVAS_ENC_AGC agc_configuration, - int16_t nchan_transport ) +/*! r: AGC enable flag */ +int16_t ivas_agc_enc_get_flag( +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION + int16_t agc_configuration, /* i : AGC configuration from command-line */ +#endif + int16_t nchan_transport /* i : number of transport channels */ +) { - return (int16_t) ( ( agc_configuration == IVAS_ENC_AGC_UNDEFINED ) +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION + return (int16_t) ( ( agc_configuration == SBA_AGC_DEFAULT ) ? ( nchan_transport == 1 ) : agc_configuration ); -} +#else + return (int16_t) ( nchan_transport == 1 ); #endif +} +#endif /* AGC_ENABLE_FOR_LBR */ /*-----------------------------------------------------------------------------------------* * Function ivas_agc_enc_init() @@ -127,6 +145,7 @@ static void ivas_agc_enc_init( return; } + /*------------------------------------------------------------------------- * ivas_spar_agc_enc_open() * @@ -171,6 +190,7 @@ ivas_error ivas_spar_agc_enc_open( return IVAS_ERR_OK; } + /*------------------------------------------------------------------------- * ivas_spar_agc_enc_close() * @@ -203,6 +223,7 @@ void ivas_spar_agc_enc_close( return; } + /*-----------------------------------------------------------------------------------------* * Function ivas_agc_enc_process() * diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 7e2d49310fb16dd3ba68fd0463db4ee2d7d5e9e5..1beab643d5ba0985d7b74e3d48f0db402c95b8c1 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -121,13 +121,23 @@ ivas_error ivas_spar_enc_open( /* AGC handle */ #ifdef AGC_ENABLE_FOR_LBR - hSpar->AGC_Enable = ivas_agc_enc_get_enablement_flag( hEncoderConfig->Opt_AGC_ON, nchan_transport ); +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION + hSpar->AGC_Enable = ivas_agc_enc_get_flag( hEncoderConfig->Opt_AGC_ON, nchan_transport ); +#else + hSpar->AGC_Enable = ivas_agc_enc_get_flag( nchan_transport ); +#endif +#endif + +#ifdef AGC_ENABLE_FOR_LBR + hSpar->hAgcEnc = NULL; + if ( hSpar->AGC_Enable ) #endif - if ( ( error = ivas_spar_agc_enc_open( &hSpar->hAgcEnc, input_Fs, nchan_inp ) ) != IVAS_ERR_OK ) { - return error; + if ( ( error = ivas_spar_agc_enc_open( &hSpar->hAgcEnc, input_Fs, nchan_inp ) ) != IVAS_ERR_OK ) + { + return error; + } } - /* PCA handle */ hSpar->hPCA = NULL; if ( hEncoderConfig->Opt_PCA_ON ) @@ -233,7 +243,6 @@ void ivas_spar_enc_close( hSpar->hFrontVad = NULL; } - num_chans = hSpar->hFbMixer->fb_cfg->num_in_chans; assert( num_chans <= nchan_inp ); @@ -375,7 +384,6 @@ static ivas_error ivas_spar_enc_process( mvr2r( data_f[HOA_keep_ind[i]], data_f[i], input_frame ); } - /*-----------------------------------------------------------------------------------------* * Transient detector *-----------------------------------------------------------------------------------------*/ @@ -429,17 +437,13 @@ static ivas_error ivas_spar_enc_process( p_pcm_tmp[i] = pcm_tmp[i]; } - dtx_vad = ( hEncoderConfig->Opt_DTX_ON == 1 ) ? front_vad_flag : 1; /*-----------------------------------------------------------------------------------------* * DirAC encoding *-----------------------------------------------------------------------------------------*/ - ivas_dirac_param_est_enc( st_ivas->hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, - data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, - st_ivas->sba_mode ); - + ivas_dirac_param_est_enc( st_ivas->hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, st_ivas->sba_mode ); if ( hQMetaData->q_direction->cfg.nbands > 0 ) { @@ -524,7 +528,6 @@ static ivas_error ivas_spar_enc_process( } } - /*-----------------------------------------------------------------------------------------* * Covariance process *-----------------------------------------------------------------------------------------*/ @@ -549,8 +552,7 @@ static ivas_error ivas_spar_enc_process( if ( hSpar->hMdEnc->table_idx != table_idx ) { hSpar->hMdEnc->table_idx = table_idx; - ivas_spar_set_bitrate_config( &hSpar->hMdEnc->spar_md_cfg, table_idx, - ( hSpar->hMdEnc->spar_hoa_md_flag ) ? IVAS_MAX_NUM_BANDS : SPAR_DIRAC_SPLIT_START_BAND ); + ivas_spar_set_bitrate_config( &hSpar->hMdEnc->spar_md_cfg, table_idx, ( hSpar->hMdEnc->spar_hoa_md_flag ) ? IVAS_MAX_NUM_BANDS : SPAR_DIRAC_SPLIT_START_BAND ); } nchan_transport = st_ivas->nchan_transport; @@ -604,9 +606,7 @@ static ivas_error ivas_spar_enc_process( } ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, 1, hSpar->hMdEnc->mixer_mat, &hSpar->hMdEnc->spar_md, &hSpar->hMdEnc->spar_md_cfg, - d_start_band, d_end_band, - ( hSpar->hMdEnc->spar_hoa_md_flag ) ? 1 : sba_order, - dtx_vad, Wscale_d ); + d_start_band, d_end_band, ( hSpar->hMdEnc->spar_hoa_md_flag ) ? 1 : sba_order, dtx_vad, Wscale_d ); } if ( hSpar->hMdEnc->spar_hoa_md_flag ) @@ -721,6 +721,10 @@ static ivas_error ivas_spar_enc_process( } else { + /* IVAS_fmToDo: This AGC on/off bit should be removed when the command line option to force enable/disable AGC is + * removed. + * On the decoder side, ivas_agc_enc_get_flag could be used instead to determine if AGC is on or not. The + * ivas_agc_enc_get_flag function should be moved to ivas_agc_com.c and renamed when this occurs. */ push_next_indice( hMetaData, 0, 1 ); } } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 1a8f595bd0f2dd6f5edacf770590f2746d82dcfe..4ae2e2f41fc1318599b71df9c0d83ba7802d2f6f 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -40,9 +40,6 @@ #include "stat_enc.h" #include "ivas_cnst.h" #include "ivas_stat_com.h" -#ifdef AGC_ENABLE_FOR_LBR -#include "lib_enc.h" -#endif /*----------------------------------------------------------------------------------* * DFT Stereo encoder structures @@ -1003,10 +1000,8 @@ typedef struct encoder_config_structure int16_t Opt_SC_VBR; /* flag indicating SC-VBR mode */ int16_t last_Opt_SC_VBR; /* flag indicating prev frame's SC-VBR mode */ -#ifdef AGC_ENABLE_FOR_LBR - IVAS_ENC_AGC Opt_AGC_ON; /* flag indicating AGC operation in SBA */ -#else /* temp. development parameters */ +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION int16_t Opt_AGC_ON; /* flag indicating AGC operation in SBA */ #endif int16_t Opt_PCA_ON; /* flag indicating PCA operation in SBA */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 4be84480fec73cfc8188ae9301c775fbde6484b2..e25afc9fd857e623699f183c24f78ddda5b91f2a 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -82,6 +82,9 @@ static ivas_error sanitizeBitrateISM( const ENCODER_CONFIG_HANDLE hEncoderConfig static void init_encoder_config( ENCODER_CONFIG_HANDLE hEncoderConfig ); static void resetIsmMetadataProvidedFlags( IVAS_ENC_HANDLE hIvasEnc ); static ivas_error bandwidthApiToInternal( const IVAS_ENC_BANDWIDTH maxBandwidth, int16_t *internalMaxBandwidth ); +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION +static ivas_error agcAPIToInternal( const IVAS_ENC_AGC agcOption, int16_t *internalAGCOption ); +#endif static ivas_error fecIndicatorApiToInternal( const IVAS_ENC_FEC_INDICATOR fecIndicator, int16_t *fecIndicatorInternal ); #ifdef DEBUGGING static ivas_error forcedModeApiToInternal( IVAS_ENC_FORCED_MODE forcedMode, int16_t *forcedModeInternal ); @@ -449,11 +452,13 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics( const IVAS_ENC_DTX_CONFIG dtxConfig, /* i : configuration of DTX, can by set to default by using IVAS_ENC_GetDefaultDtxConfig() */ const IVAS_ENC_SBA_ORDER order, /* i : order of the Ambisonics input */ const bool isPlanar, /* i : if true, input is treated as planar Ambisonics */ +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR const IVAS_ENC_AGC Opt_AGC_ON, /* i : AGC on/off/undefined flag */ #else const bool Opt_AGC_ON, /* i : AGC on/off flag */ -#endif +#endif /* AGC_ENABLE_FOR_LBR */ +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ const bool Opt_PCA_ON /* i : PCA option flag */ #ifdef DEBUG_SBA_AUDIO_DUMP , @@ -475,13 +480,21 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics( hEncoderConfig->element_mode_init = IVAS_SCE; /* Just needs to be something not mono, will be set later */ hEncoderConfig->sba_planar = isPlanar; hEncoderConfig->sba_order = order; + /* Input in ACN/SN3D in all cases (3D and planar): get number of channels */ hEncoderConfig->nchan_inp = ivas_sba_get_nchan( hEncoderConfig->sba_order, 0 ); /*planar input arg. deliberately set to zero since input always in ACN/SN3D*/ + +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR - hEncoderConfig->Opt_AGC_ON = Opt_AGC_ON; + if ( ( error = agcAPIToInternal( Opt_AGC_ON, &( hEncoderConfig->Opt_AGC_ON ) ) ) != IVAS_ERR_OK ) + { + return error; + } #else hEncoderConfig->Opt_AGC_ON = (int16_t) Opt_AGC_ON; -#endif +#endif /* AGC_ENABLE_FOR_LBR */ +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ + hEncoderConfig->Opt_PCA_ON = (int16_t) Opt_PCA_ON; hIvasEnc->maxBandwidthUser = max_bwidth_user; @@ -876,14 +889,17 @@ static ivas_error configureEncoder( return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." ); } +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR - if ( hEncoderConfig->Opt_AGC_ON == IVAS_ENC_AGC_ENABLED && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ) == SBA_MODE_SPAR ) ) + if ( hEncoderConfig->Opt_AGC_ON == SBA_AGC_FORCE_ENABLE && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ) == SBA_MODE_SPAR ) ) #else if ( hEncoderConfig->Opt_AGC_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_sba_mode_select( hEncoderConfig->ivas_total_brate ) == SBA_MODE_SPAR ) ) -#endif +#endif /* AGC_ENABLE_FOR_LBR */ { return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "AGC supported in SBA format at bitrates >= 24.4 kbps only." ); } +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ + if ( hEncoderConfig->Opt_PCA_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && hEncoderConfig->ivas_total_brate == PCA_BRATE && hEncoderConfig->sba_order == 1 ) ) { @@ -1501,16 +1517,17 @@ static ivas_error printConfigInfo_enc( { fprintf( stdout, "- PCA configured with signal adaptive decision " ); } +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR switch ( hEncoderConfig->Opt_AGC_ON ) { - case IVAS_ENC_AGC_ENABLED: + case SBA_AGC_FORCE_ENABLE: fprintf( stdout, "- AGC FORCED ON " ); break; - case IVAS_ENC_AGC_DISABLED: + case SBA_AGC_FORCE_DISABLE: fprintf( stdout, "- AGC FORCED OFF " ); break; - case IVAS_ENC_AGC_UNDEFINED: + case SBA_AGC_DEFAULT: fprintf( stdout, "- AGC default mode " ); break; default: @@ -1522,7 +1539,10 @@ static ivas_error printConfigInfo_enc( { fprintf( stdout, "- AGC ON " ); } -#endif +#endif /* AGC_ENABLE_FOR_LBR */ +#else + fprintf( stdout, "- AGC default mode " ); +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ fprintf( stdout, "\n" ); } else if ( hEncoderConfig->ivas_format == MASA_FORMAT ) @@ -2055,6 +2075,31 @@ static ivas_error bandwidthApiToInternal( return IVAS_ERR_OK; } +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION +static ivas_error agcAPIToInternal( + const IVAS_ENC_AGC agcOption, + int16_t *internalAGCOption ) +{ + switch ( agcOption ) + { + case IVAS_ENC_AGC_ENABLED: + *internalAGCOption = SBA_AGC_FORCE_ENABLE; + break; + case IVAS_ENC_AGC_DISABLED: + *internalAGCOption = SBA_AGC_FORCE_DISABLE; + break; + case IVAS_ENC_AGC_UNDEFINED: + *internalAGCOption = SBA_AGC_DEFAULT; + break; + default: + return IVAS_ERR_INVALID_AGC; + break; + } + + return IVAS_ERR_OK; +} +#endif + /*---------------------------------------------------------------------* * fecIndicatorApiToInternal() @@ -2189,11 +2234,13 @@ static void init_encoder_config( hEncoderConfig->stereo_dmx_evs = 0; hEncoderConfig->sba_order = 0; hEncoderConfig->sba_planar = 0; +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR - hEncoderConfig->Opt_AGC_ON = IVAS_ENC_AGC_UNDEFINED; + hEncoderConfig->Opt_AGC_ON = SBA_AGC_DEFAULT; #else hEncoderConfig->Opt_AGC_ON = 0; -#endif +#endif /* AGC_ENABLE_FOR_LBR */ +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ hEncoderConfig->Opt_PCA_ON = 0; return; diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index 20eef7b1fe0d4cab49b2550a9f8f8676c1618eef..373da97f966087d1f4a3ff5da7f118f0d1d5b3a7 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -124,13 +124,15 @@ typedef enum _IVAS_ENC_FORCED_MODE #endif #ifdef AGC_ENABLE_FOR_LBR +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION typedef enum _IVAS_ENC_AGC { IVAS_ENC_AGC_DISABLED = 0, IVAS_ENC_AGC_ENABLED, IVAS_ENC_AGC_UNDEFINED = 0xffff } IVAS_ENC_AGC; -#endif +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ +#endif /* AGC_ENABLE_FOR_LBR */ /*---------------------------------------------------------------------* * Encoder structures @@ -197,11 +199,13 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics( const IVAS_ENC_DTX_CONFIG dtxConfig, /* i : configuration of DTX, can by set to default by using IVAS_ENC_GetDefaultDtxConfig() */ const IVAS_ENC_SBA_ORDER order, /* i : order of the Ambisonics input */ const bool isPlanar, /* i : if true, input is treated as planar Ambisonics */ +#ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef AGC_ENABLE_FOR_LBR const IVAS_ENC_AGC Opt_AGC_ON, /* i : AGC on/off/undefined flag */ #else const bool Opt_AGC_ON, /* i : AGC on/off flag */ -#endif +#endif /* AGC_ENABLE_FOR_LBR */ +#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */ const bool Opt_PCA_ON /* i : PCA option flag */ #ifdef DEBUG_SBA_AUDIO_DUMP ,