From patchwork Wed Aug 19 12:20:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gautam Ramakrishnan X-Patchwork-Id: 21736 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 1248D44B0ED for ; Wed, 19 Aug 2020 15:21:28 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DC3616881F1; Wed, 19 Aug 2020 15:21:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 73682687F43 for ; Wed, 19 Aug 2020 15:21:21 +0300 (EEST) Received: by mail-pj1-f68.google.com with SMTP id mw10so1043623pjb.2 for ; Wed, 19 Aug 2020 05:21:21 -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=LRDr/1aXuAhanug/XAbcm59cdbJ1+klLyU9OH1Hub80/6XhXqWSJP/j3JqyVhe4VGy p2lzmzyf35ctyU9bDNj4ZWnN7IZ29pZIdx3r3QKrxsB/bVW03idK9xaAC7DYw5KOBMLV NOL/xyvrEuT/krMK9H9ookNq8ieLD5bShr1HhEtZlNTOYmnJa2d5yqETi0p4QicWv2oA 1EkUpwA3DrJGJPx9Z2el3HROq0R4gtZvV1RgSA8O7IVy1X5vokLcpTcMD3RB+sPKJqa4 jpWxi7ekKb/J2xScN25z21boXr9dvVxbUHBHWMbcGN7YHzhHVFaZhZiwMwHsYdzSiXY2 ROFg== 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=bIKZi2XdkbAEGVDrrvSCQmfXRQr6VVA/Xreq/kVzpeEh5J3Awn6nFBv1yMJ8lONuSM p8l5eg09jG2c4VLr5bxQKwa/HQExxOJfUJARsuwiupBxDfCQU1nY7WvCBfbuOeF1WMZi 4BdUJEg8Y5UAF2oPwDfKXXiZM34Cn9j1oJOw5QCR4ESdCS4+LjUDYCcBzVs3NLB+QwFG rAbIcOyzEIaOX9qowvGFWCSB6NUr4fqn6BXpx0qAHM9O9qk5FrUDdn1Mmg5jex5hWc3s dtYyTcvMUcu2tWe/uIFiqoJyC/8bMikAt0LLiM1h96tOwOx9xtRj2ZNqZtx4FHa/6jsG d6Og== X-Gm-Message-State: AOAM532chjSgSjzvP4AungBgrUafI/FAPpTxBqKaIj55hwc8BiwUAD8R t8Exr5QeUfpFb/9lUzo7ifkiYHjhAho= X-Google-Smtp-Source: ABdhPJxZ+dowNq9m1q9fZO1IyfeQTEMFPXMMCwQwnt7NRp6TN+TTXUxZ3tvts+08TKDddyuU8VsmJg== X-Received: by 2002:a17:902:c285:: with SMTP id i5mr11316420pld.288.1597839679362; Wed, 19 Aug 2020 05:21:19 -0700 (PDT) Received: from localhost.localdomain ([122.166.129.193]) by smtp.gmail.com with ESMTPSA id k88sm3039767pjk.19.2020.08.19.05.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 05:21:18 -0700 (PDT) From: gautamramk@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Aug 2020 17:50:59 +0530 Message-Id: <20200819122102.5584-1-gautamramk@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [RFC PATCH 1/4] 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 */