Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
42a8ac94
Commit
42a8ac94
authored
Dec 31, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_tinterlace: implement interlace mode 5
Allow creating interlaced bottom field first video.
parent
8dc973e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
filters.texi
doc/filters.texi
+4
-0
avfilter.h
libavfilter/avfilter.h
+1
-1
vf_tinterlace.c
libavfilter/vf_tinterlace.c
+13
-10
No files found.
doc/filters.texi
View file @
42a8ac94
...
...
@@ -2525,6 +2525,10 @@ generating a frame with double height at the same input framerate.
@item 4
Interleave the upper field from odd frames with the lower field from
even frames, generating a frame with unchanged height at half framerate.
@item 5
Interleave the lower field from odd frames with the upper field from
even frames, generating a frame with unchanged height at half framerate.
@end table
Default mode is 0.
...
...
libavfilter/avfilter.h
View file @
42a8ac94
...
...
@@ -31,7 +31,7 @@
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MINOR 57
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_tinterlace.c
View file @
42a8ac94
...
...
@@ -68,9 +68,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
if
(
args
)
{
n
=
sscanf
(
args
,
"%d"
,
&
tinterlace
->
mode
);
if
(
n
!=
1
||
tinterlace
->
mode
<
0
||
tinterlace
->
mode
>
4
)
{
if
(
n
!=
1
||
tinterlace
->
mode
<
0
||
tinterlace
->
mode
>
5
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid mode '%s', use an integer between 0 and
4
\n
"
,
args
);
"Invalid mode '%s', use an integer between 0 and
5
\n
"
,
args
);
return
AVERROR
(
EINVAL
);
}
}
...
...
@@ -179,7 +179,7 @@ static void end_frame(AVFilterLink *inlink)
AVFilterBufferRef
*
cur
=
tinterlace
->
cur
;
AVFilterBufferRef
*
next
=
tinterlace
->
next
;
AVFilterBufferRef
*
out
=
NULL
;
int
field
;
int
field
,
tff
;
/* we need at least two frames */
if
(
!
tinterlace
->
cur
)
...
...
@@ -234,23 +234,26 @@ static void end_frame(AVFilterLink *inlink)
FIELD_UPPER_AND_LOWER
,
1
,
!
field
);
break
;
case
4
:
/* interleave upper lines from odd frames with lower lines from even frames,
* halving the frame rate and preserving image height */
/* interleave upper/lower lines from odd frames with lower/upper lines from even frames,
* halving the frame rate and preserving image height */
case
4
:
/* top field first */
case
5
:
/* bottom field first */
tff
=
tinterlace
->
mode
==
4
;
out
=
avfilter_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
avfilter_copy_buffer_ref_props
(
out
,
cur
);
out
->
video
->
interlaced
=
1
;
out
->
video
->
top_field_first
=
1
;
out
->
video
->
top_field_first
=
tff
;
/* copy upper field from cur */
/* copy upper
/lower
field from cur */
copy_picture_field
(
out
->
data
,
out
->
linesize
,
cur
->
data
,
cur
->
linesize
,
inlink
->
format
,
inlink
->
w
,
inlink
->
h
,
FIELD_UPPER
,
1
,
FIELD_UPP
ER
);
/* copy lower
fields
from next */
tff
?
FIELD_UPPER
:
FIELD_LOWER
,
1
,
tff
?
FIELD_UPPER
:
FIELD_LOW
ER
);
/* copy lower
/upper field
from next */
copy_picture_field
(
out
->
data
,
out
->
linesize
,
next
->
data
,
next
->
linesize
,
inlink
->
format
,
inlink
->
w
,
inlink
->
h
,
FIELD_LOWER
,
1
,
FIELD_LOW
ER
);
tff
?
FIELD_LOWER
:
FIELD_UPPER
,
1
,
tff
?
FIELD_LOWER
:
FIELD_UPP
ER
);
avfilter_unref_buffer
(
tinterlace
->
next
);
tinterlace
->
next
=
NULL
;
break
;
...
...
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