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

Side by Side Diff: media/base/audio_bus.h

Issue 2556993002: Experiment with AVX optimizations for FMAC, FMUL operations.
Patch Set: Created 4 years 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 | « media/base/BUILD.gn ('k') | media/base/audio_parameters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_AUDIO_BUS_H_ 5 #ifndef MEDIA_BASE_AUDIO_BUS_H_
6 #define MEDIA_BASE_AUDIO_BUS_H_ 6 #define MEDIA_BASE_AUDIO_BUS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 13 matching lines...) Expand all
24 // allocated and owned by the AudioBus or it is provided to one of the factory 24 // allocated and owned by the AudioBus or it is provided to one of the factory
25 // methods. AudioBus guarantees that it allocates memory such that float array 25 // methods. AudioBus guarantees that it allocates memory such that float array
26 // for each channel is aligned by AudioBus::kChannelAlignment bytes and it 26 // for each channel is aligned by AudioBus::kChannelAlignment bytes and it
27 // requires the same for memory passed to its Wrap...() factory methods. 27 // requires the same for memory passed to its Wrap...() factory methods.
28 // TODO(chfremer): There are currently no unit tests involving CreateWrapper and 28 // TODO(chfremer): There are currently no unit tests involving CreateWrapper and
29 // SetChannelData, so we need to add them. 29 // SetChannelData, so we need to add them.
30 class MEDIA_EXPORT AudioBus { 30 class MEDIA_EXPORT AudioBus {
31 public: 31 public:
32 // Guaranteed alignment of each channel's data; use 16-byte alignment for easy 32 // Guaranteed alignment of each channel's data; use 16-byte alignment for easy
33 // SSE optimizations. 33 // SSE optimizations.
34 enum { kChannelAlignment = 16 }; 34 enum { kChannelAlignment = 32 };
35 35
36 // Creates a new AudioBus and allocates |channels| of length |frames|. Uses 36 // Creates a new AudioBus and allocates |channels| of length |frames|. Uses
37 // channels() and frames_per_buffer() from AudioParameters if given. 37 // channels() and frames_per_buffer() from AudioParameters if given.
38 static std::unique_ptr<AudioBus> Create(int channels, int frames); 38 static std::unique_ptr<AudioBus> Create(int channels, int frames);
39 static std::unique_ptr<AudioBus> Create(const AudioParameters& params); 39 static std::unique_ptr<AudioBus> Create(const AudioParameters& params);
40 40
41 // Creates a new AudioBus with the given number of channels, but zero length. 41 // Creates a new AudioBus with the given number of channels, but zero length.
42 // Clients are expected to subsequently call SetChannelData() and set_frames() 42 // Clients are expected to subsequently call SetChannelData() and set_frames()
43 // to wrap externally allocated memory. 43 // to wrap externally allocated memory.
44 static std::unique_ptr<AudioBus> CreateWrapper(int channels); 44 static std::unique_ptr<AudioBus> CreateWrapper(int channels);
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 AudioBusRefCounted(int channels, int frames); 321 AudioBusRefCounted(int channels, int frames);
322 ~AudioBusRefCounted() override; 322 ~AudioBusRefCounted() override;
323 323
324 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted); 324 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted);
325 }; 325 };
326 326
327 } // namespace media 327 } // namespace media
328 328
329 #endif // MEDIA_BASE_AUDIO_BUS_H_ 329 #endif // MEDIA_BASE_AUDIO_BUS_H_
OLDNEW
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/audio_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698