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
8de600de
Commit
8de600de
authored
May 03, 2014
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/phase: avoid a memcpy per frame.
parent
687119aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
vf_phase.c
libavfilter/vf_phase.c
+4
-8
No files found.
libavfilter/vf_phase.c
View file @
8de600de
...
...
@@ -251,13 +251,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props
(
out
,
in
);
if
(
!
s
->
frame
)
{
s
->
frame
=
in
;
mode
=
PROGRESSIVE
;
s
->
frame
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
if
(
!
s
->
frame
)
{
av_frame_free
(
&
in
);
av_frame_free
(
&
out
);
return
AVERROR
(
ENOMEM
);
}
}
else
{
mode
=
analyze_plane
(
ctx
,
s
->
mode
,
s
->
frame
,
in
);
}
...
...
@@ -269,7 +264,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
for
(
y
=
0
,
top
=
1
;
y
<
s
->
planeheight
[
plane
];
y
++
,
top
^=
1
)
{
memcpy
(
to
,
mode
==
(
top
?
BOTTOM_FIRST
:
TOP_FIRST
)
?
buf
:
from
,
s
->
linesize
[
plane
]);
memcpy
(
buf
,
from
,
s
->
linesize
[
plane
]);
buf
+=
s
->
frame
->
linesize
[
plane
];
from
+=
in
->
linesize
[
plane
];
...
...
@@ -277,7 +271,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
}
av_frame_free
(
&
in
);
if
(
in
!=
s
->
frame
)
av_frame_free
(
&
s
->
frame
);
s
->
frame
=
in
;
return
ff_filter_frame
(
outlink
,
out
);
}
...
...
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