From patchwork Sun Aug 23 10:32:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gautam Ramakrishnan X-Patchwork-Id: 21834 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 0BB3B44A2D4 for ; Sun, 23 Aug 2020 13:39:10 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E0C516880E7; Sun, 23 Aug 2020 13:39:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4900F687F4E for ; Sun, 23 Aug 2020 13:39:03 +0300 (EEST) Received: by mail-oi1-f193.google.com with SMTP id z22so5699272oid.1 for ; Sun, 23 Aug 2020 03:39:03 -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=aDCu/Jl0pK4JCrtsMAHyC2/AbIMrdGgexW/Ls+4ZSqVwXcVGxPu1AenkaEBO9y7gRE pVLt561WEXQBiCep1FcSVJ9oktZW+tGZfEbgwo5INoGwFQgaLWxXkJGnd3wxTI3AftP7 YukWrlLf2bgxPQTx31LoY9O0AynDe2BT8WxNl/wmCtdjsJUGzvHUBCfMjIEmXXKyeHJJ 6i5D/ZmCr8zmXRa6Ibsbn4h7x1MchPeYuOoLyn+lr+PqW8QVp1VeXiReMuifl3RPrXJ4 qqOPOtBsHbSTpDNGRTHDZ29ErNHs95zJTYpGDD+pZUgNXQnoMrDuouBANzzTHmRPrlk9 P0eg== 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=rI93Ce7AczPfIDGIzwll4lkAqYmSoIkt7+1rb1Id8nKlLNHj32usNTS+IzjdCnJyQl JSnN42oDvan8gtybGKnu3lfOlD5pzflK2phVG1t05GF629qs2JkWOI+Dv65cgnzWejKv 1Rthu75rvOvxwJI6o91Rqq4UjlHIu8sRvxvb+jJ1VqK5fff/jTLzSaJgbOHY00c9UXsL 7N7wa/7PK7WsOXqfSb/Bdq9EFGrb6P3lo7B8wzEC931kuUA54moXz8bPRk9HwNBR8o3O iloshkQ1QQdNb0xZb9DbYrd02o2/OZyUE22qUZ5Bh005nPQbuFkGm79aRhd+I2PqbXDZ 8BGg== X-Gm-Message-State: AOAM532xJd0KQIlzh54zUrBizKIt2O6NQDg2Du+ABI9shAb1LhyikwQR Vrxci2oXKa/qsDeCQXsqDPUeJWyyXuc= X-Google-Smtp-Source: ABdhPJz9hnQcnS+2ntigfBnDk3ffpNXfoR2Op8/KjEKgWwA6rkgD7teMLz5qOIVF7T6JRTe7CCmdZw== X-Received: by 2002:a17:90a:5a01:: with SMTP id b1mr642028pjd.27.1598178749495; Sun, 23 Aug 2020 03:32:29 -0700 (PDT) Received: from localhost.localdomain ([122.167.211.143]) by smtp.gmail.com with ESMTPSA id x20sm6509365pgh.93.2020.08.23.03.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Aug 2020 03:32:28 -0700 (PDT) From: gautamramk@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 23 Aug 2020 16:02:20 +0530 Message-Id: <20200823103223.22289-1-gautamramk@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [RFC PATCH v2 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 */