xref: /rockchip-linux_mpp/mpp/hal/vpu/vp8d/hal_vp8d_base.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 __HAL_VP8D_BASE_H__
18 #define __HAL_VP8D_BASE_H__
19 
20 #include <stdio.h>
21 
22 #include "mpp_hal.h"
23 #include "mpp_buf_slot.h"
24 #include "mpp_device.h"
25 
26 #include "hal_dec_task.h"
27 
28 #include "vp8d_syntax.h"
29 
30 #define VP8H_DBG_FUNCTION          (0x00000001)
31 #define VP8H_DBG_REG               (0x00000002)
32 #define VP8H_DBG_DUMP_REG          (0x00000004)
33 #define VP8H_DBG_IRQ               (0x00000008)
34 
35 extern RK_U32 hal_vp8d_debug;
36 
37 #define vp8h_dbg(flag, fmt, ...) \
38      _mpp_dbg_f(hal_vp8d_debug, flag, fmt, ## __VA_ARGS__)
39 
40 #define FUN_T(tag) \
41     do {\
42         if (VP8H_DBG_FUNCTION & hal_vp8d_debug)\
43             { mpp_log("%s: line(%d), func(%s)", tag, __LINE__, __FUNCTION__); }\
44     } while (0)
45 
46 typedef struct VP8DHalContext {
47     MppBufSlots     packet_slots;
48     MppBufSlots     frame_slots;
49     MppDev          dev;
50     void            *regs;
51     RK_U8           reg_size;
52     MppBufferGroup  group;
53     MppBuffer       probe_table;
54     MppBuffer       seg_map;
55     RK_U32          dec_frame_cnt;
56     FILE            *fp_reg_in;
57     FILE            *fp_reg_out;
58     MppHalApi       hal_api;
59 } VP8DHalContext_t;
60 
61 #endif
62