diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b36c59ebf4235d88ce435f9cba502a1729a0a530..d5b078e8b0d0d84172d254b007fb0e61d33bb336 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -98,7 +98,7 @@ workflow: IVAS_PIPELINE_NAME: 'Voip BE test on $CI_COMMIT_BRANCH' - if: $CI_PIPELINE_SOURCE == 'schedule' # Scheduled in any branch variables: - IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH' + IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH' stages: @@ -205,7 +205,6 @@ stages: - git restore . - git checkout $current_commit_sha - .build-reference-and-dut-binaries: &build-reference-and-dut-binaries ### build reference binaries - *build-reference-binaries @@ -1916,21 +1915,11 @@ ivas-interop-on-merge-request: - rm artifacts.zip - rm -rf $public_dir - ### 2. part: setup specific for BASOP repo - # hack for using the reference encoder -> need to build manually to make script use ref enc and BASOP dec - - mkdir COMPLEXITY - - cp IVAS_cod_ref COMPLEXITY/IVAS_cod - # build branch code aain with instrumentation - - make clean - - bash scripts/prepare_instrumentation.sh -p BASOP -m MEM_ONLY - - make -j -C $INSTR_DIR - - cp $INSTR_DIR/IVAS_dec COMPLEXITY/IVAS_dec - .complexity-measurements-prepare-artifacts: &complexity-measurements-prepare-artifacts # prepare artifacts -> move to public directory - public_dir="$CI_JOB_NAME-public" - mkdir $public_dir - - mv -f wmops/log_*_all.txt wmops/*.js ${public_dir}/ + - mv -f wmops/log_*_all.txt ./*.js ${public_dir}/ # move logfiles for links - mkdir $public_dir/logs # first move logs @@ -1938,6 +1927,7 @@ ivas-interop-on-merge-request: - echo $log_files - ls wmops/logs - for f in $log_files; do [ -f wmops/logs/$f ] && mv wmops/logs/$f $public_dir/logs/$f; done + - mv wmops/logs/latest_WMOPS.csv $public_dir/logs/ # copy index page blueprint - cp ci/complexity_measurements/index_complexity.html ${public_dir}/index.html # patch the format in the title @@ -1957,7 +1947,6 @@ ivas-interop-on-merge-request: - *print-common-info - *update-scripts-repo - *update-ltv-repo - - *build-reference-and-dut-binaries - *complexity-measurements-setup - which coan artifacts: @@ -1975,7 +1964,7 @@ complexity-stereo-in-stereo-out: script: - in_format=stereo - out_format=stereo - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" mem_only || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -1990,7 +1979,7 @@ complexity-ism-in-binaural-out: - in_format=ISM - out_format=BINAURAL - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2005,7 +1994,7 @@ complexity-ism-in-binaural_room_ir-out: - in_format=ISM - out_format=BINAURAL_ROOM_IR - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2015,12 +2004,12 @@ complexity-ism-in-ext-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 3 hours 30 minutes + start_in: 3 hours script: - in_format=ISM - out_format=EXT - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2030,12 +2019,12 @@ complexity-sba-hoa3-in-hoa3-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 4 hours 30 minutes + start_in: 4 hours script: - in_format=HOA3 - out_format=HOA3 - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2045,12 +2034,12 @@ complexity-sba-hoa3-in-binaural-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 5 hours 30 minutes + start_in: 5 hours script: - in_format=HOA3 - out_format=BINAURAL - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2060,12 +2049,12 @@ complexity-sba-hoa3-in-binaural_room_ir-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 6 hours 30 minutes + start_in: 6 hours script: - in_format=HOA3 - out_format=BINAURAL_ROOM_IR - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2075,12 +2064,12 @@ complexity-mc-in-7_1_4-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 7 hours 30 minutes + start_in: 7 hours script: - in_format=MC - out_format=7_1_4 - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2090,12 +2079,12 @@ complexity-mc-in-binaural-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 10 hours + start_in: 8 hours script: - in_format=MC - out_format=BINAURAL - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2105,12 +2094,12 @@ complexity-mc-in-binaural_room_ir-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 12 hours 30 minutes + start_in: 9 hours script: - in_format=MC - out_format=BINAURAL_ROOM_IR - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2120,12 +2109,12 @@ complexity-masa-in-ext-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 15 hours + start_in: 10 hours script: - in_format=MASA - out_format=EXT - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2135,12 +2124,12 @@ complexity-masa-in-binaural-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 16 hours + start_in: 11 hours script: - in_format=MASA - out_format=BINAURAL - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2150,12 +2139,12 @@ complexity-masa-in-hoa3-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 17 hours + start_in: 12 hours script: - in_format=MASA - out_format=HOA3 - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2170,7 +2159,7 @@ complexity-masa-in-hoa3-out: # - in_format=OMASA # - out_format=EXT # - ret_val=0 -# - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? +# - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? # - *complexity-measurements-prepare-artifacts # - exit $ret_val @@ -2180,12 +2169,12 @@ complexity-omasa-in-binaural-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 18 hours + start_in: 14 hours script: - in_format=OMASA - out_format=BINAURAL - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2195,12 +2184,12 @@ complexity-omasa-in-hoa3-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 20 hours + start_in: 15 hours script: - in_format=OMASA - out_format=HOA3 - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2210,12 +2199,12 @@ complexity-StereoDmxEVS-stereo-in-mono-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 22 hours + start_in: 16 hours script: - in_format=StereoDmxEVS - out_format=mono - ret_val=0 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" full basop || ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -2240,7 +2229,7 @@ complexity-osba-in-binaural-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 22 hours 30 minutes + start_in: 18 hours script: - in_format=OSBA - out_format=BINAURAL @@ -2255,7 +2244,7 @@ complexity-osba-in-binaural_room_ir-out: rules: - if: $MEASURE_COMPLEXITY_LINUX when: delayed - start_in: 25 hours + start_in: 19 hours script: - in_format=OSBA - out_format=BINAURAL_ROOM_IR @@ -2276,7 +2265,7 @@ pages: - *update-scripts-repo - python3 ci/setup_pages.py - ls - - ls -lh public + - ls public artifacts: paths: - public diff --git a/apps/encoder.c b/apps/encoder.c index 21aa5d0b1d489552451f01b734accc94497f1e18..037cf903b229fb9326e9c81c7495c00790338d58 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -368,6 +368,15 @@ int main( goto cleanup; } +#ifdef SUPPORT_FORCE_TCX10_TCX20 +#ifdef DEBUGGING + if ( arg.forcedMode == IVAS_ENC_FORCE_TCX10 && totalBitrate < 48000 ) + { + fprintf( stderr, "Warning: Enforcing the TCX10 mode is only supported for bitrates higher or equal than 48 kbps!\n\n" ); + } +#endif +#endif + /*------------------------------------------------------------------------------------------* * Configure and initialize (allocate memory for static variables) the encoder *------------------------------------------------------------------------------------------*/ @@ -1056,7 +1065,24 @@ static bool parseCmdlIVAS_enc( } else { +#ifdef SUPPORT_FORCE_TCX10_TCX20 + if ( arg->forcedMode == IVAS_ENC_FORCE_TCX10 ) + { + strcpy( stmp, "TCX10" ); + } + else if ( arg->forcedMode == IVAS_ENC_FORCE_TCX20 ) + { + strcpy( stmp, "TCX20" ); + } + else + { + strncpy( stmp, argv[i + 1], sizeof( stmp ) ); + } + + fprintf( stdout, "Forcing codec to: %s\n", stmp ); +#else fprintf( stdout, "Forcing codec to: %s\n", argv[i + 1] ); +#endif } i += 2; @@ -2033,10 +2059,24 @@ static IVAS_ENC_FORCED_MODE parseForcedMode( { return IVAS_ENC_FORCE_GSC; } - if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) ) + if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) +#ifdef SUPPORT_FORCE_TCX10_TCX20 + || ( strcmp( forcedModeChar, "TCX20" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX20'" ) == 0 ) +#endif + ) { +#ifdef SUPPORT_FORCE_TCX10_TCX20 + return IVAS_ENC_FORCE_TCX20; +#else return IVAS_ENC_FORCE_TCX; +#endif } +#ifdef SUPPORT_FORCE_TCX10_TCX20 + if ( ( strcmp( forcedModeChar, "TCX10" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX10'" ) == 0 ) ) + { + return IVAS_ENC_FORCE_TCX10; + } +#endif if ( ( strcmp( forcedModeChar, "HQ" ) == 0 ) || ( strcmp( forcedModeChar, "'HQ'" ) == 0 ) ) { return IVAS_ENC_FORCE_HQ; diff --git a/apps/renderer.c b/apps/renderer.c index 11a3d7f6d8495000029a49510acdcb8453a5466c..639d491c93e9e17583c2328f1b1be7809e9db720 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -637,6 +637,8 @@ int main( lfeRoutingConfigs[i] = NULL; } + IVAS_REND_PrintDisclaimer(); + CmdlnArgs args = parseCmdlnArgs( argc, argv ); if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) || @@ -796,6 +798,48 @@ int main( exit( -1 ); } + fprintf( stdout, "Input audio file: %s\n", args.inputFilePath ); + fprintf( stdout, "Output audio file: %s\n\n", args.outputFilePath ); + + if ( args.inConfig.numAudioObjects > 0 ) + { + if ( args.inConfig.numAudioObjects == 1 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM1 ); + } + else if ( args.inConfig.numAudioObjects == 2 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM2 ); + } + else if ( args.inConfig.numAudioObjects == 3 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM3 ); + } + else if ( args.inConfig.numAudioObjects == 4 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM4 ); + } + } + for ( i = 0; i < args.inConfig.numMultiChannelBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.multiChannelBuses[i].audioConfig ); + } + for ( i = 0; i < args.inConfig.numMasaBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.masaBuses[i].audioConfig ); + } + for ( i = 0; i < args.inConfig.numAmbisonicsBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.ambisonicsBuses[i].audioConfig ); + } + + if ( ( error = IVAS_REND_PrintConfig( hIvasRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\n IVAS_REND_PrintConfig failed: %s\n\n", ivas_error_to_string( error ) ); + // goto cleanup; + exit( -1 ); + } + /* === Configure === */ if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 40f8437895e69633a5c5563a5b6eb3b186fac3c4..556da0d14196131be5b7eb2fb21dde24c2a7236d 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -81,8 +81,14 @@ #define FORCE_MUSIC 101 /* debugging - force music on the command line */ #define FORCE_ACELP 102 /* debugging - force ACELP core on the command line */ #define FORCE_GSC 103 /* debugging - force GSC core on the command line */ +#ifdef SUPPORT_FORCE_TCX10_TCX20 +#define FORCE_TCX10 104 /* debugging - force TCX10 core on the command line */ +#define FORCE_TCX20 105 /* debugging - force TCX20 core on the command line */ +#define FORCE_HQ 106 /* debugging - force HQ core on the command line */ +#else #define FORCE_TCX 104 /* debugging - force TCX core on the command line */ #define FORCE_HQ 105 /* debugging - force HQ core on the command line */ +#endif #define FORCE_TD_RENDERER 201 #define FORCE_CLDFB_RENDERER 202 #endif diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 10a31d94c079da17168d2a3c79591fadc728f47b..5587bdd090f72b558a14d5356b3e027ab168f98f 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -47,7 +47,7 @@ int16_t print_disclaimer( FILE *fPtr ) { fprintf( fPtr, "\n==================================================================================================\n" ); - fprintf( fPtr, " IVAS Codec Baseline\n" ); + fprintf( fPtr, " \n IVAS Codec Version IVAS-FL-1.0\n" ); fprintf( fPtr, " \n" ); fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" ); fprintf( fPtr, " Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0\n" ); diff --git a/lib_com/options.h b/lib_com/options.h index 1691f9deae7921509c60fea07f57c91e32ed627e..e2194149a3f9f6d80eb16190fce389995f03c987 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -57,10 +57,8 @@ /*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ #ifdef DEBUGGING - #define DISABLE_DFT_STEREO_ASSERT /* This assert is hit for -10 dB tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5%, bandwidth switching] */ - /*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ #ifdef DEBUG_MODE_INFO /*#define DEBUG_MODE_ACELP*/ /* output most important ACELP core parameters to the subdirectory "res/" */ @@ -76,6 +74,7 @@ /*#define DEBUG_MODE_INFO_ALLRAD*/ /* define to output generated HOA decoding mtx */ /*#define DEBUG_MODE_LFE */ /* define to output LFE relevant parameters */ #endif +#define SUPPORT_FORCE_TCX10_TCX20 /* VA: Enable -force tcx10|tcx20 command-line option */ #ifdef DEBUG_MODE_MDCT #define DEBUG_PLOT_BITS diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index b88bfc25fc79412819a14782b62c138fec9b5a56..059e3b60ff7a587d4a8761f4025ea2f0d1ba66a9 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -30,6 +30,9 @@ *******************************************************************************************************/ +#include +#include +#include #include "lib_dec.h" #include "ivas_cnst.h" #include "ivas_prot.h" @@ -38,9 +41,6 @@ #include "jbm_jb4sb.h" #include "jbm_pcmdsp_apa.h" #include "jbm_pcmdsp_fifo.h" -#include -#include -#include #ifdef DEBUGGING #include "debug.h" #endif @@ -2449,85 +2449,6 @@ const char *IVAS_DEC_GetErrorMessage( } -/*---------------------------------------------------------------------* - * get_channel_config() - * - * Gets a str related to input config - *---------------------------------------------------------------------*/ - -static ivas_error get_channel_config( - AUDIO_CONFIG config, - char *str ) -{ - if ( config == IVAS_AUDIO_CONFIG_MONO ) - { - strcpy( str, "Mono" ); - } - else if ( config == IVAS_AUDIO_CONFIG_STEREO ) - { - strcpy( str, "Stereo" ); - } - else if ( config == IVAS_AUDIO_CONFIG_5_1 ) - { - strcpy( str, "Multichannel 5.1 (CICP6)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_7_1 ) - { - strcpy( str, "Multichannel 7.1 (CICP12)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_5_1_2 ) - { - strcpy( str, "Multichannel 5.1+2 (CICP14)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_5_1_4 ) - { - strcpy( str, "Multichannel 5.1+4 (CICP16)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_7_1_4 ) - { - strcpy( str, "Multichannel 7.1+4 (CICP19)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) - { - strcpy( str, "Multichannel (custom loudspeaker layout)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_FOA ) - { - strcpy( str, "Ambisonics: First Order (FOA)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_HOA2 ) - { - strcpy( str, "Ambisonics: Second Order (HOA2)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_HOA3 ) - { - strcpy( str, "Ambisonics: Third Order (HOA3)" ); - } - else if ( config == IVAS_AUDIO_CONFIG_BINAURAL ) - { - strcpy( str, "Binaural: no room" ); - } - else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - strcpy( str, "Binaural: room with impulse responses" ); - } - else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - strcpy( str, "Binaural: room with reverb" ); - } - else if ( config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - strcpy( str, "External renderer" ); - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Incorrect Input/Output Configuration" ); - } - - return IVAS_ERR_OK; -} - - /*---------------------------------------------------------------------* * printConfigInfo_dec( ) * diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 0c31acdf19f510cbe18360ac4e46d9af6cd9d5aa..79003e2974ddd75406a280fbde8991e85da03be3 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -229,10 +229,7 @@ ivas_error pre_proc_front_ivas( #ifdef DEBUG_MODE_INFO { int16_t tmp_dmx_in[L_FRAME48k]; - for ( int16_t isample = 0; isample < input_frame; isample++ ) - { - tmp_dmx_in[isample] = (int16_t) signal_in[isample - NS2SA( st->input_Fs, ACELP_LOOK_NS )]; - } + mvr2s( signal_in - NS2SA( st->input_Fs, ACELP_LOOK_NS ), tmp_dmx_in, input_frame ); dbgwrite( tmp_dmx_in, sizeof( int16_t ), input_frame, 1, strcat( fname( debug_dir, "ivas_input_dmx", 0, ch_idx + 1, ENC ), ".pcm" ) ); } #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 8a25b8d798b9ec65173a2c86bbda3a5438699d09..441d8c16db9f2f40a8c2739649169034168c2dad 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -1052,6 +1052,20 @@ ivas_error create_cpe_enc( #ifdef DEBUGGING hCPE->hStereoMdct->mdct_stereo_mode_cmdl = st_ivas->hEncoderConfig->mdct_stereo_mode_cmdl; +#ifdef DEBUG_FORCE_MDCT_STEREO_MODE + /*set all other members to defined states */ + hCPE->hStereoMdct->fDualMono = 0; + hCPE->hStereoMdct->fMSstereo = 0; + + if ( hCPE->hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_LR ) + { + hCPE->hStereoMdct->fDualMono = 1; + } + else if ( hCPE->hStereoMdct->mdct_stereo_mode_cmdl == SMDCT_FORCE_MS ) + { + hCPE->hStereoMdct->fMSstereo = 1; + } +#endif #endif initMdctStereoEncData( hCPE->hStereoMdct, ivas_format, hCPE->element_mode, hCPE->element_brate, max_bwidth, 0, NULL, 1 ); hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 6e4c4978b6ad81dece3ed0d435a1711d15708623..084efb6a500dc34b714dc678d82e4ffb19ade741 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -200,10 +200,17 @@ void ivas_decision_matrix_enc( { st->core = ACELP_CORE; } +#ifdef SUPPORT_FORCE_TCX10_TCX20 + else if ( st->force == FORCE_TCX20 || st->force == FORCE_TCX10 ) /* Initalizations should always happen with TCX20*/ + { + st->core = TCX_20_CORE; + } +#else else if ( st->force == FORCE_TCX ) { st->core = TCX_20_CORE; } +#endif else if ( st->force == FORCE_HQ && st->element_mode != IVAS_CPE_MDCT && element_brate >= IVAS_24k4 ) { st->core = HQ_CORE; diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index a308be9bb62960e2a51def08300a55082f13fd13..0fb8eabb35b33afae2b250b7e9673fa3cf4e4e03 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -2325,9 +2325,18 @@ static ivas_error forcedModeApiToInternal( case IVAS_ENC_FORCE_GSC: *forcedModeInternal = FORCE_GSC; break; +#ifdef SUPPORT_FORCE_TCX10_TCX20 + case IVAS_ENC_FORCE_TCX10: + *forcedModeInternal = FORCE_TCX10; + break; + case IVAS_ENC_FORCE_TCX20: + *forcedModeInternal = FORCE_TCX20; + break; +#else case IVAS_ENC_FORCE_TCX: *forcedModeInternal = FORCE_TCX; break; +#endif case IVAS_ENC_FORCE_HQ: *forcedModeInternal = FORCE_HQ; break; diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index 13399ba0ca21377e48734c52990e72f60ac018d7..52c05332aea2b6a1831ef60c8b2fe315321ab443 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -127,7 +127,12 @@ typedef enum _IVAS_ENC_FORCED_MODE IVAS_ENC_FORCE_MUSIC, IVAS_ENC_FORCE_ACELP, IVAS_ENC_FORCE_GSC, +#ifdef SUPPORT_FORCE_TCX10_TCX20 + IVAS_ENC_FORCE_TCX10, + IVAS_ENC_FORCE_TCX20, +#else IVAS_ENC_FORCE_TCX, +#endif IVAS_ENC_FORCE_HQ, IVAS_ENC_FORCE_UNFORCED, IVAS_ENC_FORCE_UNDEFINED = 0xffff diff --git a/lib_enc/transient_detection.c b/lib_enc/transient_detection.c index 04cf8ea2471a095aede392c3f01641dce49b3c15..15273d26cc5a4258fbd393872fffa055582d799a 100644 --- a/lib_enc/transient_detection.c +++ b/lib_enc/transient_detection.c @@ -324,6 +324,20 @@ void SetTCXModeInfo( hTcxEnc->tcxMode = NO_TCX; } } + +#ifdef SUPPORT_FORCE_TCX10_TCX20 +#ifdef DEBUGGING + if ( st->force == FORCE_TCX10 ) + { + hTcxEnc->tcxMode = TCX_10; + } + else if ( st->force == FORCE_TCX20 ) + { + hTcxEnc->tcxMode = TCX_20; + } +#endif +#endif + /* set the left window overlap */ if ( st->last_core == ACELP_CORE || st->last_core == AMR_WB_CORE ) { diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 3c92765d421e9d8d6e56b8ba0227203bd27c1dda..2e53001449ed54c9416abf074cbf129d915e6286 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -37,6 +37,7 @@ #include "ivas_prot_rend.h" #include "ivas_rom_com.h" #include "ivas_prot.h" +#include #ifdef DEBUGGING #include "debug.h" #include @@ -435,3 +436,114 @@ ivas_error ivas_output_buff_dec( return IVAS_ERR_OK; } + + +/*---------------------------------------------------------------------* + * get_channel_config() + * + * Gets a str related to input config + *---------------------------------------------------------------------*/ + +ivas_error get_channel_config( + const AUDIO_CONFIG config, + char *str ) +{ + if ( config == IVAS_AUDIO_CONFIG_MONO ) + { + strcpy( str, "Mono" ); + } + else if ( config == IVAS_AUDIO_CONFIG_STEREO ) + { + strcpy( str, "Stereo" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM1 ) + { + strcpy( str, "Object-based audio (1 object)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM2 ) + { + strcpy( str, "Object-based audio (2 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM3 ) + { + strcpy( str, "Object-based audio (3 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM4 ) + { + strcpy( str, "Object-based audio (4 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1 ) + { + strcpy( str, "Multichannel 5.1 (CICP6)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_7_1 ) + { + strcpy( str, "Multichannel 7.1 (CICP12)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1_2 ) + { + strcpy( str, "Multichannel 5.1+2 (CICP14)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1_4 ) + { + strcpy( str, "Multichannel 5.1+4 (CICP16)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_7_1_4 ) + { + strcpy( str, "Multichannel 7.1+4 (CICP19)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + { + strcpy( str, "Multichannel (custom loudspeaker layout)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_MASA1 ) + { + strcpy( str, "Metadata-Assisted Spatial Audio mono (MASA1)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_MASA2 ) + { + strcpy( str, "Metadata-Assisted Spatial Audio stereo (MASA2)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_FOA ) + { + strcpy( str, "Ambisonics: First Order (FOA)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_HOA2 ) + { + strcpy( str, "Ambisonics: Second Order (HOA2)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_HOA3 ) + { + strcpy( str, "Ambisonics: Third Order (HOA3)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL ) + { + strcpy( str, "Binaural: no room" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + { + strcpy( str, "Binaural: room with impulse responses" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + strcpy( str, "Binaural: room with reverb" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + { + strcpy( str, "BINAURAL_SPLIT_CODED" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + strcpy( str, "Binaural_Split_PCM" ); + } + else if ( config == IVAS_AUDIO_CONFIG_EXTERNAL ) + { + strcpy( str, "External renderer" ); + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Incorrect Input/Output Configuration" ); + } + + return IVAS_ERR_OK; +} diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 7a4c0c40c1304d0e319de3cd7def58a03151a7a1..20c375b611f9453891efc9b85e9af2bdd1c2476e 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -77,6 +77,12 @@ int16_t ivas_get_nchan_buffers_dec( const int32_t ivas_total_brate /* i : total IVAS bitrate */ ); +ivas_error get_channel_config( + const AUDIO_CONFIG config, + char *str +); + + /*----------------------------------------------------------------------------------* * Limiter prototypes *----------------------------------------------------------------------------------*/ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1253423d4d8acec208453c524fd8d3e3afb0a6d9..ab29964b7df19f3cc09f79394e9d8fbd03344ac5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7109,3 +7109,97 @@ static void freeMasaExtRenderer( return; } + + +static ivas_error printConfigInfo_rend( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +) +{ + ivas_error error; + char config_str[50]; + + /*-----------------------------------------------------------------* + * Print output audio configuration + *-----------------------------------------------------------------*/ + + if ( ( error = get_channel_config( hIvasRend->outputConfig, &config_str[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + + fprintf( stdout, "Output configuration: %s\n", config_str ); + + /*-----------------------------------------------------------------* + * Print renderer configurations + *-----------------------------------------------------------------*/ + + fprintf( stdout, "Output sampling rate: %d Hz\n", hIvasRend->sampleRateOut ); + + if ( hIvasRend->headRotData.headRotEnabled == 1 ) + { + fprintf( stdout, "Head-tracking: ON\n" ); + } + + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + fprintf( stdout, "Render framesize: %dms\n", hIvasRend->num_subframes * 5 ); + } + + return IVAS_ERR_OK; +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintInputConfig() + * + * + *---------------------------------------------------------------------*/ + +void IVAS_REND_PrintInputConfig( + const IVAS_AUDIO_CONFIG inputConfig /* i : input audio configuration */ +) +{ + char config_str[50]; + + get_channel_config( inputConfig, &config_str[0] ); + fprintf( stdout, "Input configuration: %s\n", config_str ); + + return; +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintConfig() + * + * + *---------------------------------------------------------------------*/ + +ivas_error IVAS_REND_PrintConfig( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +) +{ + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + return printConfigInfo_rend( hIvasRend ); +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintDisclaimer() + * + * Print IVAS disclaimer to console + *---------------------------------------------------------------------*/ + +void IVAS_REND_PrintDisclaimer( void ) +{ + print_disclaimer( stderr ); + + return; +} diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index a6a4797334215517c093a5a6b804db17474a5e0b..9fd8e08fe5868960e1ec1c2031e2ba0640bf0ac9 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -326,6 +326,20 @@ int32_t IVAS_REND_GetCntFramesLimited( ); #endif +/* Disclaimer and info printing */ + +void IVAS_REND_PrintInputConfig( + const IVAS_AUDIO_CONFIG inputConfig /* i : input audio configuration */ +); + +ivas_error IVAS_REND_PrintConfig( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +); + +void IVAS_REND_PrintDisclaimer( + void +); + /* clang-format on */ #endif