The palette colour bound ships at 128, not 32
Browse files at this commit7aa07927329c813f733607dbe3c4c228a5d06008Parent: 530272b- perf
- the palette colour bound ships at 128, not 32
1 changed file +10 -1
- crates/ec-av1/src/encode.rs +10 -1
crates/ec-av1/src/encode.rsmodified+10 -1
| @@ -2338,6 +2338,15 @@ fn commit_inter_luma( | |||
| 2338 | /// The largest distinct-colour count a block may hold and still be offered a | 2338 | /// The largest distinct-colour count a block may hold and still be offered a |
| 2339 | /// palette candidate at all: past it the k-means quantisation costs more | 2339 | /// palette candidate at all: past it the k-means quantisation costs more |
| 2340 | /// error than the map saves rate, and every trial is wasted wall. | 2340 | /// error than the map saves rate, and every trial is wasted wall. |
| 2341 | +/// | ||
| 2342 | +/// Swept on the gate's own screen capture (lane-av1pal2, the | ||
| 2343 | +/// `unswept-decision-constants` class): 32 (the value this lane inherited) | ||
| 2344 | +/// finds 515 palette blocks and scores +66.4%/+10.3% vs libaom/rav1e, 64 | ||
| 2345 | +/// finds 1264 and scores +57.1%/+3.2%, 128 finds 1102 and scores | ||
| 2346 | +/// +56.9%/+2.3%, and 256 is byte-identical to 128 -- above 128 the bound | ||
| 2347 | +/// binds on nothing this content holds. 128 ships: best BD against both | ||
| 2348 | +/// references and no wall cost at all (6.1s, the same as at 32, because the | ||
| 2349 | +/// blocks it newly admits are ones the RD then keeps). | ||
| 2341 | /// `EC_AV1_PAL_MAXCOLORS`. | 2350 | /// `EC_AV1_PAL_MAXCOLORS`. |
| 2342 | fn palette_max_colors() -> usize { | 2351 | fn palette_max_colors() -> usize { |
| 2343 | static N: std::sync::OnceLock<usize> = std::sync::OnceLock::new(); | 2352 | static N: std::sync::OnceLock<usize> = std::sync::OnceLock::new(); |
| @@ -2345,7 +2354,7 @@ fn palette_max_colors() -> usize { | |||
| 2345 | std::env::var("EC_AV1_PAL_MAXCOLORS") | 2354 | std::env::var("EC_AV1_PAL_MAXCOLORS") |
| 2346 | .ok() | 2355 | .ok() |
| 2347 | .and_then(|v| v.parse().ok()) | 2356 | .and_then(|v| v.parse().ok()) |
| 2348 | - .unwrap_or(32) | 2357 | + .unwrap_or(128) |
| 2349 | }) | 2358 | }) |
| 2350 | } | 2359 | } |
| 2351 | 2360 | ||