1 /****************************************************************************** 2 * 3 * Copyright (C) 2015 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ***************************************************************************** 18 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore 19 */ 20 /** 21 ******************************************************************************* 22 * @file 23 * ive2.h 24 * 25 * @brief 26 * This file contains all the necessary structure and enumeration 27 * definitions needed for the Application Program Interface(API) of the 28 * Ittiam Video Encoders This is version 2 29 * 30 * @author 31 * Ittiam 32 * 33 * @par List of Functions: 34 * 35 * @remarks 36 * None 37 * 38 ******************************************************************************* 39 */ 40 41 #ifndef _IVE2_H_ 42 #define _IVE2_H_ 43 44 /*****************************************************************************/ 45 /* Constant Macros */ 46 /*****************************************************************************/ 47 48 /** Maximum number of components in I/O Buffers */ 49 #define IVE_MAX_IO_BUFFER_COMPONENTS 4 50 51 /** Maximum number of reference pictures */ 52 #define IVE_MAX_REF 16 53 54 /*****************************************************************************/ 55 /* Enums */ 56 /*****************************************************************************/ 57 58 /** Slice modes */ 59 typedef enum 60 { 61 IVE_SLICE_MODE_NA = 0x7FFFFFFF, 62 IVE_SLICE_MODE_NONE = 0x0, 63 64 IVE_SLICE_MODE_BYTES = 0x1, 65 IVE_SLICE_MODE_BLOCKS = 0x2, 66 }IVE_SLICE_MODE_T; 67 68 /** Adaptive Intra refresh modes */ 69 typedef enum 70 { 71 IVE_AIR_MODE_NA = 0x7FFFFFFF, 72 IVE_AIR_MODE_NONE = 0x0, 73 IVE_AIR_MODE_CYCLIC = 0x1, 74 IVE_AIR_MODE_RANDOM = 0x2, 75 IVE_AIR_MODE_DISTORTION = 0x3, 76 }IVE_AIR_MODE_T; 77 78 /** Rate control modes */ 79 typedef enum 80 { 81 IVE_RC_NA = 0x7FFFFFFF, 82 IVE_RC_NONE = 0x0, 83 IVE_RC_STORAGE = 0x1, 84 IVE_RC_CBR_NON_LOW_DELAY = 0x2, 85 IVE_RC_CBR_LOW_DELAY = 0x3, 86 IVE_RC_TWOPASS = 0x4, 87 IVE_RC_RATECONTROLPRESET_DEFAULT = IVE_RC_STORAGE 88 }IVE_RC_MODE_T; 89 90 /** Encoder mode */ 91 typedef enum 92 { 93 IVE_ENC_MODE_NA = 0x7FFFFFFF, 94 IVE_ENC_MODE_HEADER = 0x1, 95 IVE_ENC_MODE_PICTURE = 0x0, 96 IVE_ENC_MODE_DEFAULT = IVE_ENC_MODE_PICTURE, 97 }IVE_ENC_MODE_T; 98 99 /** Speed Config */ 100 typedef enum IVE_SPEED_CONFIG 101 { 102 IVE_QUALITY_DUMMY = 0x7FFFFFFF, 103 IVE_CONFIG = 0, 104 IVE_SLOWEST = 1, 105 IVE_NORMAL = 2, 106 IVE_FAST = 3, 107 IVE_HIGH_SPEED = 4, 108 IVE_FASTEST = 5, 109 }IVE_SPEED_CONFIG; 110 111 /** API command type */ 112 typedef enum 113 { 114 IVE_CMD_VIDEO_NA = 0x7FFFFFFF, 115 IVE_CMD_VIDEO_CTL = IV_CMD_EXTENSIONS + 1, 116 IVE_CMD_VIDEO_ENCODE, 117 IVE_CMD_QUEUE_INPUT, 118 IVE_CMD_DEQUEUE_INPUT, 119 IVE_CMD_QUEUE_OUTPUT, 120 IVE_CMD_DEQUEUE_OUTPUT, 121 IVE_CMD_GET_RECON, 122 }IVE_API_COMMAND_TYPE_T; 123 124 /** Video Control API command type */ 125 typedef enum 126 { 127 IVE_CMD_CT_NA = 0x7FFFFFFF, 128 IVE_CMD_CTL_SETDEFAULT = 0x0, 129 IVE_CMD_CTL_SET_DIMENSIONS = 0x1, 130 IVE_CMD_CTL_SET_FRAMERATE = 0x2, 131 IVE_CMD_CTL_SET_BITRATE = 0x3, 132 IVE_CMD_CTL_SET_FRAMETYPE = 0x4, 133 IVE_CMD_CTL_SET_QP = 0x5, 134 IVE_CMD_CTL_SET_ENC_MODE = 0x6, 135 IVE_CMD_CTL_SET_VBV_PARAMS = 0x7, 136 IVE_CMD_CTL_SET_AIR_PARAMS = 0x8, 137 IVE_CMD_CTL_SET_ME_PARAMS = 0X9, 138 IVE_CMD_CTL_SET_GOP_PARAMS = 0XA, 139 IVE_CMD_CTL_SET_PROFILE_PARAMS = 0XB, 140 IVE_CMD_CTL_SET_DEBLOCK_PARAMS = 0XC, 141 IVE_CMD_CTL_SET_IPE_PARAMS = 0XD, 142 IVE_CMD_CTL_SET_VUI_PARAMS = 0XE, 143 IVE_CMD_CTL_SET_NUM_CORES = 0x30, 144 IVE_CMD_CTL_RESET = 0xA0, 145 IVE_CMD_CTL_FLUSH = 0xB0, 146 IVE_CMD_CTL_GETBUFINFO = 0xC0, 147 IVE_CMD_CTL_GETVERSION = 0xC1, 148 IVE_CMD_CTL_SET_SEI_MDCV_PARAMS = 0xD0, 149 IVE_CMD_CTL_SET_SEI_CLL_PARAMS = 0xD1, 150 IVE_CMD_CTL_SET_SEI_AVE_PARAMS = 0xD2, 151 IVE_CMD_CTL_SET_SEI_CCV_PARAMS = 0xD3, 152 IVE_CMD_CTL_SET_SEI_SII_PARAMS = 0xD4, 153 IVE_CMD_CTL_CODEC_SUBCMD_START = 0x100, 154 }IVE_CONTROL_API_COMMAND_TYPE_T; 155 156 /* IVE_ERROR_BITS_T: A UWORD32 container will be used for reporting the error*/ 157 /* code to the application. The first 8 bits starting from LSB have been */ 158 /* reserved for the codec to report internal error details. The rest of the */ 159 /* bits will be generic for all video encoders and each bit has an associated*/ 160 /* meaning as mentioned below. The unused bit fields are reserved for future */ 161 /* extenstions and will be zero in the current implementation */ 162 typedef enum { 163 164 /* Bit 8 - Unsupported input parameter or configuration. */ 165 IVE_UNSUPPORTEDPARAM = 0x8, 166 167 /* Bit 9 - Fatal error (stop the codec).If there is an */ 168 /* error and this bit is not set, the error is a recoverable one. */ 169 IVE_FATALERROR = 0x9, 170 171 IVE_ERROR_BITS_T_DUMMY_ELEMENT = 0x7FFFFFFF 172 }IVE_ERROR_BITS_T; 173 174 /* IVE_ERROR_CODES_T: The list of error codes depicting the possible error */ 175 /* scenarios that can be encountered while encoding */ 176 typedef enum 177 { 178 179 IVE_ERR_NA = 0x7FFFFFFF, 180 IVE_ERR_NONE = 0x00, 181 IVE_ERR_INVALID_API_CMD = 0x01, 182 IVE_ERR_INVALID_API_SUB_CMD = 0x02, 183 IVE_ERR_IP_GET_MEM_REC_API_STRUCT_SIZE_INCORRECT = 0x03, 184 IVE_ERR_OP_GET_MEM_REC_API_STRUCT_SIZE_INCORRECT = 0x04, 185 IVE_ERR_IP_FILL_MEM_REC_API_STRUCT_SIZE_INCORRECT = 0x05, 186 IVE_ERR_OP_FILL_MEM_REC_API_STRUCT_SIZE_INCORRECT = 0x06, 187 IVE_ERR_IP_INIT_API_STRUCT_SIZE_INCORRECT = 0x07, 188 IVE_ERR_OP_INIT_API_STRUCT_SIZE_INCORRECT = 0x08, 189 IVE_ERR_IP_RETRIEVE_MEM_REC_API_STRUCT_SIZE_INCORRECT = 0x09, 190 IVE_ERR_OP_RETRIEVE_MEM_REC_API_STRUCT_SIZE_INCORRECT = 0x0A, 191 IVE_ERR_IP_ENCODE_API_STRUCT_SIZE_INCORRECT = 0x0B, 192 IVE_ERR_OP_ENCODE_API_STRUCT_SIZE_INCORRECT = 0x0C, 193 IVE_ERR_IP_CTL_SETDEF_API_STRUCT_SIZE_INCORRECT = 0x0D, 194 IVE_ERR_OP_CTL_SETDEF_API_STRUCT_SIZE_INCORRECT = 0x0E, 195 IVE_ERR_IP_CTL_GETBUFINFO_API_STRUCT_SIZE_INCORRECT = 0x0F, 196 IVE_ERR_OP_CTL_GETBUFINFO_API_STRUCT_SIZE_INCORRECT = 0x10, 197 IVE_ERR_IP_CTL_GETVERSION_API_STRUCT_SIZE_INCORRECT = 0x11, 198 IVE_ERR_OP_CTL_GETVERSION_API_STRUCT_SIZE_INCORRECT = 0x12, 199 IVE_ERR_IP_CTL_FLUSH_API_STRUCT_SIZE_INCORRECT = 0x13, 200 IVE_ERR_OP_CTL_FLUSH_API_STRUCT_SIZE_INCORRECT = 0x14, 201 IVE_ERR_IP_CTL_RESET_API_STRUCT_SIZE_INCORRECT = 0x15, 202 IVE_ERR_OP_CTL_RESET_API_STRUCT_SIZE_INCORRECT = 0x16, 203 IVE_ERR_IP_CTL_SETCORES_API_STRUCT_SIZE_INCORRECT = 0x17, 204 IVE_ERR_OP_CTL_SETCORES_API_STRUCT_SIZE_INCORRECT = 0x18, 205 IVE_ERR_IP_CTL_SETDIM_API_STRUCT_SIZE_INCORRECT = 0x19, 206 IVE_ERR_OP_CTL_SETDIM_API_STRUCT_SIZE_INCORRECT = 0x1A, 207 IVE_ERR_IP_CTL_SETFRAMERATE_API_STRUCT_SIZE_INCORRECT = 0x1B, 208 IVE_ERR_OP_CTL_SETFRAMERATE_API_STRUCT_SIZE_INCORRECT = 0x1C, 209 IVE_ERR_IP_CTL_SETBITRATE_API_STRUCT_SIZE_INCORRECT = 0x1D, 210 IVE_ERR_OP_CTL_SETBITRATE_API_STRUCT_SIZE_INCORRECT = 0x1E, 211 IVE_ERR_IP_CTL_SETFRAMETYPE_API_STRUCT_SIZE_INCORRECT = 0x1F, 212 IVE_ERR_OP_CTL_SETFRAMETYPE_API_STRUCT_SIZE_INCORRECT = 0x20, 213 IVE_ERR_IP_CTL_SETMEPARAMS_API_STRUCT_SIZE_INCORRECT = 0x21, 214 IVE_ERR_OP_CTL_SETMEPARAMS_API_STRUCT_SIZE_INCORRECT = 0x22, 215 IVE_ERR_IP_CTL_SETIPEPARAMS_API_STRUCT_SIZE_INCORRECT = 0x23, 216 IVE_ERR_OP_CTL_SETIPEPARAMS_API_STRUCT_SIZE_INCORRECT = 0x24, 217 IVE_ERR_IP_CTL_SETGOPPARAMS_API_STRUCT_SIZE_INCORRECT = 0x25, 218 IVE_ERR_OP_CTL_SETGOPPARAMS_API_STRUCT_SIZE_INCORRECT = 0x26, 219 IVE_ERR_IP_CTL_SETDEBLKPARAMS_API_STRUCT_SIZE_INCORRECT = 0x27, 220 IVE_ERR_OP_CTL_SETDEBLKPARAMS_API_STRUCT_SIZE_INCORRECT = 0x28, 221 IVE_ERR_IP_CTL_SETQPPARAMS_API_STRUCT_SIZE_INCORRECT = 0x29, 222 IVE_ERR_OP_CTL_SETQPPARAMS_API_STRUCT_SIZE_INCORRECT = 0x2A, 223 IVE_ERR_FILL_NUM_MEM_RECS_POINTER_NULL = 0x2B, 224 IVE_ERR_NUM_MEM_REC_NOT_SUFFICIENT = 0x2C, 225 IVE_ERR_MEM_REC_STRUCT_SIZE_INCORRECT = 0x2D, 226 IVE_ERR_MEM_REC_BASE_POINTER_NULL = 0x2E, 227 IVE_ERR_MEM_REC_OVERLAP_ERR = 0x2F, 228 IVE_ERR_MEM_REC_INSUFFICIENT_SIZE = 0x30, 229 IVE_ERR_MEM_REC_ALIGNMENT_ERR = 0x31, 230 IVE_ERR_MEM_REC_INCORRECT_TYPE = 0x32, 231 IVE_ERR_HANDLE_NULL = 0x33, 232 IVE_ERR_HANDLE_STRUCT_SIZE_INCORRECT = 0x34, 233 IVE_ERR_API_FUNCTION_PTR_NULL = 0x35, 234 IVE_ERR_INVALID_CODEC_HANDLE = 0x36, 235 IVE_ERR_CTL_GET_VERSION_BUFFER_IS_NULL = 0x37, 236 IVE_ERR_IP_CTL_SETAIRPARAMS_API_STRUCT_SIZE_INCORRECT = 0x38, 237 IVE_ERR_OP_CTL_SETAIRPARAMS_API_STRUCT_SIZE_INCORRECT = 0x39, 238 IVE_ERR_IP_CTL_SETENCMODE_API_STRUCT_SIZE_INCORRECT = 0x3A, 239 IVE_ERR_OP_CTL_SETENCMODE_API_STRUCT_SIZE_INCORRECT = 0x3B, 240 IVE_ERR_IP_CTL_SETVBVPARAMS_API_STRUCT_SIZE_INCORRECT = 0x3C, 241 IVE_ERR_OP_CTL_SETVBVPARAMS_API_STRUCT_SIZE_INCORRECT = 0x3D, 242 IVE_ERR_IP_CTL_SETPROFILE_API_STRUCT_SIZE_INCORRECT = 0x3E, 243 IVE_ERR_OP_CTL_SETPROFILE_API_STRUCT_SIZE_INCORRECT = 0x3F, 244 IVE_ERR_IP_CTL_SET_VUI_STRUCT_SIZE_INCORRECT = 0x40, 245 IVE_ERR_OP_CTL_SET_VUI_STRUCT_SIZE_INCORRECT = 0x41, 246 IVE_ERR_IP_CTL_SET_SEI_MDCV_STRUCT_SIZE_INCORRECT = 0x42, 247 IVE_ERR_OP_CTL_SET_SEI_MDCV_STRUCT_SIZE_INCORRECT = 0x43, 248 IVE_ERR_IP_CTL_SET_SEI_CLL_STRUCT_SIZE_INCORRECT = 0x44, 249 IVE_ERR_OP_CTL_SET_SEI_CLL_STRUCT_SIZE_INCORRECT = 0x45, 250 IVE_ERR_IP_CTL_SET_SEI_AVE_STRUCT_SIZE_INCORRECT = 0x46, 251 IVE_ERR_OP_CTL_SET_SEI_AVE_STRUCT_SIZE_INCORRECT = 0x47, 252 IVE_ERR_IP_CTL_SET_SEI_CCV_STRUCT_SIZE_INCORRECT = 0x48, 253 IVE_ERR_OP_CTL_SET_SEI_CCV_STRUCT_SIZE_INCORRECT = 0x49, 254 IVE_ERR_IP_CTL_SET_SEI_SII_STRUCT_SIZE_INCORRECT = 0x4A, 255 IVE_ERR_OP_CTL_SET_SEI_SII_STRUCT_SIZE_INCORRECT = 0x4B, 256 }IVE_ERROR_CODES_T; 257 258 259 /*****************************************************************************/ 260 /* Initialize encoder */ 261 /*****************************************************************************/ 262 263 /** Input structure : Initialize the encoder */ 264 typedef struct 265 { 266 /** size of the structure */ 267 UWORD32 u4_size; 268 269 /** Command type */ 270 IV_API_COMMAND_TYPE_T e_cmd; 271 272 /** Number of memory records */ 273 UWORD32 u4_num_mem_rec; 274 275 /** pointer to array of memrecords structures should be filled by codec 276 with details of memory resource requirements */ 277 iv_mem_rec_t *ps_mem_rec; 278 279 /** maximum width for which codec should request memory requirements */ 280 UWORD32 u4_max_wd; 281 282 /** maximum height for which codec should request memory requirements */ 283 UWORD32 u4_max_ht; 284 285 /** Maximum number of reference frames */ 286 UWORD32 u4_max_ref_cnt; 287 288 /** Maximum number of reorder frames */ 289 UWORD32 u4_max_reorder_cnt; 290 291 /** Maximum level supported */ 292 UWORD32 u4_max_level; 293 294 /** Input color format */ 295 IV_COLOR_FORMAT_T e_inp_color_fmt; 296 297 /** Flag to enable/disable - To be used only for debugging/testing */ 298 UWORD32 u4_enable_recon; 299 300 /** Recon color format */ 301 IV_COLOR_FORMAT_T e_recon_color_fmt; 302 303 /** Rate control mode */ 304 IVE_RC_MODE_T e_rc_mode; 305 306 /** Maximum frame rate to be supported */ 307 UWORD32 u4_max_framerate; 308 309 /** Maximum bitrate to be supported */ 310 UWORD32 u4_max_bitrate; 311 312 /** Maximum number of consecutive B frames */ 313 UWORD32 u4_num_bframes; 314 315 /** Content type Interlaced/Progressive */ 316 IV_CONTENT_TYPE_T e_content_type; 317 318 /** Maximum search range to be used in X direction */ 319 UWORD32 u4_max_srch_rng_x; 320 321 /** Maximum search range to be used in Y direction */ 322 UWORD32 u4_max_srch_rng_y; 323 324 /** Slice Mode */ 325 IVE_SLICE_MODE_T e_slice_mode; 326 327 /** Slice parameter */ 328 UWORD32 u4_slice_param; 329 330 /** Processor architecture */ 331 IV_ARCH_T e_arch; 332 333 /** SOC details */ 334 IV_SOC_T e_soc; 335 336 337 }ive_init_ip_t; 338 339 /** Output structure : Initialize the encoder */ 340 typedef struct 341 { 342 /** Size of the structure */ 343 UWORD32 u4_size; 344 345 /** Return error code */ 346 UWORD32 u4_error_code; 347 }ive_init_op_t; 348 349 350 /*****************************************************************************/ 351 /* Video Encode - Deprecated */ 352 /*****************************************************************************/ 353 354 typedef struct 355 { 356 /** size of the structure */ 357 UWORD32 u4_size; 358 359 IVE_API_COMMAND_TYPE_T e_cmd; 360 361 /** Descriptor for input raw buffer */ 362 iv_raw_buf_t s_inp_buf; 363 364 /** Buffer containing pic info if mb_info_type is non-zero */ 365 void *pv_bufs; 366 367 /** Flag to indicate if mb info is sent along with input buffer */ 368 UWORD32 u4_mb_info_type; 369 370 /** Buffer containing mb info if mb_info_type is non-zero */ 371 void *pv_mb_info; 372 373 /** Flag to indicate if pic info is sent along with input buffer */ 374 UWORD32 u4_pic_info_type; 375 376 /** Buffer containing pic info if mb_info_type is non-zero */ 377 void *pv_pic_info; 378 379 /** Lower 32bits of input time stamp */ 380 UWORD32 u4_timestamp_low; 381 382 /** Upper 32bits of input time stamp */ 383 UWORD32 u4_timestamp_high; 384 385 /** Flag to indicate if this is the last input in the stream */ 386 UWORD32 u4_is_last; 387 388 /** Descriptor for output bit-stream buffer */ 389 iv_bits_buf_t s_out_buf; 390 391 /** Descriptor for recon buffer */ 392 iv_raw_buf_t s_recon_buf; 393 394 }ive_video_encode_ip_t; 395 396 397 typedef struct 398 { 399 /** size of the structure */ 400 UWORD32 u4_size; 401 402 /** error code */ 403 UWORD32 u4_error_code; 404 405 /* Output present */ 406 WORD32 output_present; 407 408 /* dump recon */ 409 WORD32 dump_recon; 410 411 /* encoded frame type */ 412 UWORD32 u4_encoded_frame_type; 413 414 /** Flag to indicate if this is the last output from the encoder */ 415 UWORD32 u4_is_last; 416 417 /** Lower 32bits of input time stamp */ 418 UWORD32 u4_timestamp_low; 419 420 /** Upper 32bits of input time stamp */ 421 UWORD32 u4_timestamp_high; 422 423 /** Descriptor for input raw buffer freed from codec */ 424 iv_raw_buf_t s_inp_buf; 425 426 /** Descriptor for output bit-stream buffer */ 427 iv_bits_buf_t s_out_buf; 428 429 /** Descriptor for recon buffer */ 430 iv_raw_buf_t s_recon_buf; 431 432 }ive_video_encode_op_t; 433 434 /*****************************************************************************/ 435 /* Queue Input raw buffer - Send the YUV buffer to be encoded */ 436 /*****************************************************************************/ 437 /** Input structure : Queue input buffer to the encoder */ 438 typedef struct 439 { 440 /** size of the structure */ 441 UWORD32 u4_size; 442 443 /** Command : IVE_CMD_QUEUE_INPUT */ 444 IVE_API_COMMAND_TYPE_T e_cmd; 445 446 /** Descriptor for input raw buffer */ 447 iv_raw_buf_t s_inp_buf; 448 449 /** Flag to indicate if mb info is sent along with input buffer */ 450 UWORD32 u4_mb_info_type; 451 452 /** Flag to indicate the size of mb info structure */ 453 UWORD32 u4_mb_info_size; 454 455 /** Buffer containing mb info if mb_info_type is non-zero */ 456 void *pv_mb_info; 457 458 /** Flag to indicate if pic info is sent along with input buffer */ 459 UWORD32 u4_pic_info_type; 460 461 /** Buffer containing pic info if mb_info_type is non-zero */ 462 void *pv_pic_info; 463 464 /** Lower 32bits of input time stamp */ 465 UWORD32 u4_timestamp_low; 466 467 /** Upper 32bits of input time stamp */ 468 UWORD32 u4_timestamp_high; 469 470 471 /** Flag to enable/disable blocking the current API call */ 472 UWORD32 u4_is_blocking; 473 474 /** Flag to indicate if this is the last input in the stream */ 475 UWORD32 u4_is_last; 476 477 }ive_queue_inp_ip_t; 478 479 /** Input structure : Queue output buffer to the encoder */ 480 typedef struct 481 { 482 /** size of the structure */ 483 UWORD32 u4_size; 484 485 /** Return error code */ 486 UWORD32 u4_error_code; 487 }ive_queue_inp_op_t; 488 489 /*****************************************************************************/ 490 /* Dequeue Input raw buffer - Get free YUV buffer from the encoder */ 491 /*****************************************************************************/ 492 /** Input structure : Dequeue input buffer from the encoder */ 493 494 typedef struct 495 { 496 /** size of the structure */ 497 UWORD32 u4_size; 498 499 /** Command: IVE_CMD_DEQUEUE_INPUT */ 500 IVE_API_COMMAND_TYPE_T e_cmd; 501 502 /** Flag to enable/disable blocking the current API call */ 503 UWORD32 u4_is_blocking; 504 505 }ive_dequeue_inp_ip_t; 506 507 /** Output structure : Dequeue input buffer from the encoder */ 508 typedef struct 509 { 510 /** size of the structure */ 511 UWORD32 u4_size; 512 513 /** Return error code */ 514 UWORD32 u4_error_code; 515 516 /** Buffer descriptor of the buffer returned from encoder */ 517 iv_raw_buf_t s_inp_buf; 518 519 /** Flag to indicate if mb info is sent along with input buffer */ 520 UWORD32 u4_mb_info_type; 521 522 /** Flag to indicate the size of mb info structure */ 523 UWORD32 u4_mb_info_size; 524 525 /** Buffer containing mb info if mb_info_type is non-zero */ 526 void *pv_mb_info; 527 528 /** Flag to indicate if pic info is sent along with input buffer */ 529 UWORD32 u4_pic_info_type; 530 531 /** Buffer containing pic info if mb_info_type is non-zero */ 532 void *pv_pic_info; 533 534 /** Lower 32bits of input time stamp */ 535 UWORD32 u4_timestamp_low; 536 537 /** Upper 32bits of input time stamp */ 538 UWORD32 u4_timestamp_high; 539 540 /** Flag to indicate if this is the last input in the stream */ 541 UWORD32 u4_is_last; 542 543 544 }ive_dequeue_inp_op_t; 545 546 /*****************************************************************************/ 547 /* Queue Output bitstream buffer - Send the bistream buffer to be filled */ 548 /*****************************************************************************/ 549 /** Input structure : Queue output buffer to the encoder */ 550 551 typedef struct 552 { 553 /** size of the structure */ 554 UWORD32 u4_size; 555 556 /** Command : IVE_CMD_QUEUE_OUTPUT */ 557 IVE_API_COMMAND_TYPE_T e_cmd; 558 559 /** Descriptor for output bit-stream buffer */ 560 iv_bits_buf_t s_out_buf; 561 562 /** Flag to enable/disable blocking the current API call */ 563 UWORD32 u4_is_blocking; 564 565 /** Flag to indicate if this is the last output in the stream */ 566 UWORD32 u4_is_last; 567 568 }ive_queue_out_ip_t; 569 570 /** Output structure : Queue output buffer to the encoder */ 571 typedef struct 572 { 573 /** size of the structure */ 574 UWORD32 u4_size; 575 576 /** Return error code */ 577 UWORD32 u4_error_code; 578 579 }ive_queue_out_op_t; 580 581 582 /*****************************************************************************/ 583 /* Dequeue Output bitstream buffer - Get the bistream buffer filled */ 584 /*****************************************************************************/ 585 /** Input structure : Dequeue output buffer from the encoder */ 586 587 typedef struct 588 { 589 /** size of the structure */ 590 UWORD32 u4_size; 591 592 /** Command : IVE_CMD_DEQUEUE_OUTPUT */ 593 IVE_API_COMMAND_TYPE_T e_cmd; 594 595 /** Flag to enable/disable blocking the current API call */ 596 UWORD32 u4_is_blocking; 597 }ive_dequeue_out_ip_t; 598 599 /** Output structure : Dequeue output buffer from the encoder */ 600 typedef struct 601 { 602 /** size of the structure */ 603 UWORD32 u4_size; 604 605 /** Return error code */ 606 UWORD32 u4_error_code; 607 608 /** Descriptor for output bit-stream buffer */ 609 iv_bits_buf_t s_out_buf; 610 611 /** Lower 32bits of timestamp corresponding to this buffer */ 612 UWORD32 u4_timestamp_low; 613 614 /** Upper 32bits of timestamp corresponding to this buffer */ 615 UWORD32 u4_timestamp_high; 616 617 /** Flag to indicate if this is the last output in the stream */ 618 UWORD32 u4_is_last; 619 620 }ive_dequeue_out_op_t; 621 622 /*****************************************************************************/ 623 /* Get Recon data - Get the reconstructed data from encoder */ 624 /*****************************************************************************/ 625 /** Input structure : Get recon data from the encoder */ 626 627 typedef struct 628 { 629 /** size of the structure */ 630 UWORD32 u4_size; 631 632 /** Command : IVE_CMD_GET_RECON */ 633 IVE_API_COMMAND_TYPE_T e_cmd; 634 635 /** Flag to enable/disable blocking the current API call */ 636 UWORD32 u4_is_blocking; 637 638 /** Descriptor for recon buffer */ 639 iv_raw_buf_t s_recon_buf; 640 641 /** Flag to indicate if this is the last recon in the stream */ 642 UWORD32 u4_is_last; 643 644 }ive_get_recon_ip_t; 645 646 /** Output structure : Get recon data from the encoder */ 647 typedef struct 648 { 649 /** size of the structure */ 650 UWORD32 u4_size; 651 652 /** Return error code */ 653 UWORD32 u4_error_code; 654 655 /** Lower 32bits of time stamp corresponding to this buffer */ 656 UWORD32 u4_timestamp_low; 657 658 /** Upper 32bits of time stamp corresponding to this buffer */ 659 UWORD32 u4_timestamp_high; 660 661 /** Flag to indicate if this is the last recon in the stream */ 662 UWORD32 u4_is_last; 663 664 }ive_get_recon_op_t; 665 666 /*****************************************************************************/ 667 /* Video control Flush */ 668 /*****************************************************************************/ 669 670 /** Input structure : Flush all the buffers from the encoder */ 671 typedef struct 672 { 673 /** size of the structure */ 674 UWORD32 u4_size; 675 676 /** Command type : IVE_CMD_VIDEO_CTL */ 677 IVE_API_COMMAND_TYPE_T e_cmd; 678 679 /** Sub command type : IVE_CMD_CTL_FLUSH */ 680 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 681 }ive_ctl_flush_ip_t; 682 683 /** Output structure : Flush all the buffers from the encoder */ 684 typedef struct 685 { 686 /** size of the structure */ 687 UWORD32 u4_size; 688 689 /** Return error code */ 690 UWORD32 u4_error_code; 691 }ive_ctl_flush_op_t; 692 693 /*****************************************************************************/ 694 /* Video control reset */ 695 /*****************************************************************************/ 696 /** Input structure : Reset the encoder */ 697 typedef struct 698 { 699 /** size of the structure */ 700 UWORD32 u4_size; 701 702 /** Command type : IVE_CMD_VIDEO_CTL */ 703 IVE_API_COMMAND_TYPE_T e_cmd; 704 705 /** Sub command type : IVE_CMD_CTL_RESET */ 706 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 707 }ive_ctl_reset_ip_t; 708 709 /** Output structure : Reset the encoder */ 710 typedef struct 711 { 712 /** size of the structure */ 713 UWORD32 u4_size; 714 715 /** Return error code */ 716 UWORD32 u4_error_code; 717 }ive_ctl_reset_op_t; 718 719 /*****************************************************************************/ 720 /* Video control:Get Buf Info */ 721 /*****************************************************************************/ 722 723 /** Input structure : Get encoder buffer requirements */ 724 typedef struct 725 { 726 /** size of the structure */ 727 UWORD32 u4_size; 728 729 /** Command type : IVE_CMD_VIDEO_CTL */ 730 IVE_API_COMMAND_TYPE_T e_cmd; 731 732 /** Sub command type : IVE_CMD_CTL_GETBUFINFO */ 733 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 734 735 /** maximum width for which codec should request memory requirements */ 736 UWORD32 u4_max_wd; 737 738 /** maximum height for which codec should request memory requirements */ 739 UWORD32 u4_max_ht; 740 741 /** Input color format */ 742 IV_COLOR_FORMAT_T e_inp_color_fmt; 743 744 }ive_ctl_getbufinfo_ip_t; 745 746 /** Output structure : Get encoder buffer requirements */ 747 typedef struct 748 { 749 /** size of the structure */ 750 UWORD32 u4_size; 751 752 /** Return error code */ 753 UWORD32 u4_error_code; 754 755 /** Minimum number of input buffers required for codec */ 756 UWORD32 u4_min_inp_bufs; 757 758 /** Minimum number of output buffers required for codec */ 759 UWORD32 u4_min_out_bufs; 760 761 /** Number of components in input buffers required for codec */ 762 UWORD32 u4_inp_comp_cnt; 763 764 /** Number of components in output buffers required for codec */ 765 UWORD32 u4_out_comp_cnt; 766 767 /** Minimum sizes of each component in input buffer required */ 768 UWORD32 au4_min_in_buf_size[IVE_MAX_IO_BUFFER_COMPONENTS]; 769 770 /** Minimum sizes of each component in output buffer required */ 771 UWORD32 au4_min_out_buf_size[IVE_MAX_IO_BUFFER_COMPONENTS]; 772 773 }ive_ctl_getbufinfo_op_t; 774 775 776 777 778 /*****************************************************************************/ 779 /* Video control:Get Version Info */ 780 /*****************************************************************************/ 781 782 /** Input structure : Get encoder version information */ 783 typedef struct 784 { 785 /** size of the structure */ 786 UWORD32 u4_size; 787 /** Command type : IVE_CMD_VIDEO_CTL */ 788 IVE_API_COMMAND_TYPE_T e_cmd; 789 790 /** Sub command type : IVE_CMD_CTL_GETVERSION */ 791 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 792 793 /** Buffer where version info will be returned */ 794 UWORD8 *pu1_version; 795 796 /** Size of the buffer allocated for version info */ 797 UWORD32 u4_version_bufsize; 798 }ive_ctl_getversioninfo_ip_t; 799 800 /** Output structure : Get encoder version information */ 801 typedef struct 802 { 803 /** size of the structure */ 804 UWORD32 u4_size; 805 806 /** Return error code */ 807 UWORD32 u4_error_code; 808 }ive_ctl_getversioninfo_op_t; 809 810 811 /*****************************************************************************/ 812 /* Video control:set default params */ 813 /*****************************************************************************/ 814 /** Input structure : Set default encoder parameters */ 815 typedef struct 816 { 817 /** size of the structure */ 818 UWORD32 u4_size; 819 820 /** Command type : IVE_CMD_VIDEO_CTL */ 821 IVE_API_COMMAND_TYPE_T e_cmd; 822 823 /** Sub command type : IVE_CMD_CTL_SETDEFAULT */ 824 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 825 826 /** Lower 32bits of time stamp corresponding to input buffer, 827 * from which this command takes effect */ 828 UWORD32 u4_timestamp_low; 829 830 /** Upper 32bits of time stamp corresponding to input buffer, 831 * from which this command takes effect */ 832 UWORD32 u4_timestamp_high; 833 834 }ive_ctl_setdefault_ip_t; 835 836 /** Output structure : Set default encoder parameters */ 837 typedef struct 838 { 839 /** size of the structure */ 840 UWORD32 u4_size; 841 842 /** Return error code */ 843 UWORD32 u4_error_code; 844 }ive_ctl_setdefault_op_t; 845 846 /*****************************************************************************/ 847 /* Video control Set Frame dimensions */ 848 /*****************************************************************************/ 849 850 /** Input structure : Set frame dimensions */ 851 typedef struct 852 { 853 /** size of the structure */ 854 UWORD32 u4_size; 855 856 /** Command type : IVE_CMD_VIDEO_CTL */ 857 IVE_API_COMMAND_TYPE_T e_cmd; 858 859 /** Sub command type : IVE_CMD_CTL_SET_DIMENSIONS */ 860 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 861 862 /** Input width */ 863 UWORD32 u4_wd; 864 865 /** Input height */ 866 UWORD32 u4_ht; 867 868 /** Lower 32bits of time stamp corresponding to input buffer, 869 * from which this command takes effect */ 870 UWORD32 u4_timestamp_low; 871 872 /** Upper 32bits of time stamp corresponding to input buffer, 873 * from which this command takes effect */ 874 UWORD32 u4_timestamp_high; 875 876 }ive_ctl_set_dimensions_ip_t; 877 878 /** Output structure : Set frame dimensions */ 879 typedef struct 880 { 881 /** size of the structure */ 882 UWORD32 u4_size; 883 884 /** Return error code */ 885 UWORD32 u4_error_code; 886 }ive_ctl_set_dimensions_op_t; 887 888 889 /*****************************************************************************/ 890 /* Video control Set Frame rates */ 891 /*****************************************************************************/ 892 893 /** Input structure : Set frame rate */ 894 typedef struct 895 { 896 /** size of the structure */ 897 UWORD32 u4_size; 898 899 /** Command type : IVE_CMD_VIDEO_CTL */ 900 IVE_API_COMMAND_TYPE_T e_cmd; 901 902 /** Sub command type : IVE_CMD_CTL_SET_FRAMERATE */ 903 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 904 905 /** Source frame rate */ 906 UWORD32 u4_src_frame_rate; 907 908 /** Target frame rate */ 909 UWORD32 u4_tgt_frame_rate; 910 911 /** Lower 32bits of time stamp corresponding to input buffer, 912 * from which this command takes effect */ 913 UWORD32 u4_timestamp_low; 914 915 /** Upper 32bits of time stamp corresponding to input buffer, 916 * from which this command takes effect */ 917 UWORD32 u4_timestamp_high; 918 919 }ive_ctl_set_frame_rate_ip_t; 920 921 /** Output structure : Set frame rate */ 922 typedef struct 923 { 924 /** size of the structure */ 925 UWORD32 u4_size; 926 927 /** Return error code */ 928 UWORD32 u4_error_code; 929 }ive_ctl_set_frame_rate_op_t; 930 931 /*****************************************************************************/ 932 /* Video control Set Bitrate */ 933 /*****************************************************************************/ 934 935 /** Input structure : Set bitrate */ 936 typedef struct 937 { 938 /** size of the structure */ 939 UWORD32 u4_size; 940 941 /** Command type : IVE_CMD_VIDEO_CTL */ 942 IVE_API_COMMAND_TYPE_T e_cmd; 943 944 /** Sub command type : IVE_CMD_CTL_SET_BITRATE */ 945 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 946 947 /** Target bitrate in kilobits per second */ 948 UWORD32 u4_target_bitrate; 949 950 /** Lower 32bits of time stamp corresponding to input buffer, 951 * from which this command takes effect */ 952 UWORD32 u4_timestamp_low; 953 954 /** Upper 32bits of time stamp corresponding to input buffer, 955 * from which this command takes effect */ 956 UWORD32 u4_timestamp_high; 957 958 }ive_ctl_set_bitrate_ip_t; 959 960 /** Output structure : Set bitrate */ 961 typedef struct 962 { 963 /** size of the structure */ 964 UWORD32 u4_size; 965 966 /** Return error code */ 967 UWORD32 u4_error_code; 968 }ive_ctl_set_bitrate_op_t; 969 970 /*****************************************************************************/ 971 /* Video control Set Frame type */ 972 /*****************************************************************************/ 973 974 /** Input structure : Set frametype */ 975 typedef struct 976 { 977 /** size of the structure */ 978 UWORD32 u4_size; 979 980 /** Command type : IVE_CMD_VIDEO_CTL */ 981 IVE_API_COMMAND_TYPE_T e_cmd; 982 983 /** Sub command type : IVE_CMD_CTL_SET_FRAMETYPE */ 984 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 985 986 /** Force current frame type */ 987 IV_PICTURE_CODING_TYPE_T e_frame_type; 988 989 /** Lower 32bits of time stamp corresponding to input buffer, 990 * from which this command takes effect */ 991 UWORD32 u4_timestamp_low; 992 993 /** Upper 32bits of time stamp corresponding to input buffer, 994 * from which this command takes effect */ 995 UWORD32 u4_timestamp_high; 996 997 }ive_ctl_set_frame_type_ip_t; 998 999 /** Output structure : Set frametype */ 1000 typedef struct 1001 { 1002 /** size of the structure */ 1003 UWORD32 u4_size; 1004 1005 /** Return error code */ 1006 UWORD32 u4_error_code; 1007 }ive_ctl_set_frame_type_op_t; 1008 1009 /*****************************************************************************/ 1010 /* Video control Set Encode mode */ 1011 /*****************************************************************************/ 1012 1013 /** Input structure : Set encode mode */ 1014 typedef struct 1015 { 1016 /** size of the structure */ 1017 UWORD32 u4_size; 1018 1019 /** Command type : IVE_CMD_VIDEO_CTL */ 1020 IVE_API_COMMAND_TYPE_T e_cmd; 1021 1022 /** Sub command type : IVE_CMD_CTL_SET_ENC_MODE */ 1023 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1024 1025 /** Encoder mode */ 1026 IVE_ENC_MODE_T e_enc_mode; 1027 1028 /** Lower 32bits of time stamp corresponding to input buffer, 1029 * from which this command takes effect */ 1030 UWORD32 u4_timestamp_low; 1031 1032 /** Upper 32bits of time stamp corresponding to input buffer, 1033 * from which this command takes effect */ 1034 UWORD32 u4_timestamp_high; 1035 1036 }ive_ctl_set_enc_mode_ip_t; 1037 1038 /** Output structure : Set encode mode */ 1039 typedef struct 1040 { 1041 /** size of the structure */ 1042 UWORD32 u4_size; 1043 1044 /** Return error code */ 1045 UWORD32 u4_error_code; 1046 1047 }ive_ctl_set_enc_mode_op_t; 1048 1049 /*****************************************************************************/ 1050 /* Video control Set QP */ 1051 /*****************************************************************************/ 1052 1053 /** Input structure : Set QP */ 1054 typedef struct 1055 { 1056 /** size of the structure */ 1057 UWORD32 u4_size; 1058 1059 /** Command type : IVE_CMD_VIDEO_CTL */ 1060 IVE_API_COMMAND_TYPE_T e_cmd; 1061 1062 /** Sub command type : IVE_CMD_CTL_SET_QP */ 1063 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1064 1065 /** Set initial Qp for I pictures */ 1066 UWORD32 u4_i_qp; 1067 1068 /** Set initial Qp for P pictures */ 1069 UWORD32 u4_p_qp; 1070 1071 /** Set initial Qp for B pictures */ 1072 UWORD32 u4_b_qp; 1073 1074 /** Set minimum Qp for I pictures */ 1075 UWORD32 u4_i_qp_min; 1076 1077 /** Set maximum Qp for I pictures */ 1078 UWORD32 u4_i_qp_max; 1079 1080 /** Set minimum Qp for P pictures */ 1081 UWORD32 u4_p_qp_min; 1082 1083 /** Set maximum Qp for P pictures */ 1084 UWORD32 u4_p_qp_max; 1085 1086 /** Set minimum Qp for B pictures */ 1087 UWORD32 u4_b_qp_min; 1088 1089 /** Set maximum Qp for B pictures */ 1090 UWORD32 u4_b_qp_max; 1091 1092 /** Lower 32bits of time stamp corresponding to input buffer, 1093 * from which this command takes effect */ 1094 UWORD32 u4_timestamp_low; 1095 1096 /** Upper 32bits of time stamp corresponding to input buffer, 1097 * from which this command takes effect */ 1098 UWORD32 u4_timestamp_high; 1099 1100 1101 }ive_ctl_set_qp_ip_t; 1102 1103 /** Output structure : Set QP */ 1104 typedef struct 1105 { 1106 /** size of the structure */ 1107 UWORD32 u4_size; 1108 1109 /** Return error code */ 1110 UWORD32 u4_error_code; 1111 }ive_ctl_set_qp_op_t; 1112 1113 /*****************************************************************************/ 1114 /* Video control Set AIR params */ 1115 /*****************************************************************************/ 1116 1117 /** Input structure : Set AIR params */ 1118 typedef struct 1119 { 1120 /** size of the structure */ 1121 UWORD32 u4_size; 1122 /** Command type : IVE_CMD_VIDEO_CTL */ 1123 IVE_API_COMMAND_TYPE_T e_cmd; 1124 1125 /** Sub command type : IVE_CMD_CTL_SET_AIR_PARAMS */ 1126 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1127 1128 /** Adaptive intra refresh mode */ 1129 IVE_AIR_MODE_T e_air_mode; 1130 1131 /** Adaptive intra refresh period in frames */ 1132 UWORD32 u4_air_refresh_period; 1133 1134 /** Lower 32bits of time stamp corresponding to input buffer, 1135 * from which this command takes effect */ 1136 UWORD32 u4_timestamp_low; 1137 1138 /** Upper 32bits of time stamp corresponding to input buffer, 1139 * from which this command takes effect */ 1140 UWORD32 u4_timestamp_high; 1141 1142 1143 }ive_ctl_set_air_params_ip_t; 1144 1145 /** Output structure : Set AIR params */ 1146 typedef struct 1147 { 1148 /** size of the structure */ 1149 UWORD32 u4_size; 1150 1151 /** Return error code */ 1152 UWORD32 u4_error_code; 1153 }ive_ctl_set_air_params_op_t; 1154 1155 /*****************************************************************************/ 1156 /* Video control Set VBV params */ 1157 /*****************************************************************************/ 1158 1159 /** Input structure : Set VBV params */ 1160 typedef struct 1161 { 1162 /** size of the structure */ 1163 UWORD32 u4_size; 1164 1165 /** Command type : IVE_CMD_VIDEO_CTL */ 1166 IVE_API_COMMAND_TYPE_T e_cmd; 1167 1168 /** Sub command type : IVE_CMD_CTL_SET_VBV_PARAMS */ 1169 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1170 1171 /** VBV buffer delay */ 1172 UWORD32 u4_vbv_buffer_delay; 1173 1174 /** VBV buffer size */ 1175 UWORD32 u4_vbv_buf_size; 1176 1177 /** Lower 32bits of time stamp corresponding to input buffer, 1178 * from which this command takes effect */ 1179 UWORD32 u4_timestamp_low; 1180 1181 /** Upper 32bits of time stamp corresponding to input buffer, 1182 * from which this command takes effect */ 1183 UWORD32 u4_timestamp_high; 1184 1185 1186 }ive_ctl_set_vbv_params_ip_t; 1187 1188 /** Output structure : Set VBV params */ 1189 typedef struct 1190 { 1191 /** size of the structure */ 1192 UWORD32 u4_size; 1193 1194 /** Return error code */ 1195 UWORD32 u4_error_code; 1196 }ive_ctl_set_vbv_params_op_t; 1197 1198 1199 /*****************************************************************************/ 1200 /* Video control Set Processor Details */ 1201 /*****************************************************************************/ 1202 1203 /** Input structure : Set processor details */ 1204 typedef struct 1205 { 1206 /** size of the structure */ 1207 UWORD32 u4_size; 1208 1209 /** Command type : IVE_CMD_VIDEO_CTL */ 1210 IVE_API_COMMAND_TYPE_T e_cmd; 1211 1212 /** Sub command type : IVE_CMD_CTL_SET_NUM_CORES */ 1213 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1214 1215 /** Total number of cores to be used */ 1216 UWORD32 u4_num_cores; 1217 1218 /** Lower 32bits of time stamp corresponding to input buffer, 1219 * from which this command takes effect */ 1220 UWORD32 u4_timestamp_low; 1221 1222 /** Upper 32bits of time stamp corresponding to input buffer, 1223 * from which this command takes effect */ 1224 UWORD32 u4_timestamp_high; 1225 1226 }ive_ctl_set_num_cores_ip_t; 1227 1228 /** Output structure : Set processor details */ 1229 typedef struct 1230 { 1231 /** size of the structure */ 1232 UWORD32 u4_size; 1233 1234 /** Return error code */ 1235 UWORD32 u4_error_code; 1236 }ive_ctl_set_num_cores_op_t; 1237 1238 /*****************************************************************************/ 1239 /* Video control Set Intra Prediction estimation params */ 1240 /*****************************************************************************/ 1241 1242 /** Input structure : Set IPE params */ 1243 typedef struct 1244 { 1245 /** size of the structure */ 1246 UWORD32 u4_size; 1247 1248 /** Command type : IVE_CMD_VIDEO_CTL */ 1249 IVE_API_COMMAND_TYPE_T e_cmd; 1250 1251 /** Sub command type : IVE_CMD_CTL_SET_IPE_PARAMS */ 1252 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1253 1254 /** Flag to enable/disbale intra 4x4 analysis */ 1255 UWORD32 u4_enable_intra_4x4; 1256 1257 /** Flag to enable/disable pre-enc stage of Intra Pred estimation */ 1258 UWORD32 u4_pre_enc_ipe; 1259 1260 /** Speed preset - Value between 0 (slowest) and 100 (fastest) */ 1261 IVE_SPEED_CONFIG u4_enc_speed_preset; 1262 1263 /** Lower 32bits of time stamp corresponding to input buffer, 1264 * from which this command takes effect */ 1265 UWORD32 u4_timestamp_low; 1266 1267 /** Upper 32bits of time stamp corresponding to input buffer, 1268 * from which this command takes effect */ 1269 UWORD32 u4_timestamp_high; 1270 1271 /** Constrained intra pred flag */ 1272 UWORD32 u4_constrained_intra_pred; 1273 1274 }ive_ctl_set_ipe_params_ip_t; 1275 1276 /** Output structure : Set IPE Params */ 1277 typedef struct 1278 { 1279 /** size of the structure */ 1280 UWORD32 u4_size; 1281 1282 /** Return error code */ 1283 UWORD32 u4_error_code; 1284 }ive_ctl_set_ipe_params_op_t; 1285 1286 /*****************************************************************************/ 1287 /* Video control Set Motion estimation params */ 1288 /*****************************************************************************/ 1289 1290 /** Input structure : Set ME Params */ 1291 typedef struct 1292 { 1293 /** size of the structure */ 1294 UWORD32 u4_size; 1295 1296 /** Command type : IVE_CMD_VIDEO_CTL */ 1297 IVE_API_COMMAND_TYPE_T e_cmd; 1298 1299 /** Sub command type : IVE_CMD_CTL_SET_ME_PARAMS */ 1300 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1301 1302 /** Flag to enable/disable pre-enc stage of Motion estimation */ 1303 UWORD32 u4_pre_enc_me; 1304 1305 /** Speed preset - Value between 0 (slowest) and 100 (fastest) */ 1306 UWORD32 u4_me_speed_preset; 1307 1308 /** Flag to enable/disable half pel motion estimation */ 1309 UWORD32 u4_enable_hpel; 1310 1311 /** Flag to enable/disable quarter pel motion estimation */ 1312 UWORD32 u4_enable_qpel; 1313 1314 /** Flag to enable/disable fast SAD approximation */ 1315 UWORD32 u4_enable_fast_sad; 1316 1317 /** Flag to enable/disable alternate reference frames */ 1318 UWORD32 u4_enable_alt_ref; 1319 1320 /** Maximum search range in X direction for farthest reference */ 1321 UWORD32 u4_srch_rng_x; 1322 1323 /** Maximum search range in Y direction for farthest reference */ 1324 UWORD32 u4_srch_rng_y; 1325 1326 /** Lower 32bits of time stamp corresponding to input buffer, 1327 * from which this command takes effect */ 1328 UWORD32 u4_timestamp_low; 1329 1330 /** Upper 32bits of time stamp corresponding to input buffer, 1331 * from which this command takes effect */ 1332 UWORD32 u4_timestamp_high; 1333 1334 }ive_ctl_set_me_params_ip_t; 1335 1336 /** Output structure : Set ME Params */ 1337 typedef struct 1338 { 1339 /** size of the structure */ 1340 UWORD32 u4_size; 1341 1342 /** Return error code */ 1343 UWORD32 u4_error_code; 1344 }ive_ctl_set_me_params_op_t; 1345 1346 /*****************************************************************************/ 1347 /* Video control Set GOP params */ 1348 /*****************************************************************************/ 1349 1350 /** Input structure : Set GOP Params */ 1351 typedef struct 1352 { 1353 /** size of the structure */ 1354 UWORD32 u4_size; 1355 1356 /** Command type : IVE_CMD_VIDEO_CTL */ 1357 IVE_API_COMMAND_TYPE_T e_cmd; 1358 1359 /** Sub command type : IVE_CMD_CTL_SET_GOP_PARAMS */ 1360 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1361 1362 /** I frame interval */ 1363 UWORD32 u4_i_frm_interval; 1364 1365 /** IDR frame interval */ 1366 UWORD32 u4_idr_frm_interval; 1367 1368 /** Lower 32bits of time stamp corresponding to input buffer, 1369 * from which this command takes effect */ 1370 UWORD32 u4_timestamp_low; 1371 1372 /** Upper 32bits of time stamp corresponding to input buffer, 1373 * from which this command takes effect */ 1374 UWORD32 u4_timestamp_high; 1375 1376 }ive_ctl_set_gop_params_ip_t; 1377 1378 /** Output structure : Set GOP params */ 1379 typedef struct 1380 { 1381 /** size of the structure */ 1382 UWORD32 u4_size; 1383 1384 /** Return error code */ 1385 UWORD32 u4_error_code; 1386 }ive_ctl_set_gop_params_op_t; 1387 1388 /*****************************************************************************/ 1389 /* Video control Set Deblock params */ 1390 /*****************************************************************************/ 1391 1392 /** Input structure : Set Deblock Params */ 1393 typedef struct 1394 { 1395 /** size of the structure */ 1396 UWORD32 u4_size; 1397 1398 /** Command type : IVE_CMD_VIDEO_CTL */ 1399 IVE_API_COMMAND_TYPE_T e_cmd; 1400 1401 /** Sub command type : IVE_CMD_CTL_SET_GOP_PARAMS */ 1402 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1403 1404 /** Disable deblock level (0: Enable completely, 3: Disable completely */ 1405 UWORD32 u4_disable_deblock_level; 1406 1407 /** Lower 32bits of time stamp corresponding to input buffer, 1408 * from which this command takes effect */ 1409 UWORD32 u4_timestamp_low; 1410 1411 /** Upper 32bits of time stamp corresponding to input buffer, 1412 * from which this command takes effect */ 1413 UWORD32 u4_timestamp_high; 1414 1415 }ive_ctl_set_deblock_params_ip_t; 1416 1417 /** Output structure : Set Deblock Params */ 1418 typedef struct 1419 { 1420 /** size of the structure */ 1421 UWORD32 u4_size; 1422 1423 /** Return error code */ 1424 UWORD32 u4_error_code; 1425 }ive_ctl_set_deblock_params_op_t; 1426 1427 /*****************************************************************************/ 1428 /* Video control Set Profile params */ 1429 /*****************************************************************************/ 1430 1431 /** Input structure : Set Profile Params */ 1432 typedef struct 1433 { 1434 /** size of the structure */ 1435 UWORD32 u4_size; 1436 1437 /** Command type : IVE_CMD_VIDEO_CTL */ 1438 IVE_API_COMMAND_TYPE_T e_cmd; 1439 1440 /** Sub command type : IVE_CMD_CTL_SET_PROFILE_PARAMS */ 1441 IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 1442 1443 /** Profile */ 1444 IV_PROFILE_T e_profile; 1445 1446 /** Lower 32bits of time stamp corresponding to input buffer, 1447 * from which this command takes effect */ 1448 UWORD32 u4_timestamp_low; 1449 1450 /** Upper 32bits of time stamp corresponding to input buffer, 1451 * from which this command takes effect */ 1452 UWORD32 u4_timestamp_high; 1453 1454 /** Entropy coding mode flag: 0-CAVLC, 1-CABAC */ 1455 UWORD32 u4_entropy_coding_mode; 1456 1457 }ive_ctl_set_profile_params_ip_t; 1458 1459 /** Output structure : Set Profile Params */ 1460 typedef struct 1461 { 1462 /** size of the structure */ 1463 UWORD32 u4_size; 1464 1465 /** Return error code */ 1466 UWORD32 u4_error_code; 1467 }ive_ctl_set_profile_params_op_t; 1468 1469 1470 #endif /* _IVE2_H_ */ 1471 1472