aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/dream/include/mach/qdsp5/qdsp5jpegcmdi.h
blob: 574ad6bbcadea8c2dfe3636d943a4aca50ec4c73 (plain) (blame)
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
#ifndef QDSP5VIDJPEGCMDI_H
#define QDSP5VIDJPEGCMDI_H

/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*

    J P E G  I N T E R N A L  C O M M A N D S

GENERAL DESCRIPTION
  This file contains defintions of format blocks of commands
  that are accepted by JPEG Task

REFERENCES
  None

EXTERNALIZED FUNCTIONS
  None

Copyright(c) 1992 - 2008 by QUALCOMM, Incorporated.

This software is licensed under the terms of the GNU General Public
License version 2, as published by the Free Software Foundation, and
may be copied, distributed, and modified under those terms.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
/*===========================================================================

                      EDIT HISTORY FOR FILE

This section contains comments describing changes made to this file.
Notice that changes are listed in reverse chronological order.

$Header: //source/qcom/qct/multimedia2/AdspSvc/7XXX/qdsp5cmd/video/qdsp5jpegcmdi.h#2 $ $DateTime: 2008/07/30 10:50:23 $ $Author: pavanr $
Revision History:
when       who     what, where, why
--------   ---     ----------------------------------------------------------
06/09/08   sv      initial version
===========================================================================*/

/*
 * ARM to JPEG configuration commands are passed through the
 * uPJpegCfgCmdQueue
 */

/*
 * Command to configure JPEG Encoder
 */

#define	JPEG_CMD_ENC_CFG		0x0000
#define	JPEG_CMD_ENC_CFG_LEN	sizeof(jpeg_cmd_enc_cfg)

#define	JPEG_CMD_ENC_PROCESS_CFG_OP_ROTATION_0		0x0000
#define	JPEG_CMD_ENC_PROCESS_CFG_OP_ROTATION_90		0x0100
#define	JPEG_CMD_ENC_PROCESS_CFG_OP_ROTATION_180	0x0200
#define	JPEG_CMD_ENC_PROCESS_CFG_OP_ROTATION_270	0x0300
#define	JPEG_CMD_ENC_PROCESS_CFG_IP_DATA_FORMAT_M	0x0003
#define	JPEG_CMD_ENC_PROCESS_CFG_IP_DATA_FORMAT_H2V2	0x0000
#define	JPEG_CMD_ENC_PROCESS_CFG_IP_DATA_FORMAT_H2V1	0x0001
#define	JPEG_CMD_ENC_PROCESS_CFG_IP_DATA_FORMAT_H1V2	0x0002

#define	JPEG_CMD_IP_SIZE_CFG_LUMA_HEIGHT_M		0x0000FFFF
#define	JPEG_CMD_IP_SIZE_CFG_LUMA_WIDTH_M		0xFFFF0000
#define	JPEG_CMD_ENC_UPSAMP_IP_SIZE_CFG_ENA		0x0001
#define	JPEG_CMD_ENC_UPSAMP_IP_SIZE_CFG_DIS		0x0000

#define	JPEG_CMD_FRAG_SIZE_LUMA_HEIGHT_M		0xFFFF

typedef struct {
	unsigned int	cmd_id;
	unsigned int	process_cfg;
	unsigned int	ip_size_cfg;
	unsigned int	op_size_cfg;
	unsigned int	frag_cfg;
	unsigned int	frag_cfg_part[16];

	unsigned int    part_num;

	unsigned int	op_buf_0_cfg_part1;
	unsigned int	op_buf_0_cfg_part2;
	unsigned int	op_buf_1_cfg_part1;
	unsigned int	op_buf_1_cfg_part2;

	unsigned int	luma_qunt_table[32];
	unsigned int	chroma_qunt_table[32];

	unsigned int	upsamp_ip_size_cfg;
	unsigned int	upsamp_ip_frame_off;
	unsigned int	upsamp_pp_filter_coeff[64];
} __attribute__((packed)) jpeg_cmd_enc_cfg;

/*
 * Command to configure JPEG Decoder
 */

#define	JPEG_CMD_DEC_CFG		0x0001
#define	JPEG_CMD_DEC_CFG_LEN		sizeof(jpeg_cmd_dec_cfg)

#define	JPEG_CMD_DEC_OP_DATA_FORMAT_M		0x0001
#define JPEG_CMD_DEC_OP_DATA_FORMAT_H2V2	0x0000
#define JPEG_CMD_DEC_OP_DATA_FORMAT_H2V1	0x0001

#define JPEG_CMD_DEC_OP_DATA_FORMAT_SCALE_FACTOR_8	0x000000
#define JPEG_CMD_DEC_OP_DATA_FORMAT_SCALE_FACTOR_4	0x010000
#define JPEG_CMD_DEC_OP_DATA_FORMAT_SCALE_FACTOR_2	0x020000
#define JPEG_CMD_DEC_OP_DATA_FORMAT_SCALE_FACTOR_1	0x030000

#define	JPEG_CMD_DEC_IP_STREAM_BUF_CFG_PART3_NOT_FINAL	0x0000
#define	JPEG_CMD_DEC_IP_STREAM_BUF_CFG_PART3_FINAL	0x0001


typedef struct {
	unsigned int	cmd_id;
	unsigned int	img_dimension_cfg;
	unsigned int	op_data_format;
	unsigned int	restart_interval;
	unsigned int	ip_buf_partition_num;
	unsigned int	ip_stream_buf_cfg_part1;
	unsigned int	ip_stream_buf_cfg_part2;
	unsigned int	ip_stream_buf_cfg_part3;
	unsigned int	op_stream_buf_0_cfg_part1;
	unsigned int	op_stream_buf_0_cfg_part2;
	unsigned int	op_stream_buf_0_cfg_part3;
	unsigned int	op_stream_buf_1_cfg_part1;
	unsigned int	op_stream_buf_1_cfg_part2;
	unsigned int	op_stream_buf_1_cfg_part3;
	unsigned int	luma_qunt_table_0_3;
	unsigned int	luma_qunt_table_4_7;
	unsigned int	luma_qunt_table_8_11;
	unsigned int	luma_qunt_table_12_15;
	unsigned int	luma_qunt_table_16_19;
	unsigned int	luma_qunt_table_20_23;
	unsigned int	luma_qunt_table_24_27;
	unsigned int	luma_qunt_table_28_31;
	unsigned int	luma_qunt_table_32_35;
	unsigned int	luma_qunt_table_36_39;
	unsigned int	luma_qunt_table_40_43;
	unsigned int	luma_qunt_table_44_47;
	unsigned int	luma_qunt_table_48_51;
	unsigned int	luma_qunt_table_52_55;
	unsigned int	luma_qunt_table_56_59;
	unsigned int	luma_qunt_table_60_63;
	unsigned int	chroma_qunt_table_0_3;
	unsigned int	chroma_qunt_table_4_7;
	unsigned int	chroma_qunt_table_8_11;
	unsigned int	chroma_qunt_table_12_15;
	unsigned int	chroma_qunt_table_16_19;
	unsigned int	chroma_qunt_table_20_23;
	unsigned int	chroma_qunt_table_24_27;
	unsigned int	chroma_qunt_table_28_31;
	unsigned int	chroma_qunt_table_32_35;
	unsigned int	chroma_qunt_table_36_39;
	unsigned int	chroma_qunt_table_40_43;
	unsigned int	chroma_qunt_table_44_47;
	unsigned int	chroma_qunt_table_48_51;
	unsigned int	chroma_qunt_table_52_55;
	unsigned int	chroma_qunt_table_56_59;
	unsigned int	chroma_qunt_table_60_63;
	unsigned int	luma_dc_hm_code_cnt_table_0_3;
	unsigned int	luma_dc_hm_code_cnt_table_4_7;
	unsigned int	luma_dc_hm_code_cnt_table_8_11;
	unsigned int	luma_dc_hm_code_cnt_table_12_15;
	unsigned int	luma_dc_hm_code_val_table_0_3;
	unsigned int	luma_dc_hm_code_val_table_4_7;
	unsigned int	luma_dc_hm_code_val_table_8_11;
	unsigned int	chroma_dc_hm_code_cnt_table_0_3;
	unsigned int	chroma_dc_hm_code_cnt_table_4_7;
	unsigned int	chroma_dc_hm_code_cnt_table_8_11;
	unsigned int	chroma_dc_hm_code_cnt_table_12_15;
	unsigned int	chroma_dc_hm_code_val_table_0_3;
	unsigned int	chroma_dc_hm_code_val_table_4_7;
	unsigned int	chroma_dc_hm_code_val_table_8_11;
	unsigned int	luma_ac_hm_code_cnt_table_0_3;
	unsigned int	luma_ac_hm_code_cnt_table_4_7;
	unsigned int	luma_ac_hm_code_cnt_table_8_11;
	unsigned int	luma_ac_hm_code_cnt_table_12_15;
	unsigned int	luma_ac_hm_code_val_table_0_3;
	unsigned int	luma_ac_hm_code_val_table_4_7;
	unsigned int	luma_ac_hm_code_val_table_8_11;
	unsigned int	luma_ac_hm_code_val_table_12_15;
	unsigned int	luma_ac_hm_code_val_table_16_19;
	unsigned int	luma_ac_hm_code_val_table_20_23;
	unsigned int	luma_ac_hm_code_val_table_24_27;
	unsigned int	luma_ac_hm_code_val_table_28_31;
	unsigned int	luma_ac_hm_code_val_table_32_35;
	unsigned int	luma_ac_hm_code_val_table_36_39;
	unsigned int	luma_ac_hm_code_val_table_40_43;
	unsigned int	luma_ac_hm_code_val_table_44_47;
	unsigned int	luma_ac_hm_code_val_table_48_51;
	unsigned int	luma_ac_hm_code_val_table_52_55;
	unsigned int	luma_ac_hm_code_val_table_56_59;
	unsigned int	luma_ac_hm_code_val_table_60_63;
	unsigned int	luma_ac_hm_code_val_table_64_67;
	unsigned int	luma_ac_hm_code_val_table_68_71;
	unsigned int	luma_ac_hm_code_val_table_72_75;
	unsigned int	luma_ac_hm_code_val_table_76_79;
	unsigned int	luma_ac_hm_code_val_table_80_83;
	unsigned int	luma_ac_hm_code_val_table_84_87;
	unsigned int	luma_ac_hm_code_val_table_88_91;
	unsigned int	luma_ac_hm_code_val_table_92_95;
	unsigned int	luma_ac_hm_code_val_table_96_99;
	unsigned int	luma_ac_hm_code_val_table_100_103;
	unsigned int	luma_ac_hm_code_val_table_104_107;
	unsigned int	luma_ac_hm_code_val_table_108_111;
	unsigned int	luma_ac_hm_code_val_table_112_115;
	unsigned int	luma_ac_hm_code_val_table_116_119;
	unsigned int	luma_ac_hm_code_val_table_120_123;
	unsigned int	luma_ac_hm_code_val_table_124_127;
	unsigned int	luma_ac_hm_code_val_table_128_131;
	unsigned int	luma_ac_hm_code_val_table_132_135;
	unsigned int	luma_ac_hm_code_val_table_136_139;
	unsigned int	luma_ac_hm_code_val_table_140_143;
	unsigned int	luma_ac_hm_code_val_table_144_147;
	unsigned int	luma_ac_hm_code_val_table_148_151;
	unsigned int	luma_ac_hm_code_val_table_152_155;
	unsigned int	luma_ac_hm_code_val_table_156_159;
	unsigned int	luma_ac_hm_code_val_table_160_161;
	unsigned int	chroma_ac_hm_code_cnt_table_0_3;
	unsigned int	chroma_ac_hm_code_cnt_table_4_7;
	unsigned int	chroma_ac_hm_code_cnt_table_8_11;
	unsigned int	chroma_ac_hm_code_cnt_table_12_15;
	unsigned int	chroma_ac_hm_code_val_table_0_3;
	unsigned int	chroma_ac_hm_code_val_table_4_7;
	unsigned int	chroma_ac_hm_code_val_table_8_11;
	unsigned int	chroma_ac_hm_code_val_table_12_15;
	unsigned int	chroma_ac_hm_code_val_table_16_19;
	unsigned int	chroma_ac_hm_code_val_table_20_23;
	unsigned int	chroma_ac_hm_code_val_table_24_27;
	unsigned int	chroma_ac_hm_code_val_table_28_31;
	unsigned int	chroma_ac_hm_code_val_table_32_35;
	unsigned int	chroma_ac_hm_code_val_table_36_39;
	unsigned int	chroma_ac_hm_code_val_table_40_43;
	unsigned int	chroma_ac_hm_code_val_table_44_47;
	unsigned int	chroma_ac_hm_code_val_table_48_51;
	unsigned int	chroma_ac_hm_code_val_table_52_55;
	unsigned int	chroma_ac_hm_code_val_table_56_59;
	unsigned int	chroma_ac_hm_code_val_table_60_63;
	unsigned int	chroma_ac_hm_code_val_table_64_67;
	unsigned int	chroma_ac_hm_code_val_table_68_71;
	unsigned int	chroma_ac_hm_code_val_table_72_75;
	unsigned int	chroma_ac_hm_code_val_table_76_79;
	unsigned int	chroma_ac_hm_code_val_table_80_83;
	unsigned int	chroma_ac_hm_code_val_table_84_87;
	unsigned int	chroma_ac_hm_code_val_table_88_91;
	unsigned int	chroma_ac_hm_code_val_table_92_95;
	unsigned int	chroma_ac_hm_code_val_table_96_99;
	unsigned int	chroma_ac_hm_code_val_table_100_103;
	unsigned int	chroma_ac_hm_code_val_table_104_107;
	unsigned int	chroma_ac_hm_code_val_table_108_111;
	unsigned int	chroma_ac_hm_code_val_table_112_115;
	unsigned int	chroma_ac_hm_code_val_table_116_119;
	unsigned int	chroma_ac_hm_code_val_table_120_123;
	unsigned int	chroma_ac_hm_code_val_table_124_127;
	unsigned int	chroma_ac_hm_code_val_table_128_131;
	unsigned int	chroma_ac_hm_code_val_table_132_135;
	unsigned int	chroma_ac_hm_code_val_table_136_139;
	unsigned int	chroma_ac_hm_code_val_table_140_143;
	unsigned int	chroma_ac_hm_code_val_table_144_147;
	unsigned int	chroma_ac_hm_code_val_table_148_151;
	unsigned int	chroma_ac_hm_code_val_table_152_155;
	unsigned int	chroma_ac_hm_code_val_table_156_159;
	unsigned int	chroma_ac_hm_code_val_table_160_161;
} __attribute__((packed)) jpeg_cmd_dec_cfg;


/*
 * ARM to JPEG configuration commands are passed through the
 * uPJpegActionCmdQueue
 */

/*
 * Command to start the encode process
 */

#define	JPEG_CMD_ENC_ENCODE		0x0000
#define	JPEG_CMD_ENC_ENCODE_LEN		sizeof(jpeg_cmd_enc_encode)


typedef struct {
	unsigned short	cmd_id;
} __attribute__((packed)) jpeg_cmd_enc_encode;


/*
 * Command to transition from current state of encoder to IDLE state
 */

#define	JPEG_CMD_ENC_IDLE		0x0001
#define	JPEG_CMD_ENC_IDLE_LEN		sizeof(jpeg_cmd_enc_idle)


typedef struct {
	unsigned short	cmd_id;
} __attribute__((packed)) jpeg_cmd_enc_idle;


/*
 * Command to inform the encoder that another buffer is ready
 */

#define	JPEG_CMD_ENC_OP_CONSUMED	0x0002
#define	JPEG_CMD_ENC_OP_CONSUMED_LEN	sizeof(jpeg_cmd_enc_op_consumed)


typedef struct {
	unsigned int	cmd_id;
	unsigned int	op_buf_addr;
	unsigned int	op_buf_size;
} __attribute__((packed)) jpeg_cmd_enc_op_consumed;


/*
 * Command to start the decoding process
 */

#define	JPEG_CMD_DEC_DECODE		0x0003
#define	JPEG_CMD_DEC_DECODE_LEN	sizeof(jpeg_cmd_dec_decode)


typedef struct {
	unsigned short	cmd_id;
} __attribute__((packed)) jpeg_cmd_dec_decode;


/*
 * Command to transition from the current state of decoder to IDLE
 */

#define	JPEG_CMD_DEC_IDLE	0x0004
#define	JPEG_CMD_DEC_IDLE_LEN	sizeof(jpeg_cmd_dec_idle)


typedef struct {
	unsigned short	cmd_id;
} __attribute__((packed)) jpeg_cmd_dec_idle;


/*
 * Command to inform that an op buffer is ready for use
 */

#define	JPEG_CMD_DEC_OP_CONSUMED	0x0005
#define	JPEG_CMD_DEC_OP_CONSUMED_LEN	sizeof(jpeg_cmd_dec_op_consumed)


typedef struct {
	unsigned int	cmd_id;
	unsigned int	luma_op_buf_addr;
	unsigned int	luma_op_buf_size;
	unsigned int	chroma_op_buf_addr;
} __attribute__((packed)) jpeg_cmd_dec_op_consumed;


/*
 * Command to pass a new ip buffer to the jpeg decoder
 */

#define	JPEG_CMD_DEC_IP	0x0006
#define	JPEG_CMD_DEC_IP_LEN	sizeof(jpeg_cmd_dec_ip_len)

#define	JPEG_CMD_EOI_INDICATOR_NOT_END	0x0000
#define	JPEG_CMD_EOI_INDICATOR_END	0x0001

typedef struct {
	unsigned int	cmd_id;
	unsigned int	ip_buf_addr;
	unsigned int	ip_buf_size;
	unsigned int	eoi_indicator;
} __attribute__((packed)) jpeg_cmd_dec_ip;



#endif