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_M2VD_BASE_H__ 18 #define __HAL_M2VD_BASE_H__ 19 20 #include <stdio.h> 21 22 #include "mpp_debug.h" 23 24 #include "mpp_hal.h" 25 #include "mpp_buf_slot.h" 26 #include "mpp_device.h" 27 28 #include "m2vd_syntax.h" 29 30 #define M2VD_BUF_SIZE_QPTAB (256) 31 #define DEC_LITTLE_ENDIAN 1 32 #define DEC_BIG_ENDIAN 0 33 #define DEC_BUS_BURST_LENGTH_UNDEFINED 0 34 #define DEC_BUS_BURST_LENGTH_4 5 35 #define DEC_BUS_BURST_LENGTH_8 8 36 #define DEC_BUS_BURST_LENGTH_16 16 37 38 #define M2VH_DBG_FUNCTION (0x00000001) 39 #define M2VH_DBG_REG (0x00000002) 40 #define M2VH_DBG_DUMP_REG (0x00000004) 41 #define M2VH_DBG_IRQ (0x00000008) 42 43 extern RK_U32 m2vh_debug; 44 45 #define m2vh_dbg_func(tag) \ 46 do {\ 47 if (M2VH_DBG_FUNCTION & m2vh_debug)\ 48 { mpp_log("%s: line(%d), func(%s)", tag, __LINE__, __FUNCTION__); }\ 49 } while (0) 50 51 typedef enum M2VDPicCodingType_e { 52 M2VD_CODING_TYPE_I = 1, 53 M2VD_CODING_TYPE_P = 2, 54 M2VD_CODING_TYPE_B = 3, 55 M2VD_CODING_TYPE_D = 4 56 } M2VDPicCodingType; 57 58 typedef enum M2VDPicStruct_e { 59 M2VD_PIC_STRUCT_TOP_FIELD = 1, 60 M2VD_PIC_STRUCT_BOTTOM_FIELD = 2, 61 M2VD_PIC_STRUCT_FRAME = 3 62 } M2VDPicStruct; 63 64 typedef struct M2vdHalCtx_t { 65 MppHalApi hal_api; 66 MppBufSlots packet_slots; 67 MppBufSlots frame_slots; 68 void *regs; 69 MppBufferGroup group; 70 MppBuffer qp_table; 71 RK_U32 dec_frame_cnt; 72 MppCbCtx *dec_cb; 73 MppDev dev; 74 FILE *fp_reg_in; 75 FILE *fp_reg_out; 76 RK_U32 reg_len; 77 } M2vdHalCtx; 78 79 #endif // __HAL_M2VD_BASE_H__ 80