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 int config_output (AVFilterLink *outlink)
 
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 70 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 72 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 86 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 101 of file vf_pullup.c.

Referenced by config_input().

static int alloc_metrics ( PullupContext s,
PullupField f 
)
static

Definition at line 114 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 129 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 146 of file vf_pullup.c.

Referenced by config_input().

static int config_input ( AVFilterLink inlink)
static

Definition at line 180 of file vf_pullup.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 220 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 239 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 250 of file vf_pullup.c.

Referenced by pullup_get_buffer().

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

Definition at line 265 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 302 of file vf_pullup.c.

Referenced by decide_frame_length().

static int find_first_break ( PullupField f,
int  max 
)
static

Definition at line 316 of file vf_pullup.c.

Referenced by decide_frame_length().

static void compute_breaks ( PullupContext s,
PullupField f0 
)
static

Definition at line 329 of file vf_pullup.c.

Referenced by decide_frame_length().

static void compute_affinity ( PullupContext s,
PullupField f 
)
static

Definition at line 370 of file vf_pullup.c.

Referenced by decide_frame_length().

static int decide_frame_length ( PullupContext s)
static

Definition at line 414 of file vf_pullup.c.

Referenced by pullup_get_frame().

static PullupFrame* pullup_get_frame ( PullupContext s)
static

Definition at line 470 of file vf_pullup.c.

Referenced by filter_frame().

static void pullup_release_frame ( PullupFrame f)
static

Definition at line 517 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 532 of file vf_pullup.c.

Referenced by pullup_submit_field().

static int check_field_queue ( PullupContext s)
static

Definition at line 563 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 587 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 619 of file vf_pullup.c.

Referenced by pullup_pack_frame().

static void pullup_pack_frame ( PullupContext s,
PullupFrame fr 
)
static

Definition at line 635 of file vf_pullup.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 661 of file vf_pullup.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 737 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_INT, {.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 }
}

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 }
}

Definition at line 752 of file vf_pullup.c.

const AVFilterPad pullup_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}

Definition at line 762 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,
}

Definition at line 771 of file vf_pullup.c.