From b0b2b0e536bb928b57bed9814a8a4713efebd0d7 Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Mon, 29 Aug 2022 14:11:08 +0300 Subject: [PATCH] Try making ultrafast all intra a bit faster --- src/search.c | 21 +++++++++++---------- src/search_intra.c | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/search.c b/src/search.c index 2e594126..b76c169a 100644 --- a/src/search.c +++ b/src/search.c @@ -974,13 +974,14 @@ static double search_cu( else { intra_search.pred_cu.intra.mode_chroma = 0; } - uvg_intra_recon_cu(state, - x, y, - depth, &intra_search, - &intra_search.pred_cu, - lcu, - tree_type, false, true); - if(tree_type != UVG_CHROMA_T) { + + if(tree_type != UVG_CHROMA_T && ctrl->cfg.rdo >= 2) { + uvg_intra_recon_cu(state, + x, y, + depth, &intra_search, + &intra_search.pred_cu, + lcu, + tree_type, false, true); intra_cost += uvg_cu_rd_cost_chroma(state, x_local, y_local, depth, &intra_search.pred_cu, lcu); } else { @@ -1201,9 +1202,9 @@ static double search_cu( // the split costs at least as much as not splitting. if (cur_cu->type == CU_NOTSET || cbf || state->encoder_control->cfg.cu_split_termination == UVG_CU_SPLIT_TERMINATION_OFF) { if (split_cost < cost) split_cost += search_cu(state, x, y, depth + 1, work_tree, tree_type); - if (split_cost < cost || 1) split_cost += search_cu(state, x + half_cu, y, depth + 1, work_tree, tree_type); - if (split_cost < cost || 1) split_cost += search_cu(state, x, y + half_cu, depth + 1, work_tree, tree_type); - if (split_cost < cost || 1) split_cost += search_cu(state, x + half_cu, y + half_cu, depth + 1, work_tree, tree_type); + if (split_cost < cost) split_cost += search_cu(state, x + half_cu, y, depth + 1, work_tree, tree_type); + if (split_cost < cost) split_cost += search_cu(state, x, y + half_cu, depth + 1, work_tree, tree_type); + if (split_cost < cost) split_cost += search_cu(state, x + half_cu, y + half_cu, depth + 1, work_tree, tree_type); } else { split_cost = INT_MAX; } diff --git a/src/search_intra.c b/src/search_intra.c index 9c7b4115..a314d5d3 100644 --- a/src/search_intra.c +++ b/src/search_intra.c @@ -1075,7 +1075,7 @@ static uint8_t search_intra_rough( FILL(search_proxy, 0); search_proxy.pred_cu = *pred_cu; - int offset = 4; + int offset = 8; search_proxy.pred_cu.intra.mode = 0; uvg_intra_predict(state, refs, &loc, COLOR_Y, preds[0], &search_proxy, NULL, UVG_LUMA_T); search_proxy.pred_cu.intra.mode = 1;