diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-30 11:51:17 +0400 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-07-01 14:14:16 +0400 |
commit | 7464a53aaa5a241858ffbcb0194d3fc44a7aa441 (patch) | |
tree | dd17645623fb10135a6ded42bdb262a41841e53c /libavfilter/vf_lut.c | |
parent | 518d8d436566e6260d73346cd999ff69eeb94e49 (diff) |
lavfi: make pix_fmt_is_in() in vf_lut.c an internal function
Also generalize it, making it accept ints rather than pixel formats.
Allow factorization.
Diffstat (limited to 'libavfilter/vf_lut.c')
-rw-r--r-- | libavfilter/vf_lut.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index fdab6941a4..8607ee906c 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -28,6 +28,7 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "avfilter.h" +#include "internal.h" static const char *var_names[] = { "E", @@ -165,16 +166,6 @@ static int query_formats(AVFilterContext *ctx) return 0; } -static int pix_fmt_is_in(enum PixelFormat pix_fmt, enum PixelFormat *pix_fmts) -{ - enum PixelFormat *p; - for (p = pix_fmts; *p != PIX_FMT_NONE; p++) { - if (pix_fmt == *p) - return 1; - } - return 0; -} - /** * Clip value val in the minval - maxval range. */ @@ -245,8 +236,8 @@ static int config_props(AVFilterLink *inlink) } lut->is_yuv = lut->is_rgb = 0; - if (pix_fmt_is_in(inlink->format, yuv_pix_fmts)) lut->is_yuv = 1; - else if (pix_fmt_is_in(inlink->format, rgb_pix_fmts)) lut->is_rgb = 1; + if (ff_fmt_is_in(inlink->format, yuv_pix_fmts)) lut->is_yuv = 1; + else if (ff_fmt_is_in(inlink->format, rgb_pix_fmts)) lut->is_rgb = 1; if (lut->is_rgb) { switch (inlink->format) { |