| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 #include "webrtc/common_video/libyuv/include/scaler.h" | 10 #include "webrtc/common_video/libyuv/include/scaler.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 int stride_y = frame.stride(kYPlane); | 63 int stride_y = frame.stride(kYPlane); |
| 64 int stride_u = frame.stride(kUPlane); | 64 int stride_u = frame.stride(kUPlane); |
| 65 int stride_v = frame.stride(kVPlane); | 65 int stride_v = frame.stride(kVPlane); |
| 66 // If previous width and height are different from current frame's, then no | 66 // If previous width and height are different from current frame's, then no |
| 67 // denoising for the current frame. | 67 // denoising for the current frame. |
| 68 if (width_ != frame.width() || height_ != frame.height()) { | 68 if (width_ != frame.width() || height_ != frame.height()) { |
| 69 width_ = frame.width(); | 69 width_ = frame.width(); |
| 70 height_ = frame.height(); | 70 height_ = frame.height(); |
| 71 denoised_frame->CreateFrame(frame.buffer(kYPlane), frame.buffer(kUPlane), | 71 denoised_frame->CreateFrame(frame.buffer(kYPlane), frame.buffer(kUPlane), |
| 72 frame.buffer(kVPlane), width_, height_, | 72 frame.buffer(kVPlane), width_, height_, |
| 73 stride_y, stride_u, stride_v, kVideoRotation_0); | 73 stride_y, stride_u, stride_v); |
| 74 // Setting time parameters to the output frame. | 74 // Setting time parameters to the output frame. |
| 75 denoised_frame->set_timestamp(frame.timestamp()); | 75 denoised_frame->set_timestamp(frame.timestamp()); |
| 76 denoised_frame->set_render_time_ms(frame.render_time_ms()); | 76 denoised_frame->set_render_time_ms(frame.render_time_ms()); |
| 77 return; | 77 return; |
| 78 } | 78 } |
| 79 // For 16x16 block. | 79 // For 16x16 block. |
| 80 int mb_cols = width_ >> 4; | 80 int mb_cols = width_ >> 4; |
| 81 int mb_rows = height_ >> 4; | 81 int mb_rows = height_ >> 4; |
| 82 if (metrics_.get() == nullptr) | 82 if (metrics_.get() == nullptr) |
| 83 metrics_.reset(new DenoiseMetrics[mb_cols * mb_rows]()); | 83 metrics_.reset(new DenoiseMetrics[mb_cols * mb_rows]()); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // neighbors' denoising status. | 138 // neighbors' denoising status. |
| 139 TrailingReduction(mb_rows, mb_cols, y_src, stride_y, y_dst); | 139 TrailingReduction(mb_rows, mb_cols, y_src, stride_y, y_dst); |
| 140 | 140 |
| 141 // Setting time parameters to the output frame. | 141 // Setting time parameters to the output frame. |
| 142 denoised_frame->set_timestamp(frame.timestamp()); | 142 denoised_frame->set_timestamp(frame.timestamp()); |
| 143 denoised_frame->set_render_time_ms(frame.render_time_ms()); | 143 denoised_frame->set_render_time_ms(frame.render_time_ms()); |
| 144 return; | 144 return; |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace webrtc | 147 } // namespace webrtc |
| OLD | NEW |