search for: flac__word_all_ones

Displaying 8 results from an estimated 8 matches for "flac__word_all_ones".

2008 Mar 14
2
bitreader optimizations
...for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ - if(br->bytes) { - const unsigned end = br->bytes * 8; - brword b = (br->buffer[cwords] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << cbits; - if(b) { - i = COUNT_ZERO_MSBS(b); - uval += i; - bits = parameter; - i++; - cbits += i; - FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); - goto break1; - } - else { - uval += end - cbits; - cbits += e...
2012 May 04
0
[PATCH] Optimize FLAC__bitreader_read_rice_signed
...- * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ - if(br->bytes*8 > cbits) { - const unsigned end = br->bytes * 8; - uint32_t b = (br->buffer[cwords] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << cbits; - if(b) { - i = COUNT_ZERO_MSBS(b); - uval += i; - bits = parameter; - i++; - cbits += i; - FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); - goto break1; - } - else { - uval += end - cbits; - cbits = en...
2008 Mar 17
0
bitreader optimizations
...for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ - if(br->bytes) { - const unsigned end = br->bytes * 8; - brword b = (br->buffer[cwords] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << cbits; - if(b) { - i = COUNT_ZERO_MSBS(b); - uval += i; - bits = parameter; - i++; - cbits += i; - FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); - goto break1; - } - else { - uval += end - cbits; - cbits += e...
2012 Aug 28
3
[PATCH 1/3] Make FLAC__clz_soft_uint32 static.
--- src/libFLAC/include/private/bitmath.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/libFLAC/include/private/bitmath.h b/src/libFLAC/include/private/bitmath.h index 61b0e03..d32b1a7 100644 --- a/src/libFLAC/include/private/bitmath.h +++ b/src/libFLAC/include/private/bitmath.h @@ -42,7 +42,7 @@ #endif /* Will never be emitted for MSVC, GCC, Intel compilers */
2012 May 09
1
[PATCH 2/2] bitmath: Finish up optimizations
...S(b); + i = FLAC__clz_uint32(b); *val += i; i++; br->consumed_bits += i; @@ -709,7 +669,7 @@ FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *va const unsigned end = br->bytes * 8; uint32_t b = (br->buffer[br->consumed_words] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << br->consumed_bits; if(b) { - i = COUNT_ZERO_MSBS(b); + i = FLAC__clz_uint32(b); *val += i; i++; br->consumed_bits += i; @@ -800,7 +760,7 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[...
2015 Dec 16
2
about word size in bitreader/bitwriter
...change this you must also change the following #defines down to SWAP_BE_WORD_TO_HOST below to match */ /* WATCHOUT: there are a few places where the code will not work unless uint32_t is >= 32 bits wide */ #define FLAC__BYTES_PER_WORD 4 #define FLAC__BITS_PER_WORD 32 #define FLAC__WORD_ALL_ONES ((FLAC__uint32)0xffffffff) ... and the following code in bitreader.c: #if FLAC__BYTES_PER_WORD == 4 switch(br->crc16_align) { case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 24), crc); case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word &g...
2015 Dec 28
1
[PATCH 3] for bitwriter.c
...< sizeof(unsigned)*8) were changed to FLAC__ASSERT(parameter < 32) I don't understand why sizeof is better here. Also, bitreader.c already uses asserts like "FLAC__ASSERT(parameter <= 31)". 4) Fixed the calculation of mask1 and mask2. The current code is incorrect if FLAC__WORD_ALL_ONES is not 32-bit, so better to replace it with the proper 32-bit constant. 5) In FLAC__bitwriter_write_rice_signed_block() the new variable total_bits was added (just as in FLAC__bitwriter_write_rice_signed()). The code was simplified. Example: - bw->bits = bw->bits + msbits + lsbits; + bw...
2012 Apr 05
1
[PATCH] remove unnecesary typedef in bitwriter.c
...here are a few places where the code will not work unless bwword is >= 32 bits wide */ -typedef FLAC__uint32 bwword; +/* WATCHOUT: there are a few places where the code will not work unless uint32_t is >= 32 bits wide */ #define FLAC__BYTES_PER_WORD 4 #define FLAC__BITS_PER_WORD 32 #define FLAC__WORD_ALL_ONES ((FLAC__uint32)0xffffffff) -/* SWAP_BE_WORD_TO_HOST swaps bytes in a bwword (which is always big-endian) if necessary to match host byte order */ +/* SWAP_BE_WORD_TO_HOST swaps bytes in a uint32_t (which is always big-endian) if necessary to match host byte order */ #if WORDS_BIGENDIAN #define SW...