Commit b9fe9995 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

update as per latest main

parents f4e4d173 b726dd64
Loading
Loading
Loading
Loading
Loading
+70 −0
Original line number Diff line number Diff line
#!/usr/bin/env python3
"""
   (C) 2022-2023 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 numpy as np


ERR_MAGIC_NUM_DLY_PROF = -1
ERR_MAGIC_NUM_G192 = 27424


def combine_error_profiles(genpatt_file, jbm_dly_profile, output_file):
    ep = np.fromfile(genpatt_file, dtype="int16")
    with open(jbm_dly_profile) as f:
        dly = np.asarray([int(l.strip()) for l in f.readlines()])

    # if one wants to differently-sized files, add wraparound/shorten logic here
    # in ci, file lengths will match
    assert len(ep) == len(dly)

    # remove lost frames already in the dly profile
    # replace with no delay (not there in the profile files, except the all-zero one)
    err_idx = np.where(dly == ERR_MAGIC_NUM_DLY_PROF)[0]
    dly[err_idx] = 0

    # insert lost frames based on .g192 file
    err_idx = np.where(ep == ERR_MAGIC_NUM_G192)[0]
    dly[err_idx] = -1
    
    with open(output_file, "w") as f:
        for d in dly:
            f.write(f"{int(d)}\n")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("genpatt_file")
    parser.add_argument("jbm_dly_profile")
    parser.add_argument("output_file")
    args = parser.parse_args()

    combine_error_profiles(**vars(args))
+9 −6
Original line number Diff line number Diff line
@@ -40,19 +40,21 @@ from collect_artifacts import (
    find_failed_files_for_sanitizer_test,
    collect_for_sanitizer_test,
)
from combine_genpatt_and_jbm_profile import combine_error_profiles


SCRIPT_DIR = pathlib.Path("./scripts").resolve()
DURATION = "120"
CFG = "ci_linux_ltv.json"
SUPPORTED_TESTS = ["CLANG1", "CLANG2", "CLANG3", "VALGRIND"]
EP_FILE = "ep_015.g192"
GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {int(DURATION) * 50} {EP_FILE}"
EIDXOR_CMD = "eid-xor -vbr -fer {bitstream} {ep_file} {out_file}"
DLY_PROFILE_IN = SCRIPT_DIR.joinpath("dly_error_profiles/dly_error_profile_5.dat")
DLY_PROFILE_OUT = "dly_profile.dat"
N_FRAMES_DLY_PROFILE = 7500
GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {N_FRAMES_DLY_PROFILE} {EP_FILE}"
MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"]
AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"]

SCRIPT_DIR = pathlib.Path("./scripts").resolve()

CONSOLE_OUT_FILE = "output_san.txt"


@@ -186,6 +188,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr

    # generate error pattern
    subprocess.call(GENPATT_CMD.split())
    combine_error_profiles(EP_FILE, DLY_PROFILE_IN, DLY_PROFILE_OUT)

    # cleanup to avoid script errors
    # we want "logs" and "dec" subfolders to be empty -> delete "dec" and rename "log"
@@ -203,10 +206,10 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr
            # need empty log folder to avoid crashes
            path.mkdir()

    cmd_fec = cmd_no_fec + ["--decoder_only", "-f", EP_FILE]
    cmd_fec = cmd_no_fec + ["--decoder_only", "-J", DLY_PROFILE_OUT]
    print(
        "======== Script command line WITH plc: ========\n{}".format(
            " ".join(cmd_no_fec)
            " ".join(cmd_fec)
        )
    )

+4 −0
Original line number Diff line number Diff line
@@ -328,6 +328,10 @@ typedef enum
#define ISM_Q_STEP                              2.5f
#define ISM_Q_STEP_BORDER                       5.0f

#ifdef NONBE_FIX_944_FEC_OMASA_1SEP_OBJ_MASA
#define ISM_FEC_MAX                             10
#endif

#define ISM_RADIUS_NBITS                        6 
#define ISM_RADIUS_MIN                          0.0f
#define ISM_RADIUS_DELTA                        0.25f /* Max radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */
+2 −3
Original line number Diff line number Diff line
@@ -151,8 +151,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
/*#define SPLIT_REND_WITH_HEAD_ROT  */                  /* Dlb,FhG: Split Rendering contributions 21 and 35 */

#define FIX_911_REMOVE_CREND_DUPLICATION                /* VA: issue 911: resolve duplication of CRend binaural external renderer function */
#define FIX_938_GCC_12_WARNINGS                         /* VA: issue #938: remove set_f(.,.,0) call in which length is always 0 to remove GCC 12.0 warning */

/* #################### End BE switches ################################## */

@@ -161,8 +159,9 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER                    /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/
#define NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW           /* FhG: issue 943: fix crash in BW switchin from WB in MDCT-Stereo core encoder */
#define NONBE_FIX_944_FEC_OMASA_1SEP_OBJ_MASA                 /* Nokia: issue 944: fix FEC error in OMASA */
#define NONBE_FIX_949_MC_5MS_FRAMING                          /* Dlb: issue 949: fix for issue 949, distorted output in MC mode with 5ms framing*/

/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+0 −4
Original line number Diff line number Diff line
@@ -242,10 +242,6 @@ void transf_cdbk_enc(
        x_tran[i] = (float) ( x_norm[i] );
    }

#ifndef FIX_938_GCC_12_WARNINGS
    set_f( x_tran + Nsv * WIDTH_BAND, 0.0f, L_SUBFR - WIDTH_BAND * Nsv );

#endif
    if ( st->coder_type != INACTIVE && st->core_brate >= MIN_BRATE_AVQ_EXC && st->core_brate <= MAX_BRATE_AVQ_EXC_TD && !harm_flag_acelp )
    {
        mvr2r( x_tran, code_preQ, L_SUBFR );
Loading