From 98f2a1aedc5f4933c2729ae15412549dea9e5549 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Tue, 5 Nov 2013 10:49:42 +0200 Subject: [PATCH] Fix LCU borders in sao reconstruction. --- src/encoder.c | 1 + src/sao.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/encoder.c b/src/encoder.c index bbe6b8b7..6c9190b7 100644 --- a/src/encoder.c +++ b/src/encoder.c @@ -870,6 +870,7 @@ void encode_slice_data(encoder_control* encoder) uint16_t x_ctb, y_ctb; picture *pic = encoder->in.cur_pic; pixel *new_y_data = MALLOC(pixel, pic->width * pic->height); + //memcpy(new_y_data, pic->y_recdata, sizeof(pixel) * pic->width * pic->height); if (encoder->sao_enable) { for (y_ctb = 0; y_ctb < encoder->in.height_in_lcu; y_ctb++) { diff --git a/src/sao.c b/src/sao.c index 8e9eb5f9..95a614ed 100644 --- a/src/sao.c +++ b/src/sao.c @@ -71,8 +71,8 @@ void sao_reconstruct_color(const pixel *rec_data, pixel *new_rec_data, const sao // Don't sample the edge pixels because this function doesn't have access to // their neighbours. - for (y = 1; y < block_height - 1; ++y) { - for (x = 1; x < block_width - 1; ++x) { + for (y = 0; y < block_height; ++y) { + for (x = 0; x < block_width; ++x) { const pixel *c_data = &rec_data[y * stride + x]; pixel *new_data = &new_rec_data[y * new_stride + x]; pixel a = c_data[a_ofs.y * stride + a_ofs.x]; @@ -196,7 +196,7 @@ void sao_reconstruct(picture *pic, pixel *new_y_data, unsigned x_ctb, unsigned y tl.y + block.y + br.y, pic->width, LCU_WIDTH + 2); - picture_blit_pixels(y_recdata, new_rec_y, LCU_WIDTH, LCU_WIDTH, pic->width, LCU_WIDTH); + //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, sao_luma,