19
19
#include < assert.h>
20
20
#include < DirectXMath.h>
21
21
22
- #pragma warning(push)
23
- #pragma warning(disable : 4005 4668)
24
22
#include < stdint.h>
25
- #pragma warning(pop)
26
-
27
23
#include < string.h>
28
24
29
25
#pragma warning(push)
30
- #pragma warning(disable: 4328 4640 6001 6262)
26
+ #pragma warning(disable: 6001 6262)
31
27
32
28
namespace XDSP
33
29
{
@@ -41,7 +37,7 @@ namespace XDSP
41
37
// Parallel multiplication of four complex numbers, assuming real and imaginary values are stored in separate vectors.
42
38
inline void XM_CALLCONV vmulComplex (
43
39
_Out_ XMVECTOR& rResult, _Out_ XMVECTOR& iResult,
44
- _In_ FXMVECTOR r1, _In_ FXMVECTOR i1, _In_ FXMVECTOR r2, _In_ GXMVECTOR i2)
40
+ _In_ FXMVECTOR r1, _In_ FXMVECTOR i1, _In_ FXMVECTOR r2, _In_ GXMVECTOR i2) noexcept
45
41
{
46
42
using namespace DirectX ;
47
43
// (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1)
@@ -52,7 +48,7 @@ namespace XDSP
52
48
}
53
49
54
50
inline void XM_CALLCONV vmulComplex (
55
- _Inout_ XMVECTOR& r1, _Inout_ XMVECTOR& i1, _In_ FXMVECTOR r2, _In_ FXMVECTOR i2)
51
+ _Inout_ XMVECTOR& r1, _Inout_ XMVECTOR& i1, _In_ FXMVECTOR r2, _In_ FXMVECTOR i2) noexcept
56
52
{
57
53
using namespace DirectX ;
58
54
// (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1)
@@ -92,7 +88,7 @@ namespace XDSP
92
88
// | 1 0 -1 0 | | (rTempZ,iTempZ) | | (rTempX - rTempZ, iTempX - iTempZ) |
93
89
// | 0 1 0 j | | (rTempW,iTempW) | | (rTempY - iTempW, iTempY + rTempW) |
94
90
// ----------------------------------------------------------------------------------
95
- inline void ButterflyDIT4_1 (_Inout_ XMVECTOR& r1, _Inout_ XMVECTOR& i1)
91
+ inline void ButterflyDIT4_1 (_Inout_ XMVECTOR& r1, _Inout_ XMVECTOR& i1) noexcept
96
92
{
97
93
using namespace DirectX ;
98
94
@@ -160,7 +156,7 @@ namespace XDSP
160
156
_In_reads_ (uStride * 4 ) const XMVECTOR* __restrict pUnityTableReal,
161
157
_In_reads_(uStride * 4 ) const XMVECTOR* __restrict pUnityTableImaginary,
162
158
_In_ size_t uStride,
163
- _In_ const bool fLast)
159
+ _In_ const bool fLast) noexcept
164
160
{
165
161
using namespace DirectX ;
166
162
@@ -231,7 +227,7 @@ namespace XDSP
231
227
inline void FFT4 (
232
228
_Inout_updates_ (uCount) XMVECTOR* __restrict pReal,
233
229
_Inout_updates_(uCount) XMVECTOR* __restrict pImaginary,
234
- const size_t uCount = 1)
230
+ const size_t uCount = 1) noexcept
235
231
{
236
232
assert (pReal);
237
233
assert (pImaginary);
@@ -257,7 +253,7 @@ namespace XDSP
257
253
inline void FFT8 (
258
254
_Inout_updates_ (uCount * 2 ) XMVECTOR* __restrict pReal,
259
255
_Inout_updates_(uCount * 2 ) XMVECTOR* __restrict pImaginary,
260
- _In_ const size_t uCount = 1)
256
+ _In_ const size_t uCount = 1) noexcept
261
257
{
262
258
using namespace DirectX ;
263
259
@@ -307,7 +303,7 @@ namespace XDSP
307
303
inline void FFT16 (
308
304
_Inout_updates_ (uCount * 4 ) XMVECTOR* __restrict pReal,
309
305
_Inout_updates_(uCount * 4 ) XMVECTOR* __restrict pImaginary,
310
- _In_ const size_t uCount = 1)
306
+ _In_ const size_t uCount = 1) noexcept
311
307
{
312
308
using namespace DirectX ;
313
309
@@ -361,11 +357,12 @@ namespace XDSP
361
357
// uLength - [in] FFT length in samples, must be a power of 2 > 16
362
358
// uCount - [in] number of FFT iterations
363
359
// ----------------------------------------------------------------------------------
364
- inline void FFT (_Inout_updates_((uLength*uCount)/4) XMVECTOR* __restrict pReal,
365
- _Inout_updates_((uLength*uCount)/4) XMVECTOR* __restrict pImaginary,
366
- _In_reads_(uLength*uCount) const XMVECTOR* __restrict pUnityTable,
367
- _In_ const size_t uLength,
368
- _In_ const size_t uCount=1)
360
+ inline void FFT (
361
+ _Inout_updates_ ((uLength*uCount)/4) XMVECTOR* __restrict pReal,
362
+ _Inout_updates_((uLength*uCount)/4) XMVECTOR* __restrict pImaginary,
363
+ _In_reads_(uLength*uCount) const XMVECTOR* __restrict pUnityTable,
364
+ _In_ const size_t uLength,
365
+ _In_ const size_t uCount=1) noexcept
369
366
{
370
367
assert (pReal);
371
368
assert (pImaginary);
@@ -438,7 +435,7 @@ namespace XDSP
438
435
// pUnityTable - [out] unity table, receives unity roots lookup table, must have at least uLength elements
439
436
// uLength - [in] FFT length in frames, must be a power of 2 > 16
440
437
// ----------------------------------------------------------------------------------
441
- inline void FFTInitializeUnityTable (_Out_writes_(uLength) XMVECTOR* __restrict pUnityTable, _In_ size_t uLength)
438
+ inline void FFTInitializeUnityTable (_Out_writes_(uLength) XMVECTOR* __restrict pUnityTable, _In_ size_t uLength) noexcept
442
439
{
443
440
assert (pUnityTable);
444
441
assert (uLength > 16 );
@@ -482,9 +479,10 @@ namespace XDSP
482
479
// pInput - [in] input buffer, samples in bit reversed order as generated by FFT functions, cannot overlap pOutput, must have at least (1<<uLog2Length)/4 elements
483
480
// uLog2Length - [in] LOG (base 2) of FFT length in samples, must be >= 2
484
481
// ----------------------------------------------------------------------------------
485
- inline void FFTUnswizzle (_Out_writes_((1 <<uLog2Length)/4) XMVECTOR* __restrict pOutput,
486
- _In_reads_((1 <<uLog2Length)/4) const XMVECTOR* __restrict pInput,
487
- _In_ const size_t uLog2Length)
482
+ inline void FFTUnswizzle (
483
+ _Out_writes_ ((1 <<uLog2Length)/4) XMVECTOR* __restrict pOutput,
484
+ _In_reads_((1 <<uLog2Length)/4) const XMVECTOR* __restrict pInput,
485
+ _In_ const size_t uLog2Length) noexcept
488
486
{
489
487
assert (pOutput);
490
488
assert (pInput);
@@ -537,10 +535,11 @@ namespace XDSP
537
535
// uLength - [in] FFT length in samples, must be a power of 2 >= 4
538
536
// ----------------------------------------------------------------------------------
539
537
#pragma warning(suppress: 6101)
540
- inline void FFTPolar (_Out_writes_(uLength/4 ) XMVECTOR* __restrict pOutput,
541
- _In_reads_(uLength/4 ) const XMVECTOR* __restrict pInputReal,
542
- _In_reads_(uLength/4 ) const XMVECTOR* __restrict pInputImaginary,
543
- _In_ const size_t uLength)
538
+ inline void FFTPolar (
539
+ _Out_writes_ (uLength/4 ) XMVECTOR* __restrict pOutput,
540
+ _In_reads_(uLength/4 ) const XMVECTOR* __restrict pInputReal,
541
+ _In_reads_(uLength/4 ) const XMVECTOR* __restrict pInputImaginary,
542
+ _In_ const size_t uLength) noexcept
544
543
{
545
544
using namespace DirectX ;
546
545
@@ -581,10 +580,11 @@ namespace XDSP
581
580
// uChannelCount - [in] number of channels, must be > 1
582
581
// uFrameCount - [in] number of frames of valid data, must be > 0
583
582
// ----------------------------------------------------------------------------------
584
- inline void Deinterleave (_Out_writes_((uChannelCount*uFrameCount)/4) XMVECTOR* __restrict pOutput,
585
- _In_reads_((uChannelCount*uFrameCount)/4) const XMVECTOR* __restrict pInput,
586
- _In_ const size_t uChannelCount,
587
- _In_ const size_t uFrameCount)
583
+ inline void Deinterleave (
584
+ _Out_writes_ ((uChannelCount*uFrameCount)/4) XMVECTOR* __restrict pOutput,
585
+ _In_reads_((uChannelCount*uFrameCount)/4) const XMVECTOR* __restrict pInput,
586
+ _In_ const size_t uChannelCount,
587
+ _In_ const size_t uFrameCount) noexcept
588
588
{
589
589
assert (pOutput);
590
590
assert (pInput);
@@ -616,10 +616,11 @@ namespace XDSP
616
616
// uChannelCount - [in] number of channels, must be > 1
617
617
// uFrameCount - [in] number of frames of valid data, must be > 0
618
618
// ----------------------------------------------------------------------------------
619
- inline void Interleave (_Out_writes_((uChannelCount*uFrameCount)/4) XMVECTOR* __restrict pOutput,
620
- _In_reads_((uChannelCount*uFrameCount)/4) const XMVECTOR* __restrict pInput,
621
- _In_ const size_t uChannelCount,
622
- _In_ const size_t uFrameCount)
619
+ inline void Interleave (
620
+ _Out_writes_ ((uChannelCount*uFrameCount)/4) XMVECTOR* __restrict pOutput,
621
+ _In_reads_((uChannelCount*uFrameCount)/4) const XMVECTOR* __restrict pInput,
622
+ _In_ const size_t uChannelCount,
623
+ _In_ const size_t uFrameCount) noexcept
623
624
{
624
625
assert (pOutput);
625
626
assert (pInput);
@@ -651,11 +652,12 @@ namespace XDSP
651
652
// uChannelCount - [in] number of channels, must be within [1, 6]
652
653
// uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 9]
653
654
// ----------------------------------------------------------------------------------
654
- inline void FFTInterleaved (_Inout_updates_(((1 <<uLog2Length)*uChannelCount)/4) XMVECTOR* __restrict pReal,
655
- _Out_writes_(((1 <<uLog2Length)*uChannelCount)/4) XMVECTOR* __restrict pImaginary,
656
- _In_reads_(1 <<uLog2Length) const XMVECTOR* __restrict pUnityTable,
657
- _In_ const size_t uChannelCount,
658
- _In_ const size_t uLog2Length)
655
+ inline void FFTInterleaved (
656
+ _Inout_updates_ (((1 <<uLog2Length)*uChannelCount)/4) XMVECTOR* __restrict pReal,
657
+ _Out_writes_(((1 <<uLog2Length)*uChannelCount)/4) XMVECTOR* __restrict pImaginary,
658
+ _In_reads_(1 <<uLog2Length) const XMVECTOR* __restrict pUnityTable,
659
+ _In_ const size_t uChannelCount,
660
+ _In_ const size_t uLog2Length) noexcept
659
661
{
660
662
assert (pReal);
661
663
assert (pImaginary);
@@ -729,11 +731,12 @@ namespace XDSP
729
731
// uChannelCount - [in] number of channels, must be > 0
730
732
// uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 9]
731
733
// ----------------------------------------------------------------------------------
732
- inline void IFFTDeinterleaved (_Inout_updates_(((1 <<uLog2Length)*uChannelCount)/4) XMVECTOR* __restrict pReal,
733
- _In_reads_(((1 <<uLog2Length)*uChannelCount)/4) const XMVECTOR* __restrict pImaginary,
734
- _In_reads_(1 <<uLog2Length) const XMVECTOR* __restrict pUnityTable,
735
- _In_ const size_t uChannelCount,
736
- _In_ const size_t uLog2Length)
734
+ inline void IFFTDeinterleaved (
735
+ _Inout_updates_ (((1 <<uLog2Length)*uChannelCount)/4) XMVECTOR* __restrict pReal,
736
+ _In_reads_(((1 <<uLog2Length)*uChannelCount)/4) const XMVECTOR* __restrict pImaginary,
737
+ _In_reads_(1 <<uLog2Length) const XMVECTOR* __restrict pUnityTable,
738
+ _In_ const size_t uChannelCount,
739
+ _In_ const size_t uLog2Length) noexcept
737
740
{
738
741
using namespace DirectX ;
739
742
0 commit comments