diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-15 11:12:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-15 11:12:25 +0100 |
commit | 4d941eac1655b21af33c6e4d52b7bfd7f9e5b990 (patch) | |
tree | 54fb5dafa6b702dc50fe5bd3691ec44679acf055 /libavutil/common.h | |
parent | 62006b539ddda23594febf0fcb2f21c03de60457 (diff) | |
parent | 3b4296f41473a5b39e84d7a49d480624c9c60040 (diff) | |
download | ffmpeg-4d941eac1655b21af33c6e4d52b7bfd7f9e5b990.tar.gz |
Merge commit '3b4296f41473a5b39e84d7a49d480624c9c60040'
* commit '3b4296f41473a5b39e84d7a49d480624c9c60040':
avformat: clarify stream id for muxing
fate: Add dependencies for aac, alac, amrnb, amrwb, atrac tests
ppc: do not pass redundant compiler flags
avutil: change GET_UTF8 to not use av_log2()
segment: fix NULL pointer dereference in seg_write_header()
Conflicts:
tests/fate/aac.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/common.h')
-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 03a2354db4..0f36309fa9 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -271,16 +271,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;\ } /** |