S9: drop EncoderConfig::cu64; default on, so the forced 32x32 split branch it guarded was never taken
Browse files at this commite3b22ca2ba93af194ba41eb594029dd55b34df89Parent: 4fd4ed42 changed files +0 -30
- crates/ec-h265/src/ctu.rs +0 -15
- crates/ec-h265/src/encoder.rs +0 -15
crates/ec-h265/src/ctu.rsmodified+0 -15
| @@ -196,9 +196,6 @@ pub struct CtuEncoder<'a> { | ||
| 196 | 196 | /// The skip decision for the 4x4 luma block currently in the scratch. |
| 197 | 197 | ts_luma: bool, |
| 198 | 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 | 199 | /// The counting CABAC engine that search prices its trials with. |
| 203 | 200 | rdoq_enc: CabacEncoder, |
| 204 | 201 | /// `log2` of the smallest coding unit the search will produce. |
| @@ -240,7 +237,6 @@ impl<'a> CtuEncoder<'a> { | ||
| 240 | 237 | rdoq_estimate: bool, |
| 241 | 238 | transform_skip: TransformSkip, |
| 242 | 239 | rqt: bool, |
| 243 | - cu64: bool, | |
| 244 | 240 | min_cb_log2: u32, |
| 245 | 241 | bit_depth: u32, |
| 246 | 242 | ) -> CtuEncoder<'a> { |
| @@ -274,7 +270,6 @@ impl<'a> CtuEncoder<'a> { | ||
| 274 | 270 | ts_rd: transform_skip == TransformSkip::Rd, |
| 275 | 271 | ts_luma: false, |
| 276 | 272 | rqt, |
| 277 | - cu64, | |
| 278 | 273 | rdoq_enc: { |
| 279 | 274 | let mut enc = CabacEncoder::counter(Contexts::new(qp.clamp(0, 51))); |
| 280 | 275 | enc.set_estimating(rdoq_estimate); |
| @@ -439,16 +434,6 @@ impl<'a> CtuEncoder<'a> { | ||
| 439 | 434 | return self.lambda * (enc.bit_count() - before) as f64 |
| 440 | 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 | 438 | let start = enc.snapshot(); |
| 454 | 439 | // 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 | 227 | /// worth +0.010 dB BD-PSNR on film and +0.080 dB on screen capture, which |
| 228 | 228 | /// is where our gap against x265 is (see `lanes/h265-rqt-r1.report.md`). |
| 229 | 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 | 230 | /// What the samples mean, written into the VUI. |
| 244 | 231 | pub video_signal_type: Option<VideoSignalType>, |
| 245 | 232 | /// Sample aspect ratio. |
| @@ -339,7 +326,6 @@ impl EncoderConfig { | ||
| 339 | 326 | rdoq_estimate: true, |
| 340 | 327 | transform_skip: TransformSkip::Rd, |
| 341 | 328 | rqt: true, |
| 342 | - cu64: true, | |
| 343 | 329 | video_signal_type: None, |
| 344 | 330 | sample_aspect_ratio: None, |
| 345 | 331 | timing: None, |
| @@ -893,7 +879,6 @@ impl Encoder { | ||
| 893 | 879 | self.cfg.rdoq_estimate, |
| 894 | 880 | self.cfg.transform_skip, |
| 895 | 881 | self.cfg.rqt, |
| 896 | - self.cfg.cu64, | |
| 897 | 882 | self.cfg.min_cu_size.max(8).trailing_zeros(), |
| 898 | 883 | u32::from(self.cfg.bit_depth), |
| 899 | 884 | ); |