FFmpeg
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 scale_frame (AVFilterLink *link, AVFrame *in, AVFrame **frame_out)
 
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 592 of file vf_scale.c.

Definition at line 593 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 
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 99 of file vf_scale.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 149 of file vf_scale.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 159 of file vf_scale.c.

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

Definition at line 197 of file vf_scale.c.

Referenced by scale_frame().

static int config_props ( AVFilterLink outlink)
static

Definition at line 221 of file vf_scale.c.

Referenced by process_command(), and scale_frame().

static int config_props_ref ( AVFilterLink outlink)
static

Definition at line 368 of file vf_scale.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 381 of file vf_scale.c.

static int request_frame_ref ( AVFilterLink outlink)
static

Definition at line 386 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 391 of file vf_scale.c.

Referenced by scale_frame().

static int scale_frame ( AVFilterLink link,
AVFrame in,
AVFrame **  frame_out 
)
static

Definition at line 415 of file vf_scale.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 542 of file vf_scale.c.

static int filter_frame_ref ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 556 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 563 of file vf_scale.c.

static const AVClass* child_class_next ( const AVClass prev)
static

Definition at line 587 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:99
static int query_formats(AVFilterContext *ctx)
Definition: vf_scale.c:159
static const AVClass scale2ref_class
Definition: vf_scale.c:682
#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:563
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_scale.c:149
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad avfilter_vf_scale2ref_outputs[]
Definition: vf_scale.c:705
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
static const AVFilterPad avfilter_vf_scale2ref_inputs[]
Definition: vf_scale.c:691

Definition at line 97 of file vf_scale.c.

const AVOption scale_options[]
static

Definition at line 595 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: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:595
static const AVClass * child_class_next(const AVClass *prev)
Definition: vf_scale.c:587

Definition at line 642 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:542

Definition at line 651 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:221

Definition at line 660 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:99
static int query_formats(AVFilterContext *ctx)
Definition: vf_scale.c:159
static const AVClass scale_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:186
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_scale.c:563
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_scale.c:149
static const AVFilterPad avfilter_vf_scale_outputs[]
Definition: vf_scale.c:660
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad avfilter_vf_scale_inputs[]
Definition: vf_scale.c:651
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 at line 669 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: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:595
static const AVClass * child_class_next(const AVClass *prev)
Definition: vf_scale.c:587

Definition at line 682 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:556
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_scale.c:542

Definition at line 691 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:221
static int request_frame(AVFilterLink *outlink)
Definition: vf_scale.c:381
static int config_props_ref(AVFilterLink *outlink)
Definition: vf_scale.c:368
static int request_frame_ref(AVFilterLink *outlink)
Definition: vf_scale.c:386

Definition at line 705 of file vf_scale.c.