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

Side by Side Diff: Source/WebCore/platform/audio/HRTFElevation.cpp

Issue 14304002: Support concatenated spatialization data (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | Source/WebKit/chromium/WebKit.grd » ('j') | Source/WebKit/chromium/WebKit.grd » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Total number of components of an HRTF database. 55 // Total number of components of an HRTF database.
56 const size_t TotalNumberOfResponses = 240; 56 const size_t TotalNumberOfResponses = 240;
57 57
58 // Number of frames in an individual impulse response. 58 // Number of frames in an individual impulse response.
59 const size_t ResponseFrameSize = 256; 59 const size_t ResponseFrameSize = 256;
60 60
61 // Sample-rate of the spatialization impulse responses as stored in the resource file. 61 // Sample-rate of the spatialization impulse responses as stored in the resource file.
62 // The impulse responses may be resampled to a different sample-rate (depending on the audio hardware) when they are loaded. 62 // The impulse responses may be resampled to a different sample-rate (depending on the audio hardware) when they are loaded.
63 const float ResponseSampleRate = 44100; 63 const float ResponseSampleRate = 44100;
64 64
65 #if USE(WEBAUDIO_GSTREAMER) 65 // Loading up individual spatialization impulse responses is very slow on Androi d. Use the
66 // concatenated response file to speed it up.
Chris Rogers 2013/04/17 22:36:56 Comment adds little value, please remove.
67 #if USE(WEBAUDIO_GSTREAMER) || OS(ANDROID)
Chris Rogers 2013/04/17 22:36:56 I don't think this should be Android-specific sinc
66 #define USE_CONCATENATED_IMPULSE_RESPONSES 68 #define USE_CONCATENATED_IMPULSE_RESPONSES
67 #endif 69 #endif
68 70
69 #ifdef USE_CONCATENATED_IMPULSE_RESPONSES 71 #ifdef USE_CONCATENATED_IMPULSE_RESPONSES
70 // Lazily load a concatenated HRTF database for given subject and store it in a 72 // Lazily load a concatenated HRTF database for given subject and store it in a
71 // local hash table to ensure quick efficient future retrievals. 73 // local hash table to ensure quick efficient future retrievals.
72 static AudioBus* getConcatenatedImpulseResponsesForSubject(const String& subject Name) 74 static AudioBus* getConcatenatedImpulseResponsesForSubject(const String& subject Name)
73 { 75 {
74 typedef HashMap<String, AudioBus*> AudioBusMap; 76 typedef HashMap<String, AudioBus*> AudioBusMap;
75 DEFINE_STATIC_LOCAL(AudioBusMap, audioBusMap, ()); 77 DEFINE_STATIC_LOCAL(AudioBusMap, audioBusMap, ());
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 void HRTFElevation::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 348 void HRTFElevation::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
347 { 349 {
348 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::AudioShare dData); 350 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::AudioShare dData);
349 info.addMember(m_kernelListL, "kernelListL"); 351 info.addMember(m_kernelListL, "kernelListL");
350 info.addMember(m_kernelListR, "kernelListR"); 352 info.addMember(m_kernelListR, "kernelListR");
351 } 353 }
352 354
353 } // namespace WebCore 355 } // namespace WebCore
354 356
355 #endif // ENABLE(WEB_AUDIO) 357 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « no previous file | Source/WebKit/chromium/WebKit.grd » ('j') | Source/WebKit/chromium/WebKit.grd » ('J')

Powered by Google App Engine
This is Rietveld 408576698