summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/vl/vl_bitstream_parser.h
blob: 46bebf470ff69d04e8da0d6947fad681411f6062 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef vl_bitstream_parser_h
#define vl_bitstream_parser_h

#include <stdbool.h>

struct vl_bitstream_parser
{
   unsigned num_bitstreams;
   const unsigned **bitstreams;
   const unsigned *sizes;
   unsigned cur_bitstream;
   unsigned cursor;
};

bool vl_bitstream_parser_init(struct vl_bitstream_parser *parser,
                              unsigned num_bitstreams,
                              const void **bitstreams,
                              const unsigned *sizes);

void vl_bitstream_parser_cleanup(struct vl_bitstream_parser *parser);

unsigned
vl_bitstream_parser_get_bits(struct vl_bitstream_parser *parser,
                             unsigned how_many_bits);

unsigned
vl_bitstream_parser_show_bits(struct vl_bitstream_parser *parser,
                              unsigned how_many_bits);

void vl_bitstream_parser_forward(struct vl_bitstream_parser *parser,
                                 unsigned how_many_bits);

void vl_bitstream_parser_rewind(struct vl_bitstream_parser *parser,
                                unsigned how_many_bits);

#endif /* vl_bitstream_parser_h */