ADPCM Codecs
Loading...
Searching...
No Matches
Public Member Functions | List of all members
adpcm_ffmpeg::BitWriter Class Reference

Writes bits into a buffer. By default the first bit written is the least significant bit of the first byte. With setMsbFirst(true) the first bit written is the most significant bit of the first byte. Call flush() to store a partial last byte. Writes beyond the buffer size are dropped. More...

#include <BitWriter.h>

Public Member Functions

 BitWriter (uint8_t *buffer, int buffer_size)
 
void setMsbFirst (bool msb)
 Selects the bit order used by put(); call before writing.
 
void put (int n, uint32_t value)
 writes the low n bits of value (0 to 32)
 
void putSigned (int n, int32_t value)
 writes the low n bits of a signed value (two's complement, 0 to 31)
 
void flush ()
 stores the pending bits as a final, zero padded byte
 
int bytesWritten () const
 number of bytes stored so far
 

Detailed Description

Writes bits into a buffer. By default the first bit written is the least significant bit of the first byte. With setMsbFirst(true) the first bit written is the most significant bit of the first byte. Call flush() to store a partial last byte. Writes beyond the buffer size are dropped.


The documentation for this class was generated from the following file: