Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
wine
wine-winehq
Commits
4be1dc1b
Commit
4be1dc1b
authored
Jul 18, 2022
by
Giovanni Mascellani
Committed by
Alexandre Julliard
Jul 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faudio: Import upstream commit e3c444e4f819d2364a6adb0ae73b1d01185b1e93.
Signed-off-by:
Giovanni Mascellani
<
gmascellani@codeweavers.com
>
parent
1ac80a99
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
53 deletions
+97
-53
FAudio.h
libs/faudio/include/FAudio.h
+1
-1
FACT.c
libs/faudio/src/FACT.c
+32
-4
FACT_internal.h
libs/faudio/src/FACT_internal.h
+1
-0
FAudioFX_reverb.c
libs/faudio/src/FAudioFX_reverb.c
+55
-44
FAudio_internal_simd.c
libs/faudio/src/FAudio_internal_simd.c
+4
-4
FAudio_platform_win32.c
libs/faudio/src/FAudio_platform_win32.c
+4
-0
No files found.
libs/faudio/include/FAudio.h
View file @
4be1dc1b
...
...
@@ -485,7 +485,7 @@ extern FAudioGUID DATAFORMAT_SUBTYPE_IEEE_FLOAT;
#define FAUDIO_ABI_VERSION 0
#define FAUDIO_MAJOR_VERSION 22
#define FAUDIO_MINOR_VERSION
6
#define FAUDIO_MINOR_VERSION
7
#define FAUDIO_PATCH_VERSION 0
#define FAUDIO_COMPILED_VERSION ( \
...
...
libs/faudio/src/FACT.c
View file @
4be1dc1b
...
...
@@ -433,9 +433,17 @@ uint32_t FACTAudioEngine_DoWork(FACTAudioEngine *pEngine)
uint8_t
i
;
FACTCue
*
cue
;
LinkedList
*
list
;
FACTNotification
*
note
;
FAudio_PlatformLockMutex
(
pEngine
->
apiLock
);
while
(
pEngine
->
wb_notifications_list
)
{
note
=
(
FACTNotification
*
)
pEngine
->
wb_notifications_list
->
entry
;
pEngine
->
notificationCallback
(
note
);
LinkedList_RemoveEntry
(
&
pEngine
->
wb_notifications_list
,
note
,
pEngine
->
apiLock
,
pEngine
->
pFree
);
}
list
=
pEngine
->
sbList
;
while
(
list
!=
NULL
)
{
...
...
@@ -495,6 +503,7 @@ uint32_t FACTAudioEngine_CreateInMemoryWaveBank(
uint32_t
dwAllocAttributes
,
FACTWaveBank
**
ppWaveBank
)
{
FACTNotification
*
note
;
uint32_t
retval
;
FAudio_PlatformLockMutex
(
pEngine
->
apiLock
);
retval
=
FACT_INTERNAL_ParseWaveBank
(
...
...
@@ -507,6 +516,14 @@ uint32_t FACTAudioEngine_CreateInMemoryWaveBank(
0
,
ppWaveBank
);
if
(
pEngine
->
notifications
&
NOTIFY_WAVEBANKPREPARED
)
{
note
=
(
FACTNotification
*
)
pEngine
->
pMalloc
(
sizeof
(
FACTNotification
));
note
->
type
=
FACTNOTIFICATIONTYPE_WAVEBANKPREPARED
;
note
->
waveBank
.
pWaveBank
=
*
ppWaveBank
;
note
->
pvContext
=
pEngine
->
wb_context
;
LinkedList_AddEntry
(
&
pEngine
->
wb_notifications_list
,
note
,
pEngine
->
apiLock
,
pEngine
->
pMalloc
);
}
FAudio_PlatformUnlockMutex
(
pEngine
->
apiLock
);
return
retval
;
}
...
...
@@ -516,6 +533,7 @@ uint32_t FACTAudioEngine_CreateStreamingWaveBank(
const
FACTStreamingParameters
*
pParms
,
FACTWaveBank
**
ppWaveBank
)
{
FACTNotification
*
note
;
uint32_t
retval
,
packetSize
;
FAudio_PlatformLockMutex
(
pEngine
->
apiLock
);
if
(
pEngine
->
pReadFile
==
FACT_INTERNAL_DefaultReadFile
&&
...
...
@@ -538,6 +556,14 @@ uint32_t FACTAudioEngine_CreateStreamingWaveBank(
1
,
ppWaveBank
);
if
(
pEngine
->
notifications
&
NOTIFY_WAVEBANKPREPARED
)
{
note
=
(
FACTNotification
*
)
pEngine
->
pMalloc
(
sizeof
(
FACTNotification
));
note
->
type
=
FACTNOTIFICATIONTYPE_WAVEBANKPREPARED
;
note
->
waveBank
.
pWaveBank
=
*
ppWaveBank
;
note
->
pvContext
=
pEngine
->
wb_context
;
LinkedList_AddEntry
(
&
pEngine
->
wb_notifications_list
,
note
,
pEngine
->
apiLock
,
pEngine
->
pMalloc
);
}
FAudio_PlatformUnlockMutex
(
pEngine
->
apiLock
);
return
retval
;
}
...
...
@@ -2175,11 +2201,13 @@ uint32_t FACTWave_Stop(FACTWave *pWave, uint32_t dwFlags)
{
FACTNotification
note
;
note
.
type
=
FACTNOTIFICATIONTYPE_WAVESTOP
;
note
.
wave
.
cueIndex
=
pWave
->
parentCue
->
index
;
note
.
wave
.
pCue
=
pWave
->
parentCue
;
note
.
wave
.
pSoundBank
=
pWave
->
parentCue
->
parentBank
;
note
.
wave
.
pWave
=
pWave
;
if
(
pWave
->
parentBank
->
parentEngine
->
notifications
&
NOTIFY_WAVESTOP
)
{
note
.
pvContext
=
pWave
->
parentBank
->
parentEngine
->
wave_context
;
}
note
.
wave
.
pWaveBank
=
pWave
->
parentBank
;
note
.
pvContext
=
pWave
->
parentBank
->
parentEngine
->
wave_context
;
pWave
->
parentBank
->
parentEngine
->
notificationCallback
(
&
note
);
}
...
...
libs/faudio/src/FACT_internal.h
View file @
4be1dc1b
...
...
@@ -440,6 +440,7 @@ struct FACTAudioEngine
void
*
sb_context
;
void
*
wb_context
;
void
*
wave_context
;
LinkedList
*
wb_notifications_list
;
/* Settings handle */
void
*
settings
;
...
...
libs/faudio/src/FAudioFX_reverb.c
View file @
4be1dc1b
...
...
@@ -1015,35 +1015,35 @@ static inline float DspReverb_INTERNAL_Process_2_to_2(
size_t
sample_count
)
{
const
float
*
in_end
=
samples_in
+
sample_count
;
float
in
,
in_ratio
,
early
,
late
[
2
];
float
in
,
early
,
late
[
2
];
float
squared_sum
=
0
;
while
(
samples_in
<
in_end
)
{
/* Input - Combine 2 channels into 1 */
in
=
(
samples_in
[
0
]
+
samples_in
[
1
])
/
2
.
0
f
;
in_ratio
=
in
*
reverb
->
dry_ratio
;
samples_in
+=
2
;
/* Early Reflections */
early
=
DspReverb_INTERNAL_ProcessEarly
(
reverb
,
in
);
/* Reverberation with Wet/Dry Mix */
late
[
0
]
=
DspReverb_INTERNAL_ProcessChannel
(
late
[
0
]
=
(
DspReverb_INTERNAL_ProcessChannel
(
reverb
,
&
reverb
->
channel
[
0
],
early
);
)
*
reverb
->
wet_ratio
)
+
samples_in
[
0
]
*
reverb
->
dry_ratio
;
late
[
1
]
=
(
DspReverb_INTERNAL_ProcessChannel
(
reverb
,
&
reverb
->
channel
[
1
],
early
)
*
reverb
->
wet_ratio
)
+
in
_ratio
;
)
*
reverb
->
wet_ratio
)
+
samples_in
[
1
]
*
reverb
->
dry
_ratio
;
squared_sum
+=
(
late
[
0
]
*
late
[
0
])
+
(
late
[
1
]
*
late
[
1
]);
/* Output */
*
samples_out
++
=
late
[
0
];
*
samples_out
++
=
late
[
1
];
samples_in
+=
2
;
}
return
squared_sum
;
...
...
@@ -1407,6 +1407,22 @@ uint32_t FAudioFXReverb_LockForProcess(
fapo
->
base
.
pMalloc
);
/* Initialize the effect to a default setting */
if
(
fapo
->
apiVersion
==
9
)
{
DspReverb_SetParameters9
(
&
fapo
->
reverb
,
(
FAudioFXReverbParameters9
*
)
fapo
->
base
.
m_pParameterBlocks
);
}
else
{
DspReverb_SetParameters
(
&
fapo
->
reverb
,
(
FAudioFXReverbParameters
*
)
fapo
->
base
.
m_pParameterBlocks
);
}
/* Call parent to do basic validation */
return
FAPOBase_LockForProcess
(
&
fapo
->
base
,
...
...
@@ -1487,6 +1503,24 @@ void FAudioFXReverb_Process(
FAudioFXReverbParameters
*
params
;
uint8_t
update_params
=
FAPOBase_ParametersChanged
(
&
fapo
->
base
);
float
total
;
params
=
(
FAudioFXReverbParameters
*
)
FAPOBase_BeginProcess
(
&
fapo
->
base
);
/* Update parameters before doing anything else */
if
(
update_params
)
{
if
(
fapo
->
apiVersion
==
9
)
{
DspReverb_SetParameters9
(
&
fapo
->
reverb
,
(
FAudioFXReverbParameters9
*
)
params
);
}
else
{
DspReverb_SetParameters
(
&
fapo
->
reverb
,
params
);
}
}
/* Handle disabled filter */
if
(
IsEnabled
==
0
)
...
...
@@ -1503,6 +1537,7 @@ void FAudioFXReverb_Process(
);
}
FAPOBase_EndProcess
(
&
fapo
->
base
);
return
;
}
...
...
@@ -1516,24 +1551,6 @@ void FAudioFXReverb_Process(
);
}
params
=
(
FAudioFXReverbParameters
*
)
FAPOBase_BeginProcess
(
&
fapo
->
base
);
/* Update parameters */
if
(
update_params
)
{
if
(
fapo
->
apiVersion
==
9
)
{
DspReverb_SetParameters9
(
&
fapo
->
reverb
,
(
FAudioFXReverbParameters9
*
)
params
);
}
else
{
DspReverb_SetParameters
(
&
fapo
->
reverb
,
params
);
}
}
/* Run reverb effect */
#define PROCESS(pin, pout) \
DspReverb_INTERNAL_Process_##pin##_to_##pout( \
...
...
@@ -1666,16 +1683,6 @@ uint32_t FAudioCreateReverbWithCustomAllocatorEXT(
sizeof
(
FAudioFXReverbParameters
)
*
3
);
result
->
apiVersion
=
7
;
#define INITPARAMS(offset) \
FAudio_memcpy( \
params + sizeof(FAudioFXReverbParameters) * offset, \
&fxdefault, \
sizeof(FAudioFXReverbParameters) \
);
INITPARAMS
(
0
)
INITPARAMS
(
1
)
INITPARAMS
(
2
)
#undef INITPARAMS
/* Initialize... */
FAudio_memcpy
(
...
...
@@ -1711,6 +1718,13 @@ uint32_t FAudioCreateReverbWithCustomAllocatorEXT(
result
->
base
.
Destructor
=
FAudioFXReverb_Free
;
#undef ASSIGN_VT
/* Prepare the default parameters */
result
->
base
.
base
.
Initialize
(
result
,
&
fxdefault
,
sizeof
(
FAudioFXReverbParameters
)
);
/* Finally. */
*
ppApo
=
&
result
->
base
.
base
;
return
0
;
...
...
@@ -1839,16 +1853,6 @@ uint32_t FAudioCreateReverb9WithCustomAllocatorEXT(
sizeof
(
FAudioFXReverbParameters9
)
*
3
);
result
->
apiVersion
=
9
;
#define INITPARAMS(offset) \
FAudio_memcpy( \
params + sizeof(FAudioFXReverbParameters9) * offset, \
&fxdefault, \
sizeof(FAudioFXReverbParameters9) \
);
INITPARAMS
(
0
)
INITPARAMS
(
1
)
INITPARAMS
(
2
)
#undef INITPARAMS
/* Initialize... */
FAudio_memcpy
(
...
...
@@ -1884,6 +1888,13 @@ uint32_t FAudioCreateReverb9WithCustomAllocatorEXT(
result
->
base
.
Destructor
=
FAudioFXReverb_Free
;
#undef ASSIGN_VT
/* Prepare the default parameters */
result
->
base
.
base
.
Initialize
(
result
,
&
fxdefault
,
sizeof
(
FAudioFXReverbParameters9
)
);
/* Finally. */
*
ppApo
=
&
result
->
base
.
base
;
return
0
;
...
...
libs/faudio/src/FAudio_internal_simd.c
View file @
4be1dc1b
...
...
@@ -285,10 +285,10 @@ void FAudio_INTERNAL_Convert_U8_To_F32_NEON(
const
uint16x8_t
uint16hi
=
vmovl_u8
(
vget_high_u8
(
bytes
));
/* convert top 8 bytes to 8 uint16 */
const
uint16x8_t
uint16lo
=
vmovl_u8
(
vget_low_u8
(
bytes
));
/* convert bottom 8 bytes to 8 uint16 */
/* split uint16 to two uint32, then convert to float, then multiply to normalize, subtract to adjust for sign, store. */
vst1q_f32
(
dst
,
vmlaq_f32
(
negone
,
vcvtq_f32_u32
(
vmovl_u16
(
vget_low_u16
(
uint16
hi
))),
divby128
));
vst1q_f32
(
dst
+
4
,
vmlaq_f32
(
negone
,
vcvtq_f32_u32
(
vmovl_u16
(
vget_high_u16
(
uint16
hi
))),
divby128
));
vst1q_f32
(
dst
+
8
,
vmlaq_f32
(
negone
,
vcvtq_f32_u32
(
vmovl_u16
(
vget_low_u16
(
uint16
lo
))),
divby128
));
vst1q_f32
(
dst
+
12
,
vmlaq_f32
(
negone
,
vcvtq_f32_u32
(
vmovl_u16
(
vget_high_u16
(
uint16
lo
))),
divby128
));
vst1q_f32
(
dst
,
vmlaq_f32
(
negone
,
vcvtq_f32_u32
(
vmovl_u16
(
vget_low_u16
(
uint16
lo
))),
divby128
));
vst1q_f32
(
dst
+
4
,
vmlaq_f32
(
negone
,
vcvtq_f32_u32
(
vmovl_u16
(
vget_high_u16
(
uint16
lo
))),
divby128
));
vst1q_f32
(
dst
+
8
,
vmlaq_f32
(
negone
,
vcvtq_f32_u32
(
vmovl_u16
(
vget_low_u16
(
uint16
hi
))),
divby128
));
vst1q_f32
(
dst
+
12
,
vmlaq_f32
(
negone
,
vcvtq_f32_u32
(
vmovl_u16
(
vget_high_u16
(
uint16
hi
))),
divby128
));
i
-=
16
;
mmsrc
-=
16
;
dst
-=
16
;
}
...
...
libs/faudio/src/FAudio_platform_win32.c
View file @
4be1dc1b
...
...
@@ -501,6 +501,10 @@ uint32_t FAudio_PlatformGetDeviceDetails(
sizeof
(
GUID
)
);
}
else
{
details
->
OutputFormat
.
dwChannelMask
=
GetMask
(
format
->
nChannels
);
}
CoTaskMemFree
(
format
);
...
...
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