• 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
23 *  ih264_defs.h
24 *
25 * @brief
26 *  Definitions used in the codec
27 *
28 * @author
29 *  Ittiam
30 *
31 *
32 * @remarks
33 *  None
34 *
35 *******************************************************************************
36 */
37 
38 #ifndef IH264_DEFS_H_
39 #define IH264_DEFS_H_
40 
41 /*****************************************************************************/
42 /* Enums                                                                     */
43 /*****************************************************************************/
44 
45 
46 /*****************************************************************************/
47 /* Profile and Levels                                                        */
48 /*****************************************************************************/
49 
50 /**
51 ******************************************************************************
52  *  @enum  PROFILE_IDC
53  *  @brief Defines the set of possible profiles
54 ******************************************************************************
55 */
56 enum
57 {
58     IH264_PROFILE_BASELINE = 66,
59     IH264_PROFILE_MAIN = 77,
60     IH264_PROFILE_EXTENDED = 88,
61     IH264_PROFILE_HIGH = 100,
62     IH264_PROFILE_HIGH10 = 110,
63     IH264_PROFILE_HIGH422 = 122,
64     IH264_PROFILE_HIGH444 = 144,
65 };
66 
67 /**
68 ******************************************************************************
69  *  @enum  LEVEL_IDC
70  *  @brief Defines the set of possible levels
71 ******************************************************************************
72 */
73 typedef enum
74 {
75     IH264_LEVEL_10         = 10,
76     IH264_LEVEL_1B         = 9,
77     IH264_LEVEL_11         = 11,
78     IH264_LEVEL_12         = 12,
79     IH264_LEVEL_13         = 13,
80     IH264_LEVEL_20         = 20,
81     IH264_LEVEL_21         = 21,
82     IH264_LEVEL_22         = 22,
83     IH264_LEVEL_30         = 30,
84     IH264_LEVEL_31         = 31,
85     IH264_LEVEL_32         = 32,
86     IH264_LEVEL_40         = 40,
87     IH264_LEVEL_41         = 41,
88     IH264_LEVEL_42         = 42,
89     IH264_LEVEL_50         = 50,
90     IH264_LEVEL_51         = 51,
91 }IH264_LEVEL_T;
92 
93 
94 /**
95 ******************************************************************************
96  *  @enum  PIC TYPES
97  *  @brief Defines the set of possible picture type - not signaled in bitstream
98 ******************************************************************************
99 */
100 typedef enum
101 {
102     PIC_NA = 0x7FFFFFFF,
103     PIC_IDR = 0,
104     PIC_I = 1,
105     PIC_P = 2,
106     PIC_B = 3,
107     PIC_P_NONREF = 4,
108     PIC_B_NONREF = 5,
109     PIC_MAX,
110 }PIC_TYPE_T;
111 
112 /**
113 ******************************************************************************
114  *  @enum  FRAME-FIELD types
115  *  @brief Defines the set of possible field types.
116 ******************************************************************************
117 */
118 enum
119 {
120     TOP_FIELD,
121     BOTTOM_FIELD,
122     FRAME,
123 };
124 
125 /**
126 ******************************************************************************
127  *  @enum  SLICE TYPES
128  *  @brief Defines the set of possible SLICE TYPES
129 ******************************************************************************
130 */
131 enum
132 {
133     PSLICE = 0,
134     BSLICE = 1,
135     ISLICE = 2,
136     SPSLICE = 3,
137     SISLICE = 4,
138     EPSLICE = 5,
139     EBSLICE = 6,
140     EISLICE = 7,
141     MAXSLICE_TYPE,
142 };
143 
144 /**
145 ******************************************************************************
146  *  @enum  NAL_UNIT_TYPE
147  *  @brief Defines the set of possible nal unit types
148 ******************************************************************************
149 */
150 typedef enum NAL_UNIT_TYPE_T
151 {
152     NAL_UNSPEC_0 = 0,
153     NAL_SLICE_NON_IDR = 1,
154     NAL_SLICE_DPA = 2,
155     NAL_SLICE_DPB = 3,
156     NAL_SLICE_DPC = 4,
157     NAL_SLICE_IDR = 5,
158     NAL_SEI = 6,
159     NAL_SPS = 7,
160     NAL_PPS = 8,
161     NAL_AUD = 9,
162     NAL_EOSEQ = 10,
163     NAL_EOSTR = 11,
164     NAL_FILLER = 12,
165     NAL_SPSE = 13,
166     NAL_PREFIX = 14,
167     NAL_SUBSET_SPS = 15,
168     NAL_AUX_PIC = 19,
169     NAL_CODED_SLICE_EXTENSION = 20,
170     NAL_UNSPEC_31 = 24,
171 } NAL_UNIT_TYPE_T;
172 
173 /**
174 ******************************************************************************
175  *  @enum  CHROMA_FORMAT_IDC
176  *  @brief Defines the set of possible chroma formats
177  *  Note Chorma format Do not change enum values
178 ******************************************************************************
179 */
180 enum
181 {
182     CHROMA_FMT_IDC_MONOCHROME   = 0,
183     CHROMA_FMT_IDC_YUV420       = 1,
184     CHROMA_FMT_IDC_YUV422       = 2,
185     CHROMA_FMT_IDC_YUV444       = 3,
186     CHROMA_FMT_IDC_YUV444_PLANES = 4,
187 };
188 
189 
190 /**
191 ******************************************************************************
192  *  @enum  MBMODES_I16x16
193  *  @brief Defines the set of possible intra 16x16 mb modes
194 ******************************************************************************
195 */
196 typedef enum
197 {
198     VERT_I16x16     = 0,
199     HORZ_I16x16     = 1,
200     DC_I16x16       = 2,
201     PLANE_I16x16    = 3,
202     MAX_I16x16      = 4,
203 }MBMODES_I16x16;
204 
205 /**
206 ******************************************************************************
207  *  @enum  MBMODES_I4x4
208  *  @brief Defines the set of possible intra 4x4 mb modes
209 ******************************************************************************
210 */
211 typedef enum
212 {
213     VERT_I4x4     = 0,
214     HORZ_I4x4     = 1,
215     DC_I4x4       = 2,
216     DIAG_DL_I4x4  = 3,
217     DIAG_DR_I4x4  = 4,
218     VERT_R_I4x4   = 5,
219     HORZ_D_I4x4   = 6,
220     VERT_L_I4x4   = 7,
221     HORZ_U_I4x4   = 8,
222     MAX_I4x4      = 9,
223 }MBMODES_I4x4;
224 
225 /**
226 ******************************************************************************
227  *  @enum  MBMODES_I8x8
228  *  @brief Defines the set of possible intra 8x8 mb modes
229 ******************************************************************************
230 */
231 typedef enum
232 {
233     VERT_I8x8     = 0,
234     HORZ_I8x8     = 1,
235     DC_I8x8       = 2,
236     DIAG_DL_I8x8  = 3,
237     DIAG_DR_I8x8  = 4,
238     VERT_R_I8x8   = 5,
239     HORZ_D_I8x8   = 6,
240     VERT_L_I8x8   = 7,
241     HORZ_U_I8x8   = 8,
242     MAX_I8x8      = 9,
243 }MBMODES_I8x8;
244 
245 /**
246 ******************************************************************************
247  *  @enum  MBMODES_CHROMA_I8x8 (Chroma)
248  *  @brief Defines the set of possible intra 8x8 mb modes for chroma
249 ******************************************************************************
250 */
251 typedef enum
252 {
253     DC_CH_I8x8     = 0,
254     HORZ_CH_I8x8   = 1,
255     VERT_CH_I8x8   = 2,
256     PLANE_CH_I8x8  = 3,
257     MAX_CH_I8x8    = 4,
258 }MBMODES_CHROMA_I8x8;
259 
260 /**
261 ******************************************************************************
262  *  @enum  MBTYPES
263  *  @brief Defines the set of possible macro block types
264 ******************************************************************************
265 */
266 typedef enum
267 {
268     INVALID_MB_TYPE = -1,
269     I16x16 = 0,
270     I4x4 = 1,
271     I8x8 = 2,
272     P16x16 = 3,
273     P16x8 = 4,
274     P8x16 = 5,
275     P8x8 = 6,
276     PSKIP = 7,
277     IPCM = 8,
278     B16x16 = 9,
279     BSKIP = 10,
280     BDIRECT = 11,
281     BASE_MODE = 12,
282     MAX_MBTYPES,
283 } MBTYPES_T;
284 
285 /* Pred Modes */
286 enum
287 {
288     BLOCK_TYPE_INTER_MB = 0,
289     BLOCK_TYPE_INTRA_MB = 1,
290     BLOCK_TYPE_SKIP_MB = 2
291 };
292 
293 /* Prediction list */
294 /* Do not change enum values */
295 enum
296 {
297     PRED_L0 = 0,
298     PRED_L1 = 1,
299     PRED_BI = 2
300 };
301 
302 
303 /**
304 ******************************************************************************
305  *  @enum  ENTROPY_BLK_TYPE
306  *  @brief Defines the nature of blocks employed in entropy coding
307 ******************************************************************************
308 */
309 typedef enum
310 {
311     ENTROPY_BLK_INVALID = -1,
312     CAVLC_LUMA_4x4_DC = 0,
313     CAVLC_LUMA_4x4_AC = 1,
314     CAVLC_LUMA_4x4 = 2,
315     CAVLC_CHROMA_4x4_DC = 3,
316     CAVLC_CHROMA_4x4_AC = 4,
317 } ENTROPY_BLK_TYPE;
318 
319 /**
320 ******************************************************************************
321  *  @enum  ENTROPY_MODE
322  *  @brief Entropy coding modes
323 ******************************************************************************
324 */
325 typedef enum
326 {
327     CAVLC = 0,
328     CABAC = 1,
329 } ENTROPY_MODE;
330 
331 /**
332 ******************************************************************************
333  *  @enum  COMPONENT_TYPE
334  *  @brief components Y, U & V
335 ******************************************************************************
336 */
337 typedef enum
338 {
339     Y,
340     U,
341     V,
342 } COMPONENT_TYPE;
343 
344 
345 /**
346 ******************************************************************************
347  *  @enum  MBPART_PREDMODE_T
348  *  @brief MbPartps_pred_mode_ctxt Table 7-11 to 7-14
349 ******************************************************************************
350 */
351 typedef enum
352 {
353     MBPART_NA,
354     MBPART_I4x4,
355     MBPART_I8x8,
356     MBPART_I16x16,
357     MBPART_L0,
358     MBPART_L1,
359     MBPART_BI,
360     MBPART_DIRECT,
361     MBPART_IPCM,
362 }MBPART_PREDMODE_T;
363 
364 
365 typedef enum
366 {
367     I_NxN,
368     I_16x16_0_0_0,
369     I_16x16_1_0_0,
370     I_16x16_2_0_0,
371     I_16x16_3_0_0,
372     I_16x16_0_1_0,
373     I_16x16_1_1_0,
374     I_16x16_2_1_0,
375     I_16x16_3_1_0,
376     I_16x16_0_2_0,
377     I_16x16_1_2_0,
378     I_16x16_2_2_0,
379     I_16x16_3_2_0,
380     I_16x16_0_0_1,
381     I_16x16_1_0_1,
382     I_16x16_2_0_1,
383     I_16x16_3_0_1,
384     I_16x16_0_1_1,
385     I_16x16_1_1_1,
386     I_16x16_2_1_1,
387     I_16x16_3_1_1,
388     I_16x16_0_2_1,
389     I_16x16_1_2_1,
390     I_16x16_2_2_1,
391     I_16x16_3_2_1,
392     I_PCM,
393 }MBTYPE_ISLICE_T;
394 
395 typedef enum
396 {
397     P_L0_16x16,
398     P_L0_L0_16x8,
399     P_L0_L0_8x16,
400     P_8x8,
401     P_8x8REF0,
402     P_SKIP
403 }MBTYPE_PSLICE_T;
404 
405 typedef enum
406 {
407     B_DIRECT_16x16,
408     B_L0_16x16,
409     B_L1_16x16,
410     B_BI_16x16,
411     B_L0_L0_16x8,
412     B_L0_L0_8x16,
413     B_L1_L1_16x8,
414     B_L1_L1_8x16,
415     B_L0_L1_16x8,
416     B_L0_L1_8x16,
417     B_L1_L0_16x8,
418     B_L1_L0_8x16,
419     B_L0_BI_16x8,
420     B_L0_BI_8x16,
421     B_L1_BI_16x8,
422     B_L1_BI_8x16,
423     B_BI_L0_16x8,
424     B_BI_L0_8x16,
425     B_BI_L1_16x8,
426     B_BI_L1_8x16,
427     B_BI_BI_16x8,
428     B_BI_BI_8x16,
429     B_8x8,
430     B_SKIP,
431 }MBTYPE_BSLICE_T;
432 
433 
434 typedef enum
435 {
436     P_L0_8x8,
437     P_L0_8x4,
438     P_L0_4x8,
439     P_L0_4x4,
440 }SUBMBTYPE_PSLICE_T;
441 
442 typedef enum
443 {
444     B_DIRECT_8x8,
445     B_L0_8x8,
446     B_L1_8x8,
447     B_BI_8x8,
448     B_L0_8x4,
449     B_L0_4x8,
450     B_L1_8x4,
451     B_L1_4x8,
452     B_BI_8x4,
453     B_BI_4x8,
454     B_L0_4x4,
455     B_L1_4x4,
456     B_BI_4x4,
457 }SUBMBTYPE_BSLICE_T;
458 
459 /**
460  * DC Mode pattern for 4 4x4 sub blocks in an MB row
461  */
462 #define DC_I16X16_MB_ROW (DC_I16x16 << 24) | (DC_I16x16 << 16) | \
463                          (DC_I16x16 << 8)  | DC_I16x16
464 
465 
466 
467 /*****************************************************************************/
468 /* Constant Macros                                                           */
469 /*****************************************************************************/
470 
471 /*****************************************************************************/
472 /* Reference frame defs                                                      */
473 /*****************************************************************************/
474 /* Maximum DPB size */
475 #define MAX_DPB_SIZE 16
476 
477 /* Maximum mmco commands in slice header */
478 #define MAX_MMCO_COMMANDS 32
479 
480 /* Maximum reference reorder idc */
481 #define MAX_MODICATION_IDC 32
482 
483 /*****************************************************************************/
484 /* SPS restrictions                                                          */
485 /*****************************************************************************/
486 
487 /* Number of SPS allowed */
488 /* An extra buffer is allocated to write the parsed data
489  * It is copied to the appropriate location later */
490 #define MAX_SPS_CNT         (32 + 1)
491 
492 /* Maximum long term reference pics */
493 #define MAX_LTREF_PICS_SPS 16
494 
495 /* Maximum short term reference pics */
496 #define MAX_STREF_PICS_SPS 64
497 
498 
499 /*****************************************************************************/
500 /* PPS restrictions                                                          */
501 /*****************************************************************************/
502 
503 /* Number of PPS allowed  */
504 /* An extra buffer is allocated to write the parsed data
505  * It is copied to the appropriate location later */
506 #define MAX_PPS_CNT         (256 + 1)
507 
508 /*****************************************************************************/
509 /* Macro definitions for sizes of MB, PU, TU, CU                            */
510 /*****************************************************************************/
511 #define MB_SIZE             16
512 #define BLK8x8SIZE          8
513 #define BLK_SIZE            4
514 
515 
516 /* TU Size Range */
517 #define MAX_TU_SIZE         8
518 #define MIN_TU_SIZE         4
519 
520 /* Max Transform Size */
521 #define MAX_TRANS_SIZE      (MAX_TU_SIZE*MAX_TU_SIZE)
522 
523 /* PU Size Range */
524 #define MAX_PU_SIZE         16
525 #define MIN_PU_SIZE         4
526 
527 /* Number of max TU in a MB row */
528 #define MAX_TU_IN_MB_ROW   ((MB_SIZE / MIN_TU_SIZE))
529 
530 #define MIN_TU_IN_MB_ROW ((MB_SIZE / MAX_TU_SIZE))
531 
532 /* Number of max PU in a CTb row */
533 #define MAX_PU_IN_MB_ROW   ((MB_SIZE / MIN_PU_SIZE))
534 
535 #define MAX_TU_IN_MB_COL MAX_TU_IN_MB_ROW
536 
537 #define MIN_TU_IN_MB_COL MIN_TU_IN_MB_ROW
538 
539 #define MAX_PU_IN_MB_COL MAX_PU_IN_MB_ROW
540 
541 /* Number of max PU in a MB */
542 /*****************************************************************************/
543 /* Note though for 64 x 64 MB, Max PU in MB is 128, in order to store      */
544 /*  intra pred info, 256 entries are needed                                  */
545 /*****************************************************************************/
546 #define MAX_PU_IN_MB       ((MB_SIZE / MIN_PU_SIZE) * \
547                              (MB_SIZE / MIN_PU_SIZE))
548 
549 /* Number of max TU in a MB */
550 #define MAX_TU_IN_MB       ((MB_SIZE / MIN_TU_SIZE) * \
551                              (MB_SIZE / MIN_TU_SIZE))
552 
553 #define MIN_TU_IN_MB (MIN_TU_IN_MB_ROW * MIN_TU_IN_MB_COL)
554 
555 #define NUM_4x4_IN_8x8 4
556 
557 #define NUM_COEFFS_IN_MIN_TU (MIN_TU_SIZE * MIN_TU_SIZE)
558 
559 /**
560  * Maximum transform depths
561  */
562 #define MAX_TRAFO_DEPTH 5
563 
564 #define MAX_DC_4x4_SUBBLK_LUMA 1
565 #define MAX_AC_4x4_SUBBLK_LUMA 16
566 #define MAX_DC_4x4_SUBBLK_CHROMA 2
567 #define MAX_AC_4x4_SUBBLK_CHROMA 8
568 
569 #define MAX_4x4_SUBBLKS (MAX_DC_4x4_SUBBLK_LUMA + MAX_DC_4x4_SUBBLK_CHROMA +\
570                          MAX_AC_4x4_SUBBLK_LUMA + MAX_AC_4x4_SUBBLK_CHROMA)
571 
572 /* Max number of deblocking edges */
573 #define MAX_VERT_DEBLK_EDGES ((MB_SIZE/8) * (MB_SIZE/4))
574 #define MAX_HORZ_DEBLK_EDGES ((MB_SIZE/4) * (MB_SIZE/8))
575 
576 /* Qp can not change below 8x8 level */
577 #define MAX_DEBLK_QP_CNT     ((MB_SIZE/8) * (MB_SIZE/8))
578 
579 /*****************************************************************************/
580 /* Parsing related macros                                                    */
581 /*****************************************************************************/
582 #define SUBBLK_COEFF_CNT    16
583 
584 /* Quant and Trans defs */
585 
586 /*****************************************************************************/
587 /* Sizes for Transform functions                                             */
588 /*****************************************************************************/
589 #define TRANS_SIZE_4   4
590 #define TRANS_SIZE_8   8
591 #define TRANS_SIZE_16 16
592 #define TRANS_SIZE_32 32
593 
594 
595 #define IT_SHIFT_STAGE_1 7
596 #define IT_SHIFT_STAGE_2 12
597 
598 /**
599  * @breif  Maximum transform dynamic range (excluding sign bit)
600  */
601 #define MAX_TR_DYNAMIC_RANGE  15
602 
603 /**
604  * @brief  Q(QP%6) * IQ(QP%6) = 2^20
605  */
606 #define QUANT_IQUANT_SHIFT    20
607 
608 /**
609  * @breif Q factor for Qp%6 multiplication
610  */
611 #define QUANT_SHIFT           14
612 
613 /**
614  * @breif Q shift factor for flat rescale matrix weights
615  */
616 #define FLAT_RESCALE_MAT_Q_SHIFT    11
617 
618 /**
619  * @breif  Scaling matrix is represented in Q15 format
620  */
621 #define SCALING_Q_SHIFT       15
622 
623 /**
624  * @brief  rounding factor for quantization represented in Q9 format
625  */
626 #define QUANT_ROUND_FACTOR_Q   9
627 
628 /**
629  * @brief  Minimum qp supported in H264 spec
630  */
631 #define MIN_H264_QP 0
632 
633 /**
634  * @brief  Maximum qp supported in H264 spec
635  */
636 #define MAX_H264_QP 51
637 
638 /**
639  * @brief  Minimum delta scale supported in H264 spec
640  */
641 #define MIN_H264_DELTA_SCALE (-128)
642 
643 /**
644  * @brief  Maximum delta scale supported in H264 spec
645  */
646 #define MAX_H264_DELTA_SCALE 127
647 
648 /**
649  * @breif  Total number of transform sizes
650  * used for sizeID while getting scale matrix
651  */
652 #define NUM_UNIQUE_TRANS_SIZE 4
653 
654 /**
655  * @breif  Maximum number of bits in frameNumber signaling
656  */
657 #define MAX_BITS_IN_FRAME_NUM     16
658 
659 /**
660  * @breif  Maximum number of bits in POC LSB signaling
661  */
662 #define MAX_BITS_IN_POC_LSB     16
663 
664 
665 /**
666  * @breif  Maximum PIC Order Count type
667  */
668 #define MAX_PIC_ORDER_COUNT_TYPE    2
669 
670 
671 /**
672  * @breif  Maximum Weighted bipred idc
673  */
674 #define MAX_WEIGHT_BIPRED_IDC 2
675 
676 /*****************************************************************************/
677 /* Number of scaling matrices for each transform size                        */
678 /*****************************************************************************/
679 #define SCALE_MAT_CNT_TRANS_SIZE_4    6
680 #define SCALE_MAT_CNT_TRANS_SIZE_8    6
681 #define SCALE_MAT_CNT_TRANS_SIZE_16   6
682 #define SCALE_MAT_CNT_TRANS_SIZE_32   2
683 
684 /* Maximum number of scale matrices for a given transform size */
685 #define SCALE_MAT_CNT_MAX_PER_TRANS_SIZE 6
686 
687 /* Total number of scale matrices */
688 #define TOTAL_SCALE_MAT_COUNT   (SCALE_MAT_CNT_TRANS_SIZE_4     + \
689                                  SCALE_MAT_CNT_TRANS_SIZE_8     + \
690                                  SCALE_MAT_CNT_TRANS_SIZE_16    + \
691                                  SCALE_MAT_CNT_TRANS_SIZE_32)
692 
693 
694 /*****************************************************************************/
695 /* Intra pred Macros                                                         */
696 /*****************************************************************************/
697 /** Planar Intra prediction mode */
698 #define INTRA_PLANAR             0
699 
700 /** DC Intra prediction mode */
701 #define INTRA_DC                 1
702 
703 /** Gives angular mode for intra prediction */
704 #define INTRA_ANGULAR(x) (x)
705 
706 /** Following is used to signal no intra prediction in case of pcm blocks
707  */
708 #define INTRA_PRED_NONE  63
709 
710 
711 /** Following is used to signal no intra prediction is needed for first three
712  * 4x4 luma blocks in case of 4x4 TU sizes
713  * Also used in pcm cases
714  */
715 #define INTRA_PRED_CHROMA_IDX_NONE  7
716 
717 
718 /**
719 ******************************************************************************
720  *  @brief  neighbor availability masks
721 ******************************************************************************
722  */
723 #define LEFT_MB_AVAILABLE_MASK      0x01
724 #define TOP_LEFT_MB_AVAILABLE_MASK  0x02
725 #define TOP_MB_AVAILABLE_MASK       0x04
726 #define TOP_RIGHT_MB_AVAILABLE_MASK 0x08
727 
728 /**
729 ******************************************************************************
730  *  @brief  SEI macros
731 ******************************************************************************
732  */
733 /*
734  * @brief  specifies the number of colour primary components of the mastering display
735  */
736 #define NUM_SEI_MDCV_PRIMARIES      3
737 
738 /*
739  * @brief  specifies the number of colour primary components of the nominal content colour volume
740  */
741 #define NUM_SEI_CCV_PRIMARIES       3
742 
743 #define DISPLAY_PRIMARIES_X_UPPER_LIMIT                37000
744 #define DISPLAY_PRIMARIES_X_LOWER_LIMIT                5
745 #define DISPLAY_PRIMARIES_X_DIVISION_FACTOR            5
746 
747 #define DISPLAY_PRIMARIES_Y_UPPER_LIMIT                42000
748 #define DISPLAY_PRIMARIES_Y_LOWER_LIMIT                5
749 #define DISPLAY_PRIMARIES_Y_DIVISION_FACTOR            5
750 
751 #define WHITE_POINT_X_UPPER_LIMIT                      37000
752 #define WHITE_POINT_X_LOWER_LIMIT                      5
753 #define WHITE_POINT_X_DIVISION_FACTOR                  5
754 
755 #define WHITE_POINT_Y_UPPER_LIMIT                      42000
756 #define WHITE_POINT_Y_LOWER_LIMIT                      5
757 #define WHITE_POINT_Y_DIVISION_FACTOR                  5
758 
759 #define MAX_DISPLAY_MASTERING_LUMINANCE_UPPER_LIMIT        100000000
760 #define MAX_DISPLAY_MASTERING_LUMINANCE_LOWER_LIMIT        50000
761 #define MAX_DISPLAY_MASTERING_LUMINANCE_DIVISION_FACTOR    10000
762 
763 #define MIN_DISPLAY_MASTERING_LUMINANCE_UPPER_LIMIT        50000
764 #define MIN_DISPLAY_MASTERING_LUMINANCE_LOWER_LIMIT        1
765 
766 #define AMBIENT_LIGHT_X_UPPER_LIMIT        50000
767 #define AMBIENT_LIGHT_Y_UPPER_LIMIT        50000
768 
769 #define CCV_PRIMARIES_X_UPPER_LIMIT        5000000
770 #define CCV_PRIMARIES_X_LOWER_LIMIT        -5000000
771 #define CCV_PRIMARIES_Y_UPPER_LIMIT        5000000
772 #define CCV_PRIMARIES_Y_LOWER_LIMIT        -5000000
773 
774 #define RSD_MAX 255
775 #define RSD_MIN -255
776 #define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
777 
778 #define SII_MAX_SUB_LAYERS 8
779 #define SII_SUB_LAYER_IDX 0
780 #define SHUTTER_INTERVAL_INFO_PRESENT_FLAG 1
781 #define SII_TIME_SCALE 24000000
782 #define FIXED_SHUTTER_INTERVAL_WITHIN_CVS_FLAG 0
783 #define SII_NUM_UNITS_IN_SHUTTER_INTERVAL 480000
784 #define SII_MAX_SUB_LAYERS_MINUS1 (SII_MAX_SUB_LAYERS - 1)
785 #define SUB_LAYER_NUM_UNITS_IN_SHUTTER_INTERVAL_HFR 480000
786 #define SUB_LAYER_NUM_UNITS_IN_SHUTTER_INTERVAL_SFR 240000
787 
788 /*
789  * @brief Below macros related to film grain characteristics SEI
790  */
791 #define SEI_FGC_NUM_COLOUR_COMPONENTS 3
792 #define SEI_FGC_MAX_NUM_MODEL_VALUES 6
793 #define SEI_FGC_MAX_NUM_INTENSITY_INTERVALS 256
794 
795 #endif /* IH264_DEFS_H_ */
796