• 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 #ifndef _IH264D_DEFS_H_
21 #define _IH264D_DEFS_H_
22 
23 /**
24  ************************************************************************
25  * \file ih264d_defs.h
26  *
27  * \brief
28  *    Type definitions used in the code
29  *
30  * \date
31  *    19/11/2002
32  *
33  * \author  Sriram Sethuraman
34  *
35  ************************************************************************
36  */
37 #include <stdint.h>
38 
39 #define H264_MAX_FRAME_WIDTH                4080
40 #define H264_MAX_FRAME_HEIGHT               4080
41 #define H264_MAX_FRAME_SIZE                 (4096 * 2048)
42 
43 #define H264_MIN_FRAME_WIDTH                16
44 #define H264_MIN_FRAME_HEIGHT               16
45 
46 #define FMT_CONV_NUM_ROWS       16
47 
48 /** Decoder currently has an additional latency of 2 pictures when
49   * returning output for display
50   */
51 #define DISPLAY_LATENCY         2
52 
53 /** Bit manipulation macros */
54 #define CHECKBIT(a,i) ((a) &  (1 << i))
55 #define CLEARBIT(a,i) ((a) &= ~(1 << i))
56 
57 /** Macro to check if a number lies in the valid integer range */
58 #define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
59 
60 /** Macro to convert a integer to a boolean value */
61 #define BOOLEAN(x) (!!(x))
62 
63 /** Arithmetic operations */
64 #define MOD(x,y) ((x)%(y))
65 #define DIV(x,y) ((x)/(y))
66 #define MUL(x,y) ((x)*(y))
67 #define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
68 
69 #define MB_ENABLE_FILTERING           0x00
70 #define MB_DISABLE_FILTERING          0x01
71 #define MB_DISABLE_TOP_EDGE           0x02
72 #define MB_DISABLE_LEFT_EDGE          0x04
73 
74 /** Maximum number of reference pics */
75 #define MAX_REF_BUFS    32
76 #define MAX_DISP_BUFS_NEW 64
77 #define MAX_FRAMES              16
78 
79 #define INVALID_FRAME_NUM       0x0fffffff
80 #define GAP_FRAME_NUM           0x1fffffff
81 
82 /** macros for reference picture lists, refIdx to POC mapping */
83 // 1 extra entry into reference picture lists for refIdx = -1.
84 // this entry is always 0. this saves conditional checks in
85 // FillBs modules.
86 #define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
87 #define POC_LIST_L0_TO_L1_DIFF_1  ((MAX_FRAMES) + 1)
88 
89 #define FRM_LIST_L0             0                                               //0
90 #define FRM_LIST_L1             1 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L0 + POC_LIST_L0_TO_L1_DIFF        //0+33                  //(1 * POC_LIST_L0_TO_L1_DIFF)
91 #define TOP_LIST_FLD_L0         2 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L1 + POC_LIST_L0_TO_L1_DIFF        //0+33+33                   //(2 * POC_LIST_L0_TO_L1_DIFF)
92 #define TOP_LIST_FLD_L1         3 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17                //(3 * POC_LIST_L0_TO_L1_DIFF)
93 #define BOT_LIST_FLD_L0         4 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17
94 #define BOT_LIST_FLD_L1         5 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17
95 #define TOTAL_LIST_ENTRIES      6 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17+17
96 #define PAD_MV_BANK_ROW             64
97 #define OFFSET_MV_BANK_ROW          ((PAD_MV_BANK_ROW)>>1)
98 #define PAD_PUC_CURNNZ              32
99 #define OFFSET_PUC_CURNNZ           (PAD_PUC_CURNNZ)
100 #define PAD_MAP_IDX_POC             (1)
101 #define OFFSET_MAP_IDX_POC          (1)
102 
103 #define OFFSET_MAP_IDX_POC          (1)
104 
105 #define NAL_REF_IDC(nal_first_byte)       ((nal_first_byte >> 5) & 0x3)
106 #define NAL_FORBIDDEN_BIT(nal_first_byte) (nal_first_byte>>7)
107 #define NAL_UNIT_TYPE(nal_first_byte)     (nal_first_byte & 0x1F)
108 
109 #define INT_PIC_TYPE_I        (0x00)
110 
111 #define YIELD_CNT_THRESHOLD  8
112 
113 
114 #define OK        0
115 #define END       1
116 #define NOT_OK    -1
117 
118 /* For 420SP */
119 #define YUV420SP_FACTOR 2
120 
121 /*To prevent buffer overflow access; in case the size of nal unit is
122  *  greater than the allocated buffer size*/
123 #define EXTRA_BS_OFFSET 16*16*2
124 
125 #define DECODED_SPS_MASK 1
126 #define DECODED_PPS_MASK 2
127 
128 /**
129  ***************************************************************************
130  * Enum to hold various mem records being request
131  ****************************************************************************
132  */
133 enum
134 {
135     /**
136      * Codec Object at API level
137      */
138     MEM_REC_IV_OBJ,
139 
140     /**
141      * Codec context
142      */
143     MEM_REC_CODEC,
144 
145     /**
146      * Bitstream buffer which holds emulation prevention removed bytes
147      */
148     MEM_REC_BITSBUF,
149 
150     /**
151      * Buffer to hold  coeff data
152      */
153     MEM_REC_COEFF_DATA,
154 
155     /**
156      * Motion vector bank
157      */
158     MEM_REC_MVBANK,
159 
160     /**
161      * Holds mem records passed to the codec.
162      */
163     MEM_REC_BACKUP,
164 
165     /**
166      * Holds SPS
167      */
168     MEM_REC_SPS,
169 
170     /**
171      * Holds PPS
172      */
173     MEM_REC_PPS,
174 
175     /**
176      * Holds Slice Headers
177      */
178     MEM_REC_SLICE_HDR,
179 
180     /**
181      * Holds thread handles
182      */
183     MEM_REC_THREAD_HANDLE,
184 
185     /**
186      * Contains i4_status map indicating parse i4_status per MB basis
187      */
188     MEM_REC_PARSE_MAP,
189 
190     /**
191      * Contains i4_status map indicating processing i4_status per MB basis
192      */
193     MEM_REC_PROC_MAP,
194 
195     /**
196      * Contains slice number info for each MB
197      */
198 
199     MEM_REC_SLICE_NUM_MAP,
200 
201     /**
202      * Holds dpb manager context
203      */
204     MEM_REC_DPB_MGR,
205 
206     /**
207      * Holds neighbors' info
208      */
209     MEM_REC_NEIGHBOR_INFO,
210 
211     /**
212      * Holds neighbors' info
213      */
214     MEM_REC_PRED_INFO,
215 
216 
217     /**
218      * Holds inter pred inforamation on packed format info
219      */
220     MEM_REC_PRED_INFO_PKD,
221     /**
222      * Holds neighbors' info
223      */
224     MEM_REC_MB_INFO,
225 
226     /**
227      * Holds deblock Mb info structure frame level)
228      */
229     MEM_REC_DEBLK_MB_INFO,
230 
231     /**
232      * Holds  reference picture buffers in non-shared mode
233      */
234     MEM_REC_REF_PIC,
235 
236     /**
237      * Holds  some misc intermediate_buffers
238      */
239     MEM_REC_EXTRA_MEM,
240 
241     /**
242      * Holds  some misc intermediate_buffers
243      */
244     MEM_REC_INTERNAL_SCRATCH,
245 
246     /**
247      * Holds  some misc intermediate_buffers
248      */
249     MEM_REC_INTERNAL_PERSIST,
250 
251     /* holds structures related to picture buffer manager*/
252     MEM_REC_PIC_BUF_MGR,
253 
254     /*holds structure related to MV buffer manager*/
255     MEM_REC_MV_BUF_MGR,
256 
257     /**
258      * Place holder to compute number of memory records.
259      */
260     MEM_REC_CNT
261 /* Do not add anything below */
262 };
263 
264 #ifdef DEBLOCK_THREAD
265 #define H264_MUTEX_LOCK(lock) ithread_mutex_lock(lock)
266 #define H264_MUTEX_UNLOCK(lock) ithread_mutex_unlock(lock)
267 #else //DEBLOCK_THREAD
268 #define H264_MUTEX_LOCK(lock)
269 #define H264_MUTEX_UNLOCK(lock)
270 
271 #define DEBUG_THREADS_PRINTF(...)
272 #define DEBUG_PERF_PRINTF(...)
273 
274 /** Profile Types*/
275 #define BASE_PROFILE_IDC    66
276 #define MAIN_PROFILE_IDC    77
277 #define EXTENDED_PROFILE_IDC    88
278 #define HIGH_PROFILE_IDC   100
279 
280 
281 #define MB_SIZE             16
282 #define BLK8x8SIZE           8
283 #define BLK_SIZE             4
284 #define NUM_BLKS_PER_MB     24
285 #define NUM_LUM_BLKS_PER_MB 16
286 #define LUM_BLK              0
287 #define CHROM_BLK            1
288 #define NUM_PELS_IN_MB      64
289 
290 /* Level Types */
291 #define H264_LEVEL_1_0     10
292 #define H264_LEVEL_1_1     11
293 #define H264_LEVEL_1_2     12
294 #define H264_LEVEL_1_3     13
295 #define H264_LEVEL_2_0     20
296 #define H264_LEVEL_2_1     21
297 #define H264_LEVEL_2_2     22
298 #define H264_LEVEL_3_0     30
299 #define H264_LEVEL_3_1     31
300 #define H264_LEVEL_3_2     32
301 #define H264_LEVEL_4_0     40
302 #define H264_LEVEL_4_1     41
303 #define H264_LEVEL_4_2     42
304 #define H264_LEVEL_5_0     50
305 #define H264_LEVEL_5_1     51
306 
307 #define MAX_MBS_LEVEL_51 36864
308 #define MAX_MBS_LEVEL_50 22080
309 #define MAX_MBS_LEVEL_42 8704
310 #define MAX_MBS_LEVEL_41 8192
311 #define MAX_MBS_LEVEL_40 8192
312 #define MAX_MBS_LEVEL_32 5120
313 #define MAX_MBS_LEVEL_31 3600
314 #define MAX_MBS_LEVEL_30 1620
315 #define MAX_MBS_LEVEL_22 1620
316 #define MAX_MBS_LEVEL_21 792
317 #define MAX_MBS_LEVEL_20 396
318 #define MAX_MBS_LEVEL_13 396
319 #define MAX_MBS_LEVEL_12 396
320 #define MAX_MBS_LEVEL_11 396
321 #define MAX_MBS_LEVEL_10 99
322 
323 /** NAL Types */
324 #define SLICE_NAL                       1
325 #define SLICE_DATA_PARTITION_A_NAL      2
326 #define SLICE_DATA_PARTITION_B_NAL      3
327 #define SLICE_DATA_PARTITION_C_NAL      4
328 #define IDR_SLICE_NAL                   5
329 #define SEI_NAL                         6
330 #define SEQ_PARAM_NAL                   7
331 #define PIC_PARAM_NAL                   8
332 #define ACCESS_UNIT_DELIMITER_RBSP      9
333 #define END_OF_SEQ_RBSP                 10
334 #define END_OF_STREAM_RBSP              11
335 #define FILLER_DATA_NAL                 12
336 
337 /** Entropy coding modes */
338 #define CAVLC  0
339 #define CABAC  1
340 
341 /** Picture Types */
342 #define I_PIC       0
343 #define IP_PIC      1
344 #define IPB_PIC     2
345 #define SI_PIC      3
346 #define SIP_PIC     4
347 #define ISI_PIC     5
348 #define ISI_PSP_PIC 6
349 #define ALL_PIC     7
350 
351 /* Frame or field picture type */
352 #define FRM_PIC         0x00
353 #define TOP_FLD         0x01
354 #define BOT_FLD         0x02
355 #define COMP_FLD_PAIR   0x03 /* TOP_FLD | BOT_FLD */
356 #define AFRM_PIC        0x04
357 #define TOP_REF         0x08
358 #define BOT_REF         0x10
359 #define PIC_MASK        0x03
360 #define NON_EXISTING    0xff
361 
362 /* field picture type for display */
363 #define DISP_TOP_FLD    0x00
364 #define DISP_BOT_FLD    0x01
365 
366 /** Slice Types */
367 #define NA_SLICE -1
368 #define P_SLICE  0
369 #define B_SLICE  1
370 #define I_SLICE  2
371 #define SP_SLICE 3
372 #define SI_SLICE 4
373 
374 /* Definition for picture skip */
375 #define SKIP_NONE  (0x0)
376 #define I_SLC_BIT  (0x1)
377 #define P_SLC_BIT  (0x2)
378 #define B_SLC_BIT  (0x4)
379 
380 /** Macros used for Deblocking */
381 #define D_INTER_MB        0
382 #define D_INTRA_MB        1
383 #define D_PRED_NON_16x16  2
384 #define D_B_SLICE         4
385 #define D_B_SUBMB         6 //D_B_SLICE | D_PRED_NON_16x16 | D_INTER_MB
386 #define D_FLD_MB          0x80
387 
388 /** Macros for Cabac checks */
389 /** MbType */
390 /** |x|x|I_PCM|SKIP|
391  |S|Inter/Intra|P/B|NON-BD16x16/BD16x16,I16x16/I4x4| */
392 #define CAB_INTRA         0x00 /* 0000 00xx */
393 #define CAB_INTER         0x04 /* 0000 01xx */
394 #define CAB_I4x4          0x00 /* 0000 00x0 */
395 #define CAB_I16x16        0x01 /* 0000 00x1 */
396 #define CAB_BD16x16       0x04 /* 0000 0100 */
397 #define CAB_NON_BD16x16   0x05 /* 0000 0101 */
398 #define CAB_P             0x07 /* 0000 0111 */
399 #define CAB_SI4x4         0x08 /* 0000 10x0 */
400 #define CAB_SI16x16       0x09 /* 0000 10x1 */
401 #define CAB_SKIP_MASK     0x10 /* 0001 0000 */
402 #define CAB_SKIP          0x10 /* 0001 0000 */
403 #define CAB_P_SKIP        0x16 /* 0001 x11x */
404 #define CAB_B_SKIP        0x14 /* 0001 x100 */
405 #define CAB_BD16x16_MASK  0x07 /* 0000 0111 */
406 #define CAB_INTRA_MASK    0x04 /* 0000 0100 */
407 #define CAB_I_PCM         0x20 /* 001x xxxx */
408 
409 /**< Binarization types for CABAC */
410 /* |x|x|x|x|MSB_FIRST_FLC|FLC|TUNARY|UNARY| */
411 #define UNARY           1
412 #define TUNARY          2
413 #define FLC             4
414 #define MSB_FIRST_FLC   12
415 
416 /** Macroblock Types */
417 #define I_4x4_MB    0
418 #define I_16x16_MB  1
419 #define P_MB        2
420 #define B_MB        3
421 #define SI_MB       4
422 #define SP_MB       5
423 #define I_PCM_MB    6
424 
425 #define SI4x4_MB 0xFF
426 
427 /** Intra luma 16x16 and chroma 8x8 prediction modes */
428 #define NUM_INTRA_PRED_MODES  4
429 #define VERT    0
430 #define HORIZ   1
431 #define DC      2
432 #define PLANE   3
433 #define NOT_VALID -1
434 #define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
435 
436 /** Intra luma 4x4 prediction modes */
437 #define NUM_INTRA4x4_PRED_MODES 9
438 
439 /** VERT, HORIZ, DC are applicable to 4x4 as well */
440 /** D - Down; U - Up; L - Left; R - Right */
441 #define DIAG_DL   3
442 #define DIAG_DR   4
443 #define VERT_R    5
444 #define HORIZ_D   6
445 #define VERT_L    7
446 #define HORIZ_U   8
447 
448 /** P_MB prediction modes */
449 #define NUM_INTER_MB_PRED_MODES 5
450 #define PRED_16x16  0
451 #define PRED_16x8   1
452 #define PRED_8x16   2
453 #define PRED_8x8    3
454 #define PRED_8x8R0  4
455 #define MAGIC_16x16 5
456 #define MB_SKIP     255
457 
458 /* P_MB submb modes */
459 #define P_L0_8x8    0
460 #define P_L0_8x4    1
461 #define P_L0_4x8    2
462 #define P_L0_4x4    3
463 
464 /* B_MB submb modes */
465 #define B_DIRECT_8x8    0
466 #define B_L0_8x8        1
467 #define B_L1_8x8        2
468 #define B_BI_8x8        3
469 #define B_L0_8x4        4
470 #define B_L0_4x8        5
471 #define B_L1_8x4        6
472 #define B_L1_4x8        7
473 #define B_BI_8x4        8
474 #define B_BI_4x8        9
475 #define B_L0_4x4        10
476 #define B_L1_4x4        11
477 #define B_BI_4x4        12
478 
479 /** B_MB prediction modes */
480 #define B_8x8    22
481 #define PRED_INVALID  -1
482 #define B_DIRECT  0
483 #define PRED_L0   1
484 #define PRED_L1   2
485 #define BI_PRED   3
486 #define B_DIRECT_BI_PRED  23
487 #define B_DIRECT_PRED_L0  24
488 #define B_DIRECT_PRED_L1  25
489 #define B_DIRECT_SPATIAL  26
490 
491 #define B_DIRECT8x8_BI_PRED  13
492 #define B_DIRECT8x8_PRED_L0  14
493 #define B_DIRECT8x8_PRED_L1  15
494 
495 #define ONE_TO_ONE  0
496 #define FRM_TO_FLD  1
497 #define FLD_TO_FRM  2
498 
499 /** Inter Sub MB Pred modes */
500 #define NUM_INTER_SUBMB_PRED_MODES 4
501 #define SUBMB_8x8    0
502 #define SUBMB_8x4    1
503 #define SUBMB_4x8    2
504 #define SUBMB_4x4    3
505 
506 /** Coded Block Pattern - Chroma */
507 #define CBPC_ALLZERO    0
508 #define CBPC_ACZERO     1
509 #define CBPC_NONZERO    2
510 
511 /** Index for accessing the left MB in the MV predictor array */
512 #define LEFT  0
513 /** Index for accessing the top MB in the MV predictor array */
514 #define TOP   1
515 /** Index for accessing the top right MB in the MV predictor array */
516 #define TOP_R 2
517 /** Index for accessing the top Left MB in the MV predictor array */
518 #define TOP_L 3
519 
520 /** Maximum number of Sequence Parameter sets */
521 #define MAX_NUM_SEQ_PARAMS 32
522 
523 /** Maximum number of Picture Parameter sets */
524 #define MAX_NUM_PIC_PARAMS 256
525 
526 #define MASK_ERR_SEQ_SET_ID   (0xFFFFFFE0)
527 #define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
528 
529 #define MAX_PIC_ORDER_CNT_TYPE    2
530 
531 #define MAX_BITS_IN_FRAME_NUM     16
532 #define MAX_BITS_IN_POC_LSB       16
533 
534 #define H264_MAX_REF_PICS         16
535 #define H264_MAX_REF_IDX          32
536 #define MAX_WEIGHT_BIPRED_IDC     2
537 #define MAX_CABAC_INIT_IDC        2
538 
539 #define H264_DEFAULT_NUM_CORES 1
540 #define DEFAULT_SEPARATE_PARSE (H264_DEFAULT_NUM_CORES == 2)? 1 :0
541 
542 /** Maximum number of Slice groups */
543 #define MAX_NUM_SLICE_GROUPS 8
544 #define MAX_NUM_REF_FRAMES_OFFSET 255
545 
546 /** Deblocking modes for a slice */
547 #define SLICE_BOUNDARY_DBLK_DISABLED  2
548 #define DBLK_DISABLED                 1
549 #define DBLK_ENABLED                  0
550 #define MIN_DBLK_FIL_OFF              -12
551 #define MAX_DBLK_FIL_OFF              12
552 
553 /** Width of the predictor buffers used for MC */
554 #define MB_SIZE             16
555 #define BLK8x8SIZE          8
556 #define BLK_SIZE             4
557 #define NUM_BLKS_PER_MB     24
558 #define NUM_LUM_BLKS_PER_MB 16
559 
560 #define SUB_BLK_WIDTH                 4
561 #define SUB_SUB_BLK_SIZE              4 /* 2x2 pixel i4_size */
562 #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
563 #define MB_LUM_SIZE                   256
564 #define MB_CHROM_SIZE                 64
565 
566 /**< Width to pad the luminance frame buff    */
567 /**< Height to pad the luminance frame buff   */
568 /**< Width to pad the chrominance frame buff  */
569 /**< Height to pad the chrominance frame buff */
570 
571 #define PAD_LEN_Y_H                   32
572 #define PAD_LEN_Y_V                   20
573 #define PAD_LEN_UV_H                  16
574 #define PAD_LEN_UV_V                  8
575 
576 #define PAD_MV_BANK_ROW             64
577 
578 /**< Maimum u4_ofst by which the Mvs could point outside the frame buffers
579  horizontally in the left and vertically in the top direction */
580 #define MAX_OFFSET_OUTSIDE_X_FRM      -20
581 #define MAX_OFFSET_OUTSIDE_Y_FRM      -20
582 #define MAX_OFFSET_OUTSIDE_UV_FRM     -8
583 
584 /** UVLC parsing macros */
585 #define   UEV     1
586 #define   SEV     2
587 #define   TEV     3
588 
589 /** Defines for Boolean values */
590 #ifndef TRUE
591 #define TRUE    1
592 #define FALSE   0
593 #endif
594 
595 #define UNUSED_FOR_REF 0
596 #define IS_SHORT_TERM  1
597 #define IS_LONG_TERM   2
598 
599 /** Defines for which field gets displayed first */
600 #define MAX_FRAMES              16
601 #define INVALID_FRAME_NUM       0x0fffffff
602 #define DO_NOT_DISP             254
603 #define DISP_FLD_FIRST_UNDEF  0
604 #define DISP_TOP_FLD_FIRST   1
605 #define DISP_BOT_FLD_FIRST   2
606 
607 /** Misc error resilience requirements*/
608 #define MAX_LOG2_WEIGHT_DENOM       7
609 #define PRED_WEIGHT_MIN             (-128)
610 #define PRED_WEIGHT_MAX             127
611 #define MAX_REDUNDANT_PIC_CNT       127
612 
613 
614 
615 #endif //DEBLOCK_THREAD
616 
617 #define NUM_COEFFS_IN_4x4BLK 16
618 #define CABAC_BITS_TO_READ 23
619 
620 #define DISPLAY_PRIMARIES_X_UPPER_LIMIT                37000
621 #define DISPLAY_PRIMARIES_X_LOWER_LIMIT                5
622 #define DISPLAY_PRIMARIES_X_DIVISION_FACTOR            5
623 
624 #define DISPLAY_PRIMARIES_Y_UPPER_LIMIT                42000
625 #define DISPLAY_PRIMARIES_Y_LOWER_LIMIT                5
626 #define DISPLAY_PRIMARIES_Y_DIVISION_FACTOR            5
627 
628 #define WHITE_POINT_X_UPPER_LIMIT                      37000
629 #define WHITE_POINT_X_LOWER_LIMIT                      5
630 #define WHITE_POINT_X_DIVISION_FACTOR                  5
631 
632 #define WHITE_POINT_Y_UPPER_LIMIT                      42000
633 #define WHITE_POINT_Y_LOWER_LIMIT                      5
634 #define WHITE_POINT_Y_DIVISION_FACTOR                  5
635 
636 #define MAX_DISPLAY_MASTERING_LUMINANCE_UPPER_LIMIT        100000000
637 #define MAX_DISPLAY_MASTERING_LUMINANCE_LOWER_LIMIT        50000
638 #define MAX_DISPLAY_MASTERING_LUMINANCE_DIVISION_FACTOR    10000
639 
640 #define MIN_DISPLAY_MASTERING_LUMINANCE_UPPER_LIMIT        50000
641 #define MIN_DISPLAY_MASTERING_LUMINANCE_LOWER_LIMIT        1
642 
643 #define AMBIENT_LIGHT_X_UPPER_LIMIT        50000
644 #define AMBIENT_LIGHT_Y_UPPER_LIMIT        50000
645 
646 #define CCV_PRIMARIES_X_UPPER_LIMIT        5000000
647 #define CCV_PRIMARIES_X_LOWER_LIMIT        -5000000
648 #define CCV_PRIMARIES_Y_UPPER_LIMIT        5000000
649 #define CCV_PRIMARIES_Y_LOWER_LIMIT        -5000000
650 
651 
652 #define MEMSET_16BYTES(pu4_start,value)                         \
653 {                                                               \
654     memset(pu4_start,value,16);                                 \
655 }
656 
657 #define MEMCPY_16BYTES(dst,src)                                 \
658 {                                                               \
659     memcpy(dst,src,16);                                         \
660 }
661 
662 
663 #endif /*_IH264D_DEFS_H_*/
664