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

Side by Side Diff: media/base/audio_parameters.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/audio_bus.h ('k') | media/base/media.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 // 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_PARAMETERS_H_ 5 #ifndef MEDIA_BASE_AUDIO_PARAMETERS_H_
6 #define MEDIA_BASE_AUDIO_PARAMETERS_H_ 6 #define MEDIA_BASE_AUDIO_PARAMETERS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 11 matching lines...) Expand all
22 // Use a struct-in-struct approach to ensure that we can calculate the required 22 // Use a struct-in-struct approach to ensure that we can calculate the required
23 // size as sizeof(Audio{Input,Output}BufferParameters) + #(bytes in audio 23 // size as sizeof(Audio{Input,Output}BufferParameters) + #(bytes in audio
24 // buffer) without using packing. Also align Audio{Input,Output}BufferParameters 24 // buffer) without using packing. Also align Audio{Input,Output}BufferParameters
25 // instead of in Audio{Input,Output}Buffer to be able to calculate size like so. 25 // instead of in Audio{Input,Output}Buffer to be able to calculate size like so.
26 // Use a macro for the alignment value that's the same as 26 // Use a macro for the alignment value that's the same as
27 // AudioBus::kChannelAlignment, since MSVC doesn't accept the latter to be used. 27 // AudioBus::kChannelAlignment, since MSVC doesn't accept the latter to be used.
28 #if defined(OS_WIN) 28 #if defined(OS_WIN)
29 #pragma warning(push) 29 #pragma warning(push)
30 #pragma warning(disable : 4324) // Disable warning for added padding. 30 #pragma warning(disable : 4324) // Disable warning for added padding.
31 #endif 31 #endif
32 #define PARAMETERS_ALIGNMENT 16 32 #define PARAMETERS_ALIGNMENT 32
33 static_assert(AudioBus::kChannelAlignment == PARAMETERS_ALIGNMENT, 33 static_assert(AudioBus::kChannelAlignment == PARAMETERS_ALIGNMENT,
34 "Audio buffer parameters struct alignment not same as AudioBus"); 34 "Audio buffer parameters struct alignment not same as AudioBus");
35 struct MEDIA_EXPORT ALIGNAS(PARAMETERS_ALIGNMENT) AudioInputBufferParameters { 35 struct MEDIA_EXPORT ALIGNAS(PARAMETERS_ALIGNMENT) AudioInputBufferParameters {
36 double volume; 36 double volume;
37 uint32_t size; 37 uint32_t size;
38 uint32_t hardware_delay_bytes; 38 uint32_t hardware_delay_bytes;
39 uint32_t id; 39 uint32_t id;
40 bool key_pressed; 40 bool key_pressed;
41 }; 41 };
42 struct MEDIA_EXPORT ALIGNAS(PARAMETERS_ALIGNMENT) AudioOutputBufferParameters { 42 struct MEDIA_EXPORT ALIGNAS(PARAMETERS_ALIGNMENT) AudioOutputBufferParameters {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 if (a.sample_rate() != b.sample_rate()) 230 if (a.sample_rate() != b.sample_rate())
231 return a.sample_rate() < b.sample_rate(); 231 return a.sample_rate() < b.sample_rate();
232 if (a.bits_per_sample() != b.bits_per_sample()) 232 if (a.bits_per_sample() != b.bits_per_sample())
233 return a.bits_per_sample() < b.bits_per_sample(); 233 return a.bits_per_sample() < b.bits_per_sample();
234 return a.frames_per_buffer() < b.frames_per_buffer(); 234 return a.frames_per_buffer() < b.frames_per_buffer();
235 } 235 }
236 236
237 } // namespace media 237 } // namespace media
238 238
239 #endif // MEDIA_BASE_AUDIO_PARAMETERS_H_ 239 #endif // MEDIA_BASE_AUDIO_PARAMETERS_H_
OLDNEW
« no previous file with comments | « media/base/audio_bus.h ('k') | media/base/media.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698