Skip to content

Profiles filtering#378

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

Profiles filtering#378
ahresse wants to merge 4 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.

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>
@ahresse
ahresse force-pushed the profiles-filtering branch from 11394bb to 27c11b9 Compare July 10, 2026 09:32
ahresse added 3 commits July 10, 2026 11:39
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>
@ahresse
ahresse force-pushed the profiles-filtering branch from 27c11b9 to f8f6c0f Compare July 10, 2026 09:44
Comment thread fluster/codec.py
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
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.

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