upipe/ubits.h header reference

Upipe bit-oriented writer More

Header inclusion  

Members  

Type  

Functions  

  • int ubits_clean(struct ubits *s, uint8_t **buffer_end_p)
  • void ubits_init(struct ubits *s, uint8_t *buffer, size_t buffer_size)
  • void ubits_put(struct ubits *s, uint8_t nb, uint32_t value)

Description  

Upipe bit-oriented writer

Members detail  

#define _UPIPE_UBITS_H_  

This macro is declared in upipe/ubits.h source file, line 31.

struct ubits  

This struct is declared in upipe/ubits.h source file, line 44.

This struct is a helper allowing to write bits by bits to a buffer.

FieldDescription
uint8_t * buffer;pointer to buffer
uint8_t * buffer_end;end of buffer
uint32_t bits;bits cache
uint32_t available;number of available bits
bool overflow;true if the bit stream cache overflows

int ubits_clean(struct ubits *s, uint8_t **buffer_end_p)  

This function is declared in upipe/ubits.h source file, line 113.

This function cleans up the helper structure for bit-oriented writer.

Parameter list:

  • s: helper structure
  • buffer_end_p: filled in with a pointer to the first non-written octet

The return value is an error code

void ubits_init(struct ubits *s, uint8_t *buffer, size_t buffer_size)  

This function is declared in upipe/ubits.h source file, line 66.

This function initializes the helper structure for bit-oriented writer.

Parameter list:

  • s: helper structure
  • buffer: pointer to buffer
  • buffer_size: buffer size in octets

void ubits_put(struct ubits *s, uint8_t nb, uint32_t value)  

This function is declared in upipe/ubits.h source file, line 81.

This function puts up to 32 bits into the bitstream.

Parameter list:

  • s: helper structure
  • nb: number of bits to write
  • value: value to write

Valid XHTML 1.0 StrictGenerated by cmassiot on Fri Feb 2 23:57:19 2018 using MkDoc