diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 81e3d0a3d601d6dbf451343a34f97d208cd5e424..d451624c71baada425032dea2deea35f5e72b568 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ variables: # note: GitLab cannot reference variables defined by users in the include ref:, we need to use a YAML anchor for this # see https://docs.gitlab.com/ci/yaml/includes/#use-variables-with-include for more information - IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF main + IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF kiene/test-runner-platform-update # If you need to set some config variable only in a local branch, then add an overwrite here # One example is DISABLE_HRTF - this will be set on a branch which is about to be merged and will be removed in a subsequent second MR # this is more easily done directly here in the child repo diff --git a/lib_com/options.h b/lib_com/options.h index 57c086afb35424dee7a8ab0fb96606fb44bab42c..98ec3c1d0689256864ea1f5ea6f06a578595852a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,6 +170,9 @@ #define FIX_2274_OOB_INDEXING_IN_CORRMATRIX /* FhG: fix OOB indexing complaint */ #define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */ #define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */ +#define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ +#define FIX_1474_USAN_TRANS_INV /* Eri: Fix USAN out-of-bounds warning. No OOB occurs, but the pointer is set to point to uninitialized memory. */ +#define FIX_1487_ACCESS_OF_UNINIT_VAL_FROM_ARR_ISM_DTX /* FhG/VA: init nb_bits_metadata to zero */ /* #################### End BE switches ################################## */ diff --git a/lib_com/trans_direct.c b/lib_com/trans_direct.c index ece693492915d911b213e6ef01176be9b2483ac0..540d6ec751d303e9ae2b1d1d3165e48c90d74ca9 100644 --- a/lib_com/trans_direct.c +++ b/lib_com/trans_direct.c @@ -100,19 +100,31 @@ void direct_transform( in32_r16[i] = in32[L - 1 - i]; in32_r16[L - 1 - i] = in32[i]; } + +#ifndef FIX_1474_USAN_TRANS_INV iseg = in32_r16 - segment_length / 4; +#endif oseg = out32; wh = win + segment_length / 4; wl = win + segment_length / 4 - 1; +#ifdef FIX_1474_USAN_TRANS_INV + sh = in32_r16 + 2 * segment_length / 4; + sl = in32_r16 + 2 * segment_length / 4 - 1; +#else sh = iseg + 3 * segment_length / 4; sl = iseg + 3 * segment_length / 4 - 1; +#endif for ( i = 0; i < segment_length / 4; i++ ) { dctin32[i] = ( ( *wl-- * *sl-- ) - ( *wh++ * *sh++ ) ); } +#ifdef FIX_1474_USAN_TRANS_INV + sl = in32_r16 + segment_length / 4 - 1; +#else sl = iseg + segment_length / 2 - 1; +#endif for ( i = 0; i < segment_length / 4; i++ ) { @@ -121,7 +133,11 @@ void direct_transform( edct( dctin32, oseg, segment_length / 2, element_mode ); +#ifdef FIX_1474_USAN_TRANS_INV + iseg = in32_r16 + segment_length / 4; +#else iseg = iseg + segment_length / 2; +#endif oseg = oseg + segment_length / 2; for ( seg = 1; seg < NUM_TIME_SWITCHING_BLOCKS - 1; seg++ ) diff --git a/lib_com/trans_inv.c b/lib_com/trans_inv.c index 620be7a1786a04740b45f3a00645da1971fe67bd..183595767c67b6216871401362dae250eb8f5d72 100644 --- a/lib_com/trans_inv.c +++ b/lib_com/trans_inv.c @@ -838,22 +838,38 @@ void inverse_transform( } } +#ifdef FIX_1474_USAN_TRANS_INV + out_segment = out_alias; +#else out_segment = out_alias - segment_length / 4; +#endif in_segment = in_mdct_modif; iedct_short( in_segment, alias, segment_length, element_mode ); for ( ta = segment_length / 4; ta < segment_length / 2; ta++ ) { +#ifdef FIX_1474_USAN_TRANS_INV + *out_segment++ = alias[ta]; +#else out_segment[ta] = alias[ta]; +#endif } for ( ta = segment_length / 2; ta < segment_length; ta++ ) { +#ifdef FIX_1474_USAN_TRANS_INV + *out_segment++ = alias[ta] * win[ta]; +#else out_segment[ta] = alias[ta] * win[ta]; +#endif } +#ifdef FIX_1474_USAN_TRANS_INV + out_segment = out_alias + segment_length / 4; +#else out_segment = out_segment + segment_length / 2; +#endif in_segment = in_segment + segment_length / 2; for ( seg = 1; seg < NUM_TIME_SWITCHING_BLOCKS - 1; seg++ ) diff --git a/lib_dec/ivas_ism_dtx_dec.c b/lib_dec/ivas_ism_dtx_dec.c index 3164218b41bd57525569775acd208ae842e39088..dc0b27813bc559bea551edd1901dbcf431cf5e94 100644 --- a/lib_dec/ivas_ism_dtx_dec.c +++ b/lib_dec/ivas_ism_dtx_dec.c @@ -120,6 +120,12 @@ void ivas_ism_dtx_dec( nb_bits_metadata[ch] = nb_bits_metadata[sce_id_dtx]; } } +#ifdef FIX_1487_ACCESS_OF_UNINIT_VAL_FROM_ARR_ISM_DTX + else + { + set_s( nb_bits_metadata, 0, st_ivas->nchan_transport ); + } +#endif if ( !st_ivas->bfi ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 4f0acd6364146159ca3e5610cdc56ffe963bf89d..736d0cbd382aa878a1de04e82c5f9b52df31dadd 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1408,6 +1408,9 @@ ivas_error ivas_jbm_dec_flush_renderer( int16_t n_samples_still_available; int16_t n_slots_still_available; int16_t n_samples_to_render; +#ifdef FIX_1486_INIT_OUTPUT_POINTERS + int16_t ch_idx; +#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; float *p_output[MAX_LS_CHANNELS + MAX_NUM_OBJECTS]; @@ -1416,6 +1419,13 @@ ivas_error ivas_jbm_dec_flush_renderer( return IVAS_ERR_OK; } +#ifdef FIX_1486_INIT_OUTPUT_POINTERS + for ( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) + { + p_output[ch_idx] = st_ivas->p_output_f[ch_idx]; + } +#endif + *nSamplesRendered = 0; hTcBuffer = st_ivas->hTcBuffer; @@ -1432,8 +1442,10 @@ ivas_error ivas_jbm_dec_flush_renderer( if ( n_slots_still_available ) { +#ifndef FIX_1486_INIT_OUTPUT_POINTERS int16_t ch_idx; +#endif /* render available full slots (with new lower granularity) */ for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) { @@ -1453,10 +1465,12 @@ ivas_error ivas_jbm_dec_flush_renderer( hTcBuffer->n_samples_flushed = n_samples_to_render; hTcBuffer->n_samples_rendered = 0; +#ifndef FIX_1486_INIT_OUTPUT_POINTERS for ( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) { p_output[ch_idx] = st_ivas->p_output_f[ch_idx]; } +#endif if ( st_ivas->ivas_format == ISM_FORMAT ) { diff --git a/pytest.ini b/pytest.ini index c52e1b7bbd61cd023d4045454868c4f916853f4f..4d5e739363ebdf842445f42b8d5497d702e6455d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,7 +3,7 @@ [pytest] addopts = --tb=short -n auto -v # Write captured system-out log messages to JUnit report. -junit_logging = system-out +junit_logging = all # Do not capture log information for passing tests to JUnit report. junit_log_passing_tests = False junit_duration_report = call diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 1aa7370f08dd8d919e2cf028bf3e4cfb223447b8..f7c1b38462480de5137d56da16af6cf4c58ddf8e 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -67,7 +67,8 @@ from pyaudio3dtools.audiofile import readfile from ..cmp_pcm import cmp_pcm from ..conftest import get_split_idx, parse_properties -def _run_cmd(cmd, test_info=None, env=None ): + +def _run_cmd(cmd, test_info=None, env=None): """ Helper function for running some command. Raises a SystemError if either the return code is non-zero or a USAN printout is detected @@ -78,6 +79,7 @@ def _run_cmd(cmd, test_info=None, env=None ): # check for USAN error first if "UndefinedBehaviorSanitizer" in stdout: error = f"USAN error detected in stdout of command: {' '.join(cmd)}\n{stdout}" + print(error) if test_info is not None: test_info.error = error raise SystemError(error) @@ -87,6 +89,7 @@ def _run_cmd(cmd, test_info=None, env=None ): proc.check_returncode() except sp.CalledProcessError as e: error = f"Command returned non-zero exit status ({e.returncode}): {' '.join(e.cmd)}\n{e.stderr}\n{e.stdout}" + print(error) if test_info is not None: test_info.error = error raise SystemError(error) @@ -106,6 +109,7 @@ def run_ivas_isar_enc_cmd(cmd, test_info=None, env=None): logging.info(f"\nRunning IVAS ISAR encoder command\n{' '.join(cmd)}\n") _run_cmd(cmd, test_info=test_info, env=env) + def run_ivas_isar_dec_cmd(cmd, test_info=None, env=None): if BIN_SUFFIX_MERGETARGET in cmd[0]: logging.info(f"\nREF decoder command:\n\t{' '.join(cmd)}\n") @@ -113,6 +117,7 @@ def run_ivas_isar_dec_cmd(cmd, test_info=None, env=None): logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n") _run_cmd(cmd, test_info=test_info, env=env) + def run_isar_post_rend_cmd(cmd, test_info=None, env=None): logging.info(f"\nRunning ISAR post renderer command\n{' '.join(cmd)}\n") _run_cmd(cmd, test_info=test_info, env=env) @@ -771,19 +776,19 @@ def scene_description_file(in_fmt, metadata_tmp, n_obj, input_file, in_meta_file metadata_tmp ).parent # File names must be relative to config file location fp_meta.write(f"{os.path.relpath(input_file, currdir)}\n") # Input file - fp_meta.write(f"{n_obj+1}\n") # Number of sources + fp_meta.write(f"{n_obj + 1}\n") # Number of sources for n in range(0, n_obj): if in_meta_files[n] == "NULL": md_file = "1\n1,0,0" # NULL metadata position: azim=0,elev=0 for 1 frame, looped throughout all frames. else: md_file = os.path.relpath(in_meta_files[n], currdir) - fp_meta.write(f"ISM\n{n+1}\n{md_file}\n") # ISM metadata + fp_meta.write(f"ISM\n{n + 1}\n{md_file}\n") # ISM metadata if "OSBA" in in_fmt: fp_meta.write( "gain_dB:-6\n" ) # Set -6 dB on all components for OSBA to match IVAS_dec fp_meta.write(f"{in_fmt.split('_')[0][1:]}\n") # SBA or MASA - fp_meta.write(f"{n_obj+1}\n") + fp_meta.write(f"{n_obj + 1}\n") fp_meta.write(f"{in_fmt.split('_')[-1]}\n") # SBA or MASA parameter if "OMASA" in in_fmt: fp_meta.write(