Chromium Code Reviews| 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 a3ec3c8c1c617d57c41d5ff3a40952857e4445a4..43c0525e8f96f9dd0368e19123a94919f124a57e 100644 |
| --- a/webrtc/modules/video_processing/frame_preprocessor.cc |
| +++ b/webrtc/modules/video_processing/frame_preprocessor.cc |
| @@ -9,6 +9,7 @@ |
| */ |
| #include "webrtc/modules/video_processing/frame_preprocessor.h" |
| +#include "webrtc/modules/video_processing/video_denoiser.h" |
| namespace webrtc { |
| @@ -16,17 +17,20 @@ VPMFramePreprocessor::VPMFramePreprocessor() |
| : content_metrics_(NULL), |
| resampled_frame_(), |
| enable_ca_(false), |
| + enable_denoise_(false), |
| frame_cnt_(0) { |
| spatial_resampler_ = new VPMSimpleSpatialResampler(); |
| ca_ = new VPMContentAnalysis(true); |
| vd_ = new VPMVideoDecimator(); |
| + vdn_ = new VideoDenoiser(); |
| } |
| VPMFramePreprocessor::~VPMFramePreprocessor() { |
| Reset(); |
| - delete spatial_resampler_; |
| delete ca_; |
| delete vd_; |
| + delete vdn_; |
| + delete spatial_resampler_; |
| } |
| void VPMFramePreprocessor::Reset() { |
| @@ -113,6 +117,11 @@ int32_t VPMFramePreprocessor::PreprocessFrame(const VideoFrame& frame, |
| *processed_frame = &resampled_frame_; |
| } |
| + if (enable_denoise_) { |
| + vdn_->DenoiseFrame(frame, &denoised_frame_); |
|
stefan-webrtc
2015/11/23 10:12:52
What if we have resampled the frame above? Then I'
jackychen
2015/11/23 19:44:59
I reordered the code, so that resample will be wor
|
| + *processed_frame = &denoised_frame_; |
| + } |
| + |
| // Perform content analysis on the frame to be encoded. |
| if (enable_ca_) { |
| // Compute new metrics every |kSkipFramesCA| frames, starting with |
| @@ -124,8 +133,8 @@ int32_t VPMFramePreprocessor::PreprocessFrame(const VideoFrame& frame, |
| content_metrics_ = ca_->ComputeContentMetrics(resampled_frame_); |
|
stefan-webrtc
2015/11/23 10:12:52
Should this use *processed_frame instead?
jackychen
2015/11/23 19:44:59
Maybe Marco can change it in another cl, but for m
stefan-webrtc
2015/11/24 08:56:18
But if denoising is on, but no resampling is done,
jackychen
2015/11/24 22:33:05
You are right. Done.
|
| } |
| } |
| - ++frame_cnt_; |
| } |
| + ++frame_cnt_; |
| return VPM_OK; |
| } |