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
d1b74734
Commit
d1b74734
authored
Dec 24, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Dither: rename DitherShift() to DitherConvert()
parent
1ad52f13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
PcmDither.cxx
src/pcm/PcmDither.cxx
+7
-7
PcmDither.hxx
src/pcm/PcmDither.hxx
+4
-4
No files found.
src/pcm/PcmDither.cxx
View file @
d1b74734
...
...
@@ -64,7 +64,7 @@ PcmDither::Dither(T sample)
template
<
typename
ST
,
typename
DT
>
inline
typename
DT
::
value_type
PcmDither
::
Dither
Shif
t
(
typename
ST
::
value_type
sample
)
PcmDither
::
Dither
Conver
t
(
typename
ST
::
value_type
sample
)
{
static_assert
(
ST
::
BITS
>
DT
::
BITS
,
"Sample formats cannot be dithered"
);
...
...
@@ -77,12 +77,12 @@ PcmDither::DitherShift(typename ST::value_type sample)
template
<
typename
ST
,
typename
DT
>
inline
void
PcmDither
::
Dither
Shif
t
(
typename
DT
::
pointer_type
dest
,
typename
ST
::
const_pointer_type
src
,
typename
ST
::
const_pointer_type
src_end
)
PcmDither
::
Dither
Conver
t
(
typename
DT
::
pointer_type
dest
,
typename
ST
::
const_pointer_type
src
,
typename
ST
::
const_pointer_type
src_end
)
{
while
(
src
<
src_end
)
*
dest
++
=
Dither
Shif
t
<
ST
,
DT
>
(
*
src
++
);
*
dest
++
=
Dither
Conver
t
<
ST
,
DT
>
(
*
src
++
);
}
void
...
...
@@ -91,7 +91,7 @@ PcmDither::Dither24To16(int16_t *dest, const int32_t *src,
{
typedef
SampleTraits
<
SampleFormat
::
S24_P32
>
ST
;
typedef
SampleTraits
<
SampleFormat
::
S16
>
DT
;
Dither
Shif
t
<
ST
,
DT
>
(
dest
,
src
,
src_end
);
Dither
Conver
t
<
ST
,
DT
>
(
dest
,
src
,
src_end
);
}
void
...
...
@@ -100,5 +100,5 @@ PcmDither::Dither32To16(int16_t *dest, const int32_t *src,
{
typedef
SampleTraits
<
SampleFormat
::
S32
>
ST
;
typedef
SampleTraits
<
SampleFormat
::
S16
>
DT
;
Dither
Shif
t
<
ST
,
DT
>
(
dest
,
src
,
src_end
);
Dither
Conver
t
<
ST
,
DT
>
(
dest
,
src
,
src_end
);
}
src/pcm/PcmDither.hxx
View file @
d1b74734
...
...
@@ -43,12 +43,12 @@ private:
T
Dither
(
T
sample
);
template
<
typename
ST
,
typename
DT
>
typename
DT
::
value_type
Dither
Shif
t
(
typename
ST
::
value_type
sample
);
typename
DT
::
value_type
Dither
Conver
t
(
typename
ST
::
value_type
sample
);
template
<
typename
ST
,
typename
DT
>
void
Dither
Shif
t
(
typename
DT
::
pointer_type
dest
,
typename
ST
::
const_pointer_type
src
,
typename
ST
::
const_pointer_type
src_end
);
void
Dither
Conver
t
(
typename
DT
::
pointer_type
dest
,
typename
ST
::
const_pointer_type
src
,
typename
ST
::
const_pointer_type
src_end
);
};
#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