xref: /rockchip-linux_mpp/mpp/hal/vpu/vp8e/hal_vp8e_putbit.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /*
2  * Copyright 2017 Rockchip Electronics Co. LTD
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __HAL_VP8E_PUT_BIT_H__
18 #define __HAL_VP8E_PUT_BIT_H__
19 
20 #include "rk_type.h"
21 #include "mpp_err.h"
22 
23 typedef struct {
24     RK_U8 *data;
25     RK_U8 *p_data;
26     RK_S32 size;
27     RK_S32 byte_cnt;
28 
29     RK_S32 range;
30     RK_S32 bottom;
31     RK_S32 bits_left;
32 } Vp8ePutBitBuf;
33 
34 typedef struct {
35     RK_S32 value;
36     RK_S32 number;
37     RK_S32 index[9];
38 } Vp8eTree;
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 MPP_RET vp8e_put_lit(Vp8ePutBitBuf *bitbuf, RK_S32 value, RK_S32 number);
45 MPP_RET vp8e_buffer_gap(Vp8ePutBitBuf *bitbuf, RK_S32 gap);
46 MPP_RET vp8e_buffer_overflow(Vp8ePutBitBuf *bitbuf);
47 MPP_RET vp8e_put_byte(Vp8ePutBitBuf *bitbuf, RK_S32 byte);
48 MPP_RET vp8e_put_bool(Vp8ePutBitBuf *bitbuf, RK_S32 prob, RK_S32 boolValue);
49 MPP_RET vp8e_set_buffer(Vp8ePutBitBuf *bitbuf, RK_U8 *data, RK_S32 size);
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif /*__HAL_VP8E_PUTBIT_H__*/
56