Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
c5b59dc4
Commit
c5b59dc4
authored
Apr 12, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always use swab.
parent
e8689aea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
53 deletions
+2
-53
modules/audio_filter/converter/a52tospdif.c
modules/audio_filter/converter/a52tospdif.c
+0
-14
modules/audio_filter/converter/dtstospdif.c
modules/audio_filter/converter/dtstospdif.c
+1
-13
modules/audio_filter/converter/float.c
modules/audio_filter/converter/float.c
+1
-15
modules/demux/mpeg/es.c
modules/demux/mpeg/es.c
+0
-11
No files found.
modules/audio_filter/converter/a52tospdif.c
View file @
c5b59dc4
...
...
@@ -90,10 +90,6 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
*/
static
const
uint8_t
p_sync_le
[
6
]
=
{
0x72
,
0xF8
,
0x1F
,
0x4E
,
0x01
,
0x00
};
static
const
uint8_t
p_sync_be
[
6
]
=
{
0xF8
,
0x72
,
0x4E
,
0x1F
,
0x00
,
0x01
};
#ifndef HAVE_SWAB
uint8_t
*
p_tmp
;
uint16_t
i
;
#endif
uint16_t
i_frame_size
=
p_in_buf
->
i_nb_bytes
/
2
;
uint8_t
*
p_in
=
p_in_buf
->
p_buffer
;
uint8_t
*
p_out
=
p_out_buf
->
p_buffer
;
...
...
@@ -113,17 +109,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out
[
5
]
=
p_in
[
5
]
&
0x7
;
/* bsmod */
p_out
[
6
]
=
(
i_frame_size
<<
4
)
&
0xff
;
p_out
[
7
]
=
(
i_frame_size
>>
4
)
&
0xff
;
#ifdef HAVE_SWAB
swab
(
p_in
,
&
p_out
[
8
],
i_frame_size
*
2
);
#else
p_tmp
=
&
p_out
[
8
];
for
(
i
=
i_frame_size
;
i
--
;
)
{
p_tmp
[
0
]
=
p_in
[
1
];
p_tmp
[
1
]
=
p_in
[
0
];
p_tmp
+=
2
;
p_in
+=
2
;
}
#endif
}
vlc_memset
(
p_out
+
8
+
i_frame_size
*
2
,
0
,
AOUT_SPDIF_SIZE
-
i_frame_size
*
2
-
8
);
...
...
modules/audio_filter/converter/dtstospdif.c
View file @
c5b59dc4
...
...
@@ -191,20 +191,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
/* We are dealing with a big endian bitstream and a little endian output
* or a little endian bitstream and a big endian output.
* Byteswap the stream */
#ifdef HAVE_SWAB
swab
(
p_in
,
p_out
+
8
,
i_length
);
#else
uint16_t
i
;
uint8_t
*
p_tmp
,
tmp
;
p_tmp
=
p_out
+
8
;
for
(
i
=
i_length
/
2
;
i
--
;
)
{
tmp
=
p_in
[
0
];
/* in-place filter */
p_tmp
[
0
]
=
p_in
[
1
];
p_tmp
[
1
]
=
tmp
;
p_tmp
+=
2
;
p_in
+=
2
;
}
#endif
/* If i_length is odd, we have to adjust swapping a bit.. */
if
(
i_length
&
1
)
{
...
...
modules/audio_filter/converter/float.c
View file @
c5b59dc4
...
...
@@ -551,28 +551,14 @@ static void Do_S16ToFL32_SW( aout_instance_t * p_aout, aout_filter_t * p_filter,
int16_t
*
p_in
;
float
*
p_out
=
(
float
*
)
p_out_buf
->
p_buffer
+
i
-
1
;
#ifdef HAVE_SWAB
int16_t
p_swabbed
[
i
];
swab
(
p_in_buf
->
p_buffer
,
p_swabbed
,
i
*
sizeof
(
int16_t
)
);
p_in
=
p_swabbed
+
i
-
1
;
#else
uint8_t
p_tmp
[
2
];
p_in
=
(
int16_t
*
)
p_in_buf
->
p_buffer
+
i
-
1
;
#endif
while
(
i
--
)
{
#ifndef HAVE_SWAB
p_tmp
[
0
]
=
((
uint8_t
*
)
p_in
)[
1
];
p_tmp
[
1
]
=
((
uint8_t
*
)
p_in
)[
0
];
*
p_out
=
(
float
)(
*
(
int16_t
*
)
p_tmp
)
/
32768
.
0
;
#else
*
p_out
=
(
float
)
*
p_in
/
32768
.
0
;
#endif
p_in
--
;
p_out
--
;
}
*
p_out
--
=
(
float
)
*
p_in
--
/
32768
.
0
;
p_out_buf
->
i_nb_samples
=
p_in_buf
->
i_nb_samples
;
p_out_buf
->
i_nb_bytes
=
p_in_buf
->
i_nb_bytes
*
4
/
2
;
...
...
modules/demux/mpeg/es.c
View file @
c5b59dc4
...
...
@@ -221,18 +221,7 @@ static int Demux( demux_t *p_demux )
if
(
p_sys
->
codec
.
b_use_word
&&
!
p_sys
->
b_big_endian
&&
p_block_in
->
i_buffer
>
0
)
{
/* Convert to big endian */
#ifdef HAVE_SWAB
swab
(
p_block_in
->
p_buffer
,
p_block_in
->
p_buffer
,
p_block_in
->
i_buffer
);
#else
uint8_t
*
p_tmp
=
p_block_in
->
p_buffer
;
for
(
int
i
=
p_block_in
->
i_buffer
/
2
;
i
--
;
)
{
uint8_t
tmp
=
p_tmp
[
0
];
p_tmp
[
0
]
=
p_tmp
[
1
];
p_tmp
[
1
]
=
tmp
;
p_tmp
+=
2
;
}
#endif
}
p_block_in
->
i_pts
=
p_block_in
->
i_dts
=
p_sys
->
b_start
||
p_sys
->
b_initial_sync_failed
?
1
:
0
;
...
...
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