EC_AV1_TILE_THREADS now covers the search, with the measured wall
Browse files at this commitbe4ee09a191f45717f597fa7bc6e76902547bd6aParent: c69113c- docs
- EC_AV1_TILE_THREADS now covers the search, with the measured wall
1 changed file +14 -4
- crates/ec-av1/src/par.rs +14 -4
crates/ec-av1/src/par.rsmodified+14 -4
| @@ -56,11 +56,21 @@ pub(crate) fn set_filter_threads(n: usize) { | ||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /// `EC_AV1_TILE_THREADS`, how many workers the ENCODER spreads a frame's |
| 59 | -/// tiles across (default 1 = the shipped single-threaded write). Tiles are | |
| 60 | -/// entropy-independent by construction (each starts from the frame's own | |
| 61 | -/// tables and resets its own contexts), so the bytes a frame comes out as do | |
| 62 | -/// not depend on this -- `encoder::tests::tile_bytes_do_not_depend_on_the_ | |
| 59 | +/// tiles across -- both the RD/motion SEARCH (`encode::search_tiles`) and the | |
| 60 | +/// entropy WRITE (`encode::write_tiles`); default 1 = the shipped | |
| 61 | +/// single-threaded encode. Tiles are independent by construction (each starts | |
| 62 | +/// from the frame's own tables, resets its own contexts, and reads no sample | |
| 63 | +/// and no mode outside its own rectangle), so the bytes a frame comes out as | |
| 64 | +/// do not depend on this -- `encoder::tests::tile_bytes_do_not_depend_on_the_ | |
| 63 | 65 | /// thread_count` is the pin. |
| 66 | +/// | |
| 67 | +/// Measured (lane-av1tsearch, 12-core box, best of two interleaved passes): | |
| 68 | +/// 1920x1080, 12 frames -- 11.49 s at one tile (any thread count), 6.98 s at | |
| 69 | +/// 4x2 tiles and 8 threads (1.65x, 1.04 -> 1.72 fps); 3840x1608, 6 frames -- | |
| 70 | +/// 17.12 s at 4x2 tiles and one thread, 8.64 s at 8 (1.98x, 0.35 -> 0.69 | |
| 71 | +/// fps). Past ~8 tiles the extra tiles cost bytes without buying wall: what | |
| 72 | +/// is left is the per-frame serial tail (the filter search re-decodes the | |
| 73 | +/// whole frame), ~43% of an inter frame by Amdahl on those numbers. | |
| 64 | 74 | static TILE_THREADS: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0); |
| 65 | 75 | |
| 66 | 76 | pub(crate) fn tile_threads() -> usize { |