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_VP8E_VEPU1_REG_H__ 18 #define __HAL_VP8E_VEPU1_REG_H__ 19 20 #include "rk_type.h" 21 22 typedef struct { 23 RK_U32 sw0; 24 25 struct { 26 RK_U32 val : 32; 27 } sw1; 28 29 struct { 30 RK_U32 val : 32; 31 } sw2; 32 33 RK_U32 sw3_4[2]; 34 35 struct { 36 RK_U32 base_stream : 32; 37 } sw5; 38 39 struct { 40 RK_U32 base_control : 32; 41 } sw6; 42 43 struct { 44 RK_U32 base_ref_lum : 32; 45 } sw7; 46 47 struct { 48 RK_U32 base_ref_chr : 32; 49 } sw8; 50 51 struct { 52 RK_U32 base_rec_lum : 32; 53 } sw9; 54 55 struct { 56 RK_U32 base_rec_chr : 32; 57 } sw10; 58 59 struct { 60 RK_U32 base_in_lum : 32; 61 } sw11; 62 63 struct { 64 RK_U32 base_in_cb : 32; 65 } sw12; 66 67 struct { 68 RK_U32 base_in_cr : 32; 69 } sw13; 70 71 struct { 72 RK_U32 enable : 1; 73 RK_U32 encoding_mode : 2; 74 RK_U32 picture_type : 2; 75 RK_U32 : 1; 76 RK_U32 rec_write_disable : 1; 77 RK_U32 : 3; 78 RK_U32 height : 9; 79 RK_U32 width : 9; 80 RK_U32 int_slice_ready : 1; 81 RK_U32 nal_size_write : 1; 82 RK_U32 mv_write : 1; 83 RK_U32 int_timeout : 1; 84 } sw14; 85 86 struct { 87 RK_U32 input_rot : 2; 88 RK_U32 input_format : 4; 89 RK_U32 y_fill : 4; 90 RK_U32 x_fill : 2; 91 RK_U32 row_length : 14; 92 RK_U32 lum_offset : 3; 93 RK_U32 chr_offset : 3; 94 } sw15; 95 96 struct { 97 RK_U32 base_ref_lum2 : 32; 98 } sw16; 99 100 struct { 101 RK_U32 base_ref_chr2 : 32; 102 } sw17; 103 104 struct { 105 RK_U32 ip_intra16_favor : 16; 106 RK_U32 stream_mode : 1; 107 RK_U32 inter_4_restrict : 1; 108 RK_U32 cabac_enable : 1; 109 RK_U32 cabac_initidc : 2; 110 RK_U32 transform_8x8 : 1; 111 RK_U32 disable_qp_mv : 1; 112 RK_U32 slice_size : 7; 113 RK_U32 deblocking : 2; 114 } sw18; 115 116 struct { 117 RK_U32 dmv_penalty1p : 10; 118 RK_U32 dmv_penalty4p : 10; 119 RK_U32 dmv_penaltyqp : 10; 120 RK_U32 split_mv : 1; 121 RK_U32 : 1; 122 } sw19; 123 124 struct { 125 RK_U32 split_penalty_8x4 : 10; 126 RK_U32 split_penalty_8x8 : 10; 127 RK_U32 split_penalty_16x8 : 10; 128 RK_U32 : 2; 129 } sw20; 130 131 struct { 132 RK_U32 inter_favor : 16; 133 RK_U32 num_slices_ready : 8; 134 RK_U32 skip_penalty : 8; 135 } sw21; 136 137 struct { 138 RK_U32 strm_hdr_rem1 : 32; 139 } sw22; 140 141 struct { 142 RK_U32 strm_hdr_rem2 : 32; 143 } sw23; 144 145 struct { 146 RK_U32 strm_buf_limit : 32; 147 } sw24; 148 149 struct { 150 RK_U32 qp_sum : 21; 151 RK_U32 : 1; 152 RK_U32 mad_threshold : 6; 153 RK_U32 mad_qp_delta : 4; 154 } sw25; 155 156 struct { 157 RK_U32 base_prob_count : 32; 158 } sw26; 159 160 struct { 161 RK_U32 y1_quant_dc : 14; 162 RK_U32 y1_zbin_dc : 9; 163 RK_U32 y1_round_dc : 8; 164 RK_U32 : 1; 165 } sw27; 166 167 struct { 168 RK_U32 y1_quant_ac : 14; 169 RK_U32 y1_zbin_ac : 9; 170 RK_U32 y1_round_ac : 8; 171 RK_U32 : 1; 172 } sw28; 173 174 struct { 175 RK_U32 y2_quant_dc : 14; 176 RK_U32 y2_zbin_dc : 9; 177 RK_U32 y2_round_dc : 8; 178 RK_U32 : 1; 179 } sw29; 180 181 struct { 182 RK_U32 y2_quant_ac : 14; 183 RK_U32 y2_zbin_ac : 9; 184 RK_U32 y2_round_ac : 8; 185 RK_U32 : 1; 186 } sw30; 187 188 struct { 189 RK_U32 ch_quant_dc : 14; 190 RK_U32 ch_zbin_dc : 9; 191 RK_U32 ch_round_dc : 8; 192 RK_U32 : 1; 193 } sw31; 194 195 struct { 196 RK_U32 ch_quant_ac : 14; 197 RK_U32 ch_zbin_ac : 9; 198 RK_U32 ch_round_ac : 8; 199 RK_U32 : 1; 200 } sw32; 201 202 struct { 203 RK_U32 y1_dequant_dc : 8; 204 RK_U32 y1_dequant_ac : 9; 205 RK_U32 y2_dequant_dc : 9; 206 RK_U32 mv_ref_idx : 2; 207 RK_U32 : 4; 208 } sw33; 209 210 struct { 211 RK_U32 y2_dequant_ac : 9; 212 RK_U32 ch_dequant_dc : 8; 213 RK_U32 ch_dequant_ac : 9; 214 RK_U32 mv_ref_idx2 : 2; 215 RK_U32 ref2_enable : 1; 216 RK_U32 segment_enable : 1; 217 RK_U32 segment_map_update : 1; 218 RK_U32 : 1; 219 } sw34; 220 221 struct { 222 RK_U32 bool_enc_value : 32; 223 } sw35; 224 225 struct { 226 RK_U32 bool_enc_range : 8; 227 RK_U32 bool_enc_value_bits : 5; 228 RK_U32 dct_partition_count : 2; 229 RK_U32 filter_level : 6; 230 RK_U32 filter_sharpness : 3; 231 RK_U32 golden_penalty : 8; 232 } sw36; 233 234 struct { 235 RK_U32 rlc_sum : 23; 236 RK_U32 start_offset : 6; 237 RK_U32 : 3; 238 } sw37; 239 240 struct { 241 RK_U32 mb_count : 16; 242 RK_U32 mad_count : 16; 243 } sw38; 244 245 struct { 246 RK_U32 base_next_lum : 32; 247 } sw39; 248 249 struct { 250 RK_U32 stab_minimum : 24; 251 RK_U32 : 6; 252 RK_U32 stab_mode : 2; 253 } sw40; 254 RK_U32 sw41_50[10]; 255 256 struct { 257 RK_U32 base_cabac_ctx : 32; 258 } sw51; 259 260 struct { 261 RK_U32 base_mv_write : 32; 262 } sw52; 263 264 struct { 265 RK_U32 rgb_coeff_a : 16; 266 RK_U32 rgb_coeff_b : 16; 267 } sw53; 268 269 struct { 270 RK_U32 rgb_coeff_c : 16; 271 RK_U32 rgb_coeff_e : 16; 272 } sw54; 273 274 struct { 275 RK_U32 rgb_coeff_f : 16; 276 RK_U32 r_mask_msb : 5; 277 RK_U32 g_mask_msb : 5; 278 RK_U32 b_mask_msb : 5; 279 RK_U32 : 1; 280 } sw55; 281 282 struct { 283 RK_U32 intra_area_bottom : 8; 284 RK_U32 intra_area_top : 8; 285 RK_U32 intra_area_right : 8; 286 RK_U32 intra_area_left : 8; 287 } sw56; 288 289 struct { 290 RK_U32 cir_interval : 16; 291 RK_U32 cir_start : 16; 292 } sw57; 293 294 struct { 295 RK_U32 base_partition1 : 32; 296 } sw58; 297 298 struct { 299 RK_U32 base_partition2 : 32; 300 } sw59; 301 302 struct { 303 RK_U32 roi1_bottom : 8; 304 RK_U32 roi1_top : 8; 305 RK_U32 roi1_right : 8; 306 RK_U32 roi1_left : 8; 307 } sw60; 308 309 struct { 310 RK_U32 roi2_bottom : 8; 311 RK_U32 roi2_top : 8; 312 RK_U32 roi2_right : 8; 313 RK_U32 roi2_left : 8; 314 } sw61; 315 316 struct { 317 RK_U32 roi2_delta_qp : 4; 318 RK_U32 roi1_delta_qp : 4; 319 RK_U32 mvc_inter_view_flag : 1; 320 RK_U32 mvc_anchor_pic_flag : 1; 321 RK_U32 mvc_temporal_id : 3; 322 RK_U32 mvc_view_id : 3; 323 RK_U32 mvc_priority_id : 3; 324 RK_U32 split_penalty4x4 : 9; 325 RK_U32 zero_mv_favor : 4; 326 } sw62; 327 328 RK_U32 sw63; 329 330 struct { 331 RK_U32 mode0_penalty : 12; 332 RK_U32 mode1_penalty : 12; 333 RK_U32 : 8; 334 } sw64; 335 336 struct { 337 RK_U32 mode2_penalty : 12; 338 RK_U32 mode3_penalty : 12; 339 RK_U32 : 8; 340 } sw65; 341 342 struct { 343 RK_U32 b_mode_0_penalty : 12; 344 RK_U32 b_mode_1_penalty : 12; 345 RK_U32 : 8; 346 } sw66_70[5]; 347 348 struct { 349 RK_U32 base_segment_map : 32; 350 } sw71; 351 352 union { 353 struct { 354 RK_U32 y1_quant_dc : 14; 355 RK_U32 y1_zbin_dc : 9; 356 RK_U32 y1_round_dc : 8; 357 RK_U32 : 1; 358 } num_0; 359 360 struct { 361 RK_U32 y1_quant_ac : 14; 362 RK_U32 y1_zbin_ac : 9; 363 RK_U32 y1_round_ac : 8; 364 RK_U32 : 1; 365 } num_1; 366 367 struct { 368 RK_U32 y2_quant_dc : 14; 369 RK_U32 y2_zbin_dc : 9; 370 RK_U32 y2_round_dc : 8; 371 RK_U32 : 1; 372 } num_2; 373 374 struct { 375 RK_U32 y2_quant_ac : 14; 376 RK_U32 y2_zbin_ac : 9; 377 RK_U32 y2_round_ac : 8; 378 RK_U32 : 1; 379 } num_3; 380 381 struct { 382 RK_U32 ch_quant_dc : 14; 383 RK_U32 ch_zbin_dc : 9; 384 RK_U32 ch_round_dc : 8; 385 RK_U32 : 1; 386 } num_4; 387 388 struct { 389 RK_U32 ch_quant_ac : 14; 390 RK_U32 ch_zbin_ac : 9; 391 RK_U32 ch_round_ac : 8; 392 RK_U32 : 1; 393 } num_5; 394 395 struct { 396 RK_U32 y1_dequant_dc : 8; 397 RK_U32 y1_dequant_ac : 9; 398 RK_U32 y2_dequant_dc : 9; 399 RK_U32 : 6; 400 } num_6; 401 402 struct { 403 RK_U32 y2_dequant_ac : 9; 404 RK_U32 ch_dequant_dc : 8; 405 RK_U32 ch_dequant_ac : 9; 406 RK_U32 filter_level : 6; 407 } num_7; 408 409 } sw72_95[24]; 410 411 struct { 412 RK_U32 penalty_0 : 8; 413 RK_U32 penalty_1 : 8; 414 RK_U32 penalty_2 : 8; 415 RK_U32 penalty_3 : 8; 416 } sw96_127[32]; 417 418 struct { 419 RK_U32 qpel_penalty_0 : 8; 420 RK_U32 qpel_penalty_1 : 8; 421 RK_U32 qpel_penalty_2 : 8; 422 RK_U32 qpel_penalty_3 : 8; 423 } sw128_159[32]; 424 425 426 struct { 427 RK_U32 cost_inter : 12; 428 RK_U32 dmv_cost_const : 12; 429 RK_U32 : 8; 430 } sw160; 431 432 struct { 433 RK_U32 cost_golden_ref : 12; 434 RK_U32 : 20; 435 } sw161; 436 437 struct { 438 RK_U32 lf_ref_delta0 : 7; //vp8_loopfilter_intra 439 RK_U32 lf_ref_delta1 : 7; //vp8_loopfilter_lastref 440 RK_U32 lf_ref_delta2 : 7; //vp8_loopfilter_glodenref 441 RK_U32 lf_ref_delta3 : 7; //vp8_loopfilter_alterf 442 RK_U32 : 4; 443 } sw162; 444 445 struct { 446 RK_U32 lf_mode_delta0 : 7; //vp8_loopfilter_bpred 447 RK_U32 lf_mode_delta1 : 7; //vp8_loopfilter_zeromv 448 RK_U32 lf_mode_delta2 : 7; //vp8_loopfilter_newmv 449 RK_U32 lf_mode_delta3 : 7; //vp8_loopfilter_splitmv 450 RK_U32 : 4; 451 } sw163; 452 453 } Vp8eVepu1Reg_t; 454 455 #endif /*__HAL_VP8E_VEPU1_REG_H__*/ 456