| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 void VPMFramePreprocessor::EnableDenoising(bool enable) { | 78 void VPMFramePreprocessor::EnableDenoising(bool enable) { |
| 79 if (enable) { | 79 if (enable) { |
| 80 denoiser_.reset(new VideoDenoiser(true)); | 80 denoiser_.reset(new VideoDenoiser(true)); |
| 81 } else { | 81 } else { |
| 82 denoiser_.reset(); | 82 denoiser_.reset(); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 const VideoFrame* VPMFramePreprocessor::PreprocessFrame( | 86 const VideoFrame* VPMFramePreprocessor::PreprocessFrame( |
| 87 const VideoFrame& frame) { | 87 const VideoFrame& frame) { |
| 88 if (frame.IsZeroSize()) { | |
| 89 return nullptr; | |
| 90 } | |
| 91 | 88 |
| 92 vd_->UpdateIncomingframe_rate(); | 89 vd_->UpdateIncomingframe_rate(); |
| 93 if (vd_->DropFrame()) { | 90 if (vd_->DropFrame()) { |
| 94 return nullptr; | 91 return nullptr; |
| 95 } | 92 } |
| 96 | 93 |
| 97 const VideoFrame* current_frame = &frame; | 94 const VideoFrame* current_frame = &frame; |
| 98 if (denoiser_) { | 95 if (denoiser_) { |
| 99 rtc::scoped_refptr<I420Buffer>* denoised_buffer = &denoised_buffer_[0]; | 96 rtc::scoped_refptr<I420Buffer>* denoised_buffer = &denoised_buffer_[0]; |
| 100 rtc::scoped_refptr<I420Buffer>* denoised_buffer_prev = &denoised_buffer_[1]; | 97 rtc::scoped_refptr<I420Buffer>* denoised_buffer_prev = &denoised_buffer_[1]; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 122 return nullptr; | 119 return nullptr; |
| 123 } | 120 } |
| 124 current_frame = &resampled_frame_; | 121 current_frame = &resampled_frame_; |
| 125 } | 122 } |
| 126 | 123 |
| 127 ++frame_cnt_; | 124 ++frame_cnt_; |
| 128 return current_frame; | 125 return current_frame; |
| 129 } | 126 } |
| 130 | 127 |
| 131 } // namespace webrtc | 128 } // namespace webrtc |
| OLD | NEW |