Transfer bits from one buffer to another, debiassing en-route. Performing a von-neumann debiassing, transfer bits from the This method of debiassing will produce at absolute maximum, a drop of 50% in the bitcount. I.E. at minimum you will lose one bit in two. In actuality, in a truly random stream, you will lose three bits in four, which means that the debiassing will leave you with around one quarter the number of bits you started with. **Returns:**- The number of bits added to
*to*.
Definition at line 9 of file debias.c. { BitField bits; int bits_xfered = 0; while (bitbuffer_available_bits(from) >= 2) { if (bitbuffer_extract_bits(from, &bits, 2) != 2) return bits_xfered; if ((bits & 3) == 1 || (bits & 3) == 2) { if (bitbuffer_add_bits(to, bits, 1) != 1) return bits_xfered; bits_xfered++; } } return bits_xfered; } |

Generated by Doxygen 1.6.0 Back to index