Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
7e1bdf77
Commit
7e1bdf77
authored
Apr 19, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dr_flac and dr_mp3.
parent
1f295eba
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
106 deletions
+134
-106
extras/dr_flac.h
extras/dr_flac.h
+112
-104
extras/dr_mp3.h
extras/dr_mp3.h
+22
-2
No files found.
extras/dr_flac.h
View file @
7e1bdf77
This diff is collapsed.
Click to expand it.
extras/dr_mp3.h
View file @
7e1bdf77
/*
MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_mp3 - v0.6.
3 - 2020-04-13
dr_mp3 - v0.6.
4 - 2020-04-19
David Reid - mackron@gmail.com
...
...
@@ -669,6 +669,17 @@ static int drmp3_have_simd(void)
#endif
#if defined(__ARM_ARCH) && (__ARM_ARCH >= 6) && !defined(__aarch64__)
#define DRMP3_HAVE_ARMV6 1
static
__inline__
__attribute__
((
always_inline
))
drmp32_int32
drmp3_clip_int16_arm
(
int32_t
a
)
{
drmp3_int32
x
=
0
;
__asm__
(
"ssat %0, #16, %1"
:
"=r"
(
x
)
:
"r"
(
a
));
return
x
;
}
#endif
typedef
struct
{
const
drmp3_uint8
*
buf
;
...
...
@@ -1888,11 +1899,17 @@ typedef drmp3_int16 drmp3d_sample_t;
static
drmp3_int16
drmp3d_scale_pcm
(
float
sample
)
{
drmp3_int16
s
;
#if DRMP3_HAVE_ARMV6
drmp3_int32
s32
=
(
drmp3_int32
)(
sample
+
.5
f
);
s32
-=
(
s32
<
0
);
s
=
(
drmp3_int16
)
drmp3_clip_int16_arm
(
s32
);
#else
if
(
sample
>=
32766.5
)
return
(
drmp3_int16
)
32767
;
if
(
sample
<=
-
32767.5
)
return
(
drmp3_int16
)
-
32768
;
s
=
(
drmp3_int16
)(
sample
+
.5
f
);
s
-=
(
s
<
0
);
/* away from zero, to be compliant */
return
(
drmp3_int16
)
s
;
#endif
return
s
;
}
#else
typedef
float
drmp3d_sample_t
;
...
...
@@ -4343,6 +4360,9 @@ counts rather than sample counts.
/*
REVISION HISTORY
================
v0.6.4 - 2020-04-19
- Bring up to date with changes to minimp3.
v0.6.3 - 2020-04-13
- Fix some pedantic warnings.
...
...
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