Commit da621b8d authored by norvell's avatar norvell
Browse files

Fixes for enc-passthrough

parent c0b7656c
Loading
Loading
Loading
Loading
+21 −34
Original line number Diff line number Diff line
@@ -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)