Merge branch 'fix-tiles-sao'

This commit is contained in:
Arttu Ylä-Outinen 2017-08-01 15:52:59 +03:00
commit d20c9ab30f
3 changed files with 12 additions and 9 deletions

View file

@ -351,29 +351,29 @@ static void encoder_sao_reconstruct(const encoder_state_t *const state,
// Copy pixels that will be filtered and bordering pixels from right and // Copy pixels that will be filtered and bordering pixels from right and
// below. // below.
const int from_index = (lcu->position_px.x + x_offsets[0]) + const int from_index = (lcu->position_px.x + x_offsets[0]) +
(lcu->position_px.y + y_offsets[0]) * frame->width; (lcu->position_px.y + y_offsets[0]) * frame->rec->stride;
const int to_index = x_offsets[0] + y_offsets[0] * SAO_BUF_WIDTH; const int to_index = x_offsets[0] + y_offsets[0] * SAO_BUF_WIDTH;
kvz_pixels_blit(&frame->rec->y[from_index], kvz_pixels_blit(&frame->rec->y[from_index],
&sao_buf_y[to_index], &sao_buf_y[to_index],
width + border_right, width + border_right,
height + border_below, height + border_below,
frame->width, frame->rec->stride,
SAO_BUF_WIDTH); SAO_BUF_WIDTH);
if (state->encoder_control->chroma_format != KVZ_CSP_400) { if (state->encoder_control->chroma_format != KVZ_CSP_400) {
const int from_index_c = (lcu->position_px.x + x_offsets[0])/2 + const int from_index_c = (lcu->position_px.x + x_offsets[0])/2 +
(lcu->position_px.y + y_offsets[0])/2 * frame->width/2; (lcu->position_px.y + y_offsets[0])/2 * frame->rec->stride/2;
const int to_index_c = x_offsets[0]/2 + y_offsets[0]/2 * SAO_BUF_WIDTH_C; const int to_index_c = x_offsets[0]/2 + y_offsets[0]/2 * SAO_BUF_WIDTH_C;
kvz_pixels_blit(&frame->rec->u[from_index_c], kvz_pixels_blit(&frame->rec->u[from_index_c],
&sao_buf_u[to_index_c], &sao_buf_u[to_index_c],
width/2 + border_right, width/2 + border_right,
height/2 + border_below, height/2 + border_below,
frame->width/2, frame->rec->stride/2,
SAO_BUF_WIDTH_C); SAO_BUF_WIDTH_C);
kvz_pixels_blit(&frame->rec->v[from_index_c], kvz_pixels_blit(&frame->rec->v[from_index_c],
&sao_buf_v[to_index_c], &sao_buf_v[to_index_c],
width/2 + border_right, width/2 + border_right,
height/2 + border_below, height/2 + border_below,
frame->width/2, frame->rec->stride/2,
SAO_BUF_WIDTH_C); SAO_BUF_WIDTH_C);
} }

View file

@ -291,7 +291,8 @@ void kvz_sao_reconstruct(const encoder_state_t *state,
const int frame_width = frame->width >> shift; const int frame_width = frame->width >> shift;
const int frame_height = frame->height >> shift; const int frame_height = frame->height >> shift;
kvz_pixel *output = &frame->rec->data[color][frame_x + frame_y * frame_width]; const int frame_stride = frame->rec->stride >> shift;
kvz_pixel *output = &frame->rec->data[color][frame_x + frame_y * frame_stride];
if (sao->type == SAO_TYPE_EDGE) { if (sao->type == SAO_TYPE_EDGE) {
const vector2d_t *offset = g_sao_edge_offsets[sao->eo_class]; const vector2d_t *offset = g_sao_edge_offsets[sao->eo_class];
@ -317,7 +318,7 @@ void kvz_sao_reconstruct(const encoder_state_t *state,
if (frame_y + offset[0].y < 0 || frame_y + offset[1].y < 0) { if (frame_y + offset[0].y < 0 || frame_y + offset[1].y < 0) {
// Nothing to do for the topmost row. // Nothing to do for the topmost row.
buffer += stride; buffer += stride;
output += frame_width; output += frame_stride;
height -= 1; height -= 1;
} }
} }
@ -328,7 +329,7 @@ void kvz_sao_reconstruct(const encoder_state_t *state,
output, output,
sao, sao,
stride, stride,
frame_width, frame_stride,
width, width,
height, height,
color); color);

View file

@ -7,10 +7,12 @@
set -eu set -eu
. "${0%/*}/util.sh" . "${0%/*}/util.sh"
common_args='-p4 --rd=0 --no-rdoq --no-deblock --no-sao --no-signhide --subme=0 --pu-depth-inter=1-3 --pu-depth-intra=2-3' common_args='-p4 --rd=0 --no-rdoq --no-signhide --subme=0 --deblock --sao --pu-depth-inter=1-3 --pu-depth-intra=2-3'
valgrind_test 264x130 10 $common_args -r1 --owf=1 --threads=0 --no-wpp valgrind_test 264x130 10 $common_args -r1 --owf=1 --threads=0 --no-wpp
valgrind_test 264x130 10 $common_args -r1 --owf=0 --threads=0 --no-wpp valgrind_test 264x130 10 $common_args -r1 --owf=0 --threads=0 --no-wpp
valgrind_test 264x130 10 $common_args -r2 --owf=1 --threads=2 --wpp valgrind_test 264x130 10 $common_args -r2 --owf=1 --threads=2 --wpp
valgrind_test 264x130 10 $common_args -r2 --owf=0 --threads=2 --no-wpp valgrind_test 264x130 10 $common_args -r2 --owf=0 --threads=2 --no-wpp
valgrind_test 264x130 10 $common_args -r2 --owf=1 --threads=2 --tiles-height-split=u2 --no-wpp valgrind_test 264x130 10 $common_args -r2 --owf=1 --threads=2 --tiles-height-split=u2 --no-wpp
valgrind_test 264x130 10 $common_args -r2 --owf=0 --threads=2 --tiles-height-split=u2 --no-wpp valgrind_test 264x130 10 $common_args -r2 --owf=0 --threads=2 --tiles-height-split=u2 --no-wpp
valgrind_test 512x512 3 $common_args -r2 --owf=1 --threads=2 --tiles=2x2 --no-wpp
valgrind_test 512x512 3 $common_args -r2 --owf=0 --threads=2 --tiles=2x2 --no-wpp