mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 11:24:05 +00:00
[tiles] Clear HMVP size properly before each leaf encoder
This commit is contained in:
parent
23170ff5a7
commit
b648bb1cd1
|
@ -119,7 +119,7 @@ static int encoder_state_config_tile_init(encoder_state_t * const state,
|
|||
state->tile->frame = kvz_videoframe_alloc(width, height, state->encoder_control->chroma_format, encoder->cfg.alf_type);
|
||||
|
||||
state->tile->frame->hmvp_lut = malloc(sizeof(cu_info_t) * height_in_lcu * MAX_NUM_HMVP_CANDS);
|
||||
state->tile->frame->hmvp_size = malloc(sizeof(uint8_t) * height_in_lcu);
|
||||
state->tile->frame->hmvp_size = calloc(1, sizeof(uint8_t) * height_in_lcu);
|
||||
|
||||
state->tile->frame->rec = NULL;
|
||||
|
||||
|
|
|
@ -850,9 +850,13 @@ static void encoder_state_encode_leaf(encoder_state_t * const state)
|
|||
// Select whether to encode the frame/tile in current thread or to define
|
||||
// wavefront jobs for other threads to handle.
|
||||
bool wavefront = state->type == ENCODER_STATE_TYPE_WAVEFRONT_ROW;
|
||||
|
||||
// Clear hmvp lut size before each leaf
|
||||
if (!wavefront) memset(state->tile->frame->hmvp_size, 0, sizeof(uint8_t) * state->tile->frame->height_in_lcu);
|
||||
else state->tile->frame->hmvp_size[state->wfrow->lcu_offset_y] = 0;
|
||||
|
||||
bool use_parallel_encoding = (wavefront && state->parent->children[1].encoder_control);
|
||||
if (!use_parallel_encoding) {
|
||||
memset(state->tile->frame->hmvp_size, 0, sizeof(uint8_t) * state->tile->frame->height_in_lcu);
|
||||
|
||||
// Encode every LCU in order and perform SAO reconstruction after every
|
||||
// frame is encoded. Deblocking and SAO search is done during LCU encoding.
|
||||
|
|
|
@ -1714,7 +1714,7 @@ uint8_t kvz_inter_get_merge_cand(const encoder_state_t * const state,
|
|||
const uint32_t ctu_row = (y >> LOG2_LCU_WIDTH);
|
||||
const uint32_t ctu_row_mul_five = ctu_row * MAX_NUM_HMVP_CANDS;
|
||||
int32_t num_cand = state->tile->frame->hmvp_size[ctu_row];
|
||||
// ToDo: VVC: verify B-frames
|
||||
|
||||
for (int i = 0; i < num_cand; i++) {
|
||||
const cu_info_t* hmvp_cand = &state->tile->frame->hmvp_lut[ctu_row_mul_five + i];
|
||||
// ToDo: Add IBC condition
|
||||
|
|
Loading…
Reference in a new issue