Cleanup the handling of prune_palette_search_level = 0
This CL unifies the handling of the sf prune_palette_search_level
for the values 0 and 2. The separate handling for sf = 0 was
introduced when sf = 2 path performed the palette_size search in
descending order followed by ascending order. Now that the order
of evaluation is changed in sf = 2 path, the sf = 0 path could
also be handled under a common else part together with sf = 2
handling.
BUG=aomedia:3096
Change-Id: Id8eb3d9d9bc7f9feaa97090a28a17cf481753abb
diff --git a/av1/encoder/palette.c b/av1/encoder/palette.c
index 7b653b2..c698b91 100644
--- a/av1/encoder/palette.c
+++ b/av1/encoder/palette.c
@@ -619,36 +619,6 @@
distortion, skippable, beat_best_rd, ctx, best_blk_skip,
tx_type_map, color_map, rows * cols, NULL);
}
- } else if (cpi->sf.intra_sf.prune_palette_search_level == 0) {
- const int max_n = AOMMIN(colors, PALETTE_MAX_SIZE),
- min_n = PALETTE_MIN_SIZE;
- // Perform top color palette search in ascending order.
- perform_top_color_palette_search(
- cpi, x, mbmi, bsize, dc_mode_cost, data, top_colors, min_n, max_n + 1,
- 1, do_header_rd_based_gating, &unused, color_cache, n_cache,
- best_mbmi, best_palette_color_map, best_rd, rate, rate_tokenonly,
- distortion, skippable, beat_best_rd, ctx, best_blk_skip, tx_type_map,
- NULL);
- // K-means clustering.
- if (colors == PALETTE_MIN_SIZE) {
- // Special case: These colors automatically become the centroids.
- assert(colors == 2);
- centroids[0] = lower_bound;
- centroids[1] = upper_bound;
- palette_rd_y(cpi, x, mbmi, bsize, dc_mode_cost, data, centroids, colors,
- color_cache, n_cache, /*do_header_rd_based_gating=*/false,
- best_mbmi, best_palette_color_map, best_rd, rate,
- rate_tokenonly, distortion, skippable, beat_best_rd, ctx,
- best_blk_skip, tx_type_map, NULL, NULL);
- } else {
- // Perform k-means palette search in ascending order.
- perform_k_means_palette_search(
- cpi, x, mbmi, bsize, dc_mode_cost, data, lower_bound, upper_bound,
- min_n, max_n + 1, 1, do_header_rd_based_gating, &unused,
- color_cache, n_cache, best_mbmi, best_palette_color_map, best_rd,
- rate, rate_tokenonly, distortion, skippable, beat_best_rd, ctx,
- best_blk_skip, tx_type_map, color_map, rows * cols, NULL);
- }
} else {
const int max_n = AOMMIN(colors, PALETTE_MAX_SIZE),
min_n = PALETTE_MIN_SIZE;