diff options
author | Mans Rullgard <mans@mansr.com> | 2012-11-13 15:49:39 +0000 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-11-14 13:50:42 +0000 |
commit | 7ba0c1b390a6ea67ca5e9cbade3005285b51b70f (patch) | |
tree | 7249f38d3ce35b98a5494584eb79acbcc04c9ded | |
parent | e8769b37fe8a841c0d28d3686c6d3cdecc542bc7 (diff) | |
download | ffmpeg-7ba0c1b390a6ea67ca5e9cbade3005285b51b70f.tar.gz |
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: Mans Rullgard <mans@mansr.com>
-rw-r--r-- | libavutil/common.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index 34658635a7..cc4df16e4a 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -252,16 +252,17 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x) #define GET_UTF8(val, GET_BYTE, ERROR)\ val= GET_BYTE;\ {\ - int ones= 7 - av_log2(val ^ 255);\ - if(ones==1)\ + uint32_t top = (val & 128) >> 1;\ + if ((val & 0xc0) == 0x80)\ ERROR\ - val&= 127>>ones;\ - while(--ones > 0){\ + while (val & top) {\ int tmp= GET_BYTE - 128;\ if(tmp>>6)\ ERROR\ val= (val<<6) + tmp;\ + top <<= 5;\ }\ + val &= (top << 1) - 1;\ } /** |