FFmpeg  4.0
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, 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

◆ OFFSET

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

Definition at line 563 of file vf_scale.c.

◆ FLAGS

Definition at line 564 of file vf_scale.c.

Enumeration Type Documentation

◆ EvalMode

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 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 

Definition at line 44 of file vf_scale.c.

Function Documentation

◆ init_dict()

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

Definition at line 98 of file vf_scale.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 148 of file vf_scale.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 158 of file vf_scale.c.

◆ parse_yuv_type()

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

◆ config_props()

static int config_props ( AVFilterLink outlink)
static

Definition at line 220 of file vf_scale.c.

Referenced by filter_frame(), and process_command().

◆ config_props_ref()

static int config_props_ref ( AVFilterLink outlink)
static

Definition at line 356 of file vf_scale.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 369 of file vf_scale.c.

◆ request_frame_ref()

static int request_frame_ref ( AVFilterLink outlink)
static

Definition at line 374 of file vf_scale.c.

◆ scale_slice()

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

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 403 of file vf_scale.c.

◆ filter_frame_ref()

static int filter_frame_ref ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 527 of file vf_scale.c.

◆ process_command()

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.

◆ child_class_next()

static const AVClass* child_class_next ( const AVClass prev)
static

Definition at line 558 of file vf_scale.c.

Variable Documentation

◆ ff_vf_scale2ref

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:644
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
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 inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad avfilter_vf_scale2ref_outputs[]
Definition: vf_scale.c:667
static const AVFilterPad avfilter_vf_scale2ref_inputs[]
Definition: vf_scale.c:653

Definition at line 96 of file vf_scale.c.

◆ scale_options

const AVOption scale_options[]
static

Definition at line 566 of file vf_scale.c.

◆ scale_class

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:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption scale_options[]
Definition: vf_scale.c:566
static const AVClass * child_class_next(const AVClass *prev)
Definition: vf_scale.c:558

Definition at line 604 of file vf_scale.c.

◆ avfilter_vf_scale_inputs

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 613 of file vf_scale.c.

◆ avfilter_vf_scale_outputs

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 622 of file vf_scale.c.

◆ ff_vf_scale

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:604
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
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:622
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad avfilter_vf_scale_inputs[]
Definition: vf_scale.c:613

Definition at line 631 of file vf_scale.c.

◆ scale2ref_class

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:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption scale_options[]
Definition: vf_scale.c:566
static const AVClass * child_class_next(const AVClass *prev)
Definition: vf_scale.c:558

Definition at line 644 of file vf_scale.c.

◆ avfilter_vf_scale2ref_inputs

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 653 of file vf_scale.c.

◆ avfilter_vf_scale2ref_outputs

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:356
static int request_frame_ref(AVFilterLink *outlink)
Definition: vf_scale.c:374

Definition at line 667 of file vf_scale.c.