From e3b22ca2ba93af194ba41eb594029dd55b34df89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Dec 2026 15:11:38 +0300 Subject: [PATCH] S9: drop EncoderConfig::cu64; default on, so the forced 32x32 split branch it guarded was never taken --- crates/ec-h265/src/ctu.rs | 15 --------------- crates/ec-h265/src/encoder.rs | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/crates/ec-h265/src/ctu.rs b/crates/ec-h265/src/ctu.rs index 06f28a8f..153dc4e7 100644 --- a/crates/ec-h265/src/ctu.rs +++ b/crates/ec-h265/src/ctu.rs @@ -196,9 +196,6 @@ pub struct CtuEncoder<'a> { /// The skip decision for the 4x4 luma block currently in the scratch. ts_luma: bool, rqt: bool, - /// Whether a 64x64 coding tree block may stay one coding unit rather than - /// always splitting to 32x32. - cu64: bool, /// The counting CABAC engine that search prices its trials with. rdoq_enc: CabacEncoder, /// `log2` of the smallest coding unit the search will produce. @@ -240,7 +237,6 @@ impl<'a> CtuEncoder<'a> { rdoq_estimate: bool, transform_skip: TransformSkip, rqt: bool, - cu64: bool, min_cb_log2: u32, bit_depth: u32, ) -> CtuEncoder<'a> { @@ -274,7 +270,6 @@ impl<'a> CtuEncoder<'a> { ts_rd: transform_skip == TransformSkip::Rd, ts_luma: false, rqt, - cu64, rdoq_enc: { let mut enc = CabacEncoder::counter(Contexts::new(qp.clamp(0, 51))); enc.set_estimating(rdoq_estimate); @@ -439,16 +434,6 @@ impl<'a> CtuEncoder<'a> { return self.lambda * (enc.bit_count() - before) as f64 + self.code_cu(x, y, log2, depth, enc); } - if log2 > 5 && !self.cu64 { - // 64x64 coding units are not searched; the decision starts at 32x32. - let before = enc.bit_count(); - enc.encode_bin(split_ctx, 1); - let mut cost = self.lambda * (enc.bit_count() - before) as f64; - for (dx, dy) in [(0, 0), (half, 0), (0, half), (half, half)] { - cost += self.code_quadtree(x + dx, y + dy, log2 - 1, depth + 1, enc); - } - return cost; - } let start = enc.snapshot(); // The z-scan availability map has to go back with everything else: the diff --git a/crates/ec-h265/src/encoder.rs b/crates/ec-h265/src/encoder.rs index 56261806..40334659 100644 --- a/crates/ec-h265/src/encoder.rs +++ b/crates/ec-h265/src/encoder.rs @@ -227,19 +227,6 @@ pub struct EncoderConfig { /// worth +0.010 dB BD-PSNR on film and +0.080 dB on screen capture, which /// is where our gap against x265 is (see `lanes/h265-rqt-r1.report.md`). pub rqt: bool, - /// Whether a 64x64 coding tree block may stay one coding unit instead of - /// always splitting to 32x32. Only reachable with `ctb_size` 64. - /// - /// A 64x64 intra coding unit still predicts and transforms in four 32x32 - /// blocks -- 32x32 is HEVC's largest transform -- so what it buys is three - /// split flags and three mode signallings, and what it costs is one luma - /// direction for the whole 64x64. Measured in `lanes/h265-cu64-r1.report.md`. - /// - /// On by default: against x265 over the four-point ladder it is worth - /// +0.007 dB BD-PSNR on film and +0.098 dB on screen capture over always - /// splitting a 64x64 tree block, and the default `ctb_size` of 32 leaves - /// it unreachable anyway. - pub cu64: bool, /// What the samples mean, written into the VUI. pub video_signal_type: Option, /// Sample aspect ratio. @@ -339,7 +326,6 @@ impl EncoderConfig { rdoq_estimate: true, transform_skip: TransformSkip::Rd, rqt: true, - cu64: true, video_signal_type: None, sample_aspect_ratio: None, timing: None, @@ -893,7 +879,6 @@ impl Encoder { self.cfg.rdoq_estimate, self.cfg.transform_skip, self.cfg.rqt, - self.cfg.cu64, self.cfg.min_cu_size.max(8).trailing_zeros(), u32::from(self.cfg.bit_depth), );