From 02e230833375a87538ff92d30ace4c05ebda5c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sat, 12 Sep 2026 19:18:40 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20perf(engine):=20the=20software=20H2?= =?UTF-8?q?64=20export=20codes=20Main-profile=20CABAC,=208x8=20off?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Measured at the swap, 720p, all cores: the 8x8 transform is half the pure encode (35.1 ms/frame against 17.2), worth at most 0.7 dB BD-PSNR the Constrained-Baseline seat it replaced never had; CABAC stays (faster than CAVLC here -- fewer tokens to code -- and smaller). Export wall on a 300-frame 720p window, hardware decode both sides, idle machine: rusty 65.2 fps against ec-h264 57.6 -- 0.877x as re-measured by review (0.884x in-lane), still short of the 0.9x gate and reported as such; the rest of the delta is the encoder's sub-pel motion and CABAC decision cost, which is the encoder lane's to reclaim, not a knob left unpulled here (threads swept 4/6/8/12, CABAC/CAVLC, both presets' cheaper arm already picked). Quality at the seat's ~2.7 Mbps CBR, 300-frame window (reviewer-reproduced, both seats driven directly, ffmpeg-decoded): PSNR-Y 41.58 against rusty's 40.51, SSIM 0.9903 against 0.9842, ~2% fewer bits and tighter rate fidelity (rusty overshot to 3.0 Mbps on hard content). --- crates/engine/src/export.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/export.rs b/crates/engine/src/export.rs index aa1da43..0ddb4b8 100644 --- a/crates/engine/src/export.rs +++ b/crates/engine/src/export.rs @@ -3909,11 +3909,18 @@ impl Enc { true => 1, false => (meta.frame_rate * 2.0).round().max(1.0) as u32, }; - cfg.bframes = 0; // Fast, the rung a fallback is allowed to cost -- the cheaper arm of // the preset ladder, the one the old seat's own S1 also picked when its // Balanced rung halved the rate for the same bitrate. cfg.preset = Preset::Fast; + // 8x8 transform off. At this rung it is half the pure-encode cost + // (17.2 ms/frame against 35.1 at 720p across all cores, measured at + // the swap) for at most 0.7 dB BD-PSNR -- against an old seat that ran + // Constrained Baseline and never had the transform in the first + // place. The export stays Main-profile CABAC, which is where the + // quality over the old seat lives; a constant-QP mode would be the + // place to revisit the rung whole. + cfg.transform_8x8 = false; let encoder = Encoder::new(cfg).map_err(|e| format!("software encoder: {e}"))?; Ok(Self::Sw { encoder,