• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 Name         : ih264d.h                                             */
23 /*                                                                           */
24 /*  Description       : This file contains all the necessary structure and   */
25 /*                      enumeration definitions needed for the Application   */
26 /*                      Program Interface(API) of the Ittiam H264 ASP       */
27 /*                      Decoder on Cortex A8 - Neon platform                 */
28 /*                                                                           */
29 /*  List of Functions : ih264d_api_function                              */
30 /*                                                                           */
31 /*  Issues / Problems : None                                                 */
32 /*                                                                           */
33 /*  Revision History  :                                                      */
34 /*                                                                           */
35 /*         DD MM YYYY   Author(s)       Changes (Describe the changes made)  */
36 /*         26 08 2010   100239(RCY)     Draft                                */
37 /*                                                                           */
38 /*****************************************************************************/
39 
40 #ifndef _IH264D_H_
41 #define _IH264D_H_
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 #include "iv.h"
47 #include "ivd.h"
48 
49 
50 /*****************************************************************************/
51 /* Constant Macros                                                           */
52 /*****************************************************************************/
53 #define IVD_ERROR_MASK 0xFF
54 
55 /*****************************************************************************/
56 /* Function Macros                                                           */
57 /*****************************************************************************/
58 #define IS_IVD_CONCEALMENT_APPLIED(x)       (x & (1 << IVD_APPLIEDCONCEALMENT))
59 #define IS_IVD_INSUFFICIENTDATA_ERROR(x)    (x & (1 << IVD_INSUFFICIENTDATA))
60 #define IS_IVD_CORRUPTEDDATA_ERROR(x)       (x & (1 << IVD_CORRUPTEDDATA))
61 #define IS_IVD_CORRUPTEDHEADER_ERROR(x)     (x & (1 << IVD_CORRUPTEDHEADER))
62 #define IS_IVD_UNSUPPORTEDINPUT_ERROR(x)    (x & (1 << IVD_UNSUPPORTEDINPUT))
63 #define IS_IVD_UNSUPPORTEDPARAM_ERROR(x)    (x & (1 << IVD_UNSUPPORTEDPARAM))
64 #define IS_IVD_FATAL_ERROR(x)               (x & (1 << IVD_FATALERROR))
65 #define IS_IVD_INVALID_BITSTREAM_ERROR(x)   (x & (1 << IVD_INVALID_BITSTREAM))
66 #define IS_IVD_INCOMPLETE_BITSTREAM_ERROR(x) (x & (1 << IVD_INCOMPLETE_BITSTREAM))
67 
68 
69 /*****************************************************************************/
70 /* API Function Prototype                                                    */
71 /*****************************************************************************/
72 IV_API_CALL_STATUS_T ih264d_api_function(iv_obj_t *ps_handle, void *pv_api_ip,void *pv_api_op);
73 
74 /*****************************************************************************/
75 /* Enums                                                                     */
76 /*****************************************************************************/
77 /* Codec Error codes for H264 ASP Decoder                                   */
78 
79 typedef enum {
80 
81     IH264D_VID_HDR_DEC_NUM_FRM_BUF_NOT_SUFFICIENT   = IVD_DUMMY_ELEMENT_FOR_CODEC_EXTENSIONS + 1,
82     IH264D_FRAME_INFO_OP_BUF_NULL,
83     IH264D_INSUFFICIENT_METADATA_BUFFER,
84 
85 }IH264D_ERROR_CODES_T;
86 
87 /*****************************************************************************/
88 /* Extended Structures                                                       */
89 /*****************************************************************************/
90 
91 
92 /*****************************************************************************/
93 /*  Delete Codec                                                             */
94 /*****************************************************************************/
95 
96 
97 typedef struct {
98     ivd_delete_ip_t               s_ivd_delete_ip_t;
99 }ih264d_delete_ip_t;
100 
101 
102 typedef struct{
103     ivd_delete_op_t               s_ivd_delete_op_t;
104 }ih264d_delete_op_t;
105 
106 
107 /*****************************************************************************/
108 /*   Initialize decoder                                                      */
109 /*****************************************************************************/
110 
111 
112 typedef struct {
113     ivd_create_ip_t                         s_ivd_create_ip_t;
114 
115     /**
116      * enable_frm_info
117      */
118     UWORD32                                 u4_enable_frame_info;
119 }ih264d_create_ip_t;
120 
121 
122 typedef struct{
123     ivd_create_op_t                         s_ivd_create_op_t;
124 }ih264d_create_op_t;
125 
126 
127 /*****************************************************************************/
128 /*   Video Decode                                                            */
129 /*****************************************************************************/
130 
131 
132 typedef struct {
133     ivd_video_decode_ip_t                   s_ivd_video_decode_ip_t;
134 
135     /**
136      * 8x8 block QP map size
137      */
138     UWORD32                                 u4_8x8_blk_qp_map_size;
139 
140     /**
141      * 8x8 block QP map
142      */
143     UWORD8                                  *pu1_8x8_blk_qp_map;
144 
145     /**
146      * 8x8 block type map size
147      */
148     UWORD32                                 u4_8x8_blk_type_map_size;
149 
150     /**
151      * 8x8 block type map
152      */
153     UWORD8                                  *pu1_8x8_blk_type_map;
154 }ih264d_video_decode_ip_t;
155 
156 /*****************************************************************************/
157 /* QP and block type maps are defined for each 8x8 MB sub-block.             */
158 /* QP can range from <0, 51> and block type can be INTER/INTRA/SKIP.         */
159 /*                                                                           */
160 /* Let’s say, a frame has a total of ‘m’ MBs (each 16x16). Since the QP      */
161 /* and block type are defined for each 8x8 block, hence each MB has          */
162 /* 4 entries giving m x 4 total entires for QP and block type map each.      */
163 /*                                                                           */
164 /* For example, for a frame of size 60x60 shown in the figure down, both     */
165 /* maps (QP and MB type) have the same layout.                               */
166 /* Each block represents an 8x8 sub-block. Both width and height are aligned */
167 /* to next largest multiple of 8, 64 in this case.                           */
168 /*                                                                           */
169 /*     0     8     16    24    32    40    48    56   64                     */
170 /*  0   ------------------------------------------------                     */
171 /*     | 0th | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th |                     */
172 /*  8   ------------------------------------------------                     */
173 /*     | 8th | 9th | 10th | -  |  -  | -   | -   |  -  |                     */
174 /* 16   ------------------------------------------------                     */
175 /*     |  -  |  -  |  -   | -  |  -  |  -  |  -  |  -  |                     */
176 /* 24   ------------------------------------------------                     */
177 /*     |  -  |  -  |  -   | -  |  -  |  -  |  -  |  -  |                     */
178 /* 32   ------------------------------------------------                     */
179 /*     |  -  |  -  |  -   | -  |  -  |  -  |  -  |  -  |                     */
180 /* 40   ------------------------------------------------                     */
181 /*     |  -  |  -  |  -   | -  |  -  |  -  |  -  |  -  |                     */
182 /* 48   ------------------------------------------------                     */
183 /*     |  -  |  -  |  -   | -  |  -  |  -  |  -  |  -  |                     */
184 /* 56   ------------------------------------------------                     */
185 /*     |  -  |  -  |  -   | -  |  -  |  -  |  -  |  -  |                     */
186 /* 64   ------------------------------------------------                     */
187 /*                                                                           */
188 /*****************************************************************************/
189 
190 typedef struct{
191     ivd_video_decode_op_t                   s_ivd_video_decode_op_t;
192 
193     /**
194      * 8x8 block QP map size
195      */
196     UWORD32                                 u4_8x8_blk_qp_map_size;
197 
198     /**
199      * 8x8 block QP map
200      */
201     UWORD8                                  *pu1_8x8_blk_qp_map;
202 
203     /**
204      * 8x8 block type map size
205      */
206     UWORD32                                 u4_8x8_blk_type_map_size;
207 
208     /**
209      * 8x8 block type map
210      */
211     UWORD8                                  *pu1_8x8_blk_type_map;
212 }ih264d_video_decode_op_t;
213 
214 
215 /*****************************************************************************/
216 /*   Get Display Frame                                                       */
217 /*****************************************************************************/
218 
219 
220 typedef struct
221 {
222     ivd_get_display_frame_ip_t              s_ivd_get_display_frame_ip_t;
223 }ih264d_get_display_frame_ip_t;
224 
225 
226 typedef struct
227 {
228     ivd_get_display_frame_op_t              s_ivd_get_display_frame_op_t;
229 }ih264d_get_display_frame_op_t;
230 
231 /*****************************************************************************/
232 /*   Set Display Frame                                                       */
233 /*****************************************************************************/
234 
235 
236 typedef struct
237 {
238     ivd_set_display_frame_ip_t              s_ivd_set_display_frame_ip_t;
239 }ih264d_set_display_frame_ip_t;
240 
241 
242 typedef struct
243 {
244     ivd_set_display_frame_op_t              s_ivd_set_display_frame_op_t;
245 }ih264d_set_display_frame_op_t;
246 
247 /*****************************************************************************/
248 /*   Release Display Buffers                                                 */
249 /*****************************************************************************/
250 
251 
252 typedef struct
253 {
254     ivd_rel_display_frame_ip_t                  s_ivd_rel_display_frame_ip_t;
255 }ih264d_rel_display_frame_ip_t;
256 
257 
258 typedef struct
259 {
260     ivd_rel_display_frame_op_t                  s_ivd_rel_display_frame_op_t;
261 }ih264d_rel_display_frame_op_t;
262 
263 typedef enum {
264     /** Set number of cores/threads to be used */
265     IH264D_CMD_CTL_SET_NUM_CORES         = IVD_CMD_CTL_CODEC_SUBCMD_START,
266 
267     /** Set processor details */
268     IH264D_CMD_CTL_SET_PROCESSOR         = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x001,
269 
270     /** Get display buffer dimensions */
271     IH264D_CMD_CTL_GET_BUFFER_DIMENSIONS = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x100,
272 
273     /** Get VUI parameters */
274     IH264D_CMD_CTL_GET_VUI_PARAMS        = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x101,
275 
276     /** Enable/disable GPU, supported on select platforms */
277     IH264D_CMD_CTL_GPU_ENABLE_DISABLE    = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x200,
278 
279     /** Set degrade level */
280     IH264D_CMD_CTL_DEGRADE               = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x300,
281 
282     /** Get SEI MDCV parameters */
283     IH264D_CMD_CTL_GET_SEI_MDCV_PARAMS   = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x301,
284 
285     /** Get SEI CLL parameters */
286     IH264D_CMD_CTL_GET_SEI_CLL_PARAMS    = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x302,
287 
288     /** Get SEI AVE parameters */
289     IH264D_CMD_CTL_GET_SEI_AVE_PARAMS    = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x303,
290 
291     /** Get SEI CCV parameters */
292     IH264D_CMD_CTL_GET_SEI_CCV_PARAMS    = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x304,
293 
294     /** Get SEI SII parameters */
295     IH264D_CMD_CTL_GET_SEI_SII_PARAMS = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x305,
296 
297     /** Get SEI FGC parameters */
298     IH264D_CMD_CTL_GET_SEI_FGC_PARAMS = IVD_CMD_CTL_CODEC_SUBCMD_START + 0x306
299 
300 }IH264D_CMD_CTL_SUB_CMDS;
301 /*****************************************************************************/
302 /*   Video control  Flush                                                    */
303 /*****************************************************************************/
304 
305 
306 typedef struct{
307     ivd_ctl_flush_ip_t                      s_ivd_ctl_flush_ip_t;
308 }ih264d_ctl_flush_ip_t;
309 
310 
311 typedef struct{
312     ivd_ctl_flush_op_t                      s_ivd_ctl_flush_op_t;
313 }ih264d_ctl_flush_op_t;
314 
315 /*****************************************************************************/
316 /*   Video control reset                                                     */
317 /*****************************************************************************/
318 
319 
320 typedef struct{
321     ivd_ctl_reset_ip_t                      s_ivd_ctl_reset_ip_t;
322 }ih264d_ctl_reset_ip_t;
323 
324 
325 typedef struct{
326     ivd_ctl_reset_op_t                      s_ivd_ctl_reset_op_t;
327 }ih264d_ctl_reset_op_t;
328 
329 
330 /*****************************************************************************/
331 /*   Video control  Set Params                                               */
332 /*****************************************************************************/
333 
334 
335 typedef struct {
336     ivd_ctl_set_config_ip_t             s_ivd_ctl_set_config_ip_t;
337 }ih264d_ctl_set_config_ip_t;
338 
339 
340 typedef struct{
341     ivd_ctl_set_config_op_t             s_ivd_ctl_set_config_op_t;
342 }ih264d_ctl_set_config_op_t;
343 
344 /*****************************************************************************/
345 /*   Video control:Get Buf Info                                              */
346 /*****************************************************************************/
347 
348 
349 typedef struct{
350     ivd_ctl_getbufinfo_ip_t             s_ivd_ctl_getbufinfo_ip_t;
351 }ih264d_ctl_getbufinfo_ip_t;
352 
353 
354 
355 typedef struct{
356     ivd_ctl_getbufinfo_op_t             s_ivd_ctl_getbufinfo_op_t;
357 }ih264d_ctl_getbufinfo_op_t;
358 
359 
360 /*****************************************************************************/
361 /*   Video control:Getstatus Call                                            */
362 /*****************************************************************************/
363 
364 
365 typedef struct{
366     ivd_ctl_getstatus_ip_t                  s_ivd_ctl_getstatus_ip_t;
367 }ih264d_ctl_getstatus_ip_t;
368 
369 
370 
371 typedef struct{
372     ivd_ctl_getstatus_op_t                  s_ivd_ctl_getstatus_op_t;
373 }ih264d_ctl_getstatus_op_t;
374 
375 
376 /*****************************************************************************/
377 /*   Video control:Get Version Info                                          */
378 /*****************************************************************************/
379 
380 
381 typedef struct{
382     ivd_ctl_getversioninfo_ip_t         s_ivd_ctl_getversioninfo_ip_t;
383 }ih264d_ctl_getversioninfo_ip_t;
384 
385 
386 
387 typedef struct{
388     ivd_ctl_getversioninfo_op_t         s_ivd_ctl_getversioninfo_op_t;
389 }ih264d_ctl_getversioninfo_op_t;
390 
391 typedef struct{
392 
393     /**
394      * u4_size
395      */
396     UWORD32                                     u4_size;
397 
398     /**
399      * cmd
400      */
401     IVD_API_COMMAND_TYPE_T                      e_cmd;
402 
403     /**
404      * sub_cmd
405      */
406     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
407 
408     /**
409      * Pictures that are are degraded
410      * 0 : No degrade
411      * 1 : Only on non-reference frames
412      * 2 : Use interval specified by u4_nondegrade_interval
413      * 3 : All non-key frames
414      * 4 : All frames
415      */
416     WORD32                                     i4_degrade_pics;
417 
418     /**
419      * Interval for pictures which are completely decoded without any degradation
420      */
421     WORD32                                     i4_nondegrade_interval;
422 
423     /**
424      * bit position (lsb is zero): Type of degradation
425      * 1 : Disable deblocking
426      * 2 : Faster inter prediction filters
427      * 3 : Fastest inter prediction filters
428      */
429     WORD32                                     i4_degrade_type;
430 
431 }ih264d_ctl_degrade_ip_t;
432 
433 typedef struct
434 {
435     /**
436      * u4_size
437      */
438     UWORD32                                     u4_size;
439 
440     /**
441      * error_code
442      */
443     UWORD32                                     u4_error_code;
444 }ih264d_ctl_degrade_op_t;
445 
446 typedef struct{
447     UWORD32                                     u4_size;
448     IVD_API_COMMAND_TYPE_T                      e_cmd;
449     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
450     UWORD32                                     u4_disable_deblk_level;
451 }ih264d_ctl_disable_deblock_ip_t;
452 
453 typedef struct{
454     UWORD32                                     u4_size;
455     UWORD32                                     u4_error_code;
456 }ih264d_ctl_disable_deblock_op_t;
457 
458 
459 typedef struct{
460     UWORD32                                     u4_size;
461     IVD_API_COMMAND_TYPE_T                      e_cmd;
462     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
463     UWORD32                                     u4_num_cores;
464 }ih264d_ctl_set_num_cores_ip_t;
465 
466 typedef struct{
467     UWORD32                                     u4_size;
468     UWORD32                                     u4_error_code;
469 }ih264d_ctl_set_num_cores_op_t;
470 
471 typedef struct
472 {
473      /**
474       * i4_size
475       */
476     UWORD32                                     u4_size;
477     /**
478      * cmd
479      */
480     IVD_API_COMMAND_TYPE_T                      e_cmd;
481     /**
482      * sub cmd
483      */
484     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
485     /**
486      * Processor type
487      */
488     UWORD32                                     u4_arch;
489     /**
490      * SOC type
491      */
492     UWORD32                                     u4_soc;
493 
494     /**
495      * num_cores
496      */
497     UWORD32                                     u4_num_cores;
498 
499 }ih264d_ctl_set_processor_ip_t;
500 
501 typedef struct
502 {
503     /**
504      * i4_size
505      */
506     UWORD32                                     u4_size;
507     /**
508      * error_code
509      */
510     UWORD32                                     u4_error_code;
511 }ih264d_ctl_set_processor_op_t;
512 
513 typedef struct{
514     UWORD32                                     u4_size;
515     IVD_API_COMMAND_TYPE_T                      e_cmd;
516     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
517 }ih264d_ctl_get_frame_dimensions_ip_t;
518 
519 
520 typedef struct{
521     UWORD32                                     u4_size;
522     UWORD32                                     u4_error_code;
523     UWORD32                                     u4_x_offset[3];
524     UWORD32                                     u4_y_offset[3];
525     UWORD32                                     u4_disp_wd[3];
526     UWORD32                                     u4_disp_ht[3];
527     UWORD32                                     u4_buffer_wd[3];
528     UWORD32                                     u4_buffer_ht[3];
529 }ih264d_ctl_get_frame_dimensions_op_t;
530 
531 typedef struct
532 {
533     UWORD32                                     u4_size;
534     IVD_API_COMMAND_TYPE_T                      e_cmd;
535     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
536 }ih264d_ctl_get_vui_params_ip_t;
537 
538 typedef struct
539 {
540     UWORD32                                     u4_size;
541     UWORD32                                     u4_error_code;
542     UWORD8                                      u1_aspect_ratio_idc;
543     UWORD16                                     u2_sar_width;
544     UWORD16                                     u2_sar_height;
545     UWORD8                                      u1_overscan_appropriate_flag;
546     UWORD8                                      u1_video_format;
547     UWORD8                                      u1_video_full_range_flag;
548     UWORD8                                      u1_colour_primaries;
549     UWORD8                                      u1_tfr_chars;
550     UWORD8                                      u1_matrix_coeffs;
551     UWORD8                                      u1_cr_top_field;
552     UWORD8                                      u1_cr_bottom_field;
553     UWORD32                                     u4_num_units_in_tick;
554     UWORD32                                     u4_time_scale;
555     UWORD8                                      u1_fixed_frame_rate_flag;
556     UWORD8                                      u1_nal_hrd_params_present;
557     UWORD8                                      u1_vcl_hrd_params_present;
558     UWORD8                                      u1_low_delay_hrd_flag;
559     UWORD8                                      u1_pic_struct_present_flag;
560     UWORD8                                      u1_bitstream_restriction_flag;
561     UWORD8                                      u1_mv_over_pic_boundaries_flag;
562     UWORD32                                     u4_max_bytes_per_pic_denom;
563     UWORD32                                     u4_max_bits_per_mb_denom;
564     UWORD32                                     u4_log2_max_mv_length_horz;
565     UWORD32                                     u4_log2_max_mv_length_vert;
566     UWORD32                                     u4_num_reorder_frames;
567     UWORD32                                     u4_max_dec_frame_buffering;
568 }ih264d_ctl_get_vui_params_op_t;
569 
570 
571 typedef struct
572 {
573     /**
574      * u4_size
575      */
576     UWORD32                                     u4_size;
577 
578     /**
579      * cmd
580      */
581     IVD_API_COMMAND_TYPE_T                      e_cmd;
582 
583     /**
584      * sub_cmd
585      */
586     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
587 }ih264d_ctl_get_sei_mdcv_params_ip_t;
588 
589 typedef struct
590 {
591     /**
592      * u4_size
593      */
594     UWORD32                                     u4_size;
595 
596     /**
597      * error_code
598      */
599     UWORD32                                     u4_error_code;
600 
601     /**
602      * Array to store the display_primaries_x values
603      */
604     UWORD16                                     au2_display_primaries_x[NUM_SEI_MDCV_PRIMARIES];
605 
606     /**
607      * Array to store the display_primaries_y values
608      */
609     UWORD16                                     au2_display_primaries_y[NUM_SEI_MDCV_PRIMARIES];
610 
611     /**
612      * Variable to store the white point x value
613      */
614     UWORD16                                     u2_white_point_x;
615 
616     /**
617      * Variable to store the white point y value
618      */
619     UWORD16                                     u2_white_point_y;
620 
621     /**
622      * Variable to store the max display mastering luminance value
623      */
624     UWORD32                                     u4_max_display_mastering_luminance;
625 
626     /**
627      * Variable to store the min display mastering luminance value
628      */
629     UWORD32                                     u4_min_display_mastering_luminance;
630 }ih264d_ctl_get_sei_mdcv_params_op_t;
631 
632 typedef struct
633 {
634     /**
635      * u4_size
636      */
637     UWORD32                                     u4_size;
638 
639     /**
640      * cmd
641      */
642     IVD_API_COMMAND_TYPE_T                      e_cmd;
643 
644     /**
645      * sub_cmd
646      */
647     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
648 }ih264d_ctl_get_sei_cll_params_ip_t;
649 
650 typedef struct
651 {
652     /**
653      * u4_size
654      */
655     UWORD32                                     u4_size;
656 
657     /**
658      * error_code
659      */
660     UWORD32                                     u4_error_code;
661 
662     /**
663      * The maximum pixel intensity of all samples
664      */
665     UWORD16                                     u2_max_content_light_level;
666 
667     /**
668      * The average pixel intensity of all samples
669      */
670     UWORD16                                     u2_max_pic_average_light_level;
671 } ih264d_ctl_get_sei_cll_params_op_t;
672 
673 typedef struct
674 {
675     /**
676      * u4_size
677      */
678     UWORD32                                     u4_size;
679 
680     /**
681      * cmd
682      */
683     IVD_API_COMMAND_TYPE_T                      e_cmd;
684 
685     /**
686      * sub_cmd
687      */
688     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
689 }ih264d_ctl_get_sei_ave_params_ip_t;
690 
691 typedef struct
692 {
693     /**
694      * u4_size
695      */
696     UWORD32                                     u4_size;
697 
698     /**
699      * error_code
700      */
701     UWORD32                                     u4_error_code;
702 
703     /**
704      * specifies the environmental illluminance of the ambient viewing environment
705      */
706     UWORD32                                     u4_ambient_illuminance;
707 
708     /*
709      * specify the normalized x chromaticity coordinates of the
710      * environmental ambient light in the nominal viewing environment
711      */
712     UWORD16                                     u2_ambient_light_x;
713 
714     /*
715      * specify the normalized y chromaticity coordinates of the
716      * environmental ambient light in the nominal viewing environment
717      */
718     UWORD16                                     u2_ambient_light_y;
719 } ih264d_ctl_get_sei_ave_params_op_t;
720 
721 typedef struct
722 {
723     /**
724      * u4_size
725      */
726     UWORD32                                     u4_size;
727 
728     /**
729      * cmd
730      */
731     IVD_API_COMMAND_TYPE_T                      e_cmd;
732 
733     /**
734      * sub_cmd
735      */
736     IVD_CONTROL_API_COMMAND_TYPE_T              e_sub_cmd;
737 }ih264d_ctl_get_sei_ccv_params_ip_t;
738 
739 typedef struct
740 {
741     /**
742      * u4_size
743      */
744     UWORD32                                     u4_size;
745 
746     /**
747      * error_code
748      */
749     UWORD32                                     u4_error_code;
750 
751     /*
752      * Flag used to control persistence of CCV SEI messages
753      */
754     UWORD8                                      u1_ccv_cancel_flag;
755 
756     /*
757      * specifies the persistence of the CCV SEI message for the current layer
758      */
759     UWORD8                                      u1_ccv_persistence_flag;
760 
761     /*
762      * specifies the presence of syntax elements ccv_primaries_x and ccv_primaries_y
763      */
764     UWORD8                                      u1_ccv_primaries_present_flag;
765 
766     /*
767      * specifies that the syntax element ccv_min_luminance_value is present
768      */
769     UWORD8                                      u1_ccv_min_luminance_value_present_flag;
770 
771     /*
772      * specifies that the syntax element ccv_max_luminance_value is present
773      */
774     UWORD8                                      u1_ccv_max_luminance_value_present_flag;
775 
776     /*
777      * specifies that the syntax element ccv_avg_luminance_value is present
778      */
779     UWORD8                                      u1_ccv_avg_luminance_value_present_flag;
780 
781     /*
782      * shall be equal to 0 in bitstreams conforming to this version. Other values
783      * for reserved_zero_2bits are reserved for future use
784      */
785     UWORD8                                      u1_ccv_reserved_zero_2bits;
786 
787     /*
788      * specify the normalized x chromaticity coordinates of the colour
789      * primary component c of the nominal content colour volume
790      */
791     WORD32                                      ai4_ccv_primaries_x[NUM_SEI_CCV_PRIMARIES];
792 
793     /*
794      * specify the normalized y chromaticity coordinates of the colour
795      * primary component c of the nominal content colour volume
796      */
797     WORD32                                      ai4_ccv_primaries_y[NUM_SEI_CCV_PRIMARIES];
798 
799     /*
800      * specifies the normalized minimum luminance value
801      */
802     UWORD32                                     u4_ccv_min_luminance_value;
803 
804     /*
805      * specifies the normalized maximum luminance value
806      */
807     UWORD32                                     u4_ccv_max_luminance_value;
808 
809     /*
810      * specifies the normalized average luminance value
811      */
812     UWORD32                                     u4_ccv_avg_luminance_value;
813 } ih264d_ctl_get_sei_ccv_params_op_t;
814 
815 typedef struct
816 {
817     /**
818      * u4_size
819      */
820     UWORD32 u4_size;
821 
822     /**
823      * cmd
824      */
825     IVD_API_COMMAND_TYPE_T e_cmd;
826 
827     /**
828      * sub_cmd
829      */
830     IVD_CONTROL_API_COMMAND_TYPE_T e_sub_cmd;
831 } ih264d_ctl_get_sei_sii_params_ip_t;
832 
833 typedef struct
834 {
835     /**
836      * u4_size
837      */
838     UWORD32 u4_size;
839 
840     /**
841      * error_code
842      */
843     UWORD32 u4_error_code;
844 
845     /**
846      * specifies if the sei sii is enabled
847      */
848     UWORD8 u1_shutter_interval_info_present_flag;
849 
850     /**
851      * specifies the shutter interval temporal sub-layer index
852      * of the current picture
853      */
854     UWORD32 u4_sii_sub_layer_idx;
855 
856     /**
857      * specify the number of time units that pass in one second
858      */
859     UWORD32 u4_sii_time_scale;
860 
861     /**
862      * specifies that the indicated shutter interval is the same for all
863      * pictures in the coded video sequence
864      */
865     UWORD8 u1_fixed_shutter_interval_within_cvs_flag;
866 
867     /**
868      * specifies the the number of time units of a clock operating at the
869      * frequency sii_time_scale Hz that corresponds to the indicated shutter
870      * interval of each picture in the coded video sequence
871      */
872     UWORD32 u4_sii_num_units_in_shutter_interval;
873 
874     /**
875      * sii_max_sub_layers_minus1 plus 1 specifies the maximum number of
876      * shutter interval temporal sub-layers indexes that may be present
877      * in the coded video sequence
878      */
879     UWORD8 u1_sii_max_sub_layers_minus1;
880 
881     /**
882      * specifies the number of time units of a clock operating at the
883      * frequency sii_time_scale Hz that corresponds to the shutter
884      * interval of each picture in the coded video sequence
885      */
886     UWORD32 au4_sub_layer_num_units_in_shutter_interval[SII_MAX_SUB_LAYERS];
887 
888 } ih264d_ctl_get_sei_sii_params_op_t;
889 
890 typedef struct
891 {
892     /**
893      * u4_size
894      */
895     UWORD32 u4_size;
896 
897     /**
898      * cmd
899      */
900     IVD_API_COMMAND_TYPE_T e_cmd;
901 
902     /**
903      * sub_cmd
904      */
905     IVD_CONTROL_API_COMMAND_TYPE_T e_sub_cmd;
906 } ih264d_ctl_get_sei_fgc_params_ip_t;
907 
908 typedef struct
909 {
910     /**
911      * u4_size
912      */
913     UWORD32 u4_size;
914 
915     /**
916      * error_code
917      */
918     UWORD32 u4_error_code;
919 
920     /**
921      * Flag to control the presence of FGC SEI params
922      */
923     UWORD8 u1_film_grain_characteristics_cancel_flag;
924 
925     /**
926      * Specifies the pic order count
927      */
928     WORD32 i4_poc;
929 
930     /**
931      * Specifies IDR pic ID
932      */
933     UWORD32 u4_idr_pic_id;
934 
935     /**
936      * Specifies film grain model for simulation
937      */
938     UWORD8 u1_film_grain_model_id;
939 
940     /**
941      * Specifies separate color format for decoded samples and grain
942      */
943     UWORD8 u1_separate_colour_description_present_flag;
944 
945     /**
946      * Specifies the bit depth used for the luma component
947      */
948     UWORD8 u1_film_grain_bit_depth_luma_minus8;
949 
950     /**
951      * Specifies the bit depth used for the Cb and Cr components
952      */
953     UWORD8 u1_film_grain_bit_depth_chroma_minus8;
954 
955     /**
956      * Specifies the colour space of the FGC in SEI
957      */
958     UWORD8 u1_film_grain_full_range_flag;
959 
960     /**
961      * Specifies the colour space of the FGC in SEI
962      */
963     UWORD8 u1_film_grain_colour_primaries;
964 
965     /**
966      * Specifies the colour space of the FGC in SEI
967      */
968     UWORD8 u1_film_grain_transfer_characteristics;
969 
970     /**
971      * Specifies the colour space of the FGC in SEI
972      */
973     UWORD8 u1_film_grain_matrix_coefficients;
974 
975     /**
976      * identifies the blending mode used to blend the simulated film grain with the decoded images
977      */
978     UWORD8 u1_blending_mode_id;
979 
980     /**
981      * Specifies a scale factor used in the film grain characterization equations
982      */
983     UWORD8 u1_log2_scale_factor;
984 
985     /**
986      * Indicates whether film grain is modelled or not on the colour component
987      */
988     UWORD8 au1_comp_model_present_flag[SEI_FGC_NUM_COLOUR_COMPONENTS];
989 
990     /**
991      * Specifies the number of intensity intervals for which
992      * a specific set of model values has been estimated
993      */
994     UWORD8 au1_num_intensity_intervals_minus1[SEI_FGC_NUM_COLOUR_COMPONENTS];
995 
996     /**
997      * Specifies the number of model values present for each intensity interval in which
998      * the film grain has been modelled
999      */
1000     UWORD8 au1_num_model_values_minus1[SEI_FGC_NUM_COLOUR_COMPONENTS];
1001 
1002     /**
1003      * Specifies the lower bound of the interval of intensity levels for which
1004      * the set of model values applies
1005      */
1006     UWORD8 au1_intensity_interval_lower_bound[SEI_FGC_NUM_COLOUR_COMPONENTS]
1007                                              [SEI_FGC_MAX_NUM_INTENSITY_INTERVALS];
1008 
1009     /**
1010      * Specifies the upper bound of the interval of intensity levels for which
1011      * the set of model values applies
1012      */
1013     UWORD8 au1_intensity_interval_upper_bound[SEI_FGC_NUM_COLOUR_COMPONENTS]
1014                                              [SEI_FGC_MAX_NUM_INTENSITY_INTERVALS];
1015 
1016     /**
1017      * Represents each one of the model values present for
1018      * the colour component and intensity interval
1019      */
1020     WORD32 ai4_comp_model_value[SEI_FGC_NUM_COLOUR_COMPONENTS][SEI_FGC_MAX_NUM_INTENSITY_INTERVALS]
1021                                [SEI_FGC_MAX_NUM_MODEL_VALUES];
1022 
1023     /**
1024      * Specifies the persistence of the film grain characteristics SEI message
1025      */
1026     UWORD32 u4_film_grain_characteristics_repetition_period;
1027 } ih264d_ctl_get_sei_fgc_params_op_t;
1028 
1029 #ifdef __cplusplus
1030 } /* closing brace for extern "C" */
1031 #endif
1032 #endif /* _IH264D_H_ */
1033