edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching·0 forks·Rust·370.3 MiB·9b67700·Tahinli·3 days ago·4021 commits
| 1 | # av1splitencode: encode.rs and encoder.rs module split (av1split 5c, 5f) |
| 2 | |
| 3 | Goal: mechanical split of `crates/ec-av1/src/encode.rs` (23,771 lines) and `crates/ec-av1/src/encoder.rs` |
| 4 | (6,503 lines) so that no file under `crates/ec-av1/src/encode*` is over 5,000 lines, with no behaviour change. |
| 5 | |
| 6 | Branch: `lane/av1splitencode`. Base: `main` (merged as the lane's merge commit `c0c546b1`, which brought in |
| 7 | the qm/, tile/ and cdf/ splits; those touch other files only). |
| 8 | |
| 9 | ## What changed |
| 10 | |
| 11 | | Step | What moved | File | |
| 12 | |---|---|---| |
| 13 | | E1 | `encode.rs` -> `encode/mod.rs` (git mv, 0 lines) | `encode/mod.rs` | |
| 14 | | E2 | `mod tests` (second half) | `encode/more_tests.rs` | |
| 15 | | E3 | `mod tests` (first half) | `encode/tests.rs` | |
| 16 | | E4 | TPL, deltaq, `encode_inter_frame`, `EncodedSequence` | `encode/frame.rs` | |
| 17 | | E5 | `record_mi*`, `Search`, `Trial`, `search_inter_block` | `encode/inter_search.rs` | |
| 18 | | E6 | `SPLIT_CENSUS`, `split_census*`, `code_square_inter`, Ibc | `encode/split.rs` | |
| 19 | | E7 | `CoefCtx`, `Plane`, `At`, `Reach`, tx tables | `encode/coef.rs` | |
| 20 | | N1 | `encoder.rs` -> `encoder/mod.rs` (git mv); inline `mod tests` -> `encoder/tests.rs` | `encoder/mod.rs`, `encoder/tests.rs` | |
| 21 | | E8 | check only: `encode/mod.rs` under 5,000 | | |
| 22 | | merge | `git merge main` (clean, no conflicts) | | |
| 23 | |
| 24 | Source-scanning tests reach the encode and encoder sources through `test_source::module_source("encode")` and |
| 25 | `module_source("encoder")` (directory-aware), so the moved files stay visible to them. No `include_str!` |
| 26 | path still names `encode.rs` or `encoder.rs`. |
| 27 | |
| 28 | ## Line counts (`crates/ec-av1/src/encode/` and `crates/ec-av1/src/encoder/`) |
| 29 | |
| 30 | | File | Lines | |
| 31 | |---|---:| |
| 32 | | `encode/inter_search.rs` | 4,671 | |
| 33 | | `encode/tests.rs` | 3,975 | |
| 34 | | `encode/more_tests.rs` | 3,935 | |
| 35 | | `encode/split.rs` | 3,334 | |
| 36 | | `encoder/tests.rs` | 3,943 | |
| 37 | | `encode/frame.rs` | 2,867 | |
| 38 | | `encoder/mod.rs` | 2,559 | |
| 39 | | `encode/mod.rs` | 2,572 | |
| 40 | | `encode/coef.rs` | 2,443 | |
| 41 | |
| 42 | Largest: `encode/inter_search.rs` at 4,671. Nothing under `encode*` is over 5,000 lines. |
| 43 | The original files were 23,771 (`encode.rs`) and 6,503 (`encoder.rs`) lines. |
| 44 | |
| 45 | ## Verify |
| 46 | |
| 47 | - `scripts/remote-run.sh av1splitencode -- cargo check -p ec-av1 --tests` (host c): exit 0, `Finished`. |
| 48 | Warnings: `ec-av1` lib 12, lib test 11, the same counts main has. |
| 49 | - Full gate on host b: |
| 50 | `EC_MEMGUARD_MAX=6G cargo test --release -p ec-av1 -- --test-threads=4` |
| 51 | Result: `test result: ok. 807 passed; 0 failed; 49 ignored; 0 measured; finished in 3002.14s`, |
| 52 | plus `4 passed; 0 failed` (second binary) and doc tests `0 passed`. Exit 0. |
| 53 | |
| 54 | ## Notes |
| 55 | |
| 56 | - The E2/E3 test halves are named `more_tests.rs` and `tests.rs` on this branch (the plan's `tests_b.rs` name was not used). |
| 57 | - No test was removed, weakened or `#[ignore]`d by this lane (moves only). |
| 58 | |
| 59 | ## Left |
| 60 | |
| 61 | - Nothing in the `encode*` scope. Remaining plan sections 5d (tile, now on main), 5e (qm, now on main) |
| 62 | and 5g (cdf, now on main) are outside this lane. |