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
7dd56d41
Commit
7dd56d41
authored
May 12, 2012
by
Robert Nagy
Committed by
Anton Khirnov
May 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yadif: Improve pts accuracy.
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
7c6d2406
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
vf_yadif.c
libavfilter/vf_yadif.c
+21
-6
No files found.
libavfilter/vf_yadif.c
View file @
7dd56d41
...
@@ -218,11 +218,11 @@ static void return_frame(AVFilterContext *ctx, int is_second)
...
@@ -218,11 +218,11 @@ static void return_frame(AVFilterContext *ctx, int is_second)
filter
(
ctx
,
yadif
->
out
,
tff
^
!
is_second
,
tff
);
filter
(
ctx
,
yadif
->
out
,
tff
^
!
is_second
,
tff
);
if
(
is_second
)
{
if
(
is_second
)
{
i
f
(
yadif
->
next
->
pts
!=
AV_NOPTS_VALUE
&&
i
nt64_t
cur_pts
=
yadif
->
cur
->
pts
;
yadif
->
cur
->
pts
!=
AV_NOPTS_VALUE
)
{
int64_t
next_pts
=
yadif
->
next
->
pts
;
yadif
->
out
->
pts
=
(
yadif
->
next
->
pts
&
yadif
->
cur
->
pts
)
+
if
(
next_pts
!=
AV_NOPTS_VALUE
&&
cur_pts
!=
AV_NOPTS_VALUE
)
{
((
yadif
->
next
->
pts
^
yadif
->
cur
->
pts
)
>>
1
)
;
yadif
->
out
->
pts
=
cur_pts
+
next_pts
;
}
else
{
}
else
{
yadif
->
out
->
pts
=
AV_NOPTS_VALUE
;
yadif
->
out
->
pts
=
AV_NOPTS_VALUE
;
}
}
...
@@ -255,6 +255,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
...
@@ -255,6 +255,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
yadif
->
out
=
avfilter_ref_buffer
(
yadif
->
cur
,
AV_PERM_READ
);
yadif
->
out
=
avfilter_ref_buffer
(
yadif
->
cur
,
AV_PERM_READ
);
avfilter_unref_buffer
(
yadif
->
prev
);
avfilter_unref_buffer
(
yadif
->
prev
);
yadif
->
prev
=
NULL
;
yadif
->
prev
=
NULL
;
if
(
yadif
->
out
->
pts
!=
AV_NOPTS_VALUE
)
yadif
->
out
->
pts
*=
2
;
avfilter_start_frame
(
ctx
->
outputs
[
0
],
yadif
->
out
);
avfilter_start_frame
(
ctx
->
outputs
[
0
],
yadif
->
out
);
return
;
return
;
}
}
...
@@ -267,6 +269,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
...
@@ -267,6 +269,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
avfilter_copy_buffer_ref_props
(
yadif
->
out
,
yadif
->
cur
);
avfilter_copy_buffer_ref_props
(
yadif
->
out
,
yadif
->
cur
);
yadif
->
out
->
video
->
interlaced
=
0
;
yadif
->
out
->
video
->
interlaced
=
0
;
if
(
yadif
->
out
->
pts
!=
AV_NOPTS_VALUE
)
yadif
->
out
->
pts
*=
2
;
avfilter_start_frame
(
ctx
->
outputs
[
0
],
yadif
->
out
);
avfilter_start_frame
(
ctx
->
outputs
[
0
],
yadif
->
out
);
}
}
...
@@ -400,6 +404,16 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
...
@@ -400,6 +404,16 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
static
void
null_draw_slice
(
AVFilterLink
*
link
,
int
y
,
int
h
,
int
slice_dir
)
{
}
static
void
null_draw_slice
(
AVFilterLink
*
link
,
int
y
,
int
h
,
int
slice_dir
)
{
}
static
int
config_props
(
AVFilterLink
*
link
)
{
link
->
time_base
.
num
=
link
->
src
->
inputs
[
0
]
->
time_base
.
num
;
link
->
time_base
.
den
=
link
->
src
->
inputs
[
0
]
->
time_base
.
den
*
2
;
link
->
w
=
link
->
src
->
inputs
[
0
]
->
w
;
link
->
h
=
link
->
src
->
inputs
[
0
]
->
h
;
return
0
;
}
AVFilter
avfilter_vf_yadif
=
{
AVFilter
avfilter_vf_yadif
=
{
.
name
=
"yadif"
,
.
name
=
"yadif"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Deinterlace the input image"
),
.
description
=
NULL_IF_CONFIG_SMALL
(
"Deinterlace the input image"
),
...
@@ -420,6 +434,7 @@ AVFilter avfilter_vf_yadif = {
...
@@ -420,6 +434,7 @@ AVFilter avfilter_vf_yadif = {
.
outputs
=
(
AVFilterPad
[])
{{
.
name
=
"default"
,
.
outputs
=
(
AVFilterPad
[])
{{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
poll_frame
=
poll_frame
,
.
poll_frame
=
poll_frame
,
.
request_frame
=
request_frame
,
},
.
request_frame
=
request_frame
,
.
config_props
=
config_props
,
},
{
.
name
=
NULL
}},
{
.
name
=
NULL
}},
};
};
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