Displaying 6 results from an estimated 6 matches for "consumed_blurb".
Did you mean:
consumed_blurbs
2004 Dec 28
2
libFLAC bitbuffer optimizations
...t;total_consumed_bits >= FLAC__BITS_PER_BLURB) {
+#if FLAC__BITS_PER_BLURB == 8
+ /*
+ * memset and memcpy are usually implemented in assembly language
+ * by the system libc, and they can be much faster
+ */
+ unsigned r_end = (bb->blurbs + (bb->bits? 1:0)),
+ r = bb->consumed_blurbs, l = r_end - r;
+ FLAC__blurb * rbuffer = &bb->buffer[r];
+ memcpy(&bb->buffer[0], rbuffer, r_end/4 + r_end%4);
+ memset(++rbuffer, 0, l/4 + l%4);
+#elif FLAC__BITS_PER_BLURB == 32
+ /* the original version */
unsigned l = 0, r = bb->consumed_blurbs, r_end = bb->blurbs +...
2005 Jan 24
0
libFLAC bitbuffer optimizations
...--- bitbuffer.c 25 Jan 2005 02:37:08 -0000 1.55
+++ bitbuffer.c 25 Jan 2005 02:39:52 -0000
@@ -228,11 +228,27 @@
/* first shift the unconsumed buffer data toward the front as much
as possible */
if(bb->total_consumed_bits >= FLAC__BITS_PER_BLURB) {
- unsigned l = 0, r = bb->consumed_blurbs, r_end = bb->blurbs +
(bb->bits? 1:0);
+#if FLAC__BITS_PER_BLURB == 8
+ /*
+ * memset and memcpy are usually implemented in assembly
language
+ * by the system libc, and they can be much faster
+ */
+ const unsigned r_end = bb->blurbs + (bb->bits? 1:0);...
2005 Jan 01
2
libFLAC bitbuffer optimizations
...(blurb) <=0xffffff \
+ ? byte_to_unary_table[(blurb) >> 16] + 8 \
+ : byte_to_unary_table[(blurb) >> 24])))
#else
/* ERROR, only sizes of 8 and 32 are supported */
#endif
@@ -2109,114 +2135,18 @@
if(nvals == 0)
return true;
+ cbits = bb->consumed_bits;
i = bb->consumed_blurbs;
- /*
- * We unroll the main loop to take care of partially consumed blurbs here.
- */
- if(bb->consumed_bits > 0) {
- save_blurb = blurb = buffer[i];
- cbits = bb->consumed_bits;
- blurb <<= cbits;
-
- while(1) {
- if(state == 0) {
- if(blurb) {
- for(j = 0; !(blurb...
2004 Dec 29
0
libFLAC bitbuffer optimizations
...ITS_PER_BLURB) {
> +#if FLAC__BITS_PER_BLURB == 8
> + /*
> + * memset and memcpy are usually implemented in assembly language
> + * by the system libc, and they can be much faster
> + */
> + unsigned r_end = (bb->blurbs + (bb->bits? 1:0)),
> + r = bb->consumed_blurbs, l = r_end - r;
> + FLAC__blurb * rbuffer = &bb->buffer[r];
> + memcpy(&bb->buffer[0], rbuffer, r_end/4 + r_end%4);
> + memset(++rbuffer, 0, l/4 + l%4);
> +#elif FLAC__BITS_PER_BLURB == 32
> + /* the original version */
> unsigned l = 0, r = bb->consumed_b...
2005 Feb 02
0
two small-ish optimizations (death by a thousand cuts)
.../libFLAC/bitbuffer.c
+++ mod/src/libFLAC/bitbuffer.c
@@ -1466,6 +1469,7 @@
{
unsigned i, bits_ = bits;
FLAC__uint32 v = 0;
+ FLAC__blurb *bbb;
FLAC__ASSERT(0 != bb);
FLAC__ASSERT(0 != bb->buffer);
@@ -1485,18 +1489,20 @@
#if FLAC__BITS_PER_BLURB > 8
if(bb->bits == 0 || bb->consumed_blurbs < bb->blurbs) { /*@@@ comment on why this is here*/
#endif
+ bbb = &bb->buffer[bb->consumed_blurbs];
if(bb->consumed_bits) {
i = FLAC__BITS_PER_BLURB - bb->consumed_bits;
if(i <= bits_) {
- v = bb->buffer[bb->consumed_blurbs] & (FLAC__BLURB_ALL_ON...
2004 Sep 10
4
bitbuffer optimizations
...; 8] + 16 : ((blurb) <= 0xffffff ? byte_to_unary_table[(blurb) >> 16] + 8 : byte_to_unary_table[(blurb) >> 24])))
#else
/* ERROR, only sizes of 8 and 32 are supported */
#endif
@@ -2090,114 +2111,16 @@
if(nvals == 0)
return true;
+ cbits = bb->consumed_bits;
i = bb->consumed_blurbs;
- /*
- * We unroll the main loop to take care of partially consumed blurbs here.
- */
- if(bb->consumed_bits > 0) {
- save_blurb = blurb = buffer[i];
- cbits = bb->consumed_bits;
- blurb <<= cbits;
-
- while(1) {
- if(state == 0) {
- if(blurb) {
- for(j = 0; !(blurb...