Commit 7ba0c1b3 authored by Mans Rullgard's avatar Mans Rullgard

avutil: change GET_UTF8 to not use av_log2()

This removes an inter-library dependency on ff_log2_tab causing
linking errors in some configurations.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent e8769b37
...@@ -252,16 +252,17 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x) ...@@ -252,16 +252,17 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
#define GET_UTF8(val, GET_BYTE, ERROR)\ #define GET_UTF8(val, GET_BYTE, ERROR)\
val= GET_BYTE;\ val= GET_BYTE;\
{\ {\
int ones= 7 - av_log2(val ^ 255);\ uint32_t top = (val & 128) >> 1;\
if(ones==1)\ if ((val & 0xc0) == 0x80)\
ERROR\ ERROR\
val&= 127>>ones;\ while (val & top) {\
while(--ones > 0){\
int tmp= GET_BYTE - 128;\ int tmp= GET_BYTE - 128;\
if(tmp>>6)\ if(tmp>>6)\
ERROR\ ERROR\
val= (val<<6) + tmp;\ val= (val<<6) + tmp;\
top <<= 5;\
}\ }\
val &= (top << 1) - 1;\
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment