• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_ENC_REF_H__
19 #define __MPP_ENC_REF_H__
20 
21 #include "rk_venc_ref.h"
22 
23 #define REF_MODE_IS_GLOBAL(mode)    (((mode) >= REF_MODE_GLOBAL) && ((mode) < REF_MODE_GLOBAL_BUTT))
24 #define REF_MODE_IS_LT_MODE(mode)   (((mode) > REF_MODE_LT) && ((mode) < REF_MODE_LT_BUTT))
25 #define REF_MODE_IS_ST_MODE(mode)   (((mode) > REF_MODE_ST) && ((mode) < REF_MODE_ST_BUTT))
26 
27 typedef struct MppEncCpbInfo_t {
28     RK_S32              dpb_size;
29     RK_S32              max_lt_cnt;
30     RK_S32              max_st_cnt;
31     RK_S32              max_lt_idx;
32     RK_S32              max_st_tid;
33     /* loop length of st/lt config */
34     RK_S32              lt_gop;
35     RK_S32              st_gop;
36 } MppEncCpbInfo;
37 
38 typedef struct MppEncRefCfgImpl_t {
39     const char          *name;
40     RK_S32              ready;
41     RK_U32              debug;
42 
43     /* config from user */
44     RK_S32              keep_cpb;
45     RK_S32              max_lt_cfg;
46     RK_S32              max_st_cfg;
47     RK_S32              lt_cfg_cnt;
48     RK_S32              st_cfg_cnt;
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