Loading scripts/ivas_conformance/runConformance.py +21 −5 Original line number Diff line number Diff line Loading @@ -47,9 +47,6 @@ import scipy.signal as sig sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) #from pyaudio3dtools.audiofile import readfile, writefile #from pyaudio3dtools.audioarray import resample def readfile( filename: str, nchannels: int = 1, fs: int = 48000, outdtype="float" Loading Loading @@ -205,6 +202,7 @@ class MLDConformance: # CREATE OUTPUT DIRECTORY STRUCTURE : CLEAN PREV OUTPUT self.outputDir = os.path.join(self.scriptsDir, "CUT_OUTPUTS") if os.path.exists(self.outputDir): if not self.args.dec_for_dut_enc: shutil.rmtree(self.outputDir, ignore_errors=False) os.makedirs(self.outputDir, exist_ok=True) subdirs = ["enc", "dec", "renderer_short", "split_rendering"] Loading @@ -220,6 +218,9 @@ class MLDConformance: def setupDUT(self): self.cut_build_path = args.cut_build_path self.filter = args.filter exe_platform = platform.system() if platform.system() == 'Windows': exe_platform = 'Win32' self.mldbin = os.path.join(self.toolsdir, platform.system(), "mld") self.wavdiffbin = os.path.join(self.toolsdir, platform.system(), "wav-diff") self.CutBins = dict() Loading Loading @@ -434,7 +435,10 @@ class MLDConformance: command = self.reformatCommand(command) command = self.setCommandExec(tag="ENC", command=command) dutEncOutput = self.getOutputFile(command) self.process(command) if not self.args.dec_for_dut_enc: self.process(command=command) assert ".192" in dutEncOutput, "Output file not identified" # Decode the encoded output with Reference decoder Loading Loading @@ -774,6 +778,10 @@ class MLDConformance: for tag in keys: if os.path.exists(self.mldcsv[tag]): mdlValues = np.loadtxt(self.mldcsv[tag], delimiter=" ", dtype=float) bePercent = np.loadtxt(self.sampleStats[tag], delimiter=",", dtype=float, skiprows=1, usecols=3) maxDiff = np.loadtxt(self.sampleStats[tag], delimiter=",", dtype=float, skiprows=1, usecols=1) bePercentAvg = np.average(bePercent) maxDiffmax = np.max(maxDiff)*32768.0 N = mdlValues.shape[0] if N == 0: continue Loading @@ -790,6 +798,8 @@ class MLDConformance: print(f"<{tag}> Frames with MLD <= 1 : {m1} frames ({PCNT(m1)}%)") print(f"<{tag}> Frames with MLD <= 2 : {m2} frames ({PCNT(m2)}%)") print(f"<{tag}> Frames with MLD <= 5 : {m5} frames ({PCNT(m5)}%)") print(f"<{tag}> BE frames percentage = {bePercentAvg}") print(f"<{tag}> max absolute diff = {maxDiffmax}, sample range (-32768, 32767)") print("##########################################################\n") Loading Loading @@ -820,6 +830,12 @@ if __name__ == "__main__": action="store_true", help="Regenerate the encoder reference bitstreams and decoded outputs", ) parser.add_argument( "--dec-for-dut-enc", default=False, action="store_true", help="process dut ENC files with REF decoder", ) parser.add_argument( "--verbose", default=False, Loading Loading
scripts/ivas_conformance/runConformance.py +21 −5 Original line number Diff line number Diff line Loading @@ -47,9 +47,6 @@ import scipy.signal as sig sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) #from pyaudio3dtools.audiofile import readfile, writefile #from pyaudio3dtools.audioarray import resample def readfile( filename: str, nchannels: int = 1, fs: int = 48000, outdtype="float" Loading Loading @@ -205,6 +202,7 @@ class MLDConformance: # CREATE OUTPUT DIRECTORY STRUCTURE : CLEAN PREV OUTPUT self.outputDir = os.path.join(self.scriptsDir, "CUT_OUTPUTS") if os.path.exists(self.outputDir): if not self.args.dec_for_dut_enc: shutil.rmtree(self.outputDir, ignore_errors=False) os.makedirs(self.outputDir, exist_ok=True) subdirs = ["enc", "dec", "renderer_short", "split_rendering"] Loading @@ -220,6 +218,9 @@ class MLDConformance: def setupDUT(self): self.cut_build_path = args.cut_build_path self.filter = args.filter exe_platform = platform.system() if platform.system() == 'Windows': exe_platform = 'Win32' self.mldbin = os.path.join(self.toolsdir, platform.system(), "mld") self.wavdiffbin = os.path.join(self.toolsdir, platform.system(), "wav-diff") self.CutBins = dict() Loading Loading @@ -434,7 +435,10 @@ class MLDConformance: command = self.reformatCommand(command) command = self.setCommandExec(tag="ENC", command=command) dutEncOutput = self.getOutputFile(command) self.process(command) if not self.args.dec_for_dut_enc: self.process(command=command) assert ".192" in dutEncOutput, "Output file not identified" # Decode the encoded output with Reference decoder Loading Loading @@ -774,6 +778,10 @@ class MLDConformance: for tag in keys: if os.path.exists(self.mldcsv[tag]): mdlValues = np.loadtxt(self.mldcsv[tag], delimiter=" ", dtype=float) bePercent = np.loadtxt(self.sampleStats[tag], delimiter=",", dtype=float, skiprows=1, usecols=3) maxDiff = np.loadtxt(self.sampleStats[tag], delimiter=",", dtype=float, skiprows=1, usecols=1) bePercentAvg = np.average(bePercent) maxDiffmax = np.max(maxDiff)*32768.0 N = mdlValues.shape[0] if N == 0: continue Loading @@ -790,6 +798,8 @@ class MLDConformance: print(f"<{tag}> Frames with MLD <= 1 : {m1} frames ({PCNT(m1)}%)") print(f"<{tag}> Frames with MLD <= 2 : {m2} frames ({PCNT(m2)}%)") print(f"<{tag}> Frames with MLD <= 5 : {m5} frames ({PCNT(m5)}%)") print(f"<{tag}> BE frames percentage = {bePercentAvg}") print(f"<{tag}> max absolute diff = {maxDiffmax}, sample range (-32768, 32767)") print("##########################################################\n") Loading Loading @@ -820,6 +830,12 @@ if __name__ == "__main__": action="store_true", help="Regenerate the encoder reference bitstreams and decoded outputs", ) parser.add_argument( "--dec-for-dut-enc", default=False, action="store_true", help="process dut ENC files with REF decoder", ) parser.add_argument( "--verbose", default=False, Loading