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
eab78ab9
Commit
eab78ab9
authored
Jan 31, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PcmDither: use constexpr
parent
f2491c88
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
PcmDither.cxx
src/PcmDither.cxx
+8
-10
No files found.
src/PcmDither.cxx
View file @
eab78ab9
...
@@ -24,16 +24,14 @@
...
@@ -24,16 +24,14 @@
inline
int16_t
inline
int16_t
PcmDither
::
Dither24To16
(
int_fast32_t
sample
)
PcmDither
::
Dither24To16
(
int_fast32_t
sample
)
{
{
enum
{
constexpr
unsigned
from_bits
=
24
;
from_bits
=
24
,
constexpr
unsigned
to_bits
=
16
;
to_bits
=
16
,
constexpr
unsigned
scale_bits
=
from_bits
-
to_bits
;
scale_bits
=
from_bits
-
to_bits
,
constexpr
int_fast32_t
round
=
1
<<
(
scale_bits
-
1
);
round
=
1
<<
(
scale_bits
-
1
),
constexpr
int_fast32_t
mask
=
(
1
<<
scale_bits
)
-
1
;
mask
=
(
1
<<
scale_bits
)
-
1
,
constexpr
int_fast32_t
ONE
=
1
<<
(
from_bits
-
1
);
ONE
=
1
<<
(
from_bits
-
1
),
constexpr
int_fast32_t
MIN
=
-
ONE
;
MIN
=
-
ONE
,
constexpr
int_fast32_t
MAX
=
ONE
-
1
;
MAX
=
ONE
-
1
};
sample
+=
error
[
0
]
-
error
[
1
]
+
error
[
2
];
sample
+=
error
[
0
]
-
error
[
1
]
+
error
[
2
];
...
...
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