Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ec55d235
Commit
ec55d235
authored
Dec 15, 2002
by
Francois Gouget
Committed by
Alexandre Julliard
Dec 15, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use slighly more accurate formula for C816.
Wrap a couple of comments to 80 columns.
parent
f6502221
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
pcmconverter.c
dlls/msacm/pcmconverter.c
+9
-9
No files found.
dlls/msacm/pcmconverter.c
View file @
ec55d235
...
...
@@ -128,15 +128,15 @@ static DWORD PCM_GetFormatIndex(LPWAVEFORMATEX wfx)
* parameters:
* + 8 bit unsigned vs 16 bit signed
* + mono vs stereo (1 or 2 channels)
* + sampling rate (8.0, 11.025, 22.05, 44.1 kHz are defined, but algo
shall work
* in all cases)
* + sampling rate (8.0, 11.025, 22.05, 44.1 kHz are defined, but algo
*
shall work
in all cases)
*
* mono => stereo: copy the same sample on Left & Right channels
* stereo =) mono: use the average value of samples from Left & Right channels
* resampling; we lookup for each destination sample the two source adjacent
samples
*
were src <= dst < src+1 (dst is increased by a fractional value which is
*
equivalent to the increment by one on src); then we use a linear
*
interpolation between src and src+1
* resampling; we lookup for each destination sample the two source adjacent
*
samples were src <= dst < src+1 (dst is increased by a fractional
*
value which is equivalent to the increment by one on src); then we
*
use a linear
interpolation between src and src+1
*/
/***********************************************************************
...
...
@@ -146,7 +146,7 @@ static DWORD PCM_GetFormatIndex(LPWAVEFORMATEX wfx)
*/
static
inline
short
C816
(
unsigned
char
b
)
{
return
(
short
)(
b
^
0x80
)
*
256
;
return
(
short
)(
(
b
+
(
b
<<
8
))
-
32768
)
;
}
/***********************************************************************
...
...
@@ -784,8 +784,8 @@ static LRESULT PCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
afd
->
pwfx
->
nChannels
=
PCM_Formats
[
afd
->
dwFormatIndex
].
nChannels
;
afd
->
pwfx
->
nSamplesPerSec
=
PCM_Formats
[
afd
->
dwFormatIndex
].
rate
;
afd
->
pwfx
->
wBitsPerSample
=
PCM_Formats
[
afd
->
dwFormatIndex
].
nBits
;
/* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not
accessible
* afd->pwfx->cbSize = 0;
/* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not
* a
ccessible a
fd->pwfx->cbSize = 0;
*/
afd
->
pwfx
->
nBlockAlign
=
(
afd
->
pwfx
->
nChannels
*
afd
->
pwfx
->
wBitsPerSample
)
/
8
;
...
...
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