OLD | NEW |
---|---|
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 Loading... | |
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()); | |
peah-webrtc
2016/06/23 13:32:21
Would it be possible to move this before the copy?
aluebs-webrtc
2016/06/24 02:49:16
Good point, although it should never happen. Done.
| |
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 < fbuf_.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()); | |
peah-webrtc
2016/06/23 13:32:21
Would it be possible to move this before the copy?
aluebs-webrtc
2016/06/24 02:49:16
Good point, although it should never happen. Done.
| |
71 ivalid_ = true; | 73 ivalid_ = true; |
72 } | 74 } |
73 } | 75 } |
74 | 76 |
75 } // namespace webrtc | 77 } // namespace webrtc |
OLD | NEW |