mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Fix handling of incomplete LCU's in SAO reconstruction.
This commit is contained in:
parent
7a20e797be
commit
f9061d322a
|
@ -882,15 +882,6 @@ void encode_slice_data(encoder_control* encoder)
|
|||
init_sao_info(sao_luma);
|
||||
init_sao_info(sao_chroma);
|
||||
|
||||
// Temporary guards against non-LCU size coding units at the edges,
|
||||
// because they aren't handled yet.
|
||||
if (encoder->in.width_in_lcu * LCU_WIDTH != encoder->in.cur_pic->width
|
||||
&& x_ctb == encoder->in.width_in_lcu - 1) {
|
||||
|
||||
} else if (encoder->in.height_in_lcu * LCU_WIDTH != encoder->in.cur_pic->height
|
||||
&& y_ctb == encoder->in.height_in_lcu - 1) {
|
||||
|
||||
} else {
|
||||
sao_search_luma(encoder->in.cur_pic, x_ctb, y_ctb, sao_luma);
|
||||
// sao_do_merge(encoder, x_ctb, y_ctb, sao_luma, sao_chroma);
|
||||
// sao_do_rdo(encoder, x_ctb, y_ctb, sao_luma, sao_chroma);
|
||||
|
@ -898,7 +889,6 @@ void encode_slice_data(encoder_control* encoder)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(pic->y_recdata, new_y_data, sizeof(pixel) * pic->width * pic->height);
|
||||
free(new_y_data);
|
||||
|
|
|
@ -199,7 +199,7 @@ void sao_reconstruct(picture *pic, pixel *new_y_data, unsigned x_ctb, unsigned y
|
|||
//picture_blit_pixels(y_recdata, new_rec_y, LCU_WIDTH, LCU_WIDTH, pic->width, LCU_WIDTH);
|
||||
|
||||
sao_reconstruct_color(&rec_y[tl.y * (LCU_WIDTH + 2) + tl.x],
|
||||
&new_rec_y[(tl.y + rec.y - y) * (LCU_WIDTH) + (tl.x + rec.x - x)],
|
||||
&new_rec_y,
|
||||
sao_luma,
|
||||
LCU_WIDTH + 2, LCU_WIDTH,
|
||||
block.x, block.y);
|
||||
|
@ -207,7 +207,10 @@ void sao_reconstruct(picture *pic, pixel *new_y_data, unsigned x_ctb, unsigned y
|
|||
//sao_reconstruct_color(rec_v, sao_chroma, COLOR_V);
|
||||
|
||||
// Copy reconstructed block from tmp buffer to rec image.
|
||||
picture_blit_pixels(new_rec_y, new_y_recdata, LCU_WIDTH, LCU_WIDTH, LCU_WIDTH, pic->width);
|
||||
//
|
||||
picture_blit_pixels(new_rec_y,
|
||||
&new_y_recdata[(tl.y + rec.y - y) * (LCU_WIDTH) + (tl.x + rec.x - x)],
|
||||
block.x, block.y, LCU_WIDTH, pic->width);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue