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
fee9f148
Commit
fee9f148
authored
Oct 26, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Pack: add "noexcept"
parent
ae67f44c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
PcmPack.cxx
src/pcm/PcmPack.cxx
+7
-5
PcmPack.hxx
src/pcm/PcmPack.hxx
+6
-3
No files found.
src/pcm/PcmPack.cxx
View file @
fee9f148
...
...
@@ -21,7 +21,7 @@
#include "system/ByteOrder.hxx"
static
void
pack_sample
(
uint8_t
*
dest
,
const
int32_t
*
src0
)
pack_sample
(
uint8_t
*
dest
,
const
int32_t
*
src0
)
noexcept
{
const
uint8_t
*
src
=
(
const
uint8_t
*
)
src0
;
...
...
@@ -34,7 +34,7 @@ pack_sample(uint8_t *dest, const int32_t *src0)
}
void
pcm_pack_24
(
uint8_t
*
dest
,
const
int32_t
*
src
,
const
int32_t
*
src_end
)
pcm_pack_24
(
uint8_t
*
dest
,
const
int32_t
*
src
,
const
int32_t
*
src_end
)
noexcept
{
/* duplicate loop to help the compiler's optimizer (constant
parameter to the pack_sample() inline function) */
...
...
@@ -49,7 +49,7 @@ pcm_pack_24(uint8_t *dest, const int32_t *src, const int32_t *src_end)
* Construct a signed 24 bit integer from three bytes into a int32_t.
*/
static
constexpr
int32_t
ConstructS24
(
uint8_t
low
,
uint8_t
mid
,
uint8_t
high
)
ConstructS24
(
uint8_t
low
,
uint8_t
mid
,
uint8_t
high
)
noexcept
{
return
int32_t
(
low
)
|
(
int32_t
(
mid
)
<<
8
)
|
(
int32_t
(
high
)
<<
16
)
|
/* extend the sign bit */
...
...
@@ -87,7 +87,8 @@ ReadS24(const uint8_t *src) noexcept
}
void
pcm_unpack_24
(
int32_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
)
pcm_unpack_24
(
int32_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
)
noexcept
{
while
(
src
<
src_end
)
{
*
dest
++
=
ReadS24
(
src
);
...
...
@@ -96,7 +97,8 @@ pcm_unpack_24(int32_t *dest, const uint8_t *src, const uint8_t *src_end)
}
void
pcm_unpack_24be
(
int32_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
)
pcm_unpack_24be
(
int32_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
)
noexcept
{
while
(
src
<
src_end
)
{
*
dest
++
=
ReadS24BE
(
src
);
...
...
src/pcm/PcmPack.hxx
View file @
fee9f148
...
...
@@ -37,7 +37,8 @@
* @param src the source buffer
*/
void
pcm_pack_24
(
uint8_t
*
dest
,
const
int32_t
*
src
,
const
int32_t
*
src_end
);
pcm_pack_24
(
uint8_t
*
dest
,
const
int32_t
*
src
,
const
int32_t
*
src_end
)
noexcept
;
/**
* Converts packed 24 bit samples (3 bytes per sample) to padded 24
...
...
@@ -47,13 +48,15 @@ pcm_pack_24(uint8_t *dest, const int32_t *src, const int32_t *src_end);
* @param src the source buffer (array of triples)
*/
void
pcm_unpack_24
(
int32_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
);
pcm_unpack_24
(
int32_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
)
noexcept
;
/**
* Like pcm_unpack_24(), but assume the source byte order is
* big-endian. The destination byte order ia always native.
*/
void
pcm_unpack_24be
(
int32_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
);
pcm_unpack_24be
(
int32_t
*
dest
,
const
uint8_t
*
src
,
const
uint8_t
*
src_end
)
noexcept
;
#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