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
257ac5f1
Commit
257ac5f1
authored
Apr 05, 2011
by
James Darnley
Committed by
Michael Niedermayer
Apr 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support more than yuv420p in yadif
(and correctly support grey8)
parent
8af3167b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
vf_yadif.c
libavfilter/vf_yadif.c
+25
-4
No files found.
libavfilter/vf_yadif.c
View file @
257ac5f1
...
...
@@ -20,6 +20,7 @@
#include "libavutil/cpu.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "yadif.h"
...
...
@@ -51,6 +52,8 @@ typedef struct {
void
(
*
filter_line
)(
uint8_t
*
dst
,
uint8_t
*
prev
,
uint8_t
*
cur
,
uint8_t
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
);
const
AVPixFmtDescriptor
*
csp
;
}
YADIFContext
;
static
void
filter_line_c
(
uint8_t
*
dst
,
...
...
@@ -121,12 +124,17 @@ static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic,
YADIFContext
*
yadif
=
ctx
->
priv
;
int
y
,
i
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
int
is_chroma
=
!!
i
;
int
w
=
dstpic
->
video
->
w
>>
is_chroma
;
int
h
=
dstpic
->
video
->
h
>>
is_chroma
;
for
(
i
=
0
;
i
<
yadif
->
csp
->
nb_components
;
i
++
)
{
int
w
=
dstpic
->
video
->
w
;
int
h
=
dstpic
->
video
->
h
;
int
refs
=
yadif
->
cur
->
linesize
[
i
];
if
(
i
)
{
/* Why is this not part of the per-plane description thing? */
w
>>=
yadif
->
csp
->
log2_chroma_w
;
h
>>=
yadif
->
csp
->
log2_chroma_h
;
}
for
(
y
=
0
;
y
<
h
;
y
++
)
{
if
((
y
^
parity
)
&
1
)
{
uint8_t
*
prev
=
&
yadif
->
prev
->
data
[
i
][
y
*
refs
];
...
...
@@ -181,6 +189,9 @@ static void return_frame(AVFilterContext *ctx, int is_second)
yadif
->
out
=
avfilter_get_video_buffer
(
link
,
AV_PERM_WRITE
|
AV_PERM_PRESERVE
|
AV_PERM_REUSE
,
link
->
w
,
link
->
h
);
if
(
!
yadif
->
csp
)
yadif
->
csp
=
&
av_pix_fmt_descriptors
[
link
->
format
];
filter
(
ctx
,
yadif
->
out
,
tff
^
!
is_second
,
tff
);
if
(
is_second
)
{
...
...
@@ -292,7 +303,16 @@ static int query_formats(AVFilterContext *ctx)
{
static
const
enum
PixelFormat
pix_fmts
[]
=
{
PIX_FMT_YUV420P
,
PIX_FMT_YUV422P
,
PIX_FMT_YUV444P
,
PIX_FMT_YUV410P
,
PIX_FMT_YUV411P
,
PIX_FMT_GRAY8
,
PIX_FMT_YUVJ420P
,
PIX_FMT_YUVJ422P
,
PIX_FMT_YUVJ444P
,
PIX_FMT_YUV440P
,
PIX_FMT_YUVJ440P
,
PIX_FMT_NONE
};
...
...
@@ -308,6 +328,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
yadif
->
mode
=
0
;
yadif
->
parity
=
-
1
;
yadif
->
csp
=
NULL
;
if
(
args
)
sscanf
(
args
,
"%d:%d"
,
&
yadif
->
mode
,
&
yadif
->
parity
);
...
...
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