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
d24f2ba5
Commit
d24f2ba5
authored
Mar 02, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_dither: added pcm_dither_32_to_16()
For 32 bit dithering, reuse the 24 bit dithering code, but apply a 8 bit right shift first.
parent
78e08f65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
pcm_dither.c
src/pcm_dither.c
+15
-0
pcm_dither.h
src/pcm_dither.h
+5
-0
No files found.
src/pcm_dither.c
View file @
d24f2ba5
...
...
@@ -76,3 +76,18 @@ pcm_dither_24_to_16(struct pcm_dither *dither,
while
(
num_samples
--
>
0
)
*
dest
++
=
pcm_dither_sample_24_to_16
(
*
src
++
,
dither
);
}
static
int16_t
pcm_dither_sample_32_to_16
(
int32_t
sample
,
struct
pcm_dither
*
dither
)
{
return
pcm_dither_sample_24_to_16
(
sample
>>
8
,
dither
);
}
void
pcm_dither_32_to_16
(
struct
pcm_dither
*
dither
,
int16_t
*
dest
,
const
int32_t
*
src
,
unsigned
num_samples
)
{
while
(
num_samples
--
>
0
)
*
dest
++
=
pcm_dither_sample_32_to_16
(
*
src
++
,
dither
);
}
src/pcm_dither.h
View file @
d24f2ba5
...
...
@@ -38,4 +38,9 @@ pcm_dither_24_to_16(struct pcm_dither *dither,
int16_t
*
dest
,
const
int32_t
*
src
,
unsigned
num_samples
);
void
pcm_dither_32_to_16
(
struct
pcm_dither
*
dither
,
int16_t
*
dest
,
const
int32_t
*
src
,
unsigned
num_samples
);
#endif
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