Commit c4886a38 authored by Yushin Cho's avatar Yushin Cho Committed by Yushin Cho

Allow rectangular partition at leaf nodes of topdown partition search

speed 5, (encoding time increase 14%~1%)
   PSNR | PSNR Cb | PSNR Cr | PSNR HVS |    SSIM | MS SSIM | CIEDE 2000
-1.4529 | -1.9177 | -1.8769 |  -1.4698 | -1.3873 | -1.3750 |    -1.6576

speed 1, 5 frames, (encoding time increase 44%~11%)
   PSNR | PSNR Cb | PSNR Cr | PSNR HVS |    SSIM | MS SSIM | CIEDE 2000
-1.3921 | -2.0810 | -1.5809 |  -1.4713 | -1.2711 | -1.2584 |    -1.7207
parent ef7a66a2
......@@ -208,13 +208,17 @@ impl SpeedSettings {
/// This preset is set this way because 8x8 with reduced TX set is faster but with equivalent
/// or better quality compared to 16x16 or 32x32 (to which reduced TX set does not apply).
fn min_block_size_preset(speed: usize) -> BlockSize {
if speed == 0 {
BlockSize::BLOCK_4X4
} else if speed <= 8 {
BlockSize::BLOCK_8X8
} else {
BlockSize::BLOCK_64X64
}
let min_block_size =
if speed == 0 {
BlockSize::BLOCK_4X4
} else if speed <= 8 {
BlockSize::BLOCK_8X8
} else {
BlockSize::BLOCK_64X64
};
// Topdown search checks min_block_size for PARTITION_SPLIT only, so min_block_size must be square.
assert!(min_block_size.is_sqr());
min_block_size
}
/// Multiref is enabled automatically if low_latency is false,
......
......@@ -608,6 +608,7 @@ impl<T: Pixel> FrameInvariants<T> {
// with exception that SBs on right or bottom frame borders split down to BLOCK_4X4.
// At speed = 0, RDO search is exhaustive.
let min_partition_size = config.speed_settings.min_block_size;
assert!(min_partition_size.is_sqr());
let use_reduced_tx_set = config.speed_settings.reduced_tx_set;
let use_tx_domain_distortion = config.tune == Tune::Psnr && config.speed_settings.tx_domain_distortion;
let use_tx_domain_rate = config.speed_settings.tx_domain_rate;
......@@ -1893,15 +1894,16 @@ fn encode_partition_topdown<T: Pixel>(
// Oversized blocks are split automatically
partition = PartitionType::PARTITION_SPLIT;
} else if must_split || (bsize > fi.min_partition_size && is_square) {
debug_assert!(bsize.is_sqr());
// Blocks of sizes within the supported range are subjected to a partitioning decision
let mut partition_types: Vec<PartitionType> = Vec::new();
if must_split {
partition_types.push(PartitionType::PARTITION_SPLIT);
if split_horz { partition_types.push(PartitionType::PARTITION_HORZ); };
if split_vert { partition_types.push(PartitionType::PARTITION_VERT); };
}
else {
//partition_types.append(&mut RAV1E_PARTITION_TYPES.to_vec());
} else if bsize.width_log2() == fi.min_partition_size.width_log2() + 1 {
partition_types.extend_from_slice(RAV1E_PARTITION_TYPES);
} else {
partition_types.push(PartitionType::PARTITION_NONE);
partition_types.push(PartitionType::PARTITION_SPLIT);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment