mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 10:34:05 +00:00
Split lcu_set_inter into two functions.
Moves code for setting the inter modes for a single PU to a new function lcu_set_inter_pu.
This commit is contained in:
parent
3236428e4d
commit
410064e880
32
src/search.c
32
src/search.c
|
@ -224,21 +224,8 @@ static void lcu_set_intra_mode(lcu_t *lcu, int x_px, int y_px, int depth, int pr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void lcu_set_inter(lcu_t *lcu, int x_px, int y_px, int depth, cu_info_t *cur_cu)
|
static void lcu_set_inter_pu(lcu_t *lcu, int x_pu, int y_pu, int width_pu, int height_pu, cu_info_t *cur_pu)
|
||||||
{
|
{
|
||||||
const int width_cu = LCU_CU_WIDTH >> depth;
|
|
||||||
const int x_cu = SUB_SCU(x_px) >> MAX_DEPTH;
|
|
||||||
const int y_cu = SUB_SCU(y_px) >> MAX_DEPTH;
|
|
||||||
const int num_pu = kvz_part_mode_num_parts[cur_cu->part_size];
|
|
||||||
|
|
||||||
for (int i = 0; i < num_pu; ++i) {
|
|
||||||
const int x_pu = PU_GET_X(cur_cu->part_size, width_cu, x_cu, i);
|
|
||||||
const int y_pu = PU_GET_Y(cur_cu->part_size, width_cu, y_cu, i);
|
|
||||||
const int width_pu = PU_GET_W(cur_cu->part_size, width_cu, i);
|
|
||||||
const int height_pu = PU_GET_H(cur_cu->part_size, width_cu, i);
|
|
||||||
|
|
||||||
cu_info_t *cur_pu = LCU_GET_CU(lcu, x_pu, y_pu);
|
|
||||||
|
|
||||||
// Set mode in every CU covered by part_mode in this depth.
|
// Set mode in every CU covered by part_mode in this depth.
|
||||||
for (int y = y_pu; y < y_pu + height_pu; ++y) {
|
for (int y = y_pu; y < y_pu + height_pu; ++y) {
|
||||||
for (int x = x_pu; x < x_pu + width_pu; ++x) {
|
for (int x = x_pu; x < x_pu + width_pu; ++x) {
|
||||||
|
@ -256,6 +243,23 @@ static void lcu_set_inter(lcu_t *lcu, int x_px, int y_px, int depth, cu_info_t *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void lcu_set_inter(lcu_t *lcu, int x_px, int y_px, int depth, cu_info_t *cur_cu)
|
||||||
|
{
|
||||||
|
const int width_cu = LCU_CU_WIDTH >> depth;
|
||||||
|
const int x_cu = SUB_SCU(x_px) >> MAX_DEPTH;
|
||||||
|
const int y_cu = SUB_SCU(y_px) >> MAX_DEPTH;
|
||||||
|
const int num_pu = kvz_part_mode_num_parts[cur_cu->part_size];
|
||||||
|
|
||||||
|
for (int i = 0; i < num_pu; ++i) {
|
||||||
|
const int x_pu = PU_GET_X(cur_cu->part_size, width_cu, x_cu, i);
|
||||||
|
const int y_pu = PU_GET_Y(cur_cu->part_size, width_cu, y_cu, i);
|
||||||
|
const int width_pu = PU_GET_W(cur_cu->part_size, width_cu, i);
|
||||||
|
const int height_pu = PU_GET_H(cur_cu->part_size, width_cu, i);
|
||||||
|
cu_info_t *cur_pu = LCU_GET_CU(lcu, x_pu, y_pu);
|
||||||
|
lcu_set_inter_pu(lcu, x_pu, y_pu, width_pu, height_pu, cur_pu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue