vp8: use range decoder from libvpx.
[platform/upstream/gstreamer.git] / ext / libvpx / gstlibvpx.h
1 /*
2  * gstlibvpx.h - GStreamer/libvpx glue
3  *
4  * Use of this source code is governed by a BSD-style license
5  * that can be found in the LICENSE file in the root of the source
6  * tree. An additional intellectual property rights grant can be found
7  * in the file PATENTS.  All contributing project authors may
8  * be found in the AUTHORS file in the root of the source tree.
9  */
10
11 #ifndef GST_LIBVPX_H
12 #define GST_LIBVPX_H
13
14 #include <stdint.h>
15 #include <stdbool.h>
16
17 typedef struct _vp8_bool_decoder        vp8_bool_decoder;
18 typedef struct _vp8_bool_decoder_state  vp8_bool_decoder_state;
19
20 struct _vp8_bool_decoder {
21     uintptr_t   private[16];
22 };
23
24 struct _vp8_bool_decoder_state {
25     uint8_t     range; /* Current "range" value (<= 255) */
26     uint8_t     value; /* Current "value" value */
27     uint8_t     count; /* Number of bits shifted out of value (<= 7) */
28 };
29
30 bool
31 vp8_bool_decoder_init (vp8_bool_decoder * bd, const uint8_t * buf,
32     unsigned int buf_size);
33
34 int
35 vp8_bool_decoder_read (vp8_bool_decoder * bd, uint8_t prob);
36
37 int
38 vp8_bool_decoder_read_literal (vp8_bool_decoder * bd, int bits);
39
40 unsigned int
41 vp8_bool_decoder_get_pos (vp8_bool_decoder * bd);
42
43 void
44 vp8_bool_decoder_get_state (vp8_bool_decoder * bd,
45     vp8_bool_decoder_state * state);
46
47 void
48 vp8_init_token_update_probs (uint8_t probs[4][8][3][11]);
49
50 void
51 vp8_init_default_token_probs (uint8_t probs[4][8][3][11]);
52
53 void
54 vp8_init_mv_update_probs (uint8_t probs[2][19]);
55
56 void
57 vp8_init_default_mv_probs (uint8_t probs[2][19]);
58
59 void
60 vp8_init_default_intra_mode_probs (uint8_t y_probs[4], uint8_t uv_probs[3]);
61
62 void
63 vp8_init_default_inter_mode_probs (uint8_t y_probs[4], uint8_t uv_probs[3]);
64
65 #endif /* GST_LIBVPX_H */