Commit f70a9b64 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

add BINAURAL output format filter support

parent 5404bc76
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -263,6 +263,9 @@ Use `--filter` to control test levels, tags and optional text/format filtering.
  - `EXT` output format: only bitrate up to 80 kbps (inclusive).
  - `MONO` output format: all bitrates.
  - `STEREO` output format: all bitrates.
- Decoder format tokens are additive to the default LEVEL1 decoder set.
- Any token containing `BINAURAL` matches decoder tests whose command contains `BINAURAL`
  (for example, `BINAURAL`, `BINAURAL_IR`, `BINAURAL_ROOM_IR`, `BINAURAL_REVERB`).
- Renderer and ISAR tests are not run by default in `LEVEL1`.
  - Add `REND` and/or `ISAR` in `--filter` to include them.
  - If `ISAR` is provided, both `ISAR` and `ISAR_ENC` test groups are run.
@@ -293,6 +296,12 @@ Examples:
  PYTHONPATH=scripts python scripts/ivas_conformance/runConformance.py --testvecDir $PWD/testvec --cut_build_path=CUT_BIN_DIR --filter LEVEL1 DEC voip
  ```

- LEVEL1 with additive BINAURAL decoder matching

  ```shell
  PYTHONPATH=scripts python scripts/ivas_conformance/runConformance.py --testvecDir $PWD/testvec --cut_build_path=CUT_BIN_DIR --filter LEVEL1 BINAURAL
  ```

- Unsupported LEVEL2 example (will fail)

  ```shell
+25 −2
Original line number Diff line number Diff line
@@ -945,6 +945,8 @@ class MLDConformance:
        text = rawCmdline.upper()
        formats = set()

        if "BINAURAL" in text:
            formats.add("BINAURAL")
        if "MONO" in text:
            formats.add("MONO")
        if "STEREO" in text:
@@ -973,10 +975,22 @@ class MLDConformance:

        if tag == "DEC":
            formats = self._decoderFormatsInCommand(rawCmdline)
            requested_formats = set(getattr(self.args, "filter_decoder_formats", []))

            ext_ok = "EXT" in formats and self._isBitrateAtMost80(rawCmdline)
            mono_ok = "MONO" in formats
            stereo_ok = "STEREO" in formats
            return ext_ok or mono_ok or stereo_ok
            default_level1_dec_ok = ext_ok or mono_ok or stereo_ok

            if requested_formats:
                requested_match = False
                if "BINAURAL" in requested_formats and "BINAURAL" in rawCmdline.upper():
                    requested_match = True
                elif formats.intersection(requested_formats):
                    requested_match = True
                return default_level1_dec_ok or requested_match

            return default_level1_dec_ok

        # For REND/ISAR/ISAR_ENC under LEVEL1, tag-level inclusion is decided at testTags parsing.
        return True
@@ -1690,7 +1704,8 @@ if __name__ == "__main__":
        default=None,
        help=(
            "Filter tests. Supports levels LEVEL1 LEVEL2 LEVEL3 and tags ENC DEC REND ISAR ISAR_ENC "
            "(comma/space-separated), and case-insensitive command substring filtering. "
            "(comma/space-separated), decoder formats EXT MONO STEREO BINAURAL, "
            "and case-insensitive command substring filtering. "
            "LEVEL3 is default. LEVEL2 is currently unsupported."
        ),
    )
@@ -1749,9 +1764,11 @@ if __name__ == "__main__":

    valid_tags = set(IVAS_Bins.keys())
    valid_levels = {"LEVEL1", "LEVEL2", "LEVEL3"}
    valid_decoder_formats = {"EXT", "MONO", "STEREO", "BINAURAL"}

    level_tokens = []
    tag_tokens = []
    decoder_format_tokens = []
    non_special_tokens = []

    for tok in filter_tokens:
@@ -1760,6 +1777,10 @@ if __name__ == "__main__":
            level_tokens.append(upper_tok)
        elif upper_tok in valid_tags:
            tag_tokens.append(upper_tok)
        elif "BINAURAL" in upper_tok:
            decoder_format_tokens.append("BINAURAL")
        elif upper_tok in valid_decoder_formats:
            decoder_format_tokens.append(upper_tok)
        else:
            non_special_tokens.append(tok)

@@ -1772,6 +1793,7 @@ if __name__ == "__main__":

    # Preserve order while removing duplicates.
    tag_tokens = list(dict.fromkeys(tag_tokens))
    decoder_format_tokens = list(dict.fromkeys(decoder_format_tokens))

    # If ISAR is requested, run both ISAR and ISAR_ENC.
    if "ISAR" in tag_tokens and "ISAR_ENC" not in tag_tokens:
@@ -1788,6 +1810,7 @@ if __name__ == "__main__":

    args.filter_display = raw_filter if raw_filter else None
    args.filter_substring = " ".join(non_special_tokens) if non_special_tokens else None
    args.filter_decoder_formats = decoder_format_tokens
    args.filter_level = filter_level

    conformance = MLDConformance(args)