Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
cf0b1b2c
Commit
cf0b1b2c
authored
Mar 22, 2015
by
Mark Harmstone
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Add delay line EAX functions.
parent
01e239d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
dsound_eax.h
dlls/dsound/dsound_eax.h
+1
-0
eax.c
dlls/dsound/eax.c
+27
-0
No files found.
dlls/dsound/dsound_eax.h
View file @
cf0b1b2c
...
...
@@ -142,6 +142,7 @@ typedef struct {
FILTER
LpFilter
;
DelayLine
Delay
;
unsigned
int
DelayTap
[
2
];
unsigned
int
Offset
;
}
eax_buffer_info
;
...
...
dlls/dsound/eax.c
View file @
cf0b1b2c
...
...
@@ -106,11 +106,26 @@ static float lpFilter2P(FILTER *iir, unsigned int offset, float input)
return
output
;
}
static
void
DelayLineIn
(
DelayLine
*
Delay
,
unsigned
int
offset
,
float
in
)
{
Delay
->
Line
[
offset
&
Delay
->
Mask
]
=
in
;
}
static
float
DelayLineOut
(
DelayLine
*
Delay
,
unsigned
int
offset
)
{
return
Delay
->
Line
[
offset
&
Delay
->
Mask
];
}
static
void
VerbPass
(
IDirectSoundBufferImpl
*
dsb
,
float
in
,
float
*
out
)
{
/* Low-pass filter the incoming sample. */
in
=
lpFilter2P
(
&
dsb
->
eax
.
LpFilter
,
0
,
in
);
/* Feed the initial delay line. */
DelayLineIn
(
&
dsb
->
eax
.
Delay
,
dsb
->
eax
.
Offset
,
in
);
in
=
DelayLineOut
(
&
dsb
->
eax
.
Delay
,
dsb
->
eax
.
Offset
-
dsb
->
eax
.
DelayTap
[
0
]);
/* Step all delays forward one sample. */
dsb
->
eax
.
Offset
++
;
}
...
...
@@ -152,6 +167,12 @@ void process_eax_buffer(IDirectSoundBufferImpl *dsb, float *buf, DWORD count)
HeapFree
(
GetProcessHeap
(),
0
,
out
);
}
static
void
UpdateDelayLine
(
float
earlyDelay
,
float
lateDelay
,
unsigned
int
frequency
,
eax_buffer_info
*
State
)
{
State
->
DelayTap
[
0
]
=
fastf2u
(
earlyDelay
*
frequency
);
State
->
DelayTap
[
1
]
=
fastf2u
((
earlyDelay
+
lateDelay
)
*
frequency
);
}
static
float
lpCoeffCalc
(
float
g
,
float
cw
)
{
float
a
=
0
.
0
f
;
...
...
@@ -262,6 +283,10 @@ static void ReverbUpdate(IDirectSoundBufferImpl *dsb)
cw
=
CalcI3DL2HFreq
(
dsb
->
device
->
eax
.
eax_props
.
flHFReference
,
dsb
->
device
->
pwfx
->
nSamplesPerSec
);
dsb
->
eax
.
LpFilter
.
coeff
=
lpCoeffCalc
(
dsb
->
device
->
eax
.
eax_props
.
flGainHF
,
cw
);
UpdateDelayLine
(
dsb
->
device
->
eax
.
eax_props
.
flReflectionsDelay
,
dsb
->
device
->
eax
.
eax_props
.
flLateReverbDelay
,
dsb
->
device
->
pwfx
->
nSamplesPerSec
,
&
dsb
->
eax
);
}
static
BOOL
ReverbDeviceUpdate
(
DirectSoundDevice
*
dev
)
...
...
@@ -286,6 +311,8 @@ void init_eax_buffer(IDirectSoundBufferImpl *dsb)
dsb
->
eax
.
Delay
.
Mask
=
0
;
dsb
->
eax
.
Delay
.
Line
=
NULL
;
dsb
->
eax
.
DelayTap
[
0
]
=
0
;
dsb
->
eax
.
DelayTap
[
1
]
=
0
;
dsb
->
eax
.
Offset
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment