Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
b7b5e3f9
Commit
b7b5e3f9
authored
Jan 07, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_prng: renamed prng() to pcm_prng()
parent
3fd1fa31
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
pcm_dither.c
src/pcm_dither.c
+1
-1
pcm_prng.h
src/pcm_prng.h
+2
-1
pcm_volume.h
src/pcm_volume.h
+1
-1
No files found.
src/pcm_dither.c
View file @
b7b5e3f9
...
...
@@ -43,7 +43,7 @@ pcm_dither_sample_24_to_16(int32_t sample, struct pcm_dither_24 *dither)
/* round */
output
=
sample
+
round
;
rnd
=
prng
(
dither
->
random
);
rnd
=
p
cm_p
rng
(
dither
->
random
);
output
+=
(
rnd
&
mask
)
-
(
dither
->
random
&
mask
);
dither
->
random
=
rnd
;
...
...
src/pcm_prng.h
View file @
b7b5e3f9
...
...
@@ -23,7 +23,8 @@
* A very simple linear congruential PRNG. It's good enough for PCM
* dithering.
*/
static
unsigned
long
prng
(
unsigned
long
state
)
static
unsigned
long
pcm_prng
(
unsigned
long
state
)
{
return
(
state
*
0x0019660dL
+
0x3c6ef35fL
)
&
0xffffffffL
;
}
...
...
src/pcm_volume.h
View file @
b7b5e3f9
...
...
@@ -46,7 +46,7 @@ pcm_dither(void)
static
unsigned
long
state
;
uint32_t
r
;
r
=
state
=
prng
(
state
);
r
=
state
=
p
cm_p
rng
(
state
);
return
(
r
&
511
)
-
((
r
>>
9
)
&
511
);
}
...
...
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