X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flibchdr%2Fbitstream.h;h=d376373b7634150a6c3b381c9e588e11e7297311;hb=a34093eb63d1645fd2de9b412efe2587df9fdb3f;hp=9250d3369e2ec00c102eeb7b3acc909813f75954;hpb=ce188d4d7f3b9ad04867c49b424e8497c2ade92b;p=pcsx_rearmed.git diff --git a/deps/libchdr/bitstream.h b/deps/libchdr/bitstream.h index 9250d336..d376373b 100644 --- a/deps/libchdr/bitstream.h +++ b/deps/libchdr/bitstream.h @@ -1,42 +1,43 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -/*************************************************************************** - - bitstream.h - - Helper classes for reading/writing at the bit level. - -***************************************************************************/ - -#pragma once - -#ifndef __BITSTREAM_H__ -#define __BITSTREAM_H__ - -#include - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// helper class for reading from a bit buffer -struct bitstream -{ - uint32_t buffer; // current bit accumulator - int bits; // number of bits in the accumulator - const uint8_t * read; // read pointer - uint32_t doffset; // byte offset within the data - uint32_t dlength; // length of the data -}; - -struct bitstream* create_bitstream(const void *src, uint32_t srclength); -int bitstream_overflow(struct bitstream* bitstream); -uint32_t bitstream_read_offset(struct bitstream* bitstream); - -uint32_t bitstream_read(struct bitstream* bitstream, int numbits); -uint32_t bitstream_peek(struct bitstream* bitstream, int numbits); -void bitstream_remove(struct bitstream* bitstream, int numbits); -uint32_t bitstream_flush(struct bitstream* bitstream); - - -#endif +/* license:BSD-3-Clause + * copyright-holders:Aaron Giles +*************************************************************************** + + bitstream.h + + Helper classes for reading/writing at the bit level. + +***************************************************************************/ + +#pragma once + +#ifndef __BITSTREAM_H__ +#define __BITSTREAM_H__ + +#include + +/*************************************************************************** + * TYPE DEFINITIONS + *************************************************************************** + */ + +/* helper class for reading from a bit buffer */ +struct bitstream +{ + uint32_t buffer; /* current bit accumulator */ + int bits; /* number of bits in the accumulator */ + const uint8_t * read; /* read pointer */ + uint32_t doffset; /* byte offset within the data */ + uint32_t dlength; /* length of the data */ +}; + +struct bitstream* create_bitstream(const void *src, uint32_t srclength); +int bitstream_overflow(struct bitstream* bitstream); +uint32_t bitstream_read_offset(struct bitstream* bitstream); + +uint32_t bitstream_read(struct bitstream* bitstream, int numbits); +uint32_t bitstream_peek(struct bitstream* bitstream, int numbits); +void bitstream_remove(struct bitstream* bitstream, int numbits); +uint32_t bitstream_flush(struct bitstream* bitstream); + + +#endif