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