From patchwork Wed Sep 29 00:44:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 30654 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp5761358iob; Tue, 28 Sep 2021 17:45:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDaNPPMhL1muyTeUVTc1UG/o1K95llRowo+3AwvHydRDHJ4WKIOXkBFjdeXjzMIwI84eV0 X-Received: by 2002:a17:906:850f:: with SMTP id i15mr10161857ejx.401.1632876305977; Tue, 28 Sep 2021 17:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632876305; cv=none; d=google.com; s=arc-20160816; b=wlly3R3UkHfQ67u2k2Pj1A6xYNKJo/Ojv0hh0+1Dj15P5Znq0G1EDrbSZ6mHczpF7r A+aelrvqk66NGOvCfUA3U6NWow6UiseqHgwNMhaFHYTlqCp5JrS37okAfcfm8rqeejFW NliIiH4ajI5O7jZz4y5z09eXKaS+keb6M8zcbgPoD8aWcOhzrKs8L6AadvWWb077bQ+D JQ8McvPNvgYLDmGCBLy2FBw7yRVh4+CWAo0YLN88O9QIL7nCuEaN1B88k1UXoCCW5b7t d/7cDITF65R3o3w2CP75KianNoPWgE4vp431/9kEHwKgo+YBY+vPDr4pTeqFxk17az4R nrnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=gsch1t+2ZS3b0wvqu0IB1g4QJDUdVw7HajvJDIrVUts=; b=gtj6HhK+gr/u+7LVKdGB9/Elv9515vUf1qK3TROmivuiSQLhtDEpmBkKGn2xxfuitO OX0EnF8IivmPYlJBX+5tGhAIK2sWsM8zaD+IOb7nXdhGw5QdHEISlEsfESjThpKIgZ3B +fHcAHRWCRgdAr8JcYeaX2IumHnpRfUUQQ8j3g91Bqlcr0s+4NrD/h2Yruwxt2JlZELz 4ocCUGPBEx7DYfEDWnV1WR0/ejt4EbEWNTd0B2eepng07gY6fzjINN1ISAeVwjisgUtm gyGO0fNnYEIiR32mQycR1AT+hXRKn/c/qO4RJYA3rPOjiJzMai/vwfQ+nc5BFlQRBVXw PBwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=POQOwVwC; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v21si692132edd.616.2021.09.28.17.45.05; Tue, 28 Sep 2021 17:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=POQOwVwC; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DB7116898A6; Wed, 29 Sep 2021 03:45:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA08E6898A6 for ; Wed, 29 Sep 2021 03:44:54 +0300 (EEST) Received: by mail-qt1-f175.google.com with SMTP id c20so788397qtb.2 for ; Tue, 28 Sep 2021 17:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=iGBdNI2WEiKdqEw4JWXBaZ9I0ZMiEwIW4zXQVeyP0/k=; b=POQOwVwCpNZ81QVzeCfeJ+FdXYoVGnzHNNgio1diVBO4LImo7VIt2dJ0LDahFsD3sQ EtqFeqVqlpdUauDoM2IOSQKEo6iClfqsg/yZ1qPfdXlfIBSM0FtCzYYZWKfN3NoKntvu n1HsOWnRh5nxsr5osn4XcVpp5FAWnUS0NFG0vg/r+G0gU/SRDmh+urOFrJw6q5R02Z6l SQXilXCtbBNTf74dF1L7qH44YOQM0Ldb7ttaItisNSIJfbknyGARpOJmZpHUhsgm78Ff DOFQKOgpo8Hp6IzoqILbRvnB+8Mh1Kzbef2eAIVNJdc3MQzs0PySYaZpvWX725eGDEZL tx/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=iGBdNI2WEiKdqEw4JWXBaZ9I0ZMiEwIW4zXQVeyP0/k=; b=Yusu5+g5Y9q6NefEoBl59g54aS9GQaxKmGUCsmqd3q5nnJzdJ+Drsn7pXCSC2HugDc 0iSW9lCQt/H5If+qHMKijt2UROcQNCLgIJav9JqfF8Ac158Pb/6vYkryV+EZgs5A4Qg0 wTIuRWz5hmxXTL9NE8Xu7xHo3d6jMHbsL+JX0hV3xXNp87oFrlevy3iEU0gErQ/2q/vn Kjpnlpnp/rAl7F1O6dXNg9kpjuC6HySE/5ccM0oWB4ZE8tdOWvcLY/ul2RA9w03zKV2g HxfKjOImsTWYoSlwBWFyJA0OVpnR1ap4f8s63PQAwhnon1bdgA5XrrmGeJSnX0cEsjfm 0TzA== X-Gm-Message-State: AOAM531SPQlF7FHIhz2jeu+CnENISWmc1PH+1vcKl0cWzObmtRxCWu/f mqA+4OT36rj8/eiEg6mQNXpX8+ZUTP0= X-Received: by 2002:ac8:1011:: with SMTP id z17mr9100294qti.388.1632876293035; Tue, 28 Sep 2021 17:44:53 -0700 (PDT) Received: from localhost.localdomain ([191.84.250.156]) by smtp.gmail.com with ESMTPSA id r139sm570770qke.84.2021.09.28.17.44.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 17:44:52 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Sep 2021 21:44:23 -0300 Message-Id: <20210929004423.17677-1-jamrial@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter/vf_floodfill: constify the AVFrame parameter in is_same() and pick_pixel() functions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: 24t6uyw7CqiR Signed-off-by: James Almer --- libavfilter/vf_floodfill.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libavfilter/vf_floodfill.c b/libavfilter/vf_floodfill.c index 21741cdb4f..5f2a4f4392 100644 --- a/libavfilter/vf_floodfill.c +++ b/libavfilter/vf_floodfill.c @@ -42,11 +42,11 @@ typedef struct FloodfillContext { int back, front; Points *points; - int (*is_same)(AVFrame *frame, int x, int y, + int (*is_same)(const AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3); void (*set_pixel)(AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3); - void (*pick_pixel)(AVFrame *frame, int x, int y, + void (*pick_pixel)(const AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3); } FloodfillContext; @@ -57,7 +57,7 @@ static int is_inside(int x, int y, int w, int h) return 0; } -static int is_same4(AVFrame *frame, int x, int y, +static int is_same4(const AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3) { unsigned c0 = frame->data[0][y * frame->linesize[0] + x]; @@ -70,7 +70,7 @@ static int is_same4(AVFrame *frame, int x, int y, return 0; } -static int is_same4_16(AVFrame *frame, int x, int y, +static int is_same4_16(const AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3) { unsigned c0 = AV_RN16(frame->data[0] + y * frame->linesize[0] + 2 * x); @@ -83,7 +83,7 @@ static int is_same4_16(AVFrame *frame, int x, int y, return 0; } -static int is_same3(AVFrame *frame, int x, int y, +static int is_same3(const AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3) { unsigned c0 = frame->data[0][y * frame->linesize[0] + x]; @@ -95,7 +95,7 @@ static int is_same3(AVFrame *frame, int x, int y, return 0; } -static int is_same3_16(AVFrame *frame, int x, int y, +static int is_same3_16(const AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3) { unsigned c0 = AV_RN16(frame->data[0] + y * frame->linesize[0] + 2 * x); @@ -107,7 +107,7 @@ static int is_same3_16(AVFrame *frame, int x, int y, return 0; } -static int is_same1(AVFrame *frame, int x, int y, +static int is_same1(const AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3) { unsigned c0 = frame->data[0][y * frame->linesize[0] + x]; @@ -117,7 +117,7 @@ static int is_same1(AVFrame *frame, int x, int y, return 0; } -static int is_same1_16(AVFrame *frame, int x, int y, +static int is_same1_16(const AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3) { unsigned c0 = AV_RN16(frame->data[0] + y * frame->linesize[0] + 2 * x); @@ -173,21 +173,21 @@ static void set_pixel4_16(AVFrame *frame, int x, int y, AV_WN16(frame->data[3] + y * frame->linesize[3] + 2 * x, d3); } -static void pick_pixel1(AVFrame *frame, int x, int y, +static void pick_pixel1(const AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3) { if (*s0 < 0) *s0 = frame->data[0][y * frame->linesize[0] + x]; } -static void pick_pixel1_16(AVFrame *frame, int x, int y, +static void pick_pixel1_16(const AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3) { if (*s0 < 0) *s0 = AV_RN16(frame->data[0] + y * frame->linesize[0] + 2 * x); } -static void pick_pixel3(AVFrame *frame, int x, int y, +static void pick_pixel3(const AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3) { if (*s0 < 0) @@ -198,7 +198,7 @@ static void pick_pixel3(AVFrame *frame, int x, int y, *s2 = frame->data[2][y * frame->linesize[2] + x]; } -static void pick_pixel3_16(AVFrame *frame, int x, int y, +static void pick_pixel3_16(const AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3) { if (*s0 < 0) @@ -209,7 +209,7 @@ static void pick_pixel3_16(AVFrame *frame, int x, int y, *s2 = AV_RN16(frame->data[2] + y * frame->linesize[2] + 2 * x); } -static void pick_pixel4(AVFrame *frame, int x, int y, +static void pick_pixel4(const AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3) { if (*s0 < 0) @@ -222,7 +222,7 @@ static void pick_pixel4(AVFrame *frame, int x, int y, *s3 = frame->data[3][y * frame->linesize[3] + x]; } -static void pick_pixel4_16(AVFrame *frame, int x, int y, +static void pick_pixel4_16(const AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3) { if (*s0 < 0)