External VNR speed improvement.

Improved visual quality with 3x times speed-up.
Change list:
 1. Remove second chance filter in temporal denoising filter to mitigate trailing artifact.
 2. Add swap buffer to save one whole-frame memcpy.
 3. Do noise estimation on every N blocks.
 4. Adopt a faster moving object detection algorithm (change the structure).
 5. Refactor the for loops and PositionCheck().
 6. Refactor the function ReduceFalseDetection (RFD).
 7. Fix a bug in TrailingBlock() which causes a mismatch.
 8. Change unit test to support swap buffer test.
 9. Remove CopyMem8x8, use memcpy to copy U/V plane which can be optimized future.
 10. Remove DenoiseMetrics.

Review URL: https://codereview.webrtc.org/1871853003

Cr-Commit-Position: refs/heads/master@{#12340}
This commit is contained in:
jackychen
2016-04-12 23:02:55 -07:00
committed by Commit bot
parent a31fb75e44
commit afaae0d151
14 changed files with 391 additions and 581 deletions

View File

@ -23,6 +23,7 @@ VPMFramePreprocessor::VPMFramePreprocessor()
ca_ = new VPMContentAnalysis(true);
vd_ = new VPMVideoDecimator();
EnableDenosing(false);
denoised_frame_toggle_ = 0;
}
VPMFramePreprocessor::~VPMFramePreprocessor() {
@ -116,9 +117,18 @@ const VideoFrame* VPMFramePreprocessor::PreprocessFrame(
const VideoFrame* current_frame = &frame;
if (denoiser_) {
denoiser_->DenoiseFrame(*current_frame, &denoised_frame_,
&denoised_frame_prev_, 0);
current_frame = &denoised_frame_;
VideoFrame* denoised_frame = &denoised_frame_[0];
VideoFrame* denoised_frame_prev = &denoised_frame_[1];
// Swap the buffer to save one memcpy in DenoiseFrame.
if (denoised_frame_toggle_) {
denoised_frame = &denoised_frame_[1];
denoised_frame_prev = &denoised_frame_[0];
}
// Invert the flag.
denoised_frame_toggle_ ^= 1;
denoiser_->DenoiseFrame(*current_frame, denoised_frame, denoised_frame_prev,
true);
current_frame = denoised_frame;
}
if (spatial_resampler_->ApplyResample(current_frame->width(),