Merge "Fix a bug in VP9 denoiser."

This commit is contained in:
JackyChen 2014-09-04 14:16:26 -07:00 committed by Gerrit Code Review
commit 7ba600dc89

View File

@ -145,11 +145,17 @@ static VP9_DENOISER_DECISION denoiser_filter(const uint8_t *sig, int sig_stride,
adj = delta;
}
if (diff > 0) {
// Diff positive means we made positive adjustment above
// (in first try/attempt), so now make negative adjustment to bring
// denoised signal down.
avg[c] = MAX(0, avg[c] - adj);
total_adj += adj;
} else {
avg[c] = MIN(UINT8_MAX, avg[c] + adj);
total_adj -= adj;
} else {
// Diff negative means we made negative adjustment above
// (in first try/attempt), so now make positive adjustment to bring
// denoised signal up.
avg[c] = MIN(UINT8_MAX, avg[c] + adj);
total_adj += adj;
}
}
sig += sig_stride;