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

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

Issue 1982183002: Pull out the PostFilter to its own NonlinearBeamformer API (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Change Beamformer::ProcessChunk() to have one parameter Created 4 years, 6 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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void IFChannelBuffer::RefreshF() const { 47 void IFChannelBuffer::RefreshF() const {
48 if (!fvalid_) { 48 if (!fvalid_) {
49 RTC_DCHECK(ivalid_); 49 RTC_DCHECK(ivalid_);
50 const int16_t* const* int_channels = ibuf_.channels(); 50 const int16_t* const* int_channels = ibuf_.channels();
51 float* const* float_channels = fbuf_.channels(); 51 float* const* float_channels = fbuf_.channels();
52 for (size_t i = 0; i < ibuf_.num_channels(); ++i) { 52 for (size_t i = 0; i < ibuf_.num_channels(); ++i) {
53 for (size_t j = 0; j < ibuf_.num_frames(); ++j) { 53 for (size_t j = 0; j < ibuf_.num_frames(); ++j) {
54 float_channels[i][j] = int_channels[i][j]; 54 float_channels[i][j] = int_channels[i][j];
55 } 55 }
56 } 56 }
57 fbuf_.set_num_channels(ibuf_.num_channels());
57 fvalid_ = true; 58 fvalid_ = true;
58 } 59 }
59 } 60 }
60 61
61 void IFChannelBuffer::RefreshI() const { 62 void IFChannelBuffer::RefreshI() const {
62 if (!ivalid_) { 63 if (!ivalid_) {
63 RTC_DCHECK(fvalid_); 64 RTC_DCHECK(fvalid_);
64 int16_t* const* int_channels = ibuf_.channels(); 65 int16_t* const* int_channels = ibuf_.channels();
65 const float* const* float_channels = fbuf_.channels(); 66 const float* const* float_channels = fbuf_.channels();
66 for (size_t i = 0; i < ibuf_.num_channels(); ++i) { 67 for (size_t i = 0; i < ibuf_.num_channels(); ++i) {
67 FloatS16ToS16(float_channels[i], 68 FloatS16ToS16(float_channels[i],
68 ibuf_.num_frames(), 69 ibuf_.num_frames(),
69 int_channels[i]); 70 int_channels[i]);
70 } 71 }
72 ibuf_.set_num_channels(fbuf_.num_channels());
71 ivalid_ = true; 73 ivalid_ = true;
72 } 74 }
73 } 75 }
74 76
75 } // namespace webrtc 77 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698