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
936d18fb
Commit
936d18fb
authored
Oct 07, 2018
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_minterpolate: use common scene sad functions
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
7748f395
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
configure
configure
+1
-0
vf_minterpolate.c
libavfilter/vf_minterpolate.c
+7
-10
No files found.
configure
View file @
936d18fb
...
...
@@ -3417,6 +3417,7 @@ mcdeint_filter_deps="avcodec gpl"
movie_filter_deps
=
"avcodec avformat"
mpdecimate_filter_deps
=
"gpl"
mpdecimate_filter_select
=
"pixelutils"
minterpolate_filter_select
=
"scene_sad"
mptestsrc_filter_deps
=
"gpl"
negate_filter_deps
=
"lut_filter"
nnedi_filter_deps
=
"gpl"
...
...
libavfilter/vf_minterpolate.c
View file @
936d18fb
...
...
@@ -26,11 +26,11 @@
#include "libavutil/motion_vector.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixelutils.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "scene_sad.h"
#define ME_MODE_BIDIR 0
#define ME_MODE_BILAT 1
...
...
@@ -188,7 +188,7 @@ typedef struct MIContext {
int
scd_method
;
int
scene_changed
;
av_pixelutils
_sad_fn
sad
;
ff_scene
_sad_fn
sad
;
double
prev_mafd
;
double
scd_threshold
;
...
...
@@ -383,7 +383,7 @@ static int config_input(AVFilterLink *inlink)
}
if
(
mi_ctx
->
scd_method
==
SCD_METHOD_FDIFF
)
{
mi_ctx
->
sad
=
av_pixelutils_get_sad_fn
(
3
,
3
,
2
,
mi_ctx
);
mi_ctx
->
sad
=
ff_scene_sad_get_fn
(
8
);
if
(
!
mi_ctx
->
sad
)
return
AVERROR
(
EINVAL
);
}
...
...
@@ -827,18 +827,15 @@ static int detect_scene_change(MIContext *mi_ctx)
{
AVMotionEstContext
*
me_ctx
=
&
mi_ctx
->
me_ctx
;
int
x
,
y
;
int
linesize
=
me_ctx
->
linesize
;
uint8_t
*
p1
=
mi_ctx
->
frames
[
1
].
avf
->
data
[
0
];
ptrdiff_t
linesize1
=
mi_ctx
->
frames
[
1
].
avf
->
linesize
[
0
];
uint8_t
*
p2
=
mi_ctx
->
frames
[
2
].
avf
->
data
[
0
];
ptrdiff_t
linesize2
=
mi_ctx
->
frames
[
2
].
avf
->
linesize
[
0
];
if
(
mi_ctx
->
scd_method
==
SCD_METHOD_FDIFF
)
{
double
ret
=
0
,
mafd
,
diff
;
int64_t
sad
;
for
(
sad
=
y
=
0
;
y
<
me_ctx
->
height
;
y
+=
8
)
for
(
x
=
0
;
x
<
linesize
;
x
+=
8
)
sad
+=
mi_ctx
->
sad
(
p1
+
x
+
y
*
linesize
,
linesize
,
p2
+
x
+
y
*
linesize
,
linesize
);
uint64_t
sad
;
mi_ctx
->
sad
(
p1
,
linesize1
,
p2
,
linesize2
,
me_ctx
->
width
,
me_ctx
->
height
,
&
sad
);
emms_c
();
mafd
=
(
double
)
sad
/
(
me_ctx
->
height
*
me_ctx
->
width
*
3
);
diff
=
fabs
(
mafd
-
mi_ctx
->
prev_mafd
);
...
...
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