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 RK_U8 color_space_last; 38 RK_U8 last_frame_type; 39 } Vp9dLastInfo; 40 41 typedef struct Vp9dRegBuf_t { 42 RK_S32 use_flag; 43 MppBuffer global_base; 44 MppBuffer probe_base; 45 MppBuffer count_base; 46 MppBuffer segid_cur_base; 47 MppBuffer segid_last_base; 48 void *hw_regs; 49 MppBuffer rcb_buf; 50 } Vp9dRegBuf; 51 52 typedef struct HalVp9dCtx_t { 53 /* for hal api call back */ 54 const MppHalApi *api; 55 56 /* for hardware info */ 57 MppClientType client_type; 58 RK_U32 hw_id; 59 MppDev dev; 60 61 MppBufSlots slots; 62 MppBufSlots packet_slots; 63 MppBufferGroup group; 64 MppCbCtx *dec_cb; 65 RK_U32 fast_mode; 66 void* hw_ctx; 67 68 const MppDecHwCap *hw_info; 69 } HalVp9dCtx; 70 71 #endif /*__HAL_VP9D_CTX_H__*/ 72