47 #define OFFSET(x) offsetof(GEQContext, x)
48 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
70 static inline double getpix(
void *priv,
double x,
double y,
int plane)
76 const int linesize = picref->
linesize[plane];
83 xi = x = av_clipf(x, 0, w - 2);
84 yi = y = av_clipf(y, 0, h - 2);
89 return (1-y)*((1-x)*src[xi + yi * linesize] + x*src[xi + 1 + yi * linesize])
90 + y *((1-x)*src[xi + (yi+1) * linesize] + x*src[xi + 1 + (yi+1) * linesize]);
95 static double lum(
void *priv,
double x,
double y) {
return getpix(priv, x, y, 0); }
96 static double cb(
void *priv,
double x,
double y) {
return getpix(priv, x, y, 1); }
97 static double cr(
void *priv,
double x,
double y) {
return getpix(priv, x, y, 2); }
98 static double alpha(
void *priv,
double x,
double y) {
return getpix(priv, x, y, 3); }
100 static const char *
const var_names[] = {
"X",
"Y",
"W",
"H",
"N",
"SW",
"SH",
"T", NULL };
148 for (plane = 0; plane < 4; plane++) {
149 static double (*p[])(
void *, double, double) = {
lum,
cb,
cr,
alpha };
150 static const char *
const func2_yuv_names[] = {
"lum",
"cb",
"cr",
"alpha",
"p", NULL };
151 static const char *
const func2_rgb_names[] = {
"g",
"b",
"r",
"alpha",
"p", NULL };
152 const char *
const *func2_names = geq->
is_rgb ? func2_rgb_names : func2_yuv_names;
153 double (*func2[])(
void *, double, double) = {
lum,
cb,
cr,
alpha, p[plane], NULL };
156 NULL, NULL, func2_names, func2, 0, ctx);
216 for (plane = 0; plane < geq->
planes && out->
data[plane]; plane++) {
219 const int linesize = out->
linesize[plane];
225 values[
VAR_SW] = w / (double)inlink->
w;
226 values[
VAR_SH] = h / (
double)inlink->
h;
228 for (y = 0; y < h; y++) {
230 for (x = 0; x < w; x++) {
278 .priv_class = &geq_class,