From patchwork Thu Aug 27 18:45:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gautam Ramakrishnan X-Patchwork-Id: 21950 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 6961044B86C for ; Thu, 27 Aug 2020 21:45:52 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3D1BB68AB18; Thu, 27 Aug 2020 21:45:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D87868A922 for ; Thu, 27 Aug 2020 21:45:45 +0300 (EEST) Received: by mail-pg1-f195.google.com with SMTP id l191so3994143pgd.5 for ; Thu, 27 Aug 2020 11:45:45 -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=nbhv6NKfVZbmwHmtCZYzaTZ+rHY3L/wnBbD+Pa/AR5GclhsvluOX7g8xov9c2xanoQ zxrAaVpIoM5LEXk4FTEnpXi5lWwxWVBlIcccq9ItXbu5nXkXc2I2kP1EDGGkAqYLf/V9 c8qwNi6AJpFEldsCmUqdrOB2GSSy0IB+Yk6pVKvQbSIZPq3a2y3Y8l1uKxwcOD1lLoJ/ otZrH0hXVrzPC9C5rE/gjqCHDu0huVaIEAtkdAqX6tZ3j+fTwYqQimY7qIkD+aQoo7Rs ONea0aOO6Z+iuICZ6HJwhg/9CM79sthspZCdRhy/CXhhsewVuADqsH3kOsrKRfRMGqvn pbBg== 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=KirqbBBQLhP224AY7bEHhSFSWhHYB2UAmXUUWt62tjEm3EX0mxzcLO+Pk/ImgNLmJl ZtWfbZR7D3cDroGpkQFXxc2hCOl9l2iuKHTH5skBdZ+pQiWWrJj3iq8BvKzHBymoGHK7 6zr67ERo9I/t6luwq1Al4S+s6gfNUTzLE0d7qdEbsXkiULZwRhQ/annml8tBeQ4gxc02 /OHff3XD/eoG13nzhLEpPLe1fohphkGoJ8cPXhPngzdWhpyRCd8ppto4WAM261REzy9A aKQyy7g+aloiyrcGkb4hX9Jl0CJZhvFYWu9NF45gx6q/dRpFezwD0C93YfF7xRiO8THd +mTQ== X-Gm-Message-State: AOAM533X0ihS/ZLedVyQ0PovPuZJmQ8xm1j7ZDEsXJFvdFTpOZBXlxio GTXfvW/KZwFdGnzZ40um9EMUucITalbPNw== X-Google-Smtp-Source: ABdhPJz8djNZFhU0JqszUkc2E7Olr0VijaReH6MCDgu3XTZrymqE5ZQuDTs9D350hitRBEWVPO4raQ== X-Received: by 2002:a62:fc97:: with SMTP id e145mr7908040pfh.15.1598553943280; Thu, 27 Aug 2020 11:45:43 -0700 (PDT) Received: from localhost.localdomain ([122.167.211.143]) by smtp.gmail.com with ESMTPSA id a20sm3597229pfi.11.2020.08.27.11.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 11:45:42 -0700 (PDT) From: gautamramk@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 28 Aug 2020 00:15:33 +0530 Message-Id: <20200827184536.10752-1-gautamramk@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [RFC PATCH v7 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 */