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