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
f7ed7446
Commit
f7ed7446
authored
Aug 03, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mad: use MAD_F_MIN and MAD_F_MAX
parent
9d44a6d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
MadDecoderPlugin.cxx
src/decoder/plugins/MadDecoderPlugin.cxx
+1
-3
No files found.
src/decoder/plugins/MadDecoderPlugin.cxx
View file @
f7ed7446
...
@@ -79,14 +79,12 @@ static inline int32_t
...
@@ -79,14 +79,12 @@ static inline int32_t
mad_fixed_to_24_sample
(
mad_fixed_t
sample
)
mad_fixed_to_24_sample
(
mad_fixed_t
sample
)
{
{
static
constexpr
unsigned
bits
=
24
;
static
constexpr
unsigned
bits
=
24
;
static
constexpr
mad_fixed_t
MIN
=
-
MAD_F_ONE
;
static
constexpr
mad_fixed_t
MAX
=
MAD_F_ONE
-
1
;
/* round */
/* round */
sample
=
sample
+
(
1L
<<
(
MAD_F_FRACBITS
-
bits
));
sample
=
sample
+
(
1L
<<
(
MAD_F_FRACBITS
-
bits
));
/* quantize */
/* quantize */
return
Clamp
(
sample
,
M
IN
,
MAX
)
return
Clamp
(
sample
,
M
AD_F_MIN
,
MAD_F_
MAX
)
>>
(
MAD_F_FRACBITS
+
1
-
bits
);
>>
(
MAD_F_FRACBITS
+
1
-
bits
);
}
}
...
...
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