diff options
author | Yunqing Wang <yunqingwang@google.com> | 2012-08-10 12:35:55 -0700 |
---|---|---|
committer | Yunqing Wang <yunqingwang@google.com> | 2012-08-31 13:48:13 -0700 |
commit | 64075c9b0129efcdba8c85d7519dbe385dbc56c5 (patch) | |
tree | 2228c9057962a580891cb4a2420399e1d06fda7b /vp8/encoder/denoising.h | |
parent | c533f2a43e102f6cd330834ffdb74575d8382bbf (diff) | |
download | libvpx-64075c9b0129efcdba8c85d7519dbe385dbc56c5.tar libvpx-64075c9b0129efcdba8c85d7519dbe385dbc56c5.tar.gz libvpx-64075c9b0129efcdba8c85d7519dbe385dbc56c5.tar.bz2 libvpx-64075c9b0129efcdba8c85d7519dbe385dbc56c5.zip |
Encoder denoiser performance improvement
The denoiser function was modified to reduce the computational
complexity.
1. The denoiser c function modification:
The original implementation calculated pixel's filter_coefficient
based on the pixel value difference between current raw frame and last
denoised raw frame, and stored them in lookup tables. For each pixel c,
find its coefficient using
filter_coefficient[c] = LUT[abs_diff[c]];
and then apply filtering operation for the pixel.
The denoising filter costed about 12% of encoding time when it was
turned on, and half of the time was spent on finding coefficients in
lookup tables. In order to simplify the process, a short cut was taken.
The pixel adjustments vs. pixel diff value were calculated ahead of time.
adjustment = filtered_value - current_raw
= (filter_coefficient * diff + 128) >> 8
The adjustment vs. diff curve becomes flat very quick when diff increases.
This allowed us to use only several levels to get a close approximation
of the curve. Following the denoiser algorithm, the adjustments are
further modified according to how big the motion magnitude is.
2. The sse2 function was rewritten.
This change made denoiser filter function 3x faster, and improved the
encoder performance by 7% ~ 10% with the denoiser on.
Change-Id: I93a4308963b8e80c7307f96ffa8b8c667425bf50
Diffstat (limited to 'vp8/encoder/denoising.h')
-rw-r--r-- | vp8/encoder/denoising.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/vp8/encoder/denoising.h b/vp8/encoder/denoising.h index 2f5fbff70..b025f5cdf 100644 --- a/vp8/encoder/denoising.h +++ b/vp8/encoder/denoising.h @@ -13,8 +13,8 @@ #include "block.h" -#define NOISE_DIFF2_THRESHOLD (75) #define SUM_DIFF_THRESHOLD (16 * 16 * 2) +#define MOTION_MAGNITUDE_THRESHOLD (8*3) enum vp8_denoiser_decision { @@ -39,12 +39,4 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser, int recon_yoffset, int recon_uvoffset); -union coeff_pair -{ - uint32_t as_int; - uint16_t as_short[2]; -}; - -union coeff_pair *vp8_get_filter_coeff_LUT(unsigned int motion_magnitude); - #endif /* VP8_ENCODER_DENOISING_H_ */ |