Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
cd3b4161
Commit
cd3b4161
authored
Jan 30, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ugly resampler: use memcpy()
parent
2e12c3f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
modules/audio_filter/resampler/ugly.c
modules/audio_filter/resampler/ugly.c
+18
-21
No files found.
modules/audio_filter/resampler/ugly.c
View file @
cd3b4161
...
...
@@ -84,11 +84,11 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
if
(
p_filter
->
fmt_out
.
audio
.
i_rate
==
p_filter
->
fmt_in
.
audio
.
i_rate
)
return
p_in_buf
;
unsigned
int
i_nb_channels
=
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
)
;
unsigned
int
i_
in_nb
=
p_in_buf
->
i_nb_samples
;
unsigned
int
i_out_nb
=
i_in_nb
*
p_filter
->
fmt_out
.
audio
.
i_rate
/
p_filter
->
fmt_in
.
audio
.
i_rate
;
unsigned
int
i_sample_bytes
=
i_nb_channels
*
sizeof
(
int32_t
);
block_t
*
p_out_buf
=
p_in_buf
;
unsigned
int
i_
out_nb
=
p_in_buf
->
i_nb_samples
*
p_filter
->
fmt_out
.
audio
.
i_rate
/
p_filter
->
fmt_in
.
audio
.
i_rate
;
const
unsigned
int
i_sample_bytes
=
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
)
*
sizeof
(
int32_t
);
if
(
p_filter
->
fmt_out
.
audio
.
i_rate
>
p_filter
->
fmt_in
.
audio
.
i_rate
)
{
...
...
@@ -97,33 +97,30 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
goto
out
;
}
int32_t
*
p_out
=
(
int32_t
*
)
p_out_buf
->
p_buffer
;
const
int32_t
*
p_in
=
(
int32_t
*
)
p_in_buf
->
p_buffer
;
unsigned
char
*
p_out
=
p_out_buf
->
p_buffer
;
unsigned
char
*
p_in
=
p_in_buf
->
p_buffer
;
unsigned
int
i_remainder
=
0
;
for
(
unsigned
i_out
=
i_out_nb
;
i_out
--
;
)
p_out_buf
->
i_nb_samples
=
i_out_nb
;
p_out_buf
->
i_buffer
=
i_out_nb
*
i_sample_bytes
;
p_out_buf
->
i_pts
=
p_in_buf
->
i_pts
;
p_out_buf
->
i_length
=
p_out_buf
->
i_nb_samples
*
1000000
/
p_filter
->
fmt_out
.
audio
.
i_rate
;
while
(
i_out_nb
)
{
for
(
unsigned
i_chan
=
i_nb_channels
;
i_chan
;
)
{
i_chan
--
;
p_out
[
i_chan
]
=
p_in
[
i_chan
];
}
p_out
+=
i_nb_channels
;
memcpy
(
p_out
,
p_in
,
i_sample_bytes
);
p_out
+=
i_sample_bytes
;
i_out_nb
--
;
i_remainder
+=
p_filter
->
fmt_in
.
audio
.
i_rate
;
while
(
i_remainder
>=
p_filter
->
fmt_out
.
audio
.
i_rate
)
{
p_in
+=
i_
nb_channel
s
;
p_in
+=
i_
sample_byte
s
;
i_remainder
-=
p_filter
->
fmt_out
.
audio
.
i_rate
;
}
}
p_out_buf
->
i_nb_samples
=
i_out_nb
;
p_out_buf
->
i_buffer
=
i_out_nb
*
i_sample_bytes
;
p_out_buf
->
i_pts
=
p_in_buf
->
i_pts
;
p_out_buf
->
i_length
=
p_out_buf
->
i_nb_samples
*
1000000
/
p_filter
->
fmt_out
.
audio
.
i_rate
;
if
(
p_in_buf
!=
p_out_buf
)
out:
block_Release
(
p_in_buf
);
...
...
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