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_AVSD_REG_H__ 18 #define __HAL_AVSD_REG_H__ 19 20 #include "mpp_debug.h" 21 #include "mpp_device.h" 22 23 #include "parser_api.h" 24 #include "hal_avsd_api.h" 25 #include "avsd_syntax.h" 26 27 #define AVSD_REGISTERS 60 28 29 typedef struct { 30 RK_U32 sw00; 31 struct { 32 RK_U32 dec_e : 1; 33 RK_U32 reserve0 : 3; 34 RK_U32 dec_irq_dis : 1; 35 RK_U32 dec_abort_e : 1; 36 RK_U32 reserve1 : 2; 37 RK_U32 dec_irq : 1; 38 RK_U32 reserve2 : 2; 39 RK_U32 dec_abort_int : 1; 40 RK_U32 dec_rdy_int : 1; 41 RK_U32 dec_bus_int : 1; 42 RK_U32 dec_buffer_int : 1; 43 RK_U32 reserve3 : 1; 44 RK_U32 dec_error_int : 1; 45 RK_U32 reserve4 : 1; 46 RK_U32 dec_timeout : 1; 47 RK_U32 reserve5 : 5; 48 RK_U32 dec_pic_inf : 1; 49 RK_U32 reserve6 : 7; 50 } sw01; 51 struct { 52 RK_U32 dec_max_burst : 5; 53 RK_U32 dec_scmd_dis : 1; 54 RK_U32 dec_adv_pre_dis : 1; 55 RK_U32 tiled_mode_lsb : 1; 56 RK_U32 dec_out_endian : 1; 57 RK_U32 dec_in_endian : 1; 58 RK_U32 dec_clk_gate_e : 1; 59 RK_U32 dec_latency : 6; 60 RK_U32 dec_out_tiled_e : 1; 61 RK_U32 dec_data_disc_e : 1; 62 RK_U32 dec_outswap32_e : 1; 63 RK_U32 dec_inswap32_e : 1; 64 RK_U32 dec_strendian_e : 1; 65 RK_U32 dec_strswap32_e : 1; 66 RK_U32 dec_timeout_e : 1; 67 RK_U32 dec_axi_rd_id : 8; 68 } sw02; 69 struct { 70 RK_U32 dec_axi_wr_id : 8; 71 RK_U32 dec_ahb_hlock_e : 1; 72 RK_U32 picord_count_e : 1; 73 RK_U32 reserve0 : 1; 74 RK_U32 reftopfirst_e : 1; 75 RK_U32 write_mvs_e : 1; 76 RK_U32 pic_fixed_quant : 1; 77 RK_U32 filtering_dis : 1; 78 RK_U32 dec_out_dis : 1; 79 RK_U32 ref_topfield_e : 1; 80 RK_U32 reserve1 : 1; 81 RK_U32 fwd_interlace_e : 1; 82 RK_U32 pic_topfiled_e : 1; 83 RK_U32 pic_inter_e : 1; 84 RK_U32 pic_b_e : 1; 85 RK_U32 pic_fieldmode_e : 1; 86 RK_U32 pic_interlace_e : 1; 87 RK_U32 reserve2 : 2; 88 RK_U32 skip_mode : 1; 89 RK_U32 rlc_mode_e : 1; 90 RK_U32 dec_mode : 4; 91 } sw03; 92 struct { 93 RK_U32 pic_refer_flag : 1; 94 RK_U32 reverse0 : 10; 95 RK_U32 pic_mb_height_p : 8; 96 RK_U32 mb_width_off : 4; 97 RK_U32 pic_mb_width : 9; 98 } sw04; 99 struct { 100 RK_U32 beta_offset : 5; 101 RK_U32 alpha_offset : 5; 102 RK_U32 reserve1 : 16; 103 RK_U32 strm_start_bit : 6; 104 } sw05; 105 struct { 106 RK_U32 stream_len : 24; 107 RK_U32 stream_len_ext : 1; 108 RK_U32 init_qp : 6; 109 RK_U32 start_code_e : 1; 110 } sw06; 111 struct { 112 RK_U32 reserve0 : 25; 113 RK_U32 avs_h_ext : 1; 114 RK_U32 reserve1 : 6; 115 } sw07; 116 RK_U32 sw08; 117 RK_U32 sw09; 118 RK_U32 sw10; 119 RK_U32 sw11; 120 struct { 121 RK_U32 rlc_vlc_base; 122 } sw12; 123 struct { 124 RK_U32 dec_out_base; 125 } sw13; 126 union { 127 RK_U32 refer0_base; 128 struct { 129 RK_U32 refer0_topc_e : 1; 130 RK_U32 refer0_field_e : 1; 131 }; 132 } sw14; 133 union { 134 RK_U32 refer1_base; 135 struct { 136 RK_U32 refer1_topc_e : 1; 137 RK_U32 refer1_field_e : 1; 138 }; 139 } sw15; 140 union { 141 RK_U32 refer2_base; 142 struct { 143 RK_U32 refer2_topc_e : 1; 144 RK_U32 refer2_field_e : 1; 145 }; 146 } sw16; 147 union { 148 RK_U32 refer3_base; 149 struct { 150 RK_U32 refer3_topc_e : 1; 151 RK_U32 refer3_field_e : 1; 152 }; 153 } sw17; 154 struct { 155 RK_U32 prev_anc_type : 1; 156 RK_U32 reverse0 : 31; 157 } sw18; 158 RK_U32 sw19_27[9]; 159 struct { 160 RK_U32 ref_invd_cur_0 : 16; 161 RK_U32 ref_invd_cur_1 : 16; 162 } sw28; 163 struct { 164 RK_U32 ref_invd_cur_2 : 16; 165 RK_U32 ref_invd_cur_3 : 16; 166 } sw29; 167 struct { 168 RK_U32 ref_dist_cur_0 : 16; 169 RK_U32 ref_dist_cur_1 : 16; 170 } sw30; 171 struct { 172 RK_U32 ref_dist_cur_2 : 16; 173 RK_U32 ref_dist_cur_3 : 16; 174 } sw31; 175 struct { 176 RK_U32 ref_invd_col_0 : 16; 177 RK_U32 ref_invd_col_1 : 16; 178 } sw32; 179 struct { 180 RK_U32 ref_invd_col_2 : 16; 181 RK_U32 ref_invd_col_3 : 16; 182 } sw33; 183 struct { 184 RK_U32 reserve0 : 2; 185 RK_U32 pred_bc_tap_1_1 : 10; 186 RK_U32 pred_bc_tap_1_0 : 10; 187 RK_U32 pred_bc_tap_0_3 : 10; 188 } sw34; 189 struct { 190 RK_U32 reserve0 : 12; 191 RK_U32 pred_bc_tap_1_3 : 10; 192 RK_U32 pred_bc_tap_1_2 : 10; 193 } sw35; 194 RK_U32 sw36_40[5]; 195 struct { 196 RK_U32 dir_mv_base : 32; 197 } sw41; 198 struct { 199 RK_U32 ref_delta_cur_3 : 3; 200 RK_U32 ref_delta_cur_2 : 3; 201 RK_U32 ref_delta_cur_1 : 3; 202 RK_U32 ref_delta_cur_0 : 3; 203 RK_U32 ref_delta_col_3 : 3; 204 RK_U32 ref_delta_col_2 : 3; 205 RK_U32 ref_delta_col_1 : 3; 206 RK_U32 ref_delta_col_0 : 3; 207 RK_U32 weight_qp_1 : 8; 208 } sw42; 209 struct { 210 RK_U32 weight_qp_5 : 8; 211 RK_U32 weight_qp_4 : 8; 212 RK_U32 weight_qp_3 : 8; 213 RK_U32 weight_qp_2 : 8; 214 } sw43; 215 struct { 216 RK_U32 weight_qp_0 : 8; 217 RK_U32 qp_delta_cr : 6; 218 RK_U32 qp_delta_cb : 6; 219 RK_U32 pb_field_enhance_e : 1; 220 RK_U32 no_fwd_ref_e : 1; 221 RK_U32 avs_aec_e : 1; 222 RK_U32 weight_qp_model : 2; 223 RK_U32 weight_qp_e : 1; 224 RK_U32 dec_avsp_ena : 1; 225 RK_U32 reserve0 : 5; 226 } sw44; 227 struct { 228 RK_U32 dir_mv_base2 : 32; 229 } sw45; 230 RK_U32 sw46; 231 RK_U32 sw47; 232 struct { 233 RK_U32 reserve0 : 14; 234 RK_U32 startmb_y : 9; 235 RK_U32 startmb_x : 9; 236 } sw48; 237 struct { 238 RK_U32 reserve0 : 2; 239 RK_U32 pred_bc_tap_0_2 : 10; 240 RK_U32 pred_bc_tap_0_1 : 10; 241 RK_U32 pred_bc_tap_0_0 : 10; 242 } sw49; 243 RK_U32 sw50; 244 struct { 245 RK_U32 refbu_y_offset : 9; 246 RK_U32 reserve0 : 3; 247 RK_U32 refbu_fparmod_e : 1; 248 RK_U32 refbu_eval_e : 1; 249 RK_U32 refbu_picid : 5; 250 RK_U32 refbu_thr : 12; 251 RK_U32 refbu_e : 1; 252 } sw51; 253 struct { 254 RK_U32 refbu_intra_sum : 16; 255 RK_U32 refbu_hit_sum : 16; 256 } sw52; 257 struct { 258 RK_U32 refbu_y_mv_sum : 22; 259 RK_U32 reserve0 : 10; 260 } sw53; 261 RK_U32 sw54; 262 struct { 263 RK_U32 apf_threshold : 14; 264 RK_U32 refbu2_picid : 5; 265 RK_U32 refbu2_thr : 12; 266 RK_U32 refbu2_buf_e : 1; 267 } sw55; 268 269 struct { 270 RK_U32 refbu_bot_sum : 16; 271 RK_U32 refbu_top_sum : 16; 272 } sw56; 273 RK_U32 sw57; 274 struct { 275 RK_U32 reserve0 : 31; 276 RK_U32 serv_merge_dis : 1; 277 } sw58; 278 RK_U32 sw59; 279 } AvsdPlusRegs_t; 280 281 #endif /*__HAL_AVSD_PLUS_REG_H__*/ 282