forge
Explore
Log in

Don't you dare go Hollow

S9: drop EncoderConfig::cu64; default on, so the forced 32x32 split branch it guarded was never taken

Browse files at this commit

e3b22ca2ba93af194ba41eb594029dd55b34df89Ahmet Kaan GümüşParent: 4fd4ed4
crates/ec-h265/src/ctu.rsmodified+0 -15
@@ -196,9 +196,6 @@ pub struct CtuEncoder<'a> {
196196 /// The skip decision for the 4x4 luma block currently in the scratch.
197197 ts_luma: bool,
198198 rqt: bool,
199- /// Whether a 64x64 coding tree block may stay one coding unit rather than
200- /// always splitting to 32x32.
201- cu64: bool,
202199 /// The counting CABAC engine that search prices its trials with.
203200 rdoq_enc: CabacEncoder,
204201 /// `log2` of the smallest coding unit the search will produce.
@@ -240,7 +237,6 @@ impl<'a> CtuEncoder<'a> {
240237 rdoq_estimate: bool,
241238 transform_skip: TransformSkip,
242239 rqt: bool,
243- cu64: bool,
244240 min_cb_log2: u32,
245241 bit_depth: u32,
246242 ) -> CtuEncoder<'a> {
@@ -274,7 +270,6 @@ impl<'a> CtuEncoder<'a> {
274270 ts_rd: transform_skip == TransformSkip::Rd,
275271 ts_luma: false,
276272 rqt,
277- cu64,
278273 rdoq_enc: {
279274 let mut enc = CabacEncoder::counter(Contexts::new(qp.clamp(0, 51)));
280275 enc.set_estimating(rdoq_estimate);
@@ -439,16 +434,6 @@ impl<'a> CtuEncoder<'a> {
439434 return self.lambda * (enc.bit_count() - before) as f64
440435 + self.code_cu(x, y, log2, depth, enc);
441436 }
442- if log2 > 5 && !self.cu64 {
443- // 64x64 coding units are not searched; the decision starts at 32x32.
444- let before = enc.bit_count();
445- enc.encode_bin(split_ctx, 1);
446- let mut cost = self.lambda * (enc.bit_count() - before) as f64;
447- for (dx, dy) in [(0, 0), (half, 0), (0, half), (half, half)] {
448- cost += self.code_quadtree(x + dx, y + dy, log2 - 1, depth + 1, enc);
449- }
450- return cost;
451- }
452437
453438 let start = enc.snapshot();
454439 // The z-scan availability map has to go back with everything else: the
crates/ec-h265/src/encoder.rsmodified+0 -15
@@ -227,19 +227,6 @@ pub struct EncoderConfig {
227227 /// worth +0.010 dB BD-PSNR on film and +0.080 dB on screen capture, which
228228 /// is where our gap against x265 is (see `lanes/h265-rqt-r1.report.md`).
229229 pub rqt: bool,
230- /// Whether a 64x64 coding tree block may stay one coding unit instead of
231- /// always splitting to 32x32. Only reachable with `ctb_size` 64.
232- ///
233- /// A 64x64 intra coding unit still predicts and transforms in four 32x32
234- /// blocks -- 32x32 is HEVC's largest transform -- so what it buys is three
235- /// split flags and three mode signallings, and what it costs is one luma
236- /// direction for the whole 64x64. Measured in `lanes/h265-cu64-r1.report.md`.
237- ///
238- /// On by default: against x265 over the four-point ladder it is worth
239- /// +0.007 dB BD-PSNR on film and +0.098 dB on screen capture over always
240- /// splitting a 64x64 tree block, and the default `ctb_size` of 32 leaves
241- /// it unreachable anyway.
242- pub cu64: bool,
243230 /// What the samples mean, written into the VUI.
244231 pub video_signal_type: Option<VideoSignalType>,
245232 /// Sample aspect ratio.
@@ -339,7 +326,6 @@ impl EncoderConfig {
339326 rdoq_estimate: true,
340327 transform_skip: TransformSkip::Rd,
341328 rqt: true,
342- cu64: true,
343329 video_signal_type: None,
344330 sample_aspect_ratio: None,
345331 timing: None,
@@ -893,7 +879,6 @@ impl Encoder {
893879 self.cfg.rdoq_estimate,
894880 self.cfg.transform_skip,
895881 self.cfg.rqt,
896- self.cfg.cu64,
897882 self.cfg.min_cu_size.max(8).trailing_zeros(),
898883 u32::from(self.cfg.bit_depth),
899884 );