Rename functions more descriptive

This commit is contained in:
Ari Lemmetti 2019-07-09 17:26:43 +03:00
parent a348a0ec23
commit b20992a9f3
4 changed files with 16 additions and 16 deletions

View file

@ -116,7 +116,7 @@ static void work_tree_copy_down(int x_local, int y_local, int depth, lcu_t *work
} }
} }
void kvz_lcu_set_trdepth(lcu_t *lcu, int x_px, int y_px, int depth, int tr_depth) void kvz_lcu_fill_trdepth(lcu_t *lcu, int x_px, int y_px, int depth, int tr_depth)
{ {
const int x_local = SUB_SCU(x_px); const int x_local = SUB_SCU(x_px);
const int y_local = SUB_SCU(y_px); const int y_local = SUB_SCU(y_px);
@ -153,7 +153,7 @@ static void lcu_fill_cu_info(lcu_t *lcu, int x_local, int y_local, int width, in
} }
} }
static void lcu_set_inter(lcu_t *lcu, int x_local, int y_local, int cu_width) static void lcu_fill_inter(lcu_t *lcu, int x_local, int y_local, int cu_width)
{ {
const part_mode_t part_mode = LCU_GET_CU_AT_PX(lcu, x_local, y_local)->part_size; const part_mode_t part_mode = LCU_GET_CU_AT_PX(lcu, x_local, y_local)->part_size;
const int num_pu = kvz_part_mode_num_parts[part_mode]; const int num_pu = kvz_part_mode_num_parts[part_mode];
@ -170,7 +170,7 @@ static void lcu_set_inter(lcu_t *lcu, int x_local, int y_local, int cu_width)
} }
} }
static void lcu_set_coeff(lcu_t *lcu, int x_local, int y_local, int width, cu_info_t *cur_cu) static void lcu_fill_cbf(lcu_t *lcu, int x_local, int y_local, int width, cu_info_t *cur_cu)
{ {
const uint32_t tr_split = cur_cu->tr_depth - cur_cu->depth; const uint32_t tr_split = cur_cu->tr_depth - cur_cu->depth;
const uint32_t mask = ~((width >> tr_split)-1); const uint32_t mask = ~((width >> tr_split)-1);
@ -602,7 +602,7 @@ static double search_cu(encoder_state_t * const state, int x, int y, int depth,
if (cur_cu->part_size != SIZE_2Nx2N) { if (cur_cu->part_size != SIZE_2Nx2N) {
tr_depth = depth + 1; tr_depth = depth + 1;
} }
kvz_lcu_set_trdepth(lcu, x, y, depth, tr_depth); kvz_lcu_fill_trdepth(lcu, x, y, depth, tr_depth);
kvz_inter_recon_cu(state, lcu, x, y, cu_width); kvz_inter_recon_cu(state, lcu, x, y, cu_width);
@ -630,8 +630,8 @@ static double search_cu(encoder_state_t * const state, int x, int y, int depth,
} }
} }
} }
lcu_set_inter(lcu, x_local, y_local, cu_width); lcu_fill_inter(lcu, x_local, y_local, cu_width);
lcu_set_coeff(lcu, x_local, y_local, cu_width, cur_cu); lcu_fill_cbf(lcu, x_local, y_local, cu_width, cur_cu);
} }
} }
@ -665,11 +665,11 @@ static double search_cu(encoder_state_t * const state, int x, int y, int depth,
if (cur_cu->tr_depth != depth) { if (cur_cu->tr_depth != depth) {
// Reset transform depth since there are no coefficients. This // Reset transform depth since there are no coefficients. This
// ensures that CBF is cleared for the whole area of the CU. // ensures that CBF is cleared for the whole area of the CU.
kvz_lcu_set_trdepth(lcu, x, y, depth, depth); kvz_lcu_fill_trdepth(lcu, x, y, depth, depth);
} }
cur_cu->cbf = 0; cur_cu->cbf = 0;
lcu_set_coeff(lcu, x_local, y_local, cu_width, cur_cu); lcu_fill_cbf(lcu, x_local, y_local, cu_width, cur_cu);
} }
} }
@ -733,7 +733,7 @@ static double search_cu(encoder_state_t * const state, int x, int y, int depth,
cur_cu->type = CU_INTRA; cur_cu->type = CU_INTRA;
cur_cu->part_size = SIZE_2Nx2N; cur_cu->part_size = SIZE_2Nx2N;
kvz_lcu_set_trdepth(lcu, x, y, depth, cur_cu->tr_depth); kvz_lcu_fill_trdepth(lcu, x, y, depth, cur_cu->tr_depth);
lcu_fill_cu_info(lcu, x_local, y_local, cu_width, cu_width, cur_cu); lcu_fill_cu_info(lcu, x_local, y_local, cu_width, cu_width, cur_cu);
const bool has_chroma = state->encoder_control->chroma_format != KVZ_CSP_400; const bool has_chroma = state->encoder_control->chroma_format != KVZ_CSP_400;

View file

@ -43,7 +43,7 @@ double kvz_cu_rd_cost_chroma(const encoder_state_t *const state,
const int x_px, const int y_px, const int depth, const int x_px, const int y_px, const int depth,
const cu_info_t *const pred_cu, const cu_info_t *const pred_cu,
lcu_t *const lcu); lcu_t *const lcu);
void kvz_lcu_set_trdepth(lcu_t *lcu, int x_px, int y_px, int depth, int tr_depth); void kvz_lcu_fill_trdepth(lcu_t *lcu, int x_px, int y_px, int depth, int tr_depth);
void kvz_intra_recon_lcu_luma(encoder_state_t * const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu); void kvz_intra_recon_lcu_luma(encoder_state_t * const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu);
void kvz_intra_recon_lcu_chroma(encoder_state_t * const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu); void kvz_intra_recon_lcu_chroma(encoder_state_t * const state, int x, int y, int depth, int8_t intra_mode, cu_info_t *cur_cu, lcu_t *lcu);

View file

@ -1537,7 +1537,7 @@ static void search_pu_inter(encoder_state_t * const state,
if (cfg->rdo >= 2) { if (cfg->rdo >= 2) {
kvz_lcu_set_trdepth(lcu, x, y, depth, depth); kvz_lcu_fill_trdepth(lcu, x, y, depth, depth);
kvz_inter_recon_cu(state, lcu, x, y, width); kvz_inter_recon_cu(state, lcu, x, y, width);
mrg_costs[merge_idx] = kvz_satd_any_size(width, height, mrg_costs[merge_idx] = kvz_satd_any_size(width, height,
lcu->rec.y + y_local * LCU_WIDTH + x_local, LCU_WIDTH, lcu->rec.y + y_local * LCU_WIDTH + x_local, LCU_WIDTH,
@ -1572,7 +1572,7 @@ static void search_pu_inter(encoder_state_t * const state,
cur_cu->inter.mv[0][1] = info.merge_cand[merge_idx].mv[0][1]; cur_cu->inter.mv[0][1] = info.merge_cand[merge_idx].mv[0][1];
cur_cu->inter.mv[1][0] = info.merge_cand[merge_idx].mv[1][0]; cur_cu->inter.mv[1][0] = info.merge_cand[merge_idx].mv[1][0];
cur_cu->inter.mv[1][1] = info.merge_cand[merge_idx].mv[1][1]; cur_cu->inter.mv[1][1] = info.merge_cand[merge_idx].mv[1][1];
kvz_lcu_set_trdepth(lcu, x, y, depth, MAX(1, depth)); kvz_lcu_fill_trdepth(lcu, x, y, depth, MAX(1, depth));
kvz_inter_recon_cu(state, lcu, x, y, width); kvz_inter_recon_cu(state, lcu, x, y, width);
kvz_quantize_lcu_residual(state, true, false, x, y, depth, cur_cu, lcu); kvz_quantize_lcu_residual(state, true, false, x, y, depth, cur_cu, lcu);
@ -1645,7 +1645,7 @@ void kvz_cu_cost_inter_rd2(encoder_state_t * const state,
if (cur_cu->part_size != SIZE_2Nx2N) { if (cur_cu->part_size != SIZE_2Nx2N) {
tr_depth = depth + 1; tr_depth = depth + 1;
} }
kvz_lcu_set_trdepth(lcu, x, y, depth, tr_depth); kvz_lcu_fill_trdepth(lcu, x, y, depth, tr_depth);
kvz_inter_recon_cu(state, lcu, x, y, CU_WIDTH_FROM_DEPTH(depth)); kvz_inter_recon_cu(state, lcu, x, y, CU_WIDTH_FROM_DEPTH(depth));
const bool reconstruct_chroma = state->encoder_control->chroma_format != KVZ_CSP_400; const bool reconstruct_chroma = state->encoder_control->chroma_format != KVZ_CSP_400;

View file

@ -286,7 +286,7 @@ static double search_intra_trdepth(encoder_state_t * const state,
if (depth == 0 || split_cost < nosplit_cost) { if (depth == 0 || split_cost < nosplit_cost) {
return split_cost; return split_cost;
} else { } else {
kvz_lcu_set_trdepth(lcu, x_px, y_px, depth, depth); kvz_lcu_fill_trdepth(lcu, x_px, y_px, depth, depth);
pred_cu->cbf = nosplit_cbf; pred_cu->cbf = nosplit_cbf;
@ -594,7 +594,7 @@ static int8_t search_intra_rdo(encoder_state_t * const state,
FILL(pred_cu.cbf, 0); FILL(pred_cu.cbf, 0);
// Reset transform split data in lcu.cu for this area. // Reset transform split data in lcu.cu for this area.
kvz_lcu_set_trdepth(lcu, x_px, y_px, depth, depth); kvz_lcu_fill_trdepth(lcu, x_px, y_px, depth, depth);
double mode_cost = search_intra_trdepth(state, x_px, y_px, depth, tr_depth, modes[rdo_mode], MAX_INT, &pred_cu, lcu); double mode_cost = search_intra_trdepth(state, x_px, y_px, depth, tr_depth, modes[rdo_mode], MAX_INT, &pred_cu, lcu);
costs[rdo_mode] += mode_cost; costs[rdo_mode] += mode_cost;
@ -830,7 +830,7 @@ void kvz_search_cu_intra(encoder_state_t * const state,
} }
// Set transform depth to current depth, meaning no transform splits. // Set transform depth to current depth, meaning no transform splits.
kvz_lcu_set_trdepth(lcu, x_px, y_px, depth, depth); kvz_lcu_fill_trdepth(lcu, x_px, y_px, depth, depth);
// Refine results with slower search or get some results if rough search was skipped. // Refine results with slower search or get some results if rough search was skipped.
const int32_t rdo_level = state->encoder_control->cfg.rdo; const int32_t rdo_level = state->encoder_control->cfg.rdo;
if (rdo_level >= 2 || skip_rough_search) { if (rdo_level >= 2 || skip_rough_search) {