xref: /OK3568_Linux_fs/external/mpp/mpp/hal/rkdec/vp9d/hal_vp9d_ctx.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright 2020 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_VP9D_CTX_H__
18 #define __HAL_VP9D_CTX_H__
19 
20 #include "mpp_device.h"
21 #include "mpp_hal.h"
22 #include "hal_bufs.h"
23 
24 #define MAX_GEN_REG 3
25 
26 typedef struct Vp9dLastInfo_t {
27     RK_S32      abs_delta_last;
28     RK_S8       last_ref_deltas[4];
29     RK_S8       last_mode_deltas[2];
30     RK_U8       segmentation_enable_flag_last;
31     RK_U8       last_show_frame;
32     RK_U8       last_intra_only;
33     RK_U32      last_width;
34     RK_U32      last_height;
35     RK_S16      feature_data[8][4];
36     RK_U8       feature_mask[8];
37 } Vp9dLastInfo;
38 
39 typedef struct Vp9dRegBuf_t {
40     RK_S32      use_flag;
41     MppBuffer   probe_base;
42     MppBuffer   count_base;
43     MppBuffer   segid_cur_base;
44     MppBuffer   segid_last_base;
45     void        *hw_regs;
46     MppBuffer   rcb_buf;
47 } Vp9dRegBuf;
48 
49 typedef struct HalVp9dCtx_t {
50     /* for hal api call back */
51     const MppHalApi *api;
52 
53     /* for hardware info */
54     MppClientType   client_type;
55     RK_U32          hw_id;
56     MppDev          dev;
57 
58     MppBufSlots     slots;
59     MppBufSlots     packet_slots;
60     MppBufferGroup  group;
61     MppCbCtx        *dec_cb;
62     RK_U32          fast_mode;
63     void*           hw_ctx;
64 
65     const MppDecHwCap   *hw_info;
66 } HalVp9dCtx;
67 
68 #endif /*__HAL_VP9D_CTX_H__*/
69