Commit adbfc316 authored by vaclav's avatar vaclav
Browse files
parents 70ba2df0 783c4431
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -175,8 +175,8 @@ stages:
.merge-request-comparison-check: &merge-request-comparison-check
  - echo "--------------- Running merge-request-comparison-check anchor ---------------"
  - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
  - if [ $exit_code -ne 0 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -ne 0 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
  - exit 0

.update-ltv-repo: &update-ltv-repo
@@ -673,9 +673,9 @@ pytest-compare-20ms-and-5ms-rendering:
    - if [ $zero_errors5 != 1 ]; then echo "run error in with 5ms rendering encountered"; zero_errors=0 ; fi
    - if [ $zero_errors10 != 1 ]; then echo "run error in with 10ms rendering encountered"; zero_errors=0 ; fi
    - if [ $zero_errors != 1 ]; then exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code5 -eq 1 ]; then echo "Non-bitexact cases encountered with 5ms rendering!"; exit_code=1; fi
    - if [ $exit_code10 -eq 1 ]; then echo "Non-bitexact cases encountered with 10ms rendering!"; exit_code=1; fi
    - if [ $exit_code -eq 1 ]; then exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code5 -ne 0 ]; then echo "Non-bitexact cases encountered with 5ms rendering!"; exit_code=1; fi
    - if [ $exit_code10 -ne 0 ]; then echo "Non-bitexact cases encountered with 10ms rendering!"; exit_code=1; fi
    - if [ $exit_code -ne 0 ]; then exit $EXIT_CODE_FAIL; fi
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
@@ -821,7 +821,7 @@ renderer-pytest-on-merge-request:
    - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi

    # run test
    - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer_.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$?
    - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$?
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true

    - *merge-request-comparison-check
@@ -1367,9 +1367,9 @@ codec-comparison-on-main-push:
    ### run pytest
    - exit_code=0
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout || exit_code=$?
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -ne 0 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
    - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi;
  allow_failure:
    exit_codes:
@@ -1593,7 +1593,7 @@ ivas-conformance-linux:
    - genhtml coverage.info -o coverage -t "Coverage on main @ $commit_sha"

    # Check for failures
    - if [ $exit_code -eq 1 ]; then echo "Test failures encountered"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -ne 0 ]; then echo "Test failures encountered"; exit $EXIT_CODE_FAIL; fi
    
  artifacts:
    name: "ivas-conformance-linux-$CI_COMMIT_SHORT_SHA"
@@ -1670,7 +1670,7 @@ test-long-self-test:
    - zero_errors=$(cat report-junit-ltv.xml | grep -c 'errors="0"') || true

    - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ]; then echo "Non-bitexact cases encountered!"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "Non-bitexact cases encountered!"; exit $EXIT_CODE_NON_BE; fi
    - exit 0


@@ -1735,7 +1735,7 @@ test-branch-vs-input-passthrough:
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
    - python3 scripts/parse_xml_report.py report-junit.xml report.csv
    - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ]; then echo "Differences encountered."; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "Differences encountered."; exit $EXIT_CODE_NON_BE; fi
    - exit 0

  artifacts:
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ TESTCASES = [
    "MASA 1dir 1TC at 256 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out, HR custom configuration",
    "MASA 1dir 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out custom configuration",
    "MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out custom configuration",
    "MASA 1TC at 256 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out, HR custom configuration",
    "OMASA 2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out",
]


+1 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@
#define NONBE_1217_INIT_OBJ_EDIT                        /* VA: issue 1217: do object editing only when objects metadata is available */
#define NONBE_1217_OBJ_EDIT_FOA                         /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */

#define NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP        /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */
/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+10 −0
Original line number Diff line number Diff line
@@ -2418,13 +2418,23 @@ static int16_t ivas_decode_masaism_metadata(
                if ( azimuth * hMasaIsmData->q_azimuth_old[obj] > 0 )
                {
                    delta_phi = 180.0f / (float) ( no_phi_masa[bits_ism[obj] - 1][idx_el] ); /* 360/2*/
#ifdef NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP
                    /* this is equivalent to testing if 'azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi' with limited precision */
                    if ( roundf( 100 * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( azimuth - hMasaIsmData->q_azimuth_old[obj] ) ) / 100.0f > 180.0f )
#else
                    if ( azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi )
#endif
                    {
                        azimuth -= delta_phi;
                    }
                    else
                    {
#ifdef NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP
                        /* this is equivalent to testing if 'hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi' with limited precision */
                        if ( roundf( 100 * ( no_phi_masa[bits_ism[obj] - 1][idx_el] ) * ( hMasaIsmData->q_azimuth_old[obj] - azimuth ) ) / 100.0f > 180.0f )
#else
                        if ( hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi )
#endif
                        {
                            azimuth += delta_phi;
                        }
+24 −28
Original line number Diff line number Diff line
@@ -71,17 +71,17 @@ if __name__ == "__main__":
        CATEGORIES = IVAS_CATEGORIES
    if args.diff:
        limits_per_measure = {
            "MLD": ("MLD", [-math.inf, 0, 0.1, 0.2, 0.3, 0.4, math.inf]),
            "DIFF": ("MAXIMUM ABS DIFF", [-32768, 0, 128, 256, 512, 32767]),
            "SSNR": ("MIN_SSNR", [-math.inf, -0.4, -0.3, -0.2, -0.1, 0, math.inf]),
            "ODG": ("MIN_ODG", [-5.0, -0.3, -0.2, -0.1, 0, math.inf]),
            "MLD": ("MLD", None),
            "DIFF": ("MAXIMUM ABS DIFF", None),
            "SSNR": ("MIN_SSNR", None),
            "ODG": ("MIN_ODG", None),
        }
    else:
        limits_per_measure = {
            "MLD": ("MLD", [0, 5, 10, math.inf]),
            "DIFF": ("MAXIMUM ABS DIFF", [0, 1024, 16384, 32769]),
            "SSNR": ("MIN_SSNR", [-math.inf, 0, 20, 40, 60, 100]),
            "ODG": ("MIN_ODG", [-5, -4, -3, -2, -1, 0]),
            "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]),
        }
    (measure_label, limits) = limits_per_measure[measure]

@@ -97,14 +97,19 @@ if __name__ == "__main__":
            for k, val in zip(keys, row[1:]):
                results_sorted[testcase][k] = val

    if limits is None:
        vals = [float(x) for x in [m[measure_label] for m in results_sorted.values() if m[measure_label] != "None" and m[measure_label] != ""]]
        start = min(vals)
        f = 10 ** (2 - int(np.floor(np.log10(abs(start)))) - 1)
        start = np.floor(start*f)/f
        step = (max(vals) - start)/10
        f = 10 ** (2 - int(np.floor(np.log10(abs(step)))) - 1)
        step = np.ceil(step*f)/f
        limits = np.arange(start, 10*step, step)

    # Output CSV file
    with open(csv_summary, "w") as fp:
        limits_labels = [
            f"{str(a)} -- {str(b)}" for (a, b) in zip(limits[0:-1], limits[1:])
        ] + ["None"]
        # Zero difference is treated as a special category for MLD and MAXIMUM ABS DIFF
        if (measure_label == "MLD" or measure_label == "MAXIMUM ABS DIFF") and not args.diff:
            limits_labels = ["0"] + limits_labels
        limits_labels = [f"{a:g}" for a in limits] + ["","None"] # Put None cases in separate bin
        headerline = f"Format;Category;" + ";".join(limits_labels) + "\n"
        fp.write(headerline)

@@ -120,27 +125,18 @@ if __name__ == "__main__":
                        if m["Format"] == fmt and m["Category"] == cat
                    ]
                ]
                # Zero difference is treated as a special category for MLD and MAXIMUM ABS DIFF
                if (measure_label == "MLD" or measure_label == "MAXIMUM ABS DIFF") and not args.diff:
                    val = [
                        float(x) for x in values if x != "None" and x != "0" and x != ""
                    ]
                    zero = [sum([1 for x in values if x == "0"])]
                    none = [sum([1 for x in values if x == "None" or x == ""])]
                else:
                # Create separate bin for None (errors)
                val = [float(x) for x in values if x != "None" and x != ""]
                    zero = []
                none = [sum([1 for x in values if x == "None" or x == ""])]
                hist, _ = np.histogram(val, limits)
                data = np.array(zero + list(hist) + none)
                data = np.array(list(hist) + [0] + none + [0])

                # CSV output
                line = f"{fmt};{cat};{'; '.join(map(str,data))}\n"
                fp.write(line)

                # Matplotlib histogram
                labels = [x if len(x) < 10 else x.replace('--','--\n') for x in limits_labels]
                ax.bar(labels, data, 0.5, label=cat, bottom=bottom)
                ax.bar(limits_labels, data, 1, align='edge', edgecolor='black', linewidth=0.5, label=cat, bottom=bottom)
                bottom += data

            # Histogram layout
Loading