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
e7b0e83e
Commit
e7b0e83e
authored
Dec 06, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/deshake: switch to filter_frame.
parent
71949ef7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
vf_deshake.c
libavfilter/vf_deshake.c
+13
-13
No files found.
libavfilter/vf_deshake.c
View file @
e7b0e83e
...
...
@@ -51,6 +51,7 @@
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
...
...
@@ -425,16 +426,23 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep
(
&
deshake
->
avctx
);
}
static
int
end_frame
(
AVFilterLink
*
link
)
static
int
filter_frame
(
AVFilterLink
*
link
,
AVFilterBufferRef
*
in
)
{
DeshakeContext
*
deshake
=
link
->
dst
->
priv
;
AVFilter
BufferRef
*
in
=
link
->
cur_buf
;
AVFilterBufferRef
*
out
=
link
->
dst
->
outputs
[
0
]
->
out_buf
;
AVFilter
Link
*
outlink
=
link
->
dst
->
outputs
[
0
]
;
AVFilterBufferRef
*
out
;
Transform
t
=
{{
0
},
0
},
orig
=
{{
0
},
0
};
float
matrix
[
9
];
float
alpha
=
2
.
0
/
deshake
->
refcount
;
char
tmp
[
256
];
out
=
ff_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
if
(
!
out
)
{
avfilter_unref_bufferp
(
&
in
);
return
AVERROR
(
ENOMEM
);
}
avfilter_copy_buffer_ref_props
(
out
,
in
);
link
->
cur_buf
=
NULL
;
/* it is in 'in' now */
if
(
deshake
->
cx
<
0
||
deshake
->
cy
<
0
||
deshake
->
cw
<
0
||
deshake
->
ch
<
0
)
{
// Find the most likely global motion for the current frame
...
...
@@ -528,22 +536,14 @@ static int end_frame(AVFilterLink *link)
// Cleanup the old reference frame
deshake
->
ref
=
in
;
// Draw the transformed frame information
ff_draw_slice
(
link
->
dst
->
outputs
[
0
],
0
,
link
->
h
,
1
);
return
ff_end_frame
(
link
->
dst
->
outputs
[
0
]);
}
static
int
draw_slice
(
AVFilterLink
*
link
,
int
y
,
int
h
,
int
slice_dir
)
{
return
0
;
return
ff_filter_frame
(
outlink
,
out
);
}
static
const
AVFilterPad
deshake_inputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
draw_slice
=
draw_slice
,
.
end_frame
=
end_frame
,
.
filter_frame
=
filter_frame
,
.
config_props
=
config_props
,
.
min_perms
=
AV_PERM_READ
|
AV_PERM_PRESERVE
,
},
...
...
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