OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TRANSIENT_WPD_TREE_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TRANSIENT_WPD_TREE_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TRANSIENT_WPD_TREE_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TRANSIENT_WPD_TREE_H_ |
13 | 13 |
14 #include "webrtc/base/scoped_ptr.h" | 14 #include <memory> |
| 15 |
15 #include "webrtc/modules/audio_processing/transient/wpd_node.h" | 16 #include "webrtc/modules/audio_processing/transient/wpd_node.h" |
16 | 17 |
17 namespace webrtc { | 18 namespace webrtc { |
18 | 19 |
19 // Tree of a Wavelet Packet Decomposition (WPD). | 20 // Tree of a Wavelet Packet Decomposition (WPD). |
20 // | 21 // |
21 // The root node contains all the data provided; for each node in the tree, the | 22 // The root node contains all the data provided; for each node in the tree, the |
22 // left child contains the approximation coefficients extracted from the node, | 23 // left child contains the approximation coefficients extracted from the node, |
23 // and the right child contains the detail coefficients. | 24 // and the right child contains the detail coefficients. |
24 // It preserves its state, so it can be multiple-called. | 25 // It preserves its state, so it can be multiple-called. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Returns the total number of nodes. | 77 // Returns the total number of nodes. |
77 int num_nodes() const { return num_nodes_; } | 78 int num_nodes() const { return num_nodes_; } |
78 | 79 |
79 // Returns the total number of leaves. | 80 // Returns the total number of leaves. |
80 int num_leaves() const { return 1 << levels_; } | 81 int num_leaves() const { return 1 << levels_; } |
81 | 82 |
82 private: | 83 private: |
83 size_t data_length_; | 84 size_t data_length_; |
84 int levels_; | 85 int levels_; |
85 int num_nodes_; | 86 int num_nodes_; |
86 rtc::scoped_ptr<rtc::scoped_ptr<WPDNode>[]> nodes_; | 87 std::unique_ptr<std::unique_ptr<WPDNode>[]> nodes_; |
87 }; | 88 }; |
88 | 89 |
89 } // namespace webrtc | 90 } // namespace webrtc |
90 | 91 |
91 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TRANSIENT_WPD_TREE_H_ | 92 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TRANSIENT_WPD_TREE_H_ |
OLD | NEW |