Skip to content

Add --strict flag to apply command - #42

Open
Mhanz3500 wants to merge 2 commits into
rust-av:mainfrom
Mhanz3500:main
Open

Add --strict flag to apply command#42
Mhanz3500 wants to merge 2 commits into
rust-av:mainfrom
Mhanz3500:main

Conversation

@Mhanz3500

Copy link
Copy Markdown
Contributor

Using --strict, the grain seed will not be randomized per-frame, and it will keep the original seed written in the fgs table.

This enables two main things:

  1. Static grain.
  2. Custom seed rotations for dynamic grain (with a long enough fgs table, you can cover all frames).

Combining the two you can also use it to have a mix of static and dynamic grain.

Comment thread src/main.rs Outdated
for (file_start, file_end, file_seed) in file_seeds {
// Find matching segments and update their seeds
for header in &mut new_headers {
if header.start_time == file_start && header.end_time == file_end {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Problem: parse_grain_table(&grain_data)? already parses the E line seed into each GrainTableSegment.random_seed, but strict mode then re-parses the same text and linearly searches new_headers for every seed. For large per-frame grain tables this becomes O(n²) before processing starts, and the duplicate parsing path can drift from the library parser’s validation rules.
  • Suggestion: Remove the extract_seeds_from_grain_table_text override path and rely on parse_grain_table for seed values; strict mode only needs to skip the later DEFAULT_GRAIN_SEED adjustment.

@Mhanz3500 Mhanz3500 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm a noob for github things

will change it when I have time, thanks!

@Mhanz3500

Copy link
Copy Markdown
Contributor Author

this new commit should address the problem, for the test fixed it failed for scaling_shift set to 10 in the builder but tested 8 in the assert, I don't think it was intentional.

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.

2 participants