From patchwork Mon Aug 24 17:40:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gautam Ramakrishnan X-Patchwork-Id: 21884 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 70F5B4491F6 for ; Mon, 24 Aug 2020 20:41:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5438468975D; Mon, 24 Aug 2020 20:41:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B37AD6881E6 for ; Mon, 24 Aug 2020 20:40:53 +0300 (EEST) Received: by mail-pf1-f193.google.com with SMTP id y206so5182945pfb.10 for ; Mon, 24 Aug 2020 10:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=7SsBHLcUbrsGWagCGMAdHQSuTa81mM/Z4XwCjEwekwg=; b=gcUHNoe6ra6xzZNg4I2sOLVnVTyzgS8eHRZgKk6VBuz4hBfWHwhrzwr123yEk46tnZ +PXZx9AJcExUSxT5h2Ovyfs2ZqfzRgqpHdzPF415+dPzbrPehO+8jf4jtVPD6nSncNL1 okZvVOgIJbrVlQERHYFH4hNejBghfC6/aRPqY10KjCCu+XJoFkobxLvenyJLmYgSV7qF NrNulJx68o7FFFrME3cmYe7m6lTUmNFA/jyNgHcK4I9UlDqcr1cMhdoY7QX5PicYDwu/ OsUzqnyjr0jL9TF6QZMWKv1Y0Y0CUk/atVh4aN+QDkjC1lG+gOIizXMqQ5Ke5/aW7qsY tRnQ== 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; bh=7SsBHLcUbrsGWagCGMAdHQSuTa81mM/Z4XwCjEwekwg=; b=gdZiFja65C6JtUeddj+Mc4eEyEF2E5Exp8ZtwxAYfe0XoJD0wPlPS2v6yz3usFMudR vKs1my4EVpaoy/ebOkyYBwR1xiuU+6y3wAHR9MT33ixnKTts6c+vuQcgHmccMbLPLZQm jKtXIhaEN+5XzCxjEpfR1uWDWZTTka9F2BN59RSJDobftCVfR0e1UoADDbhTTdQy7v/P IN3n9vxc+uWDJP+v/u4CC6gF4qWfgh/VALaEagW/NNHkRBG0Q5VSCp5NG8Y9MwqgooGj MWt8xXPoUacWvt9EpGH243xvZzX8NKopQ4+wvEqNjHPBBOWtxh/KDeMh1wwwXwcuAO/o YK7Q== X-Gm-Message-State: AOAM531JQuSO8sJyxZszt2rcFOOEvuIA1ulM03VKNw6m5NiFt4b0k4cS CLkZhQqUPLSvg4xrPJAjv08pmm5jmghBBA== X-Google-Smtp-Source: ABdhPJxWWyK4Sqez9lBh1kXvujSjdD8/K80w8/kZsk3ob3eyoNGh+FFt6XeZOgNfCoceRsHHO1hILQ== X-Received: by 2002:a05:6a00:787:: with SMTP id g7mr4791175pfu.290.1598290847559; Mon, 24 Aug 2020 10:40:47 -0700 (PDT) Received: from localhost.localdomain ([122.167.211.143]) by smtp.gmail.com with ESMTPSA id v2sm5260414pfn.116.2020.08.24.10.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 10:40:46 -0700 (PDT) From: gautamramk@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Aug 2020 23:10:30 +0530 Message-Id: <20200824174034.17837-1-gautamramk@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [RFC PATCH v3 1/5] libavcodec/jpeg2000: Make tag tree functions non static 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: Gautam Ramakrishnan MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Gautam Ramakrishnan This patch makes the tag_tree_zero() and tag_tree_size() functions non static and callable from other files. --- libavcodec/jpeg2000.c | 12 ++++++------ libavcodec/jpeg2000.h | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index 1aca31ffa4..26e09fbe38 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -39,7 +39,7 @@ /* tag tree routines */ /* allocate the memory for tag tree */ -static int32_t tag_tree_size(int w, int h) +int32_t ff_tag_tree_size(int w, int h) { int64_t res = 0; while (w > 1 || h > 1) { @@ -57,7 +57,7 @@ static Jpeg2000TgtNode *ff_jpeg2000_tag_tree_init(int w, int h) Jpeg2000TgtNode *res, *t, *t2; int32_t tt_size; - tt_size = tag_tree_size(w, h); + tt_size = ff_tag_tree_size(w, h); t = res = av_mallocz_array(tt_size, sizeof(*t)); if (!res) @@ -82,9 +82,9 @@ static Jpeg2000TgtNode *ff_jpeg2000_tag_tree_init(int w, int h) return res; } -static void tag_tree_zero(Jpeg2000TgtNode *t, int w, int h) +void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h) { - int i, siz = tag_tree_size(w, h); + int i, siz = ff_tag_tree_size(w, h); for (i = 0; i < siz; i++) { t[i].val = 0; @@ -567,8 +567,8 @@ void ff_jpeg2000_reinit(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty) Jpeg2000Band *band = rlevel->band + bandno; for(precno = 0; precno < rlevel->num_precincts_x * rlevel->num_precincts_y; precno++) { Jpeg2000Prec *prec = band->prec + precno; - tag_tree_zero(prec->zerobits, prec->nb_codeblocks_width, prec->nb_codeblocks_height); - tag_tree_zero(prec->cblkincl, prec->nb_codeblocks_width, prec->nb_codeblocks_height); + ff_tag_tree_zero(prec->zerobits, prec->nb_codeblocks_width, prec->nb_codeblocks_height); + ff_tag_tree_zero(prec->cblkincl, prec->nb_codeblocks_width, prec->nb_codeblocks_height); for (cblkno = 0; cblkno < prec->nb_codeblocks_width * prec->nb_codeblocks_height; cblkno++) { Jpeg2000Cblk *cblk = prec->cblk + cblkno; cblk->length = 0; diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h index 5b0627c3dc..c3437b02fe 100644 --- a/libavcodec/jpeg2000.h +++ b/libavcodec/jpeg2000.h @@ -290,4 +290,7 @@ static inline int needs_termination(int style, int passno) { return 0; } +int32_t ff_tag_tree_size(int w, int h); +void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h); + #endif /* AVCODEC_JPEG2000_H */