FFmpeg
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

◆ F_HAVE_BREAKS

#define F_HAVE_BREAKS   1

Definition at line 31 of file vf_pullup.c.

◆ F_HAVE_AFFINITY

#define F_HAVE_AFFINITY   2

Definition at line 32 of file vf_pullup.c.

◆ BREAK_LEFT

#define BREAK_LEFT   1

Definition at line 34 of file vf_pullup.c.

◆ BREAK_RIGHT

#define BREAK_RIGHT   2

Definition at line 35 of file vf_pullup.c.

◆ OFFSET

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

Definition at line 37 of file vf_pullup.c.

◆ FLAGS

Definition at line 38 of file vf_pullup.c.

◆ ABS

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

Definition at line 73 of file vf_pullup.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( pullup  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 55 of file vf_pullup.c.

◆ diff_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().

◆ comb_c()

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().

◆ var_c()

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().

◆ alloc_metrics()

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().

◆ free_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().

◆ make_field_queue()

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

Definition at line 149 of file vf_pullup.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 183 of file vf_pullup.c.

◆ pullup_lock_buffer()

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

◆ pullup_release_buffer()

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().

◆ alloc_buffer()

static int alloc_buffer ( PullupContext s,
PullupBuffer b 
)
static

Definition at line 247 of file vf_pullup.c.

Referenced by pullup_get_buffer().

◆ 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().

◆ queue_length()

static int queue_length ( PullupField begin,
PullupField end 
)
static

Definition at line 299 of file vf_pullup.c.

Referenced by decide_frame_length().

◆ find_first_break()

static int find_first_break ( PullupField f,
int  max 
)
static

Definition at line 313 of file vf_pullup.c.

Referenced by decide_frame_length().

◆ compute_breaks()

static void compute_breaks ( PullupContext s,
PullupField f0 
)
static

Definition at line 326 of file vf_pullup.c.

Referenced by decide_frame_length().

◆ compute_affinity()

static void compute_affinity ( PullupContext s,
PullupField f 
)
static

Definition at line 367 of file vf_pullup.c.

Referenced by decide_frame_length().

◆ 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().

◆ pullup_get_frame()

static PullupFrame* pullup_get_frame ( PullupContext s)
static

Definition at line 467 of file vf_pullup.c.

Referenced by filter_frame().

◆ pullup_release_frame()

static void pullup_release_frame ( PullupFrame f)
static

Definition at line 514 of file vf_pullup.c.

Referenced by filter_frame().

◆ compute_metric()

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().

◆ check_field_queue()

static int check_field_queue ( PullupContext s)
static

Definition at line 560 of file vf_pullup.c.

Referenced by pullup_submit_field().

◆ 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().

◆ copy_field()

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().

◆ 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().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 658 of file vf_pullup.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 734 of file vf_pullup.c.

Variable Documentation

◆ pullup_options

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

Definition at line 40 of file vf_pullup.c.

◆ pullup_inputs

const AVFilterPad pullup_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}

Definition at line 749 of file vf_pullup.c.

◆ pullup_outputs

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

Definition at line 759 of file vf_pullup.c.

◆ ff_vf_pullup

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 767 of file vf_pullup.c.

config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_pullup.c:183
pullup_outputs
static const AVFilterPad pullup_outputs[]
Definition: vf_pullup.c:759
FLAGS
#define FLAGS
Definition: vf_pullup.c:38
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_pullup.c:658
pullup_inputs
static const AVFilterPad pullup_inputs[]
Definition: vf_pullup.c:749
OFFSET
#define OFFSET(x)
Definition: vf_pullup.c:37
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
PullupContext
Definition: vf_pullup.h:49
NULL
#define NULL
Definition: coverity.c:32
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_pullup.c:55
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_pullup.c:734
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232