[FFmpeg-devel] [RFC PATCH v7 1/4] libavcodec/jpeg2000: Make tag tree functions non static

gautamramk at gmail.com gautamramk at gmail.com
Thu Aug 27 21:45:33 EEST 2020


From: Gautam Ramakrishnan <gautamramk at gmail.com>

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 */
-- 
2.17.1



More information about the ffmpeg-devel mailing list