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