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
7056ddc0
Commit
7056ddc0
authored
Oct 19, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_fieldhint: add support for duplicating fields
Fixes #7066
parent
ce5274c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
filters.texi
doc/filters.texi
+2
-0
vf_fieldhint.c
libavfilter/vf_fieldhint.c
+31
-3
No files found.
doc/filters.texi
View file @
7056ddc0
...
...
@@ -10121,6 +10121,8 @@ field and second number tells from which frame to pick up bottom field.
If optionally followed by @code{+} output frame will be marked as interlaced,
else if followed by @code{-} output frame will be marked as progressive, else
it will be marked same as input frame.
If optionally followed by @code{t} output frame will use only top field, or in
case of @code{b} it will use only bottom field.
If line starts with @code{#} or @code{;} that line is skipped.
@item mode
...
...
libavfilter/vf_fieldhint.c
View file @
7056ddc0
...
...
@@ -117,7 +117,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame
*
out
,
*
top
,
*
bottom
;
char
buf
[
1024
]
=
{
0
};
int64_t
tf
,
bf
;
char
hint
=
'='
;
int
tfactor
=
0
,
bfactor
=
1
;
char
hint
=
'='
,
field
=
'='
;
int
p
;
av_frame_free
(
&
s
->
frame
[
0
]);
...
...
@@ -137,6 +138,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
s
->
line
++
;
if
(
buf
[
0
]
==
'#'
||
buf
[
0
]
==
';'
)
{
continue
;
}
else
if
(
sscanf
(
buf
,
"%"
PRId64
",%"
PRId64
" %c %c"
,
&
tf
,
&
bf
,
&
hint
,
&
field
)
==
4
)
{
;
}
else
if
(
sscanf
(
buf
,
"%"
PRId64
",%"
PRId64
" %c"
,
&
tf
,
&
bf
,
&
hint
)
==
3
)
{
;
}
else
if
(
sscanf
(
buf
,
"%"
PRId64
",%"
PRId64
""
,
&
tf
,
&
bf
)
==
2
)
{
...
...
@@ -185,6 +188,23 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_assert0
(
0
);
}
switch
(
field
)
{
case
'b'
:
tfactor
=
1
;
top
=
bottom
;
break
;
case
't'
:
bfactor
=
0
;
bottom
=
top
;
break
;
case
'='
:
break
;
default:
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid field: %c.
\n
"
,
field
);
av_frame_free
(
&
out
);
return
AVERROR
(
EINVAL
);
}
switch
(
hint
)
{
case
'+'
:
out
->
interlaced_frame
=
1
;
...
...
@@ -194,6 +214,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
break
;
case
'='
:
break
;
case
'b'
:
tfactor
=
1
;
top
=
bottom
;
break
;
case
't'
:
bfactor
=
0
;
bottom
=
top
;
break
;
default:
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid hint: %c.
\n
"
,
hint
);
av_frame_free
(
&
out
);
...
...
@@ -203,13 +231,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
for
(
p
=
0
;
p
<
s
->
nb_planes
;
p
++
)
{
av_image_copy_plane
(
out
->
data
[
p
],
out
->
linesize
[
p
]
*
2
,
top
->
data
[
p
],
top
->
data
[
p
]
+
tfactor
*
top
->
linesize
[
p
]
,
top
->
linesize
[
p
]
*
2
,
s
->
planewidth
[
p
],
(
s
->
planeheight
[
p
]
+
1
)
/
2
);
av_image_copy_plane
(
out
->
data
[
p
]
+
out
->
linesize
[
p
],
out
->
linesize
[
p
]
*
2
,
bottom
->
data
[
p
]
+
bottom
->
linesize
[
p
],
bottom
->
data
[
p
]
+
b
factor
*
b
ottom
->
linesize
[
p
],
bottom
->
linesize
[
p
]
*
2
,
s
->
planewidth
[
p
],
(
s
->
planeheight
[
p
]
+
1
)
/
2
);
...
...
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