FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_xfade.c File Reference
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "avfilter.h"
#include "internal.h"
#include "filters.h"
#include "video.h"

Go to the source code of this file.

Data Structures

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

Macros

#define OFFSET(x)   offsetof(XFadeContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 
#define CUSTOM_TRANSITION(name, type, div)
 
#define FADE_TRANSITION(name, type, div)
 
#define WIPELEFT_TRANSITION(name, type, div)
 
#define WIPERIGHT_TRANSITION(name, type, div)
 
#define WIPEUP_TRANSITION(name, type, div)
 
#define WIPEDOWN_TRANSITION(name, type, div)
 
#define SLIDELEFT_TRANSITION(name, type, div)
 
#define SLIDERIGHT_TRANSITION(name, type, div)
 
#define SLIDEUP_TRANSITION(name, type, div)
 
#define SLIDEDOWN_TRANSITION(name, type, div)
 
#define CIRCLECROP_TRANSITION(name, type, div)
 
#define RECTCROP_TRANSITION(name, type, div)
 
#define DISTANCE_TRANSITION(name, type, div)
 
#define FADEBLACK_TRANSITION(name, type, div)
 
#define FADEWHITE_TRANSITION(name, type, div)
 
#define RADIAL_TRANSITION(name, type, div)
 
#define SMOOTHLEFT_TRANSITION(name, type, div)
 
#define SMOOTHRIGHT_TRANSITION(name, type, div)
 
#define SMOOTHUP_TRANSITION(name, type, div)
 
#define SMOOTHDOWN_TRANSITION(name, type, div)
 
#define CIRCLEOPEN_TRANSITION(name, type, div)
 
#define CIRCLECLOSE_TRANSITION(name, type, div)
 
#define VERTOPEN_TRANSITION(name, type, div)
 
#define VERTCLOSE_TRANSITION(name, type, div)
 
#define HORZOPEN_TRANSITION(name, type, div)
 
#define HORZCLOSE_TRANSITION(name, type, div)
 
#define DISSOLVE_TRANSITION(name, type, div)
 
#define PIXELIZE_TRANSITION(name, type, div)
 
#define DIAGTL_TRANSITION(name, type, div)
 
#define DIAGTR_TRANSITION(name, type, div)
 
#define DIAGBL_TRANSITION(name, type, div)
 
#define DIAGBR_TRANSITION(name, type, div)
 
#define HLSLICE_TRANSITION(name, type, div)
 
#define HRSLICE_TRANSITION(name, type, div)
 
#define VUSLICE_TRANSITION(name, type, div)
 
#define VDSLICE_TRANSITION(name, type, div)
 
#define HBLUR_TRANSITION(name, type, div)
 
#define FADEGRAYS_TRANSITION(name, type, div)
 
#define WIPETL_TRANSITION(name, type, div)
 
#define WIPETR_TRANSITION(name, type, div)
 
#define WIPEBL_TRANSITION(name, type, div)
 
#define WIPEBR_TRANSITION(name, type, div)
 
#define SQUEEZEH_TRANSITION(name, type, div)
 
#define SQUEEZEV_TRANSITION(name, type, div)
 
#define ZOOMIN_TRANSITION(name, type, div)
 
#define FADEFAST_TRANSITION(name, type, div)
 
#define FADESLOW_TRANSITION(name, type, div)
 
#define HWIND_TRANSITION(name, z, type, div, expr)
 
#define VWIND_TRANSITION(name, z, type, div, expr)
 
#define COVERH_TRANSITION(dir, name, type, div, expr)
 
#define COVERV_TRANSITION(dir, name, type, div, expr)
 
#define REVEALH_TRANSITION(dir, name, type, div, expr)
 
#define REVEALV_TRANSITION(dir, name, type, div, expr)
 

Enumerations

enum  XFadeTransitions {
  CUSTOM = -1, FADE, WIPELEFT, WIPERIGHT,
  WIPEUP, WIPEDOWN, SLIDELEFT, SLIDERIGHT,
  SLIDEUP, SLIDEDOWN, CIRCLECROP, RECTCROP,
  DISTANCE, FADEBLACK, FADEWHITE, RADIAL,
  SMOOTHLEFT, SMOOTHRIGHT, SMOOTHUP, SMOOTHDOWN,
  CIRCLEOPEN, CIRCLECLOSE, VERTOPEN, VERTCLOSE,
  HORZOPEN, HORZCLOSE, DISSOLVE, PIXELIZE,
  DIAGTL, DIAGTR, DIAGBL, DIAGBR,
  HLSLICE, HRSLICE, VUSLICE, VDSLICE,
  HBLUR, FADEGRAYS, WIPETL, WIPETR,
  WIPEBL, WIPEBR, SQUEEZEH, SQUEEZEV,
  ZOOMIN, FADEFAST, FADESLOW, HLWIND,
  HRWIND, VUWIND, VDWIND, COVERLEFT,
  COVERRIGHT, COVERUP, COVERDOWN, REVEALLEFT,
  REVEALRIGHT, REVEALUP, REVEALDOWN, NB_TRANSITIONS,
  CUSTOM, FADE, WIPELEFT, WIPERIGHT,
  WIPEUP, WIPEDOWN, SLIDELEFT, SLIDERIGHT,
  SLIDEUP, SLIDEDOWN, NB_TRANSITIONS, FADE,
  WIPELEFT, WIPERIGHT, WIPEUP, WIPEDOWN,
  SLIDEDOWN, SLIDEUP, SLIDELEFT, SLIDERIGHT,
  CIRCLEOPEN, CIRCLECLOSE, DISSOLVE, PIXELIZE,
  WIPETL, WIPETR, WIPEBL, WIPEBR,
  NB_TRANSITIONS
}
 
enum  {
  VAR_X, VAR_Y, VAR_W, VAR_H,
  VAR_A, VAR_B, VAR_PLANE, VAR_PROGRESS,
  VAR_VARS_NB
}
 

Functions

static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (xfade)
 
static float mix (float a, float b, float mix)
 
static float fract (float a)
 
static float smoothstep (float edge0, float edge1, float x)
 
static float frand (int x, int y)
 
static void zoom (float *u, float *v, float amount)
 
static double getpix (void *priv, double x, double y, int plane, int nb)
 
static double a0 (void *priv, double x, double y)
 
static double a1 (void *priv, double x, double y)
 
static double a2 (void *priv, double x, double y)
 
static double a3 (void *priv, double x, double y)
 
static double b0 (void *priv, double x, double y)
 
static double b1 (void *priv, double x, double y)
 
static double b2 (void *priv, double x, double y)
 
static double b3 (void *priv, double x, double y)
 
static int config_output (AVFilterLink *outlink)
 
static int xfade_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int xfade_frame (AVFilterContext *ctx, AVFrame *a, AVFrame *b)
 
static int forward_frame (XFadeContext *s, AVFilterLink *inlink, AVFilterLink *outlink)
 
static int xfade_activate (AVFilterContext *avctx)
 
static AVFrameget_video_buffer (AVFilterLink *inlink, int w, int h)
 

Variables

static const char *const var_names [] = { "X", "Y", "W", "H", "A", "B", "PLANE", "P", NULL }
 
static enum AVPixelFormat pix_fmts []
 
static const AVOption xfade_options []
 
static const AVFilterPad xfade_inputs []
 
static const AVFilterPad xfade_outputs []
 
const AVFilter ff_vf_xfade
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 168 of file vf_xfade.c.

◆ FLAGS

Definition at line 169 of file vf_xfade.c.

◆ CUSTOM_TRANSITION

#define CUSTOM_TRANSITION (   name,
  type,
  div 
)

Definition at line 240 of file vf_xfade.c.

◆ FADE_TRANSITION

#define FADE_TRANSITION (   name,
  type,
  div 
)
Value:
static void fade##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = mix(xf0[x], xf1[x], progress); \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 300 of file vf_xfade.c.

◆ WIPELEFT_TRANSITION

#define WIPELEFT_TRANSITION (   name,
  type,
  div 
)
Value:
static void wipeleft##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int z = width * progress; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = x > z ? xf1[x] : xf0[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 330 of file vf_xfade.c.

◆ WIPERIGHT_TRANSITION

#define WIPERIGHT_TRANSITION (   name,
  type,
  div 
)
Value:
static void wiperight##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int z = width * (1.f - progress); \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = x > z ? xf0[x] : xf1[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 361 of file vf_xfade.c.

◆ WIPEUP_TRANSITION

#define WIPEUP_TRANSITION (   name,
  type,
  div 
)
Value:
static void wipeup##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int z = out->height * progress; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = slice_start + y > z ? xf1[x] : xf0[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 392 of file vf_xfade.c.

◆ WIPEDOWN_TRANSITION

#define WIPEDOWN_TRANSITION (   name,
  type,
  div 
)
Value:
static void wipedown##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int z = out->height * (1.f - progress); \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = slice_start + y > z ? xf0[x] : xf1[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 423 of file vf_xfade.c.

◆ SLIDELEFT_TRANSITION

#define SLIDELEFT_TRANSITION (   name,
  type,
  div 
)
Value:
static void slideleft##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int z = -progress * width; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
const int zx = z + x; \
const int zz = zx % width + width * (zx < 0); \
dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[zz]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 454 of file vf_xfade.c.

◆ SLIDERIGHT_TRANSITION

#define SLIDERIGHT_TRANSITION (   name,
  type,
  div 
)
Value:
static void slideright##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int z = progress * width; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
const int zx = z + x; \
const int zz = zx % width + width * (zx < 0); \
dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[zz]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 487 of file vf_xfade.c.

◆ SLIDEUP_TRANSITION

#define SLIDEUP_TRANSITION (   name,
  type,
  div 
)
Value:
static void slideup##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = out->height; \
const int width = out->width; \
const int z = -progress * height; \
for (int p = 0; p < s->nb_planes; p++) { \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = slice_start; y < slice_end; y++) { \
const int zy = z + y; \
const int zz = zy % height + height * (zy < 0); \
const type *xf0 = (const type *)(a->data[p] + zz * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \
for (int x = 0; x < width; x++) { \
dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \
} \
\
dst += out->linesize[p] / div; \
} \
} \
}

Definition at line 520 of file vf_xfade.c.

◆ SLIDEDOWN_TRANSITION

#define SLIDEDOWN_TRANSITION (   name,
  type,
  div 
)
Value:
static void slidedown##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = out->height; \
const int width = out->width; \
const int z = progress * height; \
for (int p = 0; p < s->nb_planes; p++) { \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = slice_start; y < slice_end; y++) { \
const int zy = z + y; \
const int zz = zy % height + height * (zy < 0); \
const type *xf0 = (const type *)(a->data[p] + zz * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \
for (int x = 0; x < width; x++) { \
dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \
} \
\
dst += out->linesize[p] / div; \
} \
} \
}

Definition at line 552 of file vf_xfade.c.

◆ CIRCLECROP_TRANSITION

#define CIRCLECROP_TRANSITION (   name,
  type,
  div 
)
Value:
static void circlecrop##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const int height = out->height; \
float z = powf(2.f * fabsf(progress - 0.5f), 3.f) * hypotf(width/2, height/2); \
for (int p = 0; p < s->nb_planes; p++) { \
const int bg = s->black[p]; \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = slice_start; y < slice_end; y++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
for (int x = 0; x < width; x++) { \
float dist = hypotf(x - width / 2, y - height / 2); \
int val = progress < 0.5f ? xf1[x] : xf0[x]; \
dst[x] = (z < dist) ? bg : val; \
} \
\
dst += out->linesize[p] / div; \
} \
} \
}

Definition at line 584 of file vf_xfade.c.

◆ RECTCROP_TRANSITION

#define RECTCROP_TRANSITION (   name,
  type,
  div 
)
Value:
static void rectcrop##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const int height = out->height; \
int zh = fabsf(progress - 0.5f) * height; \
int zw = fabsf(progress - 0.5f) * width; \
for (int p = 0; p < s->nb_planes; p++) { \
const int bg = s->black[p]; \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = slice_start; y < slice_end; y++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
for (int x = 0; x < width; x++) { \
int dist = FFABS(x - width / 2) < zw && \
FFABS(y - height / 2) < zh; \
int val = progress < 0.5f ? xf1[x] : xf0[x]; \
dst[x] = !dist ? bg : val; \
} \
\
dst += out->linesize[p] / div; \
} \
} \
}

Definition at line 617 of file vf_xfade.c.

◆ DISTANCE_TRANSITION

#define DISTANCE_TRANSITION (   name,
  type,
  div 
)
Value:
static void distance##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const float max = s->max_value; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
float dist = 0.f; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
\
dist += (xf0[x] / max - xf1[x] / max) * \
(xf0[x] / max - xf1[x] / max); \
} \
\
dist = sqrtf(dist) <= progress; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
dst[x] = mix(mix(xf0[x], xf1[x], dist), xf1[x], progress); \
} \
} \
} \
}

Definition at line 652 of file vf_xfade.c.

◆ FADEBLACK_TRANSITION

#define FADEBLACK_TRANSITION (   name,
  type,
  div 
)
Value:
static void fadeblack##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const float phase = 0.2f; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
const int bg = s->black[p]; \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = mix(mix(xf0[x], bg, smoothstep(1.f-phase, 1.f, progress)), \
mix(bg, xf1[x], smoothstep(phase, 1.f, progress)), \
progress); \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 687 of file vf_xfade.c.

◆ FADEWHITE_TRANSITION

#define FADEWHITE_TRANSITION (   name,
  type,
  div 
)
Value:
static void fadewhite##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const float phase = 0.2f; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
const int bg = s->white[p]; \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = mix(mix(xf0[x], bg, smoothstep(1.f-phase, 1.f, progress)), \
mix(bg, xf1[x], smoothstep(phase, 1.f, progress)), \
progress); \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 721 of file vf_xfade.c.

◆ RADIAL_TRANSITION

#define RADIAL_TRANSITION (   name,
  type,
  div 
)
Value:
static void radial##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const int height = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = atan2f(x - width / 2, y - height / 2) - \
(progress - 0.5f) * (M_PI * 2.5f); \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 755 of file vf_xfade.c.

◆ SMOOTHLEFT_TRANSITION

#define SMOOTHLEFT_TRANSITION (   name,
  type,
  div 
)
Value:
static void smoothleft##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const float w = width; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = 1.f + x / w - progress * 2.f; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 783 of file vf_xfade.c.

◆ SMOOTHRIGHT_TRANSITION

#define SMOOTHRIGHT_TRANSITION (   name,
  type,
  div 
)
Value:
static void smoothright##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const float w = width; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = 1.f + (w - 1 - x) / w - progress * 2.f; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 811 of file vf_xfade.c.

◆ SMOOTHUP_TRANSITION

#define SMOOTHUP_TRANSITION (   name,
  type,
  div 
)
Value:
static void smoothup##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const float h = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
const float smooth = 1.f + y / h - progress * 2.f; \
for (int x = 0; x < width; x++) { \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 839 of file vf_xfade.c.

◆ SMOOTHDOWN_TRANSITION

#define SMOOTHDOWN_TRANSITION (   name,
  type,
  div 
)
Value:
static void smoothdown##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const float h = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
const float smooth = 1.f + (h - 1 - y) / h - progress * 2.f; \
for (int x = 0; x < width; x++) { \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 866 of file vf_xfade.c.

◆ CIRCLEOPEN_TRANSITION

#define CIRCLEOPEN_TRANSITION (   name,
  type,
  div 
)
Value:
static void circleopen##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const int height = out->height; \
const float z = hypotf(width / 2, height / 2); \
const float p = (progress - 0.5f) * 3.f; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = hypotf(x - width / 2, y - height / 2) / z + p; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf0[x], xf1[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 893 of file vf_xfade.c.

◆ CIRCLECLOSE_TRANSITION

#define CIRCLECLOSE_TRANSITION (   name,
  type,
  div 
)
Value:
static void circleclose##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const int height = out->height; \
const float z = hypotf(width / 2, height / 2); \
const float p = (1.f - progress - 0.5f) * 3.f; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = hypotf(x - width / 2, y - height / 2) / z + p; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 922 of file vf_xfade.c.

◆ VERTOPEN_TRANSITION

#define VERTOPEN_TRANSITION (   name,
  type,
  div 
)
Value:
static void vertopen##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
const float w2 = out->width / 2; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = 2.f - fabsf((x - w2) / w2) - progress * 2.f; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 951 of file vf_xfade.c.

◆ VERTCLOSE_TRANSITION

#define VERTCLOSE_TRANSITION (   name,
  type,
  div 
)
Value:
static void vertclose##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float w2 = out->width / 2; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = 1.f + fabsf((x - w2) / w2) - progress * 2.f; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 978 of file vf_xfade.c.

◆ HORZOPEN_TRANSITION

#define HORZOPEN_TRANSITION (   name,
  type,
  div 
)
Value:
static void horzopen##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float h2 = out->height / 2; \
for (int y = slice_start; y < slice_end; y++) { \
const float smooth = 2.f - fabsf((y - h2) / h2) - progress * 2.f; \
for (int x = 0; x < width; x++) { \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 1006 of file vf_xfade.c.

◆ HORZCLOSE_TRANSITION

#define HORZCLOSE_TRANSITION (   name,
  type,
  div 
)
Value:
static void horzclose##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float h2 = out->height / 2; \
for (int y = slice_start; y < slice_end; y++) { \
const float smooth = 1.f + fabsf((y - h2) / h2) - progress * 2.f; \
for (int x = 0; x < width; x++) { \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 1034 of file vf_xfade.c.

◆ DISSOLVE_TRANSITION

#define DISSOLVE_TRANSITION (   name,
  type,
  div 
)
Value:
static void dissolve##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = frand(x, y) * 2.f + progress * 2.f - 1.5f; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = smooth >= 0.5f ? xf0[x] : xf1[x]; \
} \
} \
} \
}

Definition at line 1069 of file vf_xfade.c.

◆ PIXELIZE_TRANSITION

#define PIXELIZE_TRANSITION (   name,
  type,
  div 
)
Value:
static void pixelize##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int w = out->width; \
const int h = out->height; \
const float d = fminf(progress, 1.f - progress); \
const float dist = ceilf(d * 50.f) / 50.f; \
const float sqx = 2.f * dist * FFMIN(w, h) / 20.f; \
const float sqy = 2.f * dist * FFMIN(w, h) / 20.f; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < w; x++) { \
int sx = dist > 0.f ? FFMIN((floorf(x / sqx) + .5f) * sqx, w - 1) : x; \
int sy = dist > 0.f ? FFMIN((floorf(y / sqy) + .5f) * sqy, h - 1) : y; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + sy * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + sy * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf0[sx], xf1[sx], progress); \
} \
} \
} \
}

Definition at line 1096 of file vf_xfade.c.

◆ DIAGTL_TRANSITION

#define DIAGTL_TRANSITION (   name,
  type,
  div 
)
Value:
static void diagtl##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float w = width; \
const float h = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = 1.f + x / w * y / h - progress * 2.f; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 1129 of file vf_xfade.c.

◆ DIAGTR_TRANSITION

#define DIAGTR_TRANSITION (   name,
  type,
  div 
)
Value:
static void diagtr##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float w = width; \
const float h = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = 1.f + (w - 1 - x) / w * y / h - progress * 2.f; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 1159 of file vf_xfade.c.

◆ DIAGBL_TRANSITION

#define DIAGBL_TRANSITION (   name,
  type,
  div 
)
Value:
static void diagbl##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float w = width; \
const float h = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = 1.f + x / w * (h - 1 - y) / h - progress * 2.f; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 1189 of file vf_xfade.c.

◆ DIAGBR_TRANSITION

#define DIAGBR_TRANSITION (   name,
  type,
  div 
)
Value:
static void diagbr##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float w = width; \
const float h = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = 1.f + (w - 1 - x) / w * (h - 1 - y) / h - \
progress * 2.f; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f, 1.f, smooth)); \
} \
} \
} \
}

Definition at line 1219 of file vf_xfade.c.

◆ HLSLICE_TRANSITION

#define HLSLICE_TRANSITION (   name,
  type,
  div 
)
Value:
static void hlslice##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float w = width; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float smooth = smoothstep(-0.5f, 0.f, x / w - progress * 1.5f); \
const float ss = smooth <= fract(10.f * x / w) ? 0.f : 1.f; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], ss); \
} \
} \
} \
}

Definition at line 1250 of file vf_xfade.c.

◆ HRSLICE_TRANSITION

#define HRSLICE_TRANSITION (   name,
  type,
  div 
)
Value:
static void hrslice##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float w = width; \
for (int y = slice_start; y < slice_end; y++) { \
for (int x = 0; x < width; x++) { \
const float xx = (w - 1 - x) / w; \
const float smooth = smoothstep(-0.5f, 0.f, xx - progress * 1.5f); \
const float ss = smooth <= fract(10.f * xx) ? 0.f : 1.f; \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], ss); \
} \
} \
} \
}

Definition at line 1280 of file vf_xfade.c.

◆ VUSLICE_TRANSITION

#define VUSLICE_TRANSITION (   name,
  type,
  div 
)
Value:
static void vuslice##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float h = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
const float smooth = smoothstep(-0.5f, 0.f, y / h - progress * 1.5f); \
const float ss = smooth <= fract(10.f * y / h) ? 0.f : 1.f; \
for (int x = 0; x < width; x++) { \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], ss); \
} \
} \
} \
}

Definition at line 1311 of file vf_xfade.c.

◆ VDSLICE_TRANSITION

#define VDSLICE_TRANSITION (   name,
  type,
  div 
)
Value:
static void vdslice##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int nb_planes = s->nb_planes; \
const int width = out->width; \
const float h = out->height; \
for (int y = slice_start; y < slice_end; y++) { \
const float yy = (h - 1 - y) / h; \
const float smooth = smoothstep(-0.5f, 0.f, yy - progress * 1.5f); \
const float ss = smooth <= fract(10.f * yy) ? 0.f : 1.f; \
for (int x = 0; x < width; x++) { \
for (int p = 0; p < nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], ss); \
} \
} \
} \
}

Definition at line 1341 of file vf_xfade.c.

◆ HBLUR_TRANSITION

#define HBLUR_TRANSITION (   name,
  type,
  div 
)

Definition at line 1372 of file vf_xfade.c.

◆ FADEGRAYS_TRANSITION

#define FADEGRAYS_TRANSITION (   name,
  type,
  div 
)

Definition at line 1417 of file vf_xfade.c.

◆ WIPETL_TRANSITION

#define WIPETL_TRANSITION (   name,
  type,
  div 
)
Value:
static void wipetl##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int zw = out->width * progress; \
const int zh = out->height * progress; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = slice_start + y <= zh && \
x <= zw ? xf0[x] : xf1[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 1487 of file vf_xfade.c.

◆ WIPETR_TRANSITION

#define WIPETR_TRANSITION (   name,
  type,
  div 
)
Value:
static void wipetr##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int zw = width * (1.f - progress); \
const int zh = out->height * progress; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = slice_start + y <= zh && \
x > zw ? xf0[x] : xf1[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 1520 of file vf_xfade.c.

◆ WIPEBL_TRANSITION

#define WIPEBL_TRANSITION (   name,
  type,
  div 
)
Value:
static void wipebl##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int zw = width * progress; \
const int zh = out->height * (1.f - progress); \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = slice_start + y > zh && \
x <= zw ? xf0[x] : xf1[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 1553 of file vf_xfade.c.

◆ WIPEBR_TRANSITION

#define WIPEBR_TRANSITION (   name,
  type,
  div 
)
Value:
static void wipebr##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int zh = out->height * (1.f - progress); \
const int width = out->width; \
const int zw = width * (1.f - progress); \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = slice_start + y > zh && \
x > zw ? xf0[x] : xf1[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 1586 of file vf_xfade.c.

◆ SQUEEZEH_TRANSITION

#define SQUEEZEH_TRANSITION (   name,
  type,
  div 
)

Definition at line 1619 of file vf_xfade.c.

◆ SQUEEZEV_TRANSITION

#define SQUEEZEV_TRANSITION (   name,
  type,
  div 
)

Definition at line 1657 of file vf_xfade.c.

◆ ZOOMIN_TRANSITION

#define ZOOMIN_TRANSITION (   name,
  type,
  div 
)

Definition at line 1702 of file vf_xfade.c.

◆ FADEFAST_TRANSITION

#define FADEFAST_TRANSITION (   name,
  type,
  div 
)
Value:
static void fadefast##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const float imax = 1.f / s->max_value; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = mix(xf0[x], xf1[x], powf(progress, 1.f + \
logf(1.f+FFABS(xf0[x]-xf1[x])*imax)\
)); \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 1741 of file vf_xfade.c.

◆ FADESLOW_TRANSITION

#define FADESLOW_TRANSITION (   name,
  type,
  div 
)
Value:
static void fadeslow##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const float imax = 1.f / s->max_value; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
dst[x] = mix(xf0[x], xf1[x], powf(progress, 1.f + \
logf(2.f-FFABS(xf0[x]-xf1[x])*imax)\
)); \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 1774 of file vf_xfade.c.

◆ HWIND_TRANSITION

#define HWIND_TRANSITION (   name,
  z,
  type,
  div,
  expr 
)
Value:
static void h##z##wind##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
for (int y = slice_start; y < slice_end; y++) { \
const float r = frand(0, y); \
for (int x = 0; x < width; x++) { \
const float fx = expr x / (float)width; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f,-0.2f, fx * (1.f - 0.2f)\
+ 0.2f * r - (1.f - progress)\
* (1.f + 0.2f))); \
} \
} \
} \
}

Definition at line 1807 of file vf_xfade.c.

◆ VWIND_TRANSITION

#define VWIND_TRANSITION (   name,
  z,
  type,
  div,
  expr 
)
Value:
static void v##z##wind##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int width = out->width; \
for (int y = slice_start; y < slice_end; y++) { \
const float fy = expr y / (float)out->height; \
for (int x = 0; x < width; x++) { \
const float r = frand(x, 0); \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
type *dst = (type *)(out->data[p] + y * out->linesize[p]); \
\
dst[x] = mix(xf1[x], xf0[x], smoothstep(0.f,-0.2f, fy * (1.f - 0.2f) \
+ 0.2f * r - (1.f - progress)\
* (1.f + 0.2f))); \
} \
} \
} \
}

Definition at line 1838 of file vf_xfade.c.

◆ COVERH_TRANSITION

#define COVERH_TRANSITION (   dir,
  name,
  type,
  div,
  expr 
)
Value:
static void cover##dir##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int z = (expr progress) * width; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
const int zx = z + x; \
const int zz = zx % width + width * (zx < 0); \
dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[x]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 1869 of file vf_xfade.c.

◆ COVERV_TRANSITION

#define COVERV_TRANSITION (   dir,
  name,
  type,
  div,
  expr 
)
Value:
static void cover##dir##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = out->height; \
const int width = out->width; \
const int z = (expr progress) * height; \
for (int p = 0; p < s->nb_planes; p++) { \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = slice_start; y < slice_end; y++) { \
const int zy = z + y; \
const int zz = zy % height + height * (zy < 0); \
const type *xf0 = (const type *)(a->data[p] + y * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \
for (int x = 0; x < width; x++) \
dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \
\
dst += out->linesize[p] / div; \
} \
} \
}

Definition at line 1904 of file vf_xfade.c.

◆ REVEALH_TRANSITION

#define REVEALH_TRANSITION (   dir,
  name,
  type,
  div,
  expr 
)
Value:
static void reveal##dir##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = slice_end - slice_start; \
const int width = out->width; \
const int z = (expr progress) * width; \
for (int p = 0; p < s->nb_planes; p++) { \
const type *xf0 = (const type *)(a->data[p] + slice_start * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + slice_start * b->linesize[p]); \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = 0; y < height; y++) { \
for (int x = 0; x < width; x++) { \
const int zx = z + x; \
const int zz = zx % width + width * (zx < 0); \
dst[x] = (zx >= 0) && (zx < width) ? xf1[x] : xf0[zz]; \
} \
\
dst += out->linesize[p] / div; \
xf0 += a->linesize[p] / div; \
xf1 += b->linesize[p] / div; \
} \
} \
}

Definition at line 1937 of file vf_xfade.c.

◆ REVEALV_TRANSITION

#define REVEALV_TRANSITION (   dir,
  name,
  type,
  div,
  expr 
)
Value:
static void reveal##dir##name##_transition(AVFilterContext *ctx, \
const AVFrame *a, const AVFrame *b, AVFrame *out, \
float progress, \
int slice_start, int slice_end, int jobnr) \
{ \
XFadeContext *s = ctx->priv; \
const int height = out->height; \
const int width = out->width; \
const int z = (expr progress) * height; \
for (int p = 0; p < s->nb_planes; p++) { \
type *dst = (type *)(out->data[p] + slice_start * out->linesize[p]); \
for (int y = slice_start; y < slice_end; y++) { \
const int zy = z + y; \
const int zz = zy % height + height * (zy < 0); \
const type *xf0 = (const type *)(a->data[p] + zz * a->linesize[p]); \
const type *xf1 = (const type *)(b->data[p] + y * b->linesize[p]); \
for (int x = 0; x < width; x++) \
dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \
\
dst += out->linesize[p] / div; \
} \
} \
}

Definition at line 1972 of file vf_xfade.c.

Enumeration Type Documentation

◆ XFadeTransitions

Enumerator
CUSTOM 
FADE 
WIPELEFT 
WIPERIGHT 
WIPEUP 
WIPEDOWN 
SLIDELEFT 
SLIDERIGHT 
SLIDEUP 
SLIDEDOWN 
CIRCLECROP 
RECTCROP 
DISTANCE 
FADEBLACK 
FADEWHITE 
RADIAL 
SMOOTHLEFT 
SMOOTHRIGHT 
SMOOTHUP 
SMOOTHDOWN 
CIRCLEOPEN 
CIRCLECLOSE 
VERTOPEN 
VERTCLOSE 
HORZOPEN 
HORZCLOSE 
DISSOLVE 
PIXELIZE 
DIAGTL 
DIAGTR 
DIAGBL 
DIAGBR 
HLSLICE 
HRSLICE 
VUSLICE 
VDSLICE 
HBLUR 
FADEGRAYS 
WIPETL 
WIPETR 
WIPEBL 
WIPEBR 
SQUEEZEH 
SQUEEZEV 
ZOOMIN 
FADEFAST 
FADESLOW 
HLWIND 
HRWIND 
VUWIND 
VDWIND 
COVERLEFT 
COVERRIGHT 
COVERUP 
COVERDOWN 
REVEALLEFT 
REVEALRIGHT 
REVEALUP 
REVEALDOWN 
NB_TRANSITIONS 
CUSTOM 
FADE 
WIPELEFT 
WIPERIGHT 
WIPEUP 
WIPEDOWN 
SLIDELEFT 
SLIDERIGHT 
SLIDEUP 
SLIDEDOWN 
NB_TRANSITIONS 
FADE 
WIPELEFT 
WIPERIGHT 
WIPEUP 
WIPEDOWN 
SLIDEDOWN 
SLIDEUP 
SLIDELEFT 
SLIDERIGHT 
CIRCLEOPEN 
CIRCLECLOSE 
DISSOLVE 
PIXELIZE 
WIPETL 
WIPETR 
WIPEBL 
WIPEBR 
NB_TRANSITIONS 

Definition at line 30 of file vf_xfade.c.

◆ anonymous enum

anonymous enum
Enumerator
VAR_X 
VAR_Y 
VAR_W 
VAR_H 
VAR_A 
VAR_B 
VAR_PLANE 
VAR_PROGRESS 
VAR_VARS_NB 

Definition at line 134 of file vf_xfade.c.

Function Documentation

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 161 of file vf_xfade.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( xfade  )

◆ mix()

static float mix ( float  a,
float  b,
float  mix 
)
inlinestatic

Definition at line 281 of file vf_xfade.c.

◆ fract()

static float fract ( float  a)
inlinestatic

Definition at line 286 of file vf_xfade.c.

◆ smoothstep()

static float smoothstep ( float  edge0,
float  edge1,
float  x 
)
inlinestatic

Definition at line 291 of file vf_xfade.c.

◆ frand()

static float frand ( int  x,
int  y 
)
static

Definition at line 1062 of file vf_xfade.c.

◆ zoom()

static void zoom ( float u,
float v,
float  amount 
)
static

Definition at line 1696 of file vf_xfade.c.

Referenced by activate(), filter_frame(), and output_single_frame().

◆ getpix()

static double getpix ( void *  priv,
double  x,
double  y,
int  plane,
int  nb 
)
inlinestatic

Definition at line 2005 of file vf_xfade.c.

Referenced by a0(), a1(), a2(), a3(), b0(), b1(), b2(), and b3().

◆ a0()

static double a0 ( void *  priv,
double  x,
double  y 
)
static

Definition at line 2029 of file vf_xfade.c.

Referenced by config_output().

◆ a1()

static double a1 ( void *  priv,
double  x,
double  y 
)
static

Definition at line 2030 of file vf_xfade.c.

Referenced by config_output().

◆ a2()

static double a2 ( void *  priv,
double  x,
double  y 
)
static

Definition at line 2031 of file vf_xfade.c.

Referenced by config_output().

◆ a3()

static double a3 ( void *  priv,
double  x,
double  y 
)
static

Definition at line 2032 of file vf_xfade.c.

Referenced by config_output().

◆ b0()

static double b0 ( void *  priv,
double  x,
double  y 
)
static

Definition at line 2034 of file vf_xfade.c.

Referenced by av_rescale_rnd(), biquad_process(), calc_lowcomp(), calc_lowcomp1(), cavs_idct8_add_c(), checkasm_check_synth_filter(), colorcontrast_slice16(), colorcontrast_slice16p(), colorcontrast_slice8(), colorcontrast_slice8p(), config_output(), extract_color(), ff_add_pixels_clamped_lasx(), ff_h264_idct8_add(), ff_ivi_recompose_haar(), ff_put_no_rnd_pixels_l2_msa(), ff_put_pixels_clamped_lasx(), ff_put_signed_pixels_clamped_lasx(), ff_simple_idct_add_lasx(), ff_simple_idct_lasx(), ff_simple_idct_put_lasx(), filter_channels(), filter_frame(), filter_horizontally(), filter_samples(), generate_noise(), horizontal_compose_daub97i_TMPL(), idct_col(), idct_row(), idctRowCondDC(), idctSparseCol(), idctSparseColAdd(), idctSparseColPut(), kaiser_beta(), set_ap(), set_highshelf_rbj(), set_hp(), set_lp(), set_params(), set_tf1s(), snow_vertical_compose97i(), spatial_compose53i_dy(), spatial_compose53i_dy_buffered(), spatial_compose97i_dy(), spatial_compose97i_dy_buffered(), spatial_compose_haari_dy_TMPL(), spatial_decompose53i(), spatial_decompose97i(), vb_stereo(), vertical_compose53iH0(), vertical_compose53iL0(), vertical_compose53iL0_TMPL(), vertical_compose97iH0(), vertical_compose97iH1(), vertical_compose97iL0(), vertical_compose97iL1(), vertical_compose_daub97iH0_TMPL(), vertical_compose_daub97iH1_TMPL(), vertical_compose_daub97iL0_TMPL(), vertical_compose_daub97iL1_TMPL(), vertical_compose_dd137iL0_TMPL(), vertical_compose_dd97iH0_TMPL(), vertical_compose_dirac53iH0_TMPL(), vertical_compose_fidelityiH0_TMPL(), vertical_compose_fidelityiL0_TMPL(), vertical_compose_haar_TMPL(), vertical_decompose53iH0(), vertical_decompose53iL0(), vertical_decompose97iH0(), vertical_decompose97iH1(), vertical_decompose97iL0(), vertical_decompose97iL1(), yuv2rgb_full_2_template_lasx(), and yuv2rgb_full_2_template_lsx().

◆ b1()

static double b1 ( void *  priv,
double  x,
double  y 
)
static

Definition at line 2035 of file vf_xfade.c.

Referenced by av_adler32_update(), av_rescale_rnd(), biquad_process(), calc_lowcomp(), calc_lowcomp1(), cavs_idct8_add_c(), checkasm_check_synth_filter(), colorcontrast_slice16(), colorcontrast_slice16p(), colorcontrast_slice8(), colorcontrast_slice8p(), config_input(), config_output(), dct4x4(), decode_dlta(), decode_hq_slice(), decode_move(), decode_predictor_coeffs(), decode_subband(), extract_color(), ff_add_pixels_clamped_lasx(), ff_eval_coefs(), ff_h264_idct8_add(), ff_ivi_recompose_haar(), ff_put_no_rnd_pixels_l2_msa(), ff_put_pixels_clamped_lasx(), ff_put_signed_pixels_clamped_lasx(), ff_simple_idct_add_lasx(), ff_simple_idct_lasx(), ff_simple_idct_put_lasx(), ff_vp8_luma_dc_wht_msa(), filter_channels(), filter_frame(), filter_horizontally(), filter_samples(), horizontal_compose_daub97i_TMPL(), icc_context(), idct_col(), idct_row(), idctRowCondDC(), idctSparseCol(), idctSparseColAdd(), idctSparseColPut(), kaiser_beta(), parse_chunk_headers(), residue_encode(), rgb24_to_yuv420p(), run_test(), search_for_ms(), set_ap(), set_hp(), set_lp(), set_params(), set_tf1s(), snow_vertical_compose97i(), spatial_compose53i_dy(), spatial_compose53i_dy_buffered(), spatial_compose97i_dy(), spatial_compose97i_dy_buffered(), spatial_compose_haari_dy_TMPL(), spatial_decompose53i(), spatial_decompose97i(), vb_stereo(), vertical_compose53iH0(), vertical_compose53iL0(), vertical_compose53iL0_TMPL(), vertical_compose97iH0(), vertical_compose97iH1(), vertical_compose97iL0(), vertical_compose97iL1(), vertical_compose_daub97iH0_TMPL(), vertical_compose_daub97iH1_TMPL(), vertical_compose_daub97iL0_TMPL(), vertical_compose_daub97iL1_TMPL(), vertical_compose_dd137iL0_TMPL(), vertical_compose_dd97iH0_TMPL(), vertical_compose_dirac53iH0_TMPL(), vertical_compose_fidelityiH0_TMPL(), vertical_compose_fidelityiL0_TMPL(), vertical_compose_haar_TMPL(), vertical_decompose53iH0(), vertical_decompose53iL0(), vertical_decompose97iH0(), vertical_decompose97iH1(), vertical_decompose97iL0(), vertical_decompose97iL1(), wht4x4(), yuv2rgb_full_2_template_lasx(), and yuv2rgb_full_2_template_lsx().

◆ b2()

static double b2 ( void *  priv,
double  x,
double  y 
)
static

Definition at line 2036 of file vf_xfade.c.

Referenced by av_adler32_update(), biquad_process(), cavs_idct8_add_c(), colorcontrast_slice16(), colorcontrast_slice16p(), colorcontrast_slice8(), colorcontrast_slice8p(), compare_by_prob(), config_input(), config_output(), decode_dlta(), decode_move(), decode_predictor_coeffs(), decode_subband(), ff_add_pixels_clamped_lasx(), ff_eval_coefs(), ff_h264_idct8_add(), ff_ivi_recompose_haar(), ff_put_no_rnd_pixels_l2_msa(), ff_put_pixels_clamped_lasx(), ff_put_signed_pixels_clamped_lasx(), ff_simple_idct_add_lasx(), ff_simple_idct_lasx(), ff_simple_idct_put_lasx(), filter_channels(), filter_frame(), filter_samples(), horizontal_compose_daub97i_TMPL(), icc_context(), idct_col(), idct_row(), idctRowCondDC(), idctSparseCol(), idctSparseColAdd(), idctSparseColPut(), parse_chunk_headers(), qoi_decode_frame(), qpel_motion_search(), residue_encode(), run_test(), search_for_ms(), set_ap(), set_hp(), set_lp(), set_params(), snow_vertical_compose97i(), spatial_compose53i_dy(), spatial_compose53i_dy_buffered(), spatial_compose97i_dy(), spatial_compose97i_dy_buffered(), spatial_decompose53i(), spatial_decompose97i(), vertical_compose53iH0(), vertical_compose53iL0(), vertical_compose53iL0_TMPL(), vertical_compose97iH0(), vertical_compose97iH1(), vertical_compose97iL0(), vertical_compose97iL1(), vertical_compose_daub97iH0_TMPL(), vertical_compose_daub97iH1_TMPL(), vertical_compose_daub97iL0_TMPL(), vertical_compose_daub97iL1_TMPL(), vertical_compose_dd137iL0_TMPL(), vertical_compose_dd97iH0_TMPL(), vertical_compose_dirac53iH0_TMPL(), vertical_compose_fidelityiH0_TMPL(), vertical_compose_fidelityiL0_TMPL(), vertical_decompose53iH0(), vertical_decompose53iL0(), vertical_decompose97iH0(), vertical_decompose97iH1(), vertical_decompose97iL0(), and vertical_decompose97iL1().

◆ b3()

static double b3 ( void *  priv,
double  x,
double  y 
)
static

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 2039 of file vf_xfade.c.

◆ xfade_slice()

static int xfade_slice ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 2189 of file vf_xfade.c.

Referenced by xfade_frame().

◆ xfade_frame()

static int xfade_frame ( AVFilterContext ctx,
AVFrame a,
AVFrame b 
)
static

Definition at line 2202 of file vf_xfade.c.

Referenced by xfade_activate().

◆ forward_frame()

static int forward_frame ( XFadeContext s,
AVFilterLink inlink,
AVFilterLink outlink 
)
static

Definition at line 2224 of file vf_xfade.c.

Referenced by xfade_activate().

◆ xfade_activate()

static int xfade_activate ( AVFilterContext avctx)
static

Definition at line 2262 of file vf_xfade.c.

◆ get_video_buffer()

static AVFrame* get_video_buffer ( AVFilterLink inlink,
int  w,
int  h 
)
static

Definition at line 2352 of file vf_xfade.c.

Variable Documentation

◆ var_names

const char* const var_names[] = { "X", "Y", "W", "H", "A", "B", "PLANE", "P", NULL }
static

Definition at line 133 of file vf_xfade.c.

Referenced by config_output().

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

◆ xfade_options

const AVOption xfade_options[]
static

Definition at line 171 of file vf_xfade.c.

◆ xfade_inputs

const AVFilterPad xfade_inputs[]
static
Initial value:
= {
{
.name = "main",
.get_buffer.video = get_video_buffer,
},
{
.name = "xfade",
.get_buffer.video = get_video_buffer,
},
}

Definition at line 2361 of file vf_xfade.c.

◆ xfade_outputs

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

Definition at line 2374 of file vf_xfade.c.

◆ ff_vf_xfade

const AVFilter ff_vf_xfade
Initial value:
= {
.name = "xfade",
.description = NULL_IF_CONFIG_SMALL("Cross fade one video with another video."),
.priv_size = sizeof(XFadeContext),
.priv_class = &xfade_class,
}

Definition at line 2382 of file vf_xfade.c.

pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_xfade.c:142
AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:491
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
r
const char * r
Definition: vf_curves.c:126
out
FILE * out
Definition: movenc.c:54
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:172
floorf
static __device__ float floorf(float a)
Definition: cuda_runtime.h:172
atan2f
#define atan2f(y, x)
Definition: libm.h:45
xfade_activate
static int xfade_activate(AVFilterContext *avctx)
Definition: vf_xfade.c:2262
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:340
w
uint8_t w
Definition: llviddspenc.c:38
get_video_buffer
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
Definition: vf_xfade.c:2352
b
#define b
Definition: input.c:41
max
#define max(a, b)
Definition: cuda_runtime.h:33
mix
static float mix(float a, float b, float mix)
Definition: vf_xfade.c:281
ceilf
static __device__ float ceilf(float a)
Definition: cuda_runtime.h:175
AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:486
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:484
AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:513
val
static double val(void *priv, double ch)
Definition: aeval.c:78
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:452
ss
#define ss(width, name, subs,...)
Definition: cbs_vp9.c:202
fabsf
static __device__ float fabsf(float a)
Definition: cuda_runtime.h:181
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:471
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:488
float
float
Definition: af_crystalizer.c:121
width
#define width
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:489
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:481
smoothstep
static float smoothstep(float edge0, float edge1, float x)
Definition: vf_xfade.c:291
slice_end
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
Definition: mpeg12dec.c:1979
fminf
float fminf(float, float)
AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:510
ctx
AVFormatContext * ctx
Definition: movenc.c:48
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
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
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:65
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:449
AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:487
activate
filter_frame For filters that do not use the activate() callback
sqrtf
static __device__ float sqrtf(float a)
Definition: cuda_runtime.h:184
xfade_inputs
static const AVFilterPad xfade_inputs[]
Definition: vf_xfade.c:2361
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:483
xfade_outputs
static const AVFilterPad xfade_outputs[]
Definition: vf_xfade.c:2374
XFadeContext
Definition: vf_xfade.c:93
f
f
Definition: af_crystalizer.c:121
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:106
powf
#define powf(x, y)
Definition: libm.h:50
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_xfade.c:161
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:475
height
#define height
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
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_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:508
frand
static float frand(int x, int y)
Definition: vf_xfade.c:1062
M_PI
#define M_PI
Definition: mathematics.h:67
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_xfade.c:2039
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:485
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
fade
static void fade(uint8_t *dst, ptrdiff_t dst_linesize, const uint8_t *src, ptrdiff_t src_linesize, int width, int height, int alpha, int beta)
Definition: vp8.c:513
fract
static float fract(float a)
Definition: vf_xfade.c:286
AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:505
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
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
AVFilterContext
An instance of a filter.
Definition: avfilter.h:397
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
smooth
static float smooth(DeshakeOpenCLContext *deshake_ctx, float *gauss_kernel, int length, float max_val, AVFifo *values)
Definition: vf_deshake_opencl.c:888
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
d
d
Definition: ffmpeg_filter.c:368
distance
static float distance(float x, float y, int band)
Definition: nellymoserenc.c:230
h
h
Definition: vp9dsp_template.c:2038
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:478
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:450