Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Side by Side Diff: webrtc/common_audio/fir_filter.cc

Issue 2719733002: Replace NULL with nullptr or null in webrtc/audio/ and common_audio/. (Closed)
Patch Set: Fixing test. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/call/audio_send_stream.cc ('k') | webrtc/common_audio/resampler/resampler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 22 matching lines...) Expand all
33 size_t state_length_; 33 size_t state_length_;
34 std::unique_ptr<float[]> coefficients_; 34 std::unique_ptr<float[]> coefficients_;
35 std::unique_ptr<float[]> state_; 35 std::unique_ptr<float[]> state_;
36 }; 36 };
37 37
38 FIRFilter* FIRFilter::Create(const float* coefficients, 38 FIRFilter* FIRFilter::Create(const float* coefficients,
39 size_t coefficients_length, 39 size_t coefficients_length,
40 size_t max_input_length) { 40 size_t max_input_length) {
41 if (!coefficients || coefficients_length <= 0 || max_input_length <= 0) { 41 if (!coefficients || coefficients_length <= 0 || max_input_length <= 0) {
42 RTC_NOTREACHED(); 42 RTC_NOTREACHED();
43 return NULL; 43 return nullptr;
44 } 44 }
45 45
46 FIRFilter* filter = NULL; 46 FIRFilter* filter = nullptr;
47 // If we know the minimum architecture at compile time, avoid CPU detection. 47 // If we know the minimum architecture at compile time, avoid CPU detection.
48 #if defined(WEBRTC_ARCH_X86_FAMILY) 48 #if defined(WEBRTC_ARCH_X86_FAMILY)
49 #if defined(__SSE2__) 49 #if defined(__SSE2__)
50 filter = 50 filter =
51 new FIRFilterSSE2(coefficients, coefficients_length, max_input_length); 51 new FIRFilterSSE2(coefficients, coefficients_length, max_input_length);
52 #else 52 #else
53 // x86 CPU detection required. 53 // x86 CPU detection required.
54 if (WebRtc_GetCPUInfo(kSSE2)) { 54 if (WebRtc_GetCPUInfo(kSSE2)) {
55 filter = 55 filter =
56 new FIRFilterSSE2(coefficients, coefficients_length, max_input_length); 56 new FIRFilterSSE2(coefficients, coefficients_length, max_input_length);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 state_.get(), &in[length - state_length_], state_length_ * sizeof(*in)); 101 state_.get(), &in[length - state_length_], state_length_ * sizeof(*in));
102 } else { 102 } else {
103 memmove(state_.get(), 103 memmove(state_.get(),
104 &state_[length], 104 &state_[length],
105 (state_length_ - length) * sizeof(state_[0])); 105 (state_length_ - length) * sizeof(state_[0]));
106 memcpy(&state_[state_length_ - length], in, length * sizeof(*in)); 106 memcpy(&state_[state_length_ - length], in, length * sizeof(*in));
107 } 107 }
108 } 108 }
109 109
110 } // namespace webrtc 110 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/audio_send_stream.cc ('k') | webrtc/common_audio/resampler/resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698