xref: /OK3568_Linux_fs/external/mpp/mpp/hal/common/jpeg/hal_jpege_hdr.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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 __HAL_JPEGE_HDR_H__
18 #define __HAL_JPEGE_HDR_H__
19 
20 #include "jpege_syntax.h"
21 
22 typedef void *JpegeBits;
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 void jpege_bits_init(JpegeBits *ctx);
29 void jpege_bits_deinit(JpegeBits ctx);
30 
31 void jpege_bits_setup(JpegeBits ctx, RK_U8 *buf, RK_S32 size);
32 void jpege_bits_put(JpegeBits ctx, RK_U32 val, RK_S32 len);
33 void jpege_bits_align_byte(JpegeBits ctx);
34 void jpege_seek_bits(JpegeBits ctx, RK_S32 len);
35 RK_U8 *jpege_bits_get_buf(JpegeBits ctx);
36 RK_S32 jpege_bits_get_bitpos(JpegeBits ctx);
37 RK_S32 jpege_bits_get_bytepos(JpegeBits ctx);
38 
39 MPP_RET write_jpeg_header(JpegeBits *bits, JpegeSyntax *syntax,
40                           const RK_U8 *qtable[2]);
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 
46 #endif /*__HAL_JPEGE_HDR_H__*/
47 
48