ref: 74f4c5cd12c6f266f24a9dd7889edf1435d14f3a
parent: cb9b277b2f564689b831e95368ac4cddc576e757
parent: dbed479d79be9361cabc5ddfdbe449c7ebbdf68e
author: Jerome Jiang <jianj@google.com>
date: Tue Mar 21 19:27:48 EDT 2017
Merge "Fix the data race caused by vp9 denoiser."
--- a/vp9/encoder/vp9_denoiser.c
+++ b/vp9/encoder/vp9_denoiser.c
@@ -314,6 +314,7 @@
block_start(mc_avg.y_buffer, mc_avg.y_stride, mi_row, mi_col);
struct buf_2d src = mb->plane[0].src;
int is_skin = 0;
+ int increase_denoising = 0;
int consec_zeromv = 0;
mv_col = ctx->best_sse_mv.as_mv.col;
mv_row = ctx->best_sse_mv.as_mv.row;
@@ -356,22 +357,18 @@
mb->plane[0].src.stride, mb->plane[1].src.stride, bs, consec_zeromv,
motion_level);
}
- if (!is_skin && denoiser->denoising_level == kDenHigh) {
- denoiser->increase_denoising = 1;
- } else {
- denoiser->increase_denoising = 0;
- }
+ if (!is_skin && denoiser->denoising_level == kDenHigh) increase_denoising = 1;
if (denoiser->denoising_level >= kDenLow)
decision = perform_motion_compensation(
- denoiser, mb, bs, denoiser->increase_denoising, mi_row, mi_col, ctx,
+ denoiser, mb, bs, increase_denoising, mi_row, mi_col, ctx,
motion_magnitude, is_skin, &zeromv_filter, consec_zeromv,
cpi->svc.number_spatial_layers, cpi->Source->y_width);
if (decision == FILTER_BLOCK) {
- decision = vp9_denoiser_filter(
- src.buf, src.stride, mc_avg_start, mc_avg.y_stride, avg_start,
- avg.y_stride, denoiser->increase_denoising, bs, motion_magnitude);
+ decision = vp9_denoiser_filter(src.buf, src.stride, mc_avg_start,
+ mc_avg.y_stride, avg_start, avg.y_stride,
+ increase_denoising, bs, motion_magnitude);
}
if (decision == FILTER_BLOCK) {
@@ -533,7 +530,6 @@
#ifdef OUTPUT_YUV_DENOISED
make_grayscale(&denoiser->running_avg_y[i]);
#endif
- denoiser->increase_denoising = 0;
denoiser->frame_buffer_initialized = 1;
denoiser->denoising_level = kDenLow;
denoiser->prev_denoising_level = kDenLow;
--- a/vp9/encoder/vp9_denoiser.h
+++ b/vp9/encoder/vp9_denoiser.h
@@ -38,7 +38,6 @@
YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES];
YV12_BUFFER_CONFIG mc_running_avg_y;
YV12_BUFFER_CONFIG last_source;
- int increase_denoising;
int frame_buffer_initialized;
int reset;
VP9_DENOISER_LEVEL denoising_level;