From patchwork Mon Jan 4 00:28:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24769 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 C127044907C for ; Mon, 4 Jan 2021 02:28:55 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A92D668A9BE; Mon, 4 Jan 2021 02:28:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D62066804E0 for ; Mon, 4 Jan 2021 02:28:53 +0200 (EET) Received: by mail-wr1-f53.google.com with SMTP id t30so30385790wrb.0 for ; Sun, 03 Jan 2021 16:28:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=Vh4XlLv6N6EWZQ0mZmZuytddri0IUcu6yaiGVqoTOXM=; b=AuPRTpmgFTjBKF8AbuvLmeCz89AzT8ALjkBFAd0/NVTYM1Yc5gJ4AZCa8J4ZFunhCL Pnib1ZTtgVl6/bdeZKs7h0Eg4JPnGNx3/UTmRcnvcRGwptHxjRSQpz489f+U33Ij+afu UCqFH3IuFUqPOuMd6UlWbCU/eW3UX/+o9RngHMcbrrRyEFX9sVraScGCQbD26efucLQ5 +YfKv037dr2BJLcH38s1ni23gYDb9S6G0HRQfWc2w72Fdgy/RD4OZ7u7LuIw4qUgcWGo EFqSgCRNMYbX7KEh8m9BVwsaSnixbOjNrQj28c+YCjPuNhhphoZq1TmKSQBYO6ETj2Bx g3dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=Vh4XlLv6N6EWZQ0mZmZuytddri0IUcu6yaiGVqoTOXM=; b=Te5zok4hPcfgehx2/fi1KGeJs77DFASeiyDMNYBloNIoQ0znZMfzEUm0T/Z2i4fpVN BUruziRbx8QEd0GtgnRy/OOc1OFQtJX//3cwBofy+L4hmYMBQl9d64u47L9oyw1lfDRH MlzPP8+Xb2rvJBGaIRMh6dC4dYkaKJZn1Eps00sy+PzxBbvhEXKWa8itZgiJoXz6Vaa+ mlGWwxdHH3q1zm6ITpLCp7++rz6KTQik2jk50p1ncwv3fkJwi3l0viFvLK4bn9+iErqO 0U39tBGQ8Hk8KWQO9yY3NrMAnd2jFwuGnxlzOKWtpUuQizpIGBcSYYGVuzfeJKolIpbl jJXw== X-Gm-Message-State: AOAM532ooyyVNkpo617LMSAbl+jPmUcy9VQqlrlT6W6rv5qKmXwTL0FG 4s+TDbjGNF7iAVIBGLxJlsJ2j76U3hY= X-Google-Smtp-Source: ABdhPJw6JX7BFY8uHDl9MFl9FOT4zT4vdFQZTpZxMqt1jcEOp25mMa8rrmoLzk+LO+KctdLRZ3oZ7g== X-Received: by 2002:a5d:660c:: with SMTP id n12mr78931830wru.291.1609720133146; Sun, 03 Jan 2021 16:28:53 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id u26sm30032046wmm.24.2021.01.03.16.28.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 16:28:52 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Jan 2021 01:28:06 +0100 Message-Id: <20210104002816.2321974-6-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210104002816.2321974-1-andreas.rheinhardt@gmail.com> References: <20210104002816.2321974-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/16] avfilter/vf_qp: Deduplicate variable names arrays 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This also avoids relocations. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_qp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_qp.c b/libavfilter/vf_qp.c index af46fe0ece..e2d60fdbb5 100644 --- a/libavfilter/vf_qp.c +++ b/libavfilter/vf_qp.c @@ -38,6 +38,8 @@ typedef struct QPContext { int evaluate_per_mb; } QPContext; +static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL }; + #define OFFSET(x) offsetof(QPContext, x) #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM @@ -55,7 +57,6 @@ static int config_input(AVFilterLink *inlink) int i; int ret; AVExpr *e = NULL; - static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL }; if (!s->qp_expr_str) return 0; @@ -144,7 +145,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVVideoBlockParams *b = av_video_enc_params_block(par_out, block_idx); int qp = sd_in ? in_qp_global + BLOCK_QP_DELTA(block_idx) : NAN; double var_values[] = { !!sd_in, qp, x, y, s->qstride, s->h, 0}; - static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL }; double temp_val; ret = av_expr_parse_and_eval(&temp_val, s->qp_expr_str,