blob: d6d2eac88b93e99e1d0d9baa6b4f66e46c1cde4e
1 | /* |
2 | * drivers/amlogic/media_modules/amvdec_ports/decoder/h264_stream.h |
3 | * |
4 | * Copyright (C) 2017 Amlogic, Inc. All rights reserved. |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, but WITHOUT |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
14 | * more details. |
15 | * |
16 | */ |
17 | |
18 | #ifndef _H264_STREAM_H |
19 | #define _H264_STREAM_H |
20 | |
21 | #include "utils.h" |
22 | |
23 | struct h264_stream_t { |
24 | unsigned char *data; |
25 | unsigned int size; |
26 | int bit_pos; |
27 | int byte_pos; |
28 | }; |
29 | |
30 | void h264_stream_set(struct h264_stream_t *s, unsigned char *data, int size); |
31 | unsigned int h264_stream_read_bits(struct h264_stream_t *s, unsigned int n); |
32 | unsigned int h264_stream_peek_bits(struct h264_stream_t *s, unsigned int n); |
33 | unsigned int h264_stream_read_bytes(struct h264_stream_t *s, unsigned int n); |
34 | unsigned int h264_stream_peek_bytes(struct h264_stream_t *s, unsigned int n); |
35 | int h264_stream_bits_remaining(struct h264_stream_t *s); |
36 | int h264_stream_bytes_remaining(struct h264_stream_t *s); |
37 | |
38 | #endif //_H264_STREAM_H |
39 | |
40 |