xref: /rockchip-linux_mpp/mpp/base/inc/mpp_enc_ref.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 __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     RK_S32              max_tlayers;
49     MppEncRefLtFrmCfg   *lt_cfg;
50     MppEncRefStFrmCfg   *st_cfg;
51 
52     /* generated parameter for MppEncRefs */
53     MppEncCpbInfo       cpb_info;
54 } MppEncRefCfgImpl;
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 MppEncRefCfg mpp_enc_ref_default(void);
61 MPP_RET mpp_enc_ref_cfg_copy(MppEncRefCfg dst, MppEncRefCfg src);
62 MppEncCpbInfo *mpp_enc_ref_cfg_get_cpb_info(MppEncRefCfg ref);
63 
64 #define check_is_mpp_enc_ref_cfg(ref) _check_is_mpp_enc_ref_cfg(__FUNCTION__, ref)
65 MPP_RET _check_is_mpp_enc_ref_cfg(const char *func, void *ref);
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif /*__MPP_ENC_REF_H__*/
72