Commit 8592280d authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch 'main' of forge.3gpp.org:ivas-codec-pc/ivas-codec into...

Merge branch 'main' of forge.3gpp.org:ivas-codec-pc/ivas-codec into 935-msan-error-in-sba-decoding-to-binaural_room_reverb
parents 5094da4b 5f5bcd51
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1805,11 +1805,17 @@ coverage-test-on-main-scheduled:
    - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref
    - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref
    - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_cut    
    - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_cut    
    - lcov -c -d obj -o coverage_stv.info # extract coverage of short test vectors here
    - lcov -c -d obj -o coverage_stv.info # extract coverage of short test vectors here
    # remove apps and lib_util files from coverage
    - lcov -r coverage_stv.info "*apps*" -o coverage_stv.info
    - lcov -r coverage_stv.info "*lib_util*" -o coverage_stv.info
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - bash ci/smoke_test.sh coverage
    - bash ci/smoke_test.sh coverage
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_ltv.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_ltv.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - bash ci/ivas_voip_be_test.sh coverage
    - bash ci/ivas_voip_be_test.sh coverage
    - lcov -c -d obj -o coverage.info
    - lcov -c -d obj -o coverage.info
    # remove apps and lib_util files from coverage
    - lcov -r coverage.info "*apps*" -o coverage.info
    - lcov -r coverage.info "*lib_util*" -o coverage.info
    - commit_sha=$(git rev-parse HEAD)
    - commit_sha=$(git rev-parse HEAD)
    - genhtml coverage.info -o coverage -t "Coverage on main @ $commit_sha"
    - genhtml coverage.info -o coverage -t "Coverage on main @ $commit_sha"
    - genhtml coverage_stv.info -o coverage_stv -t "Coverage on main -- short test vectors @ $commit_sha"
    - genhtml coverage_stv.info -o coverage_stv -t "Coverage on main -- short test vectors @ $commit_sha"
+38 −0
Original line number Original line Diff line number Diff line
#!/usr/bin/env python3

import argparse
from xml.etree import ElementTree

"""
Parse a junit report and create a MLD summary report.
"""

# Main routine
if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Parse a junit report and create a MLD summary report.')
    parser.add_argument('xml_report',type=str,help='XML junit report input file, e.g. report-junit.xml')
    parser.add_argument('csv_file',type=str,help='Output CSV file, e.g. mld.csv')
    args = parser.parse_args()
    xml_report = args.xml_report
    csv_file   = args.csv_file
    
    mld = {}

    tree = ElementTree.parse(xml_report)

    testsuite = tree.find(".//testsuite")
    print(f"Found testsuite with {testsuite.get('tests')} tests and {testsuite.get('failures')} failures.")

    testcases = tree.findall(".//testcase")

    with open(csv_file,'w') as outfile:
        for testcase in testcases:
            failure = testcase.find(".//failure")
            if failure is not None:
                system_out = testcase.find(".//system-out")
                for line in system_out.text.split('\n'):
                    if line.startswith('MLD:'):
                        mld_val = float(line.split()[1])
                        fulltestname = testcase.get('file') + "::" + testcase.get('name')
                        mld[fulltestname] = mld_val
                        outfile.write(fulltestname + ';' + str(mld_val)+'\n')

tests/scale_pcm.py

0 → 100755
+38 −0
Original line number Original line Diff line number Diff line
#!/usr/bin/env python3

import os
import sys
import argparse
import pathlib

THIS_PATH = os.path.join(os.getcwd(), __file__)
sys.path.append(os.path.join(os.path.dirname(THIS_PATH), "../scripts"))

import pyaudio3dtools
import pyivastest
import numpy as np
import concurrent.futures


def scale_folder(folder, factor):

    files = list(folder.glob("*.wav"))
    with concurrent.futures.ThreadPoolExecutor() as executor:
        executor.map(scale_file, files, files, [factor] * len(files))

def scale_file(file1, file2, factor = 1.0) -> None:
    """
    Scale file1 to file2
    """
    s1, fs = pyaudio3dtools.audiofile.readfile(file1)
    s2    = s1 * factor; 
    pyaudio3dtools.audiofile.writefile(file2, s2, fs)

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("folder", type=pathlib.Path)
    parser.add_argument("factor", type=float)
    args = parser.parse_args()

    scale_folder(**vars(args))
    sys.exit(0)

tests/test_26444.py

0 → 100644
+94 −0
Original line number Original line Diff line number Diff line
__copyright__ = """
(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.
"""

__doc__ = """
Execute tests specified via a parameter file.
"""

import os
from pathlib import Path
import filecmp
import subprocess
import pytest

test_dict = {}
TEST_DIR = "evs_be_test" 
scripts=["Readme_AMRWB_IO_dec.txt", "Readme_AMRWB_IO_enc.txt", "Readme_EVS_dec.txt","Readme_EVS_enc.txt", "Readme_JBM_dec.txt"]
for s in scripts:
    with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp:
        tag = ""
        enc_opts = ""
        dec_opts = ""
        diff_opts  = ""
        for line in fp.readlines():
            if line.startswith("$ENC_BIN"):
                enc_opts = line
            if line.startswith("$DEC_BIN"):
                dec_opts = line
            if line.startswith("$DIFF_BIN"):
                diff_opts = line[9:]
                tag = s + "--" + diff_opts.split()[1].split('/')[-1]
                if tag in test_dict:
                    print("non-unique tag found - ignoring new entry")
                    continue                
                test_dict[tag] = (enc_opts, dec_opts, diff_opts)
                tag = ""
                enc_opts = ""
                dec_opts = ""
                diff_opts  = ""

@pytest.mark.parametrize("test_tag", list(test_dict.keys()))
def test_evs_26444(test_tag):

    enc_opts, dec_opts, diff_opts = test_dict[test_tag]

    if enc_opts:
        enc_opts = enc_opts.replace("./", TEST_DIR + "/")
        subprocess.run(["./IVAS_cod","-q"] + enc_opts.split()[1:])
    if dec_opts:
        dec_opts = dec_opts.replace("./", TEST_DIR + "/")
        subprocess.run(["./IVAS_dec","-q"] + dec_opts.split()[1:])    
        
    diff_opts = diff_opts.replace("./", TEST_DIR + "/")
    if ';' in diff_opts:
        cmd1, cmd2 = diff_opts.split(';')
        cmd1 = cmd1.split()
        cmd2 = cmd2.split()        
        result1 = filecmp.cmp(cmd1[0], cmd1[1])
        result2 = filecmp.cmp(cmd2[2], cmd2[3])
    else:
        cmd1 = diff_opts.split()
        result1 = filecmp.cmp(cmd1[0], cmd1[1])
        result2 = True
    if not (result1 and result2):
        assert False, "Output differs" 

          
        
 No newline at end of file
+627 −0

File added.

Preview size limit exceeded, changes collapsed.