Commit 2f69da05 authored by vaclav's avatar vaclav
Browse files
parents 958d6e8b eae9faa0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -143,6 +143,8 @@ if __name__ == "__main__":
            ax.set_title(fmt)
            ax.legend(loc="best")
            ax.set_xlabel(measure_label)
            if "DIFF" in measure_label:
                ax.set_xticks(range(len(limits_labels)), limits_labels, rotation=35)
            ax.set_ylabel("Number of test cases")

            fig.set_figheight(4)
+12 −2
Original line number Diff line number Diff line
@@ -134,15 +134,25 @@ class IvasLogger(logging.Logger):


def getIvasLogger(name=None):
    try:
        # Python 3.13+
        acquireLock, releaseLock = logging._prepareFork, logging._afterFork
    except AttributeError:
        # Python <= 3.12
        acquireLock, releaseLock = logging._acquireLock, logging._releaseLock

    logging_class = logging.getLoggerClass()
    logging._acquireLock()

    acquireLock()

    try:
        logging.setLoggerClass(IvasLogger)
        logger = logging.getLogger(name)
        logging.setLoggerClass(logging_class)
        return logger

    finally:
        logging._releaseLock()
        releaseLock()


class IvasBaseClass(object):
+18 −3
Original line number Diff line number Diff line
@@ -325,22 +325,37 @@ def run_renderer(
            odg_ref = out_file_ref[0:-4] + ".BINAURAL.wav"

            if out_fmt not in PEAQ_SUPPORTED_FMT:
                    # Render test to BINAURAL
                    if in_fmt in PEAQ_SUPPORTED_FMT:
                        new_fmt = in_fmt # MONO or STEREO
                    else:
                        # If input is META which contains stereo, new_fmt needs to be STEREO.
                        if in_fmt == "META":
                            with open(in_file,"r") as scene:
                                if "STEREO" in scene.read():
                                    new_fmt = "STEREO"
                                else:
                                    new_fmt = "BINAURAL"
                        else:
                            new_fmt = "BINAURAL"

                    # Render test to PEAQ supported format (MONO, STEREO or BINAURAL)
                    cmd2 = RENDERER_CMD[:]
                    cmd2[2] = str(out_file)  # in_file
                    cmd2[4] = str(out_fmt)   # in_fmt
                    cmd2[6] = odg_test       # out_file
                    cmd2[8] = "BINAURAL"     # out_fmt
                    cmd2[8] = new_fmt        # out_fmt
                    cmd2[10] = str(sr)
                    cmd2[0] += BIN_SUFFIX_MERGETARGET # Use IVAS_rend_ref for re-rendering
                    cmd2[0] += binary_suffix
                    if "MASA" in str(out_fmt):
                        cmd2.extend(["-im", out_file + ".met"])
                    run_cmd(cmd2, env)

                    # Render ref to BINAURAL with same settings as test
                    cmd2[2] = str(out_file_ref)  # in_file
                    cmd2[6] = odg_ref            # out_file
                    run_cmd(cmd2, env)
                    out_fmt_bin = "BINAURAL"
                    out_fmt_bin = new_fmt
            else:
                out_fmt_bin = out_fmt
                odg_test = out_file