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