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
/*
 * Copyright 2017 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_M4V_VDPU1_REG_TBL_H__
#define __HAL_M4V_VDPU1_REG_TBL_H__
 
#include "rk_type.h"
 
/* Number registers for the decoder */
#define DEC_VDPU1_REGISTERS         (101)
 
typedef struct {
    RK_U32 SwReg00;
 
    struct {
        RK_U32 sw_dec_en         : 1;
        RK_U32 reserve0          : 3;
        RK_U32 sw_dec_irq_dis    : 1;
        RK_U32 reserve1          : 3;
        RK_U32 sw_dec_irq        : 1;
        RK_U32 reserve2          : 3;
        RK_U32 sw_dec_rdy_int    : 1;
        RK_U32 sw_dec_bus_int    : 1;
        RK_U32 sw_dec_buffer_int : 1;
        RK_U32 sw_dec_aso_int    : 1;
        RK_U32 sw_dec_error_int  : 1;
        RK_U32 sw_dec_slice_int  : 1;
        RK_U32 sw_dec_timeout    : 1;
        RK_U32 reserve3          : 5;
        RK_U32 sw_dec_pic_inf    : 1;
        RK_U32 reserve4          : 7;
    } SwReg01;
 
    struct {
        RK_U32 sw_dec_max_burst   : 5;
        RK_U32 sw_dec_scmd_dis    : 1;
        RK_U32 sw_dec_adv_pre_dis : 1;
        RK_U32 sw_tiled_mode_lsb  : 1;
        RK_U32 sw_dec_out_endian  : 1;
        RK_U32 sw_dec_in_endian   : 1;
        RK_U32 sw_dec_clk_gate_e  : 1;
        RK_U32 sw_dec_latency     : 6;
        RK_U32 sw_tiled_mode_msb  : 1;
        RK_U32 sw_dec_data_disc_e : 1;
        RK_U32 sw_dec_outswap32_e : 1;
        RK_U32 sw_dec_inswap32_e  : 1;
        RK_U32 sw_dec_strendian_e : 1;
        RK_U32 sw_dec_strswap32_e : 1;
        RK_U32 sw_dec_timeout_e   : 1;
        RK_U32 sw_dec_axi_rd_id   : 8;
    } SwReg02;
 
    struct {
        RK_U32 sw_dec_axi_wr_id   : 8;
        RK_U32 reserve0           : 1;
        RK_U32 sw_picord_count_e  : 1;
        RK_U32 sw_seq_mbaff_e     : 1;
        RK_U32 sw_reftopfirst_e   : 1;
        RK_U32 sw_write_mvs_e     : 1;
        RK_U32 sw_pic_fixed_quant : 1;
        RK_U32 sw_filtering_dis   : 1;
        RK_U32 sw_dec_out_dis     : 1;
        RK_U32 sw_ref_topfield_e  : 1;
        RK_U32 sw_sorenson_e      : 1;
        RK_U32 sw_fwd_interlace_e : 1;
        RK_U32 sw_pic_topfield_e  : 1;
        RK_U32 sw_pic_inter_e     : 1;
        RK_U32 sw_pic_b_e         : 1;
        RK_U32 sw_pic_fieldmode_e : 1;
        RK_U32 sw_pic_interlace_e : 1;
        RK_U32 sw_pjpeg_e         : 1;
        RK_U32 sw_divx3_e         : 1;
        RK_U32 sw_skip_mode       : 1;
        RK_U32 sw_rlc_mode_e      : 1;
        RK_U32 sw_dec_mode        : 4;
    } SwReg03;
 
    struct {
        RK_U32  sw_reserve0         : 5;
        RK_U32  sw_topfieldfirst_e  : 1;
        RK_U32  sw_alt_scan_e       : 1;
        RK_U32  sw_mb_height_off    : 4;
        RK_U32  sw_pic_mb_hight_p   : 8;
        RK_U32  sw_mb_width_off     : 4;
        RK_U32  sw_pic_mb_width     : 9;
    } SwReg04;
 
    struct {
        RK_U32 sw_vop_time_incr    : 16;
        RK_U32 sw_intradc_vlc_thr  : 3;
        RK_U32 sw_ch_qp_offset     : 5;
        RK_U32 sw_type1_quant_e    : 1;
        RK_U32 sw_sync_markers_e   : 1;
        RK_U32 sw_strm_start_bit   : 6;
    } SwReg05;
 
    struct {
        RK_U32 sw_stream_len      : 24;
        RK_U32 sw_ch_8pix_ileav_e : 1;
        RK_U32 sw_init_qp         : 6;
        RK_U32 sw_start_code_e    : 1;
    } SwReg06;
 
    struct {
        RK_U32 sw_framenum        : 16;
        RK_U32 sw_framenum_len    : 5;
        RK_U32 reserve0           : 5;
        RK_U32 sw_weight_bipr_idc : 2;
        RK_U32 sw_weight_pred_e   : 1;
        RK_U32 sw_dir_8x8_infer_e : 1;
        RK_U32 sw_blackwhite_e    : 1;
        RK_U32 sw_cabac_e         : 1;
    } SwReg07;
 
    struct {
        RK_U32 sw_idr_pic_id      : 16;
        RK_U32 sw_idr_pic_e       : 1;
        RK_U32 sw_refpic_mk_len   : 11;
        RK_U32 sw_8x8trans_flag_e : 1;
        RK_U32 sw_rdpic_cnt_pres  : 1;
        RK_U32 sw_filt_ctrl_pres  : 1;
        RK_U32 sw_const_intra_e   : 1;
    } SwReg08;
 
    struct {
        RK_U32 sw_poc_length      : 8;
        RK_U32 reserve0           : 6;
        RK_U32 sw_refidx0_active  : 5;
        RK_U32 sw_refidx1_active  : 5;
        RK_U32 sw_pps_id          : 8;
    } SwReg09;
 
    struct {
        RK_U32 sw_diff_mv_base    : 32;
    } SwReg10;
 
    RK_U32 SwReg11;
 
    struct {
        RK_U32 sw_rlc_vlc_base    : 32;
    } SwReg12;
 
    struct {
        RK_U32 dec_out_st_adr     : 32;
    } SwReg13;
 
    /* MPP passes fd of reference frame to kernel
    * with the whole register rather than higher 30-bit.
    * At the same time, the lower 2-bit will be assigned
    * by kernel.
    * */
    struct {
        //RK_U32 sw_refer0_topc_e    : 1;
        //RK_U32 sw_refer0_field_e   : 1;
        RK_U32 sw_refer0_base        : 32;
    } SwReg14;
 
    struct {
        //RK_U32 sw_refer1_topc_e    : 1;
        //RK_U32 sw_refer1_field_e   : 1;
        RK_U32 sw_refer1_base        : 32;
    } SwReg15;
 
    struct {
        //RK_U32 sw_refer2_topc_e    : 1;
        //RK_U32 sw_refer2_field_e   : 1;
        RK_U32 sw_refer2_base        : 32;
    } SwReg16;
 
    struct {
        //RK_U32 sw_refer3_topc_e    : 1;
        //RK_U32 sw_refer3_field_e   : 1;
        RK_U32 sw_refer3_base        : 32;
    } SwReg17;
 
    struct {
        RK_U32 sw_prev_anc_type      : 1;
        RK_U32 sw_mpeg4_vc1_rc       : 1;
        RK_U32 sw_mv_accuracy_fwd    : 1;
        RK_U32 sw_fcode_bwd_ver      : 4;
        RK_U32 sw_fcode_bwd_hor      : 4;
        RK_U32 sw_fcode_fwd_ver      : 4;
        RK_U32 sw_fcode_fwd_hor      : 4;
        RK_U32 sw_alt_scan_flag_e    : 1;
        RK_U32 reserve0              : 12;
    } SwReg18;
 
    struct {
        //RK_U32 sw_refer5_topc_e    : 1;
        //RK_U32 sw_refer5_field_e   : 1;
        RK_U32 sw_refer5_base        : 32;
    } SwReg19;
 
    struct {
        //RK_U32 sw_refer6_topc_e    : 1;
        //RK_U32 sw_refer6_field_e   : 1;
        RK_U32 sw_refer6_base        : 32;
    } SwReg20;
 
    struct {
        //RK_U32 sw_refer7_topc_e    : 1;
        //RK_U32 sw_refer7_field_e   : 1;
        RK_U32 sw_refer7_base        : 32;
    } SwReg21;
 
 
    RK_U32 SwReg22_33[12];
 
    struct {
        RK_U32  reserve           : 2;
        RK_U32 sw_pred_bc_tap_1_1 : 10;
        RK_U32 sw_pred_bc_tap_1_0 : 10;
        RK_U32 sw_pred_bc_tap_0_3 : 10;
    } SwReg34;
 
    RK_U32 SwReg35_39[5];
 
    struct {
        RK_U32 sw_qtable_base     : 32;
    } SwReg40;
 
    struct {
        RK_U32 sw_dir_mv_base     : 32;
    } SwReg41;
 
    RK_U32 SwReg42_47[6];
 
    struct {
        RK_U32 reserve0           : 15;
        RK_U32 sw_startmb_y       : 8;
        RK_U32 sw_startmb_x       : 9;
    } SwReg48;
 
    struct {
        RK_U32 reserve0           : 2;
        RK_U32 sw_pred_bc_tap_0_2 : 10;
        RK_U32 sw_pred_bc_tap_0_1 : 10;
        RK_U32 sw_pred_bc_tap_0_0 : 10;
    } SwReg49;
 
    RK_U32 SwReg50;
 
    struct {
        RK_U32 sw_refbu_y_offset  : 9;
        RK_U32 reserve0           : 3;
        RK_U32 sw_refbu_fparmod_e : 1;
        RK_U32 sw_refbu_eval_e    : 1;
        RK_U32 sw_refbu_picid     : 5;
        RK_U32 sw_refbu_thr       : 12;
        RK_U32 sw_refbu_e         : 1;
    } SwReg51;
 
    RK_U32 SwReg52_54[3];
 
    struct {
        RK_U32 sw_apf_threshold   : 14;
        RK_U32 reserve0           : 18;
    } SwReg55;
 
    RK_U32 SwReg56_100[45];
} M4vdVdpu1Regs_t;
 
#endif /*__HAL_M4V_VDPU1_REG_TBL_H__*/