---
Alternative patch that makes the table public instead of duplicating it.
libavcodec/aacps.c | 2 +-
libavcodec/tiertexseqv.c | 2 +-
libavcodec/xsubdec.c | 2 +-
libavcodec/xsubenc.c | 2 +-
libavformat/matroskadec.c | 4 ++--
libavformat/rtsp.c | 2 +-
libavutil/common.h | 6 +++---
libavutil/mathematics.c | 4 +++-
8 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/libavcodec/aacps.c b/libavcodec/aacps.c
index fa7e9ac..8cc3579 100644
--- a/libavcodec/aacps.c
+++ b/libavcodec/aacps.c
@@ -193,7 +193,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext
*gb_host, PSContext *ps
ps->border_position[e] = get_bits(gb, 5);
} else
for (e = 1; e <= ps->num_env; e++)
- ps->border_position[e] = (e * numQMFSlots >>
ff_log2_tab[ps->num_env]) - 1;
+ ps->border_position[e] = (e * numQMFSlots >>
av_log2_tab[ps->num_env]) - 1;
if (ps->enable_iid) {
for (e = 0; e < ps->num_env; e++) {
diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c
index 98f6477..9050fa2 100644
--- a/libavcodec/tiertexseqv.c
+++ b/libavcodec/tiertexseqv.c
@@ -107,7 +107,7 @@ static const unsigned char *seq_decode_op1(SeqVideoContext
*seq,
} else {
if (len <= 0)
return NULL;
- bits = ff_log2_tab[len - 1] + 1;
+ bits = av_log2_tab[len - 1] + 1;
if (src_end - src < len + 8 * bits)
return NULL;
color_table = src;
diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c
index 11e1d57..9277ecc 100644
--- a/libavcodec/xsubdec.c
+++ b/libavcodec/xsubdec.c
@@ -118,7 +118,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int *data_size,
// interlaced: do odd lines
if (y == (h + 1) / 2) bitmap = sub->rects[0]->pict.data[0] + w;
for (x = 0; x < w; ) {
- int log2 = ff_log2_tab[show_bits(&gb, 8)];
+ int log2 = av_log2_tab[show_bits(&gb, 8)];
int run = get_bits(&gb, 14 - 4 * (log2 >> 1));
int color = get_bits(&gb, 2);
run = FFMIN(run, w - x);
diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c
index 816e651..ca2c081 100644
--- a/libavcodec/xsubenc.c
+++ b/libavcodec/xsubenc.c
@@ -42,7 +42,7 @@
static void put_xsub_rle(PutBitContext *pb, int len, int color)
{
if (len <= 255)
- put_bits(pb, 2 + ((ff_log2_tab[len] >> 1) << 2), len);
+ put_bits(pb, 2 + ((av_log2_tab[len] >> 1) << 2), len);
else
put_bits(pb, 14, 0);
put_bits(pb, 2, color);
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 094b055..1443bfd 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -604,7 +604,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska,
AVIOContext *pb,
}
/* get the length of the EBML number */
- read = 8 - ff_log2_tab[total];
+ read = 8 - av_log2_tab[total];
if (read > max_size) {
int64_t pos = avio_tell(pb) - 1;
av_log(matroska->ctx, AV_LOG_ERROR,
@@ -614,7 +614,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska,
AVIOContext *pb,
}
/* read out length */
- total ^= 1 << ff_log2_tab[total];
+ total ^= 1 << av_log2_tab[total];
while (n++ < read)
total = (total << 8) | avio_r8(pb);
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index df27218..848dbb6 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1649,7 +1649,7 @@ redirect:
goto fail;
do {
- int lower_transport = ff_log2_tab[lower_transport_mask &
+ int lower_transport = av_log2_tab[lower_transport_mask &
~(lower_transport_mask - 1)];
err = ff_rtsp_make_setup_request(s, host, port, lower_transport,
diff --git a/libavutil/common.h b/libavutil/common.h
index 433e8e4..25c27b9 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -60,7 +60,7 @@
#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
/* misc math functions */
-extern const uint8_t ff_log2_tab[256];
+extern const uint8_t av_log2_tab[256];
extern const uint8_t av_reverse[256];
@@ -75,7 +75,7 @@ static av_always_inline av_const int av_log2_c(unsigned int v)
v >>= 8;
n += 8;
}
- n += ff_log2_tab[v];
+ n += av_log2_tab[v];
return n;
}
@@ -87,7 +87,7 @@ static av_always_inline av_const int av_log2_16bit_c(unsigned
int v)
v >>= 8;
n += 8;
}
- n += ff_log2_tab[v];
+ n += av_log2_tab[v];
return n;
}
diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index ce89195..dc31395 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -26,9 +26,11 @@
#include <assert.h>
#include <stdint.h>
#include <limits.h>
+
+#include "common.h"
#include "mathematics.h"
-const uint8_t ff_log2_tab[256]={
+const uint8_t av_log2_tab[256] = {
0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel