xref: /rockchip-linux_mpp/mpp/codec/enc/h265/h265e_stream.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /*
2  * Copyright 2015 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 __H265E_STREAM_H__
18 #define __H265E_STREAM_H__
19 
20 #include "mpp_bitwrite.h"
21 
22 typedef struct  H265eStream_t {
23     RK_U8 *buf;
24     RK_S32 size;
25     MppWriteCtx enc_stream;
26 } H265eStream;
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 MPP_RET h265e_stream_init(H265eStream *s);
33 MPP_RET h265e_stream_deinit(H265eStream *s);
34 MPP_RET h265e_stream_reset(H265eStream *s);
35 MPP_RET h265e_stream_realign(H265eStream *s);
36 MPP_RET h265e_stream_write_with_log(H265eStream *s,
37                                     RK_U32 val, RK_S32 i_count, char *name);
38 MPP_RET h265e_stream_write1_with_log(H265eStream *s,
39                                      RK_U32 val, char *name);
40 MPP_RET h265e_stream_write_ue_with_log(H265eStream *s,
41                                        RK_U32 val, char *name);
42 MPP_RET h265e_stream_write_se_with_log(H265eStream *s,
43                                        RK_S32 val, char *name);
44 MPP_RET h265e_stream_write32(H265eStream *s, RK_U32 i_bits,
45                              char *name);
46 RK_S32 h265e_stream_size_se( RK_S32 val );
47 MPP_RET h265e_stream_rbsp_trailing(H265eStream *s);
48 MPP_RET h265e_stream_flush(H265eStream *s);
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif /* __H265E_STREAM_H__ */
55