FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_rotate.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "internal.h"
#include "video.h"
#include <float.h>

Go to the source code of this file.

Data Structures

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

Macros

#define OFFSET(x)   offsetof(RotContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define TFLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define FIXP   (1<<16)
 
#define FIXP2   (1<<20)
 
#define INT_PI   3294199
 
#define SET_SIZE_EXPR(name, opt_name)
 

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_CH,
  VAR_SN, VAR_NB_CHANNELS, VAR_T, VAR_SR,
  VAR_P, VAR_F, VAR_VARS_NB, VAR_CH,
  VAR_SN, VAR_NB_CHANNELS, VAR_T, VAR_SR,
  VAR_P, 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_SIZE, VAR_DURATION,
  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_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_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,
  VAR_CW, VAR_CH, VAR_CX, VAR_CY,
  VAR_A, VAR_DAR, VAR_SAR, 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

 AVFILTER_DEFINE_CLASS (rotate)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static double get_rotated_w (void *opaque, double angle)
 
static double get_rotated_h (void *opaque, double angle)
 
static int64_t int_sin (int64_t a)
 Compute the sin of a using integer values. More...
 
static uint8_t * interpolate_bilinear8 (uint8_t *dst_color, const uint8_t *src, int src_linesize, int src_linestep, int x, int y, int max_x, int max_y)
 Interpolate the color in src at position x and y using bilinear interpolation. More...
 
static uint8_t * interpolate_bilinear16 (uint8_t *dst_color, const uint8_t *src, int src_linesize, int src_linestep, int x, int y, int max_x, int max_y)
 Interpolate the color in src at position x and y using bilinear interpolation. More...
 
static int config_props (AVFilterLink *outlink)
 
static av_always_inline void copy_elem (uint8_t *pout, const uint8_t *pin, int elem_size)
 
static av_always_inline void simple_rotate_internal (uint8_t *dst, const uint8_t *src, int src_linesize, int angle, int elem_size, int len)
 
static av_always_inline void simple_rotate (uint8_t *dst, const uint8_t *src, int src_linesize, int angle, int elem_size, int len)
 
static int filter_slice (AVFilterContext *ctx, void *arg, int job, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 

Variables

static const char *const var_names []
 
static const AVOption rotate_options []
 
static enum AVPixelFormat pix_fmts []
 
static double(*const func1 [])(void *, double)
 
static const char *const func1_names []
 
static const AVFilterPad rotate_inputs []
 
static const AVFilterPad rotate_outputs []
 
const AVFilter ff_vf_rotate
 

Detailed Description

rotation filter, partially based on the tests/rotozoom.c program

Definition in file vf_rotate.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 95 of file vf_rotate.c.

◆ FLAGS

Definition at line 96 of file vf_rotate.c.

◆ TFLAGS

Definition at line 97 of file vf_rotate.c.

◆ FIXP

#define FIXP   (1<<16)

Definition at line 194 of file vf_rotate.c.

◆ FIXP2

#define FIXP2   (1<<20)

Definition at line 195 of file vf_rotate.c.

◆ INT_PI

#define INT_PI   3294199

Definition at line 196 of file vf_rotate.c.

◆ SET_SIZE_EXPR

#define SET_SIZE_EXPR (   name,
  opt_name 
)
Value:
do { \
ret = av_expr_parse_and_eval(&res, expr = rot->name##_expr_str, \
var_names, rot->var_values, \
func1_names, func1, NULL, NULL, rot, 0, ctx); \
if (ret < 0 || isnan(res) || isinf(res) || res <= 0) { \
av_log(ctx, AV_LOG_ERROR, \
"Error parsing or evaluating expression for option %s: " \
"invalid expression '%s' or non-positive or indefinite value %f\n", \
opt_name, expr, res); \
return ret; \
} \
} while (0)

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_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ILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( rotate  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 114 of file vf_rotate.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 127 of file vf_rotate.c.

◆ get_rotated_w()

static double get_rotated_w ( void *  opaque,
double  angle 
)
static

Definition at line 158 of file vf_rotate.c.

◆ get_rotated_h()

static double get_rotated_h ( void *  opaque,
double  angle 
)
static

Definition at line 170 of file vf_rotate.c.

◆ int_sin()

static int64_t int_sin ( int64_t  a)
static

Compute the sin of a using integer values.

Input is scaled by FIXP2 and output values are scaled by FIXP.

Definition at line 202 of file vf_rotate.c.

Referenced by filter_frame().

◆ interpolate_bilinear8()

static uint8_t* interpolate_bilinear8 ( uint8_t *  dst_color,
const uint8_t *  src,
int  src_linesize,
int  src_linestep,
int  x,
int  y,
int  max_x,
int  max_y 
)
static

Interpolate the color in src at position x and y using bilinear interpolation.

Definition at line 225 of file vf_rotate.c.

Referenced by config_props().

◆ interpolate_bilinear16()

static uint8_t* interpolate_bilinear16 ( uint8_t *  dst_color,
const uint8_t *  src,
int  src_linesize,
int  src_linestep,
int  x,
int  y,
int  max_x,
int  max_y 
)
static

Interpolate the color in src at position x and y using bilinear interpolation.

Definition at line 255 of file vf_rotate.c.

Referenced by config_props().

◆ config_props()

static int config_props ( AVFilterLink outlink)
static

Definition at line 281 of file vf_rotate.c.

◆ copy_elem()

static av_always_inline void copy_elem ( uint8_t *  pout,
const uint8_t *  pin,
int  elem_size 
)
static

Definition at line 354 of file vf_rotate.c.

Referenced by simple_rotate_internal().

◆ simple_rotate_internal()

static av_always_inline void simple_rotate_internal ( uint8_t *  dst,
const uint8_t *  src,
int  src_linesize,
int  angle,
int  elem_size,
int  len 
)
static

Definition at line 377 of file vf_rotate.c.

Referenced by simple_rotate().

◆ simple_rotate()

static av_always_inline void simple_rotate ( uint8_t *  dst,
const uint8_t *  src,
int  src_linesize,
int  angle,
int  elem_size,
int  len 
)
static

Definition at line 399 of file vf_rotate.c.

Referenced by filter_slice().

◆ filter_slice()

static int filter_slice ( AVFilterContext ctx,
void *  arg,
int  job,
int  nb_jobs 
)
static

Definition at line 410 of file vf_rotate.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 500 of file vf_rotate.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 554 of file vf_rotate.c.

Variable Documentation

◆ var_names

const char* const var_names[]
static
Initial value:
= {
"in_w" , "iw",
"in_h" , "ih",
"out_w", "ow",
"out_h", "oh",
"hsub", "vsub",
"n",
"t",
}

Definition at line 41 of file vf_rotate.c.

Referenced by config_props(), and process_command().

◆ rotate_options

const AVOption rotate_options[]
static
Initial value:
= {
{ "angle", "set angle (in radians)", OFFSET(angle_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags=TFLAGS },
{ "a", "set angle (in radians)", OFFSET(angle_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags=TFLAGS },
{ "out_w", "set output width expression", OFFSET(outw_expr_str), AV_OPT_TYPE_STRING, {.str="iw"}, 0, 0, .flags=FLAGS },
{ "ow", "set output width expression", OFFSET(outw_expr_str), AV_OPT_TYPE_STRING, {.str="iw"}, 0, 0, .flags=FLAGS },
{ "out_h", "set output height expression", OFFSET(outh_expr_str), AV_OPT_TYPE_STRING, {.str="ih"}, 0, 0, .flags=FLAGS },
{ "oh", "set output height expression", OFFSET(outh_expr_str), AV_OPT_TYPE_STRING, {.str="ih"}, 0, 0, .flags=FLAGS },
{ "fillcolor", "set background fill color", OFFSET(fillcolor_str), AV_OPT_TYPE_STRING, {.str="black"}, 0, 0, .flags=FLAGS },
{ "c", "set background fill color", OFFSET(fillcolor_str), AV_OPT_TYPE_STRING, {.str="black"}, 0, 0, .flags=FLAGS },
{ "bilinear", "use bilinear interpolation", OFFSET(use_bilinear), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, .flags=FLAGS },
{ NULL }
}

Definition at line 99 of file vf_rotate.c.

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

◆ func1

double(* const func1[])(void *, double)
static
Initial value:

Definition at line 182 of file vf_rotate.c.

Referenced by config_props(), ff_rate_control_init(), and parse_channel_expressions().

◆ func1_names

const char* const func1_names[]
static
Initial value:
= {
"rotw",
"roth",
}

Definition at line 188 of file vf_rotate.c.

Referenced by av_expr_parse(), av_expr_parse_and_eval(), config_props(), ff_rate_control_init(), and parse_channel_expressions().

◆ rotate_inputs

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

Definition at line 577 of file vf_rotate.c.

◆ rotate_outputs

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

Definition at line 585 of file vf_rotate.c.

◆ ff_vf_rotate

const AVFilter ff_vf_rotate
Initial value:
= {
.name = "rotate",
.description = NULL_IF_CONFIG_SMALL("Rotate the input image."),
.priv_size = sizeof(RotContext),
.init = init,
.priv_class = &rotate_class,
}

Definition at line 593 of file vf_rotate.c.

AV_PIX_FMT_YUV420P9LE
@ AV_PIX_FMT_YUV420P9LE
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:147
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:174
RotContext
Definition: vf_rotate.c:63
AV_PIX_FMT_YUV420P16LE
@ AV_PIX_FMT_YUV420P16LE
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:121
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_rotate.c:554
get_rotated_h
static double get_rotated_h(void *opaque, double angle)
Definition: vf_rotate.c:170
AV_PIX_FMT_YUV444P16LE
@ AV_PIX_FMT_YUV444P16LE
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:125
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_YUV420P12LE
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:261
func1_names
static const char *const func1_names[]
Definition: vf_rotate.c:188
AV_PIX_FMT_YUV420P10LE
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:149
AV_PIX_FMT_YUV444P12LE
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:269
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
ctx
AVFormatContext * ctx
Definition: movenc.c:48
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:194
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_rotate.c:500
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
AV_PIX_FMT_YUV444P10LE
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:155
NULL
#define NULL
Definition: coverity.c:32
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_rotate.c:114
isnan
#define isnan(x)
Definition: libm.h:340
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
AV_PIX_FMT_YUVA444P9LE
@ AV_PIX_FMT_YUVA444P9LE
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:173
isinf
#define isinf(x)
Definition: libm.h:317
AV_PIX_FMT_YUVA420P16LE
@ AV_PIX_FMT_YUVA420P16LE
planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:181
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:258
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_YUVA420P9LE
@ AV_PIX_FMT_YUVA420P9LE
planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
Definition: pixfmt.h:169
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
OFFSET
#define OFFSET(x)
Definition: vf_rotate.c:95
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:115
av_expr_parse_and_eval
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
Definition: eval.c:776
rotate_inputs
static const AVFilterPad rotate_inputs[]
Definition: vf_rotate.c:577
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
AV_PIX_FMT_RGB0
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:256
AV_PIX_FMT_YUVA420P10LE
@ AV_PIX_FMT_YUVA420P10LE
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:175
rotate_outputs
static const AVFilterPad rotate_outputs[]
Definition: vf_rotate.c:585
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:142
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_rotate.c:127
func1
static double(*const func1[])(void *, double)
Definition: vf_rotate.c:182
get_rotated_w
static double get_rotated_w(void *opaque, double angle)
Definition: vf_rotate.c:158
ret
ret
Definition: filter_design.txt:187
AV_PIX_FMT_0BGR
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:257
FLAGS
#define FLAGS
Definition: vf_rotate.c:96
config_props
static int config_props(AVFilterLink *outlink)
Definition: vf_rotate.c:281
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_PIX_FMT_YUV444P9LE
@ AV_PIX_FMT_YUV444P9LE
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:153
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
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:117
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
var_names
static const char *const var_names[]
Definition: vf_rotate.c:41
AV_PIX_FMT_YUVA444P10LE
@ AV_PIX_FMT_YUVA444P10LE
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:179
TFLAGS
#define TFLAGS
Definition: vf_rotate.c:97
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_rotate.c:135
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:195
AV_PIX_FMT_0RGB
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:255
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
AV_PIX_FMT_YUVA444P16LE
@ AV_PIX_FMT_YUVA444P16LE
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:185
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229