forge
Explore
Log in

Don't you dare go Hollow

S9: drop EncoderConfig::inter_lambda_scale; default 1.0 makes the multiply an exact no-op

Browse files at this commit

c4a3d04162856fd316bc11afd277852a48dce826Ahmet Kaan GümüşParent: e3b22ca
crates/ec-h265/examples/hevc_gop.rsmodified+0 -7
@@ -93,13 +93,6 @@ fn run() -> Result<(), String> {
93 cfg.keep_recon = true;93 cfg.keep_recon = true;
94 // Optional trailing flags: `sh` turns sign data hiding on.94 // Optional trailing flags: `sh` turns sign data hiding on.
95 cfg.sign_hiding = args.iter().skip(9).any(|a| a == "sh");95 cfg.sign_hiding = args.iter().skip(9).any(|a| a == "sh");
96- // Sweep override of the P-mode decision lambda scale (experiments only).
97- if let Some(v) = std::env::var("EC_INTER_LAMBDA_SCALE")
98- .ok()
99- .and_then(|v| v.parse::<f64>().ok())
100- {
101- cfg.inter_lambda_scale = v;
102- }
103 // Experiments: worker threads and the P-picture wavefront (`0` or `off`).96 // Experiments: worker threads and the P-picture wavefront (`0` or `off`).
104 if let Some(v) = std::env::var("EC_H265_THREADS")97 if let Some(v) = std::env::var("EC_H265_THREADS")
105 .ok()98 .ok()
crates/ec-h265/src/enc_p.rsmodified+1 -1
@@ -624,7 +624,7 @@ impl<'a> PCoder<'a> {
624 bd,624 bd,
625 qpd,625 qpd,
626 qpc,626 qpc,
627- lambda: lambda_for(qpd) * enc.cfg.inter_lambda_scale,627+ lambda: lambda_for(qpd),
628 // The search measures SAD on 8-bit samples, so its lambda is the 8-bit one.628 // The search measures SAD on 8-bit samples, so its lambda is the 8-bit one.
629 search_lambda: lambda_for(qp).sqrt(),629 search_lambda: lambda_for(qp).sqrt(),
630 sign_hiding: enc.cfg.sign_hiding,630 sign_hiding: enc.cfg.sign_hiding,
crates/ec-h265/src/encoder.rsmodified+0 -9
@@ -266,14 +266,6 @@ pub struct EncoderConfig {
266 /// against off, the single continuous substream the sequential coder writes.266 /// against off, the single continuous substream the sequential coder writes.
267 /// Off also makes P pictures single-threaded.267 /// Off also makes P pictures single-threaded.
268 pub inter_wpp: bool,268 pub inter_wpp: bool,
269- /// Scale on the lambda the P-picture mode decisions use, against
270- /// `lambda_for(qp)` (the intra lambda, in squared-error units per bit). The
271- /// motion search uses `sqrt(lambda_for(qp))` instead, because it costs SAD.
272- ///
273- /// Measured with `scripts/hevc-bdrate.sh` (ffmpeg PSNR, bframes=0 x265
274- /// anchor, 352x288, QPs 22/27/32/37), BD-rate against x265: +21.9% at scale 1,
275- /// +23.4% at 1/4, +28.9% at 1/16. Scale 1 is the default.
276- pub inter_lambda_scale: f64,
277 /// Whether a sequence with P pictures (`keyint > 1`) codes its IDR pictures with the269 /// Whether a sequence with P pictures (`keyint > 1`) codes its IDR pictures with the
278 /// fast intra tool set: no RDOQ, one full-RD intra candidate, no NxN split, no transform270 /// fast intra tool set: no RDOQ, one full-RD intra candidate, no NxN split, no transform
279 /// skip trial, no transform-tree split. An IDR is one picture in `keyint`, so what271 /// skip trial, no transform-tree split. An IDR is one picture in `keyint`, so what
@@ -337,7 +329,6 @@ impl EncoderConfig {
337 keep_recon: false,329 keep_recon: false,
338 keyint: 1,330 keyint: 1,
339 inter_wpp: true,331 inter_wpp: true,
340- inter_lambda_scale: 1.0,
341 gop_fast_idr: true,332 gop_fast_idr: true,
342 bit_depth: 8,333 bit_depth: 8,
343 speed: Preset::Default,334 speed: Preset::Default,