Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
618b067d
Commit
618b067d
authored
Sep 12, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws_snd: use memcpy() and memset() instead of loops
parent
6896aa7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
ws-snd1.c
libavcodec/ws-snd1.c
+6
-9
No files found.
libavcodec/ws-snd1.c
View file @
618b067d
...
...
@@ -60,7 +60,6 @@ static int ws_snd_decode_frame(AVCodecContext *avctx,
int
in_size
,
out_size
;
int
sample
=
128
;
int
i
;
uint8_t
*
samples
=
data
;
uint8_t
*
samples_end
;
...
...
@@ -87,8 +86,7 @@ static int ws_snd_decode_frame(AVCodecContext *avctx,
samples_end
=
samples
+
out_size
;
if
(
in_size
==
out_size
)
{
for
(
i
=
0
;
i
<
out_size
;
i
++
)
*
samples
++
=
*
buf
++
;
memcpy
(
samples
,
buf
,
out_size
);
*
data_size
=
out_size
;
return
buf_size
;
}
...
...
@@ -153,16 +151,15 @@ static int ws_snd_decode_frame(AVCodecContext *avctx,
sample
=
av_clip_uint8
(
sample
);
*
samples
++
=
sample
;
}
else
{
/* copy */
for
(
count
++
;
count
>
0
;
count
--
)
{
*
samples
++
=
*
buf
++
;
}
memcpy
(
samples
,
buf
,
smp
);
samples
+=
smp
;
buf
+=
smp
;
sample
=
buf
[
-
1
];
}
break
;
default:
/* run */
for
(
count
++
;
count
>
0
;
count
--
)
{
*
samples
++
=
sample
;
}
memset
(
samples
,
sample
,
smp
);
samples
+=
smp
;
}
}
...
...
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