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
72e80db8
Commit
72e80db8
authored
Oct 20, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_*: add "restrict" keywords
Allow more compiler optimizations.
parent
7b33c343
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
18 deletions
+29
-18
pcm_channels.c
src/pcm_channels.c
+23
-16
pcm_format.c
src/pcm_format.c
+6
-2
No files found.
src/pcm_channels.c
View file @
72e80db8
...
...
@@ -25,8 +25,9 @@
#include <assert.h>
static
void
pcm_convert_channels_16_1_to_2
(
int16_t
*
dest
,
const
int16_t
*
src
,
const
int16_t
*
src_end
)
pcm_convert_channels_16_1_to_2
(
int16_t
*
restrict
dest
,
const
int16_t
*
restrict
src
,
const
int16_t
*
restrict
src_end
)
{
while
(
src
<
src_end
)
{
int16_t
value
=
*
src
++
;
...
...
@@ -37,8 +38,9 @@ pcm_convert_channels_16_1_to_2(int16_t *dest, const int16_t *src,
}
static
void
pcm_convert_channels_16_2_to_1
(
int16_t
*
dest
,
const
int16_t
*
src
,
const
int16_t
*
src_end
)
pcm_convert_channels_16_2_to_1
(
int16_t
*
restrict
dest
,
const
int16_t
*
restrict
src
,
const
int16_t
*
restrict
src_end
)
{
while
(
src
<
src_end
)
{
int32_t
a
=
*
src
++
,
b
=
*
src
++
;
...
...
@@ -48,9 +50,10 @@ pcm_convert_channels_16_2_to_1(int16_t *dest, const int16_t *src,
}
static
void
pcm_convert_channels_16_n_to_2
(
int16_t
*
dest
,
unsigned
src_channels
,
const
int16_t
*
src
,
const
int16_t
*
src_end
)
pcm_convert_channels_16_n_to_2
(
int16_t
*
restrict
dest
,
unsigned
src_channels
,
const
int16_t
*
restrict
src
,
const
int16_t
*
restrict
src_end
)
{
unsigned
c
;
...
...
@@ -98,8 +101,9 @@ pcm_convert_channels_16(struct pcm_buffer *buffer,
}
static
void
pcm_convert_channels_24_1_to_2
(
int32_t
*
dest
,
const
int32_t
*
src
,
const
int32_t
*
src_end
)
pcm_convert_channels_24_1_to_2
(
int32_t
*
restrict
dest
,
const
int32_t
*
restrict
src
,
const
int32_t
*
restrict
src_end
)
{
while
(
src
<
src_end
)
{
int32_t
value
=
*
src
++
;
...
...
@@ -110,8 +114,9 @@ pcm_convert_channels_24_1_to_2(int32_t *dest, const int32_t *src,
}
static
void
pcm_convert_channels_24_2_to_1
(
int32_t
*
dest
,
const
int32_t
*
src
,
const
int32_t
*
src_end
)
pcm_convert_channels_24_2_to_1
(
int32_t
*
restrict
dest
,
const
int32_t
*
restrict
src
,
const
int32_t
*
restrict
src_end
)
{
while
(
src
<
src_end
)
{
int32_t
a
=
*
src
++
,
b
=
*
src
++
;
...
...
@@ -121,9 +126,10 @@ pcm_convert_channels_24_2_to_1(int32_t *dest, const int32_t *src,
}
static
void
pcm_convert_channels_24_n_to_2
(
int32_t
*
dest
,
unsigned
src_channels
,
const
int32_t
*
src
,
const
int32_t
*
src_end
)
pcm_convert_channels_24_n_to_2
(
int32_t
*
restrict
dest
,
unsigned
src_channels
,
const
int32_t
*
restrict
src
,
const
int32_t
*
restrict
src_end
)
{
unsigned
c
;
...
...
@@ -178,8 +184,9 @@ pcm_convert_channels_32_1_to_2(int32_t *dest, const int32_t *src,
}
static
void
pcm_convert_channels_32_2_to_1
(
int32_t
*
dest
,
const
int32_t
*
src
,
const
int32_t
*
src_end
)
pcm_convert_channels_32_2_to_1
(
int32_t
*
restrict
dest
,
const
int32_t
*
restrict
src
,
const
int32_t
*
restrict
src_end
)
{
while
(
src
<
src_end
)
{
int64_t
a
=
*
src
++
,
b
=
*
src
++
;
...
...
src/pcm_format.c
View file @
72e80db8
...
...
@@ -137,7 +137,9 @@ pcm_convert_16_to_24(int32_t *out, const int16_t *in, const int16_t *in_end)
}
static
void
pcm_convert_32_to_24
(
int32_t
*
out
,
const
int32_t
*
in
,
const
int32_t
*
in_end
)
pcm_convert_32_to_24
(
int32_t
*
restrict
out
,
const
int32_t
*
restrict
in
,
const
int32_t
*
restrict
in_end
)
{
while
(
in
<
in_end
)
*
out
++
=
*
in
++
>>
8
;
...
...
@@ -208,7 +210,9 @@ pcm_convert_16_to_32(int32_t *out, const int16_t *in, const int16_t *in_end)
}
static
void
pcm_convert_24_to_32
(
int32_t
*
out
,
const
int32_t
*
in
,
const
int32_t
*
in_end
)
pcm_convert_24_to_32
(
int32_t
*
restrict
out
,
const
int32_t
*
restrict
in
,
const
int32_t
*
restrict
in_end
)
{
while
(
in
<
in_end
)
*
out
++
=
*
in
++
<<
8
;
...
...
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