Merge commit '5ff998a233'
* commit '5ff998a233':
flacenc: use uint64_t for bit counts
flacenc: remove wasted trailing 0 bits
lavu: add av_ctz() for trailing zero bit count
flacenc: use a separate buffer for byte-swapping for MD5 checksum on big-endian
fate: aac: Place LATM tests and general AAC tests in different groups
build: The A64 muxer depends on rawenc.o for ff_raw_write_packet()
Conflicts:
doc/APIchanges
libavutil/version.h
tests/fate/aac.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
7d26be63c2
8 changed files with 174 additions and 45 deletions
|
|
@ -89,6 +89,61 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
|
|||
#define av_log2 ff_log2
|
||||
#define av_log2_16bit ff_log2_16bit
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_math
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if HAVE_FAST_CLZ && AV_GCC_VERSION_AT_LEAST(3,4)
|
||||
#ifndef ff_ctz
|
||||
#define ff_ctz(v) __builtin_ctz(v)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ff_ctz
|
||||
#define ff_ctz ff_ctz_c
|
||||
static av_always_inline av_const int ff_ctz_c(int v)
|
||||
{
|
||||
int c;
|
||||
|
||||
if (v & 0x1)
|
||||
return 0;
|
||||
|
||||
c = 1;
|
||||
if (!(v & 0xffff)) {
|
||||
v >>= 16;
|
||||
c += 16;
|
||||
}
|
||||
if (!(v & 0xff)) {
|
||||
v >>= 8;
|
||||
c += 8;
|
||||
}
|
||||
if (!(v & 0xf)) {
|
||||
v >>= 4;
|
||||
c += 4;
|
||||
}
|
||||
if (!(v & 0x3)) {
|
||||
v >>= 2;
|
||||
c += 2;
|
||||
}
|
||||
c -= v & 0x1;
|
||||
|
||||
return c;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Trailing zero bit count.
|
||||
*
|
||||
* @param v input value. If v is 0, the result is undefined.
|
||||
* @return the number of trailing 0-bits
|
||||
*/
|
||||
int av_ctz(int v);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue