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 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 rtc::scoped_refptr<I420Buffer>* denoised_frame_prev) { | 79 rtc::scoped_refptr<I420Buffer>* denoised_frame_prev) { |
80 width_ = frame->width(); | 80 width_ = frame->width(); |
81 height_ = frame->height(); | 81 height_ = frame->height(); |
82 mb_cols_ = width_ >> 4; | 82 mb_cols_ = width_ >> 4; |
83 mb_rows_ = height_ >> 4; | 83 mb_rows_ = height_ >> 4; |
84 stride_y_ = frame->StrideY(); | 84 stride_y_ = frame->StrideY(); |
85 stride_u_ = frame->StrideU(); | 85 stride_u_ = frame->StrideU(); |
86 stride_v_ = frame->StrideV(); | 86 stride_v_ = frame->StrideV(); |
87 | 87 |
88 // Allocate an empty buffer for denoised_frame_prev. | 88 // Allocate an empty buffer for denoised_frame_prev. |
89 *denoised_frame_prev = new rtc::RefCountedObject<I420Buffer>( | 89 *denoised_frame_prev = I420Buffer::Create( |
90 width_, height_, stride_y_, stride_u_, stride_v_); | 90 width_, height_, stride_y_, stride_u_, stride_v_); |
91 // Allocate and initialize denoised_frame with key frame. | 91 // Allocate and initialize denoised_frame with key frame. |
92 *denoised_frame = I420Buffer::CopyKeepStride(frame); | 92 *denoised_frame = I420Buffer::CopyKeepStride(frame); |
93 | 93 |
94 // Init noise estimator and allocate buffers. | 94 // Init noise estimator and allocate buffers. |
95 ne_->Init(width_, height_, cpu_type_); | 95 ne_->Init(width_, height_, cpu_type_); |
96 moving_edge_.reset(new uint8_t[mb_cols_ * mb_rows_]); | 96 moving_edge_.reset(new uint8_t[mb_cols_ * mb_rows_]); |
97 mb_filter_decision_.reset(new DenoiserDecision[mb_cols_ * mb_rows_]); | 97 mb_filter_decision_.reset(new DenoiserDecision[mb_cols_ * mb_rows_]); |
98 x_density_.reset(new uint8_t[mb_cols_]); | 98 x_density_.reset(new uint8_t[mb_cols_]); |
99 y_density_.reset(new uint8_t[mb_rows_]); | 99 y_density_.reset(new uint8_t[mb_rows_]); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 memcpy(v_dst, v_src, (height_ >> 1) * stride_v_); | 333 memcpy(v_dst, v_src, (height_ >> 1) * stride_v_); |
334 | 334 |
335 #if DISPLAY || DISPLAYNEON | 335 #if DISPLAY || DISPLAYNEON |
336 // Show rectangular region | 336 // Show rectangular region |
337 ShowRect(filter_, moving_edge_, moving_object_, x_density_, y_density_, u_src, | 337 ShowRect(filter_, moving_edge_, moving_object_, x_density_, y_density_, u_src, |
338 v_src, u_dst, v_dst, mb_rows_, mb_cols_, stride_u_, stride_v_); | 338 v_src, u_dst, v_dst, mb_rows_, mb_cols_, stride_u_, stride_v_); |
339 #endif | 339 #endif |
340 } | 340 } |
341 | 341 |
342 } // namespace webrtc | 342 } // namespace webrtc |
OLD | NEW |