• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/dream/include/mach/qdsp5/
1#ifndef QDSP5VIDJPEGCMDI_H
2#define QDSP5VIDJPEGCMDI_H
3
4/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
5
6    J P E G  I N T E R N A L  C O M M A N D S
7
8GENERAL DESCRIPTION
9  This file contains defintions of format blocks of commands
10  that are accepted by JPEG Task
11
12REFERENCES
13  None
14
15EXTERNALIZED FUNCTIONS
16  None
17
18Copyright(c) 1992 - 2008 by QUALCOMM, Incorporated.
19
20This software is licensed under the terms of the GNU General Public
21License version 2, as published by the Free Software Foundation, and
22may be copied, distributed, and modified under those terms.
23
24This program is distributed in the hope that it will be useful,
25but WITHOUT ANY WARRANTY; without even the implied warranty of
26MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27GNU General Public License for more details.
28
29*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
30/*===========================================================================
31
32                      EDIT HISTORY FOR FILE
33
34This section contains comments describing changes made to this file.
35Notice that changes are listed in reverse chronological order.
36
37$Header: //source/qcom/qct/multimedia2/AdspSvc/7XXX/qdsp5cmd/video/qdsp5jpegcmdi.h#2 $ $DateTime: 2008/07/30 10:50:23 $ $Author: pavanr $
38Revision History:
39when       who     what, where, why
40--------   ---     ----------------------------------------------------------
4106/09/08   sv      initial version
42===========================================================================*/
43
44/*
45 * ARM to JPEG configuration commands are passed through the
46 * uPJpegCfgCmdQueue
47 */
48
49/*
50 * Command to configure JPEG Encoder
51 */
52
53#define	JPEG_CMD_ENC_CFG		0x0000
54#define	JPEG_CMD_ENC_CFG_LEN	sizeof(jpeg_cmd_enc_cfg)
55
56#define	JPEG_CMD_ENC_PROCESS_CFG_OP_ROTATION_0		0x0000
57#define	JPEG_CMD_ENC_PROCESS_CFG_OP_ROTATION_90		0x0100
58#define	JPEG_CMD_ENC_PROCESS_CFG_OP_ROTATION_180	0x0200
59#define	JPEG_CMD_ENC_PROCESS_CFG_OP_ROTATION_270	0x0300
60#define	JPEG_CMD_ENC_PROCESS_CFG_IP_DATA_FORMAT_M	0x0003
61#define	JPEG_CMD_ENC_PROCESS_CFG_IP_DATA_FORMAT_H2V2	0x0000
62#define	JPEG_CMD_ENC_PROCESS_CFG_IP_DATA_FORMAT_H2V1	0x0001
63#define	JPEG_CMD_ENC_PROCESS_CFG_IP_DATA_FORMAT_H1V2	0x0002
64
65#define	JPEG_CMD_IP_SIZE_CFG_LUMA_HEIGHT_M		0x0000FFFF
66#define	JPEG_CMD_IP_SIZE_CFG_LUMA_WIDTH_M		0xFFFF0000
67#define	JPEG_CMD_ENC_UPSAMP_IP_SIZE_CFG_ENA		0x0001
68#define	JPEG_CMD_ENC_UPSAMP_IP_SIZE_CFG_DIS		0x0000
69
70#define	JPEG_CMD_FRAG_SIZE_LUMA_HEIGHT_M		0xFFFF
71
72typedef struct {
73	unsigned int	cmd_id;
74	unsigned int	process_cfg;
75	unsigned int	ip_size_cfg;
76	unsigned int	op_size_cfg;
77	unsigned int	frag_cfg;
78	unsigned int	frag_cfg_part[16];
79
80	unsigned int    part_num;
81
82	unsigned int	op_buf_0_cfg_part1;
83	unsigned int	op_buf_0_cfg_part2;
84	unsigned int	op_buf_1_cfg_part1;
85	unsigned int	op_buf_1_cfg_part2;
86
87	unsigned int	luma_qunt_table[32];
88	unsigned int	chroma_qunt_table[32];
89
90	unsigned int	upsamp_ip_size_cfg;
91	unsigned int	upsamp_ip_frame_off;
92	unsigned int	upsamp_pp_filter_coeff[64];
93} __attribute__((packed)) jpeg_cmd_enc_cfg;
94
95/*
96 * Command to configure JPEG Decoder
97 */
98
99#define	JPEG_CMD_DEC_CFG		0x0001
100#define	JPEG_CMD_DEC_CFG_LEN		sizeof(jpeg_cmd_dec_cfg)
101
102#define	JPEG_CMD_DEC_OP_DATA_FORMAT_M		0x0001
103#define JPEG_CMD_DEC_OP_DATA_FORMAT_H2V2	0x0000
104#define JPEG_CMD_DEC_OP_DATA_FORMAT_H2V1	0x0001
105
106#define JPEG_CMD_DEC_OP_DATA_FORMAT_SCALE_FACTOR_8	0x000000
107#define JPEG_CMD_DEC_OP_DATA_FORMAT_SCALE_FACTOR_4	0x010000
108#define JPEG_CMD_DEC_OP_DATA_FORMAT_SCALE_FACTOR_2	0x020000
109#define JPEG_CMD_DEC_OP_DATA_FORMAT_SCALE_FACTOR_1	0x030000
110
111#define	JPEG_CMD_DEC_IP_STREAM_BUF_CFG_PART3_NOT_FINAL	0x0000
112#define	JPEG_CMD_DEC_IP_STREAM_BUF_CFG_PART3_FINAL	0x0001
113
114
115typedef struct {
116	unsigned int	cmd_id;
117	unsigned int	img_dimension_cfg;
118	unsigned int	op_data_format;
119	unsigned int	restart_interval;
120	unsigned int	ip_buf_partition_num;
121	unsigned int	ip_stream_buf_cfg_part1;
122	unsigned int	ip_stream_buf_cfg_part2;
123	unsigned int	ip_stream_buf_cfg_part3;
124	unsigned int	op_stream_buf_0_cfg_part1;
125	unsigned int	op_stream_buf_0_cfg_part2;
126	unsigned int	op_stream_buf_0_cfg_part3;
127	unsigned int	op_stream_buf_1_cfg_part1;
128	unsigned int	op_stream_buf_1_cfg_part2;
129	unsigned int	op_stream_buf_1_cfg_part3;
130	unsigned int	luma_qunt_table_0_3;
131	unsigned int	luma_qunt_table_4_7;
132	unsigned int	luma_qunt_table_8_11;
133	unsigned int	luma_qunt_table_12_15;
134	unsigned int	luma_qunt_table_16_19;
135	unsigned int	luma_qunt_table_20_23;
136	unsigned int	luma_qunt_table_24_27;
137	unsigned int	luma_qunt_table_28_31;
138	unsigned int	luma_qunt_table_32_35;
139	unsigned int	luma_qunt_table_36_39;
140	unsigned int	luma_qunt_table_40_43;
141	unsigned int	luma_qunt_table_44_47;
142	unsigned int	luma_qunt_table_48_51;
143	unsigned int	luma_qunt_table_52_55;
144	unsigned int	luma_qunt_table_56_59;
145	unsigned int	luma_qunt_table_60_63;
146	unsigned int	chroma_qunt_table_0_3;
147	unsigned int	chroma_qunt_table_4_7;
148	unsigned int	chroma_qunt_table_8_11;
149	unsigned int	chroma_qunt_table_12_15;
150	unsigned int	chroma_qunt_table_16_19;
151	unsigned int	chroma_qunt_table_20_23;
152	unsigned int	chroma_qunt_table_24_27;
153	unsigned int	chroma_qunt_table_28_31;
154	unsigned int	chroma_qunt_table_32_35;
155	unsigned int	chroma_qunt_table_36_39;
156	unsigned int	chroma_qunt_table_40_43;
157	unsigned int	chroma_qunt_table_44_47;
158	unsigned int	chroma_qunt_table_48_51;
159	unsigned int	chroma_qunt_table_52_55;
160	unsigned int	chroma_qunt_table_56_59;
161	unsigned int	chroma_qunt_table_60_63;
162	unsigned int	luma_dc_hm_code_cnt_table_0_3;
163	unsigned int	luma_dc_hm_code_cnt_table_4_7;
164	unsigned int	luma_dc_hm_code_cnt_table_8_11;
165	unsigned int	luma_dc_hm_code_cnt_table_12_15;
166	unsigned int	luma_dc_hm_code_val_table_0_3;
167	unsigned int	luma_dc_hm_code_val_table_4_7;
168	unsigned int	luma_dc_hm_code_val_table_8_11;
169	unsigned int	chroma_dc_hm_code_cnt_table_0_3;
170	unsigned int	chroma_dc_hm_code_cnt_table_4_7;
171	unsigned int	chroma_dc_hm_code_cnt_table_8_11;
172	unsigned int	chroma_dc_hm_code_cnt_table_12_15;
173	unsigned int	chroma_dc_hm_code_val_table_0_3;
174	unsigned int	chroma_dc_hm_code_val_table_4_7;
175	unsigned int	chroma_dc_hm_code_val_table_8_11;
176	unsigned int	luma_ac_hm_code_cnt_table_0_3;
177	unsigned int	luma_ac_hm_code_cnt_table_4_7;
178	unsigned int	luma_ac_hm_code_cnt_table_8_11;
179	unsigned int	luma_ac_hm_code_cnt_table_12_15;
180	unsigned int	luma_ac_hm_code_val_table_0_3;
181	unsigned int	luma_ac_hm_code_val_table_4_7;
182	unsigned int	luma_ac_hm_code_val_table_8_11;
183	unsigned int	luma_ac_hm_code_val_table_12_15;
184	unsigned int	luma_ac_hm_code_val_table_16_19;
185	unsigned int	luma_ac_hm_code_val_table_20_23;
186	unsigned int	luma_ac_hm_code_val_table_24_27;
187	unsigned int	luma_ac_hm_code_val_table_28_31;
188	unsigned int	luma_ac_hm_code_val_table_32_35;
189	unsigned int	luma_ac_hm_code_val_table_36_39;
190	unsigned int	luma_ac_hm_code_val_table_40_43;
191	unsigned int	luma_ac_hm_code_val_table_44_47;
192	unsigned int	luma_ac_hm_code_val_table_48_51;
193	unsigned int	luma_ac_hm_code_val_table_52_55;
194	unsigned int	luma_ac_hm_code_val_table_56_59;
195	unsigned int	luma_ac_hm_code_val_table_60_63;
196	unsigned int	luma_ac_hm_code_val_table_64_67;
197	unsigned int	luma_ac_hm_code_val_table_68_71;
198	unsigned int	luma_ac_hm_code_val_table_72_75;
199	unsigned int	luma_ac_hm_code_val_table_76_79;
200	unsigned int	luma_ac_hm_code_val_table_80_83;
201	unsigned int	luma_ac_hm_code_val_table_84_87;
202	unsigned int	luma_ac_hm_code_val_table_88_91;
203	unsigned int	luma_ac_hm_code_val_table_92_95;
204	unsigned int	luma_ac_hm_code_val_table_96_99;
205	unsigned int	luma_ac_hm_code_val_table_100_103;
206	unsigned int	luma_ac_hm_code_val_table_104_107;
207	unsigned int	luma_ac_hm_code_val_table_108_111;
208	unsigned int	luma_ac_hm_code_val_table_112_115;
209	unsigned int	luma_ac_hm_code_val_table_116_119;
210	unsigned int	luma_ac_hm_code_val_table_120_123;
211	unsigned int	luma_ac_hm_code_val_table_124_127;
212	unsigned int	luma_ac_hm_code_val_table_128_131;
213	unsigned int	luma_ac_hm_code_val_table_132_135;
214	unsigned int	luma_ac_hm_code_val_table_136_139;
215	unsigned int	luma_ac_hm_code_val_table_140_143;
216	unsigned int	luma_ac_hm_code_val_table_144_147;
217	unsigned int	luma_ac_hm_code_val_table_148_151;
218	unsigned int	luma_ac_hm_code_val_table_152_155;
219	unsigned int	luma_ac_hm_code_val_table_156_159;
220	unsigned int	luma_ac_hm_code_val_table_160_161;
221	unsigned int	chroma_ac_hm_code_cnt_table_0_3;
222	unsigned int	chroma_ac_hm_code_cnt_table_4_7;
223	unsigned int	chroma_ac_hm_code_cnt_table_8_11;
224	unsigned int	chroma_ac_hm_code_cnt_table_12_15;
225	unsigned int	chroma_ac_hm_code_val_table_0_3;
226	unsigned int	chroma_ac_hm_code_val_table_4_7;
227	unsigned int	chroma_ac_hm_code_val_table_8_11;
228	unsigned int	chroma_ac_hm_code_val_table_12_15;
229	unsigned int	chroma_ac_hm_code_val_table_16_19;
230	unsigned int	chroma_ac_hm_code_val_table_20_23;
231	unsigned int	chroma_ac_hm_code_val_table_24_27;
232	unsigned int	chroma_ac_hm_code_val_table_28_31;
233	unsigned int	chroma_ac_hm_code_val_table_32_35;
234	unsigned int	chroma_ac_hm_code_val_table_36_39;
235	unsigned int	chroma_ac_hm_code_val_table_40_43;
236	unsigned int	chroma_ac_hm_code_val_table_44_47;
237	unsigned int	chroma_ac_hm_code_val_table_48_51;
238	unsigned int	chroma_ac_hm_code_val_table_52_55;
239	unsigned int	chroma_ac_hm_code_val_table_56_59;
240	unsigned int	chroma_ac_hm_code_val_table_60_63;
241	unsigned int	chroma_ac_hm_code_val_table_64_67;
242	unsigned int	chroma_ac_hm_code_val_table_68_71;
243	unsigned int	chroma_ac_hm_code_val_table_72_75;
244	unsigned int	chroma_ac_hm_code_val_table_76_79;
245	unsigned int	chroma_ac_hm_code_val_table_80_83;
246	unsigned int	chroma_ac_hm_code_val_table_84_87;
247	unsigned int	chroma_ac_hm_code_val_table_88_91;
248	unsigned int	chroma_ac_hm_code_val_table_92_95;
249	unsigned int	chroma_ac_hm_code_val_table_96_99;
250	unsigned int	chroma_ac_hm_code_val_table_100_103;
251	unsigned int	chroma_ac_hm_code_val_table_104_107;
252	unsigned int	chroma_ac_hm_code_val_table_108_111;
253	unsigned int	chroma_ac_hm_code_val_table_112_115;
254	unsigned int	chroma_ac_hm_code_val_table_116_119;
255	unsigned int	chroma_ac_hm_code_val_table_120_123;
256	unsigned int	chroma_ac_hm_code_val_table_124_127;
257	unsigned int	chroma_ac_hm_code_val_table_128_131;
258	unsigned int	chroma_ac_hm_code_val_table_132_135;
259	unsigned int	chroma_ac_hm_code_val_table_136_139;
260	unsigned int	chroma_ac_hm_code_val_table_140_143;
261	unsigned int	chroma_ac_hm_code_val_table_144_147;
262	unsigned int	chroma_ac_hm_code_val_table_148_151;
263	unsigned int	chroma_ac_hm_code_val_table_152_155;
264	unsigned int	chroma_ac_hm_code_val_table_156_159;
265	unsigned int	chroma_ac_hm_code_val_table_160_161;
266} __attribute__((packed)) jpeg_cmd_dec_cfg;
267
268
269/*
270 * ARM to JPEG configuration commands are passed through the
271 * uPJpegActionCmdQueue
272 */
273
274/*
275 * Command to start the encode process
276 */
277
278#define	JPEG_CMD_ENC_ENCODE		0x0000
279#define	JPEG_CMD_ENC_ENCODE_LEN		sizeof(jpeg_cmd_enc_encode)
280
281
282typedef struct {
283	unsigned short	cmd_id;
284} __attribute__((packed)) jpeg_cmd_enc_encode;
285
286
287/*
288 * Command to transition from current state of encoder to IDLE state
289 */
290
291#define	JPEG_CMD_ENC_IDLE		0x0001
292#define	JPEG_CMD_ENC_IDLE_LEN		sizeof(jpeg_cmd_enc_idle)
293
294
295typedef struct {
296	unsigned short	cmd_id;
297} __attribute__((packed)) jpeg_cmd_enc_idle;
298
299
300/*
301 * Command to inform the encoder that another buffer is ready
302 */
303
304#define	JPEG_CMD_ENC_OP_CONSUMED	0x0002
305#define	JPEG_CMD_ENC_OP_CONSUMED_LEN	sizeof(jpeg_cmd_enc_op_consumed)
306
307
308typedef struct {
309	unsigned int	cmd_id;
310	unsigned int	op_buf_addr;
311	unsigned int	op_buf_size;
312} __attribute__((packed)) jpeg_cmd_enc_op_consumed;
313
314
315/*
316 * Command to start the decoding process
317 */
318
319#define	JPEG_CMD_DEC_DECODE		0x0003
320#define	JPEG_CMD_DEC_DECODE_LEN	sizeof(jpeg_cmd_dec_decode)
321
322
323typedef struct {
324	unsigned short	cmd_id;
325} __attribute__((packed)) jpeg_cmd_dec_decode;
326
327
328/*
329 * Command to transition from the current state of decoder to IDLE
330 */
331
332#define	JPEG_CMD_DEC_IDLE	0x0004
333#define	JPEG_CMD_DEC_IDLE_LEN	sizeof(jpeg_cmd_dec_idle)
334
335
336typedef struct {
337	unsigned short	cmd_id;
338} __attribute__((packed)) jpeg_cmd_dec_idle;
339
340
341/*
342 * Command to inform that an op buffer is ready for use
343 */
344
345#define	JPEG_CMD_DEC_OP_CONSUMED	0x0005
346#define	JPEG_CMD_DEC_OP_CONSUMED_LEN	sizeof(jpeg_cmd_dec_op_consumed)
347
348
349typedef struct {
350	unsigned int	cmd_id;
351	unsigned int	luma_op_buf_addr;
352	unsigned int	luma_op_buf_size;
353	unsigned int	chroma_op_buf_addr;
354} __attribute__((packed)) jpeg_cmd_dec_op_consumed;
355
356
357/*
358 * Command to pass a new ip buffer to the jpeg decoder
359 */
360
361#define	JPEG_CMD_DEC_IP	0x0006
362#define	JPEG_CMD_DEC_IP_LEN	sizeof(jpeg_cmd_dec_ip_len)
363
364#define	JPEG_CMD_EOI_INDICATOR_NOT_END	0x0000
365#define	JPEG_CMD_EOI_INDICATOR_END	0x0001
366
367typedef struct {
368	unsigned int	cmd_id;
369	unsigned int	ip_buf_addr;
370	unsigned int	ip_buf_size;
371	unsigned int	eoi_indicator;
372} __attribute__((packed)) jpeg_cmd_dec_ip;
373
374
375
376#endif
377