From patchwork Fri Dec 6 16:18:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 16639 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id DCD58446116 for ; Fri, 6 Dec 2019 18:28:03 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B8F0568B623; Fri, 6 Dec 2019 18:28:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-3.mx.upcmail.net (vie01a-dmta-pe01-3.mx.upcmail.net [62.179.121.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5336668B5BC for ; Fri, 6 Dec 2019 18:27:57 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1idGLz-00005H-0V for ffmpeg-devel@ffmpeg.org; Fri, 06 Dec 2019 17:21:15 +0100 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id dGL1i6C4CwlysdGL1ihf8I; Fri, 06 Dec 2019 17:20:15 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=E5OzWpVl c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=SM3fgze9InTXZf-NtBkA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 6 Dec 2019 17:18:17 +0100 Message-Id: <20191206161818.25008-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191206161818.25008-1-michael@niedermayer.cc> References: <20191206161818.25008-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfCi8OZmD88G0K1dRWj+hoK8FL7kzz8TG4d0K2XQOMSTQ7IUa+QnPDzjhleUxFFNsXMbRIKPO7PvyzB0t+mxXQAJuCJoV06PKdXnrUKNoIn5FmEhejnMZ uNDf2q7EPe15CJwH70JOYFvmTEyRMvPdsFTWV/z8o/7IvShkdo11SNl5 Subject: [FFmpeg-devel] [PATCH 2/3] avfilter/vf_geq: Add NB_PLANES X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavfilter/vf_geq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c index e3267e331f..c965204a1c 100644 --- a/libavfilter/vf_geq.c +++ b/libavfilter/vf_geq.c @@ -33,6 +33,8 @@ #include "libavutil/pixdesc.h" #include "internal.h" +#define NB_PLANES 4 + enum InterpolationMethods { INTERP_NEAREST, INTERP_BILINEAR, @@ -44,7 +46,7 @@ enum { VAR_X, VAR_Y, VAR_W, VAR_H, VAR_N, VAR_ typedef struct GEQContext { const AVClass *class; - AVExpr *e[4]; ///< expressions for each plane + AVExpr *e[NB_PLANES]; ///< expressions for each plane char *expr_str[4+3]; ///< expression strings for each plane AVFrame *picref; ///< current input buffer uint8_t *dst; ///< reference pointer to the 8bits output @@ -188,7 +190,7 @@ static av_cold int geq_init(AVFilterContext *ctx) goto end; } - for (plane = 0; plane < 4; plane++) { + for (plane = 0; plane < NB_PLANES; plane++) { static double (*p[])(void *, double, double) = { lum, cb, cr, alpha }; 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 };