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> {
196 /// The skip decision for the 4x4 luma block currently in the scratch.196 /// The skip decision for the 4x4 luma block currently in the scratch.
197 ts_luma: bool,197 ts_luma: bool,
198 rqt: bool,198 rqt: bool,
199- /// Whether a 64x64 coding tree block may stay one coding unit rather than
200- /// always splitting to 32x32.
201- cu64: bool,
202 /// The counting CABAC engine that search prices its trials with.199 /// The counting CABAC engine that search prices its trials with.
203 rdoq_enc: CabacEncoder,200 rdoq_enc: CabacEncoder,
204 /// `log2` of the smallest coding unit the search will produce.201 /// `log2` of the smallest coding unit the search will produce.
@@ -240,7 +237,6 @@ impl<'a> CtuEncoder<'a> {
240 rdoq_estimate: bool,237 rdoq_estimate: bool,
241 transform_skip: TransformSkip,238 transform_skip: TransformSkip,
242 rqt: bool,239 rqt: bool,
243- cu64: bool,
244 min_cb_log2: u32,240 min_cb_log2: u32,
245 bit_depth: u32,241 bit_depth: u32,
246 ) -> CtuEncoder<'a> {242 ) -> CtuEncoder<'a> {
@@ -274,7 +270,6 @@ impl<'a> CtuEncoder<'a> {
274 ts_rd: transform_skip == TransformSkip::Rd,270 ts_rd: transform_skip == TransformSkip::Rd,
275 ts_luma: false,271 ts_luma: false,
276 rqt,272 rqt,
277- cu64,
278 rdoq_enc: {273 rdoq_enc: {
279 let mut enc = CabacEncoder::counter(Contexts::new(qp.clamp(0, 51)));274 let mut enc = CabacEncoder::counter(Contexts::new(qp.clamp(0, 51)));
280 enc.set_estimating(rdoq_estimate);275 enc.set_estimating(rdoq_estimate);
@@ -439,16 +434,6 @@ impl<'a> CtuEncoder<'a> {
439 return self.lambda * (enc.bit_count() - before) as f64434 return self.lambda * (enc.bit_count() - before) as f64
440 + self.code_cu(x, y, log2, depth, enc);435 + self.code_cu(x, y, log2, depth, enc);
441 }436 }
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- }
452 437
453 let start = enc.snapshot();438 let start = enc.snapshot();
454 // The z-scan availability map has to go back with everything else: the439 // 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 {
227 /// worth +0.010 dB BD-PSNR on film and +0.080 dB on screen capture, which227 /// worth +0.010 dB BD-PSNR on film and +0.080 dB on screen capture, which
228 /// is where our gap against x265 is (see `lanes/h265-rqt-r1.report.md`).228 /// is where our gap against x265 is (see `lanes/h265-rqt-r1.report.md`).
229 pub rqt: bool,229 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,
243 /// What the samples mean, written into the VUI.230 /// What the samples mean, written into the VUI.
244 pub video_signal_type: Option<VideoSignalType>,231 pub video_signal_type: Option<VideoSignalType>,
245 /// Sample aspect ratio.232 /// Sample aspect ratio.
@@ -339,7 +326,6 @@ impl EncoderConfig {
339 rdoq_estimate: true,326 rdoq_estimate: true,
340 transform_skip: TransformSkip::Rd,327 transform_skip: TransformSkip::Rd,
341 rqt: true,328 rqt: true,
342- cu64: true,
343 video_signal_type: None,329 video_signal_type: None,
344 sample_aspect_ratio: None,330 sample_aspect_ratio: None,
345 timing: None,331 timing: None,
@@ -893,7 +879,6 @@ impl Encoder {
893 self.cfg.rdoq_estimate,879 self.cfg.rdoq_estimate,
894 self.cfg.transform_skip,880 self.cfg.transform_skip,
895 self.cfg.rqt,881 self.cfg.rqt,
896- self.cfg.cu64,
897 self.cfg.min_cu_size.max(8).trailing_zeros(),882 self.cfg.min_cu_size.max(8).trailing_zeros(),
898 u32::from(self.cfg.bit_depth),883 u32::from(self.cfg.bit_depth),
899 );884 );