diff options
author | Marco <marpan@google.com> | 2014-09-09 09:11:55 -0700 |
---|---|---|
committer | Marco <marpan@google.com> | 2014-09-09 09:19:01 -0700 |
commit | 0c7a9925d620e44a4131e76494c25253dcfed13a (patch) | |
tree | 72bb175df875e09692ac16e0db9e2979f239e5e4 /vp8/encoder/denoising.c | |
parent | fcd431fdc75cb6178adab234aeb5998359a76872 (diff) | |
download | libvpx-0c7a9925d620e44a4131e76494c25253dcfed13a.tar libvpx-0c7a9925d620e44a4131e76494c25253dcfed13a.tar.gz libvpx-0c7a9925d620e44a4131e76494c25253dcfed13a.tar.bz2 libvpx-0c7a9925d620e44a4131e76494c25253dcfed13a.zip |
vp8: Updates for adaptive denoiser mode.
Add qp/bitrate condition, update some settings.
Change-Id: I1af0f102823a886393be063ad9d17d7564753cc7
Diffstat (limited to 'vp8/encoder/denoising.c')
-rw-r--r-- | vp8/encoder/denoising.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/vp8/encoder/denoising.c b/vp8/encoder/denoising.c index 0c98eb1a5..d4f68a9da 100644 --- a/vp8/encoder/denoising.c +++ b/vp8/encoder/denoising.c @@ -412,12 +412,27 @@ int vp8_denoiser_allocate(VP8_DENOISER *denoiser, int width, int height, vp8_denoiser_set_parameters(denoiser, mode); denoiser->nmse_source_diff = 0; denoiser->nmse_source_diff_count = 0; + denoiser->qp_avg = 0; + // QP threshold below which we can go up to aggressive mode. + denoiser->qp_threshold_up = 80; + // QP threshold above which we can go back down to normal mode. + // For now keep this second threshold high, so not used currently. + denoiser->qp_threshold_down = 128; + // Bitrate thresholds and noise metric (nmse) thresholds for switching to + // aggressive mode. // TODO(marpan): Adjust thresholds, including effect on resolution. + denoiser->bitrate_threshold = 200000; // (bits/sec). denoiser->threshold_aggressive_mode = 35; - if (width * height > 640 * 480) + if (width * height > 640 * 480) { + denoiser->bitrate_threshold = 500000; + denoiser->threshold_aggressive_mode = 100; + } else if (width * height > 960 * 540) { + denoiser->bitrate_threshold = 800000; denoiser->threshold_aggressive_mode = 150; - else if (width * height > 1280 * 720) + } else if (width * height > 1280 * 720) { + denoiser->bitrate_threshold = 2000000; denoiser->threshold_aggressive_mode = 1400; + } return 0; } |