Libav
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 "video.h"
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.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
 

Enumerations

enum  var_name {
  VAR_E, VAR_INTERLACED, VAR_N, VAR_PHI,
  VAR_PI, VAR_PREV_INPTS, VAR_PREV_OUTPTS, VAR_PTS,
  VAR_STARTPTS, VAR_TB, VAR_RTCTIME, VAR_RTCSTART,
  VAR_S, VAR_SR, VAR_VARS_NB, VAR_E,
  VAR_PHI, VAR_PI, VAR_AVTB, VAR_INTB,
  VAR_SR, VAR_VARS_NB, VAR_PI, VAR_PHI,
  VAR_E, VAR_W, VAR_H, VAR_A,
  VAR_DAR, VAR_SAR, VAR_HSUB, VAR_VSUB,
  VARS_NB, VAR_W, VAR_H, VAR_CW,
  VAR_CH, VAR_HSUB, VAR_VSUB, VARS_NB,
  VAR_E, VAR_PHI, VAR_PI, VAR_IN_W,
  VAR_IW, VAR_IN_H, VAR_IH, VAR_OUT_W,
  VAR_OW, VAR_OUT_H, VAR_OH, VAR_X,
  VAR_Y, VAR_N, VAR_T, VAR_VARS_NB,
  VAR_E, VAR_PHI, VAR_PI, VAR_MAIN_W,
  VAR_MW, VAR_MAIN_H, VAR_MH, VAR_TEXT_W,
  VAR_TW, VAR_TEXT_H, VAR_TH, VAR_X,
  VAR_Y, VAR_N, VAR_T, VAR_VARS_NB,
  VAR_E, VAR_PHI, VAR_PI, VAR_W,
  VAR_H, VAR_VAL, VAR_MAXVAL, VAR_MINVAL,
  VAR_NEGVAL, VAR_CLIPVAL, VAR_VARS_NB, VAR_E,
  VAR_PHI, VAR_PI, VAR_MAIN_W, VAR_MW,
  VAR_MAIN_H, VAR_MH, VAR_OVERLAY_W, VAR_OW,
  VAR_OVERLAY_H, VAR_OH, VAR_VARS_NB, VAR_PI,
  VAR_PHI, VAR_E, VAR_IN_W, VAR_IW,
  VAR_IN_H, VAR_IH, VAR_OUT_W, VAR_OW,
  VAR_OUT_H, VAR_OH, VAR_X, VAR_Y,
  VAR_A, VAR_HSUB, VAR_VSUB, VARS_NB,
  VAR_PI, VAR_PHI, VAR_E, VAR_IN_W,
  VAR_IW, VAR_IN_H, VAR_IH, VAR_OUT_W,
  VAR_OW, VAR_OUT_H, VAR_OH, VAR_A,
  VAR_DAR, VAR_SAR, VAR_HSUB, VAR_VSUB,
  VARS_NB, VAR_E, VAR_PHI, VAR_PI,
  VAR_TB, VAR_PTS, VAR_START_PTS, VAR_PREV_PTS,
  VAR_PREV_SELECTED_PTS, VAR_T, VAR_START_T, VAR_PREV_T,
  VAR_PREV_SELECTED_T, VAR_PICT_TYPE, VAR_PICT_TYPE_I, VAR_PICT_TYPE_P,
  VAR_PICT_TYPE_B, VAR_PICT_TYPE_S, VAR_PICT_TYPE_SI, VAR_PICT_TYPE_SP,
  VAR_PICT_TYPE_BI, VAR_INTERLACE_TYPE, VAR_INTERLACE_TYPE_P, VAR_INTERLACE_TYPE_T,
  VAR_INTERLACE_TYPE_B, VAR_N, VAR_SELECTED_N, VAR_PREV_SELECTED_N,
  VAR_KEY, VAR_VARS_NB, VAR_E, VAR_PHI,
  VAR_PI, VAR_AVTB, VAR_VARS_NB
}
 

Functions

static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *link, AVFrame *in)
 

Variables

static const char *const var_names []
 
static const AVOption options []
 
static const AVClass scale_class
 
static const AVFilterPad avfilter_vf_scale_inputs []
 
static const AVFilterPad avfilter_vf_scale_outputs []
 
AVFilter ff_vf_scale
 

Detailed Description

scale video filter

Definition in file vf_scale.c.

Macro Definition Documentation

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

Definition at line 298 of file vf_scale.c.

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 299 of file vf_scale.c.

Enumeration Type Documentation

enum var_name
Enumerator
VAR_E 
VAR_INTERLACED 
VAR_N 
VAR_PHI 
VAR_PI 
VAR_PREV_INPTS 
VAR_PREV_OUTPTS 
VAR_PTS 
VAR_STARTPTS 
VAR_TB 
VAR_RTCTIME 
VAR_RTCSTART 
VAR_S 
VAR_SR 
VAR_VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_AVTB 
VAR_INTB 
VAR_SR 
VAR_VARS_NB 
VAR_PI 
VAR_PHI 
VAR_E 
VAR_W 
VAR_H 
VAR_A 
VAR_DAR 
VAR_SAR 
VAR_HSUB 
VAR_VSUB 
VARS_NB 
VAR_W 
VAR_H 
VAR_CW 
VAR_CH 
VAR_HSUB 
VAR_VSUB 
VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_IN_W 
VAR_IW 
VAR_IN_H 
VAR_IH 
VAR_OUT_W 
VAR_OW 
VAR_OUT_H 
VAR_OH 
VAR_X 
VAR_Y 
VAR_N 
VAR_T 
VAR_VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_MAIN_W 
VAR_MW 
VAR_MAIN_H 
VAR_MH 
VAR_TEXT_W 
VAR_TW 
VAR_TEXT_H 
VAR_TH 
VAR_X 
VAR_Y 
VAR_N 
VAR_T 
VAR_VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_W 
VAR_H 
VAR_VAL 
VAR_MAXVAL 
VAR_MINVAL 
VAR_NEGVAL 
VAR_CLIPVAL 
VAR_VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_MAIN_W 
VAR_MW 
VAR_MAIN_H 
VAR_MH 
VAR_OVERLAY_W 
VAR_OW 
VAR_OVERLAY_H 
VAR_OH 
VAR_VARS_NB 
VAR_PI 
VAR_PHI 
VAR_E 
VAR_IN_W 
VAR_IW 
VAR_IN_H 
VAR_IH 
VAR_OUT_W 
VAR_OW 
VAR_OUT_H 
VAR_OH 
VAR_X 
VAR_Y 
VAR_A 
VAR_HSUB 
VAR_VSUB 
VARS_NB 
VAR_PI 
VAR_PHI 
VAR_E 
VAR_IN_W 
VAR_IW 
VAR_IN_H 
VAR_IH 
VAR_OUT_W 
VAR_OW 
VAR_OUT_H 
VAR_OH 
VAR_A 
VAR_DAR 
VAR_SAR 
VAR_HSUB 
VAR_VSUB 
VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_TB 
VAR_PTS 
VAR_START_PTS 
VAR_PREV_PTS 
VAR_PREV_SELECTED_PTS 
VAR_T 
VAR_START_T 
VAR_PREV_T 
VAR_PREV_SELECTED_T 
VAR_PICT_TYPE 
VAR_PICT_TYPE_I 
VAR_PICT_TYPE_P 
VAR_PICT_TYPE_B 
VAR_PICT_TYPE_S 
VAR_PICT_TYPE_SI 
VAR_PICT_TYPE_SP 
VAR_PICT_TYPE_BI 
VAR_INTERLACE_TYPE 
VAR_INTERLACE_TYPE_P 
VAR_INTERLACE_TYPE_T 
VAR_INTERLACE_TYPE_B 
VAR_N 
VAR_SELECTED_N 
VAR_PREV_SELECTED_N 
VAR_KEY 
VAR_VARS_NB 
VAR_E 
VAR_PHI 
VAR_PI 
VAR_AVTB 
VAR_VARS_NB 

Definition at line 56 of file vf_scale.c.

Function Documentation

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 92 of file vf_scale.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 109 of file vf_scale.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 116 of file vf_scale.c.

static int config_props ( AVFilterLink outlink)
static

Definition at line 154 of file vf_scale.c.

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 263 of file vf_scale.c.

Variable Documentation

const char* const var_names[]
static
Initial value:
= {
"PI",
"PHI",
"E",
"in_w", "iw",
"in_h", "ih",
"out_w", "ow",
"out_h", "oh",
"a", "dar",
"sar",
"hsub",
"vsub",
}
NULL
Definition: eval.c:55

Definition at line 41 of file vf_scale.c.

Referenced by config_props().

const AVOption options[]
static
Initial value:
= {
{ "w", "Output video width", OFFSET(w_expr), AV_OPT_TYPE_STRING, { .str = "iw" }, .flags = FLAGS },
{ "h", "Output video height", OFFSET(h_expr), AV_OPT_TYPE_STRING, { .str = "ih" }, .flags = FLAGS },
{ "flags", "Flags to pass to libswscale", OFFSET(flags_str), AV_OPT_TYPE_STRING, { .str = "bilinear" }, .flags = FLAGS },
{ NULL },
}
#define FLAGS
Definition: vf_scale.c:299
NULL
Definition: eval.c:55
#define OFFSET(x)
Definition: vf_scale.c:298

Definition at line 300 of file vf_scale.c.

const AVClass scale_class
static
Initial value:
= {
.class_name = "scale",
.item_name = av_default_item_name,
.option = options,
}
static const AVOption options[]
Definition: vf_scale.c:300
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
av_default_item_name
Definition: dnxhdenc.c:52

Definition at line 307 of file vf_scale.c.

const AVFilterPad avfilter_vf_scale_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
NULL
Definition: eval.c:55
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_scale.c:263

Definition at line 314 of file vf_scale.c.

const AVFilterPad avfilter_vf_scale_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
},
{ NULL }
}
static int config_props(AVFilterLink *outlink)
Definition: vf_scale.c:154
NULL
Definition: eval.c:55

Definition at line 323 of file vf_scale.c.

AVFilter ff_vf_scale
Initial value:
= {
.name = "scale",
.description = NULL_IF_CONFIG_SMALL("Scale the input video to width:height size and/or convert the image format."),
.init = init,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ScaleContext),
.priv_class = &scale_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:232
static int query_formats(AVFilterContext *ctx)
Definition: vf_scale.c:116
static const AVClass scale_class
Definition: vf_scale.c:307
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:150
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_scale.c:109
static const AVFilterPad avfilter_vf_scale_outputs[]
Definition: vf_scale.c:323
static const AVFilterPad avfilter_vf_scale_inputs[]
Definition: vf_scale.c:314
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:221
static av_cold int init(AVFilterContext *ctx)
Definition: vf_scale.c:92

Definition at line 332 of file vf_scale.c.