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