OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 uint32_t VPMFramePreprocessor::GetDecimatedWidth() const { | 89 uint32_t VPMFramePreprocessor::GetDecimatedWidth() const { |
90 return spatial_resampler_->TargetWidth(); | 90 return spatial_resampler_->TargetWidth(); |
91 } | 91 } |
92 | 92 |
93 uint32_t VPMFramePreprocessor::GetDecimatedHeight() const { | 93 uint32_t VPMFramePreprocessor::GetDecimatedHeight() const { |
94 return spatial_resampler_->TargetHeight(); | 94 return spatial_resampler_->TargetHeight(); |
95 } | 95 } |
96 | 96 |
97 void VPMFramePreprocessor::EnableDenosing(bool enable) { | 97 void VPMFramePreprocessor::EnableDenosing(bool enable) { |
98 denoiser_.reset(new VideoDenoiser(true)); | 98 if (enable) { |
| 99 denoiser_.reset(new VideoDenoiser(true)); |
| 100 } else { |
| 101 denoiser_.reset(); |
| 102 } |
99 } | 103 } |
100 | 104 |
101 const VideoFrame* VPMFramePreprocessor::PreprocessFrame( | 105 const VideoFrame* VPMFramePreprocessor::PreprocessFrame( |
102 const VideoFrame& frame) { | 106 const VideoFrame& frame) { |
103 if (frame.IsZeroSize()) { | 107 if (frame.IsZeroSize()) { |
104 return nullptr; | 108 return nullptr; |
105 } | 109 } |
106 | 110 |
107 vd_->UpdateIncomingframe_rate(); | 111 vd_->UpdateIncomingframe_rate(); |
108 if (vd_->DropFrame()) { | 112 if (vd_->DropFrame()) { |
(...skipping 23 matching lines...) Expand all Loading... |
132 } | 136 } |
133 ++frame_cnt_; | 137 ++frame_cnt_; |
134 return current_frame; | 138 return current_frame; |
135 } | 139 } |
136 | 140 |
137 VideoContentMetrics* VPMFramePreprocessor::GetContentMetrics() const { | 141 VideoContentMetrics* VPMFramePreprocessor::GetContentMetrics() const { |
138 return content_metrics_; | 142 return content_metrics_; |
139 } | 143 } |
140 | 144 |
141 } // namespace webrtc | 145 } // namespace webrtc |
OLD | NEW |