[LMCS] free source_lmcs and rec_lmcs in encoder_state_encode (as done with normal source and rec)

This commit is contained in:
Marko Viitanen 2021-05-25 17:42:34 +03:00
parent 1b8c8b2c68
commit e9044bfbc5

View file

@ -1105,10 +1105,15 @@ static void encoder_state_encode(encoder_state_t * const main_state) {
width, width,
height height
); );
sub_state->tile->frame->source_lmcs = sub_state->tile->frame->source;
sub_state->tile->frame->rec_lmcs = sub_state->tile->frame->rec;
if (sub_state->encoder_control->cfg.lmcs_enable) { if (sub_state->encoder_control->cfg.lmcs_enable) {
kvz_image_free(sub_state->tile->frame->source_lmcs);
sub_state->tile->frame->source_lmcs = NULL;
kvz_image_free(sub_state->tile->frame->rec_lmcs);
sub_state->tile->frame->rec_lmcs = NULL;
sub_state->tile->frame->source_lmcs = kvz_image_make_subimage( sub_state->tile->frame->source_lmcs = kvz_image_make_subimage(
main_state->tile->frame->source_lmcs, main_state->tile->frame->source_lmcs,
offset_x, offset_x,
@ -1125,6 +1130,9 @@ static void encoder_state_encode(encoder_state_t * const main_state) {
); );
sub_state->tile->frame->source_lmcs_mapped = true; sub_state->tile->frame->source_lmcs_mapped = true;
} else {
sub_state->tile->frame->source_lmcs = sub_state->tile->frame->source;
sub_state->tile->frame->rec_lmcs = sub_state->tile->frame->rec;
} }
sub_state->tile->frame->cu_array = kvz_cu_subarray( sub_state->tile->frame->cu_array = kvz_cu_subarray(