xref: /aosp_15_r20/external/libavc/encoder/svc/isvce.h (revision 495ae853bb871d1e5a258cb02c2cc13cde8ddb9a)
1 /******************************************************************************
2  *
3  * Copyright (C) 2022 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         : isvce.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 SVC Encoder     */
27 /*                                                                           */
28 /*  List of Functions : isvce_api_function                                   */
29 /*                                                                           */
30 /*****************************************************************************/
31 
32 #ifndef _ISVCE_H_
33 #define _ISVCE_H_
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
40 #include <stdbool.h>
41 
42 #include "iv2.h"
43 #include "ive2.h"
44 
45     /*****************************************************************************/
46     /* Enums                                                                     */
47     /*****************************************************************************/
48     typedef enum ISVCE_API_COMMAND_TYPE_T
49     {
50         ISVCE_CMD_VIDEO_NA = 0x7FFFFFFF,
51         ISVCE_CMD_GET_NUM_MEM_REC = 0x0,
52         ISVCE_CMD_FILL_NUM_MEM_REC = 0x1,
53         ISVCE_CMD_RETRIEVE_MEMREC = 0x2,
54         ISVCE_CMD_INIT = 0x3,
55         ISVCE_CMD_EXTENSIONS = 0x100,
56         ISVCE_CMD_VIDEO_CTL,
57         ISVCE_CMD_VIDEO_ENCODE
58     } ISVCE_API_COMMAND_TYPE_T;
59 
60     typedef enum ISVCE_CONTROL_API_COMMAND_TYPE_T
61     {
62         ISVCE_CMD_CT_NA = 0x7FFFFFFF,
63         ISVCE_CMD_CTL_SETDEFAULT = 0x0,
64         ISVCE_CMD_CTL_SET_DIMENSIONS = 0x1,
65         ISVCE_CMD_CTL_SET_FRAMERATE = 0x2,
66         ISVCE_CMD_CTL_SET_BITRATE = 0x3,
67         ISVCE_CMD_CTL_SET_FRAMETYPE = 0x4,
68         ISVCE_CMD_CTL_SET_QP = 0x5,
69         ISVCE_CMD_CTL_SET_ENC_MODE = 0x6,
70         ISVCE_CMD_CTL_SET_VBV_PARAMS = 0x7,
71         ISVCE_CMD_CTL_SET_AIR_PARAMS = 0x8,
72         ISVCE_CMD_CTL_SET_ME_PARAMS = 0X9,
73         ISVCE_CMD_CTL_SET_GOP_PARAMS = 0XA,
74         ISVCE_CMD_CTL_SET_PROFILE_PARAMS = 0XB,
75         ISVCE_CMD_CTL_SET_DEBLOCK_PARAMS = 0XC,
76         ISVCE_CMD_CTL_SET_IPE_PARAMS = 0XD,
77         ISVCE_CMD_CTL_SET_VUI_PARAMS = 0XE,
78         ISVCE_CMD_CTL_SET_NUM_CORES = 0x30,
79         ISVCE_CMD_CTL_RESET = 0xA0,
80         ISVCE_CMD_CTL_FLUSH = 0xB0,
81         ISVCE_CMD_CTL_GETBUFINFO = 0xC0,
82         ISVCE_CMD_CTL_GETVERSION = 0xC1,
83         ISVCE_CMD_CTL_SET_SEI_MDCV_PARAMS = 0xD0,
84         ISVCE_CMD_CTL_SET_SEI_CLL_PARAMS = 0xD1,
85         ISVCE_CMD_CTL_SET_SEI_AVE_PARAMS = 0xD2,
86         ISVCE_CMD_CTL_SET_SEI_CCV_PARAMS = 0xD3,
87         ISVCE_CMD_CTL_GET_ENC_FRAME_DIMENSIONS = 0xE1
88     } ISVCE_CONTROL_API_COMMAND_TYPE_T;
89 
90     /*****************************************************************************/
91     /* Extended Structures                                                       */
92     /*****************************************************************************/
93 
94     /*****************************************************************************/
95     /*  Get Number of Memory Records                                             */
96     /*****************************************************************************/
97     typedef struct svc_inp_params_t
98     {
99         /**
100          * Num Temporal Layers
101          */
102         UWORD8 u1_num_temporal_layers;
103 
104         /**
105          * Num Spatial Layers
106          */
107         UWORD8 u1_num_spatial_layers;
108 
109         /**
110          * Resolution ration b/w spatial layers
111          */
112         DOUBLE d_spatial_res_ratio;
113 
114     } svc_inp_params_t;
115 
116     typedef struct isvce_num_mem_rec_ip_t
117     {
118         iv_num_mem_rec_ip_t s_ive_ip;
119     } isvce_num_mem_rec_ip_t;
120 
121     typedef struct isvce_num_mem_rec_op_t
122     {
123         iv_num_mem_rec_op_t s_ive_op;
124     } isvce_num_mem_rec_op_t;
125 
126     /*****************************************************************************/
127     /*  Fill Memory Records                                                      */
128     /*****************************************************************************/
129 
130     typedef struct isvce_fill_mem_rec_ip_t
131     {
132         iv_fill_mem_rec_ip_t s_ive_ip;
133 
134         svc_inp_params_t s_svc_inp_params;
135 
136         UWORD32 u4_wd;
137 
138         UWORD32 u4_ht;
139 
140     } isvce_fill_mem_rec_ip_t;
141 
142     typedef struct isvce_fill_mem_rec_op_t
143     {
144         iv_fill_mem_rec_op_t s_ive_op;
145     } isvce_fill_mem_rec_op_t;
146 
147     /*****************************************************************************/
148     /*  Retrieve Memory Records                                                  */
149     /*****************************************************************************/
150 
151     typedef struct isvce_retrieve_mem_rec_ip_t
152     {
153         iv_retrieve_mem_rec_ip_t s_ive_ip;
154     } isvce_retrieve_mem_rec_ip_t;
155 
156     typedef struct isvce_retrieve_mem_rec_op_t
157     {
158         iv_retrieve_mem_rec_op_t s_ive_op;
159     } isvce_retrieve_mem_rec_op_t;
160 
161     /*****************************************************************************/
162     /*   Initialize encoder                                                      */
163     /*****************************************************************************/
164 
165     typedef struct isvce_init_ip_t
166     {
167         ive_init_ip_t s_ive_ip;
168 
169         svc_inp_params_t s_svc_inp_params;
170 
171         UWORD32 *pu4_max_bitrate;
172 
173         UWORD32 u4_wd;
174 
175         UWORD32 u4_ht;
176 
177         bool b_use_default_vui;
178 
179         bool b_nalu_info_export_enable;
180 
181     } isvce_init_ip_t;
182 
183     typedef struct isvce_init_op_t
184     {
185         ive_init_op_t s_ive_op;
186     } isvce_init_op_t;
187 
188     /*****************************************************************************/
189     /*   Video control  Flush                                                    */
190     /*****************************************************************************/
191 
192     typedef struct isvce_ctl_flush_ip_t
193     {
194         ive_ctl_flush_ip_t s_ive_ip;
195     } isvce_ctl_flush_ip_t;
196 
197     typedef struct isvce_ctl_flush_op_t
198     {
199         ive_ctl_flush_op_t s_ive_op;
200     } isvce_ctl_flush_op_t;
201 
202     /*****************************************************************************/
203     /*   Video control reset                                                     */
204     /*****************************************************************************/
205 
206     typedef struct isvce_ctl_reset_ip_t
207     {
208         ive_ctl_reset_ip_t s_ive_ip;
209     } isvce_ctl_reset_ip_t;
210 
211     typedef struct isvce_ctl_reset_op_t
212     {
213         ive_ctl_reset_op_t s_ive_op;
214     } isvce_ctl_reset_op_t;
215 
216     /*****************************************************************************/
217     /*   Video control:Get Buf Info                                              */
218     /*****************************************************************************/
219 
220     typedef struct isvce_ctl_getbufinfo_ip_t
221     {
222         ive_ctl_getbufinfo_ip_t s_ive_ip;
223     } isvce_ctl_getbufinfo_ip_t;
224 
225     typedef struct isvce_ctl_getbufinfo_op_t
226     {
227         ive_ctl_getbufinfo_op_t s_ive_op;
228 
229         UWORD32 au4_min_rec_buf_size[IVE_MAX_IO_BUFFER_COMPONENTS];
230 
231         UWORD32 u4_rec_comp_cnt;
232 
233         UWORD32 u4_min_rec_bufs;
234 
235         UWORD32 u4_min_nalu_info_bufs;
236 
237         UWORD32 u4_min_nalu_info_buf_size;
238     } isvce_ctl_getbufinfo_op_t;
239 
240     /*****************************************************************************/
241     /*   Video control:Get Version Info                                          */
242     /*****************************************************************************/
243 
244     typedef struct isvce_ctl_getversioninfo_ip_t
245     {
246         ive_ctl_getversioninfo_ip_t s_ive_ip;
247     } isvce_ctl_getversioninfo_ip_t;
248 
249     typedef struct isvce_ctl_getversioninfo_op_t
250     {
251         ive_ctl_getversioninfo_op_t s_ive_op;
252     } isvce_ctl_getversioninfo_op_t;
253 
254     /*****************************************************************************/
255     /*   Video control:Set default params                                       */
256     /*****************************************************************************/
257 
258     typedef struct isvce_ctl_setdefault_ip_t
259     {
260         ive_ctl_setdefault_ip_t s_ive_ip;
261     } isvce_ctl_setdefault_ip_t;
262 
263     typedef struct isvce_ctl_setdefault_op_t
264     {
265         ive_ctl_setdefault_op_t s_ive_op;
266     } isvce_ctl_setdefault_op_t;
267 
268     /*****************************************************************************/
269     /*   Video control  Set IPE params                                           */
270     /*****************************************************************************/
271     typedef struct isvce_ctl_set_ipe_params_ip_t
272     {
273         ive_ctl_set_ipe_params_ip_t s_ive_ip;
274     } isvce_ctl_set_ipe_params_ip_t;
275 
276     typedef struct isvce_ctl_set_ipe_params_op_t
277     {
278         ive_ctl_set_ipe_params_op_t s_ive_op;
279     } isvce_ctl_set_ipe_params_op_t;
280 
281     /*****************************************************************************/
282     /*   Video control  Set Frame dimensions                                     */
283     /*****************************************************************************/
284     typedef struct isvce_ctl_set_dimensions_ip_t
285     {
286         ive_ctl_set_dimensions_ip_t s_ive_ip;
287     } isvce_ctl_set_dimensions_ip_t;
288 
289     typedef struct isvce_ctl_set_dimensions_op_t
290     {
291         ive_ctl_set_dimensions_op_t s_ive_op;
292     } isvce_ctl_set_dimensions_op_t;
293 
294     /*   Video control - Get Enc Frame dimensions */
295     typedef struct isvce_ctl_get_enc_dimensions_ip_t
296     {
297         UWORD32 u4_inp_frame_wd;
298 
299         UWORD32 u4_inp_frame_ht;
300     } isvce_ctl_get_enc_dimensions_ip_t;
301 
302     typedef struct isvce_ctl_get_enc_dimensions_op_t
303     {
304         UWORD32 u4_error_code;
305 
306         UWORD32 u4_enc_frame_wd;
307 
308         UWORD32 u4_enc_frame_ht;
309 
310     } isvce_ctl_get_enc_dimensions_op_t;
311 
312     /*****************************************************************************/
313     /*   Video control  Set Frame rates                                          */
314     /*****************************************************************************/
315     typedef struct isvce_ctl_set_frame_rate_ip_t
316     {
317         ive_ctl_set_frame_rate_ip_t s_ive_ip;
318     } isvce_ctl_set_frame_rate_ip_t;
319 
320     typedef struct isvce_ctl_set_frame_rate_op_t
321     {
322         ive_ctl_set_frame_rate_op_t s_ive_op;
323     } isvce_ctl_set_frame_rate_op_t;
324 
325     /*****************************************************************************/
326     /*   Video control  Set Bitrate                                              */
327     /*****************************************************************************/
328     typedef struct isvce_ctl_set_bitrate_ip_t
329     {
330         ive_ctl_set_bitrate_ip_t s_ive_ip;
331 
332         UWORD32 *pu4_target_bitrate;
333     } isvce_ctl_set_bitrate_ip_t;
334 
335     typedef struct isvce_ctl_set_bitrate_op_t
336     {
337         ive_ctl_set_bitrate_op_t s_ive_op;
338     } isvce_ctl_set_bitrate_op_t;
339 
340     /*****************************************************************************/
341     /*   Video control  Set Frame type                                           */
342     /*****************************************************************************/
343     typedef struct isvce_ctl_set_frame_type_ip_t
344     {
345         ive_ctl_set_frame_type_ip_t s_ive_ip;
346     } isvce_ctl_set_frame_type_ip_t;
347 
348     typedef struct isvce_ctl_set_frame_type_op_t
349     {
350         ive_ctl_set_frame_type_op_t s_ive_op;
351     } isvce_ctl_set_frame_type_op_t;
352 
353     /*****************************************************************************/
354     /*   Video control  Set Encode mode                                          */
355     /*****************************************************************************/
356     typedef struct isvce_ctl_set_enc_mode_ip_t
357     {
358         ive_ctl_set_enc_mode_ip_t s_ive_ip;
359     } isvce_ctl_set_enc_mode_ip_t;
360 
361     typedef struct isvce_ctl_set_enc_mode_op_t
362     {
363         ive_ctl_set_enc_mode_op_t s_ive_op;
364     } isvce_ctl_set_enc_mode_op_t;
365 
366     /*****************************************************************************/
367     /*   Video control  Set QP                                                   */
368     /*****************************************************************************/
369     typedef struct isvce_ctl_set_qp_ip_t
370     {
371         ive_ctl_set_qp_ip_t s_ive_ip;
372 
373         UWORD32 *pu4_i_qp;
374 
375         UWORD32 *pu4_i_qp_max;
376 
377         UWORD32 *pu4_i_qp_min;
378 
379         UWORD32 *pu4_p_qp;
380 
381         UWORD32 *pu4_p_qp_max;
382 
383         UWORD32 *pu4_p_qp_min;
384 
385         UWORD32 *pu4_b_qp;
386 
387         UWORD32 *pu4_b_qp_max;
388 
389         UWORD32 *pu4_b_qp_min;
390 
391     } isvce_ctl_set_qp_ip_t;
392 
393     typedef struct isvce_ctl_set_qp_op_t
394     {
395         ive_ctl_set_qp_op_t s_ive_op;
396     } isvce_ctl_set_qp_op_t;
397 
398     /*****************************************************************************/
399     /*   Video control  Set AIR params                                           */
400     /*****************************************************************************/
401     typedef struct isvce_ctl_set_air_params_ip_t
402     {
403         ive_ctl_set_air_params_ip_t s_ive_ip;
404     } isvce_ctl_set_air_params_ip_t;
405 
406     typedef struct isvce_ctl_set_air_params_op_t
407     {
408         ive_ctl_set_air_params_op_t s_ive_op;
409     } isvce_ctl_set_air_params_op_t;
410 
411     /*****************************************************************************/
412     /*   Video control  Set VBV params                                           */
413     /*****************************************************************************/
414     typedef struct isvce_ctl_set_vbv_params_ip_t
415     {
416         ive_ctl_set_vbv_params_ip_t s_ive_ip;
417 
418         UWORD32 *pu4_vbv_buffer_delay;
419     } isvce_ctl_set_vbv_params_ip_t;
420 
421     typedef struct isvce_ctl_set_vbv_params_op_t
422     {
423         ive_ctl_set_vbv_params_op_t s_ive_op;
424     } isvce_ctl_set_vbv_params_op_t;
425 
426     /*****************************************************************************/
427     /*   Video control  Set Processor Details                                    */
428     /*****************************************************************************/
429     typedef struct isvce_ctl_set_num_cores_ip_t
430     {
431         ive_ctl_set_num_cores_ip_t s_ive_ip;
432     } isvce_ctl_set_num_cores_ip_t;
433 
434     typedef struct isvce_ctl_set_num_cores_op_t
435     {
436         ive_ctl_set_num_cores_op_t s_ive_op;
437     } isvce_ctl_set_num_cores_op_t;
438 
439     /*****************************************************************************/
440     /*   Video control  Set Motion estimation params                             */
441     /*****************************************************************************/
442     typedef struct isvce_ctl_set_me_params_ip_t
443     {
444         ive_ctl_set_me_params_ip_t s_ive_ip;
445     } isvce_ctl_set_me_params_ip_t;
446 
447     typedef struct isvce_ctl_set_me_params_op_t
448     {
449         ive_ctl_set_me_params_op_t s_ive_op;
450     } isvce_ctl_set_me_params_op_t;
451 
452     /*****************************************************************************/
453     /*   Video control  Set GOP params                                           */
454     /*****************************************************************************/
455     typedef struct isvce_ctl_set_gop_params_ip_t
456     {
457         ive_ctl_set_gop_params_ip_t s_ive_ip;
458     } isvce_ctl_set_gop_params_ip_t;
459 
460     typedef struct isvce_ctl_set_gop_params_op_t
461     {
462         ive_ctl_set_gop_params_op_t s_ive_op;
463     } isvce_ctl_set_gop_params_op_t;
464 
465     /*****************************************************************************/
466     /*   Video control  Set Deblock params                                       */
467     /*****************************************************************************/
468     typedef struct isvce_ctl_set_deblock_params_ip_t
469     {
470         ive_ctl_set_deblock_params_ip_t s_ive_ip;
471     } isvce_ctl_set_deblock_params_ip_t;
472 
473     typedef struct isvce_ctl_set_deblock_params_op_t
474     {
475         ive_ctl_set_deblock_params_op_t s_ive_op;
476     } isvce_ctl_set_deblock_params_op_t;
477 
478     /*****************************************************************************/
479     /*   Video control  Set Profile params                                       */
480     /*****************************************************************************/
481     typedef struct isvce_ctl_set_profile_params_ip_t
482     {
483         ive_ctl_set_profile_params_ip_t s_ive_ip;
484     } isvce_ctl_set_profile_params_ip_t;
485 
486     typedef struct isvce_ctl_set_profile_params_op_t
487     {
488         ive_ctl_set_profile_params_op_t s_ive_op;
489     } isvce_ctl_set_profile_params_op_t;
490 
491     /*****************************************************************************/
492     /*   Synchronous video encode call                                           */
493     /*****************************************************************************/
494     typedef struct isvce_nalu_info_buf_t
495     {
496         /* For each NALU, following info will be copied as a csv string - */
497         /* 'type,length,SId,TID,isIDR,isFirstSliceInLayer,isLastSliceInLayer' */
498         UWORD8 *pu1_buf;
499 
500         UWORD32 u4_num_bytes;
501 
502         UWORD32 u4_buf_size;
503     } isvce_nalu_info_buf_t;
504 
505     typedef struct isvce_video_encode_ip_t
506     {
507         ive_video_encode_ip_t s_ive_ip;
508 
509         isvce_nalu_info_buf_t *ps_nalu_info_buf;
510 
511     } isvce_video_encode_ip_t;
512 
513     typedef struct isvce_video_encode_op_t
514     {
515         ive_video_encode_op_t s_ive_op;
516 
517         bool b_is_nalu_info_present;
518 
519         isvce_nalu_info_buf_t *ps_nalu_info_buf;
520 
521     } isvce_video_encode_op_t;
522 
523     /*****************************************************************************/
524     /*   Video usability information                                             */
525     /*****************************************************************************/
526     typedef struct isvce_vui_ip_t
527     {
528         /** size of the structure  */
529         UWORD32 u4_size;
530 
531         /** Command type : ISVCE_CMD_VIDEO_CTL  */
532         ISVCE_API_COMMAND_TYPE_T e_cmd;
533 
534         /** Sub command type : ISVCE_CMD_CTL_SET_GOP_PARAMS */
535         ISVCE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd;
536 
537         /** indicates the presence of aspect_ratio */
538         UWORD8 u1_aspect_ratio_info_present_flag;
539 
540         /** specifies the aspect ratio of the luma samples */
541         UWORD8 u1_aspect_ratio_idc;
542 
543         /** width of the luma samples. user dependent */
544         UWORD16 u2_sar_width;
545 
546         /** Height of the luma samples. user dependent */
547         UWORD16 u2_sar_height;
548 
549         /** if 1, specifies that the overscan_appropriate_flag is present
550          * if 0, the preferred display method for the video signal is unspecified */
551         UWORD8 u1_overscan_info_present_flag;
552 
553         /** if 1,indicates that the cropped decoded pictures output
554          * are suitable for display using overscan */
555         UWORD8 u1_overscan_appropriate_flag;
556 
557         /** if 1 specifies that video_format, video_full_range_flag and
558          * colour_description_present_flag are present */
559         UWORD8 u1_video_signal_type_present_flag;
560 
561         /** pal, secam, ntsc, ...  */
562         UWORD8 u1_video_format;
563 
564         /** indicates the black level and range of the luma and chroma signals */
565         UWORD8 u1_video_full_range_flag;
566 
567         /** if 1,specifies that colour_primaries, transfer_characteristics
568          * and matrix_coefficients are present */
569         UWORD8 u1_colour_description_present_flag;
570 
571         /** indicates the chromaticity coordinates of the source primaries  */
572         UWORD8 u1_colour_primaries;
573 
574         /** indicates the opto-electronic transfer characteristic of the source picture */
575         UWORD8 u1_transfer_characteristics;
576 
577         /** the matrix coefficients used in deriving luma and chroma signals
578          * from the green, blue, and red primaries */
579         UWORD8 u1_matrix_coefficients;
580 
581         /** if 1, specifies that chroma_sample_loc_type_top_field and
582          * chroma_sample_loc_type_bottom_field are present */
583         UWORD8 u1_chroma_loc_info_present_flag;
584 
585         /** location of chroma samples */
586         UWORD8 u1_chroma_sample_loc_type_top_field;
587 
588         UWORD8 u1_chroma_sample_loc_type_bottom_field;
589 
590         /**  Indicates the presence of the num_units_in_ticks, time_scale flag */
591         UWORD8 u1_vui_timing_info_present_flag;
592 
593         /**  Number of units that correspond to one increment of the
594          *   clock. Indicates the  resolution */
595         UWORD32 u4_vui_num_units_in_tick;
596 
597         /**  The number of time units that pass in one second */
598         UWORD32 u4_vui_time_scale;
599 
600         /** Flag indicating that time difference between two frames is a constant */
601         UWORD8 u1_fixed_frame_rate_flag;
602 
603         /** Indicates the presence of NAL HRD parameters */
604         UWORD8 u1_nal_hrd_parameters_present_flag;
605 
606         /** Indicates the presence of VCL HRD parameters */
607         UWORD8 u1_vcl_hrd_parameters_present_flag;
608 
609         /** Specifies the HRD operational mode */
610         UWORD8 u1_low_delay_hrd_flag;
611 
612         /** Indicates presence of SEI messages which include pic_struct syntax element */
613         UWORD8 u1_pic_struct_present_flag;
614 
615         /** 1, specifies that the following cvs bitstream restriction parameters are present */
616         UWORD8 u1_bitstream_restriction_flag;
617 
618         /** if 0, indicates that no pel outside the pic boundaries and
619          * no sub-pels derived using pels outside the pic boundaries is used for inter prediction */
620         UWORD8 u1_motion_vectors_over_pic_boundaries_flag;
621 
622         /** Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units
623          * associated with any coded picture */
624         UWORD8 u1_max_bytes_per_pic_denom;
625 
626         /** Indicates an upper bound for the number of bits of coding_unit() data */
627         UWORD8 u1_max_bits_per_mb_denom;
628 
629         /** Indicate the maximum absolute value of a decoded horizontal MV component
630          * in quarter-pel luma units */
631         UWORD8 u1_log2_max_mv_length_horizontal;
632 
633         /** Indicate the maximum absolute value of a decoded vertical MV component
634          * in quarter-pel luma units */
635         UWORD8 u1_log2_max_mv_length_vertical;
636 
637         /** Max number of frames that are not synchronized in display and decode order */
638         UWORD8 u1_num_reorder_frames;
639 
640         /** specifies required size of the HRD DPB in units of frame buffers */
641         UWORD8 u1_max_dec_frame_buffering;
642 
643     } isvce_vui_ip_t;
644 
645     typedef struct isvce_vui_op_t
646     {
647         /** size of the structure                                           */
648         UWORD32 u4_size;
649 
650         /** Return error code                                               */
651         UWORD32 u4_error_code;
652     } isvce_vui_op_t;
653 
654     /*****************************************************************************/
655     /*    Video control  Set SEI MDCV params                                     */
656     /*****************************************************************************/
657     typedef struct isvce_ctl_set_sei_mdcv_params_ip_t
658     {
659         /** size of the structure                                             */
660         UWORD32 u4_size;
661 
662         /** Command type : ISVCE_CMD_VIDEO_CTL                                  */
663         ISVCE_API_COMMAND_TYPE_T e_cmd;
664 
665         /** Sub command type : ISVCE_CMD_CTL_SET_SEI_MDCV_PARAMS                */
666         ISVCE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd;
667 
668         /** mastering display color volume info present flag                  */
669         UWORD8 u1_sei_mdcv_params_present_flag;
670 
671         /** Array to store the display_primaries_x values                     */
672         UWORD16 au2_display_primaries_x[3];
673 
674         /** Array to store the display_primaries_y values                     */
675         UWORD16 au2_display_primaries_y[3];
676 
677         /** Variable to store the white point x value                         */
678         UWORD16 u2_white_point_x;
679 
680         /** Variable to store the white point y value                         */
681         UWORD16 u2_white_point_y;
682 
683         /** Variable to store the max display mastering luminance value       */
684         UWORD32 u4_max_display_mastering_luminance;
685 
686         /** Variable to store the min display mastering luminance value       */
687         UWORD32 u4_min_display_mastering_luminance;
688 
689         /** Lower 32bits of time stamp corresponding to input buffer,
690          * from which this command takes effect                               */
691         UWORD32 u4_timestamp_low;
692 
693         /** Upper 32bits of time stamp corresponding to input buffer,
694          * from which this command takes effect                               */
695         UWORD32 u4_timestamp_high;
696 
697     } isvce_ctl_set_sei_mdcv_params_ip_t;
698 
699     typedef struct isvce_ctl_set_sei_mdcv_params_op_t
700     {
701         /** size of the structure                                           */
702         UWORD32 u4_size;
703 
704         /** Return error code                                               */
705         UWORD32 u4_error_code;
706 
707     } isvce_ctl_set_sei_mdcv_params_op_t;
708 
709     /*****************************************************************************/
710     /*    Video control  Set SEI CLL params                                      */
711     /*****************************************************************************/
712     typedef struct isvce_ctl_set_sei_cll_params_ip_t
713     {
714         /** size of the structure                                             */
715         UWORD32 u4_size;
716 
717         /** Command type : ISVCE_CMD_VIDEO_CTL                                  */
718         ISVCE_API_COMMAND_TYPE_T e_cmd;
719 
720         /** Sub command type : ISVCE_CMD_CTL_SET_SEI_CLL_PARAMS                 */
721         ISVCE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd;
722 
723         /** content light level info present flag                             */
724         UWORD8 u1_sei_cll_params_present_flag;
725 
726         /** The maximum pixel intensity of all samples                        */
727         UWORD16 u2_max_content_light_level;
728 
729         /** The average pixel intensity of all samples                        */
730         UWORD16 u2_max_pic_average_light_level;
731 
732         /** Lower 32bits of time stamp corresponding to input buffer,
733          * from which this command takes effect                               */
734         UWORD32 u4_timestamp_low;
735 
736         /** Upper 32bits of time stamp corresponding to input buffer,
737          * from which this command takes effect                               */
738         UWORD32 u4_timestamp_high;
739 
740     } isvce_ctl_set_sei_cll_params_ip_t;
741 
742     typedef struct isvce_ctl_set_sei_cll_params_op_t
743     {
744         /** size of the structure                                             */
745         UWORD32 u4_size;
746 
747         /** Return error code                                                 */
748         UWORD32 u4_error_code;
749 
750     } isvce_ctl_set_sei_cll_params_op_t;
751 
752     /*****************************************************************************/
753     /*    Video control  Set SEI AVE params                                      */
754     /*****************************************************************************/
755     typedef struct isvce_ctl_set_sei_ave_params_ip_t
756     {
757         /** size of the structure                                             */
758         UWORD32 u4_size;
759 
760         /** Command type : ISVCE_CMD_VIDEO_CTL                                  */
761         ISVCE_API_COMMAND_TYPE_T e_cmd;
762 
763         /** Sub command type : ISVCE_CMD_CTL_SET_SEI_AVE_PARAMS                 */
764         ISVCE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd;
765 
766         /** ambient viewing environment info present flag                     */
767         UWORD8 u1_sei_ave_params_present_flag;
768 
769         /** specifies the environmental illluminance of the ambient viewing
770          * environment                                                        */
771         UWORD32 u4_ambient_illuminance;
772 
773         /** specify the normalized x chromaticity coordinates of the
774          * environmental ambient light in the nominal viewing environment     */
775         UWORD16 u2_ambient_light_x;
776 
777         /** specify the normalized y chromaticity coordinates of the
778          * environmental ambient light in the nominal viewing environment     */
779         UWORD16 u2_ambient_light_y;
780 
781         /** Lower 32bits of time stamp corresponding to input buffer,
782          * from which this command takes effect                               */
783         UWORD32 u4_timestamp_low;
784 
785         /** Upper 32bits of time stamp corresponding to input buffer,
786          * from which this command takes effect                               */
787         UWORD32 u4_timestamp_high;
788 
789     } isvce_ctl_set_sei_ave_params_ip_t;
790 
791     typedef struct isvce_ctl_set_sei_ave_params_op_t
792     {
793         /** size of the structure                                             */
794         UWORD32 u4_size;
795 
796         /** Return error code                                                 */
797         UWORD32 u4_error_code;
798 
799     } isvce_ctl_set_sei_ave_params_op_t;
800 
801     /*****************************************************************************/
802     /*    Video control  Set SEI CCV params                                      */
803     /*****************************************************************************/
804     typedef struct isvce_ctl_set_sei_ccv_params_ip_t
805     {
806         /** size of the structure                                             */
807         UWORD32 u4_size;
808 
809         /** Command type : ISVCE_CMD_VIDEO_CTL                                  */
810         ISVCE_API_COMMAND_TYPE_T e_cmd;
811 
812         /** Sub command type : ISVCE_CMD_CTL_SET_SEI_CCV_PARAMS                 */
813         ISVCE_CONTROL_API_COMMAND_TYPE_T e_sub_cmd;
814 
815         /** content color volume info present flag                            */
816         UWORD8 u1_sei_ccv_params_present_flag;
817 
818         /** Flag used to control persistence of CCV SEI messages              */
819         UWORD8 u1_ccv_cancel_flag;
820 
821         /** specifies the persistence of the CCV SEI message for the
822          * current layer                                                      */
823         UWORD8 u1_ccv_persistence_flag;
824 
825         /** specifies the presence of syntax elements ccv_primaries_x
826          * and ccv_primaries_y                                                */
827         UWORD8 u1_ccv_primaries_present_flag;
828 
829         /** specifies that the syntax element ccv_min_luminance_value
830          * is present                                                         */
831         UWORD8 u1_ccv_min_luminance_value_present_flag;
832 
833         /** specifies that the syntax element ccv_max_luminance_value
834          *  is present                                                        */
835         UWORD8 u1_ccv_max_luminance_value_present_flag;
836 
837         /** specifies that the syntax element ccv_avg_luminance_value
838          *  is present                                                        */
839         UWORD8 u1_ccv_avg_luminance_value_present_flag;
840 
841         /** shall be equal to 0 in bitstreams conforming to this version.
842          * Other values for reserved_zero_2bits are reserved for future use   */
843         UWORD8 u1_ccv_reserved_zero_2bits;
844 
845         /** specify the normalized x chromaticity coordinates of the colour
846          * primary component c of the nominal content colour volume           */
847         WORD32 ai4_ccv_primaries_x[3];
848 
849         /** specify the normalized y chromaticity coordinates of the colour
850          * primary component c of the nominal content colour volume           */
851         WORD32 ai4_ccv_primaries_y[3];
852 
853         /** specifies the normalized minimum luminance value                  */
854         UWORD32 u4_ccv_min_luminance_value;
855 
856         /** specifies the normalized maximum luminance value                  */
857         UWORD32 u4_ccv_max_luminance_value;
858 
859         /** specifies the normalized average luminance value                  */
860         UWORD32 u4_ccv_avg_luminance_value;
861 
862         /** Lower 32bits of time stamp corresponding to input buffer,
863          * from which this command takes effect                               */
864         UWORD32 u4_timestamp_low;
865 
866         /** Upper 32bits of time stamp corresponding to input buffer,
867          * from which this command takes effect                               */
868         UWORD32 u4_timestamp_high;
869 
870     } isvce_ctl_set_sei_ccv_params_ip_t;
871 
872     typedef struct isvce_ctl_set_sei_ccv_params_op_t
873     {
874         /** size of the structure                                             */
875         UWORD32 u4_size;
876 
877         /** Return error code                                                 */
878         UWORD32 u4_error_code;
879 
880     } isvce_ctl_set_sei_ccv_params_op_t;
881 
882     /* The enum values should not have greater than 8 bits as this is assigned to WORD8 */
883     typedef enum IV_MB_TYPE_T
884     {
885         INTRA16x16 = 0,
886         INTRA4x4,
887         INTER16x16
888     } IV_MB_TYPE_T;
889 
890     /*****************************************************************************/
891     /*   Pic info structures                                                     */
892     /*****************************************************************************/
893     typedef struct isvce_pic_info1_t
894     {
895         /** Qp  */
896         UWORD32 u4_qp;
897 
898         /** Pic Type */
899         IV_PICTURE_CODING_TYPE_T e_frame_type;
900 
901     } isvce_pic_info1_t;
902 
903     /*****************************************************************************/
904     /*   MB info structures                                                     */
905     /*****************************************************************************/
906     typedef struct isvce_mv_t
907     {
908         /** MV X    */
909         WORD16 i2_mv_x;
910 
911         /** MV Y    */
912         WORD16 i2_mv_y;
913     } isvce_mv_t;
914 
915     typedef struct isvce_mb_info1_t
916     {
917         /** Intra / Inter    */
918         WORD8 i1_mb_type;
919 
920         union
921         {
922             isvce_mv_t as_mv[1];
923 
924             /** Intra mode */
925             WORD8 ai1_intra_mode[1];
926         };
927     } isvce_mb_info1_t;
928 
929     typedef struct isvce_mb_info2_t
930     {
931         /** Intra / Inter    */
932         WORD8 i1_mb_type;
933 
934         /** SAD     */
935         UWORD16 u2_sad;
936 
937         union
938         {
939             isvce_mv_t as_mv[1];
940 
941             /** Intra mode */
942             WORD8 ai1_intra_mode[1];
943         };
944 
945     } isvce_mb_info2_t;
946 
947     typedef struct isvce_mb_info3_t
948     {
949         /** Intra / Inter    */
950         WORD8 i1_mb_type;
951 
952         union
953         {
954             isvce_mv_t as_mv[4];
955 
956             /** Intra mode */
957             WORD8 ai1_intra_mode[16];
958         };
959 
960     } isvce_mb_info3_t;
961 
962     typedef struct isvce_mb_info4_t
963     {
964         /** Intra / Inter    */
965         WORD8 i1_mb_type;
966 
967         /** Intra Mode      */
968         WORD8 i1_intra_mode;
969 
970         /** SAD     */
971         UWORD16 u2_sad;
972 
973         union
974         {
975             isvce_mv_t as_mv[16];
976 
977             /** Intra mode */
978             WORD8 ai1_intra_mode[16];
979         };
980 
981     } isvce_mb_info4_t;
982 
983     /* Add any new structures to the following union. It is used to calculate the
984      * max size needed for allocation of memory */
985     typedef struct isvce_api_mb_info_t
986     {
987         union
988         {
989             isvce_mb_info1_t s_mb_info1;
990             isvce_mb_info2_t s_mb_info2;
991             isvce_mb_info3_t s_mb_info3;
992             isvce_mb_info4_t s_mb_info4;
993         };
994     } isvce_api_mb_info_t;
995 
996     typedef struct isvce_pic_info2_t
997     {
998         /** Qp  */
999         UWORD32 u4_qp;
1000 
1001         /** Pic Type */
1002         IV_PICTURE_CODING_TYPE_T e_frame_type;
1003 
1004         /** Disable deblock level (0: Enable completely, 3: Disable completely */
1005         UWORD32 u4_disable_deblock_level;
1006 
1007     } isvce_pic_info2_t;
1008 
1009     typedef struct isvce_api_cmds_t
1010     {
1011         ISVCE_API_COMMAND_TYPE_T e_cmd;
1012 
1013         ISVCE_CONTROL_API_COMMAND_TYPE_T e_ctl_cmd;
1014     } isvce_api_cmds_t;
1015 
1016     extern IV_STATUS_T isvce_api_function(iv_obj_t *ps_handle, void *pv_api_ip, void *pv_api_op,
1017                                           isvce_api_cmds_t *ps_iv_api_cmds);
1018 
1019 #ifdef __cplusplus
1020 } /* closing brace for extern "C" */
1021 #endif
1022 
1023 #endif
1024