Commit 5dc849b9 authored by Jan Kiene's avatar Jan Kiene
Browse files

remove obsolete file

parent 7a985bd8
Loading
Loading
Loading
Loading

ci/ivas_voip_be_test.sh

deleted100755 → 0
+0 −132
Original line number Diff line number Diff line
#! /usr/bin/bash

# (C) 2022-2024 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.

function usage {
    echo
    echo "Usage:"
    echo "      ivas_voip_be_test.sh [MODE]"
    echo 
    echo "      MODE - test (default) or coverage"
    exit
}

if [ ! -d "lib_com" ]; then
    echo "not in root directory! - please run in IVAS root"
    exit 1
fi

if [ -z "$1" ] || [ "$1" == "test" ]; then
    WORKERS=""
    BUILD=1
    COVERAGE=0
elif [ "$1" == "coverage" ]; then
    WORKERS="-t 1"
    BUILD=0
    COVERAGE=1
else
    usage
fi

if [ $BUILD -eq 1 ];then
    make clean
    make all -j
fi

# Configuration
modes=(
    'stereo_b32_dtx_wb_cbr'
    'stereo_b48_dtx_fb_cbr'
    'ISM4_b48_dtx_fb_cbr'
    'ISM3_b64_dtx_swb_cbr'
    'MASA_1TC_b24_4_dtx_wb_cbr'
    'MASA_2TC_b80_dtx_fb_cbr'
    'MC_5_1_b128_swb_cbr'
    'MC_7_1_b96_wb_cbr'
    'MC_5_1_4_b48_fb_cbr'
    'MC_7_1_4_b160_fb_cbr'
    'OMASA_ISM1_2TC_b512_swb_cbr'
    'OMASA_ISM2_1TC_b24_4_wb_cbr'
    'OMASA_ISM3_2TC_b80_fb_cbr'
    'OMASA_ISM4_1TC_b48_swb_cbr'
    'OSBA_ISM4_HOA2_b512_fb_cbr'
    'OSBA_ISM2_HOA2_b64_wb_cbr'
    'HOA3_b64_swb_cbr'
    'FOA_b256_fb_cbr'
)
limit_input_to_x_seconds=30
verbosity_cmd="-z console"

cfg=./scripts/config/ci_linux.json
dly_profile=./scripts/dly_error_profiles/dly_error_profile_0.dat

output_dir_default="out"
output_dir_voip="out_voip"

# Run the same modes in VoIP and non-VoIP mode with a neutral delay profile
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" -o $output_dir_default | tee voip_be_test_output.txt
mkdir $output_dir_voip
cp -r $output_dir_default/enc $output_dir_voip/enc
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" -o $output_dir_voip -J "$dly_profile" --decoder_only | tee -a voip_be_test_output.txt

# Check if Python scripts above failed. They return status 0 even when running a mode fails, so we have to parse log file
if grep -iq failed voip_be_test_output.txt ; then
    echo "Run errors in runIvasCodec.py"
    exit 1
fi

if [ $COVERAGE -eq 1 ];then
    # Coverage analysis requires only running the codec and may exit before the comparison part
    exit 0
fi

# Set up Python path
python_audio_module_path=$(pwd)/scripts
export PYTHONPATH=$python_audio_module_path:$PYTHONPATH
python_audiofile_script_path=$python_audio_module_path/pyaudio3dtools/audiofile.py

jbm_offset=60
output_dir_default_dec="$output_dir_default"/dec
output_dir_jbm_dec=${output_dir_default_dec/$output_dir_default/$output_dir_voip}

# strip part of filenames
for f in $output_dir_jbm_dec/*.wav; do
    mv $f ${f/_jbm_dly_error_profile_0_dat/}
done

num_diff=0
python3 $python_audio_module_path/batch_comp_audio.py $output_dir_default_dec $output_dir_jbm_dec -ds --tool pyaudio3dtools --test_offset_ms $jbm_offset
num_diff=$?

if [ $num_diff == 0 ]; then
    printf "\n\nAll tested conditions are bit-exact\n" | tee -a voip_be_test_output.txt
else
    printf "\n\nBitexactness problems found!\n" | tee -a voip_be_test_output.txt
    exit 1;
fi