Commit ab9d37a3 authored by Rupert Swarbrick's avatar Rupert Swarbrick Committed by Debargha Mukherjee
Browse files

Save enough lines at bottom of frame in save_cdef_boundary_lines

The logic (copied from save_deblock_boundary_lines) to work out how
many lines to save isn't correct here: we always save exactly one line
but duplicate it across multiple rows in the "boundary" buffer.


Change-Id: Ib7ce7a777191062f3511d82c8c4eec589c900a2f
parent 8e2e6652
......@@ -1851,7 +1851,6 @@ static void save_cdef_boundary_lines(const YV12_BUFFER_CONFIG *frame,
int stripe, int use_highbd, int is_above,
RestorationStripeBoundaries *boundaries) {
const int is_uv = plane > 0;
const int src_height = frame->crop_heights[is_uv];
const uint8_t *src_buf = REAL_PTR(use_highbd, frame->buffers[plane]);
const int src_stride = frame->strides[is_uv] << use_highbd;
const uint8_t *src_rows = src_buf + row * src_stride;
......@@ -1862,7 +1861,6 @@ static void save_cdef_boundary_lines(const YV12_BUFFER_CONFIG *frame,
const int bdry_stride = boundaries->stripe_boundary_stride << use_highbd;
uint8_t *bdry_rows = bdry_start + RESTORATION_CTX_VERT * stripe * bdry_stride;
const int lines_to_save = AOMMIN(RESTORATION_CTX_VERT, src_height - row);
// At the point where this function is called, we've already applied
// superres. So we don't need to extend the lines here, we can just
......@@ -1875,14 +1873,14 @@ static void save_cdef_boundary_lines(const YV12_BUFFER_CONFIG *frame,
const int upscaled_width = src_width;
const int line_bytes = upscaled_width << use_highbd;
for (int i = 0; i < lines_to_save; i++) {
for (int i = 0; i < RESTORATION_CTX_VERT; i++) {
// Copy the line at 'row' into both context lines. This is because
// we want to (effectively) extend the outermost row of CDEF data
// from this tile to produce a border, rather than using deblocked
// pixels from the tile above/below.
memcpy(bdry_rows + i * bdry_stride, src_rows, line_bytes);
extend_lines(bdry_rows, upscaled_width, lines_to_save, bdry_stride,
extend_lines(bdry_rows, upscaled_width, RESTORATION_CTX_VERT, bdry_stride,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment