Commit 1ea21c67 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 1255-object-editing-broken-in-jbm-2

parents 53b936c3 4a499d0d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ SUBPAGE_TMPL_CSS = """
.tbase .tleft{text-align:left;horizontal-align:bottom}
.tbase .tincrease{text-align:left;background-color:#ff5500;border-color:inherit;font-weight:bold;}
.tbase .treduce{text-align:left;background-color:#acff00;border-color:inherit;font-weight:bold;}

thead {position:sticky;top:0;background-color:#ffffffd0}
.arrowup {font-weight:bold;font-size:200%;}
.arrowdown {font-weight:bold;font-size:200%;}
</style>
+3 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ if __name__ == "__main__":
            "MLD": ("MLD", [0, 1, 2, 3, 4, 5, 10, 20, math.inf]),
            "DIFF": ("MAXIMUM ABS DIFF", [0, 16, 256, 1024, 2048, 4096, 8192, 16384, 32769]),
            "SSNR": ("MIN_SSNR", [-math.inf, 0, 10, 20, 30, 40, 40, 50, 60, 100]),
            "ODG": ("MIN_ODG", [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]),
            "ODG": ("MIN_ODG", [-5, -2, -1, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.5]),
        }
    (measure_label, limits) = limits_per_measure[measure]

@@ -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):
+49 −1
Original line number Diff line number Diff line
@@ -315,6 +315,51 @@ def run_renderer(
        # CUT creation mode will run a comparison with REF
        out_file_ref = str(OUTPUT_PATH_REF.joinpath(out_file_stem))

        # Check if we need to render to mono, stereo or binaural for PEAQ comparison
        odg_input = None
        odg_test = None
        odg_ref = None
        if get_odg:
            odg_input = out_file_ref[0:-4] + ".INPUT.BINAURAL.wav"
            odg_test = str(out_file)[0:-4] + ".BINAURAL.wav"
            odg_ref = out_file_ref[0:-4] + ".BINAURAL.wav"

            if out_fmt not in PEAQ_SUPPORTED_FMT:
                    if in_fmt in PEAQ_SUPPORTED_FMT:
                        new_fmt = in_fmt # MONO or STEREO
                    else:
                        new_fmt = "BINAURAL"
                    # Render test to 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] = new_fmt        # out_fmt
                    cmd2[10] = str(sr)
                    cmd2[0] += BIN_SUFFIX_MERGETARGET # Use IVAS_rend_ref for re-rendering
                    cmd2[0] += binary_suffix
                    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 = new_fmt
            else:
                out_fmt_bin = out_fmt
                odg_test = out_file
                odg_ref = out_file_ref

            if out_fmt_bin != in_fmt:
                # Render input to match out_fmt_bin using same config as input, but with IVAS_rend_ref
                cmd[0] += BIN_SUFFIX_MERGETARGET
                cmd[0] += binary_suffix
                cmd[6] = odg_input       # out_file
                cmd[8] = out_fmt_bin     # out_fmt
                run_cmd(cmd, env)
            else:
                odg_input = in_file

        # see constants.py
        ref_fs = int(cmd[10]) * 1000
        output_differs, reason = cmp_pcm(
@@ -326,7 +371,10 @@ def run_renderer(
            mld_lim=get_mld_lim,
            abs_tol=abs_tol,
            get_ssnr=get_ssnr,
            get_odg=get_ssnr,
            get_odg=get_odg,
            odg_input=odg_input,
            odg_test=odg_test,
            odg_ref=odg_ref,            
        )

        props = parse_properties(reason, output_differs, props_to_record)