Loading ci/create_trajectories.py +19 −2 Original line number Diff line number Diff line 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 Loading @@ -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 ci/run_scheduled_sanitizer_test.py +46 −37 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import argparse import pathlib import subprocess import sys import os import numpy as np import json Loading @@ -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() Loading Loading @@ -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]) Loading @@ -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" Loading Loading @@ -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") Loading @@ -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 Loading @@ -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=",") 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 = [ Loading Loading @@ -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( Loading Loading @@ -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())) lib_com/edct.c +3 −38 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ #include "prot.h" #include "wmc_auto.h" #include <math.h> /* for cosf, sinf */ #include <assert.h> static ivas_error get_edct_table( const float **edct_table, Loading Loading @@ -226,7 +227,6 @@ void edst( return; } #define FAST_EDXT /* optimized FFT-based DCT/DST algorithm */ /*-------------------------------------------------------------------------* * edxt() Loading @@ -243,9 +243,8 @@ void edxt( ) { const float pi_len = EVS_PI / length; int16_t k, m; int16_t k; #ifdef FAST_EDXT if ( kernelType == MDST_II || kernelType == MDCT_II ) { const int16_t Nm1 = length - 1; Loading Loading @@ -351,42 +350,8 @@ void edxt( } } else #endif if ( kernelType & 1 ) /* DST */ { const float offK = ( kernelType == MDST_II && synthesis ? 0.5f : 1.0f - 0.5f * ( kernelType >> 1 ) ); const float offM = ( kernelType == MDST_II && synthesis ? 1.0f : 0.5f ); for ( k = 0; k < length; k++ ) { y[k] = 0.f; for ( m = 0; m < length; m++ ) { y[k] += x[m] * sinf( pi_len * ( m + offM ) * ( k + offK ) ); } } if ( offK == 1.f ) { y[length - 1] *= 0.5f; /* scale Nyquist sample */ } } else /* kernelType 0, 2: DCT */ { const float offK = ( kernelType == MDCT_II && synthesis ? 0.5f : 0.5f - 0.5f * ( kernelType >> 1 ) ); const float offM = ( kernelType == MDCT_II && synthesis ? 0.0f : 0.5f ); for ( k = 0; k < length; k++ ) { y[k] = 0.f; for ( m = 0; m < length; m++ ) { y[k] += x[m] * cosf( pi_len * ( m + offM ) * ( k + offK ) ); } } if ( offK == 0.f ) { y[0] *= 0.5f; /* scale lowest (i.e. DC) sample */ } assert( !"Unsupported Kernel type in edxt()" ); } v_multc( y, ( kernelType == MDCT_II ? -1.f : 1.f ) * sqrtf( 2.f / length ), y, length ); Loading lib_com/prot.h +6 −8 Original line number Diff line number Diff line Loading @@ -2250,8 +2250,6 @@ ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ Encoder_Struct *st_ivas, /* i/o: encoder state structure */ const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t element_brate /* element bitrate */ Loading lib_com/tcx_utils.c +2 −5 Original line number Diff line number Diff line Loading @@ -568,14 +568,11 @@ void lpc2mdct( if ( noInverse ) { for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ); } assert( !"not supported option in lpc2mdct()" ); } else /* Get amplitude */ { /* Get amplitude */ for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( 1.0f / max( EPSILON, sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ) ); Loading Loading
ci/create_trajectories.py +19 −2 Original line number Diff line number Diff line 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 Loading @@ -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
ci/run_scheduled_sanitizer_test.py +46 −37 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import argparse import pathlib import subprocess import sys import os import numpy as np import json Loading @@ -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() Loading Loading @@ -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]) Loading @@ -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" Loading Loading @@ -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") Loading @@ -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 Loading @@ -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=",") 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 = [ Loading Loading @@ -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( Loading Loading @@ -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()))
lib_com/edct.c +3 −38 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ #include "prot.h" #include "wmc_auto.h" #include <math.h> /* for cosf, sinf */ #include <assert.h> static ivas_error get_edct_table( const float **edct_table, Loading Loading @@ -226,7 +227,6 @@ void edst( return; } #define FAST_EDXT /* optimized FFT-based DCT/DST algorithm */ /*-------------------------------------------------------------------------* * edxt() Loading @@ -243,9 +243,8 @@ void edxt( ) { const float pi_len = EVS_PI / length; int16_t k, m; int16_t k; #ifdef FAST_EDXT if ( kernelType == MDST_II || kernelType == MDCT_II ) { const int16_t Nm1 = length - 1; Loading Loading @@ -351,42 +350,8 @@ void edxt( } } else #endif if ( kernelType & 1 ) /* DST */ { const float offK = ( kernelType == MDST_II && synthesis ? 0.5f : 1.0f - 0.5f * ( kernelType >> 1 ) ); const float offM = ( kernelType == MDST_II && synthesis ? 1.0f : 0.5f ); for ( k = 0; k < length; k++ ) { y[k] = 0.f; for ( m = 0; m < length; m++ ) { y[k] += x[m] * sinf( pi_len * ( m + offM ) * ( k + offK ) ); } } if ( offK == 1.f ) { y[length - 1] *= 0.5f; /* scale Nyquist sample */ } } else /* kernelType 0, 2: DCT */ { const float offK = ( kernelType == MDCT_II && synthesis ? 0.5f : 0.5f - 0.5f * ( kernelType >> 1 ) ); const float offM = ( kernelType == MDCT_II && synthesis ? 0.0f : 0.5f ); for ( k = 0; k < length; k++ ) { y[k] = 0.f; for ( m = 0; m < length; m++ ) { y[k] += x[m] * cosf( pi_len * ( m + offM ) * ( k + offK ) ); } } if ( offK == 0.f ) { y[0] *= 0.5f; /* scale lowest (i.e. DC) sample */ } assert( !"Unsupported Kernel type in edxt()" ); } v_multc( y, ( kernelType == MDCT_II ? -1.f : 1.f ) * sqrtf( 2.f / length ), y, length ); Loading
lib_com/prot.h +6 −8 Original line number Diff line number Diff line Loading @@ -2250,8 +2250,6 @@ ivas_error init_encoder( Encoder_State *st, /* i/o: state structure */ Encoder_Struct *st_ivas, /* i/o: encoder state structure */ const int16_t idchan, /* i : channel ID */ const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ const int16_t interval_SID, /* i : interval for SID update */ const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t element_brate /* element bitrate */ Loading
lib_com/tcx_utils.c +2 −5 Original line number Diff line number Diff line Loading @@ -568,14 +568,11 @@ void lpc2mdct( if ( noInverse ) { for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ); } assert( !"not supported option in lpc2mdct()" ); } else /* Get amplitude */ { /* Get amplitude */ for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( 1.0f / max( EPSILON, sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ) ); Loading