Commit 23d83be2 authored by vaclav's avatar vaclav
Browse files
parents e2ea4d39 ce97dbf5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ Comparing:

<br>
<h2><a href="summary_{job_name}.html">Summary page</a></h2>
<h2><a href="summary__split_{job_name}.html">Split comparison summary page</a></h2>
<br>
<br>

+31 −30
Original line number Diff line number Diff line
@@ -4,11 +4,11 @@ from typing import List
from create_report_pages import SUBPAGE_TMPL_CSS, FORMATS


title = {
TITLE_4_MEASURE = {
    "MLD": "Maximum MLD across channels",
    "DIFF": "Maximim absolute difference across channels",
    "SSNR": "Minimum SSNR across channels",
    "ODG": "Minimum PEAQ ODG across channels",
    "MAX_ABS_DIFF": "Maximum absolute difference across channels",
    "MIN_SSNR": "Minimum SSNR across channels",
    "MIN_ODG": "Minimum PEAQ ODG across channels",
    "DELTA_ODG": "PEAQ ODG using binauralized input and output",
}

@@ -16,9 +16,13 @@ SUMMARY_PAGE_TMPL_HTML = """

<h1>Summary for job {job_name}, ID: {id_current}</h1>

<hr>

{images}

"""
IMAGE_HTML_TMPL = "<img src={image_dir}/histogram_{measure}_{format}.png>"
SUBHEADING_HTML_TMP = "<h2>{subtitle}</h2>\n"


def create_summary_page(
@@ -26,53 +30,50 @@ def create_summary_page(
    id_current: int,
    job_name: str,
    measures: List[str],
    image_dir: str,
):
    images = histogram_summary(job_name, measures)
    html = "\n<hr>\n".join(
        [
            SUBHEADING_HTML_TMP.format(subtitle=TITLE_4_MEASURE[m])
            + " ".join(
                [
                    IMAGE_HTML_TMPL.format(measure=m, format=f, image_dir=image_dir)
                    for f in FORMATS
                ]
            )
            for m in measures
        ]
    )

    new_summary_page = SUBPAGE_TMPL_CSS + SUMMARY_PAGE_TMPL_HTML.format(
        id_current=id_current,
        job_name=job_name,
        images=images,
        images=html,
    )
    with open(html_out, "w") as f:
        f.write(new_summary_page)


def histogram_summary(
    job_name: str,
    measures: List[str],
):
    images = "<hr>"
    for m in measures:
        images += (
            f"<h2>{title[m]}</h2>\n"
            + " ".join(
                [f"<img src=images_{job_name}/summary_{m}_{x}.png>" for x in FORMATS]
            )
            + f'\n<br><a href="images_{job_name}/summary_{m}.csv">summary_{m}.csv</a><hr>\n\n'
        )
    return images


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("html_out")
    parser.add_argument("id_current", type=int)
    parser.add_argument("job_name")
    parser.add_argument("image_dir")
    parser.add_argument(
        "--measures",
        nargs="+",
        help=f"List of measures to include in summary. Allowed values: {' '.join(title.keys())}",
        default=["MLD", "DIFF", "SSNR", "ODG"],
        help=f"List of measures to include in summary. Allowed values: {' '.join(TITLE_4_MEASURE.keys())}",
        # exclude DELTA_ODG here
        default=list(TITLE_4_MEASURE.keys())[:-1],
    )
    args = parser.parse_args()

    if not all([m in title for m in args.measures]):
        raise ValueError(f"Invalid list of measures: {args.measures}, expected one of {' '.join(title.keys())}")
    if not all([m in TITLE_4_MEASURE for m in args.measures]):
        raise ValueError(
            f"Invalid list of measures: {args.measures}, expected one of {' '.join(TITLE_4_MEASURE.keys())}"
        )

    create_summary_page(
        args.html_out,
        args.id_current,
        args.job_name,
        args.measures,
        args.html_out, args.id_current, args.job_name, args.measures, args.image_dir
    )
+9 −0
Original line number Diff line number Diff line
@@ -5808,6 +5808,15 @@ void ivas_omasa_render_objects_from_mix(
    const int16_t output_frame                                  /* i  : output frame length per channel        */
);

#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
void ivas_omasa_gain_masa_tc(
    float *output[],                                            /* i/o  : output synthesis signal                 */
    const float gainMasa,                                       /* i  : gain for MASA transport channels        */
    const int16_t nchan_transport_ism,                          /* i  : number of ISM TCs                       */
    const int16_t output_frame                                  /* i  : output frame length per channel         */
);
#endif

void ivas_omasa_dirac_rend_jbm(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                     */
    const uint16_t nSamplesAsked,                               /* i  : number of samples requested             */
+1 −0
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_1118_EVS_LR_HQ_BITERROR                   /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */
#define NONBE_1303_REND_GRANULARITY                     /* VA: issue 1303: Renderer granularity revision */
#define NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT               /* Nokia: issue 1305: Fix OMASA ext output in case of object editing */


/* ##################### End NON-BE switches ########################### */
+17 −0
Original line number Diff line number Diff line
@@ -2885,6 +2885,13 @@ void ivas_dec_prepare_renderer(
        {
            ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots );
        }
#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
        /* MASA transport gaining for edited disc OMASA EXT. For ISMs, only metadata is modified */
        if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasaIsmData->masa_gain_is_edited == 1 )
        {
            ivas_omasa_gain_masa_tc( st_ivas->hTcBuffer->tc, st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->nchan_ism, st_ivas->hTcBuffer->n_samples_available );
        }
#endif
    }
    else if ( st_ivas->ivas_format == STEREO_FORMAT )
    {
@@ -2960,6 +2967,16 @@ void ivas_dec_prepare_renderer(
            {
                ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots );
            }
#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
            /* MASA transport gaining for edited param_one OMASA EXT. For ISMs, only metadata is modified.  */
            if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->hMasaIsmData->masa_gain_is_edited == 1 )
            {
                for ( n = 0; n < CPE_CHANNELS; n++ )
                {
                    v_multc( st_ivas->hTcBuffer->tc[n], st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->hTcBuffer->tc[n], st_ivas->hTcBuffer->n_samples_available );
                }
            }
#endif
        }
        else
        {
Loading