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
2a375bb4
Commit
2a375bb4
authored
Jul 03, 2011
by
Joakim Plate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mode to yadif to enable/disable deinterlacing based on src frame "interlaced" flag
Signed-off-by:
Joakim Plate
<
elupus@ecce.se
>
parent
cbfdfbe8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
filters.texi
doc/filters.texi
+13
-1
vf_yadif.c
libavfilter/vf_yadif.c
+26
-2
No files found.
doc/filters.texi
View file @
2a375bb4
...
...
@@ -1737,7 +1737,7 @@ Flip the input video vertically.
Deinterlace the input video ("yadif" means "yet another deinterlacing
filter").
It accepts the optional parameters: @var{mode}:@var{parity}.
It accepts the optional parameters: @var{mode}:@var{parity}
:@var(auto)
.
@var{mode} specifies the interlacing mode to adopt, accepts one of the
following values:
...
...
@@ -1771,6 +1771,18 @@ Default value is -1.
If interlacing is unknown or decoder does not export this information,
top field first will be assumed.
@var{auto] specifies if deinterlacer should trust the interlaced flag
and only deinterlace frames marked as interlaced
@table @option
@item 0
deinterlace all frames
@item 1
only deinterlace frames marked as interlaced
@end table
Default value is 0.
@c man end VIDEO FILTERS
@chapter Video Sources
...
...
libavfilter/vf_yadif.c
View file @
2a375bb4
...
...
@@ -44,6 +44,12 @@ typedef struct {
int
frame_pending
;
/**
* 0: deinterlace all frames
* 1: only deinterlace frames marked as interlaced
*/
int
auto_enable
;
AVFilterBufferRef
*
cur
;
AVFilterBufferRef
*
next
;
AVFilterBufferRef
*
prev
;
...
...
@@ -240,6 +246,14 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
if
(
!
yadif
->
cur
)
return
;
if
(
yadif
->
auto_enable
&&
!
yadif
->
cur
->
video
->
interlaced
)
{
yadif
->
out
=
avfilter_ref_buffer
(
yadif
->
cur
,
AV_PERM_READ
);
avfilter_unref_buffer
(
yadif
->
prev
);
yadif
->
prev
=
NULL
;
avfilter_start_frame
(
ctx
->
outputs
[
0
],
yadif
->
out
);
return
;
}
if
(
!
yadif
->
prev
)
yadif
->
prev
=
avfilter_ref_buffer
(
yadif
->
cur
,
AV_PERM_READ
);
...
...
@@ -259,6 +273,12 @@ static void end_frame(AVFilterLink *link)
if
(
!
yadif
->
out
)
return
;
if
(
yadif
->
auto_enable
&&
!
yadif
->
cur
->
video
->
interlaced
)
{
avfilter_draw_slice
(
ctx
->
outputs
[
0
],
0
,
link
->
h
,
1
);
avfilter_end_frame
(
ctx
->
outputs
[
0
]);
return
;
}
return_frame
(
ctx
,
0
);
}
...
...
@@ -299,6 +319,9 @@ static int poll_frame(AVFilterLink *link)
}
assert
(
yadif
->
next
||
!
val
);
if
(
yadif
->
auto_enable
&&
yadif
->
next
&&
!
yadif
->
next
->
video
->
interlaced
)
return
val
;
return
val
*
((
yadif
->
mode
&
1
)
+
1
);
}
...
...
@@ -344,9 +367,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
yadif
->
mode
=
0
;
yadif
->
parity
=
-
1
;
yadif
->
auto_enable
=
0
;
yadif
->
csp
=
NULL
;
if
(
args
)
sscanf
(
args
,
"%d:%d
"
,
&
yadif
->
mode
,
&
yadif
->
parity
);
if
(
args
)
sscanf
(
args
,
"%d:%d
:%d"
,
&
yadif
->
mode
,
&
yadif
->
parity
,
&
yadif
->
auto_enable
);
yadif
->
filter_line
=
filter_line_c
;
if
(
HAVE_SSSE3
&&
cpu_flags
&
AV_CPU_FLAG_SSSE3
)
...
...
@@ -356,7 +380,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
else
if
(
HAVE_MMX
&&
cpu_flags
&
AV_CPU_FLAG_MMX
)
yadif
->
filter_line
=
ff_yadif_filter_line_mmx
;
av_log
(
ctx
,
AV_LOG_INFO
,
"mode:%d parity:%d
\n
"
,
yadif
->
mode
,
yadif
->
parity
);
av_log
(
ctx
,
AV_LOG_INFO
,
"mode:%d parity:%d
auto_enable:%d
\n
"
,
yadif
->
mode
,
yadif
->
parity
,
yadif
->
auto_enable
);
return
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