Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2284)

Unified Diff: webrtc/modules/video_processing/frame_preprocessor.cc

Issue 2005733003: Refactor VideoDenoiser to work with I420Buffer, not VideoFrame. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Trivial rebase. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_processing/frame_preprocessor.cc
diff --git a/webrtc/modules/video_processing/frame_preprocessor.cc b/webrtc/modules/video_processing/frame_preprocessor.cc
index 100cdb519ab349a7cfbf6fa00f4a42d8f8fd6ead..1d21340b31f204a47911690bf91c764f9863e82a 100644
--- a/webrtc/modules/video_processing/frame_preprocessor.cc
+++ b/webrtc/modules/video_processing/frame_preprocessor.cc
@@ -96,18 +96,20 @@ const VideoFrame* VPMFramePreprocessor::PreprocessFrame(
const VideoFrame* current_frame = &frame;
if (denoiser_) {
- VideoFrame* denoised_frame = &denoised_frame_[0];
- VideoFrame* denoised_frame_prev = &denoised_frame_[1];
+ rtc::scoped_refptr<I420Buffer>* denoised_frame = &denoised_buffer_[0];
+ rtc::scoped_refptr<I420Buffer>* denoised_frame_prev = &denoised_buffer_[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];
+ denoised_frame = &denoised_buffer_[1];
+ denoised_frame_prev = &denoised_buffer_[0];
}
// Invert the flag.
denoised_frame_toggle_ ^= 1;
- denoiser_->DenoiseFrame(*current_frame, denoised_frame, denoised_frame_prev,
- true);
- current_frame = denoised_frame;
+ denoiser_->DenoiseFrame(current_frame->video_frame_buffer(), denoised_frame,
+ denoised_frame_prev, true);
+ denoised_frame_.ShallowCopy(*current_frame);
+ denoised_frame_.set_video_frame_buffer(*denoised_frame);
+ current_frame = &denoised_frame_;
}
if (spatial_resampler_->ApplyResample(current_frame->width(),

Powered by Google App Engine
This is Rietveld 408576698