diff --git a/apps/renderer.c b/apps/renderer.c index 740680bb22cde65a19981c13c9ceb13d7d0e0457..69c01c28c66cd790deae2bc3aa0875eaf9c9a28c 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1235,15 +1235,11 @@ int main( masaIds[i] = 0u; } -#ifdef FIX_1377_HANDLE_ERROR_CODE if ( ( error = IVAS_REND_SetObjectIDs( hIvasRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_REND_SetObjectIDs: %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#else - IVAS_REND_SetObjectIDs( hIvasRend ); -#endif for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) { @@ -2617,14 +2613,10 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; -#ifdef FIX_HRTF_LEFTOVERS for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID; } -#else - args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; -#endif for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) { diff --git a/ci/create_trajectories.py b/ci/create_trajectories.py index 6b957df0926bdb2f08a43727571d160ea164894a..522a26461d1afe804bc13a67e43f74fc576c8172 100644 --- a/ci/create_trajectories.py +++ b/ci/create_trajectories.py @@ -1,13 +1,15 @@ import numpy as np +from scipy.spatial.transform import Rotation FRAMES_PER_SEC = 50 +MAGIC_VAL_TO_SIGNAL_EULER_ANGLES = -3 def random_trajectory(duration_sec): n_frames = int(FRAMES_PER_SEC * duration_sec) trj = np.random.random((n_frames, 4)) - trj[:, 0] = -3 + trj[:, 0] = MAGIC_VAL_TO_SIGNAL_EULER_ANGLES trj[:, 1] *= 180 trj[:, 2] *= 90 trj[:, 3] *= 180 @@ -17,9 +19,24 @@ def random_trajectory(duration_sec): def constant_trajectory(duration_sec, yaw=0, pitch=0, roll=0): n_frames = int(FRAMES_PER_SEC * duration_sec) trj = np.empty((n_frames, 4)) - trj[:, 0] = -3 + trj[:, 0] = MAGIC_VAL_TO_SIGNAL_EULER_ANGLES trj[:, 1] = yaw trj[:, 2] = pitch trj[:, 3] = roll return trj + +def random_trajectory_quat(duration_sec): + n_frames = int(FRAMES_PER_SEC * duration_sec) + trj = Rotation.random(n_frames).as_quat() + return trj + + +def constant_trajectory_quat(duration_sec, w=1, x=0, y=0, z=0): + n_frames = int(FRAMES_PER_SEC * duration_sec) + trj = np.empty((n_frames, 4)) + trj[:, 0] = w + trj[:, 1] = x + trj[:, 2] = y + trj[:, 3] = z + return trj diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index c2d3f30d1134047c5bf560d00c51140729900844..071270610f8a71048a6dc60acd1020d83f98ba34 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -1,38 +1,39 @@ #!/usr/bin/env python3 """ - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. """ import argparse import pathlib import subprocess import sys +import os import numpy as np import json @@ -43,7 +44,7 @@ from collect_artifacts import ( find_failed_files_for_sanitizer_test, ) from combine_genpatt_and_jbm_profile import combine_error_profiles -from create_trajectories import random_trajectory +from create_trajectories import random_trajectory, random_trajectory_quat SCRIPT_DIR = pathlib.Path("./scripts").resolve() @@ -75,12 +76,17 @@ ARGS_FOR_OC = { "BINAURAL_ROOM_REVERB": BINAURAL_OUT_ARGS, } +SEED_FOR_RANDOM = int(os.environ.get("CI_JOB_ID", 0)) + def main(args): in_format = args.in_format out_formats = args.out_formats tests = args.tests run_fec = not args.skip_fec + seed = SEED_FOR_RANDOM if args.inject_seed is None else args.inject_seed + + np.random.seed(seed) assert all([t in SUPPORTED_TESTS for t in tests]) @@ -92,7 +98,6 @@ def main(args): def get_modes(in_format: str) -> list: - in_format_for_script = in_format if in_format in MC_MODES: in_format_for_script = "MC" @@ -134,7 +139,6 @@ def assemble_oc_dict(out_formats: list): def get_md_file_command(in_format: str) -> list: - cmd = list() if "ISM" in in_format: cmd.append("--ism_metadata_files") @@ -145,8 +149,7 @@ def get_md_file_command(in_format: str) -> list: return cmd -def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True): - +def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool): modes = get_modes(in_format) if len(modes) == 0: return 0 @@ -156,10 +159,10 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # create random trajectory files if "BINAURAL" in oc_str: - trajectory_files = [HEAD_TRAJ_FILE, EXOF_TRAJ_FILE] - for tf in trajectory_files: - traj = random_trajectory(int(DURATION)) - np.savetxt(tf, traj, fmt="%.2f", delimiter=",") + traj = random_trajectory(int(DURATION)) + np.savetxt(HEAD_TRAJ_FILE, traj, fmt="%.2f", delimiter=",") + traj_exof = random_trajectory_quat(int(DURATION)) + np.savetxt(EXOF_TRAJ_FILE, traj_exof, fmt="%.2f", delimiter=",") ### always run encoder and decoder with no frameloss cmd_no_fec = [ @@ -187,7 +190,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # resue decoder part of StereDmxEVS mode (it is basically a duplicate of "normal" mono run) if in_format == "StereoDmxEVS": panning = np.random.randint(-90, 91) - cmd_no_fec += [f'-D=-non_diegetic_pan {panning}'] + cmd_no_fec += [f"-D=-non_diegetic_pan {panning}"] print( "======== Script command line WITHOUT plc: ========\n{}".format( @@ -277,5 +280,11 @@ if __name__ == "__main__": parser.add_argument("out_formats", type=str, nargs="+") parser.add_argument("--tests", type=str, nargs="+", default=["CLANG1", "CLANG2"]) parser.add_argument("--skip_fec", action="store_true") + parser.add_argument( + "--inject_seed", + type=int, + default=None, + help="Value to use for seeding random generators", + ) sys.exit(main(parser.parse_args())) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index ff0e1972fed39ed84c13a810d60d1d9d415e876c..6f679f0fd81f19ec85247e6db1be3016a9e45727 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -229,9 +229,7 @@ typedef enum /* format signaling in SID frames */ #define SID_FORMAT_NBITS 3 /* Bit 0 | Bit 1 | Bit 2 */ /*-------|-------|------ */ -#ifdef FIX_1384_MSAN_ivas_spar_dec_open #define SID_FORMAT_NONE (-0x1) /* n/a| n/a| n/a*/ -#endif #define SID_DFT_STEREO 0x0 /* 0| 0| 0 */ #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ diff --git a/lib_com/options.h b/lib_com/options.h index 682494ad64b4cd50e15f0382b960e89ceed17064..6d394089cd1363bd8b44f7f310073adbf256963d 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,15 +168,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ -#define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ -#define FIX_HRTF_LEFTOVERS /* VA: HRTF updates - bring float main in line with BASOP main */ -#define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ -#define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ -#define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ -#define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ -#define FIX_1385_INIT_IGF_STOP_FREQ /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */ -#define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ -#define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ /* #################### End BE switches ################################## */ @@ -188,8 +179,6 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ -#define NONBE_1344_REND_MASA_LOW_FS /* Nokia: Issue 1344: Fix sanitizer errors when using IVAS_rend to render MASA with lower sampling rates */ #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES /* Nokia: Fix for issues 1399: obj edit broken with MC/SBA output in VOIP, and 1400: negative energy estimate used for gaining. */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index efb77f0a3f8067eae9f448e8a7c78e2ec5782e92..5f7ab86cf1b7c7ee447c853e104672c520dff706 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2645,18 +2645,15 @@ void flip_and_downmix_generic( ); void non_linearity( - const float input[], /* i : input signal */ - float output[], /* i : output signal */ - float old_bwe_exc_extended[], /* i/o: memory bugffer */ - const int16_t length, /* i : input length */ - float *prev_scale, /* i/o: memory */ - const int16_t coder_type, /* i : Coder Type */ - const float *voice_factors, /* i : Voice Factors */ - const int16_t L_frame /* i : ACELP frame length */ -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS */ -#endif + const float input[], /* i : input signal */ + float output[], /* i : output signal */ + float old_bwe_exc_extended[], /* i/o: memory bugffer */ + const int16_t length, /* i : input length */ + float *prev_scale, /* i/o: memory */ + const int16_t coder_type, /* i : Coder Type */ + const float *voice_factors, /* i : Voice Factors */ + const int16_t L_frame, /* i : ACELP frame length */ + const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS*/ ); void interp_code_5over2( diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index ed06e57636c1bb4fa0f19df5422c1125585b5edb..2104e5cdee89af298c6c2a8d9df5c9fd39feda0e 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -1345,18 +1345,15 @@ void ScaleShapedSHB( * -------------------------------------------------------------------*/ void non_linearity( - const float input[], /* i : input signal */ - float output[], /* o : output signal */ - float old_bwe_exc_extended[], /* i/o: memory bugffer */ - const int16_t length, /* i : input length */ - float *prev_scale, /* i/o: memory */ - const int16_t coder_type, /* i : Coder Type */ - const float *voice_factors, /* i : Voice Factors */ - const int16_t L_frame /* i : ACELP frame length */ -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS */ -#endif + const float input[], /* i : input signal */ + float output[], /* o : output signal */ + float old_bwe_exc_extended[], /* i/o: memory bugffer */ + const int16_t length, /* i : input length */ + float *prev_scale, /* i/o: memory */ + const int16_t coder_type, /* i : Coder Type */ + const float *voice_factors, /* i : Voice Factors */ + const int16_t L_frame, /* i : ACELP frame length */ + const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS*/ ) { int16_t i, j; @@ -1369,17 +1366,16 @@ void non_linearity( int16_t en_abs = 0; float v_fac = 0, ths; int16_t nframes; -#ifdef NONBE_1328_FIX_NON_LINEARITY float sc_factor; -#endif + if ( L_frame == L_FRAME16k ) { - nframes = 5; + nframes = NB_SUBFR16k; ths = 0.87f; } else { - nframes = 4; + nframes = NB_SUBFR; ths = 0.94f; } @@ -1416,17 +1412,14 @@ void non_linearity( scale = 0.67f; } -#ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = 1024.0f; if ( element_mode > EVS_MONO ) { sc_factor = (float) ( 1 << max( 13 - norm_s( j + 1 ), 0 ) ); /* Adapt the scaling factor allowed depending of max position */ sc_factor = max( sc_factor, 2.0f ); } + if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale ) -#else - if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale ) -#endif { scale_step = 1.0; *prev_scale = scale; @@ -1483,17 +1476,14 @@ void non_linearity( scale = 0.67f; } -#ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = 1024.0f; if ( element_mode > EVS_MONO ) { sc_factor = (float) ( 1 << max( 12 - norm_s( j - length / 2 + 1 ), 0 ) ); /* allowed intra frame jump is smaller */ sc_factor = max( sc_factor, 2.0f ); } + if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale ) -#else - if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale ) -#endif { scale_step = 1.0; *prev_scale = scale; diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index d488d4479efb0225490c17226df1ef6c3e79afa9..8824a6f840dacbcf36a95e2a5cb73d668bfa7c14 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -1414,12 +1414,7 @@ ivas_error acelp_core_dec( if ( !st->ppp_mode_dec && ( st->idchan == 0 || st->element_mode != IVAS_CPE_TD || ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD && st->tdm_LRTD_flag ) ) ) { - non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - st->element_mode -#endif - ); + non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame, st->element_mode ); } if ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) diff --git a/lib_dec/dec_acelp_tcx_main.c b/lib_dec/dec_acelp_tcx_main.c index a591157e44e72a87adab547256f7e80b5326acca..95a3f3275b0e403918159b7d4e6a8a33f3f1214b 100644 --- a/lib_dec/dec_acelp_tcx_main.c +++ b/lib_dec/dec_acelp_tcx_main.c @@ -425,12 +425,7 @@ void dec_acelp_tcx_frame( if ( st->core == ACELP_CORE && st->igf && st->con_tcx == 0 ) { - non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - st->element_mode -#endif - ); + non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame, st->element_mode ); /* update the old BWE exe memory */ mvr2r( &old_bwe_exc[L_FRAME32k], st->hBWE_TD->old_bwe_exc, PIT16k_MAX * 2 ); diff --git a/lib_dec/igf_dec.c b/lib_dec/igf_dec.c index ba7c4993fd1f8722f8a81aa6ca62afbc61958b53..8f91c43fb2282956044fa51d42850d9407e7a44f 100755 --- a/lib_dec/igf_dec.c +++ b/lib_dec/igf_dec.c @@ -1573,6 +1573,7 @@ void IGFDecRestoreTCX10SubFrameData( return; } + /*-----------------------------------------------------------------------* * init_igf_dec() * @@ -1592,9 +1593,7 @@ void init_igf_dec( hIGFDec->flag_sparse = &hIGFDec->flag_sparseBuf[0]; hIGFDec->infoTCXNoise = &hIGFDec->infoTCXNoiseBuf[0]; hIGFDec->virtualSpec = &hIGFDec->virtualSpecBuf[0]; -#ifdef FIX_1385_INIT_IGF_STOP_FREQ hIGFDec->infoIGFStopFreq = 0; -#endif return; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 31297ed45c82cfc8ee0cf0bee62c71754397b30a..f83de6eb2e85e176456c5e2c6a788be3e3091e6b 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1154,9 +1154,7 @@ ivas_error ivas_init_decoder_front( st_ivas->ism_mode = ISM_MODE_NONE; st_ivas->mc_mode = MC_MODE_NONE; -#ifdef FIX_1384_MSAN_ivas_spar_dec_open st_ivas->sid_format = SID_FORMAT_NONE; -#endif st_ivas->sba_dirac_stereo_flag = 0; /* HRTF binauralization latency in ns */ diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index eef4b37bf8b0440b416beaba0f1da004587b59a4..9cf401aba420831ffb4701c627136ca1345cb345 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -532,9 +532,7 @@ void ivas_mdct_core_invQ( set_s( total_nbbits, 0, CPE_CHANNELS ); set_s( bitsRead, 0, CPE_CHANNELS ); tmp_concealment_method = 0; -#ifdef FIX_1387_INIT_PRM_SQQ prm_sqQ = NULL; /* set prm_sqQ to NULL - in case of bfi == 1 it's not set or needed, but it triggers sanitizers */ -#endif for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { diff --git a/lib_dec/ivas_tcx_core_dec.c b/lib_dec/ivas_tcx_core_dec.c index b7e5c11f95406c11e8105194f6be867c69f90250..634ac0f6d7d77e7991bddddb74137efdbdf8ec26 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -288,18 +288,7 @@ void stereo_tcx_core_dec( { int16_t tcx_lpc_cdk; -#ifdef FIX_1384_MSAN_stereo_tcx_core_enc tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); -#else - if ( bfi && st->use_partial_copy && st->rf_frame_type == RF_TCXFD ) - { - tcx_lpc_cdk = tcxlpc_get_cdk( GENERIC ); - } - else - { - tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); - } -#endif mvr2r( st->lsf_old, &lsf[0], M ); mvr2r( st->lsp_old, &lsp[0], M ); @@ -398,13 +387,6 @@ void stereo_tcx_core_dec( lsp2a_stab( st->lsp_old, st->old_Aq_12_8, M ); } -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc - if ( st->enablePlcWaveadjust && bfi ) - { - st->hPlcInfo->nbLostCmpt++; - } -#endif - /*--------------------------------------------------------------------------------* * TD-TCX concealment *--------------------------------------------------------------------------------*/ @@ -538,26 +520,6 @@ void stereo_tcx_core_dec( if ( st->core == TCX_10_CORE || st->core == TCX_20_CORE ) { -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc - if ( st->enablePlcWaveadjust || /* bfi */ - ( st->last_total_brate >= HQ_48k && /* recovery */ - st->last_codec_mode == MODE2 ) ) - { - /* waveform adjustment */ - concealment_signal_tuning( st, bfi, synthFB, st->last_core_bfi ); - - if ( ( bfi || st->prev_bfi ) && st->hPlcInfo->Pitch && st->hPlcInfo->concealment_method == TCX_NONTONAL ) - { - lerp( synthFB, synth, st->L_frame, hTcxDec->L_frameTCX ); - - if ( !bfi && st->prev_bfi ) - { - st->hPlcInfo->Pitch = 0; - } - } - } -#endif - if ( !bfi && st->hTonalMDCTConc != NULL ) { TonalMDCTConceal_SaveTimeSignal( st->hTonalMDCTConc, synthFB, hTcxDec->L_frameTCX ); @@ -681,13 +643,6 @@ void stereo_tcx_core_dec( if ( !bfi ) { -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc - if ( st->enablePlcWaveadjust ) - { - st->hPlcInfo->nbLostCmpt = 0; - } -#endif - if ( param[1 + NOISE_FILL_RANGES] != 0 ) { set_f( pitch_buf, hTcxLtpDec->tcxltp_pitch_int + (float) hTcxLtpDec->tcxltp_pitch_fr / (float) st->pit_res_max, NB_SUBFR16k ); @@ -844,11 +799,7 @@ static void dec_prm_tcx( getTCXMode( st, st, 0 /* <- MCT_flag */ ); /* last_core for error concealment */ -#ifdef FIX_1384_MSAN_stereo_tcx_core_enc if ( st->element_mode != IVAS_CPE_MDCT ) -#else - if ( !st->use_partial_copy && st->element_mode != IVAS_CPE_MDCT ) -#endif { st->last_core_from_bs = get_next_indice( st, 1 ); /* Store decoder memory of last_core */ if ( st->last_core == ACELP_CORE && st->last_core_from_bs != ACELP_CORE ) @@ -874,23 +825,16 @@ static void dec_prm_tcx( } } -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc - if ( !st->use_partial_copy ) + if ( st->element_mode != IVAS_CPE_MDCT ) { -#endif - if ( st->element_mode != IVAS_CPE_MDCT ) - { - getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st ); - } - st->flagGuidedAcelp = 0; + getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st ); + } + st->flagGuidedAcelp = 0; - if ( st->dec_glr ) - { - st->dec_glr_idx = -1; - } -#ifndef FIX_1384_MSAN_stereo_tcx_core_enc + if ( st->dec_glr ) + { + st->dec_glr_idx = -1; } -#endif #ifdef DEBUG_MODE_TCX fprintf( pF, "\t TCX Header: %d bits: %d %d %d %d\n", st->next_bit_pos - start_bit_pos, st->tcxonly, st->core, st->tcxonly ? st->clas_dec : st->hTcxCfg->coder_type, st->hTcxCfg->tcx_curr_overlap_mode ); nbits_tcx = st->next_bit_pos; @@ -912,7 +856,6 @@ static void dec_prm_tcx( * TCX20/10 parameters *--------------------------------------------------------------------------------*/ -#ifdef FIX_1384_MSAN_stereo_tcx_core_enc getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); if ( *total_nbbits - bitsRead[0] < ( st->next_bit_pos - start_bit_pos ) ) @@ -922,27 +865,11 @@ static void dec_prm_tcx( } bitsRead[0] = st->next_bit_pos - start_bit_pos; -#else - if ( st->use_partial_copy == 0 ) - { - getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); - } - - if ( !st->use_partial_copy ) - { - if ( *total_nbbits - bitsRead[0] < ( st->next_bit_pos - start_bit_pos ) ) - { - st->BER_detect = 1; - st->next_bit_pos = start_bit_pos + *total_nbbits - bitsRead[0]; - } - - bitsRead[0] = st->next_bit_pos - start_bit_pos; - } -#endif return; } + /*-----------------------------------------------------------------* * Function stereo_tcx_dec_mode_switch_reconf() * diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 4f6c1f75abf92c556d7095b958fae02551529364..fc63961eda08cc6e81624ab2d2bb6d13171749ad 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -863,23 +863,19 @@ ivas_error IVAS_DEC_FeedFrame_Serial( { ivas_error error; -#ifdef FIX_1388_MSAN_ivas_init_decoder if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( !hIvasDec->isInitialized ) { /* Once first frame is fed, finish initialization in EVS Mono. * In IVAS mode, initialization is done in ivas_dec(). */ if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { -#ifdef FIX_1388_MSAN_ivas_init_decoder hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; -#endif if ( ( error = ivas_init_decoder( hIvasDec->st_ivas ) ) != IVAS_ERR_OK ) { return error; @@ -892,12 +888,7 @@ ivas_error IVAS_DEC_FeedFrame_Serial( st->prev_use_partial_copy = 0; hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = hIvasDec->hVoIP->hCurrentDataUnit->dataSize * FRAMES_PER_SEC; } -#ifndef FIX_1388_MSAN_ivas_init_decoder - else - { - hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; - } -#endif + hIvasDec->isInitialized = true; } } diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 33bef3e67a26bc212898ab133ba1c5a5ad420f4a..ccc96242b19b326a4b65592e24c62e04118e7cb0 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -695,12 +695,7 @@ ivas_error acelp_core_enc( if ( !st->Opt_SC_VBR && ( st->idchan == 0 || st->element_mode != IVAS_CPE_TD || ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD && st->tdm_LRTD_flag ) ) ) { /* Apply a non linearity to the SHB excitation */ - non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - st->element_mode -#endif - ); + non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame, st->element_mode ); } if ( st->core_brate == SID_2k40 || st->core_brate == FRAME_NO_DATA ) diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c index 9a890ae3c9f4deb10580190b4f37b9ebbc844971..87e703d16051d917003691d7ea6f89b87164f69b 100644 --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -332,7 +332,6 @@ void TNSAnalysisStereo( pFilter[0]->order = pFilter[1]->order = maxOrder; } -#ifdef FIX_1349_TNS_CRASH else { pFilter[0]->filterType = TNS_FILTER_OFF; @@ -340,7 +339,6 @@ void TNSAnalysisStereo( sts[0]->hTcxEnc->tnsData[k].nFilters = 0; sts[1]->hTcxEnc->tnsData[k].nFilters = 0; } -#endif } } } diff --git a/lib_enc/enc_acelp_tcx_main.c b/lib_enc/enc_acelp_tcx_main.c index 8851d9be5e0c358e9470583a923ad7836d14c09b..f2dc342a0e0f2854faa2c579cb2aee3b7704a682 100644 --- a/lib_enc/enc_acelp_tcx_main.c +++ b/lib_enc/enc_acelp_tcx_main.c @@ -99,12 +99,7 @@ void enc_acelp_tcx_main( /* Apply non linearity to the SHB excitation */ if ( st->core == ACELP_CORE && st->igf ) { - non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - st->element_mode -#endif - ); + non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame, st->element_mode ); /* update the old_BWE_exc memory */ mvr2r( &old_bwe_exc[L_FRAME32k], st->hBWE_TD->old_bwe_exc, PIT16k_MAX * 2 ); diff --git a/lib_enc/ivas_tcx_core_enc.c b/lib_enc/ivas_tcx_core_enc.c index a2f96032d090dc4cbaaf847febeb2ea9ceef949d..60a79ea77175adc78bb7826d2e48ca883156209c 100644 --- a/lib_enc/ivas_tcx_core_enc.c +++ b/lib_enc/ivas_tcx_core_enc.c @@ -336,9 +336,7 @@ void stereo_tcx_core_enc( } } -#ifdef FIX_1384_MSAN_stereo_tcx_core_enc st->acelp_cfg.midLpc = 0; -#endif last_core_orig = st->last_core; for ( n = 0; n < n_subframes; n++ ) { diff --git a/lib_rend/ivas_dirac_ana.c b/lib_rend/ivas_dirac_ana.c index 973182504a5cca5f4ab1d3949a9d124f22567756..73c2db15c66c5e3f8ea51c99a22a9844e2cd0381 100644 --- a/lib_rend/ivas_dirac_ana.c +++ b/lib_rend/ivas_dirac_ana.c @@ -231,17 +231,14 @@ void ivas_dirac_ana( float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; - /* Estimate MASA parameters from the SBA signals */ ivas_dirac_param_est_ana( hDirAC, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame ); -#ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hDirAC->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hDirAC->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } -#endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hDirAC->hMasaOut, hDirAC->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); diff --git a/lib_rend/ivas_masa_merge.c b/lib_rend/ivas_masa_merge.c index 997cdc84d156e3f5efa171a446baf87e2bc75f7f..4432133cd4206f10ba9d42cafe73ded976b474b3 100644 --- a/lib_rend/ivas_masa_merge.c +++ b/lib_rend/ivas_masa_merge.c @@ -37,9 +37,7 @@ #include "ivas_prot.h" #include "ivas_cnst.h" #include "prot.h" -#ifdef NONBE_1344_REND_MASA_LOW_FS #include "ivas_rom_com.h" -#endif #include "wmc_auto.h" @@ -329,9 +327,7 @@ ivas_error masaPrerendOpen( { MASA_PREREND_HANDLE hMasaPrerend; int16_t i; -#ifdef NONBE_1344_REND_MASA_LOW_FS int16_t maxBin; -#endif ivas_error error; error = IVAS_ERR_OK; @@ -342,7 +338,6 @@ ivas_error masaPrerendOpen( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA prerenderer\n" ) ); } -#ifdef NONBE_1344_REND_MASA_LOW_FS /* Determine the number of bands and band grouping */ hMasaPrerend->nbands = MASA_FREQUENCY_BANDS; mvs2s( MASA_band_grouping_24, hMasaPrerend->band_grouping, MASA_FREQUENCY_BANDS + 1 ); @@ -357,7 +352,6 @@ ivas_error masaPrerendOpen( break; } } -#endif hMasaPrerend->num_Cldfb_instances = numTransports; for ( i = 0; i < hMasaPrerend->num_Cldfb_instances; i++ ) diff --git a/lib_rend/ivas_mcmasa_ana.c b/lib_rend/ivas_mcmasa_ana.c index 2f67607e9457a4ee100cceed1d482183c5fd0479..1ed545b4fe13a2493b9341ad3a358fc6ed11a27d 100644 --- a/lib_rend/ivas_mcmasa_ana.c +++ b/lib_rend/ivas_mcmasa_ana.c @@ -393,13 +393,11 @@ void ivas_mcmasa_ana( /* Analysis */ ivas_mcmasa_param_est_ana( hMcMasa, data_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_inp ); -#ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hMcMasa->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hMcMasa->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } -#endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hMcMasa->hMasaOut, hMcMasa->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); @@ -1141,7 +1139,6 @@ void ivas_create_masa_out_meta( } -#ifdef NONBE_1344_REND_MASA_LOW_FS /*------------------------------------------------------------------------- * ivas_masa_zero_high_bands() * @@ -1173,4 +1170,3 @@ void ivas_masa_zero_high_bands( return; } -#endif diff --git a/lib_rend/ivas_omasa_ana.c b/lib_rend/ivas_omasa_ana.c index 566099d5b7ee1eb3f4f555aa5eb1ed3e0d91ad3a..d43c24f63b4cc17b1af58d6a2ffe9b22bb378c1a 100644 --- a/lib_rend/ivas_omasa_ana.c +++ b/lib_rend/ivas_omasa_ana.c @@ -261,13 +261,11 @@ void ivas_omasa_ana( /* Estimate MASA parameters from the objects */ ivas_omasa_param_est_ana( hOMasa, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_ism ); -#ifdef NONBE_1344_REND_MASA_LOW_FS /* Add zeros to higher bands in case of lower sampling rates */ if ( hOMasa->nbands < MASA_FREQUENCY_BANDS ) { ivas_masa_zero_high_bands( hOMasa->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); } -#endif /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hOMasa->hMasaOut, hOMasa->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index cca2f34dc687444fd290d302ee4f3446b73b9c87..ae80304ee04ae85ea7bf3e40026aa3718a8004a0 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1476,16 +1476,14 @@ void ivas_create_masa_out_meta( float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : Estimated surround coherence */ ); -#ifdef NONBE_1344_REND_MASA_LOW_FS void ivas_masa_zero_high_bands( - const int16_t nbands, /* i : Number of frequency bands with estimated values */ - float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated elevation */ - float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated azimuth */ - float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated direct-to-total ratio */ - float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated spread coherence */ - float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i/o : Estimated surround coherence */ + const int16_t nbands, /* i : Number of frequency bands with estimated values */ + float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: Estimated elevation */ + float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: Estimated azimuth */ + float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: Estimated direct-to-total ratio */ + float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: Estimated spread coherence */ + float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i/o: Estimated surround coherence */ ); -#endif ivas_error ivas_dirac_ana_open( DIRAC_ANA_HANDLE *hDirACPtr, /* i/o: DIRAC data handle pointer */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index ad42bd515eb13c61b99d64bf782991e1003c1318..b9286d3d96b01ae9bddcb24319badb17319c024c 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -898,20 +898,10 @@ ivas_error combine_external_and_head_orientations_rend( int16_t i; sr_pose_pred_axis = DEFAULT_AXIS; -#ifdef FIX_1383_HEAD_TRACK_SANITIZER if ( hHeadTrackData->headRotEnabled ) { headRotQuaternions = hHeadTrackData->headPositions; listenerPos = hHeadTrackData->Pos; -#else - if ( hHeadTrackData != NULL ) - { - if ( hHeadTrackData->headRotEnabled ) - { - headRotQuaternions = hHeadTrackData->headPositions; - listenerPos = hHeadTrackData->Pos; - } -#endif sr_pose_pred_axis = hHeadTrackData->sr_pose_pred_axis; } else if ( hExtOrientationData != NULL ) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index c575a9a60a5da146f9e53d272b0a3959e59e0a06..891f9013e5d6ae0e17cfbbcc37a99e3600acd951 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1527,10 +1527,8 @@ typedef struct ivas_dirac_ana_data_structure typedef struct ivas_masa_prerend_data_structure { -#ifdef NONBE_1344_REND_MASA_LOW_FS int16_t nbands; int16_t band_grouping[MASA_FREQUENCY_BANDS + 1]; -#endif /* CLDFB analysis */ int16_t num_Cldfb_instances; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1904c0a62469ccfbdadc8e8fb72f0cc9bb9834f9..bba3fbb187b09ae7a0bb1502506c125efbb00b99 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7312,19 +7312,11 @@ static void renderMasaToMasa( } /* Compute channel energy for metadata processing */ -#ifdef NONBE_1344_REND_MASA_LOW_FS for ( band_m_idx = 0; band_m_idx < masaInput->hMasaPrerend->nbands; band_m_idx++ ) -#else - for ( band_m_idx = 0; band_m_idx < MASA_FREQUENCY_BANDS; band_m_idx++ ) -#endif { -#ifdef NONBE_1344_REND_MASA_LOW_FS brange[0] = masaInput->hMasaPrerend->band_grouping[band_m_idx]; brange[1] = masaInput->hMasaPrerend->band_grouping[band_m_idx + 1]; -#else - brange[0] = MASA_band_grouping_24[band_m_idx]; - brange[1] = MASA_band_grouping_24[band_m_idx + 1]; -#endif + for ( j = brange[0]; j < brange[1]; j++ ) { for ( i = 0; i < numAnalysisChannels; i++ ) diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 0affb9401c7505ecb162837c60979a18e3e5fb0f..164120d79dba7e7b422967b01a79a287bf68572c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -816,11 +816,7 @@ static ivas_error load_reverb_from_binary( hHrtfStatistics->average_energy_r_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); hHrtfStatistics->inter_aural_coherence_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); -#ifdef FIX_HRTF_LEFTOVERS if ( hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->average_energy_r_dyn == NULL || hHrtfStatistics->inter_aural_coherence_dyn == NULL ) -#else - if ( hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->inter_aural_coherence_dyn == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } diff --git a/scripts/pyivastest/IvasScriptsCommon.py b/scripts/pyivastest/IvasScriptsCommon.py index dd88681f94a041fe8128f05d2cb5c5062c8bbbab..0878fb04371d274d8acedb725697296e8c503d24 100644 --- a/scripts/pyivastest/IvasScriptsCommon.py +++ b/scripts/pyivastest/IvasScriptsCommon.py @@ -647,7 +647,7 @@ def runner_setup(runner, args): "0", jbm_suffix, ] - dec_options = ["-Tracefile", "{dec_file_name}.tracefile_dec", "-VOIP"] + dec_options = ["-Tracefile", "{dec_file_name}.tracefile_dec", "-no_delay_cmp", "-VOIP"] add_to_proc_chain(bs_proc_chain, jbm_cmd, dec_options) if args["sidstart"]: @@ -771,7 +771,7 @@ def analyzer_setup(analyzer, args): "0", jbm_suffix, ] - dec_options = ["-Tracefile", "{dec_file_name}.tracefile_dec", "-VOIP"] + dec_options = ["-Tracefile", "{dec_file_name}.tracefile_dec", "-no_delay_cmp", "-VOIP"] add_to_proc_chain(bs_proc_chain, jbm_cmd, dec_options) if args["sidstart"]: diff --git a/tests/split_rendering/utils.py b/tests/split_rendering/utils.py index ccc6a9b5c8aa6fc231373952097eaa12dff88df2..6c3a43903fc8955449528ee09f1369b898bd251a 100644 --- a/tests/split_rendering/utils.py +++ b/tests/split_rendering/utils.py @@ -38,6 +38,7 @@ from typing import Tuple import numpy as np import pytest +import logging from tests.renderer.utils import ( check_BE, @@ -178,6 +179,7 @@ def run_full_chain_split_rendering( get_ssnr=False, get_odg=False, get_odg_bin=False, + delay_profile: Optional[Path] = None, ) -> str: """ Runs the full split rendering chain consisting of @@ -228,63 +230,80 @@ def run_full_chain_split_rendering( in_meta_files = None # run encoder - cmd = SPLIT_PRE_COD_CMD[:] + enc_cmd = SPLIT_PRE_COD_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[1] = bitrate + enc_cmd[0] += BIN_SUFFIX_MERGETARGET + enc_cmd[0] += binary_suffix + enc_cmd[1] = bitrate # if in REF or CUT creation mode use the comparetestv if test_info.config.option.create_ref or test_info.config.option.create_cut: in_file = FORMAT_TO_FILE_COMPARETEST[in_fmt] truncate_signal(in_file, cut_in_file) - cmd[3] = str(cut_in_file) + enc_cmd[3] = str(cut_in_file) else: - cmd[3] = str(FORMAT_TO_FILE_SMOKETEST[in_fmt]) - cmd[4] = str(ivas_bitstream) + enc_cmd[3] = str(FORMAT_TO_FILE_SMOKETEST[in_fmt]) + enc_cmd[4] = str(ivas_bitstream) if in_meta_files: - cmd[1:1] = in_meta_files - - cmd[1:1] = FORMAT_TO_IVAS_COD_FORMAT[in_fmt] - - run_ivas_isar_enc_cmd(cmd) + enc_cmd[1:1] = in_meta_files + + enc_cmd[1:1] = FORMAT_TO_IVAS_COD_FORMAT[in_fmt] + + run_ivas_isar_enc_cmd(enc_cmd) + + if delay_profile: + rtp_bitstream = ivas_bitstream.with_suffix(".rtpg192") + netsim_cmd = [ + str(TOOLS_DIR / f"networkSimulator_g192{EXE_SUFFIX}"), + str(delay_profile), + str(ivas_bitstream), + str(rtp_bitstream), + str(tmp_dir / "tmp.netsimtrace"), + "1", + "0", + ] + run_cmd(netsim_cmd, test_info=test_info) + ivas_bitstream = rtp_bitstream # decode to split-rendering bitstream - cmd = SPLIT_PRE_DEC_CMD[:] + dec_cmd = SPLIT_PRE_DEC_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[2] = str(pre_trajectory) - cmd[4] = str(render_config) - cmd[6] = str(pre_rend_fr) - cmd[7] = renderer_fmt - cmd[9] = str(ivas_bitstream) - cmd[10] = str(split_bitstream) + dec_cmd[0] += BIN_SUFFIX_MERGETARGET + dec_cmd[0] += binary_suffix + dec_cmd[2] = str(pre_trajectory) + dec_cmd[4] = str(render_config) + dec_cmd[6] = str(pre_rend_fr) + dec_cmd[7] = renderer_fmt + dec_cmd[9] = str(ivas_bitstream) + dec_cmd[10] = str(split_bitstream) if renderer_fmt == "BINAURAL_SPLIT_PCM": - cmd[5:5] = ["-om", str(split_md_file)] + dec_cmd[5:5] = ["-om", str(split_md_file)] + + if delay_profile: + dec_cmd[5:5] = ["-voip"] - run_ivas_isar_dec_cmd(cmd) + run_ivas_isar_dec_cmd(dec_cmd) # run split renderer - cmd = SPLIT_POST_REND_CMD[:] + post_rend_cmd = SPLIT_POST_REND_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[4] = str(split_bitstream) - cmd[6] = renderer_fmt - cmd[8] = str(out_file) - cmd[10] = str(post_trajectory) - cmd[12] = post_rend_fr + post_rend_cmd[0] += BIN_SUFFIX_MERGETARGET + post_rend_cmd[0] += binary_suffix + post_rend_cmd[4] = str(split_bitstream) + post_rend_cmd[6] = renderer_fmt + post_rend_cmd[8] = str(out_file) + post_rend_cmd[10] = str(post_trajectory) + post_rend_cmd[12] = post_rend_fr if renderer_fmt == "BINAURAL_SPLIT_PCM": - cmd[7:7] = ["-im", str(split_md_file)] + post_rend_cmd[7:7] = ["-im", str(split_md_file)] - run_isar_post_rend_cmd(cmd) + run_isar_post_rend_cmd(post_rend_cmd) if test_info.config.option.create_cut: # CUT creation mode will run a comparison with REF @@ -328,8 +347,13 @@ def run_full_chain_split_rendering( for k, v in props.items(): record_property(k, v) - if output_differs: - pytest.fail(f"Output differs: ({reason})") + if output_differs: + logging.error(f"Encoder command line was: {' '.join(enc_cmd)}") + if delay_profile: + logging.error(f"Netsim command line was: {' '.join(netsim_cmd)}") + logging.error(f"Decoder command line was: {' '.join(dec_cmd)}") + logging.error(f"Post renderer command line was: {' '.join(post_rend_cmd)}") + pytest.fail(f"Output differs: ({reason})") return out_file @@ -390,52 +414,52 @@ def run_external_split_rendering( in_meta_files = None # generate split-rendering bitstream - cmd = SPLIT_PRE_REND_CMD[:] + split_pre_cmd = SPLIT_PRE_REND_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[4] = str(render_config) + split_pre_cmd[0] += BIN_SUFFIX_MERGETARGET + split_pre_cmd[0] += binary_suffix + split_pre_cmd[4] = str(render_config) if is_comparetest: in_file = FORMAT_TO_FILE_COMPARETEST[in_fmt] truncate_signal(in_file, cut_in_file) - cmd[6] = str(cut_in_file) + split_pre_cmd[6] = str(cut_in_file) else: - cmd[6] = str(FORMAT_TO_FILE_SMOKETEST[in_fmt]) - cmd[8] = in_fmt - cmd[10] = str(split_bitstream) - cmd[12] = renderer_fmt - cmd[14] = str(pre_trajectory) - cmd[16] = pre_rend_fr + split_pre_cmd[6] = str(FORMAT_TO_FILE_SMOKETEST[in_fmt]) + split_pre_cmd[8] = in_fmt + split_pre_cmd[10] = str(split_bitstream) + split_pre_cmd[12] = renderer_fmt + split_pre_cmd[14] = str(pre_trajectory) + split_pre_cmd[16] = pre_rend_fr if renderer_fmt == "BINAURAL_SPLIT_PCM": - cmd[13:13] = ["-om", str(split_md_file)] + split_pre_cmd[13:13] = ["-om", str(split_md_file)] if in_meta_files: - cmd[9:9] = ["-im", *in_meta_files] + split_pre_cmd[9:9] = ["-im", *in_meta_files] - run_isar_ext_rend_cmd(cmd) + run_isar_ext_rend_cmd(split_pre_cmd) # run split renderer - cmd = SPLIT_POST_REND_CMD[:] + split_post_cmd = SPLIT_POST_REND_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[4] = str(split_bitstream) - cmd[6] = renderer_fmt - cmd[8] = str(out_file) - cmd[10] = str(post_trajectory) - cmd[12] = post_rend_fr + split_post_cmd[0] += BIN_SUFFIX_MERGETARGET + split_post_cmd[0] += binary_suffix + split_post_cmd[4] = str(split_bitstream) + split_post_cmd[6] = renderer_fmt + split_post_cmd[8] = str(out_file) + split_post_cmd[10] = str(post_trajectory) + split_post_cmd[12] = post_rend_fr if renderer_fmt == "BINAURAL_SPLIT_PCM": - cmd[7:7] = ["-im", str(split_md_file)] + split_post_cmd[7:7] = ["-im", str(split_md_file)] if plc_error_pattern: - cmd[1:1] = ["-prbfi", str(plc_error_pattern)] + split_post_cmd[1:1] = ["-prbfi", str(plc_error_pattern)] - run_isar_ext_rend_cmd(cmd) + run_isar_ext_rend_cmd(split_post_cmd) if test_info.config.option.create_cut: # CUT creation mode will run a comparison with REF @@ -483,7 +507,9 @@ def run_external_split_rendering( for k, v in props.items(): record_property(k, v) - if output_differs: - pytest.fail(f"Output differs: ({reason})") + if output_differs: + logging.error(f"Split Pre command line was: {' '.join(split_pre_cmd)}") + logging.error(f"Split Post command line was: {' '.join(split_post_cmd)}") + pytest.fail(f"Output differs: ({reason})") return out_file