FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
vf_pullup.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "vf_pullup.h"

Go to the source code of this file.

Macros

#define F_HAVE_BREAKS   1
 
#define F_HAVE_AFFINITY   2
 
#define BREAK_LEFT   1
 
#define BREAK_RIGHT   2
 
#define OFFSET(x)   offsetof(PullupContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define ABS(a)   (((a) ^ ((a) >> 31)) - ((a) >> 31))
 

Functions

 AVFILTER_DEFINE_CLASS (pullup)
 
static int query_formats (AVFilterContext *ctx)
 
static int diff_c (const uint8_t *a, const uint8_t *b, ptrdiff_t s)
 
static int comb_c (const uint8_t *a, const uint8_t *b, ptrdiff_t s)
 
static int var_c (const uint8_t *a, const uint8_t *b, ptrdiff_t s)
 
static int alloc_metrics (PullupContext *s, PullupField *f)
 
static void free_field_queue (PullupField *head)
 
static PullupFieldmake_field_queue (PullupContext *s, int len)
 
static int config_input (AVFilterLink *inlink)
 
static PullupBufferpullup_lock_buffer (PullupBuffer *b, int parity)
 
static void pullup_release_buffer (PullupBuffer *b, int parity)
 
static int alloc_buffer (PullupContext *s, PullupBuffer *b)
 
static PullupBufferpullup_get_buffer (PullupContext *s, int parity)
 
static int queue_length (PullupField *begin, PullupField *end)
 
static int find_first_break (PullupField *f, int max)
 
static void compute_breaks (PullupContext *s, PullupField *f0)
 
static void compute_affinity (PullupContext *s, PullupField *f)
 
static int decide_frame_length (PullupContext *s)
 
static PullupFramepullup_get_frame (PullupContext *s)
 
static void pullup_release_frame (PullupFrame *f)
 
static void compute_metric (PullupContext *s, int *dest, PullupField *fa, int pa, PullupField *fb, int pb, int(*func)(const uint8_t *, const uint8_t *, ptrdiff_t))
 
static int check_field_queue (PullupContext *s)
 
static void pullup_submit_field (PullupContext *s, PullupBuffer *b, int parity)
 
static void copy_field (PullupContext *s, PullupBuffer *dst, PullupBuffer *src, int parity)
 
static void pullup_pack_frame (PullupContext *s, PullupFrame *fr)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption pullup_options []
 
static const AVFilterPad pullup_inputs []
 
static const AVFilterPad pullup_outputs []
 
AVFilter ff_vf_pullup
 

Macro Definition Documentation

#define F_HAVE_BREAKS   1

Definition at line 31 of file vf_pullup.c.

Referenced by compute_breaks().

#define F_HAVE_AFFINITY   2

Definition at line 32 of file vf_pullup.c.

Referenced by compute_affinity().

#define BREAK_LEFT   1

Definition at line 34 of file vf_pullup.c.

Referenced by compute_breaks(), decide_frame_length(), and find_first_break().

#define BREAK_RIGHT   2

Definition at line 35 of file vf_pullup.c.

Referenced by compute_breaks(), decide_frame_length(), and find_first_break().

#define OFFSET (   x)    offsetof(PullupContext, x)

Definition at line 37 of file vf_pullup.c.

Definition at line 38 of file vf_pullup.c.

#define ABS (   a)    (((a) ^ ((a) >> 31)) - ((a) >> 31))

Definition at line 73 of file vf_pullup.c.

Referenced by comb_c(), diff_c(), and var_c().

Function Documentation

AVFILTER_DEFINE_CLASS ( pullup  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 55 of file vf_pullup.c.

static int diff_c ( const uint8_t a,
const uint8_t b,
ptrdiff_t  s 
)
static

Definition at line 75 of file vf_pullup.c.

Referenced by config_input().

static int comb_c ( const uint8_t a,
const uint8_t b,
ptrdiff_t  s 
)
static

Definition at line 89 of file vf_pullup.c.

Referenced by config_input().

static int var_c ( const uint8_t a,
const uint8_t b,
ptrdiff_t  s 
)
static

Definition at line 104 of file vf_pullup.c.

Referenced by config_input().

static int alloc_metrics ( PullupContext s,
PullupField f 
)
static

Definition at line 117 of file vf_pullup.c.

Referenced by check_field_queue(), and make_field_queue().

static void free_field_queue ( PullupField head)
static

Definition at line 132 of file vf_pullup.c.

Referenced by make_field_queue(), and uninit().

static PullupField* make_field_queue ( PullupContext s,
int  len 
)
static

Definition at line 149 of file vf_pullup.c.

Referenced by config_input().

static int config_input ( AVFilterLink inlink)
static

Definition at line 183 of file vf_pullup.c.

static PullupBuffer* pullup_lock_buffer ( PullupBuffer b,
int  parity 
)
static
static void pullup_release_buffer ( PullupBuffer b,
int  parity 
)
static

Definition at line 236 of file vf_pullup.c.

Referenced by filter_frame(), and pullup_release_frame().

static int alloc_buffer ( PullupContext s,
PullupBuffer b 
)
static

Definition at line 247 of file vf_pullup.c.

Referenced by pullup_get_buffer().

static PullupBuffer* pullup_get_buffer ( PullupContext s,
int  parity 
)
static

Definition at line 262 of file vf_pullup.c.

Referenced by filter_frame(), and pullup_pack_frame().

static int queue_length ( PullupField begin,
PullupField end 
)
static

Definition at line 299 of file vf_pullup.c.

Referenced by decide_frame_length().

static int find_first_break ( PullupField f,
int  max 
)
static

Definition at line 313 of file vf_pullup.c.

Referenced by decide_frame_length().

static void compute_breaks ( PullupContext s,
PullupField f0 
)
static

Definition at line 326 of file vf_pullup.c.

Referenced by decide_frame_length().

static void compute_affinity ( PullupContext s,
PullupField f 
)
static

Definition at line 367 of file vf_pullup.c.

Referenced by decide_frame_length().

static int decide_frame_length ( PullupContext s)
static

Definition at line 411 of file vf_pullup.c.

Referenced by pullup_get_frame().

static PullupFrame* pullup_get_frame ( PullupContext s)
static

Definition at line 467 of file vf_pullup.c.

Referenced by filter_frame().

static void pullup_release_frame ( PullupFrame f)
static

Definition at line 514 of file vf_pullup.c.

Referenced by filter_frame().

static void compute_metric ( PullupContext s,
int *  dest,
PullupField fa,
int  pa,
PullupField fb,
int  pb,
int(*)(const uint8_t *, const uint8_t *, ptrdiff_t)  func 
)
static

Definition at line 529 of file vf_pullup.c.

Referenced by pullup_submit_field().

static int check_field_queue ( PullupContext s)
static

Definition at line 560 of file vf_pullup.c.

Referenced by pullup_submit_field().

static void pullup_submit_field ( PullupContext s,
PullupBuffer b,
int  parity 
)
static

Definition at line 584 of file vf_pullup.c.

Referenced by filter_frame().

static void copy_field ( PullupContext s,
PullupBuffer dst,
PullupBuffer src,
int  parity 
)
static

Definition at line 616 of file vf_pullup.c.

Referenced by pullup_pack_frame().

static void pullup_pack_frame ( PullupContext s,
PullupFrame fr 
)
static

Definition at line 632 of file vf_pullup.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 658 of file vf_pullup.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 734 of file vf_pullup.c.

Variable Documentation

const AVOption pullup_options[]
static
Initial value:
= {
{ "jl", "set left junk size", OFFSET(junk_left), AV_OPT_TYPE_INT, {.i64=1}, 0, INT_MAX, FLAGS },
{ "jr", "set right junk size", OFFSET(junk_right), AV_OPT_TYPE_INT, {.i64=1}, 0, INT_MAX, FLAGS },
{ "jt", "set top junk size", OFFSET(junk_top), AV_OPT_TYPE_INT, {.i64=4}, 1, INT_MAX, FLAGS },
{ "jb", "set bottom junk size", OFFSET(junk_bottom), AV_OPT_TYPE_INT, {.i64=4}, 1, INT_MAX, FLAGS },
{ "sb", "set strict breaks", OFFSET(strict_breaks), AV_OPT_TYPE_BOOL,{.i64=0},-1, 1, FLAGS },
{ "mp", "set metric plane", OFFSET(metric_plane), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, FLAGS, "mp" },
{ "y", "luma", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "mp" },
{ "u", "chroma blue", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "mp" },
{ "v", "chroma red", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "mp" },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: vf_pullup.c:38
#define OFFSET(x)
Definition: vf_pullup.c:37

Definition at line 40 of file vf_pullup.c.

const AVFilterPad pullup_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_pullup.c:658
static int config_input(AVFilterLink *inlink)
Definition: vf_pullup.c:183

Definition at line 749 of file vf_pullup.c.

const AVFilterPad pullup_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 759 of file vf_pullup.c.

AVFilter ff_vf_pullup
Initial value:
= {
.name = "pullup",
.description = NULL_IF_CONFIG_SMALL("Pullup from field sequence to frames."),
.priv_size = sizeof(PullupContext),
.priv_class = &pullup_class,
}
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_pullup.c:734
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad pullup_inputs[]
Definition: vf_pullup.c:749
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static const AVFilterPad pullup_outputs[]
Definition: vf_pullup.c:759
static int query_formats(AVFilterContext *ctx)
Definition: vf_pullup.c:55

Definition at line 767 of file vf_pullup.c.