FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_zscale.c File Reference
#include <float.h>
#include <stdio.h>
#include <string.h>
#include <zimg.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/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"

Go to the source code of this file.

Data Structures

struct  ZScaleContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define ZIMG_ALIGNMENT   64
 
#define MIN_TILESIZE   64
 
#define MAX_THREADS   64
 
#define OFFSET(x)   offsetof(ZScaleContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define TFLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Enumerations

enum  var_name {
  VAR_N, VAR_TB, VAR_PTS, VAR_DTS,
  VAR_NOPTS, VAR_STARTPTS, VAR_STARTDTS, VAR_DURATION,
  VAR_D, VAR_POS, VAR_SIZE, VAR_KEY,
  VAR_STATE, VAR_VARS_NB, VAR_N, VAR_TS,
  VAR_POS, VAR_PREV_INPTS, VAR_PREV_INDTS, VAR_PREV_INDUR,
  VAR_PREV_OUTPTS, VAR_PREV_OUTDTS, VAR_PREV_OUTDUR, VAR_NEXT_PTS,
  VAR_NEXT_DTS, VAR_NEXT_DUR, VAR_PTS, VAR_DTS,
  VAR_DURATION, VAR_STARTPTS, VAR_STARTDTS, VAR_TB,
  VAR_TB_OUT, VAR_SR, VAR_NOPTS, VAR_VARS_NB,
  VAR_CH, VAR_N, VAR_NB_IN_CHANNELS, VAR_NB_OUT_CHANNELS,
  VAR_T, VAR_S, VAR_VARS_NB, VAR_W,
  VAR_H, VAR_CW, VAR_CH, VAR_HSUB,
  VAR_VSUB, VARS_NB, VAR_VALUE1, VAR_VALUE2,
  VAR_FRAMEVAL, VAR_USERVAL, VAR_VARS_NB, 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_I, VAR_P, VAR_B,
  VAR_S, VAR_SI, VAR_SP, VAR_BI,
  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_CONSUMED_SAMPLES_N,
  VAR_SAMPLES_N, VAR_SAMPLE_RATE, VAR_N, VAR_SELECTED_N,
  VAR_PREV_SELECTED_N, VAR_KEY, VAR_POS, VAR_SCENE,
  VAR_CONCATDEC_SELECT, VAR_VARS_NB, VAR_N, VAR_T,
  VAR_POS, VAR_PTS, VAR_TS, VAR_TE,
  VAR_TI, VAR_W, VAR_H, VAR_VARS_NB,
  VAR_IN_W, VAR_IW, VAR_IN_H, VAR_IH,
  VAR_OUT_W, VAR_OW, VAR_OUT_H, VAR_OH,
  VAR_A, VAR_SAR, VAR_DAR, VAR_HSUB,
  VAR_VSUB, VAR_OHSUB, VAR_OVSUB, VARS_NB,
  VAR_FRAME_RATE, VAR_INTERLACED, VAR_N, VAR_NB_CONSUMED_SAMPLES,
  VAR_NB_SAMPLES, VAR_POS, VAR_PREV_INPTS, VAR_PREV_INT,
  VAR_PREV_OUTPTS, VAR_PREV_OUTT, VAR_PTS, VAR_SAMPLE_RATE,
  VAR_STARTPTS, VAR_STARTT, VAR_T, VAR_TB,
  VAR_RTCTIME, VAR_RTCSTART, VAR_S, VAR_SR,
  VAR_FR, VAR_VARS_NB, VAR_AVTB, VAR_INTB,
  VAR_SR, VAR_VARS_NB, VAR_W, VAR_H,
  VAR_A, VAR_DAR, VAR_SAR, VAR_HSUB,
  VAR_VSUB, VARS_NB, VAR_IN_W, VAR_IW,
  VAR_IN_H, VAR_IH, VAR_OUT_W, VAR_OW,
  VAR_OUT_H, VAR_OH, VAR_A, VAR_SAR,
  VAR_DAR, VAR_HSUB, VAR_VSUB, VAR_X,
  VAR_Y, VAR_N, VAR_POS, VAR_T,
  VAR_VARS_NB, VAR_X, VAR_Y, VAR_W,
  VAR_H, VAR_N, VAR_T, VAR_VARS_NB,
  VAR_DAR, VAR_HSUB, VAR_VSUB, VAR_IN_H,
  VAR_IH, VAR_IN_W, VAR_IW, VAR_SAR,
  VAR_X, VAR_Y, VAR_H, VAR_W,
  VAR_T, VAR_MAX, VARS_NB, VAR_DAR,
  VAR_HSUB, VAR_VSUB, VAR_LINE_H, VAR_LH,
  VAR_MAIN_H, VAR_h, VAR_H, VAR_MAIN_W,
  VAR_w, VAR_W, VAR_MAX_GLYPH_A, VAR_ASCENT,
  VAR_MAX_GLYPH_D, VAR_DESCENT, VAR_MAX_GLYPH_H, VAR_MAX_GLYPH_W,
  VAR_N, VAR_SAR, VAR_T, VAR_TEXT_H,
  VAR_TH, VAR_TEXT_W, VAR_TW, VAR_X,
  VAR_Y, VAR_PICT_TYPE, VAR_PKT_POS, VAR_PKT_DURATION,
  VAR_PKT_SIZE, VAR_VARS_NB, VAR_N, VAR_POS,
  VAR_R, VAR_T, VAR_NB, VAR_SOURCE_FPS,
  VAR_FPS_NTSC, VAR_FPS_PAL, VAR_FPS_FILM, VAR_FPS_NTSC_FILM,
  VARS_NB, VAR_N, VAR_PTS, VAR_R,
  VAR_T, VAR_TB, VAR_NB, VAR_W,
  VAR_H, VAR_VAL, VAR_MAXVAL, VAR_MINVAL,
  VAR_NEGVAL, VAR_CLIPVAL, VAR_VARS_NB, VAR_W,
  VAR_H, VAR_X, VAR_Y, VAR_BITDEPTHX,
  VAR_BITDEPTHY, VAR_VARS_NB, VAR_MAIN_W, VAR_MW,
  VAR_MAIN_H, VAR_MH, VAR_OVERLAY_W, VAR_OW,
  VAR_OVERLAY_H, VAR_OH, VAR_HSUB, VAR_VSUB,
  VAR_X, VAR_Y, VAR_N, VAR_POS,
  VAR_T, VAR_VARS_NB, VAR_MAIN_W, VAR_MW,
  VAR_MAIN_H, VAR_MH, VAR_OVERLAY_W, VAR_OW,
  VAR_OVERLAY_H, VAR_OH, VAR_X, VAR_Y,
  VAR_N, VAR_POS, VAR_T, VAR_VARS_NB,
  VAR_MAIN_iW, VAR_MW, VAR_MAIN_iH, VAR_MH,
  VAR_OVERLAY_iW, VAR_OVERLAY_iH, VAR_OVERLAY_X, VAR_OX,
  VAR_OVERLAY_Y, VAR_OY, VAR_OVERLAY_W, VAR_OW,
  VAR_OVERLAY_H, VAR_OH, VAR_VARS_NB, 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_SAR, VAR_DAR,
  VAR_HSUB, VAR_VSUB, VARS_NB, 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_SAR, VAR_DAR,
  VARS_NB, VAR_W, VAR_H, VAR_VAL,
  VAR_YMIN, VAR_UMIN, VAR_VMIN, VAR_AMIN,
  VAR_YMAX, VAR_UMAX, VAR_VMAX, VAR_AMAX,
  VAR_VARS_NB, VAR_IN_W, VAR_IW, VAR_IN_H,
  VAR_IH, VAR_OUT_W, VAR_OW, VAR_OUT_H,
  VAR_OH, VAR_HSUB, VAR_VSUB, VAR_N,
  VAR_T, VAR_VARS_NB, VAR_IN_W, VAR_IW,
  VAR_IN_H, VAR_IH, VAR_OUT_W, VAR_OW,
  VAR_OUT_H, VAR_OH, VAR_A, VAR_SAR,
  VAR_DAR, VAR_HSUB, VAR_VSUB, VAR_OHSUB,
  VAR_OVSUB, VAR_N, VAR_T, VAR_POS,
  VAR_S2R_MAIN_W, VAR_S2R_MAIN_H, VAR_S2R_MAIN_A, VAR_S2R_MAIN_SAR,
  VAR_S2R_MAIN_DAR, VAR_S2R_MDAR, VAR_S2R_MAIN_HSUB, VAR_S2R_MAIN_VSUB,
  VAR_S2R_MAIN_N, VAR_S2R_MAIN_T, VAR_S2R_MAIN_POS, VARS_NB,
  VAR_IN_W, VAR_IW, VAR_IN_H, VAR_IH,
  VAR_OUT_W, VAR_OW, VAR_OUT_H, VAR_OH,
  VAR_A, VAR_SAR, VAR_DAR, VAR_N,
  VAR_T, VAR_POS, VAR_S2R_MAIN_W, VAR_S2R_MAIN_H,
  VAR_S2R_MAIN_A, VAR_S2R_MAIN_SAR, VAR_S2R_MAIN_DAR, VAR_S2R_MDAR,
  VAR_S2R_MAIN_N, VAR_S2R_MAIN_T, VAR_S2R_MAIN_POS, 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, VARS_NB, VAR_W,
  VAR_H, VAR_N, VAR_PTS, VAR_R,
  VAR_T, VAR_TB, VAR_NB, VAR_iW,
  VAR_IN_W, VAR_iH, VAR_IN_H, VAR_oW,
  VAR_OUT_W, VAR_W, VAR_oH, VAR_OUT_H,
  VAR_H, CW, CH, CX,
  CY, VAR_VARS_NB, VAR_IN_W, VAR_IW,
  VAR_IN_H, VAR_IH, VAR_OUT_W, VAR_OW,
  VAR_OUT_H, VAR_OH, VAR_IN, VAR_ON,
  VAR_DURATION, VAR_PDURATION, VAR_IN_TIME, VAR_IT,
  VAR_TIME, VAR_OUT_TIME, VAR_OT, VAR_FRAME,
  VAR_ZOOM, VAR_PZOOM, VAR_X, VAR_PX,
  VAR_Y, VAR_PY, VAR_A, VAR_SAR,
  VAR_DAR, VAR_HSUB, VAR_VSUB, VARS_NB,
  VAR_IN_W, VAR_IW, VAR_IN_H, VAR_IH,
  VAR_OUT_W, VAR_OW, VAR_OUT_H, VAR_OH,
  VAR_A, VAR_SAR, VAR_DAR, VAR_HSUB,
  VAR_VSUB, VAR_OHSUB, VAR_OVSUB, VARS_NB,
  VAR_X, VAR_Y, VAR_W, VAR_H,
  VAR_TIME, VAR_SPEED, VAR_TEMPO, VAR_ORDER,
  VAR_PATTERN, VAR_ROW, VAR_VARS_NB
}
 

Functions

static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static void slice_params (ZScaleContext *s, int out_h, int in_h)
 
static int config_props (AVFilterLink *outlink)
 
static int print_zimg_error (AVFilterContext *ctx)
 
static int convert_chroma_location (enum AVChromaLocation chroma_location)
 
static int convert_matrix (enum AVColorSpace colorspace)
 
static int convert_trc (enum AVColorTransferCharacteristic color_trc)
 
static int convert_primaries (enum AVColorPrimaries color_primaries)
 
static int convert_range (enum AVColorRange color_range)
 
static enum AVColorRange convert_range_from_zimg (enum zimg_pixel_range_e color_range)
 
static int compare_zimg_image_formats (zimg_image_format *img_fmt0, zimg_image_format *img_fmt1)
 
static int compare_zimg_graph_builder_params (zimg_graph_builder_params *parm0, zimg_graph_builder_params *parm1)
 
static void format_init (zimg_image_format *format, AVFrame *frame, const AVPixFmtDescriptor *desc, int colorspace, int primaries, int transfer, int range, int location)
 
static int graphs_build (AVFrame *in, AVFrame *out, const AVPixFmtDescriptor *desc, const AVPixFmtDescriptor *out_desc, AVFilterContext *ctx, int job_nr, int n_jobs)
 
static int realign_frame (const AVPixFmtDescriptor *desc, AVFrame **frame, int needs_copy)
 
static void update_output_color_information (ZScaleContext *s, AVFrame *frame)
 
static int filter_slice (AVFilterContext *ctx, void *data, int job_nr, int n_jobs)
 
static int filter_frame (AVFilterLink *link, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
 AVFILTER_DEFINE_CLASS (zscale)
 

Variables

static const char *const var_names []
 
static const AVOption zscale_options []
 
static const AVFilterPad avfilter_vf_zscale_inputs []
 
static const AVFilterPad avfilter_vf_zscale_outputs []
 
const AVFilter ff_vf_zscale
 

Detailed Description

zscale video filter using z.lib library

Definition in file vf_zscale.c.

Macro Definition Documentation

◆ ZIMG_ALIGNMENT

#define ZIMG_ALIGNMENT   64

Definition at line 47 of file vf_zscale.c.

◆ MIN_TILESIZE

#define MIN_TILESIZE   64

Definition at line 48 of file vf_zscale.c.

◆ MAX_THREADS

#define MAX_THREADS   64

Definition at line 49 of file vf_zscale.c.

◆ OFFSET

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

Definition at line 968 of file vf_zscale.c.

◆ FLAGS

Definition at line 969 of file vf_zscale.c.

◆ TFLAGS

Definition at line 970 of file vf_zscale.c.

Enumeration Type Documentation

◆ var_name

enum var_name
Enumerator
VAR_N 
VAR_TB 
VAR_PTS 
VAR_DTS 
VAR_NOPTS 
VAR_STARTPTS 
VAR_STARTDTS 
VAR_DURATION 
VAR_D 
VAR_POS 
VAR_SIZE 
VAR_KEY 
VAR_STATE 
VAR_VARS_NB 
VAR_N 
VAR_TS 
VAR_POS 
VAR_PREV_INPTS 
VAR_PREV_INDTS 
VAR_PREV_INDUR 
VAR_PREV_OUTPTS 
VAR_PREV_OUTDTS 
VAR_PREV_OUTDUR 
VAR_NEXT_PTS 
VAR_NEXT_DTS 
VAR_NEXT_DUR 
VAR_PTS 
VAR_DTS 
VAR_DURATION 
VAR_STARTPTS 
VAR_STARTDTS 
VAR_TB 
VAR_TB_OUT 
VAR_SR 
VAR_NOPTS 
VAR_VARS_NB 
VAR_CH 
VAR_N 
VAR_NB_IN_CHANNELS 
VAR_NB_OUT_CHANNELS 
VAR_T 
VAR_S 
VAR_VARS_NB 
VAR_W 
VAR_H 
VAR_CW 
VAR_CH 
VAR_HSUB 
VAR_VSU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 
VAR_OUT_W 
VAR_OW 
VAR_OUT_H 
VAR_OH 
VAR_IN 
VAR_ON 
VAR_DURATION 
VAR_PDURATION 
VAR_IN_TIME 
VAR_IT 
VAR_TIME 
VAR_OUT_TIME 
VAR_OT 
VAR_FRAME 
VAR_ZOOM 
VAR_PZOOM 
VAR_X 
VAR_PX 
VAR_Y 
VAR_PY 
VAR_A 
VAR_SAR 
VAR_DAR 
VAR_HSUB 
VAR_VSUB 
VARS_NB 
VAR_IN_W 
VAR_IW 
VAR_IN_H 
VAR_IH 
VAR_OUT_W 
VAR_OW 
VAR_OUT_H 
VAR_OH 
VAR_A 
VAR_SAR 
VAR_DAR 
VAR_HSUB 
VAR_VSUB 
VAR_OHSUB 
VAR_OVSUB 
VARS_NB 
VAR_X 
VAR_Y 
VAR_W 
VAR_H 
VAR_TIME 
VAR_SPEED 
VAR_TEMPO 
VAR_ORDER 
VAR_PATTERN 
VAR_ROW 
VAR_VARS_NB 

Definition at line 66 of file vf_zscale.c.

Function Documentation

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 148 of file vf_zscale.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 196 of file vf_zscale.c.

◆ slice_params()

static void slice_params ( ZScaleContext s,
int  out_h,
int  in_h 
)
static

Definition at line 228 of file vf_zscale.c.

Referenced by filter_frame().

◆ config_props()

static int config_props ( AVFilterLink outlink)
static

Definition at line 243 of file vf_zscale.c.

Referenced by process_command().

◆ print_zimg_error()

static int print_zimg_error ( AVFilterContext ctx)
static

Definition at line 361 of file vf_zscale.c.

Referenced by filter_slice(), and graphs_build().

◆ convert_chroma_location()

static int convert_chroma_location ( enum AVChromaLocation  chroma_location)
static

Definition at line 371 of file vf_zscale.c.

Referenced by format_init().

◆ convert_matrix()

static int convert_matrix ( enum AVColorSpace  colorspace)
static

Definition at line 391 of file vf_zscale.c.

Referenced by format_init().

◆ convert_trc()

static int convert_trc ( enum AVColorTransferCharacteristic  color_trc)
static

Definition at line 424 of file vf_zscale.c.

Referenced by format_init().

◆ convert_primaries()

static int convert_primaries ( enum AVColorPrimaries  color_primaries)
static

Definition at line 461 of file vf_zscale.c.

Referenced by format_init().

◆ convert_range()

static int convert_range ( enum AVColorRange  color_range)
static

Definition at line 492 of file vf_zscale.c.

Referenced by format_init().

◆ convert_range_from_zimg()

static enum AVColorRange convert_range_from_zimg ( enum zimg_pixel_range_e  color_range)
static

Definition at line 504 of file vf_zscale.c.

Referenced by update_output_color_information().

◆ compare_zimg_image_formats()

static int compare_zimg_image_formats ( zimg_image_format *  img_fmt0,
zimg_image_format *  img_fmt1 
)
static

Definition at line 516 of file vf_zscale.c.

Referenced by filter_slice().

◆ compare_zimg_graph_builder_params()

static int compare_zimg_graph_builder_params ( zimg_graph_builder_params *  parm0,
zimg_graph_builder_params *  parm1 
)
static

Definition at line 537 of file vf_zscale.c.

Referenced by filter_slice().

◆ format_init()

static void format_init ( zimg_image_format *  format,
AVFrame frame,
const AVPixFmtDescriptor desc,
int  colorspace,
int  primaries,
int  transfer,
int  range,
int  location 
)
static

Definition at line 560 of file vf_zscale.c.

Referenced by filter_frame().

◆ graphs_build()

static int graphs_build ( AVFrame in,
AVFrame out,
const AVPixFmtDescriptor desc,
const AVPixFmtDescriptor out_desc,
AVFilterContext ctx,
int  job_nr,
int  n_jobs 
)
static

Definition at line 577 of file vf_zscale.c.

Referenced by filter_slice().

◆ realign_frame()

static int realign_frame ( const AVPixFmtDescriptor desc,
AVFrame **  frame,
int  needs_copy 
)
static

Definition at line 645 of file vf_zscale.c.

Referenced by filter_frame().

◆ update_output_color_information()

static void update_output_color_information ( ZScaleContext s,
AVFrame frame 
)
static

Definition at line 684 of file vf_zscale.c.

Referenced by filter_frame().

◆ filter_slice()

static int filter_slice ( AVFilterContext ctx,
void *  data,
int  job_nr,
int  n_jobs 
)
static

Definition at line 702 of file vf_zscale.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 766 of file vf_zscale.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 927 of file vf_zscale.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 944 of file vf_zscale.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( zscale  )

Variable Documentation

◆ var_names

const char* const var_names[]
static
Initial value:
= {
"in_w", "iw",
"in_h", "ih",
"out_w", "ow",
"out_h", "oh",
"a",
"sar",
"dar",
"hsub",
"vsub",
"ohsub",
"ovsub",
}

Definition at line 51 of file vf_zscale.c.

Referenced by config_props().

◆ zscale_options

const AVOption zscale_options[]
static

Definition at line 972 of file vf_zscale.c.

◆ avfilter_vf_zscale_inputs

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

Definition at line 1098 of file vf_zscale.c.

◆ avfilter_vf_zscale_outputs

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

Definition at line 1106 of file vf_zscale.c.

◆ ff_vf_zscale

const AVFilter ff_vf_zscale
Initial value:
= {
.name = "zscale",
.description = NULL_IF_CONFIG_SMALL("Apply resizing, colorspace and bit depth conversion."),
.init = init,
.priv_size = sizeof(ZScaleContext),
.priv_class = &zscale_class,
.process_command = process_command,
}

Definition at line 1114 of file vf_zscale.c.

uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_zscale.c:927
config_props
static int config_props(AVFilterLink *outlink)
Definition: vf_zscale.c:243
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_zscale.c:196
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_zscale.c:944
ZScaleContext
Definition: vf_zscale.c:81
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
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:117
avfilter_vf_zscale_outputs
static const AVFilterPad avfilter_vf_zscale_outputs[]
Definition: vf_zscale.c:1106
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_zscale.c:766
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_zscale.c:148
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:127
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
avfilter_vf_zscale_inputs
static const AVFilterPad avfilter_vf_zscale_inputs[]
Definition: vf_zscale.c:1098