Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
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
videolan
vlc-gpu
Commits
0a2f90d4
Commit
0a2f90d4
authored
Aug 17, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audio format: use bswap*()
parent
9ff7bdc4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
modules/audio_filter/converter/format.c
modules/audio_filter/converter/format.c
+12
-16
No files found.
modules/audio_filter/converter/format.c
View file @
0a2f90d4
...
...
@@ -481,42 +481,38 @@ static void S24toFl32(block_t *bdst, const block_t *bsrc)
}
/* */
#define XCHG(type, a, b) \
do { type _tmp = a; a = b; b = _tmp; } while(0)
static
void
Swap64
(
block_t
*
b
)
{
uint
8_t
*
data
=
(
uint8
_t
*
)
b
->
p_buffer
;
uint
64_t
*
data
=
(
uint64
_t
*
)
b
->
p_buffer
;
for
(
size_t
i
=
0
;
i
<
b
->
i_buffer
/
8
;
i
++
)
{
XCHG
(
uint8_t
,
data
[
0
],
data
[
7
]);
XCHG
(
uint8_t
,
data
[
1
],
data
[
6
]);
XCHG
(
uint8_t
,
data
[
2
],
data
[
5
]);
XCHG
(
uint8_t
,
data
[
3
],
data
[
4
]);
data
+=
8
;
*
data
=
bswap64
(
*
data
);
data
++
;
}
}
static
void
Swap32
(
block_t
*
b
)
{
uint
8_t
*
data
=
(
uint8
_t
*
)
b
->
p_buffer
;
uint
32_t
*
data
=
(
uint32
_t
*
)
b
->
p_buffer
;
for
(
size_t
i
=
0
;
i
<
b
->
i_buffer
/
4
;
i
++
)
{
XCHG
(
uint8_t
,
data
[
0
],
data
[
3
]);
XCHG
(
uint8_t
,
data
[
1
],
data
[
2
]);
data
+=
4
;
*
data
=
bswap32
(
*
data
);
data
++
;
}
}
static
void
Swap24
(
block_t
*
b
)
{
uint8_t
*
data
=
(
uint8_t
*
)
b
->
p_buffer
;
for
(
size_t
i
=
0
;
i
<
b
->
i_buffer
/
3
;
i
++
)
{
XCHG
(
uint8_t
,
data
[
0
],
data
[
2
]);
uint8_t
buf
=
data
[
0
];
data
[
0
]
=
data
[
2
];
data
[
2
]
=
buf
;
data
+=
3
;
}
}
static
void
Swap16
(
block_t
*
b
)
{
uint
8_t
*
data
=
(
uint8
_t
*
)
b
->
p_buffer
;
uint
16_t
*
data
=
(
uint16
_t
*
)
b
->
p_buffer
;
for
(
size_t
i
=
0
;
i
<
b
->
i_buffer
/
2
;
i
++
)
{
XCHG
(
uint8_t
,
data
[
0
],
data
[
1
]
);
data
+=
2
;
*
data
=
bswap16
(
*
data
);
data
++
;
}
}
...
...
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