Files
dragonpilot/tools/lib/vidindex/bitstream.h
Dragonpilot Team 811fd5086f dragonpilot v2023.02.08 for EON/C2
version: dragonpilot v2023.02.08 release for EON/C2
date: 2023-02-08T05:01:31
dp-dev(priv2) beta2 commit: f770882b7f
2023-02-08 05:04:53 +00:00

27 lines
611 B
C

#ifndef bitstream_H
#define bitstream_H
#include <stddef.h>
#include <stdint.h>
struct bitstream {
const uint8_t *buffer_ptr;
const uint8_t *buffer_end;
uint64_t value;
uint32_t pos;
uint32_t shift;
size_t size;
};
void bs_init(struct bitstream *bs, const uint8_t *buffer, size_t input_size);
void bs_seek(struct bitstream *bs, size_t new_pos);
uint32_t bs_get(struct bitstream *bs, int n);
uint32_t bs_peek(struct bitstream *bs, int n);
size_t bs_remain(struct bitstream *bs);
int bs_eof(struct bitstream *bs);
uint32_t bs_ue(struct bitstream *bs);
int32_t bs_se(struct bitstream *bs);
#endif