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
39185814
Commit
39185814
authored
Nov 04, 2013
by
Andrew Eikum
Committed by
Alexandre Julliard
Nov 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msadp32: Also convert to 8-bit PCM.
parent
1483bfa2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
32 deletions
+64
-32
msadp32.c
dlls/msadp32.acm/msadp32.c
+64
-32
No files found.
dlls/msadp32.acm/msadp32.c
View file @
39185814
...
...
@@ -223,6 +223,11 @@ static inline void process_nibble(unsigned nibble, int* idelta,
if
(
*
idelta
<
16
)
*
idelta
=
16
;
}
static
inline
unsigned
char
C168
(
short
s
)
{
return
HIBYTE
(
s
)
^
(
unsigned
char
)
0x80
;
}
static
void
cvtSSms16K
(
const
ACMDRVSTREAMINSTANCE
*
adsi
,
const
unsigned
char
*
src
,
LPDWORD
nsrc
,
unsigned
char
*
dst
,
LPDWORD
ndst
)
...
...
@@ -234,10 +239,10 @@ static void cvtSSms16K(const ACMDRVSTREAMINSTANCE *adsi,
int
nsamp
;
int
nsamp_blk
=
((
ADPCMWAVEFORMAT
*
)
adsi
->
pwfxSrc
)
->
wSamplesPerBlock
;
DWORD
nblock
=
min
(
*
nsrc
/
adsi
->
pwfxSrc
->
nBlockAlign
,
*
ndst
/
(
nsamp_blk
*
2
*
2
));
*
ndst
/
(
nsamp_blk
*
adsi
->
pwfxDst
->
nBlockAlign
));
*
nsrc
=
nblock
*
adsi
->
pwfxSrc
->
nBlockAlign
;
*
ndst
=
nblock
*
nsamp_blk
*
2
*
2
;
*
ndst
=
nblock
*
nsamp_blk
*
adsi
->
pwfxDst
->
nBlockAlign
;
nsamp_blk
-=
2
;
/* see below for samples from block head */
for
(;
nblock
>
0
;
nblock
--
)
...
...
@@ -256,18 +261,34 @@ static void cvtSSms16K(const ACMDRVSTREAMINSTANCE *adsi,
sample2L
=
R16
(
src
);
src
+=
2
;
sample2R
=
R16
(
src
);
src
+=
2
;
/* store samples from block head */
W16
(
dst
,
sample2L
);
dst
+=
2
;
W16
(
dst
,
sample2R
);
dst
+=
2
;
W16
(
dst
,
sample1L
);
dst
+=
2
;
W16
(
dst
,
sample1R
);
dst
+=
2
;
for
(
nsamp
=
nsamp_blk
;
nsamp
>
0
;
nsamp
--
)
{
process_nibble
(
*
src
>>
4
,
&
ideltaL
,
&
sample1L
,
&
sample2L
,
&
coeffL
);
W16
(
dst
,
sample1L
);
dst
+=
2
;
process_nibble
(
*
src
++
&
0x0F
,
&
ideltaR
,
&
sample1R
,
&
sample2R
,
&
coeffR
);
W16
(
dst
,
sample1R
);
dst
+=
2
;
if
(
adsi
->
pwfxDst
->
wBitsPerSample
==
8
){
/* store samples from block head */
*
dst
=
C168
(
sample2L
);
++
dst
;
*
dst
=
C168
(
sample2R
);
++
dst
;
*
dst
=
C168
(
sample1L
);
++
dst
;
*
dst
=
C168
(
sample1R
);
++
dst
;
for
(
nsamp
=
nsamp_blk
;
nsamp
>
0
;
nsamp
--
)
{
process_nibble
(
*
src
>>
4
,
&
ideltaL
,
&
sample1L
,
&
sample2L
,
&
coeffL
);
*
dst
=
C168
(
sample1L
);
++
dst
;
process_nibble
(
*
src
++
&
0x0F
,
&
ideltaR
,
&
sample1R
,
&
sample2R
,
&
coeffR
);
*
dst
=
C168
(
sample1R
);
++
dst
;
}
}
else
if
(
adsi
->
pwfxDst
->
wBitsPerSample
==
16
){
/* store samples from block head */
W16
(
dst
,
sample2L
);
dst
+=
2
;
W16
(
dst
,
sample2R
);
dst
+=
2
;
W16
(
dst
,
sample1L
);
dst
+=
2
;
W16
(
dst
,
sample1R
);
dst
+=
2
;
for
(
nsamp
=
nsamp_blk
;
nsamp
>
0
;
nsamp
--
)
{
process_nibble
(
*
src
>>
4
,
&
ideltaL
,
&
sample1L
,
&
sample2L
,
&
coeffL
);
W16
(
dst
,
sample1L
);
dst
+=
2
;
process_nibble
(
*
src
++
&
0x0F
,
&
ideltaR
,
&
sample1R
,
&
sample2R
,
&
coeffR
);
W16
(
dst
,
sample1R
);
dst
+=
2
;
}
}
src
=
in_src
+
adsi
->
pwfxSrc
->
nBlockAlign
;
}
...
...
@@ -283,10 +304,10 @@ static void cvtMMms16K(const ACMDRVSTREAMINSTANCE *adsi,
int
nsamp
;
int
nsamp_blk
=
((
ADPCMWAVEFORMAT
*
)
adsi
->
pwfxSrc
)
->
wSamplesPerBlock
;
DWORD
nblock
=
min
(
*
nsrc
/
adsi
->
pwfxSrc
->
nBlockAlign
,
*
ndst
/
(
nsamp_blk
*
2
));
*
ndst
/
(
nsamp_blk
*
adsi
->
pwfxDst
->
nBlockAlign
));
*
nsrc
=
nblock
*
adsi
->
pwfxSrc
->
nBlockAlign
;
*
ndst
=
nblock
*
nsamp_blk
*
2
;
*
ndst
=
nblock
*
nsamp_blk
*
adsi
->
pwfxDst
->
nBlockAlign
;
nsamp_blk
-=
2
;
/* see below for samples from block head */
for
(;
nblock
>
0
;
nblock
--
)
...
...
@@ -301,16 +322,30 @@ static void cvtMMms16K(const ACMDRVSTREAMINSTANCE *adsi,
sample2
=
R16
(
src
);
src
+=
2
;
/* store samples from block head */
W16
(
dst
,
sample2
);
dst
+=
2
;
W16
(
dst
,
sample1
);
dst
+=
2
;
for
(
nsamp
=
nsamp_blk
;
nsamp
>
0
;
nsamp
-=
2
)
{
process_nibble
(
*
src
>>
4
,
&
idelta
,
&
sample1
,
&
sample2
,
&
coeff
);
W16
(
dst
,
sample1
);
dst
+=
2
;
process_nibble
(
*
src
++
&
0x0F
,
&
idelta
,
&
sample1
,
&
sample2
,
&
coeff
);
W16
(
dst
,
sample1
);
dst
+=
2
;
if
(
adsi
->
pwfxDst
->
wBitsPerSample
==
8
){
*
dst
=
C168
(
sample2
);
++
dst
;
*
dst
=
C168
(
sample1
);
++
dst
;
for
(
nsamp
=
nsamp_blk
;
nsamp
>
0
;
nsamp
-=
2
)
{
process_nibble
(
*
src
>>
4
,
&
idelta
,
&
sample1
,
&
sample2
,
&
coeff
);
*
dst
=
C168
(
sample1
);
++
dst
;
process_nibble
(
*
src
++
&
0x0F
,
&
idelta
,
&
sample1
,
&
sample2
,
&
coeff
);
*
dst
=
C168
(
sample1
);
++
dst
;
}
}
else
if
(
adsi
->
pwfxDst
->
wBitsPerSample
==
16
){
W16
(
dst
,
sample2
);
dst
+=
2
;
W16
(
dst
,
sample1
);
dst
+=
2
;
for
(
nsamp
=
nsamp_blk
;
nsamp
>
0
;
nsamp
-=
2
)
{
process_nibble
(
*
src
>>
4
,
&
idelta
,
&
sample1
,
&
sample2
,
&
coeff
);
W16
(
dst
,
sample1
);
dst
+=
2
;
process_nibble
(
*
src
++
&
0x0F
,
&
idelta
,
&
sample1
,
&
sample2
,
&
coeff
);
W16
(
dst
,
sample1
);
dst
+=
2
;
}
}
src
=
in_src
+
adsi
->
pwfxSrc
->
nBlockAlign
;
}
}
...
...
@@ -553,12 +588,9 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
else
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_ADPCM
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
/* resampling or mono <=> stereo not available
* ADPCM algo only define 16 bit per sample output
*/
/* resampling or mono <=> stereo not available */
if
(
adsi
->
pwfxSrc
->
nSamplesPerSec
!=
adsi
->
pwfxDst
->
nSamplesPerSec
||
adsi
->
pwfxSrc
->
nChannels
!=
adsi
->
pwfxDst
->
nChannels
||
adsi
->
pwfxDst
->
wBitsPerSample
!=
16
)
adsi
->
pwfxSrc
->
nChannels
!=
adsi
->
pwfxDst
->
nChannels
)
goto
theEnd
;
#if 0
...
...
@@ -577,9 +609,9 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
#endif
/* adpcm decoding... */
if
(
adsi
->
pwfxDst
->
wBitsPerSample
==
16
&&
adsi
->
pwfxDst
->
nChannels
==
2
)
if
(
adsi
->
pwfxDst
->
nChannels
==
2
)
aad
->
convert
=
cvtSSms16K
;
if
(
adsi
->
pwfxDst
->
wBitsPerSample
==
16
&&
adsi
->
pwfxDst
->
nChannels
==
1
)
else
if
(
adsi
->
pwfxDst
->
nChannels
==
1
)
aad
->
convert
=
cvtMMms16K
;
}
else
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_PCM
&&
...
...
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