xref: /rockchip-linux_mpp/mpp/hal/vpu/vp8e/hal_vp8e_vepu2_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_VP8E_VEPU2_REG_H__
18 #define __HAL_VP8E_VEPU2_REG_H__
19 
20 #include "rk_type.h"
21 
22 typedef struct {
23     union {
24         struct {
25             RK_U32 y1_quant_dc : 14;
26             RK_U32 : 2;
27             RK_U32 y2_quant_dc : 14;
28             RK_U32 : 2;
29         } num_0;
30 
31         struct {
32             RK_U32 ch_quant_dc : 14;
33             RK_U32 : 2;
34             RK_U32 y1_quant_ac : 14;
35             RK_U32 : 2;
36         } num_1;
37 
38         struct {
39             RK_U32 y2_quant_ac : 14;
40             RK_U32 : 2;
41             RK_U32 ch_quant_ac : 14;
42             RK_U32 : 2;
43         } num_2;
44 
45         struct {
46             RK_U32 y1_zbin_dc : 9;
47             RK_U32 y2_zbin_dc : 9;
48             RK_U32 ch_zbin_dc : 9;
49             RK_U32 : 5;
50         } num_3;
51 
52         struct {
53             RK_U32 y1_zbin_ac : 9;
54             RK_U32 y2_zbin_ac : 9;
55             RK_U32 ch_zbin_ac : 9;
56             RK_U32 : 5;
57         } num_4;
58 
59         struct {
60             RK_U32 y1_round_dc : 8;
61             RK_U32 y2_round_dc : 8;
62             RK_U32 ch_round_dc : 8;
63             RK_U32 : 8;
64         } num_5;
65 
66         struct {
67             RK_U32 y1_round_ac : 8;
68             RK_U32 y2_round_ac : 8;
69             RK_U32 ch_round_ac : 8;
70             RK_U32 : 8;
71         } num_6;
72 
73         struct {
74             RK_U32 y1_dequant_dc : 8;
75             RK_U32 y2_dequant_dc : 9;
76             RK_U32 ch_dequant_dc : 8;
77             RK_U32 filter_level : 6;
78             RK_U32 : 1;
79         } num_7;
80 
81         struct {
82             RK_U32 y1_dequant_ac : 9;
83             RK_U32 y2_dequant_ac : 9;
84             RK_U32 ch_dequant_ac : 9;
85             RK_U32 : 5;
86         } num_8;
87 
88     } sw0_26[27];
89 
90     struct {
91         RK_U32 base_segment_map : 32;
92     } sw27;
93 
94     struct {
95         RK_U32 b_mode_0_penalty : 12;
96         RK_U32 : 4;
97         RK_U32 b_mode_1_penalty : 12;
98         RK_U32 : 4;
99     } sw28_32[5];
100 
101     struct {
102         RK_U32 mode0_penalty : 12;
103         RK_U32 : 4;
104         RK_U32 mode1_penalty : 12;
105         RK_U32 : 4;
106     } sw33;
107 
108     struct {
109         RK_U32 mode2_penalty : 12;
110         RK_U32 : 4;
111         RK_U32 mode3_penalty : 12;
112         RK_U32 : 4;
113     } sw34;
114 
115     RK_U32 sw35_39[5];
116 
117     struct {
118         RK_U32 cost_inter : 12;
119         RK_U32 : 4;
120         RK_U32 lf_ref_delta0 : 7;
121         RK_U32 : 1;
122         RK_U32 lf_mode_delta0 : 7;
123         RK_U32 : 1;
124     } sw40;
125 
126     struct {
127         RK_U32 cost_golden_ref : 12;
128         RK_U32 : 4;
129         RK_U32 dmv_cost_const : 12;
130         RK_U32 : 4;
131     } sw41;
132 
133     struct {
134         RK_U32 lf_ref_delta2 : 7;
135         RK_U32 : 1;
136         RK_U32 lf_ref_delta1 : 7;
137         RK_U32 : 1;
138         RK_U32 lf_ref_delta3 : 7;
139         RK_U32 : 9;
140     } sw42;
141 
142     struct {
143         RK_U32 lf_mode_delta2 : 7;
144         RK_U32 : 1;
145         RK_U32 lf_mode_delta1 : 7;
146         RK_U32 : 1;
147         RK_U32 lf_mode_delta3 : 7;
148         RK_U32 : 9;
149     } sw43;
150 
151     struct {
152         RK_U32 base_partition1 : 32;
153     } sw44;
154 
155     struct {
156         RK_U32 base_partition2 : 32;
157     } sw45;
158 
159     struct {
160         RK_U32 intra_area_right : 8;
161         RK_U32 intra_area_left : 8;
162         RK_U32 intra_area_bottom : 8;
163         RK_U32 intra_area_top : 8;
164     } sw46;
165 
166     struct {
167         RK_U32 cir_interval : 16;
168         RK_U32 cir_start : 16;
169     } sw47;
170 
171     struct {
172         RK_U32 base_in_lum : 32;
173     } sw48;
174 
175     struct {
176         RK_U32 base_in_cb : 32;
177     } sw49;
178 
179     struct {
180         RK_U32 base_in_cr : 32;
181     } sw50;
182 
183     struct {
184         RK_U32 strm_hdr_rem1 : 32;
185     } sw51;
186 
187     struct {
188         RK_U32 strm_hdr_rem2 : 32;
189     } sw52;
190 
191     struct {
192         RK_U32 strm_buf_limit : 32;
193     } sw53;
194 
195     struct {
196         RK_U32 val : 32;
197     } sw54;
198 
199     RK_U32 sw55;
200 
201     struct {
202         RK_U32 base_ref_lum : 32;
203     } sw56;
204 
205     struct {
206         RK_U32 base_ref_chr : 32;
207     } sw57;
208 
209     struct {
210         RK_U32 : 11;
211         RK_U32 qp_sum : 21;
212     } sw58;
213 
214     struct {
215         RK_U32 : 8;
216         RK_U32 slice_size : 7;
217         RK_U32 strea_mmode : 1;
218         RK_U32 inter4_restrict : 1;
219         RK_U32 transform_8x8 : 1;
220         RK_U32 : 2;
221         RK_U32 cabac_enable : 1;
222         RK_U32 cabac_init_idc : 2;
223         RK_U32 : 1;
224         RK_U32 deblocking : 2;
225         RK_U32 : 2;
226         RK_U32 disable_qp_mv : 1;
227         RK_U32 : 3;
228     } sw59;
229 
230     struct {
231         RK_U32 y_fill : 4;
232         RK_U32 x_fill : 2;
233         RK_U32 : 2;
234         RK_U32 skip_penalty : 8;
235         RK_U32 start_offset : 6;
236         RK_U32 : 10;
237     } sw60;
238 
239     struct {
240         RK_U32 row_length : 14;
241         RK_U32 : 2;
242         RK_U32 lum_offset : 3;
243         RK_U32 : 1;
244         RK_U32 chr_offset : 3;
245         RK_U32 : 9;
246     } sw61;
247 
248     struct {
249         RK_U32 rlc_sum : 23;
250         RK_U32 : 9;
251     } sw62;
252 
253     struct {
254         RK_U32 base_rec_lum : 32;
255     } sw63;
256 
257     struct {
258         RK_U32 base_rec_chr : 32;
259     } sw64;
260 
261     struct {
262         RK_U32 y1_quant_ac : 14;
263         RK_U32 y1_zbin_ac : 9;
264         RK_U32 y1_round_ac : 8;
265         RK_U32 : 1;
266     } sw65;
267 
268     struct {
269         RK_U32 y2_quant_dc : 14;
270         RK_U32 y2_zbin_dc : 9;
271         RK_U32 y2_round_dc : 8;
272         RK_U32 : 1;
273     } sw66;
274 
275     struct {
276         RK_U32 y2_quant_ac : 14;
277         RK_U32 y2_zbin_ac : 9;
278         RK_U32 y2_round_ac : 8;
279         RK_U32 : 1;
280     } sw67;
281 
282     struct {
283         RK_U32 ch_quant_dc : 14;
284         RK_U32 ch_zbin_dc : 9;
285         RK_U32 ch_round_dc : 8;
286         RK_U32 : 1;
287     } sw68;
288 
289     struct {
290         RK_U32 ch_quant_ac : 14;
291         RK_U32 ch_zbin_ac : 9;
292         RK_U32 ch_round_ac : 8;
293         RK_U32 : 1;
294     } sw69;
295 
296     struct {
297         RK_U32 y1_dequant_dc : 8;
298         RK_U32 y1_dequant_ac : 9;
299         RK_U32 y2_dequant_dc : 9;
300         RK_U32 mv_ref_idx : 2 ;
301         RK_U32 : 4;
302     } sw70;
303 
304     struct {
305         RK_U32 y2_dequant_ac : 9;
306         RK_U32 ch_dequant_dc : 8;
307         RK_U32 ch_dequant_ac : 9;
308         RK_U32 mv_ref_idx2 : 2;
309         RK_U32 ref2_enable : 1;
310         RK_U32 segment_enable : 1;
311         RK_U32 segment_map_update : 1;
312         RK_U32 : 1;
313     } sw71;
314 
315     struct {
316         RK_U32 bool_enc_value : 32;
317     } sw72;
318 
319     struct {
320         RK_U32 bool_enc_range : 8;
321         RK_U32 bool_enc_value_bits : 5;
322         RK_U32 dct_partition_count : 2;
323         RK_U32 filter_level : 6;
324         RK_U32 filter_sharpness : 3;
325         RK_U32 golden_penalty : 8;
326     } sw73;
327 
328     struct {
329         RK_U32 nal_size_write : 1;
330         RK_U32 : 1;
331         RK_U32 input_rot : 2;
332         RK_U32 input_format : 4;
333         RK_U32 : 8;
334         RK_U32 num_slices_ready : 8;
335         RK_U32 mad_threshold : 6;
336         RK_U32 : 2;
337     } sw74;
338 
339     struct {
340         RK_U32 inter_favor : 16;
341         RK_U32 ip_intra_16_favor : 16;
342     } sw75;
343 
344     struct {
345         RK_U32 base_ref_lum2 : 32;
346     } sw76;
347 
348     struct {
349         RK_U32 base_stream : 32;
350     } sw77;
351 
352     struct {
353         RK_U32 base_control : 32;
354     } sw78;
355 
356     struct {
357         RK_U32 base_next_lum : 32;
358     } sw79;
359 
360     struct {
361         RK_U32 base_mv_write : 32;
362     } sw80;
363 
364     struct {
365         RK_U32 base_cabac_ctx : 32;
366     } sw81;
367 
368     struct {
369         RK_U32 roi1_right : 8;
370         RK_U32 roi1_left : 8;
371         RK_U32 roi1_bottom : 8;
372         RK_U32 roi1_top : 8;
373     } sw82;
374 
375     struct {
376         RK_U32 roi2_right : 8;
377         RK_U32 roi2_left : 8;
378         RK_U32 roi2_bottom : 8;
379         RK_U32 roi2_top : 8;
380     } sw83;
381 
382     RK_U32 sw84_93[10];
383 
384     struct {
385         RK_U32 stab_gmvx : 6;
386         RK_U32 stab_mode : 2;
387         RK_U32 stab_minimum : 24;
388     } sw94;
389 
390     struct {
391         RK_U32 rgb_coeff_a : 16;
392         RK_U32 rgb_coeff_b : 16;
393     } sw95;
394 
395     struct {
396         RK_U32 rgb_coeff_c : 16;
397         RK_U32 rgb_coeff_e : 16;
398     } sw96;
399 
400     struct {
401         RK_U32 rgb_coeff_f : 16;
402         RK_U32 : 16;
403     } sw97;
404 
405     struct {
406         RK_U32 r_mask_msb : 5;
407         RK_U32 : 3;
408         RK_U32 g_mask_msb : 5;
409         RK_U32 : 3;
410         RK_U32 b_mask_msb : 5;
411         RK_U32 : 11;
412     } sw98;
413 
414     struct {
415         RK_U32 split_mv : 1;
416         RK_U32 dmv_penalty_4p : 10;
417         RK_U32 dmv_penalty_qp : 10;
418         RK_U32 dmv_penalty_1p : 10;
419         RK_U32 : 1;
420     } sw99;
421 
422     struct {
423         RK_U32 y1_quant_dc : 14;
424         RK_U32 y1_zbin_dc : 9;
425         RK_U32 y1_round_dc : 8;
426         RK_U32 : 1;
427     } sw100;
428 
429     RK_U32 sw101;
430 
431     struct {
432         RK_U32 mvc_inter_view_flag : 1;
433         RK_U32 mvc_temporal_id : 3;
434         RK_U32 mvc_priority_id : 3;
435         RK_U32 mvc_anchor_pic_flag : 1;
436         RK_U32 mvc_view_id : 3;
437         RK_U32 split_penalty_4x4 : 9;
438         RK_U32 zero_mv_favor : 4;
439         RK_U32 : 8;
440     } sw102;
441 
442     struct {
443         RK_U32 enable : 1;
444         RK_U32 : 3;
445         RK_U32 encoding_mode : 2;
446         RK_U32 picture_type : 2;
447         RK_U32 width : 9;
448         RK_U32 : 3;
449         RK_U32 height : 9;
450         RK_U32 : 3;
451     } sw103;
452 
453     struct {
454         RK_U32 mad_count : 16;
455         RK_U32 mb_count : 16;
456     } sw104;
457 
458     struct {
459         RK_U32 val : 32;
460     } sw105;
461 
462     struct {
463         RK_U32 base_ref_chr2 : 32;
464     } sw106;
465 
466     struct {
467         RK_U32 split_penalty_8x4 : 10;
468         RK_U32 split_penalty_8x8 : 10;
469         RK_U32 split_penalty_16x8 : 10;
470         RK_U32 : 2;
471     } sw107;
472 
473     struct {
474         RK_U32 base_prob_count : 32;
475     } sw108;
476 
477     struct {
478         RK_U32 val : 16;
479         RK_U32 int_slice_ready : 1;
480         RK_U32 : 3;
481         RK_U32 rec_write_disable : 1;
482         RK_U32 : 3;
483         RK_U32 mv_write : 1;
484         RK_U32 : 7;
485     } sw109;
486 
487     RK_U32 sw110_119[10];
488 
489     struct {
490         RK_U32 penalty_0 : 8;
491         RK_U32 penalty_1 : 8;
492         RK_U32 penalty_2 : 8;
493         RK_U32 penalty_3 : 8;
494     } sw120_183[64];
495 
496 } Vp8eVepu2Reg_t;
497 
498 #endif /*__HAL_VP8E_VEPU2_REG_H__*/
499