Commit 8ce049e6 authored by Rupert Swarbrick's avatar Rupert Swarbrick Committed by Debargha Mukherjee

Fix mismatch with striped loop restoration+superres

When upscaling a frame, we extend frame borders to stop the upscale to
save boundary lines convolving with uninitialised data off the edges,
which was causing encode/decode mismatches. With this patch, we only
do the extension when there's going to be an upscale (otherwise
there's no need), which should give a small coding gain when not
upscaling.

More importantly, it forces us to extend in the decode path whether or
not we are using loop restoration, which matches what the encoder does
and fixes a mismatch.

Change-Id: Ie5a0791b0cbedbf254f9080f3cbf668318673f2f
parent b88f50a0
...@@ -3698,12 +3698,12 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data, ...@@ -3698,12 +3698,12 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data,
} }
#if CONFIG_STRIPED_LOOP_RESTORATION #if CONFIG_STRIPED_LOOP_RESTORATION
#if CONFIG_FRAME_SUPERRES && CONFIG_HORZONLY_FRAME_SUPERRES
if (!av1_superres_unscaled(cm)) aom_extend_frame_borders(&pbi->cur_buf->buf);
#endif
if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE || if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[1].frame_restoration_type != RESTORE_NONE || cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE) { cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
#if CONFIG_FRAME_SUPERRES && CONFIG_HORZONLY_FRAME_SUPERRES
aom_extend_frame_borders(&pbi->cur_buf->buf);
#endif
av1_loop_restoration_save_boundary_lines(&pbi->cur_buf->buf, cm); av1_loop_restoration_save_boundary_lines(&pbi->cur_buf->buf, cm);
} }
#endif #endif
......
...@@ -4685,7 +4685,7 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) { ...@@ -4685,7 +4685,7 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
#if CONFIG_STRIPED_LOOP_RESTORATION #if CONFIG_STRIPED_LOOP_RESTORATION
#if CONFIG_FRAME_SUPERRES && CONFIG_HORZONLY_FRAME_SUPERRES #if CONFIG_FRAME_SUPERRES && CONFIG_HORZONLY_FRAME_SUPERRES
aom_extend_frame_borders(cm->frame_to_show); if (!av1_superres_unscaled(cm)) aom_extend_frame_borders(cm->frame_to_show);
#endif #endif
av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm); av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm);
#endif #endif
......
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