Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
71ec3e45
Commit
71ec3e45
authored
Aug 26, 2020
by
Limin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "avfilter/yadif: simplify the code for better readability"
This reverts commit
2a9b9346
.
parent
ca8e5ded
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
23 deletions
+18
-23
vf_bwdif.c
libavfilter/vf_bwdif.c
+7
-6
vf_yadif.c
libavfilter/vf_yadif.c
+6
-10
vf_bwdif_init.c
libavfilter/x86/vf_bwdif_init.c
+1
-1
vf_yadif_init.c
libavfilter/x86/vf_yadif_init.c
+2
-1
yadif.h
libavfilter/yadif.h
+1
-4
yadif_common.c
libavfilter/yadif_common.c
+1
-1
No files found.
libavfilter/vf_bwdif.c
View file @
71ec3e45
...
...
@@ -219,8 +219,8 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
YADIFContext
*
yadif
=
&
s
->
yadif
;
ThreadData
*
td
=
arg
;
int
linesize
=
yadif
->
cur
->
linesize
[
td
->
plane
];
int
clip_max
=
(
1
<<
(
yadif
->
depth
))
-
1
;
int
df
=
(
yadif
->
depth
+
7
)
/
8
;
int
clip_max
=
(
1
<<
(
yadif
->
csp
->
comp
[
td
->
plane
].
depth
))
-
1
;
int
df
=
(
yadif
->
csp
->
comp
[
td
->
plane
].
depth
+
7
)
/
8
;
int
refs
=
linesize
/
df
;
int
slice_start
=
(
td
->
h
*
jobnr
)
/
nb_jobs
;
int
slice_end
=
(
td
->
h
*
(
jobnr
+
1
))
/
nb_jobs
;
...
...
@@ -267,13 +267,13 @@ static void filter(AVFilterContext *ctx, AVFrame *dstpic,
ThreadData
td
=
{
.
frame
=
dstpic
,
.
parity
=
parity
,
.
tff
=
tff
};
int
i
;
for
(
i
=
0
;
i
<
yadif
->
nb_components
;
i
++
)
{
for
(
i
=
0
;
i
<
yadif
->
csp
->
nb_components
;
i
++
)
{
int
w
=
dstpic
->
width
;
int
h
=
dstpic
->
height
;
if
(
i
==
1
||
i
==
2
)
{
w
=
AV_CEIL_RSHIFT
(
w
,
yadif
->
hsub
);
h
=
AV_CEIL_RSHIFT
(
h
,
yadif
->
vsub
);
w
=
AV_CEIL_RSHIFT
(
w
,
yadif
->
csp
->
log2_chroma_w
);
h
=
AV_CEIL_RSHIFT
(
h
,
yadif
->
csp
->
log2_chroma_h
);
}
td
.
w
=
w
;
...
...
@@ -348,8 +348,9 @@ static int config_props(AVFilterLink *link)
return
AVERROR
(
EINVAL
);
}
yadif
->
csp
=
av_pix_fmt_desc_get
(
link
->
format
);
yadif
->
filter
=
filter
;
if
(
yadif
->
depth
>
8
)
{
if
(
yadif
->
csp
->
comp
[
0
].
depth
>
8
)
{
s
->
filter_intra
=
filter_intra_16bit
;
s
->
filter_line
=
filter_line_c_16bit
;
s
->
filter_edge
=
filter_edge_16bit
;
...
...
libavfilter/vf_yadif.c
View file @
71ec3e45
...
...
@@ -192,7 +192,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
YADIFContext
*
s
=
ctx
->
priv
;
ThreadData
*
td
=
arg
;
int
refs
=
s
->
cur
->
linesize
[
td
->
plane
];
int
df
=
(
s
->
depth
+
7
)
/
8
;
int
df
=
(
s
->
csp
->
comp
[
td
->
plane
].
depth
+
7
)
/
8
;
int
pix_3
=
3
*
df
;
int
slice_start
=
(
td
->
h
*
jobnr
)
/
nb_jobs
;
int
slice_end
=
(
td
->
h
*
(
jobnr
+
1
))
/
nb_jobs
;
...
...
@@ -233,13 +233,13 @@ static void filter(AVFilterContext *ctx, AVFrame *dstpic,
ThreadData
td
=
{
.
frame
=
dstpic
,
.
parity
=
parity
,
.
tff
=
tff
};
int
i
;
for
(
i
=
0
;
i
<
yadif
->
nb_components
;
i
++
)
{
for
(
i
=
0
;
i
<
yadif
->
csp
->
nb_components
;
i
++
)
{
int
w
=
dstpic
->
width
;
int
h
=
dstpic
->
height
;
if
(
i
==
1
||
i
==
2
)
{
w
=
AV_CEIL_RSHIFT
(
w
,
yadif
->
hsub
);
h
=
AV_CEIL_RSHIFT
(
h
,
yadif
->
vsub
);
w
=
AV_CEIL_RSHIFT
(
w
,
yadif
->
csp
->
log2_chroma_w
);
h
=
AV_CEIL_RSHIFT
(
h
,
yadif
->
csp
->
log2_chroma_h
);
}
...
...
@@ -292,7 +292,6 @@ static int config_output(AVFilterLink *outlink)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
YADIFContext
*
s
=
ctx
->
priv
;
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
outlink
->
format
);
outlink
->
time_base
.
num
=
ctx
->
inputs
[
0
]
->
time_base
.
num
;
outlink
->
time_base
.
den
=
ctx
->
inputs
[
0
]
->
time_base
.
den
*
2
;
...
...
@@ -308,12 +307,9 @@ static int config_output(AVFilterLink *outlink)
return
AVERROR
(
EINVAL
);
}
s
->
csp
=
av_pix_fmt_desc_get
(
outlink
->
format
);
s
->
filter
=
filter
;
s
->
depth
=
desc
->
comp
[
0
].
depth
;
s
->
nb_components
=
desc
->
nb_components
;
s
->
hsub
=
desc
->
log2_chroma_w
;
s
->
vsub
=
desc
->
log2_chroma_h
;
if
(
s
->
depth
>
8
)
{
if
(
s
->
csp
->
comp
[
0
].
depth
>
8
)
{
s
->
filter_line
=
filter_line_c_16bit
;
s
->
filter_edges
=
filter_edges_16bit
;
}
else
{
...
...
libavfilter/x86/vf_bwdif_init.c
View file @
71ec3e45
...
...
@@ -55,7 +55,7 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif)
{
YADIFContext
*
yadif
=
&
bwdif
->
yadif
;
int
cpu_flags
=
av_get_cpu_flags
();
int
bit_depth
=
yadif
->
depth
;
int
bit_depth
=
(
!
yadif
->
csp
)
?
8
:
yadif
->
csp
->
comp
[
0
].
depth
;
if
(
bit_depth
<=
8
)
{
#if ARCH_X86_32
...
...
libavfilter/x86/vf_yadif_init.c
View file @
71ec3e45
...
...
@@ -60,7 +60,8 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
av_cold
void
ff_yadif_init_x86
(
YADIFContext
*
yadif
)
{
int
cpu_flags
=
av_get_cpu_flags
();
int
bit_depth
=
yadif
->
depth
;
int
bit_depth
=
(
!
yadif
->
csp
)
?
8
:
yadif
->
csp
->
comp
[
0
].
depth
;
if
(
bit_depth
>=
15
)
{
#if ARCH_X86_32
...
...
libavfilter/yadif.h
View file @
71ec3e45
...
...
@@ -72,10 +72,7 @@ typedef struct YADIFContext {
void
(
*
filter_edges
)(
void
*
dst
,
void
*
prev
,
void
*
cur
,
void
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
);
int
nb_components
;
int
depth
;
int
hsub
;
int
vsub
;
const
AVPixFmtDescriptor
*
csp
;
int
eof
;
uint8_t
*
temp_line
;
int
temp_line_size
;
...
...
libavfilter/yadif_common.c
View file @
71ec3e45
...
...
@@ -69,7 +69,7 @@ static int return_frame(AVFilterContext *ctx, int is_second)
static
int
checkstride
(
YADIFContext
*
yadif
,
const
AVFrame
*
a
,
const
AVFrame
*
b
)
{
int
i
;
for
(
i
=
0
;
i
<
yadif
->
nb_components
;
i
++
)
for
(
i
=
0
;
i
<
yadif
->
csp
->
nb_components
;
i
++
)
if
(
a
->
linesize
[
i
]
!=
b
->
linesize
[
i
])
return
1
;
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