Skip to content

Profiles filtering - #378

Open
ahresse wants to merge 11 commits into
fluendo:masterfrom
ahresse:profiles-filtering
Open

Profiles filtering#378
ahresse wants to merge 11 commits into
fluendo:masterfrom
ahresse:profiles-filtering

Conversation

@ahresse

@ahresse ahresse commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This pull request adds support for filtering test vectors by codec profile, allowing users to specify which profiles to run via a new -p/--profiles command-line option. The feature is fully documented, supports multiple profiles, is case-insensitive, and includes automatic inference of VP9 profiles from test vector names. The implementation also introduces new profile values for VP9 in the Profile enum and ensures that only matching test vectors are executed when filtering is active.

Profile Filtering Feature:

  • Added a -p/--profiles argument to the CLI, enabling users to run only test vectors matching specified codec profiles; the option supports multiple, case-insensitive profile names and is documented in README.md [1] [2] [3] [4].
  • Updated context and initialization logic in fluster/fluster.py to parse, validate, and store user-supplied profile names, mapping them to the new or existing Profile enum values; errors are reported for unknown profiles [1] [2] [3] [4] [5].

VP9 Profile Support:

  • Added VP9 profile values (VP9 Profile 0 through VP9 Profile 3) to the Profile enum in fluster/codec.py.
  • Implemented automatic VP9 profile inference from test vector names (e.g., vp90- prefix → Profile 0) in TestSuite, and assigned inferred profiles to test vectors when loading VP9 test suites from JSON [1] [2].

Test Vector Filtering Logic:

  • Updated TestSuite.generate_tests to filter out test vectors whose profiles do not match the requested profiles, ensuring only relevant vectors are run.

Interface and Internal Consistency:

  • Propagated profile filtering information through context objects and constructors in fluster/fluster.py and fluster/test_suite.py, ensuring consistent handling across the codebase [1] [2] [3].

@ylatuya ylatuya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first contribution! Filtering by profiles is super helpful.

Do you think this filter should also be enabled for the list command? It will also help list test vectors that match a specific profile.

Comment thread fluster/codec.py Outdated
@ahresse

ahresse commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@ylatuya I implemented your proposition in last commit. Quite useful to be able to list profiles indeed.

@ahresse
ahresse force-pushed the profiles-filtering branch 2 times, most recently from 27c11b9 to f8f6c0f Compare July 10, 2026 09:44
Comment thread fluster/codec.py Outdated
Comment on lines +81 to +98
CONSTRAINED_BASELINE = ("Constrained Baseline", Codec.H264)
BASELINE = ("Baseline", Codec.H264)
EXTENDED = ("Extended", Codec.H264)
MAIN = ("Main", Codec.H264)
HIGH = ("High", Codec.H264)
HIGH_10 = ("High 10", Codec.H264)
HIGH_10_INTRA = ("High 10 Intra", Codec.H264)
HIGH_4_2_2 = ("High 4:2:2", Codec.H264)
HIGH_4_2_2_INTRA = ("High 4:2:2 Intra", Codec.H264)
HIGH_4_4_4_INTRA = ("High 4:4:4 Intra", Codec.H264)
HIGH_4_4_4_PREDICTIVE = ("High 4:4:4 Predictive", Codec.H264)
CAVLC_4_4_4 = ("CAVLC 4:4:4", Codec.H264)
CAVLC_4_4_4_INTRA = ("CAVLC 4:4:4 Intra", Codec.H264)

MAIN_10 = ("Main 10", Codec.H264)
MAIN_STILL_PICTURE = ("Main Still Picture", Codec.H264)
MAIN_4_2_2_10 = ("Main 4:2:2 10", Codec.H264)
MAIN_4_4_4_12 = ("Main 4:4:4 12", Codec.H264)

@mdimopoulos mdimopoulos Jul 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these are definitely shared with H265 (and possibly H266).
Sorry, the comment above this piece of code is obsolete. I can't make a proper evaluation of the impact of the PR right now but please take it into account

cc @ylatuya

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, profiles are shared among different codecs and they should be associated to a list of codecs instead of single codec.

Comment thread fluster/codec.py Outdated
Comment on lines +81 to +98
CONSTRAINED_BASELINE = ("Constrained Baseline", Codec.H264)
BASELINE = ("Baseline", Codec.H264)
EXTENDED = ("Extended", Codec.H264)
MAIN = ("Main", Codec.H264)
HIGH = ("High", Codec.H264)
HIGH_10 = ("High 10", Codec.H264)
HIGH_10_INTRA = ("High 10 Intra", Codec.H264)
HIGH_4_2_2 = ("High 4:2:2", Codec.H264)
HIGH_4_2_2_INTRA = ("High 4:2:2 Intra", Codec.H264)
HIGH_4_4_4_INTRA = ("High 4:4:4 Intra", Codec.H264)
HIGH_4_4_4_PREDICTIVE = ("High 4:4:4 Predictive", Codec.H264)
CAVLC_4_4_4 = ("CAVLC 4:4:4", Codec.H264)
CAVLC_4_4_4_INTRA = ("CAVLC 4:4:4 Intra", Codec.H264)

MAIN_10 = ("Main 10", Codec.H264)
MAIN_STILL_PICTURE = ("Main Still Picture", Codec.H264)
MAIN_4_2_2_10 = ("Main 4:2:2 10", Codec.H264)
MAIN_4_4_4_12 = ("Main 4:4:4 12", Codec.H264)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, profiles are shared among different codecs and they should be associated to a list of codecs instead of single codec.

@ahresse
ahresse force-pushed the profiles-filtering branch from f8f6c0f to 339ae09 Compare August 4, 2026 10:47
@ahresse

ahresse commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@ylatuya and @mdimopoulos: Last commit might fulfil your previous comments.

profile 0: color depth: 8 bit/sample, chroma subsampling: 4:2:0
profile 1: color depth: 8 bit, chroma subsampling: 4:2:2, 4:2:0, 4:4:4
profile 2: color depth: 10–12 bit, chroma subsampling: 4:2:0
profile 3: color depth: 10–12 bit, chroma subsampling: 4:2:2, 4:2:0, 4:4:4

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
to filter test vectors by codec profile
Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
- Add codec attribute to Profile enum
- Profile members now carry a codec attribute via tuple values with a custom __new__
- list command shows profiles grouped by codec (filterable with -d/--codec)
- TestVector stores/serializes codec alongside profile

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
Redefine each Profile member to carry a list of codecs instead of a
single one, so profiles common to several codec families can be
shared, e.g. "Main" (H.264, H.265, AV1, MPEG2) and "Main 10"
(H.265, H.266).

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
@ahresse
ahresse force-pushed the profiles-filtering branch from dbe9c53 to 83a80f1 Compare August 17, 2026 13:05
The codec field was only serialized next to the profile and never read
back as a Codec enum, causing a type mismatch on reload. Remove it
entirely since the test suite already carries the codec.

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
AV1 defines Main, High and Professional profiles. Main already
maps to Codec.AV1, so add AV1 to the shared High profile for a
complete profile listing.

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
Add the -p/--profiles option to the reference subcommand so reference
runs can be restricted to specific codec profiles, mirroring run.

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
Match the test_vector_names pattern by storing the profiles to filter
as a Set instead of a List.

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
Sort codecs and their profiles alphabetically in list_profiles for a
deterministic listing.

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
@ahresse

ahresse commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

I suspect CI to fail because of network failures. (Github is experiencing degraded performance right now. (https://www.githubstatus.com/) - make check "works on my machine" :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants