From d1f62e8a4f976e11634d2f9187821e8686cec76d Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sun, 27 Jul 2003 05:24:15 +0000 Subject: Moved to gst-libs/ext/mplex Original commit message from CVS: Moved to gst-libs/ext/mplex --- ext/mplex/bits.hh | 82 ------------------------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 ext/mplex/bits.hh (limited to 'ext/mplex/bits.hh') diff --git a/ext/mplex/bits.hh b/ext/mplex/bits.hh deleted file mode 100644 index 275b8c0f..00000000 --- a/ext/mplex/bits.hh +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef __BITS_H__ -#define __BITS_H__ - -#include -#include - -typedef uint64_t bitcount_t; - - -class BitStreamUndo -{ -//protected: -public: - uint8_t outbyte; - unsigned int byteidx; - int bitidx; - unsigned int bufcount; - fpos_t actpos; - bitcount_t totbits; - bitcount_t buffer_start; - bitcount_t readpos; - uint8_t *bfr; - unsigned int bfr_size; -public: - bool eobs; -}; - -typedef class BitStream _BitStream; - -typedef size_t (*ReadCallback) (_BitStream *bs, uint8_t *dest, size_t size, void *user_data); - -class BitStream : public BitStreamUndo -{ -public: - void *user_data; - static const unsigned int BUFFER_SIZE = 4 * 1024; -public: - BitStream (); - ~BitStream (); - inline bitcount_t bitcount () - { - return totbits; - } - inline bool eos () - { - return eobs; - } -}; - - -// -// Input bit stream class. Supports the "scanning" of a stream -// into a large buffer which is flushed once it has been read. -// N.b. if you scan ahead a long way and don't read its your -// responsibility to flush manually... -// - -class IBitStream:public BitStream -{ -public: - void open (ReadCallback read_callback, void *user_data, unsigned int buf_size = BUFFER_SIZE); - void SetBufSize (unsigned int buf_size); - void close (); - uint32_t get1bit (); - uint32_t getbits (int N); - void prepareundo (BitStreamUndo & undobuf); - void undochanges (BitStreamUndo & undobuf); - bool seek_sync (unsigned int sync, int N, int lim); - void flush (bitcount_t bitposition); - inline unsigned int buffered_bytes () - { - return (buffer_start + bufcount - readpos); - } - unsigned int read_buffered_bytes (uint8_t * dst, unsigned int length_bytes); - -private: - bool refill_buffer (); - static uint8_t masks[8]; - ReadCallback read_callback; -}; - -#endif // __BITS_H__ -- cgit v1.2.1