FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_scale.c File Reference

scale video filter More...

#include <stdio.h>
#include <string.h>
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "scale.h"
#include "video.h"
#include "libavutil/avstring.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/avassert.h"
#include "libswscale/swscale.h"

Go to the source code of this file.

Data Structures

struct  ScaleContext
 

Macros

#define OFFSET(x)   offsetof(ScaleContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Enumerations

enum  EvalMode {
  EVAL_MODE_ONCE, EVAL_MODE_FRAME, EVAL_MODE_NB, EVAL_MODE_INIT,
  EVAL_MODE_FRAME, EVAL_MODE_NB, EVAL_MODE_INIT, EVAL_MODE_FRAME,
  EVAL_MODE_NB, EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB,
  EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB, EVAL_MODE_INIT,
  EVAL_MODE_FRAME, EVAL_MODE_NB
}
 

Functions

static av_cold int init_dict (AVFilterContext *ctx, AVDictionary **opts)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static const intparse_yuv_type (const char *s, enum AVColorSpace colorspace)
 
static int config_props (AVFilterLink *outlink)
 
static int config_props_ref (AVFilterLink *outlink)
 
static int request_frame (AVFilterLink *outlink)
 
static int request_frame_ref (AVFilterLink *outlink)
 
static int scale_slice (AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, struct SwsContext *sws, int y, int h, int mul, int field)
 
static int filter_frame (AVFilterLink *link, AVFrame *in)
 
static int filter_frame_ref (AVFilterLink *link, AVFrame *in)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
static const AVClasschild_class_next (const AVClass *prev)
 

Variables

AVFilter ff_vf_scale2ref
 
static const AVOption scale_options []
 
static const AVClass scale_class
 
static const AVFilterPad avfilter_vf_scale_inputs []
 
static const AVFilterPad avfilter_vf_scale_outputs []
 
AVFilter ff_vf_scale
 
static const AVClass scale2ref_class
 
static const AVFilterPad avfilter_vf_scale2ref_inputs []
 
static const AVFilterPad avfilter_vf_scale2ref_outputs []
 

Detailed Description

scale video filter

Definition in file vf_scale.c.

Macro Definition Documentation

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

Definition at line 563 of file vf_scale.c.

Definition at line 564 of file vf_scale.c.

Enumeration Type Documentation

enum EvalMode
Enumerator
EVAL_MODE_ONCE 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 

Definition at line 44 of file vf_scale.c.

Function Documentation

static av_cold int init_dict ( AVFilterContext ctx,
AVDictionary **  opts 
)
static

Definition at line 98 of file vf_scale.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 148 of file vf_scale.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 158 of file vf_scale.c.

static const int* parse_yuv_type ( const char *  s,
enum AVColorSpace  colorspace 
)
static

Definition at line 196 of file vf_scale.c.

Referenced by filter_frame().

static int config_props ( AVFilterLink outlink)
static

Definition at line 220 of file vf_scale.c.

Referenced by filter_frame(), and process_command().

static int config_props_ref ( AVFilterLink outlink)
static

Definition at line 357 of file vf_scale.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 369 of file vf_scale.c.

static int request_frame_ref ( AVFilterLink outlink)
static

Definition at line 374 of file vf_scale.c.

static int scale_slice ( AVFilterLink link,
AVFrame out_buf,
AVFrame cur_pic,
struct SwsContext sws,
int  y,
int  h,
int  mul,
int  field 
)
static

Definition at line 379 of file vf_scale.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 403 of file vf_scale.c.

static int filter_frame_ref ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 527 of file vf_scale.c.

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 534 of file vf_scale.c.

static const AVClass* child_class_next ( const AVClass prev)
static

Definition at line 558 of file vf_scale.c.

Variable Documentation

AVFilter ff_vf_scale2ref
Initial value:
= {
.name = "scale2ref",
.description = NULL_IF_CONFIG_SMALL("Scale the input video size and/or convert the image format to the given reference."),
.init_dict = init_dict,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ScaleContext),
.priv_class = &scale2ref_class,
}
static av_cold int init_dict(AVFilterContext *ctx, AVDictionary **opts)
Definition: vf_scale.c:98
static int query_formats(AVFilterContext *ctx)
Definition: vf_scale.c:158
static const AVClass scale2ref_class
Definition: vf_scale.c:642
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_scale.c:534
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_scale.c:148
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static const AVFilterPad avfilter_vf_scale2ref_outputs[]
Definition: vf_scale.c:665
static const AVFilterPad avfilter_vf_scale2ref_inputs[]
Definition: vf_scale.c:651

Definition at line 96 of file vf_scale.c.

const AVOption scale_options[]
static

Definition at line 566 of file vf_scale.c.

const AVClass scale_class
static
Initial value:
= {
.class_name = "scale",
.item_name = av_default_item_name,
.option = scale_options,
.child_class_next = child_class_next,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:86
static const AVOption scale_options[]
Definition: vf_scale.c:566
av_default_item_name
static const AVClass * child_class_next(const AVClass *prev)
Definition: vf_scale.c:558

Definition at line 602 of file vf_scale.c.

const AVFilterPad avfilter_vf_scale_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_scale.c:403

Definition at line 611 of file vf_scale.c.

const AVFilterPad avfilter_vf_scale_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_props(AVFilterLink *outlink)
Definition: vf_scale.c:220

Definition at line 620 of file vf_scale.c.

AVFilter ff_vf_scale
Initial value:
= {
.name = "scale",
.description = NULL_IF_CONFIG_SMALL("Scale the input video size and/or convert the image format."),
.init_dict = init_dict,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ScaleContext),
.priv_class = &scale_class,
}
static av_cold int init_dict(AVFilterContext *ctx, AVDictionary **opts)
Definition: vf_scale.c:98
static int query_formats(AVFilterContext *ctx)
Definition: vf_scale.c:158
static const AVClass scale_class
Definition: vf_scale.c:602
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_scale.c:534
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_scale.c:148
static const AVFilterPad avfilter_vf_scale_outputs[]
Definition: vf_scale.c:620
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static const AVFilterPad avfilter_vf_scale_inputs[]
Definition: vf_scale.c:611

Definition at line 629 of file vf_scale.c.

const AVClass scale2ref_class
static
Initial value:
= {
.class_name = "scale2ref",
.item_name = av_default_item_name,
.option = scale_options,
.child_class_next = child_class_next,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:86
static const AVOption scale_options[]
Definition: vf_scale.c:566
av_default_item_name
static const AVClass * child_class_next(const AVClass *prev)
Definition: vf_scale.c:558

Definition at line 642 of file vf_scale.c.

const AVFilterPad avfilter_vf_scale2ref_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{
.name = "ref",
.filter_frame = filter_frame_ref,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame_ref(AVFilterLink *link, AVFrame *in)
Definition: vf_scale.c:527
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_scale.c:403

Definition at line 651 of file vf_scale.c.

const AVFilterPad avfilter_vf_scale2ref_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
.request_frame= request_frame,
},
{
.name = "ref",
.config_props = config_props_ref,
.request_frame= request_frame_ref,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_props(AVFilterLink *outlink)
Definition: vf_scale.c:220
static int request_frame(AVFilterLink *outlink)
Definition: vf_scale.c:369
static int config_props_ref(AVFilterLink *outlink)
Definition: vf_scale.c:357
static int request_frame_ref(AVFilterLink *outlink)
Definition: vf_scale.c:374

Definition at line 665 of file vf_scale.c.