1 /* 2 * 3 * Copyright 2015 Rockchip Electronics Co. LTD 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 #ifndef __MPP_BITPUT_H__ 19 #define __MPP_BITPUT_H__ 20 21 #include "rk_type.h" 22 #include "mpp_err.h" 23 #include "mpp_common.h" 24 25 typedef struct bitput_ctx_t { 26 RK_U32 buflen; //!< max buf length, 64bit uint 27 RK_U32 index; //!< current uint position 28 RK_U64 *pbuf; //!< outpacket data 29 RK_U64 bvalue; //!< buffer value, 64 bit 30 RK_U8 bitpos; //!< bit pos in 64bit 31 RK_U32 size; //!< data size,except header 32 } BitputCtx_t; 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif 37 38 RK_S32 mpp_set_bitput_ctx(BitputCtx_t *bp, RK_U64 *data, RK_U32 len); 39 void mpp_put_bits(BitputCtx_t *bp, RK_U64 invalue, RK_S32 lbits); 40 void mpp_put_align(BitputCtx_t *bp, RK_S32 align_bits, int flag); 41 42 #ifdef __cplusplus 43 } 44 #endif 45 46 #endif 47