Loading apps/decoder.c +29 −33 Original line number Diff line number Diff line Loading @@ -105,20 +105,22 @@ typedef struct bool hrtfReaderEnabled; char *hrtfFileName; IVAS_DEC_INPUT_FORMAT inputFormat; #ifdef DEBUGGING bool forceSubframeBinauralization; IVAS_DEC_FORCED_REND_MODE forcedRendMode; #endif bool customLsOutputEnabled; char *customLsSetupFilename; int16_t orientation_tracking; float no_diegetic_pan; bool renderConfigEnabled; char *renderConfigFilename; #ifdef DEBUGGING bool forceSubframeBinauralization; IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ #endif #endif } DecArguments; Loading @@ -128,12 +130,10 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); #ifdef DEBUGGING static int16_t app_own_random( int16_t *seed ); #endif static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); #ifdef DEBUGGING static int16_t app_own_random( int16_t *seed ); static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ); #endif Loading Loading @@ -582,10 +582,10 @@ cleanup: printf( "\n" ); } #ifdef DEBUGGING #ifdef DEBUG_SBA_AUDIO_DUMP ivas_close_sba_decoder_debug_files( arg.output_Fs, numOutChannels, numTransportChannels, pca_ingest_channels ); #endif #ifdef DEBUGGING dbgclose(); #endif Loading Loading @@ -689,6 +689,9 @@ static bool parseCmdlIVAS_dec( arg->forcedRendMode = IVAS_DEC_FORCE_REND_UNFORCED; arg->forceSubframeBinauralization = false; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif #endif arg->output_Fs = 48000; arg->outputFormat = IVAS_DEC_OUTPUT_MONO; Loading Loading @@ -720,9 +723,6 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->no_diegetic_pan = 0.f; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif /*-----------------------------------------------------------------* * Initialization Loading Loading @@ -791,21 +791,6 @@ static bool parseCmdlIVAS_dec( arg->jbmOffsetFilename = argv[i]; i++; } #ifdef DEBUGGING else if ( strcmp( argv_to_upper, "-FEC" ) == 0 ) { ftmp = 0.0f; if ( sscanf( argv[i + 1], "%f", &ftmp ) != 1 ) { arg->FEPatterFileName = argv[i + 1]; } else { arg->FER = ftmp; } i += 2; } #endif else if ( strcmp( argv_to_upper, "-Q" ) == 0 ) { arg->quietModeEnabled = true; Loading @@ -827,6 +812,19 @@ static bool parseCmdlIVAS_dec( } } #ifdef DEBUGGING else if ( strcmp( argv_to_upper, "-FEC" ) == 0 ) { ftmp = 0.0f; if ( sscanf( argv[i + 1], "%f", &ftmp ) != 1 ) { arg->FEPatterFileName = argv[i + 1]; } else { arg->FER = ftmp; } i += 2; } else if ( strcmp( argv_to_upper, "-FORCE" ) == 0 ) { i++; Loading @@ -837,6 +835,11 @@ static bool parseCmdlIVAS_dec( i++; } } else if ( strcmp( argv_to_upper, "-FORCE_SUBFRAME_BIN" ) == 0 ) /* Force binauralization to subframe (5 ms) resolution */ { arg->forceSubframeBinauralization = true; i++; } #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK /*-----------------------------------------------------------------* Loading Loading @@ -948,13 +951,6 @@ static bool parseCmdlIVAS_dec( } i++; } #ifdef DEBUGGING else if ( strcmp( argv_to_upper, "-FORCE_SUBFRAME_BIN" ) == 0 ) /* Force binauralization to subframe (5 ms) resolution */ { arg->forceSubframeBinauralization = true; i++; } #endif /*-----------------------------------------------------------------* * Option not recognized Loading apps/encoder.c +74 −71 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ typedef union _EncInputFormatConfig { /* MONO details */ bool stereoToMonoDownmix; #ifdef DEBUGGING /* STEREO details */ IVAS_ENC_STEREO_MODE stereoMode; Loading @@ -83,16 +84,20 @@ typedef union _EncInputFormatConfig int16_t numObjects; const char *metadataFiles[IVAS_MAX_NUM_OBJECTS]; } ism; /* SBA details */ struct EncSbaConfig { IVAS_ENC_SBA_ORDER order; bool isPlanar; } sba; /* MASA details */ IVAS_ENC_MASA_VARIANT masaVariant; /* MC details */ IVAS_ENC_MC_LAYOUT mcLayout; } EncInputFormatConfig; /* Struct for storing cmdln arguments */ Loading @@ -112,24 +117,24 @@ typedef struct bool quietModeEnabled; bool delayCompensationEnabled; const char *masaMetadataFile; #ifdef DEBUGGING IVAS_ENC_FORCED_MODE forcedMode; const char *forcedModeFile; #endif IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig; const char *ca_config_file; bool mimeOutput; #ifdef DEBUGGING IVAS_ENC_FORCED_MODE forcedMode; const char *forcedModeFile; #ifdef DEBUG_AGC_ENCODER_CMD_OPTION IVAS_ENC_AGC agc; #endif bool pca; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ #endif #ifdef DEBUG_SBA const char *dbg_file_tag; #endif #endif bool pca; } EncArguments; Loading Loading @@ -214,17 +219,13 @@ int main( int16_t *pcmBuf = NULL; #ifdef DEBUGGING FILE *f_forcedModeProfile = NULL; #endif #ifdef DEBUG_SBA int16_t numTransportChannels = 1; #endif #ifdef WMOPS size_t SRAM_size = 0; #endif #ifdef WMOPS size_t SRAM_size = 0; reset_wmops(); reset_stack(); #endif Loading Loading @@ -826,13 +827,6 @@ cleanup: fclose( f_bitrateProfile ); } #ifdef DEBUGGING if ( f_forcedModeProfile ) { fclose( f_forcedModeProfile ); } #endif IVAS_ENC_Close( &hIvasEnc ); #ifdef RAM_COUNTING_TOOL Loading @@ -848,13 +842,18 @@ cleanup: #ifdef DEBUGGING dbgclose(); #endif if ( f_forcedModeProfile ) { fclose( f_forcedModeProfile ); } #ifdef DEBUG_SBA ivas_close_sba_encoder_debug_files(); #ifdef DEBUG_AGC ivas_close_agc_debug_files(); #endif #endif #endif return mainFailed ? -1 : 0; Loading Loading @@ -884,24 +883,24 @@ static void initArgStruct( EncArguments *arg ) arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; arg->masaMetadataFile = NULL; #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; #endif arg->caConfig = IVAS_ENC_GetDefaultChannelAwareConfig(); arg->ca_config_file = NULL; arg->mimeOutput = false; #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; #ifdef DEBUG_AGC_ENCODER_CMD_OPTION arg->agc = IVAS_ENC_AGC_UNDEFINED; #endif arg->pca = false; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif #ifdef DEBUG_SBA arg->dbg_file_tag = NULL; #endif #endif arg->pca = false; return; } Loading Loading @@ -1063,6 +1062,54 @@ static bool parseCmdlIVAS_enc( } #endif /* #ifdef DEBUG_MODE_INFO_TWEAK */ #endif /* #ifdef DEBUG_MODE_INFO */ #ifdef DEBUG_AGC_ENCODER_CMD_OPTION /*-----------------------------------------------------------------* * IVAS SPAR AGC option *-----------------------------------------------------------------*/ else if ( strcmp( argv_to_upper, "-AGC" ) == 0 ) { i++; if ( i < argc - 4 ) { arg->agc = ( atoi( argv[i] ) ) ? IVAS_ENC_AGC_ENABLED : IVAS_ENC_AGC_DISABLED; if ( argv[i] == NULL || atoi( argv[i] ) < 0 || atoi( argv[i] ) > 1 ) { fprintf( stderr, "Error: wrong adaptive gain control option specified (%d), expected 0 or 1\n\n", (int32_t) atoi( argv[i] ) ); usage_enc(); return false; } i++; } else { fprintf( stderr, "Error: unspecified adaptive gain control option\n\n" ); usage_enc(); return false; } } #endif #ifdef DEBUG_SBA /*-----------------------------------------------------------------* * IVAS SPAR debug files tag *-----------------------------------------------------------------*/ else if ( strcmp( argv_to_upper, "-TAG" ) == 0 ) { i++; if ( i < argc - 4 ) { arg->dbg_file_tag = argv[i]; ++i; } else { fprintf( stderr, "Error: [IVAS SPAR Encoder] unspecified tag value \n\n" ); usage_enc(); return false; } } #endif #endif /* #ifdef DEBUGGING */ /*-----------------------------------------------------------------* Loading Loading @@ -1400,29 +1447,6 @@ static bool parseCmdlIVAS_enc( arg->inputFormatConfig.stereoToMonoDownmix = true; i++; } #ifdef DEBUG_AGC_ENCODER_CMD_OPTION else if ( strcmp( argv_to_upper, "-AGC" ) == 0 ) { i++; if ( i < argc - 4 ) { arg->agc = ( atoi( argv[i] ) ) ? IVAS_ENC_AGC_ENABLED : IVAS_ENC_AGC_DISABLED; if ( argv[i] == NULL || atoi( argv[i] ) < 0 || atoi( argv[i] ) > 1 ) { fprintf( stderr, "Error: wrong adaptive gain control option specified (%d), expected 0 or 1\n\n", (int32_t) atoi( argv[i] ) ); usage_enc(); return false; } i++; } else { fprintf( stderr, "Error: unspecified adaptive gain control option\n\n" ); usage_enc(); return false; } } #endif else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // VE: should be renamed to "-pca" { i++; Loading Loading @@ -1456,26 +1480,6 @@ static bool parseCmdlIVAS_enc( return false; } } #ifdef DEBUG_SBA /*-----------------------------------------------------------------* * IVAS SPAR debug files tag *-----------------------------------------------------------------*/ else if ( strcmp( argv_to_upper, "-TAG" ) == 0 ) { i++; if ( i < argc - 4 ) { arg->dbg_file_tag = argv[i]; ++i; } else { fprintf( stderr, "Error: [IVAS SPAR Encoder] unspecified tag value \n\n" ); usage_enc(); return false; } } #endif /*-----------------------------------------------------------------* * Option not recognized Loading Loading @@ -1659,6 +1663,10 @@ static void usage_enc( void ) fprintf( stdout, " The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).\n" ); fprintf( stdout, " default output bitstream file format is G.192\n" ); fprintf( stdout, "-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" ); #ifdef DEBUGGING fprintf( stdout, "-force T : Force specific mode, T = (speech, music, ACELP, GSC, TCX, HQ),\n" ); fprintf( stdout, " alternatively, T can be a text file where each line contains \"nb_frames T\"\n" ); #ifdef DEBUG_SBA fprintf( stdout, "-tag : Tag name for intermediate debug files\n" ); #endif Loading @@ -1667,11 +1675,6 @@ static void usage_enc( void ) 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" ); #endif fprintf( stdout, "-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" ); #ifdef DEBUGGING fprintf( stdout, "-force T : Force specific mode, T = (speech, music, ACELP, GSC, TCX, HQ),\n" ); fprintf( stdout, " alternatively, T can be a text file where each line contains \"nb_frames T\"\n" ); #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK fprintf( stdout, "-info <folder> : specify subfolder name for debug output\n" ); Loading lib_com/ivas_error.h +15 −10 Original line number Diff line number Diff line Loading @@ -84,21 +84,14 @@ typedef enum IVAS_ERR_INVALID_INDEX, IVAS_ERR_NOT_SUPPORTED_OPTION, IVAS_ERR_NOT_IMPLEMENTED, #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, #endif IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH, IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, #ifdef EXT_RENDERER IVAS_ERR_NUM_CHANNELS_UNKNOWN, IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT, IVAS_ERR_INVALID_INPUT_ID, IVAS_ERR_WRONG_NUM_CHANNELS, IVAS_ERR_INVALID_BUFFER_SIZE, #endif #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, #ifdef DEBUG_AGC_ENCODER_CMD_OPTION IVAS_ERR_INVALID_AGC, #endif #endif /*----------------------------------------* Loading Loading @@ -129,6 +122,18 @@ typedef enum IVAS_ERR_BITSTREAM_READER_INVALID_DATA, IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT, #ifdef EXT_RENDERER /*----------------------------------------* * renderer (lib_rend only) * *----------------------------------------*/ IVAS_ERR_NUM_CHANNELS_UNKNOWN, IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT, IVAS_ERR_INVALID_INPUT_ID, IVAS_ERR_WRONG_NUM_CHANNELS, IVAS_ERR_INVALID_BUFFER_SIZE, #endif /*----------------------------------------* * unknown error * *----------------------------------------*/ Loading lib_enc/ivas_agc_enc.c +13 −19 Original line number Diff line number Diff line Loading @@ -59,24 +59,12 @@ extern FILE *agcOut; static int16_t ivas_agc_writeBits( FILE *stream, const int16_t n_channels, ivas_agc_enc_state_t *pState ); #endif #ifdef DEBUG_AGC_ENCODER_CMD_OPTION /*-----------------------------------------------------------------------------------------* * 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. * * This function determines if AGC is enabled or disabled. *-----------------------------------------------------------------------------------------*/ #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 /*! r: AGC enable flag */ int16_t ivas_agc_enc_get_flag( Loading @@ -86,15 +74,21 @@ int16_t ivas_agc_enc_get_flag( int16_t nchan_transport /* i : number of transport channels */ ) { int16_t agc_flag; /* AGC is enabled only if there is one transport channel. */ agc_flag = (int16_t) ( nchan_transport == 1 ); #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 ); /* 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. */ agc_flag = ( agc_configuration != SBA_AGC_DEFAULT ) ? agc_configuration : agc_flag; #endif return agc_flag; } /*-----------------------------------------------------------------------------------------* * Function ivas_agc_enc_init() * Loading lib_enc/ivas_stat_enc.h +3 −3 Original line number Diff line number Diff line Loading @@ -999,9 +999,6 @@ typedef struct encoder_config_structure int16_t last_Opt_SC_VBR; /* flag indicating prev frame's SC-VBR mode */ /* 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 */ #ifdef DEBUGGING Loading @@ -1009,6 +1006,9 @@ typedef struct encoder_config_structure int16_t stereo_mode_cmdl; /* stereo mode forced from the command-line */ int16_t force; /* parameter to force specific "core" of the Core-Coder*/ int16_t mdct_stereo_mode_cmdl; /* mdct stereo mode forced from command-line, employed only when DEBUG_FORCE_MDCT_STEREO_MODE is activated */ #ifdef DEBUG_AGC_ENCODER_CMD_OPTION int16_t Opt_AGC_ON; /* flag indicating AGC operation in SBA */ #endif #endif Loading Loading
apps/decoder.c +29 −33 Original line number Diff line number Diff line Loading @@ -105,20 +105,22 @@ typedef struct bool hrtfReaderEnabled; char *hrtfFileName; IVAS_DEC_INPUT_FORMAT inputFormat; #ifdef DEBUGGING bool forceSubframeBinauralization; IVAS_DEC_FORCED_REND_MODE forcedRendMode; #endif bool customLsOutputEnabled; char *customLsSetupFilename; int16_t orientation_tracking; float no_diegetic_pan; bool renderConfigEnabled; char *renderConfigFilename; #ifdef DEBUGGING bool forceSubframeBinauralization; IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ #endif #endif } DecArguments; Loading @@ -128,12 +130,10 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); #ifdef DEBUGGING static int16_t app_own_random( int16_t *seed ); #endif static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); #ifdef DEBUGGING static int16_t app_own_random( int16_t *seed ); static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ); #endif Loading Loading @@ -582,10 +582,10 @@ cleanup: printf( "\n" ); } #ifdef DEBUGGING #ifdef DEBUG_SBA_AUDIO_DUMP ivas_close_sba_decoder_debug_files( arg.output_Fs, numOutChannels, numTransportChannels, pca_ingest_channels ); #endif #ifdef DEBUGGING dbgclose(); #endif Loading Loading @@ -689,6 +689,9 @@ static bool parseCmdlIVAS_dec( arg->forcedRendMode = IVAS_DEC_FORCE_REND_UNFORCED; arg->forceSubframeBinauralization = false; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif #endif arg->output_Fs = 48000; arg->outputFormat = IVAS_DEC_OUTPUT_MONO; Loading Loading @@ -720,9 +723,6 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->no_diegetic_pan = 0.f; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif /*-----------------------------------------------------------------* * Initialization Loading Loading @@ -791,21 +791,6 @@ static bool parseCmdlIVAS_dec( arg->jbmOffsetFilename = argv[i]; i++; } #ifdef DEBUGGING else if ( strcmp( argv_to_upper, "-FEC" ) == 0 ) { ftmp = 0.0f; if ( sscanf( argv[i + 1], "%f", &ftmp ) != 1 ) { arg->FEPatterFileName = argv[i + 1]; } else { arg->FER = ftmp; } i += 2; } #endif else if ( strcmp( argv_to_upper, "-Q" ) == 0 ) { arg->quietModeEnabled = true; Loading @@ -827,6 +812,19 @@ static bool parseCmdlIVAS_dec( } } #ifdef DEBUGGING else if ( strcmp( argv_to_upper, "-FEC" ) == 0 ) { ftmp = 0.0f; if ( sscanf( argv[i + 1], "%f", &ftmp ) != 1 ) { arg->FEPatterFileName = argv[i + 1]; } else { arg->FER = ftmp; } i += 2; } else if ( strcmp( argv_to_upper, "-FORCE" ) == 0 ) { i++; Loading @@ -837,6 +835,11 @@ static bool parseCmdlIVAS_dec( i++; } } else if ( strcmp( argv_to_upper, "-FORCE_SUBFRAME_BIN" ) == 0 ) /* Force binauralization to subframe (5 ms) resolution */ { arg->forceSubframeBinauralization = true; i++; } #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK /*-----------------------------------------------------------------* Loading Loading @@ -948,13 +951,6 @@ static bool parseCmdlIVAS_dec( } i++; } #ifdef DEBUGGING else if ( strcmp( argv_to_upper, "-FORCE_SUBFRAME_BIN" ) == 0 ) /* Force binauralization to subframe (5 ms) resolution */ { arg->forceSubframeBinauralization = true; i++; } #endif /*-----------------------------------------------------------------* * Option not recognized Loading
apps/encoder.c +74 −71 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ typedef union _EncInputFormatConfig { /* MONO details */ bool stereoToMonoDownmix; #ifdef DEBUGGING /* STEREO details */ IVAS_ENC_STEREO_MODE stereoMode; Loading @@ -83,16 +84,20 @@ typedef union _EncInputFormatConfig int16_t numObjects; const char *metadataFiles[IVAS_MAX_NUM_OBJECTS]; } ism; /* SBA details */ struct EncSbaConfig { IVAS_ENC_SBA_ORDER order; bool isPlanar; } sba; /* MASA details */ IVAS_ENC_MASA_VARIANT masaVariant; /* MC details */ IVAS_ENC_MC_LAYOUT mcLayout; } EncInputFormatConfig; /* Struct for storing cmdln arguments */ Loading @@ -112,24 +117,24 @@ typedef struct bool quietModeEnabled; bool delayCompensationEnabled; const char *masaMetadataFile; #ifdef DEBUGGING IVAS_ENC_FORCED_MODE forcedMode; const char *forcedModeFile; #endif IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig; const char *ca_config_file; bool mimeOutput; #ifdef DEBUGGING IVAS_ENC_FORCED_MODE forcedMode; const char *forcedModeFile; #ifdef DEBUG_AGC_ENCODER_CMD_OPTION IVAS_ENC_AGC agc; #endif bool pca; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ #endif #ifdef DEBUG_SBA const char *dbg_file_tag; #endif #endif bool pca; } EncArguments; Loading Loading @@ -214,17 +219,13 @@ int main( int16_t *pcmBuf = NULL; #ifdef DEBUGGING FILE *f_forcedModeProfile = NULL; #endif #ifdef DEBUG_SBA int16_t numTransportChannels = 1; #endif #ifdef WMOPS size_t SRAM_size = 0; #endif #ifdef WMOPS size_t SRAM_size = 0; reset_wmops(); reset_stack(); #endif Loading Loading @@ -826,13 +827,6 @@ cleanup: fclose( f_bitrateProfile ); } #ifdef DEBUGGING if ( f_forcedModeProfile ) { fclose( f_forcedModeProfile ); } #endif IVAS_ENC_Close( &hIvasEnc ); #ifdef RAM_COUNTING_TOOL Loading @@ -848,13 +842,18 @@ cleanup: #ifdef DEBUGGING dbgclose(); #endif if ( f_forcedModeProfile ) { fclose( f_forcedModeProfile ); } #ifdef DEBUG_SBA ivas_close_sba_encoder_debug_files(); #ifdef DEBUG_AGC ivas_close_agc_debug_files(); #endif #endif #endif return mainFailed ? -1 : 0; Loading Loading @@ -884,24 +883,24 @@ static void initArgStruct( EncArguments *arg ) arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; arg->masaMetadataFile = NULL; #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; #endif arg->caConfig = IVAS_ENC_GetDefaultChannelAwareConfig(); arg->ca_config_file = NULL; arg->mimeOutput = false; #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; #ifdef DEBUG_AGC_ENCODER_CMD_OPTION arg->agc = IVAS_ENC_AGC_UNDEFINED; #endif arg->pca = false; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif #ifdef DEBUG_SBA arg->dbg_file_tag = NULL; #endif #endif arg->pca = false; return; } Loading Loading @@ -1063,6 +1062,54 @@ static bool parseCmdlIVAS_enc( } #endif /* #ifdef DEBUG_MODE_INFO_TWEAK */ #endif /* #ifdef DEBUG_MODE_INFO */ #ifdef DEBUG_AGC_ENCODER_CMD_OPTION /*-----------------------------------------------------------------* * IVAS SPAR AGC option *-----------------------------------------------------------------*/ else if ( strcmp( argv_to_upper, "-AGC" ) == 0 ) { i++; if ( i < argc - 4 ) { arg->agc = ( atoi( argv[i] ) ) ? IVAS_ENC_AGC_ENABLED : IVAS_ENC_AGC_DISABLED; if ( argv[i] == NULL || atoi( argv[i] ) < 0 || atoi( argv[i] ) > 1 ) { fprintf( stderr, "Error: wrong adaptive gain control option specified (%d), expected 0 or 1\n\n", (int32_t) atoi( argv[i] ) ); usage_enc(); return false; } i++; } else { fprintf( stderr, "Error: unspecified adaptive gain control option\n\n" ); usage_enc(); return false; } } #endif #ifdef DEBUG_SBA /*-----------------------------------------------------------------* * IVAS SPAR debug files tag *-----------------------------------------------------------------*/ else if ( strcmp( argv_to_upper, "-TAG" ) == 0 ) { i++; if ( i < argc - 4 ) { arg->dbg_file_tag = argv[i]; ++i; } else { fprintf( stderr, "Error: [IVAS SPAR Encoder] unspecified tag value \n\n" ); usage_enc(); return false; } } #endif #endif /* #ifdef DEBUGGING */ /*-----------------------------------------------------------------* Loading Loading @@ -1400,29 +1447,6 @@ static bool parseCmdlIVAS_enc( arg->inputFormatConfig.stereoToMonoDownmix = true; i++; } #ifdef DEBUG_AGC_ENCODER_CMD_OPTION else if ( strcmp( argv_to_upper, "-AGC" ) == 0 ) { i++; if ( i < argc - 4 ) { arg->agc = ( atoi( argv[i] ) ) ? IVAS_ENC_AGC_ENABLED : IVAS_ENC_AGC_DISABLED; if ( argv[i] == NULL || atoi( argv[i] ) < 0 || atoi( argv[i] ) > 1 ) { fprintf( stderr, "Error: wrong adaptive gain control option specified (%d), expected 0 or 1\n\n", (int32_t) atoi( argv[i] ) ); usage_enc(); return false; } i++; } else { fprintf( stderr, "Error: unspecified adaptive gain control option\n\n" ); usage_enc(); return false; } } #endif else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // VE: should be renamed to "-pca" { i++; Loading Loading @@ -1456,26 +1480,6 @@ static bool parseCmdlIVAS_enc( return false; } } #ifdef DEBUG_SBA /*-----------------------------------------------------------------* * IVAS SPAR debug files tag *-----------------------------------------------------------------*/ else if ( strcmp( argv_to_upper, "-TAG" ) == 0 ) { i++; if ( i < argc - 4 ) { arg->dbg_file_tag = argv[i]; ++i; } else { fprintf( stderr, "Error: [IVAS SPAR Encoder] unspecified tag value \n\n" ); usage_enc(); return false; } } #endif /*-----------------------------------------------------------------* * Option not recognized Loading Loading @@ -1659,6 +1663,10 @@ static void usage_enc( void ) fprintf( stdout, " The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).\n" ); fprintf( stdout, " default output bitstream file format is G.192\n" ); fprintf( stdout, "-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" ); #ifdef DEBUGGING fprintf( stdout, "-force T : Force specific mode, T = (speech, music, ACELP, GSC, TCX, HQ),\n" ); fprintf( stdout, " alternatively, T can be a text file where each line contains \"nb_frames T\"\n" ); #ifdef DEBUG_SBA fprintf( stdout, "-tag : Tag name for intermediate debug files\n" ); #endif Loading @@ -1667,11 +1675,6 @@ static void usage_enc( void ) 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" ); #endif fprintf( stdout, "-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" ); #ifdef DEBUGGING fprintf( stdout, "-force T : Force specific mode, T = (speech, music, ACELP, GSC, TCX, HQ),\n" ); fprintf( stdout, " alternatively, T can be a text file where each line contains \"nb_frames T\"\n" ); #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK fprintf( stdout, "-info <folder> : specify subfolder name for debug output\n" ); Loading
lib_com/ivas_error.h +15 −10 Original line number Diff line number Diff line Loading @@ -84,21 +84,14 @@ typedef enum IVAS_ERR_INVALID_INDEX, IVAS_ERR_NOT_SUPPORTED_OPTION, IVAS_ERR_NOT_IMPLEMENTED, #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, #endif IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH, IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, #ifdef EXT_RENDERER IVAS_ERR_NUM_CHANNELS_UNKNOWN, IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT, IVAS_ERR_INVALID_INPUT_ID, IVAS_ERR_WRONG_NUM_CHANNELS, IVAS_ERR_INVALID_BUFFER_SIZE, #endif #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, #ifdef DEBUG_AGC_ENCODER_CMD_OPTION IVAS_ERR_INVALID_AGC, #endif #endif /*----------------------------------------* Loading Loading @@ -129,6 +122,18 @@ typedef enum IVAS_ERR_BITSTREAM_READER_INVALID_DATA, IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT, #ifdef EXT_RENDERER /*----------------------------------------* * renderer (lib_rend only) * *----------------------------------------*/ IVAS_ERR_NUM_CHANNELS_UNKNOWN, IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT, IVAS_ERR_INVALID_INPUT_ID, IVAS_ERR_WRONG_NUM_CHANNELS, IVAS_ERR_INVALID_BUFFER_SIZE, #endif /*----------------------------------------* * unknown error * *----------------------------------------*/ Loading
lib_enc/ivas_agc_enc.c +13 −19 Original line number Diff line number Diff line Loading @@ -59,24 +59,12 @@ extern FILE *agcOut; static int16_t ivas_agc_writeBits( FILE *stream, const int16_t n_channels, ivas_agc_enc_state_t *pState ); #endif #ifdef DEBUG_AGC_ENCODER_CMD_OPTION /*-----------------------------------------------------------------------------------------* * 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. * * This function determines if AGC is enabled or disabled. *-----------------------------------------------------------------------------------------*/ #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 /*! r: AGC enable flag */ int16_t ivas_agc_enc_get_flag( Loading @@ -86,15 +74,21 @@ int16_t ivas_agc_enc_get_flag( int16_t nchan_transport /* i : number of transport channels */ ) { int16_t agc_flag; /* AGC is enabled only if there is one transport channel. */ agc_flag = (int16_t) ( nchan_transport == 1 ); #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 ); /* 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. */ agc_flag = ( agc_configuration != SBA_AGC_DEFAULT ) ? agc_configuration : agc_flag; #endif return agc_flag; } /*-----------------------------------------------------------------------------------------* * Function ivas_agc_enc_init() * Loading
lib_enc/ivas_stat_enc.h +3 −3 Original line number Diff line number Diff line Loading @@ -999,9 +999,6 @@ typedef struct encoder_config_structure int16_t last_Opt_SC_VBR; /* flag indicating prev frame's SC-VBR mode */ /* 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 */ #ifdef DEBUGGING Loading @@ -1009,6 +1006,9 @@ typedef struct encoder_config_structure int16_t stereo_mode_cmdl; /* stereo mode forced from the command-line */ int16_t force; /* parameter to force specific "core" of the Core-Coder*/ int16_t mdct_stereo_mode_cmdl; /* mdct stereo mode forced from command-line, employed only when DEBUG_FORCE_MDCT_STEREO_MODE is activated */ #ifdef DEBUG_AGC_ENCODER_CMD_OPTION int16_t Opt_AGC_ON; /* flag indicating AGC operation in SBA */ #endif #endif Loading