51 Bitstream::write_bit (
bool bit)
54 _crc->process_bit (bit);
56 _data.push_back (bit);
61 Bitstream::write_from_byte (uint8_t
byte,
int bits)
63 for (
int i = bits - 1; i >= 0; --i) {
64 write_bit ((
byte >> i) & 1);
70 Bitstream::write_from_word (uint32_t word,
int bits)
72 for (
int i = bits - 1; i >= 0; --i) {
73 write_bit ((word >> i) & 1);
79 Bitstream::start_crc (uint16_t poly)
81 DCP_ASSERT (!
static_cast<bool>(_crc));
82 _crc = boost::crc_basic<16> (poly);
87 Bitstream::write_crc ()
89 DCP_ASSERT (
static_cast<bool>(_crc));
90 uint16_t crc = _crc->checksum();
91 write_from_word (crc, 16);
Namespace for everything in libdcp.