xref: /OK3568_Linux_fs/external/mpp/mpp/base/inc/mpp_enc_ref.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 __MPP_ENC_REF_H__
18 #define __MPP_ENC_REF_H__
19 
20 #include "rk_venc_ref.h"
21 
22 #define REF_MODE_IS_GLOBAL(mode)    ((mode >= REF_MODE_GLOBAL) && (mode < REF_MODE_GLOBAL_BUTT))
23 #define REF_MODE_IS_LT_MODE(mode)   ((mode > REF_MODE_LT) && (mode < REF_MODE_LT_BUTT))
24 #define REF_MODE_IS_ST_MODE(mode)   ((mode > REF_MODE_ST) && (mode < REF_MODE_ST_BUTT))
25 
26 typedef struct MppEncCpbInfo_t {
27     RK_S32              dpb_size;
28     RK_S32              max_lt_cnt;
29     RK_S32              max_st_cnt;
30     RK_S32              max_lt_idx;
31     RK_S32              max_st_tid;
32     /* loop length of st/lt config */
33     RK_S32              lt_gop;
34     RK_S32              st_gop;
35 } MppEncCpbInfo;
36 
37 typedef struct MppEncRefCfgImpl_t {
38     const char          *name;
39     RK_S32              ready;
40     RK_U32              debug;
41 
42     /* config from user */
43     RK_S32              keep_cpb;
44     RK_S32              max_lt_cfg;
45     RK_S32              max_st_cfg;
46     RK_S32              lt_cfg_cnt;
47     RK_S32              st_cfg_cnt;
48     MppEncRefLtFrmCfg   *lt_cfg;
49     MppEncRefStFrmCfg   *st_cfg;
50 
51     /* generated parameter for MppEncRefs */
52     MppEncCpbInfo       cpb_info;
53 } MppEncRefCfgImpl;
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 MppEncRefCfg mpp_enc_ref_default(void);
60 MPP_RET mpp_enc_ref_cfg_copy(MppEncRefCfg dst, MppEncRefCfg src);
61 MppEncCpbInfo *mpp_enc_ref_cfg_get_cpb_info(MppEncRefCfg ref);
62 
63 #define check_is_mpp_enc_ref_cfg(ref) _check_is_mpp_enc_ref_cfg(__FUNCTION__, ref)
64 MPP_RET _check_is_mpp_enc_ref_cfg(const char *func, void *ref);
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /*__MPP_ENC_REF_H__*/
71