xref: /aosp_15_r20/external/libavc/encoder/ih264e.h (revision 495ae853bb871d1e5a258cb02c2cc13cde8ddb9a)
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 ******************************************************************************
23 * @file
24 *  ih264e.h
25 *
26 * @brief
27 *  This file contains all the necessary structure and enumeration definitions
28 *  needed for the Application Program Interface(API) of the Ittiam H264 Encoder
29 *
30 * @author
31 *  ittiam
32 *
33 * @remarks
34 *  none
35 ******************************************************************************
36 */
37 
38 #ifndef _IH264E_H_
39 #define _IH264E_H_
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #include "iv2.h"
46 #include "ive2.h"
47 
48 /*****************************************************************************/
49 /* Constant Macros                                                           */
50 /*****************************************************************************/
51 
52 
53 /*****************************************************************************/
54 /* Function Declarations                                                     */
55 /*****************************************************************************/
56 IV_STATUS_T ih264e_api_function(iv_obj_t *ps_handle, void *pv_api_ip,
57                                 void *pv_api_op);
58 
59 /*****************************************************************************/
60 /* Enums                                                                     */
61 /*****************************************************************************/
62 typedef enum
63 {
64     IH264E_CMD_CTL_SET_ME_INFO_ENABLE,
65 }IH264E_CMD_CTL_SUB_CMDS;
66 
67 /* NOTE: Ensure this enum values are not greater than 8 bits as this is being
68  * assigned to WORD8 */
69 typedef enum
70 {
71     INTRA16x16 = 0,
72     INTRA4x4,
73     INTER16x16,
74 }IV_MB_TYPE_T;
75 
76 /*****************************************************************************/
77 /* Extended Structures                                                       */
78 /*****************************************************************************/
79 
80 /*****************************************************************************/
81 /*  Get Number of Memory Records                                             */
82 /*****************************************************************************/
83 typedef struct
84 {
85     iv_num_mem_rec_ip_t                    s_ive_ip;
86 }ih264e_num_mem_rec_ip_t;
87 
88 typedef struct
89 {
90     iv_num_mem_rec_op_t                    s_ive_op;
91 }ih264e_num_mem_rec_op_t;
92 
93 /*****************************************************************************/
94 /*  Fill Memory Records                                                      */
95 /*****************************************************************************/
96 typedef struct
97 {
98     iv_fill_mem_rec_ip_t                   s_ive_ip;
99 }ih264e_fill_mem_rec_ip_t;
100 
101 typedef struct
102 {
103     iv_fill_mem_rec_op_t                   s_ive_op;
104 }ih264e_fill_mem_rec_op_t;
105 
106 /*****************************************************************************/
107 /*  Retrieve Memory Records                                                  */
108 /*****************************************************************************/
109 typedef struct
110 {
111     iv_retrieve_mem_rec_ip_t               s_ive_ip;
112 }ih264e_retrieve_mem_rec_ip_t;
113 
114 typedef struct
115 {
116     iv_retrieve_mem_rec_op_t               s_ive_op;
117 }ih264e_retrieve_mem_rec_op_t;
118 
119 /*****************************************************************************/
120 /*   Initialize encoder                                                      */
121 /*****************************************************************************/
122 typedef struct
123 {
124     ive_init_ip_t                           s_ive_ip;
125 }ih264e_init_ip_t;
126 
127 typedef struct
128 {
129     ive_init_op_t                           s_ive_op;
130 }ih264e_init_op_t;
131 
132 /*****************************************************************************/
133 /*   Queue Input raw buffer - Send the YUV buffer to be encoded              */
134 /*****************************************************************************/
135 typedef struct
136 {
137     ive_queue_inp_ip_t                      s_ive_ip;
138 }ih264e_queue_inp_ip_t;
139 
140 typedef struct
141 {
142     ive_queue_inp_op_t                      s_ive_op;
143 }ih264e_queue_inp_op_t;
144 
145 /*****************************************************************************/
146 /*   Dequeue Input raw buffer - Get free YUV buffer from the encoder         */
147 /*****************************************************************************/
148 typedef struct
149 {
150     ive_dequeue_inp_ip_t                      s_ive_ip;
151 }ih264e_dequeue_inp_ip_t;
152 
153 typedef struct
154 {
155     ive_dequeue_inp_op_t                      s_ive_op;
156 }ih264e_dequeue_inp_op_t;
157 
158 /*****************************************************************************/
159 /*   Queue Output bitstream buffer - Send the bistream buffer to be filled   */
160 /*****************************************************************************/
161 typedef struct
162 {
163     ive_queue_out_ip_t                      s_ive_ip;
164 }ih264e_queue_out_ip_t;
165 
166 typedef struct
167 {
168     ive_queue_out_op_t                      s_ive_op;
169 }ih264e_queue_out_op_t;
170 
171 /*****************************************************************************/
172 /* Dequeue Output bitstream buffer - Get the bistream buffer filled          */
173 /*****************************************************************************/
174 typedef struct
175 {
176     ive_dequeue_out_ip_t                      s_ive_ip;
177 }ih264e_dequeue_out_ip_t;
178 
179 typedef struct
180 {
181     ive_dequeue_out_op_t                      s_ive_op;
182 }ih264e_dequeue_out_op_t;
183 
184 /*****************************************************************************/
185 /* Get Recon data - Get the reconstructed data from encoder                  */
186 /*****************************************************************************/
187 typedef struct
188 {
189     ive_get_recon_ip_t                        s_ive_ip;
190 }ih264e_get_recon_ip_t;
191 
192 typedef struct
193 {
194     ive_get_recon_op_t                        s_ive_op;
195 }ih264e_get_recon_op_t;
196 
197 /*****************************************************************************/
198 /*   Video control  Flush                                                    */
199 /*****************************************************************************/
200 typedef struct
201 {
202     ive_ctl_flush_ip_t                      s_ive_ip;
203 }ih264e_ctl_flush_ip_t;
204 
205 typedef struct
206 {
207     ive_ctl_flush_op_t                      s_ive_op;
208 }ih264e_ctl_flush_op_t;
209 
210 /*****************************************************************************/
211 /*   Video control reset                                                     */
212 /*****************************************************************************/
213 typedef struct
214 {
215     ive_ctl_reset_ip_t                      s_ive_ip;
216 }ih264e_ctl_reset_ip_t;
217 
218 typedef struct
219 {
220     ive_ctl_reset_op_t                      s_ive_op;
221 }ih264e_ctl_reset_op_t;
222 
223 /*****************************************************************************/
224 /*   Video control:Get Buf Info                                              */
225 /*****************************************************************************/
226 typedef struct
227 {
228     ive_ctl_getbufinfo_ip_t             s_ive_ip;
229 }ih264e_ctl_getbufinfo_ip_t;
230 
231 typedef struct
232 {
233     ive_ctl_getbufinfo_op_t             s_ive_op;
234 }ih264e_ctl_getbufinfo_op_t;
235 
236 /*****************************************************************************/
237 /*   Video control:Get Version Info                                          */
238 /*****************************************************************************/
239 typedef struct
240 {
241     ive_ctl_getversioninfo_ip_t         s_ive_ip;
242 }ih264e_ctl_getversioninfo_ip_t;
243 
244 typedef struct
245 {
246     ive_ctl_getversioninfo_op_t         s_ive_op;
247 }ih264e_ctl_getversioninfo_op_t;
248 
249 /*****************************************************************************/
250 /*   Video control:Set default params                                        */
251 /*****************************************************************************/
252 typedef struct
253 {
254     ive_ctl_setdefault_ip_t         s_ive_ip;
255 }ih264e_ctl_setdefault_ip_t;
256 
257 typedef struct
258 {
259     ive_ctl_setdefault_op_t         s_ive_op;
260 }ih264e_ctl_setdefault_op_t;
261 
262 /*****************************************************************************/
263 /*   Video control  Set IPE params                                           */
264 /*****************************************************************************/
265 typedef struct
266 {
267     ive_ctl_set_ipe_params_ip_t     s_ive_ip;
268 }ih264e_ctl_set_ipe_params_ip_t;
269 
270 typedef struct
271 {
272     ive_ctl_set_ipe_params_op_t     s_ive_op;
273 }ih264e_ctl_set_ipe_params_op_t;
274 
275 /*****************************************************************************/
276 /*   Video control  Set Frame dimensions                                     */
277 /*****************************************************************************/
278 typedef struct
279 {
280     ive_ctl_set_dimensions_ip_t     s_ive_ip;
281 }ih264e_ctl_set_dimensions_ip_t;
282 
283 typedef struct
284 {
285     ive_ctl_set_dimensions_op_t     s_ive_op;
286 }ih264e_ctl_set_dimensions_op_t;
287 
288 /*****************************************************************************/
289 /*   Video control  Set Frame rates                                          */
290 /*****************************************************************************/
291 typedef struct
292 {
293     ive_ctl_set_frame_rate_ip_t     s_ive_ip;
294 }ih264e_ctl_set_frame_rate_ip_t;
295 
296 typedef struct
297 {
298     ive_ctl_set_frame_rate_op_t     s_ive_op;
299 }ih264e_ctl_set_frame_rate_op_t;
300 
301 /*****************************************************************************/
302 /*   Video control  Set Bitrate                                              */
303 /*****************************************************************************/
304 typedef struct
305 {
306     ive_ctl_set_bitrate_ip_t        s_ive_ip;
307 }ih264e_ctl_set_bitrate_ip_t;
308 
309 typedef struct
310 {
311     ive_ctl_set_bitrate_op_t        s_ive_op;
312 }ih264e_ctl_set_bitrate_op_t;
313 
314 /*****************************************************************************/
315 /*   Video control  Set Frame type                                           */
316 /*****************************************************************************/
317 typedef struct
318 {
319     ive_ctl_set_frame_type_ip_t     s_ive_ip;
320 }ih264e_ctl_set_frame_type_ip_t;
321 
322 typedef struct
323 {
324     ive_ctl_set_frame_type_op_t     s_ive_op;
325 }ih264e_ctl_set_frame_type_op_t;
326 
327 /*****************************************************************************/
328 /*   Video control  Set Encode mode                                          */
329 /*****************************************************************************/
330 typedef struct
331 {
332     ive_ctl_set_enc_mode_ip_t       s_ive_ip;
333 }ih264e_ctl_set_enc_mode_ip_t;
334 
335 typedef struct
336 {
337     ive_ctl_set_enc_mode_op_t       s_ive_op;
338 }ih264e_ctl_set_enc_mode_op_t;
339 
340 /*****************************************************************************/
341 /*   Video control  Set QP                                                   */
342 /*****************************************************************************/
343 typedef struct
344 {
345     ive_ctl_set_qp_ip_t             s_ive_ip;
346 }ih264e_ctl_set_qp_ip_t;
347 
348 typedef struct
349 {
350     ive_ctl_set_qp_op_t             s_ive_op;
351 }ih264e_ctl_set_qp_op_t;
352 
353 /*****************************************************************************/
354 /*   Video control  Set AIR params                                           */
355 /*****************************************************************************/
356 typedef struct
357 {
358     ive_ctl_set_air_params_ip_t     s_ive_ip;
359 }ih264e_ctl_set_air_params_ip_t;
360 
361 typedef struct
362 {
363     ive_ctl_set_air_params_op_t     s_ive_op;
364 }ih264e_ctl_set_air_params_op_t;
365 
366 /*****************************************************************************/
367 /*   Video control  Set VBV params                                           */
368 /*****************************************************************************/
369 typedef struct
370 {
371     ive_ctl_set_vbv_params_ip_t     s_ive_ip;
372 }ih264e_ctl_set_vbv_params_ip_t;
373 
374 typedef struct
375 {
376     ive_ctl_set_vbv_params_op_t     s_ive_op;
377 }ih264e_ctl_set_vbv_params_op_t;
378 
379 /*****************************************************************************/
380 /*   Video control  Set Processor Details                                    */
381 /*****************************************************************************/
382 typedef struct
383 {
384     ive_ctl_set_num_cores_ip_t      s_ive_ip;
385 }ih264e_ctl_set_num_cores_ip_t;
386 
387 typedef struct
388 {
389     ive_ctl_set_num_cores_op_t      s_ive_op;
390 }ih264e_ctl_set_num_cores_op_t;
391 
392 /*****************************************************************************/
393 /*   Video control  Set Motion estimation params                             */
394 /*****************************************************************************/
395 typedef struct
396 {
397     ive_ctl_set_me_params_ip_t      s_ive_ip;
398 }ih264e_ctl_set_me_params_ip_t;
399 
400 typedef struct
401 {
402     ive_ctl_set_me_params_op_t      s_ive_op;
403 }ih264e_ctl_set_me_params_op_t;
404 
405 /*****************************************************************************/
406 /*   Video control  Set GOP params                                           */
407 /*****************************************************************************/
408 typedef struct
409 {
410     ive_ctl_set_gop_params_ip_t     s_ive_ip;
411 }ih264e_ctl_set_gop_params_ip_t;
412 
413 typedef struct
414 {
415     ive_ctl_set_gop_params_op_t     s_ive_op;
416 }ih264e_ctl_set_gop_params_op_t;
417 
418 /*****************************************************************************/
419 /*   Video control  Set Deblock params                                       */
420 /*****************************************************************************/
421 typedef struct
422 {
423     ive_ctl_set_deblock_params_ip_t s_ive_ip;
424 }ih264e_ctl_set_deblock_params_ip_t;
425 
426 typedef struct
427 {
428     ive_ctl_set_deblock_params_op_t s_ive_op;
429 }ih264e_ctl_set_deblock_params_op_t;
430 
431 /*****************************************************************************/
432 /*   Video control  Set Profile params                                       */
433 /*****************************************************************************/
434 typedef struct
435 {
436     ive_ctl_set_profile_params_ip_t s_ive_ip;
437 }ih264e_ctl_set_profile_params_ip_t;
438 
439 typedef struct
440 {
441     ive_ctl_set_profile_params_op_t s_ive_op;
442 }ih264e_ctl_set_profile_params_op_t;
443 
444 /*****************************************************************************/
445 /*   Synchronous video encode call                                           */
446 /*****************************************************************************/
447 typedef struct
448 {
449     ive_video_encode_ip_t s_ive_ip;
450 }ih264e_video_encode_ip_t;
451 
452 typedef struct
453 {
454     ive_video_encode_op_t s_ive_op;
455 }ih264e_video_encode_op_t;
456 
457 /*****************************************************************************/
458 /*   Video usability information                                             */
459 /*****************************************************************************/
460 typedef struct
461 {
462     /** size of the structure  */
463     UWORD32                                     u4_size;
464 
465     /** Command type : IVE_CMD_VIDEO_CTL  */
466     IVE_API_COMMAND_TYPE_T                      e_cmd;
467 
468     /** Sub command type : IVE_CMD_CTL_SET_GOP_PARAMS */
469     IVE_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
470 
471     /** indicates the presence of aspect_ratio */
472     UWORD8                                      u1_aspect_ratio_info_present_flag;
473 
474     /** specifies the aspect ratio of the luma samples */
475     UWORD8                                      u1_aspect_ratio_idc;
476 
477     /** width of the luma samples. user dependent */
478     UWORD16                                     u2_sar_width;
479 
480     /** Height of the luma samples. user dependent */
481     UWORD16                                     u2_sar_height;
482 
483     /** if 1, specifies that the overscan_appropriate_flag is present
484      * if 0, the preferred display method for the video signal is unspecified */
485     UWORD8                                      u1_overscan_info_present_flag;
486 
487     /** if 1,indicates that the cropped decoded pictures output
488      * are suitable for display using overscan */
489     UWORD8                                      u1_overscan_appropriate_flag;
490 
491     /** if 1 specifies that video_format, video_full_range_flag and
492      * colour_description_present_flag are present */
493     UWORD8                                      u1_video_signal_type_present_flag;
494 
495     /** pal, secam, ntsc, ...  */
496     UWORD8                                      u1_video_format;
497 
498     /** indicates the black level and range of the luma and chroma signals */
499     UWORD8                                      u1_video_full_range_flag;
500 
501     /** if 1,specifies that colour_primaries, transfer_characteristics
502      * and matrix_coefficients are present */
503     UWORD8                                      u1_colour_description_present_flag;
504 
505     /** indicates the chromaticity coordinates of the source primaries  */
506     UWORD8                                      u1_colour_primaries;
507 
508     /** indicates the opto-electronic transfer characteristic of the source picture */
509     UWORD8                                      u1_transfer_characteristics;
510 
511     /** the matrix coefficients used in deriving luma and chroma signals
512      * from the green, blue, and red primaries */
513     UWORD8                                      u1_matrix_coefficients;
514 
515     /** if 1, specifies that chroma_sample_loc_type_top_field and
516      * chroma_sample_loc_type_bottom_field are present */
517     UWORD8                                      u1_chroma_loc_info_present_flag;
518 
519     /** location of chroma samples */
520     UWORD8                                      u1_chroma_sample_loc_type_top_field;
521     UWORD8                                      u1_chroma_sample_loc_type_bottom_field;
522 
523     /**  Indicates the presence of the num_units_in_ticks, time_scale flag */
524     UWORD8                                      u1_vui_timing_info_present_flag;
525 
526     /**  Number of units that correspond to one increment of the
527     *   clock. Indicates the  resolution */
528     UWORD32                                     u4_vui_num_units_in_tick;
529 
530     /**  The number of time units that pass in one second */
531     UWORD32                                     u4_vui_time_scale;
532 
533     /** Flag indicating that time difference between two frames is a constant */
534     UWORD8                                      u1_fixed_frame_rate_flag;
535 
536     /** Indicates the presence of NAL HRD parameters */
537     UWORD8                                      u1_nal_hrd_parameters_present_flag;
538 
539     /** Indicates the presence of VCL HRD parameters */
540     UWORD8                                      u1_vcl_hrd_parameters_present_flag;
541 
542     /** Specifies the HRD operational mode */
543     UWORD8                                      u1_low_delay_hrd_flag;
544 
545     /** Indicates presence of SEI messages which include pic_struct syntax element */
546     UWORD8                                      u1_pic_struct_present_flag;
547 
548     /** 1, specifies that the following cvs bitstream restriction parameters are present */
549     UWORD8                                      u1_bitstream_restriction_flag;
550 
551     /** if 0, indicates that no pel outside the pic boundaries and
552      * no sub-pels derived using pels outside the pic boundaries is used for inter prediction */
553     UWORD8                                      u1_motion_vectors_over_pic_boundaries_flag;
554 
555     /** Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units
556      * associated with any coded picture */
557     UWORD8                                      u1_max_bytes_per_pic_denom;
558 
559     /** Indicates an upper bound for the number of bits of coding_unit() data */
560     UWORD8                                      u1_max_bits_per_mb_denom;
561 
562     /** Indicate the maximum absolute value of a decoded horizontal MV component
563      * in quarter-pel luma units */
564     UWORD8                                      u1_log2_max_mv_length_horizontal;
565 
566     /** Indicate the maximum absolute value of a decoded vertical MV component
567      * in quarter-pel luma units */
568     UWORD8                                      u1_log2_max_mv_length_vertical;
569 
570     /** Max number of frames that are not synchronized in display and decode order */
571     UWORD8                                      u1_num_reorder_frames;
572 
573     /** specifies required size of the HRD DPB in units of frame buffers */
574     UWORD8                                      u1_max_dec_frame_buffering;
575 
576 }ih264e_vui_ip_t;
577 
578 typedef struct
579 {
580     /** size of the structure                                           */
581     UWORD32                                     u4_size;
582 
583     /** Return error code                                               */
584     UWORD32                                     u4_error_code;
585 }ih264e_vui_op_t;
586 
587 /*****************************************************************************/
588 /*    Video control  Set SEI MDCV params                                     */
589 /*****************************************************************************/
590 typedef struct
591 {
592     /** size of the structure                                             */
593     UWORD32                                     u4_size;
594 
595     /** Command type : IVE_CMD_VIDEO_CTL                                  */
596     IVE_API_COMMAND_TYPE_T                      e_cmd;
597 
598     /** Sub command type : IVE_CMD_CTL_SET_SEI_MDCV_PARAMS                */
599     IVE_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
600 
601     /** mastering display color volume info present flag                  */
602     UWORD8                                      u1_sei_mdcv_params_present_flag;
603 
604     /** Array to store the display_primaries_x values                     */
605     UWORD16                                     au2_display_primaries_x[3];
606 
607     /** Array to store the display_primaries_y values                     */
608     UWORD16                                     au2_display_primaries_y[3];
609 
610     /** Variable to store the white point x value                         */
611     UWORD16                                     u2_white_point_x;
612 
613     /** Variable to store the white point y value                         */
614     UWORD16                                     u2_white_point_y;
615 
616     /** Variable to store the max display mastering luminance value       */
617     UWORD32                                     u4_max_display_mastering_luminance;
618 
619     /** Variable to store the min display mastering luminance value       */
620     UWORD32                                     u4_min_display_mastering_luminance;
621 
622     /** Lower 32bits of time stamp corresponding to input buffer,
623      * from which this command takes effect                               */
624     UWORD32                                     u4_timestamp_low;
625 
626     /** Upper 32bits of time stamp corresponding to input buffer,
627      * from which this command takes effect                               */
628     UWORD32                                     u4_timestamp_high;
629 
630 }ih264e_ctl_set_sei_mdcv_params_ip_t;
631 
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 }ih264e_ctl_set_sei_mdcv_params_op_t;
641 
642 /*****************************************************************************/
643 /*    Video control  Set SEI CLL params                                      */
644 /*****************************************************************************/
645 typedef 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_SET_SEI_CLL_PARAMS                 */
654     IVE_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
655 
656     /** content light level info present flag                             */
657     UWORD8                                      u1_sei_cll_params_present_flag;
658 
659     /** The maximum pixel intensity of all samples                        */
660     UWORD16                                     u2_max_content_light_level;
661 
662     /** The average pixel intensity of all samples                        */
663     UWORD16                                     u2_max_pic_average_light_level;
664 
665     /** Lower 32bits of time stamp corresponding to input buffer,
666      * from which this command takes effect                               */
667     UWORD32                                     u4_timestamp_low;
668 
669     /** Upper 32bits of time stamp corresponding to input buffer,
670      * from which this command takes effect                               */
671     UWORD32                                     u4_timestamp_high;
672 
673 }ih264e_ctl_set_sei_cll_params_ip_t;
674 
675 typedef struct
676 {
677     /** size of the structure                                             */
678     UWORD32                                     u4_size;
679 
680     /** Return error code                                                 */
681     UWORD32                                     u4_error_code;
682 
683 }ih264e_ctl_set_sei_cll_params_op_t;
684 
685 /*****************************************************************************/
686 /*    Video control  Set SEI AVE params                                      */
687 /*****************************************************************************/
688 typedef struct
689 {
690     /** size of the structure                                             */
691     UWORD32                                     u4_size;
692 
693     /** Command type : IVE_CMD_VIDEO_CTL                                  */
694     IVE_API_COMMAND_TYPE_T                      e_cmd;
695 
696     /** Sub command type : IVE_CMD_CTL_SET_SEI_AVE_PARAMS                 */
697     IVE_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
698 
699     /** ambient viewing environment info present flag                     */
700     UWORD8                                      u1_sei_ave_params_present_flag;
701 
702     /** specifies the environmental illluminance of the ambient viewing
703      * environment                                                        */
704     UWORD32                                     u4_ambient_illuminance;
705 
706     /** specify the normalized x chromaticity coordinates of the
707      * environmental ambient light in the nominal viewing environment     */
708     UWORD16                                     u2_ambient_light_x;
709 
710     /** specify the normalized y chromaticity coordinates of the
711      * environmental ambient light in the nominal viewing environment     */
712     UWORD16                                     u2_ambient_light_y;
713 
714     /** Lower 32bits of time stamp corresponding to input buffer,
715      * from which this command takes effect                               */
716     UWORD32                                     u4_timestamp_low;
717 
718     /** Upper 32bits of time stamp corresponding to input buffer,
719      * from which this command takes effect                               */
720     UWORD32                                     u4_timestamp_high;
721 
722 }ih264e_ctl_set_sei_ave_params_ip_t;
723 
724 typedef struct
725 {
726     /** size of the structure                                             */
727     UWORD32                                     u4_size;
728 
729     /** Return error code                                                 */
730     UWORD32                                     u4_error_code;
731 
732 }ih264e_ctl_set_sei_ave_params_op_t;
733 
734 /*****************************************************************************/
735 /*    Video control  Set SEI CCV params                                      */
736 /*****************************************************************************/
737 typedef struct
738 {
739     /** size of the structure                                             */
740     UWORD32                                     u4_size;
741 
742     /** Command type : IVE_CMD_VIDEO_CTL                                  */
743     IVE_API_COMMAND_TYPE_T                      e_cmd;
744 
745     /** Sub command type : IVE_CMD_CTL_SET_SEI_CCV_PARAMS                 */
746     IVE_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
747 
748     /** content color volume info present flag                            */
749     UWORD8                                      u1_sei_ccv_params_present_flag;
750 
751     /** Flag used to control persistence of CCV SEI messages              */
752     UWORD8                                      u1_ccv_cancel_flag;
753 
754     /** specifies the persistence of the CCV SEI message for the
755      * current layer                                                      */
756     UWORD8                                      u1_ccv_persistence_flag;
757 
758     /** specifies the presence of syntax elements ccv_primaries_x
759      * and ccv_primaries_y                                                */
760     UWORD8                                      u1_ccv_primaries_present_flag;
761 
762     /** specifies that the syntax element ccv_min_luminance_value
763      * is present                                                         */
764     UWORD8                                      u1_ccv_min_luminance_value_present_flag;
765 
766     /** specifies that the syntax element ccv_max_luminance_value
767      *  is present                                                        */
768     UWORD8                                      u1_ccv_max_luminance_value_present_flag;
769 
770     /** specifies that the syntax element ccv_avg_luminance_value
771      *  is present                                                        */
772     UWORD8                                      u1_ccv_avg_luminance_value_present_flag;
773 
774     /** shall be equal to 0 in bitstreams conforming to this version.
775      * Other values for reserved_zero_2bits are reserved for future use   */
776     UWORD8                                      u1_ccv_reserved_zero_2bits;
777 
778     /** specify the normalized x chromaticity coordinates of the colour
779      * primary component c of the nominal content colour volume           */
780     WORD32                                      ai4_ccv_primaries_x[3];
781 
782     /** specify the normalized y chromaticity coordinates of the colour
783      * primary component c of the nominal content colour volume           */
784     WORD32                                      ai4_ccv_primaries_y[3];
785 
786     /** specifies the normalized minimum luminance value                  */
787     UWORD32                                     u4_ccv_min_luminance_value;
788 
789     /** specifies the normalized maximum luminance value                  */
790     UWORD32                                     u4_ccv_max_luminance_value;
791 
792     /** specifies the normalized average luminance value                  */
793     UWORD32                                     u4_ccv_avg_luminance_value;
794 
795     /** Lower 32bits of time stamp corresponding to input buffer,
796      * from which this command takes effect                               */
797     UWORD32                                     u4_timestamp_low;
798 
799     /** Upper 32bits of time stamp corresponding to input buffer,
800      * from which this command takes effect                               */
801     UWORD32                                     u4_timestamp_high;
802 
803 }ih264e_ctl_set_sei_ccv_params_ip_t;
804 
805 typedef struct
806 {
807     /** size of the structure                                             */
808     UWORD32                                     u4_size;
809 
810     /** Return error code                                                 */
811     UWORD32                                     u4_error_code;
812 
813 }ih264e_ctl_set_sei_ccv_params_op_t;
814 
815 /*****************************************************************************/
816 /*    Video control  Set SEI SII params                                      */
817 /*****************************************************************************/
818 
819 typedef struct
820 {
821     /** size of the structure                                             */
822     UWORD32 u4_size;
823 
824     /** Command type : IVE_CMD_VIDEO_CTL                                  */
825     IVE_API_COMMAND_TYPE_T e_cmd;
826 
827     /** Sub command type : IVE_CMD_CTL_SET_SEI_SII_PARAMS                 */
828     IVE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd;
829 
830     /**
831      * specifies if the sei sii is enabled                                */
832     UWORD8 u1_shutter_interval_info_present_flag;
833 
834     /**
835      * specifies the shutter interval temporal sub-layer index
836      * of the current picture                                             */
837     UWORD32 u4_sii_sub_layer_idx;
838 
839     /**
840      * specify the number of time units that pass in one second           */
841     UWORD32 u4_sii_time_scale;
842 
843     /**
844      * specifies that the indicated shutter interval is the same
845      * for all pictures in the coded video sequence                       */
846     UWORD8 u1_fixed_shutter_interval_within_cvs_flag;
847 
848     /**
849      * specifies the the number of time units of a clock operating at
850      * the frequency sii_time_scale Hz that corresponds to the indicated
851      * shutter interval of each picture in the coded video sequence       */
852     UWORD32 u4_sii_num_units_in_shutter_interval;
853 
854     /**
855      * sii_max_sub_layers_minus1 plus 1 specifies the maximum number of
856      * shutter interval temporal sub-layers indexes that may be present
857      * in the coded video sequence                                        */
858     UWORD8 u1_sii_max_sub_layers_minus1;
859 
860     /**
861      * specifies the number of time units of a clock operating at the
862      * frequency sii_time_scale Hz that corresponds to the shutter
863      * interval of each picture in the coded video sequence               */
864     UWORD32 au4_sub_layer_num_units_in_shutter_interval[8];
865 
866     /**
867      * Lower 32bits of time stamp corresponding to input buffer,
868      * from which this command takes effect                               */
869     UWORD32 u4_timestamp_low;
870 
871     /**
872      * Upper 32bits of time stamp corresponding to input buffer,
873      * from which this command takes effect                               */
874     UWORD32 u4_timestamp_high;
875 
876 } ih264e_ctl_set_sei_sii_params_ip_t;
877 
878 typedef struct
879 {
880     /** size of the structure                                             */
881     UWORD32 u4_size;
882 
883     /** Return error code                                                 */
884     UWORD32 u4_error_code;
885 
886 } ih264e_ctl_set_sei_sii_params_op_t;
887 
888 /*****************************************************************************/
889 /*   Pic info structures                                                     */
890 /*****************************************************************************/
891 typedef struct
892 {
893     /** Qp  */
894     UWORD32                                     u4_qp;
895 
896     /** Pic Type */
897     IV_PICTURE_CODING_TYPE_T                    e_frame_type;
898 
899 }ih264e_pic_info1_t;
900 
901 typedef struct
902 {
903     /** Qp  */
904     UWORD32                                     u4_qp;
905 
906     /** Pic Type */
907     IV_PICTURE_CODING_TYPE_T                    e_frame_type;
908 
909     /** Disable deblock level (0: Enable completely, 3: Disable completely */
910     UWORD32                                     u4_disable_deblock_level;
911 
912 }ih264e_pic_info2_t;
913 
914 
915 /*****************************************************************************/
916 /*   MB info structures                                                     */
917 /*****************************************************************************/
918 typedef struct
919 {
920     /** MV X    */
921     WORD16                                  i2_mv_x;
922 
923     /** MV Y    */
924     WORD16                                  i2_mv_y;
925 }ih264e_mv_t;
926 
927 typedef struct
928 {
929     /** Intra / Inter    */
930     WORD8                                       i1_mb_type;
931     union
932     {
933         ih264e_mv_t                                 as_mv[1];
934 
935         /** Intra mode */
936         WORD8                                       ai1_intra_mode[1];
937     };
938 }ih264e_mb_info1_t;
939 
940 typedef struct
941 {
942     /** Intra / Inter    */
943     WORD8                                       i1_mb_type;
944 
945 
946     /** SAD     */
947     UWORD16                                     u2_sad;
948 
949     union
950     {
951         ih264e_mv_t                                 as_mv[1];
952 
953         /** Intra mode */
954         WORD8                                       ai1_intra_mode[1];
955     };
956 
957 
958 }ih264e_mb_info2_t;
959 
960 typedef struct
961 {
962     /** Intra / Inter    */
963     WORD8                                       i1_mb_type;
964 
965     union
966     {
967         ih264e_mv_t                                 as_mv[4];
968 
969         /** Intra mode */
970         WORD8                                       ai1_intra_mode[16];
971     };
972 
973 }ih264e_mb_info3_t;
974 
975 typedef struct
976 {
977     /** Intra / Inter    */
978     WORD8                                       i1_mb_type;
979 
980     /** Intra Mode      */
981     WORD8                                       i1_intra_mode;
982 
983     /** SAD     */
984     UWORD16                                     u2_sad;
985 
986     union
987     {
988         ih264e_mv_t                                 as_mv[16];
989 
990         /** Intra mode */
991         WORD8                                       ai1_intra_mode[16];
992     };
993 
994 }ih264e_mb_info4_t;
995 
996 /* Add any new structures to the following union. It is used to calculate the
997  * max size needed for allocation of memory */
998 typedef struct
999 {
1000     union
1001     {
1002         ih264e_mb_info1_t               s_mb_info1;
1003         ih264e_mb_info2_t               s_mb_info2;
1004         ih264e_mb_info3_t               s_mb_info3;
1005         ih264e_mb_info4_t               s_mb_info4;
1006     };
1007 }ih264e_mb_info_t;
1008 
1009 #ifdef __cplusplus
1010 } /* closing brace for extern "C" */
1011 
1012 #endif
1013 #endif /* _IH264E_H_ */
1014