From b440c48d07c4da5c5493ef16a9eecbc058ca4252 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Mon, 10 Feb 2014 14:31:36 +0200 Subject: [PATCH] Fix intra reconstruction on the bottom of the frame. When the CU was both at the bottom of frame and at the bottom of LCU, uninitialized pixels were being used as reference. --- src/intra.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/intra.c b/src/intra.c index 4e56f32b..097f5ca0 100644 --- a/src/intra.c +++ b/src/intra.c @@ -521,7 +521,8 @@ void intra_build_reference_border(picture *pic, const pixel *src, int32_t x_luma // There are no coded pixels below the bottom of the LCU due to raster scan order. if (num_ref_pixels + y > src_height) { num_ref_pixels = src_height - y; - } else if ((num_ref_pixels << is_chroma) + y_in_lcu > LCU_WIDTH) { + } + if ((num_ref_pixels << is_chroma) + y_in_lcu > LCU_WIDTH) { num_ref_pixels = (LCU_WIDTH - y_in_lcu) >> is_chroma; } // Copy pixels from coded CUs.