1/*
2Copyright 2018 Google Inc. All Rights Reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS-IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#include "base/channel_view.h"
18
19#include "base/simd_utils.h"
20
21namespace vraudio {
22
23ChannelView& ChannelView::operator+=(const ChannelView& other) {
24 DCHECK_EQ(other.size(), size_);
25 DCHECK(enabled_);
26 float* this_sample = begin();
27 const float* other_sample = other.begin();
28 AddPointwise(length: size_, input_a: other_sample, input_b: this_sample, output: this_sample);
29 return *this;
30}
31
32ChannelView& ChannelView::operator-=(const ChannelView& other) {
33 DCHECK_EQ(other.size(), size_);
34 DCHECK(enabled_);
35 float* this_sample = begin();
36 const float* other_sample = other.begin();
37 SubtractPointwise(length: size_, input_a: other_sample, input_b: this_sample, output: this_sample);
38 return *this;
39}
40
41ChannelView& ChannelView::operator*=(const ChannelView& other) {
42 DCHECK_EQ(other.size(), size_);
43 DCHECK(enabled_);
44 float* this_sample = begin();
45 const float* other_sample = other.begin();
46 MultiplyPointwise(length: size_, input_a: other_sample, input_b: this_sample, output: this_sample);
47 return *this;
48}
49
50} // namespace vraudio
51

source code of qtmultimedia/src/3rdparty/resonance-audio/resonance_audio/base/channel_view.cc