8x8 transform on by default
Browse files at this commite6fcc5cc2788e495935cd800044f63dc8e2915b3Parent: d563e2c- feat
- 8x8 transform on by default
2 changed files +8 -7
crates/ec-h264/src/enc/mod.rsmodified+7 -6
| @@ -74,12 +74,12 @@ pub struct EncoderConfig { | ||
| 74 | 74 | pub threads: usize, |
| 75 | 75 | /// Quantiser for constant-QP mode (`bitrate` zero). |
| 76 | 76 | pub qp: i32, |
| 77 | - /// 8x8 transform (High profile). Off by default. | |
| 77 | + /// 8x8 transform (High profile). On by default, as it is in x264. | |
| 78 | 78 | /// |
| 79 | - /// When enabled, eligible intra and inter luma macroblocks write | |
| 80 | - /// `transform_size_8x8_flag` and choose the 8x8 path with a squared-error | |
| 81 | - /// rate-distortion cost. Leaving it off preserves the Baseline/Main-profile | |
| 82 | - /// 4x4 path. | |
| 79 | + /// Eligible intra and inter luma macroblocks write `transform_size_8x8_flag` | |
| 80 | + /// and choose the 8x8 path with a squared-error rate-distortion cost. | |
| 81 | + /// Turning it off restricts the stream to the Baseline/Main-profile 4x4 | |
| 82 | + /// path, which costs 0.7 dB BD-PSNR on film and 0.2 dB on screen capture. | |
| 83 | 83 | pub transform_8x8: bool, |
| 84 | 84 | #[cfg(feature = "rd-ablation")] |
| 85 | 85 | rd_lambda_standard: bool, |
| @@ -107,7 +107,7 @@ impl EncoderConfig { | ||
| 107 | 107 | cabac: true, |
| 108 | 108 | threads: 0, |
| 109 | 109 | qp: 26, |
| 110 | - transform_8x8: false, | |
| 110 | + transform_8x8: true, | |
| 111 | 111 | #[cfg(feature = "rd-ablation")] |
| 112 | 112 | rd_lambda_standard: false, |
| 113 | 113 | #[cfg(feature = "rd-ablation")] |
| @@ -994,6 +994,7 @@ mod tests { | ||
| 994 | 994 | #[test] |
| 995 | 995 | fn production_lambda_tracks_transform_mode() { |
| 996 | 996 | let mut cfg = EncoderConfig::new(640, 480); |
| 997 | + cfg.transform_8x8 = false; | |
| 997 | 998 | assert_eq!( |
| 998 | 999 | lambda_for(26, rd_lambda_standard(&cfg)), |
| 999 | 1000 | lambda_for(26, false) |
crates/ec-h264/tests/encode.rsmodified+1 -1
| @@ -913,7 +913,7 @@ fn clip_sources(path: &std::ffi::OsStr, want: usize) -> (usize, usize, Vec<Plane | ||
| 913 | 913 | (w, h, sources) |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | -/// BD-PSNR of the opt-in `transform_8x8` flag against flag-off on one real | |
| 916 | +/// BD-PSNR of the `transform_8x8` flag (on by default) against flag-off on one real | |
| 917 | 917 | /// clip from the library, full size, over a QP sweep: the number the synthetic |
| 918 | 918 | /// gate above cannot give, because the synthetic clip is content the flag wins |
| 919 | 919 | /// on. Prints the per-QP points, the BD-PSNR and the 8x8 macroblock share; |