diff options
author | Stefan Holmer <holmer@google.com> | 2012-03-06 10:48:18 +0100 |
---|---|---|
committer | Stefan Holmer <holmer@google.com> | 2012-03-13 15:33:50 -0700 |
commit | 9c41143d6655f39c3b6f2f0023cd687214af599a (patch) | |
tree | afe1ba43e4556e63807f1b4cfa259b6b96fc7a2e /vp8/encoder/onyx_if.c | |
parent | c21f53a501ebecc9dcbbad90251efed82e327629 (diff) | |
download | libvpx-9c41143d6655f39c3b6f2f0023cd687214af599a.tar libvpx-9c41143d6655f39c3b6f2f0023cd687214af599a.tar.gz libvpx-9c41143d6655f39c3b6f2f0023cd687214af599a.tar.bz2 libvpx-9c41143d6655f39c3b6f2f0023cd687214af599a.zip |
Adds a motion compensated temporal denoiser to the encoder.
Some refactoring in rdopt.c and pickinter.c.
Change-Id: I4f50020eb3313c37f4d441d708fedcaf219d3038
Diffstat (limited to 'vp8/encoder/onyx_if.c')
-rw-r--r-- | vp8/encoder/onyx_if.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 5ad51e846..dbb7bb368 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -1680,6 +1680,17 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) cpi->alt_ref_source = NULL; cpi->is_src_frame_alt_ref = 0; +#if CONFIG_TEMPORAL_DENOISING + if (cpi->oxcf.noise_sensitivity) + { + if (!cpi->denoiser.yv12_mc_running_avg.buffer_alloc) + { + int width = (cpi->oxcf.Width + 15) & ~15; + int height = (cpi->oxcf.Height + 15) & ~15; + vp8_denoiser_allocate(&cpi->denoiser, width, height); + } + } +#endif #if 0 // Experimental RD Code @@ -2314,6 +2325,9 @@ void vp8_remove_compressor(VP8_COMP **ptr) vp8cx_remove_encoder_threads(cpi); #endif +#if CONFIG_TEMPORAL_DENOISING + vp8_denoiser_free(&cpi->denoiser); +#endif dealloc_compressor_data(cpi); vpx_free(cpi->mb.ss); vpx_free(cpi->tok); @@ -3133,7 +3147,12 @@ void vp8_loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm) } vp8_yv12_extend_frame_borders_ptr(cm->frame_to_show); - +#if CONFIG_TEMPORAL_DENOISING + if (cpi->oxcf.noise_sensitivity) + { + vp8_yv12_extend_frame_borders(&cpi->denoiser.yv12_running_avg); + } +#endif } static void encode_frame_to_data_rate @@ -3589,7 +3608,7 @@ static void encode_frame_to_data_rate scale_and_extend_source(cpi->un_scaled_source, cpi); -#if !(CONFIG_REALTIME_ONLY) && CONFIG_POSTPROC +#if !(CONFIG_REALTIME_ONLY) && CONFIG_POSTPROC && !(CONFIG_TEMPORAL_DENOISING) if (cpi->oxcf.noise_sensitivity > 0) { |