VP9 denoiser bug-fix: artifact caused by false buffer swap.

The artifact occurs periodically when VP9 denoiser is on and
refresh_golden_frame happen. When refresh_golden_frame happen,
we should copy the frame buffer instead of swapping the pointers.

Change-Id: Ib3204c4b04db28ecf439c6d9e61f3d146f04196d
This commit is contained in:
jackychen 2015-10-07 10:44:04 -07:00
parent f3a73f1277
commit 7231c62c9f

View File

@ -387,7 +387,22 @@ void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
return;
}
/* For non key frames */
// If more than one refresh occurs, must copy frame buffer.
if ((refresh_alt_ref_frame + refresh_golden_frame + refresh_last_frame)
> 1) {
if (refresh_alt_ref_frame) {
copy_frame(denoiser->running_avg_y[ALTREF_FRAME],
denoiser->running_avg_y[INTRA_FRAME]);
}
if (refresh_golden_frame) {
copy_frame(denoiser->running_avg_y[GOLDEN_FRAME],
denoiser->running_avg_y[INTRA_FRAME]);
}
if (refresh_last_frame) {
copy_frame(denoiser->running_avg_y[LAST_FRAME],
denoiser->running_avg_y[INTRA_FRAME]);
}
} else {
if (refresh_alt_ref_frame) {
swap_frame_buffer(&denoiser->running_avg_y[ALTREF_FRAME],
&denoiser->running_avg_y[INTRA_FRAME]);
@ -400,6 +415,7 @@ void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
swap_frame_buffer(&denoiser->running_avg_y[LAST_FRAME],
&denoiser->running_avg_y[INTRA_FRAME]);
}
}
}
void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx) {