diff options
| author | 2016-04-24 13:20:13 +0100 | |
|---|---|---|
| committer | 2016-04-28 11:22:40 +0100 | |
| commit | dda9ffe7901b354d45ab48844801a16b806da9a2 (patch) | |
| tree | d8edc62b7dc00d0668189ad7efc44cd46914c292 /src | |
| parent | Merge pull request #1708 from MerryMage/dsp_dsp (diff) | |
| download | yuzu-dda9ffe7901b354d45ab48844801a16b806da9a2.tar.gz yuzu-dda9ffe7901b354d45ab48844801a16b806da9a2.tar.xz yuzu-dda9ffe7901b354d45ab48844801a16b806da9a2.zip | |
AudioCore: Move samples_per_frame and num_sources into hle/common.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio_core/audio_core.h | 2 | ||||
| -rw-r--r-- | src/audio_core/hle/common.h | 9 | ||||
| -rw-r--r-- | src/audio_core/hle/dsp.h | 12 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/audio_core/audio_core.h b/src/audio_core/audio_core.h index 64c330914..b349895ea 100644 --- a/src/audio_core/audio_core.h +++ b/src/audio_core/audio_core.h | |||
| @@ -10,8 +10,6 @@ class VMManager; | |||
| 10 | 10 | ||
| 11 | namespace AudioCore { | 11 | namespace AudioCore { |
| 12 | 12 | ||
| 13 | constexpr int num_sources = 24; | ||
| 14 | constexpr int samples_per_frame = 160; ///< Samples per audio frame at native sample rate | ||
| 15 | constexpr int native_sample_rate = 32728; ///< 32kHz | 13 | constexpr int native_sample_rate = 32728; ///< 32kHz |
| 16 | 14 | ||
| 17 | /// Initialise Audio Core | 15 | /// Initialise Audio Core |
diff --git a/src/audio_core/hle/common.h b/src/audio_core/hle/common.h index 37d441eb2..7910f42ae 100644 --- a/src/audio_core/hle/common.h +++ b/src/audio_core/hle/common.h | |||
| @@ -7,18 +7,19 @@ | |||
| 7 | #include <algorithm> | 7 | #include <algorithm> |
| 8 | #include <array> | 8 | #include <array> |
| 9 | 9 | ||
| 10 | #include "audio_core/audio_core.h" | ||
| 11 | |||
| 12 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 13 | 11 | ||
| 14 | namespace DSP { | 12 | namespace DSP { |
| 15 | namespace HLE { | 13 | namespace HLE { |
| 16 | 14 | ||
| 15 | constexpr int num_sources = 24; | ||
| 16 | constexpr int samples_per_frame = 160; ///< Samples per audio frame at native sample rate | ||
| 17 | |||
| 17 | /// The final output to the speakers is stereo. Preprocessing output in Source is also stereo. | 18 | /// The final output to the speakers is stereo. Preprocessing output in Source is also stereo. |
| 18 | using StereoFrame16 = std::array<std::array<s16, 2>, AudioCore::samples_per_frame>; | 19 | using StereoFrame16 = std::array<std::array<s16, 2>, samples_per_frame>; |
| 19 | 20 | ||
| 20 | /// The DSP is quadraphonic internally. | 21 | /// The DSP is quadraphonic internally. |
| 21 | using QuadFrame32 = std::array<std::array<s32, 4>, AudioCore::samples_per_frame>; | 22 | using QuadFrame32 = std::array<std::array<s32, 4>, samples_per_frame>; |
| 22 | 23 | ||
| 23 | /** | 24 | /** |
| 24 | * This performs the filter operation defined by FilterT::ProcessSample on the frame in-place. | 25 | * This performs the filter operation defined by FilterT::ProcessSample on the frame in-place. |
diff --git a/src/audio_core/hle/dsp.h b/src/audio_core/hle/dsp.h index c15ef0b7a..c76350bdd 100644 --- a/src/audio_core/hle/dsp.h +++ b/src/audio_core/hle/dsp.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include <cstddef> | 7 | #include <cstddef> |
| 8 | #include <type_traits> | 8 | #include <type_traits> |
| 9 | 9 | ||
| 10 | #include "audio_core/audio_core.h" | 10 | #include "audio_core/hle/common.h" |
| 11 | 11 | ||
| 12 | #include "common/bit_field.h" | 12 | #include "common/bit_field.h" |
| 13 | #include "common/common_funcs.h" | 13 | #include "common/common_funcs.h" |
| @@ -305,7 +305,7 @@ struct SourceConfiguration { | |||
| 305 | u16_le buffer_id; | 305 | u16_le buffer_id; |
| 306 | }; | 306 | }; |
| 307 | 307 | ||
| 308 | Configuration config[AudioCore::num_sources]; | 308 | Configuration config[num_sources]; |
| 309 | }; | 309 | }; |
| 310 | ASSERT_DSP_STRUCT(SourceConfiguration::Configuration, 192); | 310 | ASSERT_DSP_STRUCT(SourceConfiguration::Configuration, 192); |
| 311 | ASSERT_DSP_STRUCT(SourceConfiguration::Configuration::Buffer, 20); | 311 | ASSERT_DSP_STRUCT(SourceConfiguration::Configuration::Buffer, 20); |
| @@ -320,7 +320,7 @@ struct SourceStatus { | |||
| 320 | INSERT_PADDING_DSPWORDS(1); | 320 | INSERT_PADDING_DSPWORDS(1); |
| 321 | }; | 321 | }; |
| 322 | 322 | ||
| 323 | Status status[AudioCore::num_sources]; | 323 | Status status[num_sources]; |
| 324 | }; | 324 | }; |
| 325 | ASSERT_DSP_STRUCT(SourceStatus::Status, 12); | 325 | ASSERT_DSP_STRUCT(SourceStatus::Status, 12); |
| 326 | 326 | ||
| @@ -413,7 +413,7 @@ ASSERT_DSP_STRUCT(DspConfiguration::ReverbEffect, 52); | |||
| 413 | struct AdpcmCoefficients { | 413 | struct AdpcmCoefficients { |
| 414 | /// Coefficients are signed fixed point with 11 fractional bits. | 414 | /// Coefficients are signed fixed point with 11 fractional bits. |
| 415 | /// Each source has 16 coefficients associated with it. | 415 | /// Each source has 16 coefficients associated with it. |
| 416 | s16_le coeff[AudioCore::num_sources][16]; | 416 | s16_le coeff[num_sources][16]; |
| 417 | }; | 417 | }; |
| 418 | ASSERT_DSP_STRUCT(AdpcmCoefficients, 768); | 418 | ASSERT_DSP_STRUCT(AdpcmCoefficients, 768); |
| 419 | 419 | ||
| @@ -427,7 +427,7 @@ ASSERT_DSP_STRUCT(DspStatus, 32); | |||
| 427 | /// Final mixed output in PCM16 stereo format, what you hear out of the speakers. | 427 | /// Final mixed output in PCM16 stereo format, what you hear out of the speakers. |
| 428 | /// When the application writes to this region it has no effect. | 428 | /// When the application writes to this region it has no effect. |
| 429 | struct FinalMixSamples { | 429 | struct FinalMixSamples { |
| 430 | s16_le pcm16[2 * AudioCore::samples_per_frame]; | 430 | s16_le pcm16[2 * samples_per_frame]; |
| 431 | }; | 431 | }; |
| 432 | ASSERT_DSP_STRUCT(FinalMixSamples, 640); | 432 | ASSERT_DSP_STRUCT(FinalMixSamples, 640); |
| 433 | 433 | ||
| @@ -437,7 +437,7 @@ ASSERT_DSP_STRUCT(FinalMixSamples, 640); | |||
| 437 | /// Values that exceed s16 range will be clipped by the DSP after further processing. | 437 | /// Values that exceed s16 range will be clipped by the DSP after further processing. |
| 438 | struct IntermediateMixSamples { | 438 | struct IntermediateMixSamples { |
| 439 | struct Samples { | 439 | struct Samples { |
| 440 | s32_le pcm32[4][AudioCore::samples_per_frame]; ///< Little-endian as opposed to DSP middle-endian. | 440 | s32_le pcm32[4][samples_per_frame]; ///< Little-endian as opposed to DSP middle-endian. |
| 441 | }; | 441 | }; |
| 442 | 442 | ||
| 443 | Samples mix1; | 443 | Samples mix1; |