Remove initital fast pass for 1 partition 1 plane
The optimization rarely triggers outside of synthetic test content, and costs real content 1-2% performance.
@@ -1231,23 +1231,12 @@ float compress_symbolic_block(
float mode_cutoff = ctx.config.tune_block_mode_limit / 100.0f;
- // next, test mode #0. This mode uses 1 plane of weights and 1 partition.
- // we test it twice, first with a modecutoff of 0, then with the specified mode-cutoff.
- // This causes an early-out that speeds up encoding of "easy" content.
+ // Test 1 plane of weights and 1 partition.
+ compress_symbolic_block_fixed_partition_1_plane(
+ decode_mode, mode_cutoff, ctx.config.tune_refinement_limit, bsd,
+ 1, 0, blk, ewb, tempblocks, &tmpbuf->planes);
- float modecutoffs[2];
- float errorval_mult[2] = { 2.5, 1 };
- modecutoffs[0] = 0;
- modecutoffs[1] = mode_cutoff;
-
- float best_errorval_in_mode;
- for (int i = 0; i < 2; i++)
- {
- compress_symbolic_block_fixed_partition_1_plane(decode_mode, modecutoffs[i], ctx.config.tune_refinement_limit, bsd, 1, // partition count
- 0, // partition index
- blk, ewb, tempblocks, &tmpbuf->planes);
-
- best_errorval_in_mode = 1e30f;
+ float best_errorval_in_mode = 1e30f;
for (int j = 0; j < 4; j++)
{
if (tempblocks[j].error_block)
@@ -1256,7 +1245,7 @@ float compress_symbolic_block(
}
decompress_symbolic_block(decode_mode, bsd, xpos, ypos, zpos, tempblocks + j, temp);
- float errorval = compute_imageblock_difference(bsd, blk, temp, ewb) * errorval_mult[i];
+ float errorval = compute_imageblock_difference(bsd, blk, temp, ewb);
if (errorval < best_errorval_in_mode)
{
@@ -1275,7 +1264,6 @@ float compress_symbolic_block(
{
goto END_OF_TESTS;
}
- }
int is_normal_map;
float lowest_correl;
@@ -1303,11 +1291,9 @@ float compress_symbolic_block(
continue;
}
- compress_symbolic_block_fixed_partition_2_planes(decode_mode, mode_cutoff, ctx.config.tune_refinement_limit,
- bsd, 1, // partition count
- 0, // partition index
- i, // the color component to test a separate plane of weights for.
- blk, ewb, tempblocks, &tmpbuf->planes);
+ compress_symbolic_block_fixed_partition_2_planes(
+ decode_mode, mode_cutoff, ctx.config.tune_refinement_limit, bsd,
+ 1, 0, i, blk, ewb, tempblocks, &tmpbuf->planes);
best_errorval_in_mode = 1e30f;
for (int j = 0; j < 4; j++)
