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
5f5dcf44
Commit
5f5dcf44
authored
Aug 31, 2017
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: rename framesync2 to framesync.
parent
1b8e061c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
197 additions
and
197 deletions
+197
-197
Makefile
libavfilter/Makefile
+25
-25
f_streamselect.c
libavfilter/f_streamselect.c
+6
-6
framesync.c
libavfilter/framesync.c
+16
-16
framesync.h
libavfilter/framesync.h
+21
-21
maskedmerge.h
libavfilter/maskedmerge.h
+1
-1
vf_blend.c
libavfilter/vf_blend.c
+6
-6
vf_convolve.c
libavfilter/vf_convolve.c
+6
-6
vf_displace.c
libavfilter/vf_displace.c
+8
-8
vf_hysteresis.c
libavfilter/vf_hysteresis.c
+7
-7
vf_libvmaf.c
libavfilter/vf_libvmaf.c
+6
-6
vf_lut2.c
libavfilter/vf_lut2.c
+7
-7
vf_lut3d.c
libavfilter/vf_lut3d.c
+6
-6
vf_maskedclamp.c
libavfilter/vf_maskedclamp.c
+8
-8
vf_maskedmerge.c
libavfilter/vf_maskedmerge.c
+7
-7
vf_mergeplanes.c
libavfilter/vf_mergeplanes.c
+6
-6
vf_midequalizer.c
libavfilter/vf_midequalizer.c
+7
-7
vf_overlay.c
libavfilter/vf_overlay.c
+6
-6
vf_paletteuse.c
libavfilter/vf_paletteuse.c
+6
-6
vf_premultiply.c
libavfilter/vf_premultiply.c
+7
-7
vf_psnr.c
libavfilter/vf_psnr.c
+6
-6
vf_remap.c
libavfilter/vf_remap.c
+8
-8
vf_ssim.c
libavfilter/vf_ssim.c
+6
-6
vf_stack.c
libavfilter/vf_stack.c
+6
-6
vf_threshold.c
libavfilter/vf_threshold.c
+9
-9
No files found.
libavfilter/Makefile
View file @
5f5dcf44
This diff is collapsed.
Click to expand it.
libavfilter/f_streamselect.c
View file @
5f5dcf44
...
...
@@ -22,7 +22,7 @@
#include "avfilter.h"
#include "audio.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
...
...
@@ -56,7 +56,7 @@ static int process_frame(FFFrameSync *fs)
int
i
,
j
,
ret
=
0
;
for
(
i
=
0
;
i
<
ctx
->
nb_inputs
;
i
++
)
{
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
i
,
&
in
[
i
],
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
i
,
&
in
[
i
],
0
))
<
0
)
return
ret
;
}
...
...
@@ -87,7 +87,7 @@ static int process_frame(FFFrameSync *fs)
static
int
activate
(
AVFilterContext
*
ctx
)
{
StreamSelectContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
int
config_output
(
AVFilterLink
*
outlink
)
...
...
@@ -124,7 +124,7 @@ static int config_output(AVFilterLink *outlink)
if
(
s
->
fs
.
opaque
==
s
)
return
0
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
ctx
->
nb_inputs
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
ctx
->
nb_inputs
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -142,7 +142,7 @@ static int config_output(AVFilterLink *outlink)
if
(
!
s
->
frames
)
return
AVERROR
(
ENOMEM
);
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
parse_definition
(
AVFilterContext
*
ctx
,
int
nb_pads
,
int
is_input
,
int
is_audio
)
...
...
@@ -289,7 +289,7 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep
(
&
s
->
last_pts
);
av_freep
(
&
s
->
map
);
av_freep
(
&
s
->
frames
);
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
...
libavfilter/framesync
2
.c
→
libavfilter/framesync.c
View file @
5f5dcf44
...
...
@@ -22,7 +22,7 @@
#include "libavutil/opt.h"
#include "avfilter.h"
#include "filters.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#define OFFSET(member) offsetof(FFFrameSync, member)
...
...
@@ -61,12 +61,12 @@ enum {
static
int
consume_from_fifos
(
FFFrameSync
*
fs
);
const
AVClass
*
framesync
2
_get_class
(
void
)
const
AVClass
*
framesync_get_class
(
void
)
{
return
&
framesync_class
;
}
void
ff_framesync
2
_preinit
(
FFFrameSync
*
fs
)
void
ff_framesync_preinit
(
FFFrameSync
*
fs
)
{
if
(
fs
->
class
)
return
;
...
...
@@ -74,14 +74,14 @@ void ff_framesync2_preinit(FFFrameSync *fs)
av_opt_set_defaults
(
fs
);
}
int
ff_framesync
2
_init
(
FFFrameSync
*
fs
,
AVFilterContext
*
parent
,
unsigned
nb_in
)
int
ff_framesync_init
(
FFFrameSync
*
fs
,
AVFilterContext
*
parent
,
unsigned
nb_in
)
{
/* For filters with several outputs, we will not be able to assume which
output is relevant for ff_outlink_frame_wanted() and
ff_outlink_set_status(). To be designed when needed. */
av_assert0
(
parent
->
nb_outputs
==
1
);
ff_framesync
2
_preinit
(
fs
);
ff_framesync_preinit
(
fs
);
fs
->
parent
=
parent
;
fs
->
nb_in
=
nb_in
;
...
...
@@ -114,7 +114,7 @@ static void framesync_sync_level_update(FFFrameSync *fs)
framesync_eof
(
fs
);
}
int
ff_framesync
2
_configure
(
FFFrameSync
*
fs
)
int
ff_framesync_configure
(
FFFrameSync
*
fs
)
{
unsigned
i
;
int64_t
gcd
,
lcm
;
...
...
@@ -253,7 +253,7 @@ static void framesync_inject_status(FFFrameSync *fs, unsigned in, int status, in
fs
->
in
[
in
].
have_next
=
1
;
}
int
ff_framesync
2
_get_frame
(
FFFrameSync
*
fs
,
unsigned
in
,
AVFrame
**
rframe
,
int
ff_framesync_get_frame
(
FFFrameSync
*
fs
,
unsigned
in
,
AVFrame
**
rframe
,
unsigned
get
)
{
AVFrame
*
frame
;
...
...
@@ -290,7 +290,7 @@ int ff_framesync2_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe,
return
0
;
}
void
ff_framesync
2
_uninit
(
FFFrameSync
*
fs
)
void
ff_framesync_uninit
(
FFFrameSync
*
fs
)
{
unsigned
i
;
...
...
@@ -341,7 +341,7 @@ static int consume_from_fifos(FFFrameSync *fs)
return
1
;
}
int
ff_framesync
2
_activate
(
FFFrameSync
*
fs
)
int
ff_framesync_activate
(
FFFrameSync
*
fs
)
{
int
ret
;
...
...
@@ -358,11 +358,11 @@ int ff_framesync2_activate(FFFrameSync *fs)
return
0
;
}
int
ff_framesync
2
_init_dualinput
(
FFFrameSync
*
fs
,
AVFilterContext
*
parent
)
int
ff_framesync_init_dualinput
(
FFFrameSync
*
fs
,
AVFilterContext
*
parent
)
{
int
ret
;
ret
=
ff_framesync
2
_init
(
fs
,
parent
,
2
);
ret
=
ff_framesync_init
(
fs
,
parent
,
2
);
if
(
ret
<
0
)
return
ret
;
fs
->
in
[
0
].
time_base
=
parent
->
inputs
[
0
]
->
time_base
;
...
...
@@ -376,14 +376,14 @@ int ff_framesync2_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
return
0
;
}
int
ff_framesync
2
_dualinput_get
(
FFFrameSync
*
fs
,
AVFrame
**
f0
,
AVFrame
**
f1
)
int
ff_framesync_dualinput_get
(
FFFrameSync
*
fs
,
AVFrame
**
f0
,
AVFrame
**
f1
)
{
AVFilterContext
*
ctx
=
fs
->
parent
;
AVFrame
*
mainpic
=
NULL
,
*
secondpic
=
NULL
;
int
ret
=
0
;
if
((
ret
=
ff_framesync
2
_get_frame
(
fs
,
0
,
&
mainpic
,
1
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
fs
,
1
,
&
secondpic
,
0
))
<
0
)
{
if
((
ret
=
ff_framesync_get_frame
(
fs
,
0
,
&
mainpic
,
1
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
fs
,
1
,
&
secondpic
,
0
))
<
0
)
{
av_frame_free
(
&
mainpic
);
return
ret
;
}
...
...
@@ -398,11 +398,11 @@ int ff_framesync2_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
return
0
;
}
int
ff_framesync
2
_dualinput_get_writable
(
FFFrameSync
*
fs
,
AVFrame
**
f0
,
AVFrame
**
f1
)
int
ff_framesync_dualinput_get_writable
(
FFFrameSync
*
fs
,
AVFrame
**
f0
,
AVFrame
**
f1
)
{
int
ret
;
ret
=
ff_framesync
2
_dualinput_get
(
fs
,
f0
,
f1
);
ret
=
ff_framesync_dualinput_get
(
fs
,
f0
,
f1
);
if
(
ret
<
0
)
return
ret
;
ret
=
ff_inlink_make_frame_writable
(
fs
->
parent
->
inputs
[
0
],
f0
);
...
...
libavfilter/framesync
2
.h
→
libavfilter/framesync.h
View file @
5f5dcf44
...
...
@@ -18,8 +18,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVFILTER_FRAMESYNC
2
_H
#define AVFILTER_FRAMESYNC
2
_H
#ifndef AVFILTER_FRAMESYNC_H
#define AVFILTER_FRAMESYNC_H
#include "bufferqueue.h"
...
...
@@ -47,7 +47,7 @@ enum EOFAction {
* others can be configured.
*
* The basic working of this API is the following: set the on_event
* callback, then call ff_framesync
2
_activate() from the filter's activate
* callback, then call ff_framesync_activate() from the filter's activate
* callback.
*/
...
...
@@ -209,9 +209,9 @@ typedef struct FFFrameSync {
}
FFFrameSync
;
/**
* Get the class for the framesync
2
object.
* Get the class for the framesync object.
*/
const
AVClass
*
framesync
2
_get_class
(
void
);
const
AVClass
*
framesync_get_class
(
void
);
/**
* Pre-initialize a frame sync structure.
...
...
@@ -220,7 +220,7 @@ const AVClass *framesync2_get_class(void);
* The entire structure is expected to be already set to 0.
* This step is optional, but necessary to use the options.
*/
void
ff_framesync
2
_preinit
(
FFFrameSync
*
fs
);
void
ff_framesync_preinit
(
FFFrameSync
*
fs
);
/**
* Initialize a frame sync structure.
...
...
@@ -232,7 +232,7 @@ void ff_framesync2_preinit(FFFrameSync *fs);
* @param nb_in number of inputs
* @return >= 0 for success or a negative error code
*/
int
ff_framesync
2
_init
(
FFFrameSync
*
fs
,
AVFilterContext
*
parent
,
unsigned
nb_in
);
int
ff_framesync_init
(
FFFrameSync
*
fs
,
AVFilterContext
*
parent
,
unsigned
nb_in
);
/**
* Configure a frame sync structure.
...
...
@@ -241,12 +241,12 @@ int ff_framesync2_init(FFFrameSync *fs, AVFilterContext *parent, unsigned nb_in)
*
* @return >= 0 for success or a negative error code
*/
int
ff_framesync
2
_configure
(
FFFrameSync
*
fs
);
int
ff_framesync_configure
(
FFFrameSync
*
fs
);
/**
* Free all memory currently allocated.
*/
void
ff_framesync
2
_uninit
(
FFFrameSync
*
fs
);
void
ff_framesync_uninit
(
FFFrameSync
*
fs
);
/**
* Get the current frame in an input.
...
...
@@ -258,16 +258,16 @@ void ff_framesync2_uninit(FFFrameSync *fs);
* the returned frame; the current frame will either be
* duplicated or removed from the framesync structure
*/
int
ff_framesync
2
_get_frame
(
FFFrameSync
*
fs
,
unsigned
in
,
AVFrame
**
rframe
,
int
ff_framesync_get_frame
(
FFFrameSync
*
fs
,
unsigned
in
,
AVFrame
**
rframe
,
unsigned
get
);
/**
* Examine the frames in the filter's input and try to produce output.
*
* This function can be the complete implementation of the activate
* method of a filter using framesync
2
.
* method of a filter using framesync.
*/
int
ff_framesync
2
_activate
(
FFFrameSync
*
fs
);
int
ff_framesync_activate
(
FFFrameSync
*
fs
);
/**
* Initialize a frame sync structure for dualinput.
...
...
@@ -277,35 +277,35 @@ int ff_framesync2_activate(FFFrameSync *fs);
* the only one with sync set and generic timeline support will just pass it
* unchanged when disabled.
*
* Equivalent to ff_framesync
2
_init(fs, parent, 2) then setting the time
* Equivalent to ff_framesync_init(fs, parent, 2) then setting the time
* base, sync and ext modes on the inputs.
*/
int
ff_framesync
2
_init_dualinput
(
FFFrameSync
*
fs
,
AVFilterContext
*
parent
);
int
ff_framesync_init_dualinput
(
FFFrameSync
*
fs
,
AVFilterContext
*
parent
);
/**
* @param f0 used to return the main frame
* @param f1 used to return the second frame, or NULL if disabled
* @return >=0 for success or AVERROR code
*/
int
ff_framesync
2
_dualinput_get
(
FFFrameSync
*
fs
,
AVFrame
**
f0
,
AVFrame
**
f1
);
int
ff_framesync_dualinput_get
(
FFFrameSync
*
fs
,
AVFrame
**
f0
,
AVFrame
**
f1
);
/**
* Same as ff_framesync
2
_dualinput_get(), but make sure that f0 is writable.
* Same as ff_framesync_dualinput_get(), but make sure that f0 is writable.
*/
int
ff_framesync
2
_dualinput_get_writable
(
FFFrameSync
*
fs
,
AVFrame
**
f0
,
AVFrame
**
f1
);
int
ff_framesync_dualinput_get_writable
(
FFFrameSync
*
fs
,
AVFrame
**
f0
,
AVFrame
**
f1
);
#define FRAMESYNC_DEFINE_CLASS(name, context, field) \
static int name##_framesync_preinit(AVFilterContext *ctx) { \
context *s = ctx->priv; \
ff_framesync
2
_preinit(&s->field); \
ff_framesync_preinit(&s->field); \
return 0; \
} \
static const AVClass *name##_child_class_next(const AVClass *prev) { \
return prev ? NULL : framesync
2
_get_class(); \
return prev ? NULL : framesync_get_class(); \
} \
static void *name##_child_next(void *obj, void *prev) { \
context *s = obj; \
s->fs.class = framesync
2
_get_class();
/* FIXME */
\
s->fs.class = framesync_get_class();
/* FIXME */
\
return prev ? NULL : &s->field; \
} \
static const AVClass name##_class = { \
...
...
@@ -318,4 +318,4 @@ static const AVClass name##_class = { \
.child_next = name##_child_next, \
}
#endif
/* AVFILTER_FRAMESYNC
2
_H */
#endif
/* AVFILTER_FRAMESYNC_H */
libavfilter/maskedmerge.h
View file @
5f5dcf44
...
...
@@ -22,7 +22,7 @@
#define AVFILTER_MASKEDMERGE_H
#include "avfilter.h"
#include "framesync
2
.h"
#include "framesync.h"
typedef
struct
MaskedMergeContext
{
const
AVClass
*
class
;
...
...
libavfilter/vf_blend.c
View file @
5f5dcf44
...
...
@@ -25,7 +25,7 @@
#include "avfilter.h"
#include "bufferqueue.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
#include "blend.h"
...
...
@@ -411,7 +411,7 @@ static int blend_frame_for_dualinput(FFFrameSync *fs)
AVFrame
*
top_buf
,
*
bottom_buf
,
*
dst_buf
;
int
ret
;
ret
=
ff_framesync
2
_dualinput_get
(
fs
,
&
top_buf
,
&
bottom_buf
);
ret
=
ff_framesync_dualinput_get
(
fs
,
&
top_buf
,
&
bottom_buf
);
if
(
ret
<
0
)
return
ret
;
if
(
!
bottom_buf
)
...
...
@@ -454,7 +454,7 @@ static av_cold void uninit(AVFilterContext *ctx)
BlendContext
*
s
=
ctx
->
priv
;
int
i
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
av_frame_free
(
&
s
->
prev_frame
);
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
params
);
i
++
)
...
...
@@ -554,7 +554,7 @@ static int config_output(AVFilterLink *outlink)
s
->
nb_planes
=
av_pix_fmt_count_planes
(
toplink
->
format
);
if
(
!
s
->
tblend
)
if
((
ret
=
ff_framesync
2
_init_dualinput
(
&
s
->
fs
,
ctx
))
<
0
)
if
((
ret
=
ff_framesync_init_dualinput
(
&
s
->
fs
,
ctx
))
<
0
)
return
ret
;
for
(
plane
=
0
;
plane
<
FF_ARRAY_ELEMS
(
s
->
params
);
plane
++
)
{
...
...
@@ -581,7 +581,7 @@ static int config_output(AVFilterLink *outlink)
}
}
return
s
->
tblend
?
0
:
ff_framesync
2
_configure
(
&
s
->
fs
);
return
s
->
tblend
?
0
:
ff_framesync_configure
(
&
s
->
fs
);
}
#if CONFIG_BLEND_FILTER
...
...
@@ -589,7 +589,7 @@ static int config_output(AVFilterLink *outlink)
static
int
activate
(
AVFilterContext
*
ctx
)
{
BlendContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
const
AVFilterPad
blend_inputs
[]
=
{
...
...
libavfilter/vf_convolve.c
View file @
5f5dcf44
...
...
@@ -25,7 +25,7 @@
#include "avfilter.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
...
...
@@ -262,7 +262,7 @@ static int do_convolve(FFFrameSync *fs)
AVFrame
*
mainpic
=
NULL
,
*
impulsepic
=
NULL
;
int
ret
,
y
,
x
,
plane
;
ret
=
ff_framesync
2
_dualinput_get
(
fs
,
&
mainpic
,
&
impulsepic
);
ret
=
ff_framesync_dualinput_get
(
fs
,
&
mainpic
,
&
impulsepic
);
if
(
ret
<
0
)
return
ret
;
if
(
!
impulsepic
)
...
...
@@ -336,7 +336,7 @@ static int config_output(AVFilterLink *outlink)
int
ret
,
i
;
s
->
fs
.
on_event
=
do_convolve
;
ret
=
ff_framesync
2
_init_dualinput
(
&
s
->
fs
,
ctx
);
ret
=
ff_framesync_init_dualinput
(
&
s
->
fs
,
ctx
);
if
(
ret
<
0
)
return
ret
;
outlink
->
w
=
mainlink
->
w
;
...
...
@@ -345,7 +345,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
mainlink
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
mainlink
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_configure
(
&
s
->
fs
))
<
0
)
if
((
ret
=
ff_framesync_configure
(
&
s
->
fs
))
<
0
)
return
ret
;
for
(
i
=
0
;
i
<
s
->
nb_planes
;
i
++
)
{
...
...
@@ -361,7 +361,7 @@ static int config_output(AVFilterLink *outlink)
static
int
activate
(
AVFilterContext
*
ctx
)
{
ConvolveContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -378,7 +378,7 @@ static av_cold void uninit(AVFilterContext *ctx)
av_fft_end
(
s
->
ifft
[
i
]);
}
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
}
static
const
AVFilterPad
convolve_inputs
[]
=
{
...
...
libavfilter/vf_displace.c
View file @
5f5dcf44
...
...
@@ -23,7 +23,7 @@
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
...
...
@@ -248,9 +248,9 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
,
*
in
,
*
xpic
,
*
ypic
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
in
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
xpic
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
2
,
&
ypic
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
in
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
xpic
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
2
,
&
ypic
,
0
))
<
0
)
return
ret
;
if
(
ctx
->
is_disabled
)
{
...
...
@@ -336,7 +336,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
srclink
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
srclink
->
frame_rate
;
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
3
);
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
3
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -356,20 +356,20 @@ static int config_output(AVFilterLink *outlink)
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
DisplaceContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
DisplaceContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
}
static
const
AVFilterPad
displace_inputs
[]
=
{
...
...
libavfilter/vf_hysteresis.c
View file @
5f5dcf44
...
...
@@ -26,7 +26,7 @@
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "framesync
2
.h"
#include "framesync.h"
#define OFFSET(x) offsetof(HysteresisContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
...
...
@@ -94,8 +94,8 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
,
*
base
,
*
alt
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
base
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
alt
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
base
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
alt
,
0
))
<
0
)
return
ret
;
if
(
ctx
->
is_disabled
)
{
...
...
@@ -324,7 +324,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
base
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
base
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -339,20 +339,20 @@ static int config_output(AVFilterLink *outlink)
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
HysteresisContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
HysteresisContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
av_freep
(
&
s
->
map
);
av_freep
(
&
s
->
xy
);
}
...
...
libavfilter/vf_libvmaf.c
View file @
5f5dcf44
...
...
@@ -32,7 +32,7 @@
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
...
...
@@ -177,7 +177,7 @@ static int do_vmaf(FFFrameSync *fs)
AVFrame
*
main
,
*
ref
;
int
ret
;
ret
=
ff_framesync
2
_dualinput_get
(
fs
,
&
main
,
&
ref
);
ret
=
ff_framesync_dualinput_get
(
fs
,
&
main
,
&
ref
);
if
(
ret
<
0
)
return
ret
;
if
(
!
ref
)
...
...
@@ -266,7 +266,7 @@ static int config_output(AVFilterLink *outlink)
AVFilterLink
*
mainlink
=
ctx
->
inputs
[
0
];
int
ret
;
ret
=
ff_framesync
2
_init_dualinput
(
&
s
->
fs
,
ctx
);
ret
=
ff_framesync_init_dualinput
(
&
s
->
fs
,
ctx
);
if
(
ret
<
0
)
return
ret
;
outlink
->
w
=
mainlink
->
w
;
...
...
@@ -274,7 +274,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
time_base
=
mainlink
->
time_base
;
outlink
->
sample_aspect_ratio
=
mainlink
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
mainlink
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_configure
(
&
s
->
fs
))
<
0
)
if
((
ret
=
ff_framesync_configure
(
&
s
->
fs
))
<
0
)
return
ret
;
return
0
;
...
...
@@ -283,14 +283,14 @@ static int config_output(AVFilterLink *outlink)
static
int
activate
(
AVFilterContext
*
ctx
)
{
LIBVMAFContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
LIBVMAFContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
pthread_mutex_lock
(
&
s
->
lock
);
s
->
eof
=
1
;
...
...
libavfilter/vf_lut2.c
View file @
5f5dcf44
...
...
@@ -28,7 +28,7 @@
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "framesync
2
.h"
#include "framesync.h"
static
const
char
*
const
var_names
[]
=
{
"w"
,
///< width of the input video
...
...
@@ -85,7 +85,7 @@ static av_cold void uninit(AVFilterContext *ctx)
LUT2Context
*
s
=
ctx
->
priv
;
int
i
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
av_frame_free
(
&
s
->
prev_frame
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
...
...
@@ -216,8 +216,8 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
,
*
srcx
=
NULL
,
*
srcy
=
NULL
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
srcx
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
srcy
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
srcx
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
srcy
,
0
))
<
0
)
return
ret
;
if
(
ctx
->
is_disabled
||
!
srcy
)
{
...
...
@@ -327,7 +327,7 @@ static int lut2_config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
srcx
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
srcx
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -345,13 +345,13 @@ static int lut2_config_output(AVFilterLink *outlink)
if
((
ret
=
config_output
(
outlink
))
<
0
)
return
ret
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
LUT2Context
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
const
AVFilterPad
inputs
[]
=
{
...
...
libavfilter/vf_lut3d.c
View file @
5f5dcf44
...
...
@@ -32,7 +32,7 @@
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
...
...
@@ -681,13 +681,13 @@ static int config_output(AVFilterLink *outlink)
LUT3DContext
*
lut3d
=
ctx
->
priv
;
int
ret
;
ret
=
ff_framesync
2
_init_dualinput
(
&
lut3d
->
fs
,
ctx
);
ret
=
ff_framesync_init_dualinput
(
&
lut3d
->
fs
,
ctx
);
if
(
ret
<
0
)
return
ret
;
outlink
->
w
=
ctx
->
inputs
[
0
]
->
w
;
outlink
->
h
=
ctx
->
inputs
[
0
]
->
h
;
outlink
->
time_base
=
ctx
->
inputs
[
0
]
->
time_base
;
if
((
ret
=
ff_framesync
2
_configure
(
&
lut3d
->
fs
))
<
0
)
if
((
ret
=
ff_framesync_configure
(
&
lut3d
->
fs
))
<
0
)
return
ret
;
return
0
;
}
...
...
@@ -695,7 +695,7 @@ static int config_output(AVFilterLink *outlink)
static
int
activate
(
AVFilterContext
*
ctx
)
{
LUT3DContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
int
config_clut
(
AVFilterLink
*
inlink
)
...
...
@@ -755,7 +755,7 @@ static int update_apply_clut(FFFrameSync *fs)
AVFrame
*
main
,
*
second
,
*
out
;
int
ret
;
ret
=
ff_framesync
2
_dualinput_get
(
fs
,
&
main
,
&
second
);
ret
=
ff_framesync_dualinput_get
(
fs
,
&
main
,
&
second
);
if
(
ret
<
0
)
return
ret
;
if
(
!
second
)
...
...
@@ -775,7 +775,7 @@ static av_cold int haldclut_init(AVFilterContext *ctx)
static
av_cold
void
haldclut_uninit
(
AVFilterContext
*
ctx
)
{
LUT3DContext
*
lut3d
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
lut3d
->
fs
);
ff_framesync_uninit
(
&
lut3d
->
fs
);
}
static
const
AVOption
haldclut_options
[]
=
{
...
...
libavfilter/vf_maskedclamp.c
View file @
5f5dcf44
...
...
@@ -25,7 +25,7 @@
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "framesync
2
.h"
#include "framesync.h"
#define OFFSET(x) offsetof(MaskedClampContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
...
...
@@ -93,9 +93,9 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
,
*
base
,
*
dark
,
*
bright
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
base
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
dark
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
2
,
&
bright
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
base
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
dark
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
2
,
&
bright
,
0
))
<
0
)
return
ret
;
if
(
ctx
->
is_disabled
)
{
...
...
@@ -265,7 +265,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
base
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
base
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
3
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
3
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -284,20 +284,20 @@ static int config_output(AVFilterLink *outlink)
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
MaskedClampContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
MaskedClampContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
}
static
const
AVFilterPad
maskedclamp_inputs
[]
=
{
...
...
libavfilter/vf_maskedmerge.c
View file @
5f5dcf44
...
...
@@ -71,9 +71,9 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
,
*
base
,
*
overlay
,
*
mask
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
base
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
overlay
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
2
,
&
mask
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
base
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
overlay
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
2
,
&
mask
,
0
))
<
0
)
return
ret
;
if
(
ctx
->
is_disabled
)
{
...
...
@@ -232,7 +232,7 @@ static int config_output(AVFilterLink *outlink)
if
((
ret
=
av_image_fill_linesizes
(
s
->
linesize
,
outlink
->
format
,
outlink
->
w
))
<
0
)
return
ret
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
3
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
3
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -251,20 +251,20 @@ static int config_output(AVFilterLink *outlink)
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
MaskedMergeContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
MaskedMergeContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
}
static
const
AVFilterPad
maskedmerge_inputs
[]
=
{
...
...
libavfilter/vf_mergeplanes.c
View file @
5f5dcf44
...
...
@@ -25,7 +25,7 @@
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"
#include "framesync
2
.h"
#include "framesync.h"
typedef
struct
InputParam
{
int
depth
[
4
];
...
...
@@ -143,7 +143,7 @@ static int process_frame(FFFrameSync *fs)
int
i
,
ret
;
for
(
i
=
0
;
i
<
s
->
nb_inputs
;
i
++
)
{
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
i
,
&
in
[
i
],
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
i
,
&
in
[
i
],
0
))
<
0
)
return
ret
;
}
...
...
@@ -172,7 +172,7 @@ static int config_output(AVFilterLink *outlink)
FFFrameSyncIn
*
in
;
int
i
,
ret
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
s
->
nb_inputs
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
s
->
nb_inputs
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -265,7 +265,7 @@ static int config_output(AVFilterLink *outlink)
}
}
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
fail:
return
AVERROR
(
EINVAL
);
}
...
...
@@ -273,7 +273,7 @@ fail:
static
int
activate
(
AVFilterContext
*
ctx
)
{
MergePlanesContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -281,7 +281,7 @@ static av_cold void uninit(AVFilterContext *ctx)
MergePlanesContext
*
s
=
ctx
->
priv
;
int
i
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
for
(
i
=
0
;
i
<
ctx
->
nb_inputs
;
i
++
)
av_freep
(
&
ctx
->
input_pads
[
i
].
name
);
...
...
libavfilter/vf_midequalizer.c
View file @
5f5dcf44
...
...
@@ -25,7 +25,7 @@
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "framesync
2
.h"
#include "framesync.h"
typedef
struct
MidEqualizerContext
{
const
AVClass
*
class
;
...
...
@@ -89,8 +89,8 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
,
*
in0
,
*
in1
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
in0
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
in1
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
in0
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
in1
,
0
))
<
0
)
return
ret
;
if
(
ctx
->
is_disabled
)
{
...
...
@@ -311,7 +311,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
in0
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
in0
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -326,20 +326,20 @@ static int config_output(AVFilterLink *outlink)
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
MidEqualizerContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
MidEqualizerContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
av_freep
(
&
s
->
histogram
[
0
]);
av_freep
(
&
s
->
histogram
[
1
]);
av_freep
(
&
s
->
cchange
);
...
...
libavfilter/vf_overlay.c
View file @
5f5dcf44
...
...
@@ -37,7 +37,7 @@
#include "libavutil/timestamp.h"
#include "internal.h"
#include "drawutils.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "video.h"
static
const
char
*
const
var_names
[]
=
{
...
...
@@ -130,7 +130,7 @@ static av_cold void uninit(AVFilterContext *ctx)
{
OverlayContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
av_expr_free
(
s
->
x_pexpr
);
s
->
x_pexpr
=
NULL
;
av_expr_free
(
s
->
y_pexpr
);
s
->
y_pexpr
=
NULL
;
}
...
...
@@ -377,14 +377,14 @@ static int config_output(AVFilterLink *outlink)
OverlayContext
*
s
=
ctx
->
priv
;
int
ret
;
if
((
ret
=
ff_framesync
2
_init_dualinput
(
&
s
->
fs
,
ctx
))
<
0
)
if
((
ret
=
ff_framesync_init_dualinput
(
&
s
->
fs
,
ctx
))
<
0
)
return
ret
;
outlink
->
w
=
ctx
->
inputs
[
MAIN
]
->
w
;
outlink
->
h
=
ctx
->
inputs
[
MAIN
]
->
h
;
outlink
->
time_base
=
ctx
->
inputs
[
MAIN
]
->
time_base
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
// divide by 255 and round to nearest
...
...
@@ -765,7 +765,7 @@ static int do_blend(FFFrameSync *fs)
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
int
ret
;
ret
=
ff_framesync
2
_dualinput_get_writable
(
fs
,
&
mainpic
,
&
second
);
ret
=
ff_framesync_dualinput_get_writable
(
fs
,
&
mainpic
,
&
second
);
if
(
ret
<
0
)
return
ret
;
if
(
!
second
)
...
...
@@ -808,7 +808,7 @@ static av_cold int init(AVFilterContext *ctx)
static
int
activate
(
AVFilterContext
*
ctx
)
{
OverlayContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
#define OFFSET(x) offsetof(OverlayContext, x)
...
...
libavfilter/vf_paletteuse.c
View file @
5f5dcf44
...
...
@@ -29,7 +29,7 @@
#include "libavutil/qsort.h"
#include "avfilter.h"
#include "filters.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
enum
dithering_mode
{
...
...
@@ -904,7 +904,7 @@ static int config_output(AVFilterLink *outlink)
AVFilterContext
*
ctx
=
outlink
->
src
;
PaletteUseContext
*
s
=
ctx
->
priv
;
ret
=
ff_framesync
2
_init_dualinput
(
&
s
->
fs
,
ctx
);
ret
=
ff_framesync_init_dualinput
(
&
s
->
fs
,
ctx
);
if
(
ret
<
0
)
return
ret
;
s
->
fs
.
opt_repeatlast
=
1
;
// only 1 frame in the palette
...
...
@@ -915,7 +915,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
h
=
ctx
->
inputs
[
0
]
->
h
;
outlink
->
time_base
=
ctx
->
inputs
[
0
]
->
time_base
;
if
((
ret
=
ff_framesync
2
_configure
(
&
s
->
fs
))
<
0
)
if
((
ret
=
ff_framesync_configure
(
&
s
->
fs
))
<
0
)
return
ret
;
return
0
;
}
...
...
@@ -971,7 +971,7 @@ static int load_apply_palette(FFFrameSync *fs)
int
ret
;
// writable for error diffusal dithering
ret
=
ff_framesync
2
_dualinput_get_writable
(
fs
,
&
main
,
&
second
);
ret
=
ff_framesync_dualinput_get_writable
(
fs
,
&
main
,
&
second
);
if
(
ret
<
0
)
return
ret
;
if
(
!
main
||
!
second
)
{
...
...
@@ -1052,7 +1052,7 @@ static av_cold int init(AVFilterContext *ctx)
static
int
activate
(
AVFilterContext
*
ctx
)
{
PaletteUseContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -1060,7 +1060,7 @@ static av_cold void uninit(AVFilterContext *ctx)
int
i
;
PaletteUseContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
for
(
i
=
0
;
i
<
CACHE_SIZE
;
i
++
)
av_freep
(
&
s
->
cache
[
i
].
entries
);
av_frame_free
(
&
s
->
last_in
);
...
...
libavfilter/vf_premultiply.c
View file @
5f5dcf44
...
...
@@ -24,7 +24,7 @@
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
...
...
@@ -503,8 +503,8 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
=
NULL
,
*
base
,
*
alpha
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
base
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
alpha
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
base
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
alpha
,
0
))
<
0
)
return
ret
;
if
((
ret
=
filter_frame
(
ctx
,
&
out
,
base
,
alpha
))
<
0
)
...
...
@@ -578,7 +578,7 @@ static int config_output(AVFilterLink *outlink)
if
(
s
->
inplace
)
return
0
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
2
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -593,7 +593,7 @@ static int config_output(AVFilterLink *outlink)
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
...
...
@@ -623,7 +623,7 @@ static int activate(AVFilterContext *ctx)
return
0
;
}
}
else
{
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
}
...
...
@@ -668,7 +668,7 @@ static av_cold void uninit(AVFilterContext *ctx)
PreMultiplyContext
*
s
=
ctx
->
priv
;
if
(
!
s
->
inplace
)
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
}
static
const
AVFilterPad
premultiply_outputs
[]
=
{
...
...
libavfilter/vf_psnr.c
View file @
5f5dcf44
...
...
@@ -31,7 +31,7 @@
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "psnr.h"
#include "video.h"
...
...
@@ -151,7 +151,7 @@ static int do_psnr(FFFrameSync *fs)
int
ret
,
j
,
c
;
AVDictionary
**
metadata
;
ret
=
ff_framesync
2
_dualinput_get
(
fs
,
&
main
,
&
ref
);
ret
=
ff_framesync_dualinput_get
(
fs
,
&
main
,
&
ref
);
if
(
ret
<
0
)
return
ret
;
if
(
!
ref
)
...
...
@@ -339,7 +339,7 @@ static int config_output(AVFilterLink *outlink)
AVFilterLink
*
mainlink
=
ctx
->
inputs
[
0
];
int
ret
;
ret
=
ff_framesync
2
_init_dualinput
(
&
s
->
fs
,
ctx
);
ret
=
ff_framesync_init_dualinput
(
&
s
->
fs
,
ctx
);
if
(
ret
<
0
)
return
ret
;
outlink
->
w
=
mainlink
->
w
;
...
...
@@ -347,7 +347,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
time_base
=
mainlink
->
time_base
;
outlink
->
sample_aspect_ratio
=
mainlink
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
mainlink
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_configure
(
&
s
->
fs
))
<
0
)
if
((
ret
=
ff_framesync_configure
(
&
s
->
fs
))
<
0
)
return
ret
;
return
0
;
...
...
@@ -356,7 +356,7 @@ static int config_output(AVFilterLink *outlink)
static
int
activate
(
AVFilterContext
*
ctx
)
{
PSNRContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -380,7 +380,7 @@ static av_cold void uninit(AVFilterContext *ctx)
get_psnr
(
s
->
min_mse
,
1
,
s
->
average_max
));
}
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
if
(
s
->
stats_file
&&
s
->
stats_file
!=
stdout
)
fclose
(
s
->
stats_file
);
...
...
libavfilter/vf_remap.c
View file @
5f5dcf44
...
...
@@ -41,7 +41,7 @@
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
...
...
@@ -286,9 +286,9 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
,
*
in
,
*
xpic
,
*
ypic
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
in
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
xpic
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
2
,
&
ypic
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
in
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
xpic
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
2
,
&
ypic
,
0
))
<
0
)
return
ret
;
if
(
ctx
->
is_disabled
)
{
...
...
@@ -333,7 +333,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
srclink
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
srclink
->
frame_rate
;
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
3
);
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
3
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -353,13 +353,13 @@ static int config_output(AVFilterLink *outlink)
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
RemapContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
...
...
@@ -367,7 +367,7 @@ static av_cold void uninit(AVFilterContext *ctx)
{
RemapContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
}
static
const
AVFilterPad
remap_inputs
[]
=
{
...
...
libavfilter/vf_ssim.c
View file @
5f5dcf44
...
...
@@ -40,7 +40,7 @@
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "ssim.h"
#include "video.h"
...
...
@@ -291,7 +291,7 @@ static int do_ssim(FFFrameSync *fs)
float
c
[
4
],
ssimv
=
0
.
0
;
int
ret
,
i
;
ret
=
ff_framesync
2
_dualinput_get
(
fs
,
&
main
,
&
ref
);
ret
=
ff_framesync_dualinput_get
(
fs
,
&
main
,
&
ref
);
if
(
ret
<
0
)
return
ret
;
if
(
!
ref
)
...
...
@@ -431,7 +431,7 @@ static int config_output(AVFilterLink *outlink)
AVFilterLink
*
mainlink
=
ctx
->
inputs
[
0
];
int
ret
;
ret
=
ff_framesync
2
_init_dualinput
(
&
s
->
fs
,
ctx
);
ret
=
ff_framesync_init_dualinput
(
&
s
->
fs
,
ctx
);
if
(
ret
<
0
)
return
ret
;
outlink
->
w
=
mainlink
->
w
;
...
...
@@ -440,7 +440,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
mainlink
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
mainlink
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_configure
(
&
s
->
fs
))
<
0
)
if
((
ret
=
ff_framesync_configure
(
&
s
->
fs
))
<
0
)
return
ret
;
return
0
;
...
...
@@ -449,7 +449,7 @@ static int config_output(AVFilterLink *outlink)
static
int
activate
(
AVFilterContext
*
ctx
)
{
SSIMContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -469,7 +469,7 @@ static av_cold void uninit(AVFilterContext *ctx)
s
->
ssim_total
/
s
->
nb_frames
,
ssim_db
(
s
->
ssim_total
,
s
->
nb_frames
));
}
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
if
(
s
->
stats_file
&&
s
->
stats_file
!=
stdout
)
fclose
(
s
->
stats_file
);
...
...
libavfilter/vf_stack.c
View file @
5f5dcf44
...
...
@@ -26,7 +26,7 @@
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "video.h"
typedef
struct
StackContext
{
...
...
@@ -97,7 +97,7 @@ static int process_frame(FFFrameSync *fs)
int
i
,
p
,
ret
,
offset
[
4
]
=
{
0
};
for
(
i
=
0
;
i
<
s
->
nb_inputs
;
i
++
)
{
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
i
,
&
in
[
i
],
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
i
,
&
in
[
i
],
0
))
<
0
)
return
ret
;
}
...
...
@@ -180,7 +180,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
time_base
=
time_base
;
outlink
->
frame_rate
=
frame_rate
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
s
->
nb_inputs
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
s
->
nb_inputs
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -196,7 +196,7 @@ static int config_output(AVFilterLink *outlink)
in
[
i
].
after
=
s
->
shortest
?
EXT_STOP
:
EXT_INFINITY
;
}
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -204,7 +204,7 @@ static av_cold void uninit(AVFilterContext *ctx)
StackContext
*
s
=
ctx
->
priv
;
int
i
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
av_freep
(
&
s
->
frames
);
for
(
i
=
0
;
i
<
ctx
->
nb_inputs
;
i
++
)
...
...
@@ -214,7 +214,7 @@ static av_cold void uninit(AVFilterContext *ctx)
static
int
activate
(
AVFilterContext
*
ctx
)
{
StackContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
#define OFFSET(x) offsetof(StackContext, x)
...
...
libavfilter/vf_threshold.c
View file @
5f5dcf44
...
...
@@ -28,7 +28,7 @@
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "framesync
2
.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
...
...
@@ -96,10 +96,10 @@ static int process_frame(FFFrameSync *fs)
AVFrame
*
out
,
*
in
,
*
threshold
,
*
min
,
*
max
;
int
ret
;
if
((
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
0
,
&
in
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
1
,
&
threshold
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
2
,
&
min
,
0
))
<
0
||
(
ret
=
ff_framesync
2
_get_frame
(
&
s
->
fs
,
3
,
&
max
,
0
))
<
0
)
if
((
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
0
,
&
in
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
1
,
&
threshold
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
2
,
&
min
,
0
))
<
0
||
(
ret
=
ff_framesync_get_frame
(
&
s
->
fs
,
3
,
&
max
,
0
))
<
0
)
return
ret
;
if
(
ctx
->
is_disabled
)
{
...
...
@@ -256,7 +256,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
sample_aspect_ratio
=
base
->
sample_aspect_ratio
;
outlink
->
frame_rate
=
base
->
frame_rate
;
if
((
ret
=
ff_framesync
2
_init
(
&
s
->
fs
,
ctx
,
4
))
<
0
)
if
((
ret
=
ff_framesync_init
(
&
s
->
fs
,
ctx
,
4
))
<
0
)
return
ret
;
in
=
s
->
fs
.
in
;
...
...
@@ -279,20 +279,20 @@ static int config_output(AVFilterLink *outlink)
s
->
fs
.
opaque
=
s
;
s
->
fs
.
on_event
=
process_frame
;
return
ff_framesync
2
_configure
(
&
s
->
fs
);
return
ff_framesync_configure
(
&
s
->
fs
);
}
static
int
activate
(
AVFilterContext
*
ctx
)
{
ThresholdContext
*
s
=
ctx
->
priv
;
return
ff_framesync
2
_activate
(
&
s
->
fs
);
return
ff_framesync_activate
(
&
s
->
fs
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
ThresholdContext
*
s
=
ctx
->
priv
;
ff_framesync
2
_uninit
(
&
s
->
fs
);
ff_framesync_uninit
(
&
s
->
fs
);
}
static
const
AVFilterPad
inputs
[]
=
{
...
...
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