Speed feature to turn off cctx at speed > 1 (#135)
The significant run time increase in long unit tests (#135) is
mostly because cctx is on for high speed configs. Here we turn
it off for speed >= 2 to resolve this issue.
Change-Id: Ib175a5aae943bb8857b69d196b85275856cccdd0
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 7edbf48..f05e447 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -392,6 +392,9 @@
sf->tx_sf.model_based_prune_tx_search_level = 1;
sf->tx_sf.tx_type_search.use_reduced_intra_txset = 1;
sf->tx_sf.tx_type_search.skip_stx_search = 0;
+#if CONFIG_CROSS_CHROMA_TX
+ sf->tx_sf.tx_type_search.skip_cctx_search = 0;
+#endif // CONFIG_CROSS_CHROMA_TX
if (cpi->twopass.fr_content_type == FC_HIGHMOTION ||
cpi->is_screen_content_type) {
@@ -490,6 +493,9 @@
// TODO(Sachin): Enable/Enhance this speed feature for speed 2 & 3
sf->tx_sf.tx_type_search.skip_stx_search = 1;
+#if CONFIG_CROSS_CHROMA_TX
+ sf->tx_sf.tx_type_search.skip_cctx_search = 1;
+#endif // CONFIG_CROSS_CHROMA_TX
sf->intra_sf.disable_smooth_intra =
!frame_is_intra_only(&cpi->common) || (cpi->rc.frames_to_key != 1);
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 54f139e..efe6241 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -235,6 +235,10 @@
int winner_mode_tx_type_pruning;
// Speed feature to disable intra secondary transform
int skip_stx_search;
+#if CONFIG_CROSS_CHROMA_TX
+ // Speed feature to disable cross chroma component transform
+ int skip_cctx_search;
+#endif // CONFIG_CROSS_CHROMA_TX
} TX_TYPE_SEARCH;
enum {
diff --git a/av1/encoder/tx_search.c b/av1/encoder/tx_search.c
index 26da00c..c72d794 100644
--- a/av1/encoder/tx_search.c
+++ b/av1/encoder/tx_search.c
@@ -2861,7 +2861,8 @@
// Intra mode needs decoded pixels such that the next transform block
// can use them for prediction. If cctx is enabled, this reconstruction
// should be done later in search_cctx_type, when cctx type is chosen.
- if (plane == AOM_PLANE_Y || !is_cctx_allowed(cm, xd)) {
+ if (plane == AOM_PLANE_Y || !is_cctx_allowed(cm, xd) ||
+ cpi->sf.tx_sf.tx_type_search.skip_cctx_search) {
recon_intra(cpi, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
txb_ctx, skip_trellis, best_tx_type, 0, &rate_cost, best_eob);
p->dqcoeff = orig_dqcoeff;
@@ -4606,7 +4607,8 @@
const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd);
int is_cost_valid = 1;
#if CONFIG_CROSS_CHROMA_TX
- if (is_cctx_allowed(&cpi->common, xd)) {
+ if (is_cctx_allowed(&cpi->common, xd) &&
+ !cpi->sf.tx_sf.tx_type_search.skip_cctx_search) {
RD_STATS this_rd_stats;
int64_t chroma_ref_best_rd = ref_best_rd;
if (cpi->sf.inter_sf.perform_best_rd_based_gating_for_chroma && is_inter &&