Commit 017856b5 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 20231020_maintenance

parents 506b5cf9 b4edaaa8
Loading
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -7,7 +7,17 @@

  <h2>Regression tracking</h2>

  <li><a href="long_term_regression.html">Long term regression</a></li>
  <ul>
    <li><a href="long_term_mld_enc.html">Long term MLD encoder</a></li>
    <li><a href="long_term_mld_dec.html">Long term MLD decoder</a></li>
    <li><a href="long_term_mld_dec_reject_JBM_BINAURAL_ROOM_REVERB.html">Long term MLD decoder - excluding JBM and BINAURAL_ROOM_REVERB</a></li>
    <li><a href="long_term_max_abs_diff_enc.html">Long term MAX_ABS_DIFF encoder</a></li>
    <li><a href="long_term_max_abs_diff_dec.html">Long term MAX_ABS_DIFF decoder</a></li>
    <li><a href="long_term_max_abs_diff_dec_reject_JBM_BINAURAL_ROOM_REVERB.html">Long term MAX_ABS_DIFF decoder - excluding JBM and BINAURAL_ROOM_REVERB</a></li>

    <li><a href="detect_regressions.html">Detect MLD regressions</a></li>
    <li><a href="detect_regressions.csv">detect_regressions.csv</a></li>
  </ul>

  <h2>Daily long testvector tests</h2>

+139 −71
Original line number Diff line number Diff line
#!/usr/bin/env python3

import os
import pandas as pd
import argparse
import plotly.express as px
import re
import plotly.graph_objects as go
from plotly.subplots import make_subplots

@@ -23,15 +25,18 @@ def read_csv_files(root_dir):


def parse_csv_data(csv_data):
    """keep 'testcase', 'format', 'MLD', 'MAX_ABS_DIFF'  and add
    'date' column."""
    cols_to_keep = ["testcase", "format", "MLD", "MAX_ABS_DIFF"]
    """keep 'testcase', 'format', 'MLD', 'MAX_ABS_DIFF', 'MIN_ODG', 'MIN_SSNR'  and add
    'date' and 'job' column."""
    cols_to_keep = ["testcase", "format", "MLD", "MAX_ABS_DIFF", "MIN_ODG", "MIN_SSNR"]
    parsed_data = {}
    for key, df in csv_data.items():
        tmp = key.split("-")
        job = "-".join(tmp[4:-4])
        cols = [col for col in cols_to_keep if col in df.columns]
        date = os.path.basename(os.path.dirname(key))
        new_df = df[cols].copy()
        new_df["date"] = date
        new_df["job"] = job
        parsed_data[key] = new_df

    # concatenate all dataframe in the dictionary
@@ -39,38 +44,67 @@ def parse_csv_data(csv_data):
    return concat_df


def plot_data(df, output_filename):
    """plot max values for 'MLD' and 'MAX_ABS_DIFF' data and save
def plot_data(df, args):
    """plot max values for measure and data and save
    to html file."""

    measure = args.measure
    days = args.days

    # Convert 'date' to datetime
    df["date"] = pd.to_datetime(df["date"], errors="coerce")
    df["MLD"] = pd.to_numeric(df["MLD"], errors="coerce")
    df["MAX_ABS_DIFF"] = pd.to_numeric(df["MAX_ABS_DIFF"], errors="coerce")
    df[measure] = pd.to_numeric(df[measure], errors="coerce")

    # Filter out rows older than "days"
    cutoff = df["date"].max() - pd.Timedelta(days=days)
    df = df[df["date"] > cutoff].reset_index(drop=True)

    # Drop rows with NaT and NaN
    clean_df = df.dropna(subset=["date", "MLD", "MAX_ABS_DIFF"])
    df = df.dropna(subset=["date", measure])

    # Filter test cases based on include/reject/match arguments
    if args.include:
        mask = pd.Series(False, index=df.index)
        for tag in args.include:
            mask |= df["testcase"].str.contains(tag, case=False, na=False)
        df = df[mask]
    if args.reject:
        mask = pd.Series(False, index=df.index)
        for tag in args.reject:
            mask |= df["testcase"].str.contains(tag, case=False, na=False)
        df = df[~mask]
    if args.match:
        pattern = re.compile(args.match, re.IGNORECASE)
        df = df[df["testcase"].str.contains(pattern, na=False)]

    # Filter jobs based on job-include/job-reject/job-match arguments
    if args.job_include:
        mask = pd.Series(False, index=df.index)
        for tag in args.job_include:
            mask |= df["job"].str.contains(tag, case=False, na=False)
        df = df[mask]
    if args.job_reject:
        mask = pd.Series(False, index=df.index)
        for tag in args.job_reject:
            mask |= df["job"].str.contains(tag, case=False, na=False)
        df = df[~mask]
    if args.job_match:
        pattern = re.compile(args.job_match, re.IGNORECASE)
        df = df[df["job"].str.contains(pattern, na=False)]

    # Group by 'format' and 'date' to get rows with max 'MLD' per group
    max_mld = (
        clean_df.groupby(["format", "date"])
        .apply(lambda x: x.loc[x["MLD"].idxmax()])
        .reset_index(drop=True)
    )

    # Group by 'format' and 'date' to get rows with max 'MAX_ABS_DIFF' per
    # group
    max_abs_diff = (
        clean_df.groupby(["format", "date"])
        .apply(lambda x: x.loc[x["MAX_ABS_DIFF"].idxmax()])
        .reset_index(drop=True)
    )
    # Group by 'format' and 'date' to get rows with max 'MLD' per group
    idx = df.groupby(["format", "date"])[measure].idxmax()
    max = df.loc[idx].reset_index(drop=True)
    idx = df.groupby(["format", "date"])[measure].idxmin()
    min = df.loc[idx].reset_index(drop=True)
    mean = df.groupby(["format", "date"])[measure].mean().to_frame("mean").reset_index()

    formats = sorted(clean_df["format"].unique())
    formats = sorted(df["format"].unique())

    fig = make_subplots(
        rows=5,
        cols=2,
        specs=[[{"secondary_y": True}] * 2] * 5,
        subplot_titles=[f"{i}" for i in formats],
        shared_xaxes="columns",
    )
@@ -79,64 +113,65 @@ def plot_data(df, output_filename):
        row = i // 2 + 1
        col = i % 2 + 1

        data_mld = max_mld[max_mld["format"] == fmt].sort_values("date")
        data_diff = max_abs_diff[max_abs_diff["format"]
                                 == fmt].sort_values("date")
        if "MIN" in measure:
            data = min[min["format"] == fmt].sort_values("date")
            maxmin_str = "Min"
        else:    
            data = max[max["format"] == fmt].sort_values("date")
            maxmin_str = "Max"

        # Add max 'MLD' to primary y-axis
        # Add max measure to plots
        fig.add_trace(
            go.Scatter(
                x=data_mld["date"],
                y=data_mld["MLD"],
                x=data["date"],
                y=data[measure],
                mode="lines+markers",
                name=f" {fmt} - Max MLD",
                name=f"{maxmin_str} {measure}",
                hovertext=[
                    f"Testcase: {tc}<br>MLD: {mld:.4f}<br>MAX_ABS_DIFF:"
                    f"{abs_diff}<br>Format:"
                    f" {format}<br>Date: {date.date()}"
                    for tc, mld, abs_diff, format, date in zip(
                        data_mld["testcase"],
                        data_mld["MLD"],
                        data_mld["MAX_ABS_DIFF"],
                        data_mld["format"],
                        data_mld["date"],
                    f"Testcase: {tc}<br>{maxmin_str} {measure}: {value:.4f}"
                    f"<br>Job: {job}"
                    f"<br>Date: {date.date()}"
                    for job, tc, value, date in zip(
                        data["job"],
                        data["testcase"],
                        data[measure],
                        data["date"],
                    )
                ],
                hoverinfo="text",
                marker_color="red",
                showlegend=(i == 0),
            ),
            row=row,
            col=col,
            secondary_y=False,
        )

        # Add max 'MAX_ABS_DIFF' to secondary y-axis
        data = mean[mean["format"] == fmt].sort_values("date")

        # Add mean measure to plots
        fig.add_trace(
            go.Scatter(
                x=data_diff["date"],
                y=data_diff["MAX_ABS_DIFF"],
                x=data["date"],
                y=data["mean"],
                mode="lines+markers",
                name=f"{fmt} - Max MAX_ABS_DIFF",
                name=f"Mean {measure}",
                hovertext=[
                    f"Testcase: {tc}<br>MLD: {mld:.4f}<br>MAX_ABS_DIFF:"
                    f" {abs_diff:.4f}<br>Format:"
                    f" {format}<br>Date: {date.date()}"
                    for tc, mld, abs_diff, format, date in zip(
                        data_diff["testcase"],
                        data_diff["MLD"],
                        data_diff["MAX_ABS_DIFF"],
                        data_diff["format"],
                        data_diff["date"],
                    f"Mean {measure}: {value:.4f}" f"<br>Date: {date.date()}"
                    for value, date in zip(
                        data["mean"],
                        data["date"],
                    )
                ],
                hoverinfo="text",
                marker_color="blue",
                showlegend=(i == 0),
            ),
            row=row,
            col=col,
            secondary_y=True,
        )

    fig.update_layout(
        title_text="Long-term regression: max MLD and max MAX_ABS_DIFF",
        title_text=f"History: {measure}",
        legend=dict(x=1, y=1, orientation="v"),
        hovermode="x unified",
    )
@@ -144,21 +179,8 @@ def plot_data(df, output_filename):
    fig.update_xaxes(automargin=True)
    fig.update_yaxes(automargin=True)

    # Update y-axes titles per subplot
    for i in range(10):
        yaxis_num = i * 2 + 1
        yaxis2_num = yaxis_num + 1
        fig["layout"][f"yaxis{yaxis_num}"].update(
            title="Max MLD", titlefont=dict(color="blue"), tickfont=dict(color="blue")
        )
        fig["layout"][f"yaxis{yaxis2_num}"].update(
            title="Max MAX_ABS_DIFF",
            titlefont=dict(color="green"),
            tickfont=dict(color="green"),
        )

    # Save to html
    fig.write_html(output_filename)
    fig.write_html(args.output_filename)


if __name__ == "__main__":
@@ -173,8 +195,54 @@ if __name__ == "__main__":
        type=str,
        help="Filename of the generated plot. e.g" ". long_term_regression.html",
    )
    parser.add_argument(
        "--days",
        type=int,
        help="Number of days in history. Default: 30",
        default=30,
    )
    parser.add_argument(
        "--measure",
        type=str,
        help="Measure for analysis: MLD, MAX_ABS_DIFF, MIN_ODG, MIN_SSNR, default: MLD",
        default="MLD",
    )
    parser.add_argument(
        "--include",
        nargs="+",
        type=str,
        help="List of tags to include in testcases",
    )
    parser.add_argument(
        "--reject",
        nargs="+",
        type=str,
        help="List of tags to reject in testcases",
    )
    parser.add_argument(
        "--match",
        type=str,
        help="Regex pattern for selecting testcases",
    )
    parser.add_argument(
        "--job-include",
        nargs="+",
        type=str,
        help="List of tags to include in jobs",
    )
    parser.add_argument(
        "--job-reject",
        nargs="+",
        type=str,
        help="List of tags to reject in jobs",
    )
    parser.add_argument(
        "--job-match",
        type=str,
        help="Regex pattern for selecting jobs",
    )
    args = parser.parse_args()

    csv_data = read_csv_files(args.root_dir)
    data = parse_csv_data(csv_data)
    plot_data(data, args.output_filename)
    plot_data(data, args)
+6 −0
Original line number Diff line number Diff line
@@ -1111,11 +1111,17 @@ ivas_error ivas_param_ism_dec_open(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
);

#ifdef FIX_FLOAT_1526_DIRAC_MEM_LEAK
void ivas_param_ism_dec_close(
    PARAM_ISM_DEC_HANDLE *hParamIsmDec                          /* i/o: decoder ParamISM handle                     */
);
#else
void ivas_param_ism_dec_close(
    PARAM_ISM_DEC_HANDLE *hParamIsmDec,                         /* i/o: decoder ParamISM handle                     */
    SPAT_PARAM_REND_COMMON_DATA_HANDLE *hSpatParamRendCom_out,  /* i/o: common spatial renderer data                */
    const AUDIO_CONFIG output_config                            /* i  : output audio configuration                  */
);
#endif

void ivas_ism_dec_digest_tc(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
+5 −1
Original line number Diff line number Diff line
@@ -161,13 +161,17 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#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 FIX_FLOAT_1522_LTV_MSAN_QMETADATA_ENC_EC3       /* Nokia: float issue 1522: fix uninit MSAN in EC3 of qmetadata encoding */
#define FIX_2235_TD_RENDERER_WORD16                     /* Eri: For float: small synch with BASOP, removing unnecessary abs. BASOP: Use Word16 in TD renderer without converting to Word32 */
#define FIX_FLOAT_1526_DIRAC_MEM_LEAK                   /* FhG: potential memory leak in DirAC handles in case of format switching */
#define ALIGN_ACELP_CORE                                /* VA: align ACELP core functions with BASOP */

/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt. TS 26.258 V3.0 */

#define FIX_2432_ISM_SPIKES_16KHZ                       /* VA: basop issue 2432: fix spikes in ISM decoding at 16kHz output sampling rate */

/* ##################### End NON-BE switches ########################### */

/* ################## End MAINTENANCE switches ######################### */
+11 −7
Original line number Diff line number Diff line
@@ -2336,7 +2336,9 @@ void MDCT_classifier_reset(
ivas_error acelp_core_enc(
    Encoder_State *st, /* i/o: encoder state structure                 */
    const float inp[], /* i  : input signal of the current frame       */
#ifndef ALIGN_ACELP_CORE
    const float ener, /* i  : residual energy from Levinson-Durbin    */
#endif
    float A[NB_SUBFR16k * ( M + 1 )],    /* i  : A(z) unquantized for the 4 subframes    */
    float Aw[NB_SUBFR16k * ( M + 1 )],   /* i  : weighted A(z) unquant. for subframes    */
    const float epsP[M + 1],             /* i  : LP prediction errors                    */
@@ -3029,7 +3031,9 @@ void CNG_enc(
    Encoder_State *st,   /* i/o: State structure                                     */
    float Aq[],          /* o  : LP coefficients                                     */
    const float *speech, /* i  : pointer to current frame input speech buffer        */
#ifndef ALIGN_ACELP_CORE
    float enr, /* i  : frame energy output from Levinson recursion         */
#endif
    const float *lsp_mid,   /* i  : mid frame LSPs                                      */
    float *lsp_new,         /* i/o: current frame LSPs                                  */
    float *lsf_new,         /* i/o: current frame LSFs                                  */
Loading