avcodec/jpeg2000: Make ff_tag_tree_size() static

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-06 13:30:11 +02:00
parent fc9cb7d51a
commit faa62773cb
2 changed files with 4 additions and 5 deletions

View File

@ -39,8 +39,7 @@
/* tag tree routines */ /* 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; int64_t res = 0;
while (w > 1 || h > 1) { while (w > 1 || h > 1) {
@ -52,13 +51,14 @@ int32_t ff_tag_tree_size(int w, int h)
return (int32_t)(res + 1); return (int32_t)(res + 1);
} }
/* allocate the memory for tag tree */
static Jpeg2000TgtNode *ff_jpeg2000_tag_tree_init(int w, int h) static Jpeg2000TgtNode *ff_jpeg2000_tag_tree_init(int w, int h)
{ {
int pw = w, ph = h; int pw = w, ph = h;
Jpeg2000TgtNode *res, *t, *t2; Jpeg2000TgtNode *res, *t, *t2;
int32_t tt_size; int32_t tt_size;
tt_size = ff_tag_tree_size(w, h); tt_size = tag_tree_size(w, h);
t = res = av_mallocz_array(tt_size, sizeof(*t)); t = res = av_mallocz_array(tt_size, sizeof(*t));
if (!res) if (!res)
@ -85,7 +85,7 @@ static Jpeg2000TgtNode *ff_jpeg2000_tag_tree_init(int w, int h)
void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h, int val) void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h, int val)
{ {
int i, siz = ff_tag_tree_size(w, h); int i, siz = tag_tree_size(w, h);
for (i = 0; i < siz; i++) { for (i = 0; i < siz; i++) {
t[i].val = val; t[i].val = val;

View File

@ -301,7 +301,6 @@ static inline int needs_termination(int style, int passno) {
return 0; return 0;
} }
int32_t ff_tag_tree_size(int w, int h);
void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h, int val); void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h, int val);
#endif /* AVCODEC_JPEG2000_H */ #endif /* AVCODEC_JPEG2000_H */