xref: /rockchip-linux_mpp/mpp/hal/vpu/vp8d/hal_vp8d_vdpu2_reg.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_VDPU2_REG_H__
18 #define __HAL_VP8D_VDPU2_REG_H__
19 #include "rk_type.h"
20 
21 #define VP8HWD_VP7             1
22 #define VP8HWD_VP8             2
23 #define VP8HWD_WEBP            3
24 
25 #define DEC_MODE_VP7           9
26 #define DEC_MODE_VP8           10
27 
28 #define VP8D_PROB_TABLE_SIZE  (1<<16) /* TODO */
29 #define VP8D_MAX_SEGMAP_SIZE  (2048 + 1024)  //1920*1080 /* TODO */
30 
31 #define VP8D_REG_NUM    159
32 
33 typedef struct  {
34     RK_U32 ppReg[50];
35     struct {
36         RK_U32  sw_dec_out_tiled_e  : 1;
37         RK_U32  sw_dec_latency      : 6;
38         RK_U32  sw_pic_fixed_quant  : 1;
39         RK_U32  sw_filtering_dis    : 1;
40         RK_U32  sw_skip_mode        : 1;
41         RK_U32  sw_dec_scmd_dis     : 1;
42         RK_U32  sw_dec_adv_pre_dis  : 1;
43         RK_U32  sw_priority_mode    : 1;
44         RK_U32  sw_refbu2_thr       : 12;
45         RK_U32  sw_refbu2_picid     : 5;
46         RK_U32  reserve1            : 2;
47     } reg50_dec_ctrl;
48 
49     struct {
50         RK_U32 sw_stream_len       : 24;
51         RK_U32  reserve1            : 1;
52         RK_U32  sw_init_qp          : 6;
53         RK_U32  reserve2           : 1;
54     } reg51_stream_info;
55 
56     struct {
57         RK_U32  sw_startmb_y        : 8;
58         RK_U32  sw_startmb_x        : 9;
59         RK_U32  sw_apf_threshold    : 14;
60         RK_U32  sw_reserve          : 1;
61     } reg52_error_concealment;
62 
63     RK_U32       reg53_dec_mode;
64 
65     struct {
66         RK_U32  sw_dec_in_endian    : 1;
67         RK_U32  sw_dec_out_endian   : 1;
68         RK_U32  sw_dec_inswap32_e   : 1;
69         RK_U32  sw_dec_outswap32_e  : 1;
70         RK_U32  sw_dec_strswap32_e  : 1;
71         RK_U32  sw_dec_strendian_e  : 1;
72         RK_U32  reserve3            : 26;
73     } reg54_endian;
74 
75     struct {
76         RK_U32  sw_dec_irq      : 1;
77         RK_U32  sw_dec_irq_dis  : 1;
78         RK_U32  reserve0        : 2;
79         RK_U32  sw_dec_rdy_int  : 1;
80         RK_U32  sw_dec_bus_int  : 1;
81         RK_U32  sw_dec_buffer_int   : 1;
82         RK_U32  reserve1        : 1;
83         RK_U32  sw_dec_aso_int  : 1;
84         RK_U32  sw_dec_slice_int    : 1;
85         RK_U32  sw_dec_pic_inf  : 1;
86         RK_U32  reserve2        : 1;
87         RK_U32  sw_dec_error_int: 1;
88         RK_U32  sw_dec_timeout  : 1;
89         RK_U32  reserve3        : 18;
90     } reg55_Interrupt;
91 
92     struct {
93         RK_U32  sw_dec_axi_rn_id    : 8;
94         RK_U32  sw_dec_axi_wr_id    : 8;
95         RK_U32  sw_dec_max_burst    : 5;
96         RK_U32  resever             : 1;
97         RK_U32  sw_dec_data_disc_e  : 1;
98         RK_U32  resever1            : 9;
99     } reg56_axi_ctrl;
100 
101     struct {
102         RK_U32  sw_dec_e            : 1;
103         RK_U32  sw_refbu2_buf_e     : 1;
104         RK_U32  sw_dec_out_dis      : 1;
105         RK_U32  resever             : 1;
106         RK_U32  sw_dec_clk_gate_e   : 1;
107         RK_U32  sw_dec_timeout_e    : 1;
108         RK_U32  sw_picord_count_e   : 1;
109         RK_U32  sw_seq_mbaff_e      : 1;
110         RK_U32  sw_reftopfirst_e    : 1;
111         RK_U32  sw_ref_topfield_e   : 1;
112         RK_U32  sw_write_mvs_e      : 1;
113         RK_U32  sw_sorenson_e       : 1;
114         RK_U32  sw_fwd_interlace_e  : 1;
115         RK_U32  sw_pic_topfield_e   : 1 ;
116         RK_U32  sw_pic_inter_e      : 1;
117         RK_U32  sw_pic_b_e          : 1;
118         RK_U32  sw_pic_fieldmode_e  : 1;
119         RK_U32  sw_pic_interlace_e  : 1;
120         RK_U32  sw_pjpeg_e          : 1;
121         RK_U32  sw_divx3_e          : 1;
122         RK_U32  sw_rlc_mode_e       : 1;
123         RK_U32  sw_ch_8pix_ileav_e  : 1;
124         RK_U32  sw_start_code_e     : 1;
125         RK_U32  resever1            : 8;
126         RK_U32 sw_dec_ahb_hlock_e  : 1;
127 
128     } reg57_enable_ctrl;
129 
130     RK_U32                        reg58_soft_rest;
131 
132     struct {
133         RK_U32  resever             : 2;
134         RK_U32  sw_pred_bc_tap_0_2  : 10;
135         RK_U32  sw_pred_bc_tap_0_1  : 10;
136         RK_U32  sw_pred_bc_tap_0_0  : 10;
137     } reg59;
138 
139     RK_U32          reg60_addit_ch_st_base;
140     RK_U32          reg61_qtable_base;
141     RK_U32          reg62_directmv_base;
142     RK_U32          reg63_cur_pic_base;
143     RK_U32          reg64_input_stream_base;
144 
145     struct {
146         RK_U32  sw_refbu_y_offset   : 9;
147         RK_U32  sw_reserve          : 3;
148         RK_U32  sw_refbu_fparmod_e  : 1;
149         RK_U32  sw_refbu_eval_e     : 1;
150         RK_U32  sw_refbu_picid      : 5;
151         RK_U32  sw_refbu_thr        : 12;
152         RK_U32  sw_refbu_e          : 1;
153     } reg65_refpicbuf_ctrl;
154 
155     struct {
156         RK_U32  build_version   : 3;
157         RK_U32  product_IDen    : 1;
158         RK_U32  minor_version   : 8;
159         RK_U32  major_version   : 4;
160         RK_U32  product_numer   : 16;
161     } reg66_id;
162 
163     struct {
164         RK_U32  sw_reserve          : 25;
165         RK_U32  sw_dec_rtl_rom      : 1;
166         RK_U32  sw_dec_rv_prof      : 2;
167         RK_U32  sw_ref_buff2_exist  : 1;
168         RK_U32  sw_dec_divx_prof    : 1;
169         RK_U32  sw_dec_refbu_ilace  : 1;
170         RK_U32  sw_dec_jpeg_exten   : 1;
171     } reg67_synthesis_cfg;
172 
173     struct {
174         RK_U32  sw_refbu_top_sum    : 16;
175         RK_U32  sw_refbu_bot_sum    : 16;
176     } reg68_sum_of_partitions;
177 
178     struct {
179         RK_U32  sw_refbu_intra_sum  : 16;
180         RK_U32  sw_refbu_hit_sum    : 16;
181     } reg69_sum_inf;
182 
183     struct {
184         RK_U32  sw_refbu_mv_sum : 22;
185         RK_U32  sw_reserve      : 10;
186     } reg70_sum_mv;
187 
188     RK_U32                        reg71_119_reserve[49];
189 
190     struct {
191         RK_U32  sw_pic_mb_h_ext     : 3;
192         RK_U32  sw_pic_mb_w_ext     : 3;
193         RK_U32  sw_alt_scan_e       : 1;
194         RK_U32  sw_mb_height_off    : 4;
195         RK_U32  sw_pic_mb_hight_p   : 8;
196         RK_U32  sw_mb_width_off     : 4;
197         RK_U32  sw_pic_mb_width     : 9;
198     } reg120;
199 
200     struct {
201         RK_U32  sw_resever         : 5;
202         RK_U32  sw_vp7_version     : 1;
203         RK_U32  sw_dc_match0       : 3;
204         RK_U32  sw_dc_match1       : 3;
205         RK_U32  sw_eable_bilinear  : 1;
206         RK_U32  sw_romain_mv       : 1;
207         RK_U32  sw_resever1        : 6;
208         RK_U32  sw_dct2_start_bit  : 6;
209         RK_U32  sw_dct1_start_bit  : 6;
210     } reg121;
211 
212     struct {
213         RK_U32  sw_boolean_range   : 8;
214         RK_U32  sw_boolean_value   : 8;
215         RK_U32  sw_multistream_e   : 1;
216         RK_U32  sw_huffman_e       : 1;
217         RK_U32  sw_strm1_start_bit : 6;
218         RK_U32  sw_resever         : 2;
219         RK_U32  sw_strm_start_bit  : 6;
220     } reg122;
221 
222     struct {
223         RK_U32  sw_dc_comp1   : 16;
224         RK_U32  sw_dc_comp0   : 16;
225     } reg123;
226 
227     struct {
228         RK_U32  sw_stream1_len      : 24;
229         RK_U32  sw_coeffs_part_am   : 4;
230         RK_U32  sw_resever          : 4;
231     } reg124;
232 
233     struct {
234         RK_U32  resever              : 2;
235         RK_U32  sw_pred_bc_tap_5_3   : 10;
236         RK_U32  sw_pred_bc_tap_5_2   : 10;
237         RK_U32  sw_pred_bc_tap_5_1   : 10;
238     } reg125;
239 
240     struct {
241         RK_U32  resever              : 2;
242         RK_U32  sw_pred_bc_tap_6_2   : 10;
243         RK_U32  sw_pred_bc_tap_6_1   : 10;
244         RK_U32  sw_pred_bc_tap_6_0   : 10;
245     } reg126;
246 
247     struct {
248         RK_U32  resever              : 2;
249         RK_U32  sw_pred_bc_tap_7_1   : 10;
250         RK_U32  sw_pred_bc_tap_7_0   : 10;
251         RK_U32  sw_pred_bc_tap_6_3   : 10;
252     } reg127;
253 
254     struct {
255         RK_U32  sw_pred_tap_6_4     : 2;
256         RK_U32  sw_pred_tap_6_M1    : 2;
257         RK_U32  sw_pred_tap_4_4     : 2;
258         RK_U32  sw_pred_tap_4_M1    : 2;
259         RK_U32  sw_pred_tap_2_4     : 2;
260         RK_U32  sw_pred_tap_2_M1    : 2;
261         RK_U32  sw_pred_bc_tap_7_3  : 10;
262         RK_U32  sw_pred_bc_tap_7_2  : 10;
263     } reg128;
264 
265     struct {
266         RK_U32  sw_filt_level_3   : 6;
267         RK_U32  sw_filt_level_2   : 6;
268         RK_U32  sw_filt_level_1   : 6;
269         RK_U32  sw_filt_level_0   : 6;
270         RK_U32  resever           : 8;
271     } reg129;
272 
273     struct {
274         RK_U32  sw_quant_1        : 11;
275         RK_U32  sw_quant_0        : 11;
276         RK_U32  sw_quant_delta_1  : 5;
277         RK_U32  sw_quant_delta_0  : 5;
278     } reg130;
279 
280 
281     RK_U32 reg131_ref0_base;
282 
283     struct {
284         RK_U32  sw_filt_mb_adj_3   : 7;
285         RK_U32  sw_filt_mb_adj_2   : 7;
286         RK_U32  sw_filt_mb_adj_1   : 7;
287         RK_U32  sw_filt_mb_adj_0   : 7;
288         RK_U32  sw_filt_sharpness  : 3;
289         RK_U32  sw_filt_type       : 1;
290     } reg132;
291 
292 
293     struct {
294         RK_U32  sw_filt_ref_adj_3  : 7;
295         RK_U32  sw_filt_ref_adj_2  : 7;
296         RK_U32  sw_filt_ref_adj_1  : 7;
297         RK_U32  sw_filt_ref_adj_0  : 7;
298         RK_U32  sw_resver          : 4;
299     } reg133;
300 
301     RK_U32 reg134;
302     RK_U32 reg135;
303 
304     RK_U32 reg136_golden_ref_base;
305 
306     union {
307         RK_U32 alternate_ref_base;
308         struct {
309             RK_U32  sw_scan_map_5  : 6;
310             RK_U32  sw_scan_map_4  : 6;
311             RK_U32  sw_scan_map_3  : 6;
312             RK_U32  sw_scan_map_2  : 6;
313             RK_U32  sw_scan_map_1  : 6;
314             RK_U32  sw_resver      : 2;
315         };
316     } reg137;
317 
318     struct {
319         RK_U32  sw_scan_map_10 : 6;
320         RK_U32  sw_scan_map_9  : 6;
321         RK_U32  sw_scan_map_8  : 6;
322         RK_U32  sw_scan_map_7  : 6;
323         RK_U32  sw_scan_map_6  : 6;
324         RK_U32  sw_resver      : 2;
325     } reg138;
326 
327     struct {
328         RK_U32  sw_scan_map_15  : 6;
329         RK_U32  sw_scan_map_14  : 6;
330         RK_U32  sw_scan_map_13  : 6;
331         RK_U32  sw_scan_map_12  : 6;
332         RK_U32  sw_scan_map_11  : 6;
333         RK_U32  sw_resver       : 2;
334     } reg139;
335 
336     RK_U32 reg_dct_strm_base[5];
337     RK_U32 reg145_bitpl_ctrl_base;
338     RK_U32 reg_dct_strm1_base[2];
339 
340     struct {
341         RK_U32  sw_slice_h  : 8;
342         RK_U32  sw_resver   : 24;
343     } reg148;
344 
345     RK_U32 reg149_segment_map_base;
346 
347 
348     struct {
349         RK_U32  sw_dct_start_bit_7   : 6;
350         RK_U32  sw_dct_start_bit_6   : 6;
351         RK_U32  sw_dct_start_bit_5   : 6;
352         RK_U32  sw_dct_start_bit_4   : 6;
353         RK_U32  sw_dct_start_bit_3   : 6;
354         RK_U32  sw_resver            : 2;
355     } reg150;
356 
357     struct {
358         RK_U32  sw_quant_3        : 11;
359         RK_U32  sw_quant_2        : 11;
360         RK_U32  sw_quant_delta_3   : 5;
361         RK_U32  sw_quant_delta_2   : 5;
362     } reg151;
363 
364     struct {
365         RK_U32  sw_quant_5        : 11;
366         RK_U32  sw_quant_4        : 11;
367         RK_U32  sw_resver         : 5;
368         RK_U32  sw_quant_delta_4  : 5;
369     } reg152;
370 
371     struct {
372         RK_U32  resever              : 2;
373         RK_U32  sw_pred_bc_tap_1_1   : 10;
374         RK_U32  sw_pred_bc_tap_1_0   : 10;
375         RK_U32  sw_pred_bc_tap_0_3   : 10;
376     } reg153;
377 
378     struct {
379         RK_U32  resever              : 2;
380         RK_U32  sw_pred_bc_tap_2_0   : 10;
381         RK_U32  sw_pred_bc_tap_1_3   : 10;
382         RK_U32  sw_pred_bc_tap_1_2   : 10;
383     } reg154;
384 
385     struct {
386         RK_U32  resever              : 2;
387         RK_U32  sw_pred_bc_tap_2_3   : 10;
388         RK_U32  sw_pred_bc_tap_2_2   : 10;
389         RK_U32  sw_pred_bc_tap_2_1   : 10;
390     } reg155;
391 
392     struct {
393         RK_U32  resever              : 2;
394         RK_U32  sw_pred_bc_tap_3_2   : 10;
395         RK_U32  sw_pred_bc_tap_3_1   : 10;
396         RK_U32  sw_pred_bc_tap_3_0   : 10;
397     } reg156;
398 
399     struct {
400         RK_U32  resever              : 2;
401         RK_U32  sw_pred_bc_tap_4_1   : 10;
402         RK_U32  sw_pred_bc_tap_4_0   : 10;
403         RK_U32  sw_pred_bc_tap_3_3   : 10;
404     } reg157;
405 
406     struct {
407         RK_U32  resever              : 2;
408         RK_U32  sw_pred_bc_tap_5_0   : 10;
409         RK_U32  sw_pred_bc_tap_4_3   : 10;
410         RK_U32  sw_pred_bc_tap_4_2   : 10;
411     } reg158;
412 } VP8DRegSet_t;
413 
414 #endif
415