From c0b7656c8b7ae3b4e18627c1bfc6905c0155ef5a Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 23 Jan 2025 13:48:11 +0100 Subject: [PATCH 1/4] Update of test_enc_passthrough.py --- tests/test_enc_passthrough.py | 158 +++++++++++++++++++++++----------- 1 file changed, 106 insertions(+), 52 deletions(-) diff --git a/tests/test_enc_passthrough.py b/tests/test_enc_passthrough.py index be9b7909fd..9bccaefa1e 100644 --- a/tests/test_enc_passthrough.py +++ b/tests/test_enc_passthrough.py @@ -42,39 +42,6 @@ BITRATES = [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 1600 BW = [16, 32, 48] FORMAT = [ - ("STEREO","-stereo","stvST{bw}c.wav","STEREO"), - ("SBA1","-sba 1", "stvFOA{bw}c.wav","FOA"), - ("SBA2","-sba 2", "stv2OA{bw}c.wav","HOA2"), - ("SBA3","-sba 3", "stv3OA{bw}c.wav","HOA3"), - ("MC-5_1","-mc 5_1", "stv51MC{bw}c.wav","5_1"), - ("MC-5_1_2","-mc 5_1_2", "stv512MC{bw}c.wav","5_1_2"), - ("MC-5_1_4","-mc 5_1_4", "stv514MC{bw}c.wav","5_1_4"), - ("MC-7_1","-mc 7_1", "stv71MC{bw}c.wav","7_1"), - ("MC-7_1_4","-mc 7_1_4", "stv714MC{bw}c.wav","7_1_4"), - ("ISM1","-ism 1 testv/stvISM1.csv", "stv1ISM{bw}s.wav","EXT"), - ("ISM2","-ism 2 testv/stvISM1.csv testv/stvISM2.csv", "stv2ISM{bw}s.wav","EXT"), - ("ISM3","-ism 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv", "stv3ISM{bw}s.wav","EXT"), - ("ISM4","-ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv", "stv4ISM{bw}s.wav","EXT"), - ("MASA1-1Dir","-masa 1 testv/stv1MASA1TC48c.met","stv1MASA1TC{bw}c.wav","EXT"), - ("MASA1-2Dir","-masa 1 testv/stv2MASA1TC48c.met","stv2MASA1TC{bw}c.wav","EXT"), - ("MASA2-1Dir","-masa 2 testv/stv1MASA2TC48c.met","stv1MASA2TC{bw}c.wav","EXT"), - ("MASA2-2Dir","-masa 2 testv/stv2MASA2TC48c.met","stv2MASA2TC{bw}c.wav","EXT"), - ("OMASA-1-1-1Dir","-ism_masa 1 1 testv/stvISM1.csv testv/stv1MASA1TC48c.met","stvOMASA_1ISM_1MASA1TC{bw}c.wav","BINAURAL"), - ("OMASA-2-1-1Dir","-ism_masa 2 1 testv/stvISM1.csv testv/stvISM2.csv testv/stv1MASA1TC48c.met","stvOMASA_2ISM_1MASA1TC{bw}c.wav","BINAURAL"), - ("OMASA-3-1-1Dir","-ism_masa 3 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv1MASA1TC48c.met","stvOMASA_3ISM_1MASA1TC{bw}c.wav","BINAURAL"), - ("OMASA-4-1-1Dir","-ism_masa 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv1MASA1TC48c.met","stvOMASA_4ISM_1MASA1TC{bw}c.wav","BINAURAL"), - ("OMASA-1-2-1Dir","-ism_masa 1 2 testv/stvISM1.csv testv/stv1MASA2TC48c.met","stvOMASA_1ISM_1MASA2TC{bw}c.wav","BINAURAL"), - ("OMASA-2-2-1Dir","-ism_masa 2 2 testv/stvISM1.csv testv/stvISM2.csv testv/stv1MASA2TC48c.met","stvOMASA_2ISM_1MASA2TC{bw}c.wav","BINAURAL"), - ("OMASA-3-2-1Dir","-ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv1MASA2TC48c.met","stvOMASA_3ISM_1MASA2TC{bw}c.wav","BINAURAL"), - ("OMASA-4-2-1Dir","-ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv1MASA2TC48c.met","stvOMASA_4ISM_1MASA2TC{bw}c.wav","BINAURAL"), - ("OMASA-1-1-2Dir","-ism_masa 1 1 testv/stvISM1.csv testv/stv2MASA1TC48c.met","stvOMASA_1ISM_2MASA1TC{bw}c.wav","BINAURAL"), - ("OMASA-2-1-2Dir","-ism_masa 2 1 testv/stvISM1.csv testv/stvISM2.csv testv/stv2MASA1TC48c.met","stvOMASA_2ISM_2MASA1TC{bw}c.wav","BINAURAL"), - ("OMASA-3-1-2Dir","-ism_masa 3 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA1TC48c.met","stvOMASA_3ISM_2MASA1TC{bw}c.wav","BINAURAL"), - ("OMASA-4-1-2Dir","-ism_masa 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA1TC48c.met","stvOMASA_4ISM_2MASA1TC{bw}c.wav","BINAURAL"), - ("OMASA-1-2-2Dir","-ism_masa 1 2 testv/stvISM1.csv testv/stv2MASA2TC48c.met","stvOMASA_1ISM_2MASA2TC{bw}c.wav","BINAURAL"), - ("OMASA-2-2-2Dir","-ism_masa 2 2 testv/stvISM1.csv testv/stvISM2.csv testv/stv2MASA2TC48c.met","stvOMASA_2ISM_2MASA2TC{bw}c.wav","BINAURAL"), - ("OMASA-3-2-2Dir","-ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA2TC48c.met","stvOMASA_3ISM_2MASA2TC{bw}c.wav","BINAURAL"), - ("OMASA-4-2-2Dir","-ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met","stvOMASA_4ISM_2MASA2TC{bw}c.wav","BINAURAL"), # OSBA only supported for HOA3 in ivas-float-update for now # ("OSBA-1-1","-ism_sba 1 1 testv/stvISM1.csv","stvOSBA_1ISM_FOA{bw}c.wav", "EXT"), # ("OSBA-2-1","-ism_sba 2 1 testv/stvISM1.csv testv/stvISM2.csv","stvOSBA_2ISM_FOA{bw}c.wav", "EXT"), @@ -91,33 +58,120 @@ FORMAT = [ ] test_dict = {} -for fmt, in_fmt, in_file, out_fmt in FORMAT: - for br in BITRATES: - for bw in BW: +sim_opts = "" +eid_opts = "" + +# Stereo +fmt = "STEREO" +in_fmt = "-stereo" +out_fmt = "STEREO" +in_file = "stvST{bw}c.wav" +for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000]: + for bw in [16, 32, 48]: + tag = f"{fmt}-{br}-{bw}" + enc_opts = f"{in_fmt} {br} {bw} testv/{in_file.format(bw=bw)} bit" + dec_opts = f"{out_fmt} {bw} bit out.wav" + test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) + +# SBA +fmt = "SBA{order}" +in_fmt = "-sba {order}" +out_fmt = ["FOA","HOA2","HOA3"] +in_file = ["stvFOA{bw}c.wav", "stv2OA{bw}c.wav", "stv3OA{bw}c.wav"] +for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: + for bw in [16, 32, 48]: + for order in range(0,3): + tag = f"{fmt.format(order=order+1)}-{br}-{bw}" + enc_opts = f"{in_fmt} {br} {bw} testv/{in_file[order].format(bw=bw)} bit" + dec_opts = f"{out_fmt[order]} {bw} bit out.wav" + test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) - # Filter out unsupported bitrate combinations - if fmt == "STEREO" and br > 256000: - continue - if fmt == "ISM1" and br > 128000: - continue - if fmt == "ISM2" and (br < 16400 or br > 256000): +# MC +fmt = "MC-{conf}" +in_fmt = "-mc {conf}" +out_fmt = ["5_1","5_1_2","5_1_4","7_1","7_1_4"] +in_file = ["stv51{bw}c.wav", "stv512{bw}c.wav", "stv514{bw}c.wav", "stv71{bw}c.wav", "stv714{bw}c.wav"] +for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: + for bw in [32, 48]: + for c in range(len(out_fmt)): + if c > 0 and bw == 32: + continue # 32 kHz stv input exists only for 5_1 + tag = f"{fmt.format(conf=out_fmt[c])}-{br}-{bw}" + enc_opts = f"{in_fmt.format(conf=out_fmt[c])} {br} {bw} testv/{in_file[c].format(bw=bw)} bit" + dec_opts = f"{out_fmt[c]} {bw} bit out.wav" + test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) + +# ISM +fmt = "ISM{obj}" +in_fmt = "-ism {obj}" +out_fmt = "EXT" +for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: + for bw in [48]: + for obj in range(4): + if obj == 0 and br > 128000: continue - if fmt == "ISM3" and (br < 24400 or br > 384000): + if obj == 1 and (br < 16400 or br > 256000): continue - if fmt == "ISM4" and br < 24400: + if obj == 2 and (br < 24400 or br > 384000): continue - - # Filter out cases where the input file does not exist for this bandwidth - if not os.path.isfile(os.path.join(SCRIPTS_DIR, f"testv/{in_file.format(bw=bw)}")): + if obj == 2 and br < 24400: continue - - tag = f"{fmt}-{br}-{bw}" - enc_opts = f"{in_fmt} {br} {bw} testv/{in_file.format(bw=bw)} bit" + meta = " ".join([f"testv/stvISM{o}.csv" for o in range(obj)]) + infiles = " ".join([f"testv/stv{o}ISM{bw}s.wav" for o in range(obj)]) + tag = f"{fmt.format(obj=obj+1)}-{br}-{bw}" + enc_opts = f"{in_fmt.format(obj=obj+1)} {meta} {br} {bw} {infiles} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" - sim_opts = "" - eid_opts = "" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) +# MASA +fmt = "MASA{tc}-{dir}Dir" +in_fmt = "-masa {tc}" +out_fmt = "EXT" +for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: + for bw in [16, 32, 48]: + for tc in range(2): + for dir in range(2): + meta = f"testv/stv{dir+1}MASA{tc+1}TC{bw}c.met" + infile = f"stv{dir+1}MASA{tc+1}TC{bw}c.wav" + tag = f"{fmt.format(tc=tc+1, dir=dir+1)}-{br}-{bw}" + enc_opts = f"{in_fmt.format(tc=+1)} {meta} {br} {bw} {infile} bit" + dec_opts = f"{out_fmt} {bw} bit out.wav" + test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) + +# OMASA +fmt = "OMASA-{obj}-{tc}-{dir}Dir" +in_fmt = "-ism_masa {obj} {tc}" +#out_fmt = "EXT" +out_fmt = "BINAURAL" +for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: + for bw in [32, 48]: + for tc in range(2): + for dir in range(2): + for obj in range(4): + meta = " ".join([f"testv/stvISM{o}.csv" for o in range(obj)]) + meta = meta + f" testv/stv{dir+1}MASA{tc+1}TC{bw}c.met" + infile = f"stvOMASA_{obj+1}ISM_{dir+1}MASA{tc+1}TC{bw}c.wav" + tag = f"{fmt.format(obj=obj+1, tc=tc+1, dir=dir+1)}-{br}-{bw}" + enc_opts = f"{in_fmt.format(obj=obj+1, tc=+1)} {meta} {br} {bw} {infile} bit" + dec_opts = f"{out_fmt} {bw} bit out.wav" + test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) + +# OSBA +fmt = "OSBA-{obj}-{order}" +in_fmt = "-ism_sba {obj} {order}" +out_fmt = "EXT" +in_file = ["stvOSBA_{obj}ISM_FOA{bw}c.wav","stvOSBA_{obj}ISM_2OA{bw}c.wav","stvOSBA_{obj}ISM_3OA{bw}c.wav"] +for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: + for bw in [16, 32, 48]: + #for order in range(3): + for order in [2]: # Currently only HOA3 output supported + for obj in range(4): + meta = " ".join([f"testv/stvISM{o}.csv" for o in range(obj)]) + tag = f"{fmt.format(obj=obj+1, order=order+1)}-{br}-{bw}" + enc_opts = f"{in_fmt} {meta} {br} {bw} testv/{in_file[order].format(obj=obj, bw=bw)} bit" + dec_opts = f"{out_fmt} {bw} bit out.wav" + test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) + @pytest.mark.parametrize("test_tag", list(test_dict.keys())) -- GitLab From da621b8dd0c46986740a43a2324292b5b08567c0 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 23 Jan 2025 16:02:33 +0100 Subject: [PATCH 2/4] Fixes for enc-passthrough --- tests/test_enc_passthrough.py | 55 +++++++++++++---------------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/tests/test_enc_passthrough.py b/tests/test_enc_passthrough.py index 9bccaefa1e..d71c10c9d3 100644 --- a/tests/test_enc_passthrough.py +++ b/tests/test_enc_passthrough.py @@ -32,35 +32,20 @@ __doc__ = """ Execute tests specified via a parameter file. """ import pytest +import glob +from pathlib import Path from tests.codec_be_on_mr_nonselection.test_param_file import run_test from tests.conftest import DecoderFrontend, EncoderFrontend -from tests.constants import SCRIPTS_DIR -import os.path - -BITRATES = [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000] -BW = [16, 32, 48] - -FORMAT = [ - # OSBA only supported for HOA3 in ivas-float-update for now - # ("OSBA-1-1","-ism_sba 1 1 testv/stvISM1.csv","stvOSBA_1ISM_FOA{bw}c.wav", "EXT"), - # ("OSBA-2-1","-ism_sba 2 1 testv/stvISM1.csv testv/stvISM2.csv","stvOSBA_2ISM_FOA{bw}c.wav", "EXT"), - # ("OSBA-3-1","-ism_sba 3 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv","stvOSBA_3ISM_FOA{bw}c.wav", "EXT"), - # ("OSBA-4-1","-ism_sba 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv", "stvOSBA_4ISM_FOA{bw}c.wav", "EXT"), - # ("OSBA-1-2","-ism_sba 1 2 testv/stvISM1.csv","stvOSBA_1ISM_2OA{bw}c.wav", "EXT"), - # ("OSBA-2-2","-ism_sba 2 2 testv/stvISM1.csv testv/stvISM2.csv","stvOSBA_2ISM_2OA{bw}c.wav", "EXT"), - # ("OSBA-3-2","-ism_sba 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv","stvOSBA_3ISM_2OA{bw}c.wav", "EXT"), - # ("OSBA-4-2","-ism_sba 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv", "stvOSBA_4ISM_2OA{bw}c.wav", "EXT"), - ("OSBA-1-3","-ism_sba 1 3 testv/stvISM1.csv","stvOSBA_1ISM_3OA{bw}c.wav", "EXT"), - ("OSBA-2-3","-ism_sba 2 3 testv/stvISM1.csv testv/stvISM2.csv","stvOSBA_2ISM_3OA{bw}c.wav", "EXT"), - ("OSBA-3-3","-ism_sba 3 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv","stvOSBA_3ISM_3OA{bw}c.wav", "EXT"), - ("OSBA-4-3","-ism_sba 4 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv", "stvOSBA_4ISM_3OA{bw}c.wav", "EXT"), -] +from tests.constants import TESTV_DIR + test_dict = {} sim_opts = "" eid_opts = "" +testv_files = [Path(f).name for f in glob.glob(str(TESTV_DIR.joinpath("*.wav")))] + # Stereo fmt = "STEREO" in_fmt = "-stereo" @@ -82,7 +67,7 @@ for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 16000 for bw in [16, 32, 48]: for order in range(0,3): tag = f"{fmt.format(order=order+1)}-{br}-{bw}" - enc_opts = f"{in_fmt} {br} {bw} testv/{in_file[order].format(bw=bw)} bit" + enc_opts = f"{in_fmt.format(order=order+1)} {br} {bw} testv/{in_file[order].format(bw=bw)} bit" dec_opts = f"{out_fmt[order]} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) @@ -90,12 +75,12 @@ for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 16000 fmt = "MC-{conf}" in_fmt = "-mc {conf}" out_fmt = ["5_1","5_1_2","5_1_4","7_1","7_1_4"] -in_file = ["stv51{bw}c.wav", "stv512{bw}c.wav", "stv514{bw}c.wav", "stv71{bw}c.wav", "stv714{bw}c.wav"] +in_file = ["stv51MC{bw}c.wav", "stv512MC{bw}c.wav", "stv514MC{bw}c.wav", "stv71MC{bw}c.wav", "stv714MC{bw}c.wav"] for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: for bw in [32, 48]: for c in range(len(out_fmt)): - if c > 0 and bw == 32: - continue # 32 kHz stv input exists only for 5_1 + if in_file[c].format(bw=bw) not in testv_files: + continue tag = f"{fmt.format(conf=out_fmt[c])}-{br}-{bw}" enc_opts = f"{in_fmt.format(conf=out_fmt[c])} {br} {bw} testv/{in_file[c].format(bw=bw)} bit" dec_opts = f"{out_fmt[c]} {bw} bit out.wav" @@ -116,10 +101,10 @@ for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 16000 continue if obj == 2 and br < 24400: continue - meta = " ".join([f"testv/stvISM{o}.csv" for o in range(obj)]) - infiles = " ".join([f"testv/stv{o}ISM{bw}s.wav" for o in range(obj)]) + meta = " ".join([f"testv/stvISM{o+1}.csv" for o in range(obj+1)]) + infile = f"stv{obj+1}ISM{bw}s.wav" tag = f"{fmt.format(obj=obj+1)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(obj=obj+1)} {meta} {br} {bw} {infiles} bit" + enc_opts = f"{in_fmt.format(obj=obj+1)} {meta} {br} {bw} testv/{infile} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) @@ -134,7 +119,7 @@ for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 16000 meta = f"testv/stv{dir+1}MASA{tc+1}TC{bw}c.met" infile = f"stv{dir+1}MASA{tc+1}TC{bw}c.wav" tag = f"{fmt.format(tc=tc+1, dir=dir+1)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(tc=+1)} {meta} {br} {bw} {infile} bit" + enc_opts = f"{in_fmt.format(tc=+1)} {meta} {br} {bw} testv/{infile} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) @@ -148,11 +133,13 @@ for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 16000 for tc in range(2): for dir in range(2): for obj in range(4): - meta = " ".join([f"testv/stvISM{o}.csv" for o in range(obj)]) - meta = meta + f" testv/stv{dir+1}MASA{tc+1}TC{bw}c.met" infile = f"stvOMASA_{obj+1}ISM_{dir+1}MASA{tc+1}TC{bw}c.wav" + if infile not in testv_files: + continue + meta = " ".join([f"testv/stvISM{o+1}.csv" for o in range(obj+1)]) + meta = meta + f" testv/stv{dir+1}MASA{tc+1}TC{bw}c.met" tag = f"{fmt.format(obj=obj+1, tc=tc+1, dir=dir+1)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(obj=obj+1, tc=+1)} {meta} {br} {bw} {infile} bit" + enc_opts = f"{in_fmt.format(obj=obj+1, tc=+1)} {meta} {br} {bw} testv/{infile} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) @@ -166,9 +153,9 @@ for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 16000 #for order in range(3): for order in [2]: # Currently only HOA3 output supported for obj in range(4): - meta = " ".join([f"testv/stvISM{o}.csv" for o in range(obj)]) + meta = " ".join([f"testv/stvISM{o+1}.csv" for o in range(obj+1)]) tag = f"{fmt.format(obj=obj+1, order=order+1)}-{br}-{bw}" - enc_opts = f"{in_fmt} {meta} {br} {bw} testv/{in_file[order].format(obj=obj, bw=bw)} bit" + enc_opts = f"{in_fmt.format(obj=obj+1,order=order+1)} {meta} {br} {bw} testv/{in_file[order].format(obj=obj+1, bw=bw)} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) -- GitLab From 715b72a3297ed2f8cc4088a597e834cae6f11371 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 23 Jan 2025 16:21:24 +0100 Subject: [PATCH 3/4] Fixes for test_enc_passthrough.py --- tests/test_enc_passthrough.py | 66 +++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/tests/test_enc_passthrough.py b/tests/test_enc_passthrough.py index d71c10c9d3..2ba0dff602 100644 --- a/tests/test_enc_passthrough.py +++ b/tests/test_enc_passthrough.py @@ -39,6 +39,10 @@ from tests.codec_be_on_mr_nonselection.test_param_file import run_test from tests.conftest import DecoderFrontend, EncoderFrontend from tests.constants import TESTV_DIR +NUMBER_OF_MASA_TCS = 2 +NUMBER_OF_MASA_DIRS = 2 +NUMBER_OF_SBA_ORDERS = 3 +NUMBER_OF_OBJECTS = 4 test_dict = {} sim_opts = "" @@ -65,10 +69,10 @@ out_fmt = ["FOA","HOA2","HOA3"] in_file = ["stvFOA{bw}c.wav", "stv2OA{bw}c.wav", "stv3OA{bw}c.wav"] for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: for bw in [16, 32, 48]: - for order in range(0,3): - tag = f"{fmt.format(order=order+1)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(order=order+1)} {br} {bw} testv/{in_file[order].format(bw=bw)} bit" - dec_opts = f"{out_fmt[order]} {bw} bit out.wav" + for order in range(1, NUMBER_OF_SBA_ORDERS + 1): + tag = f"{fmt.format(order=order)}-{br}-{bw}" + enc_opts = f"{in_fmt.format(order=order)} {br} {bw} testv/{in_file[order-1].format(bw=bw)} bit" + dec_opts = f"{out_fmt[order-1]} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) # MC @@ -92,19 +96,19 @@ in_fmt = "-ism {obj}" out_fmt = "EXT" for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: for bw in [48]: - for obj in range(4): - if obj == 0 and br > 128000: + for obj in range(1, NUMBER_OF_OBJECTS + 1): + if obj == 1 and br > 128000: continue - if obj == 1 and (br < 16400 or br > 256000): + if obj == 2 and (br < 16400 or br > 256000): continue - if obj == 2 and (br < 24400 or br > 384000): + if obj == 3 and (br < 24400 or br > 384000): continue - if obj == 2 and br < 24400: + if obj == 4 and br < 24400: continue - meta = " ".join([f"testv/stvISM{o+1}.csv" for o in range(obj+1)]) - infile = f"stv{obj+1}ISM{bw}s.wav" - tag = f"{fmt.format(obj=obj+1)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(obj=obj+1)} {meta} {br} {bw} testv/{infile} bit" + meta = " ".join([f"testv/stvISM{o}.csv" for o in range(1, obj + 1)]) + infile = f"stv{obj}ISM{bw}s.wav" + tag = f"{fmt.format(obj=obj)}-{br}-{bw}" + enc_opts = f"{in_fmt.format(obj=obj)} {meta} {br} {bw} testv/{infile} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) @@ -114,12 +118,12 @@ in_fmt = "-masa {tc}" out_fmt = "EXT" for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: for bw in [16, 32, 48]: - for tc in range(2): - for dir in range(2): - meta = f"testv/stv{dir+1}MASA{tc+1}TC{bw}c.met" - infile = f"stv{dir+1}MASA{tc+1}TC{bw}c.wav" - tag = f"{fmt.format(tc=tc+1, dir=dir+1)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(tc=+1)} {meta} {br} {bw} testv/{infile} bit" + for tc in range(1, NUMBER_OF_MASA_TCS + 1): + for dir in range(1, NUMBER_OF_MASA_DIRS + 1): + meta = f"testv/stv{dir}MASA{tc}TC{bw}c.met" + infile = f"stv{dir}MASA{tc}TC{bw}c.wav" + tag = f"{fmt.format(tc=tc, dir=dir)}-{br}-{bw}" + enc_opts = f"{in_fmt.format(tc=tc)} {meta} {br} {bw} testv/{infile} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) @@ -130,16 +134,16 @@ in_fmt = "-ism_masa {obj} {tc}" out_fmt = "BINAURAL" for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: for bw in [32, 48]: - for tc in range(2): - for dir in range(2): - for obj in range(4): - infile = f"stvOMASA_{obj+1}ISM_{dir+1}MASA{tc+1}TC{bw}c.wav" + for tc in range(1, NUMBER_OF_MASA_TCS + 1): + for dir in range(1, NUMBER_OF_MASA_DIRS + 1): + for obj in range(1, NUMBER_OF_OBJECTS + 1): + infile = f"stvOMASA_{obj}ISM_{dir}MASA{tc}TC{bw}c.wav" if infile not in testv_files: continue - meta = " ".join([f"testv/stvISM{o+1}.csv" for o in range(obj+1)]) - meta = meta + f" testv/stv{dir+1}MASA{tc+1}TC{bw}c.met" - tag = f"{fmt.format(obj=obj+1, tc=tc+1, dir=dir+1)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(obj=obj+1, tc=+1)} {meta} {br} {bw} testv/{infile} bit" + meta = " ".join([f"testv/stvISM{o}.csv" for o in range(1, obj + 1)]) + meta = meta + f" testv/stv{dir}MASA{tc}TC{bw}c.met" + tag = f"{fmt.format(obj=obj, tc=tc, dir=dir)}-{br}-{bw}" + enc_opts = f"{in_fmt.format(obj=obj, tc=tc)} {meta} {br} {bw} testv/{infile} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) @@ -152,10 +156,10 @@ for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 16000 for bw in [16, 32, 48]: #for order in range(3): for order in [2]: # Currently only HOA3 output supported - for obj in range(4): - meta = " ".join([f"testv/stvISM{o+1}.csv" for o in range(obj+1)]) - tag = f"{fmt.format(obj=obj+1, order=order+1)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(obj=obj+1,order=order+1)} {meta} {br} {bw} testv/{in_file[order].format(obj=obj+1, bw=bw)} bit" + for obj in range(1, NUMBER_OF_OBJECTS + 1): + meta = " ".join([f"testv/stvISM{o}.csv" for o in range(1, obj + 1)]) + tag = f"{fmt.format(obj=obj, order=order)}-{br}-{bw}" + enc_opts = f"{in_fmt.format(obj=obj,order=order)} {meta} {br} {bw} testv/{in_file[order].format(obj=obj, bw=bw)} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) -- GitLab From 07626119d6964393c9f1ee81aa5fd9a6e24f6fa3 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 23 Jan 2025 16:25:15 +0100 Subject: [PATCH 4/4] Fixes for test_enc_passthrough.py - 2 --- tests/test_enc_passthrough.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_enc_passthrough.py b/tests/test_enc_passthrough.py index 2ba0dff602..17bd6cb8aa 100644 --- a/tests/test_enc_passthrough.py +++ b/tests/test_enc_passthrough.py @@ -154,12 +154,12 @@ out_fmt = "EXT" in_file = ["stvOSBA_{obj}ISM_FOA{bw}c.wav","stvOSBA_{obj}ISM_2OA{bw}c.wav","stvOSBA_{obj}ISM_3OA{bw}c.wav"] for br in [13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000]: for bw in [16, 32, 48]: - #for order in range(3): - for order in [2]: # Currently only HOA3 output supported + #for order in range(1, NUMBER_OF_SBA_ORDERS + 1): + for order in [3]: # Currently only HOA3 output supported for obj in range(1, NUMBER_OF_OBJECTS + 1): meta = " ".join([f"testv/stvISM{o}.csv" for o in range(1, obj + 1)]) tag = f"{fmt.format(obj=obj, order=order)}-{br}-{bw}" - enc_opts = f"{in_fmt.format(obj=obj,order=order)} {meta} {br} {bw} testv/{in_file[order].format(obj=obj, bw=bw)} bit" + enc_opts = f"{in_fmt.format(obj=obj,order=order)} {meta} {br} {bw} testv/{in_file[order-1].format(obj=obj, bw=bw)} bit" dec_opts = f"{out_fmt} {bw} bit out.wav" test_dict[tag] = (enc_opts, dec_opts, sim_opts, eid_opts) -- GitLab