[FFmpeg-devel] [PATCH] lavfi/geq: add more consistent form for alpha function

Stefano Sabatini stefasab at gmail.com
Mon May 20 11:41:03 CEST 2013


Use a short form, consistent with the other component accessor functions.
---
 doc/filters.texi     |    2 +-
 libavfilter/vf_geq.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 2475e00..98456df 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4077,7 +4077,7 @@ red-difference chroma plane. Return 0 if there is no such plane.
 Return the value of the pixel at location (@var{x}, at var{y}) of the
 red/green/blue component. Return 0 if there is no such component.
 
- at item alpha(x, y)
+ at item alpha(x, y), a(x, y)
 Return the value of the pixel at location (@var{x}, at var{y}) of the alpha
 plane. Return 0 if there is no such plane.
 @end table
diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c
index 64f651b..16339ab 100644
--- a/libavfilter/vf_geq.c
+++ b/libavfilter/vf_geq.c
@@ -147,10 +147,10 @@ static av_cold int geq_init(AVFilterContext *ctx)
 
     for (plane = 0; plane < 4; plane++) {
         static double (*p[])(void *, double, double) = { c0, c1, c2, c3 };
-        static const char *const func2_yuv_names[]    = { "lum", "cb", "cr", "alpha", "p", NULL };
-        static const char *const func2_rgb_names[]    = { "g", "b", "r", "alpha", "p", NULL };
+        static const char *const func2_yuv_names[]    = { "lum", "cb", "cr", "a", "alpha", "p", NULL };
+        static const char *const func2_rgb_names[]    = { "g",   "b",  "r",  "a", "alpha", "p", NULL };
         const char *const *func2_names       = geq->is_rgb ? func2_rgb_names : func2_yuv_names;
-        double (*func2[])(void *, double, double) = { c0, c1, c2, c3, p[plane], NULL };
+        double (*func2[])(void *, double, double) = { c0, c1, c2, c3, c3, p[plane], NULL };
 
         ret = av_expr_parse(&geq->e[plane], geq->expr_str[plane < 3 && geq->is_rgb ? plane+4 : plane], var_names,
                             NULL, NULL, func2_names, func2, 0, ctx);
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list