source: 3DVCSoftware/branches/HTM-8.0-dev0/source/Lib/TLibCommon/TypeDef.h @ 618

Last change on this file since 618 was 618, checked in by tech, 12 years ago

Incorporated:

  • MV-HEVC 5 HLS
  • Cleanups
  • Further ENC_DEC trace functionalities.
  • Update cfg files.
  • Property svn:eol-style set to native
File size: 31.9 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license. 
5 *
6 * Copyright (c) 2010-2013, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/** \file     TypeDef.h
35    \brief    Define basic types, new types and enumerations
36*/
37
38#ifndef _TYPEDEF__
39#define _TYPEDEF__
40
41//! \ingroup TLibCommon
42//! \{
43/////////////////////////////////////////////////////////////////////////////////////////
44///////////////////////////////// EXTENSION SELECTION /////////////////////////////////// 
45/////////////////////////////////////////////////////////////////////////////////////////
46
47/* HEVC_EXT might be defined by compiler/makefile options.
48   
49   Linux makefiles support the following settings:   
50   make             -> HEVC_EXT not defined   
51   make HEVC_EXT=0  -> H_MV=0 H_3D=0   --> plain HM
52   make HEVC_EXT=1  -> H_MV=1 H_3D=0   --> MV only
53   make HEVC_EXT=2  -> H_MV=1 H_3D=1   --> full 3D
54*/
55
56#ifndef HEVC_EXT
57#define HEVC_EXT                    2
58#endif
59
60#if ( HEVC_EXT < 0 )||( HEVC_EXT > 2 )
61#error HEVC_EXT must be in the range of 0 to 2, inclusive.
62#endif
63
64#define H_MV          ( HEVC_EXT != 0)
65#define H_3D          ( HEVC_EXT == 2)
66
67/////////////////////////////////////////////////////////////////////////////////////////
68///////////////////////////////////   MAJOR DEFINES   /////////////////////////////////// 
69/////////////////////////////////////////////////////////////////////////////////////////
70#if H_MV
71#define H_MV_ENC_DEC_TRAC                 1  //< CU/PU level tracking
72#define H_MV5                             1
73#endif
74
75#if H_3D
76#define H_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
77                                              // HHI_QTLPC_RAU_OFF_C0160     // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
78
79#define H_3D_VSO                          1   // VSO, View synthesis optimization, includes:
80                                              // HHI_VSO
81                                              // HHI_VSO_LS_TABLE_M23714 enable table base Lagrange multiplier optimization
82                                              // SAIT_VSO_EST_A0033, JCT3V-A0033 modification 3
83                                              // LGE_WVSO_A0119
84#define H_3D_NBDV                         1   // Neighboring block disparity derivation
85                                              // QC_JCT3V-A0097
86                                              // LGE_DVMCP_A0126
87                                              // LGE_DVMCP_MEM_REDUCTION_B0135     
88                                              // QC_SIMPLE_NBDV_B0047
89                                              // FIX_LGE_DVMCP_B0133
90                                              // QC_NBDV_LDB_FIX_C0055
91                                              // MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097
92                                              // MTK_SIMPLIFY_DVTC_C0135           
93                                              // QC_CU_NBDV_D0181
94                                              // SEC_DEFAULT_DV_D0112
95                                              // MTK_DVMCP_FIX_E0172               1 // fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172
96#define H_3D_ARP                          1   // Advanced residual prediction (ARP), JCT3V-D0177
97#define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
98                                              // Unifying rounding offset, for IC part, JCT3V-D0135
99                                              // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC
100
101#if H_3D_NBDV
102#define H_3D_NBDV_REF                     1   // Depth oriented neighboring block disparity derivation
103                                              // MTK_D0156
104                                              // MERL_D0166: Reference view selection in NBDV & Bi-VSP
105                                              // MERL_C0152: Basic VSP
106#endif
107
108#define H_3D_VSP                          1   // View synthesis prediction
109                                              // MERL_C0152: Basic VSP
110                                              // MERL_D0166: Reference view selection in NBDV & Bi-VSP
111                                              // MTK_D0105, LG_D0139: No VSP for depth
112                                              // QC_D0191: Clean up
113                                              // LG_D0092: Multiple VSP candidate allowed
114                                              // MTK_VSP_FIX_ALIGN_WD_E0172
115#define H_3D_IV_MERGE                     1   // Inter-view motion merge candidate
116                                              // HHI_INTER_VIEW_MOTION_PRED
117                                              // SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction
118                                              // QC_MRG_CANS_B0048             , JCT3V-B0048, B0086, B0069
119                                              // OL_DISMV_POS_B0069            , different pos for disparity MV candidate, B0069
120                                              // MTK_INTERVIEW_MERGE_A0049     , second part
121                                              // QC_AMVP_MRG_UNIFY_IVCAN_C0051     
122                                              // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
123                                              // QC_INRIA_MTK_MRG_E0126           
124#define H_3D_TMVP                         1   // QC_TMVP_C0047
125                                              // Sony_M23639
126
127#define H_3D_DIM                          1   // DIM, Depth intra modes, includes:
128                                              // HHI_DMM_WEDGE_INTRA
129                                              // HHI_DMM_PRED_TEX
130                                              // FIX_WEDGE_NOFLOAT_D0036
131                                              // LGE_EDGE_INTRA_A0070
132                                              // LGE_DMM3_SIMP_C0044
133                                              // QC_DC_PREDICTOR_D0183
134                                              // HHI_DELTADC_DLT_D0035
135                                              // PKU_QC_DEPTH_INTRA_UNI_D0195
136                                              // RWTH_SDC_DLT_B0036
137                                              // INTEL_SDC64_D0193
138                                              // RWTH_SDC_CTX_SIMPL_D0032
139                                              // LGE_CONCATENATE_D0141
140                                              // FIX_SDC_ENC_RD_WVSO_D0163
141                                              // MTK_SAMPLE_BASED_SDC_D0110
142
143
144
145/////////////////////////////////////////////////////////////////////////////////////////
146///////////////////////////////////   HTM-8.0 INTEGRATIONS //////////////////////////////
147/////////////////////////////////////////////////////////////////////////////////////////
148
149#define SHARP_ILLUCOMP_REFINE_E0046       1
150#define MTK_FAST_TEXTURE_ENCODING_E0173   1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
151#define MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170            1   // Progressive MV Compression, JCT3V-E0170
152#define LGE_INTER_SDC_E0156               1   // Enable inter SDC for depth coding
153
154#if H_3D_IC
155#define MTK_CLIPPING_ALIGN_IC_E0168       1   // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
156#endif
157
158#if H_3D_NBDV
159#define NBDV_DEFAULT_VIEWIDX_BUGFIX       1  // Bug fix for invalid default view index for NBDV
160#define MTK_RVS_BUGFIX_E0172              1  // Bug fix for issues caused by reference view selection, JCT3V-E0172
161#define MTK_TEXTURE_MRGCAND_BUGFIX_E0182  1  // Bug fix for TEXTURE MERGING CANDIDATE     , JCT3V-E0182
162
163#if MTK_RVS_BUGFIX_E0172
164#define MTK_DIVMC_FIX_E0172               1 // fix the issue of derivation of disparity inter-view merge candidate, issue 5 in JCT3V-E0172
165#define MTK_NBDV_TN_FIX_E0172             1 // fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172
166#endif // MTK_RVS_BUGFIX_E0172
167
168#if H_3D_NBDV_REF
169#define NTT_DoNBDV_VECTOR_CLIP_E0141      1   // disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209
170#define SEC_SIMPLIFIED_NBDV_E0142         1   // Simplified NBDV, JCT3V-E0142 and JCT3V-E0190
171#endif
172#endif // H_3D_NBDV
173
174#if H_3D_DIM
175#define SEC_DMM2_E0146_HHIFIX             1   // Removal of DMM2 from DMMs
176#define ZJU_DEPTH_INTRA_MODE_E0204        1   // Simplified Binarization for depth_intra_mode
177#define KWU_SDC_SIMPLE_DC_E0117           1   // Simplified DC calculation for SDC
178#define SCU_HS_DMM4_REMOVE_DIV_E0242      1   // DMM4 Division Removal
179#define SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX     1   // Fast DMM and RBC Mode Selection
180#endif
181
182#if H_3D_VSP
183#define NTT_VSP_COMMON_E0207_E0208        1 // common part of JCT3V-E0207 and JCT3V-E0208
184#if NTT_VSP_COMMON_E0207_E0208
185#define NTT_VSP_DC_BUGFIX_E0208           1 // bugfix for sub-PU based DC in VSP, JCT3V-E0208
186#define NTT_VSP_VECTOR_CLIP_E0208         1 // disparity vector clipping on fetching depth map in VSP, JCT3V-E0208
187#define NTT_VSP_ADAPTIVE_SPLIT_E0207      1 // adaptive sub-PU partitioning in VSP, JCT3V-E0207
188#endif
189#endif
190
191#define H_3D_REN_MAX_DEV_OUT              0  // Output maximal possible shift deviation
192
193/// FIXES
194#define H_3D_FIX_BVSP                     1  // DV from NBDV instead of DoNBDV should be used
195#define H_3D_FIX_TICKET_036               1  // fix for ticket #36
196#define H_3D_FIX_REN                      1  // fix of erroneous inpainting for renderer
197#define H_3D_FIX_REN_WARNING              1  // fix of warning related to camera parameter precision
198
199#define H_3D_FIX_UINT_WARNING             1  // explicit in VSD
200#endif // H_3D
201
202
203/////////////////////////////////////////////////////////////////////////////////////////
204///////////////////////////////////   HTM-8.1 INTEGRATIONS //////////////////////////////
205/////////////////////////////////////////////////////////////////////////////////////////
206
207// Please put HTM-8.1 Integration defines here, when possible
208
209
210/// FIXES
211#define H_MV_FIX_LID_PIC_HASH_SEI_T40                      1   // Fix wrong layer_id in decoded picture hash SEI
212
213/////////////////////////////////////////////////////////////////////////////////////////
214///////////////////////////////////   DERIVED DEFINES /////////////////////////////////// 
215/////////////////////////////////////////////////////////////////////////////////////////
216
217///// ***** VIEW SYNTHESIS OPTIMIZAION *********
218#if H_3D_VSO                                 
219#define H_3D_VSO_DIST_INT                 1   // Allow negative synthesized view distortion change
220#define H_3D_VSO_COLOR_PLANES             1   // Compute VSO distortion on color planes
221#define H_3D_VSO_EARLY_SKIP               1   // LGE_VSO_EARLY_SKIP_A0093, A0093 modification 4
222#define H_3D_VSO_RM_ASSERTIONS            0   // Output VSO assertions
223#define H_3D_VSO_SYNTH_DIST_OUT           0   // Output of synthesized view distortion instead of depth distortion in encoder output
224
225#define H_3D_VSO_FIX                      0   // This fix should be enabled after verification
226
227#endif
228////   ****** Neighbouring block-based Disparity Vector  *********
229#if H_3D_NBDV
230#if SEC_SIMPLIFIED_NBDV_E0142
231#define DVFROM_LEFT                       0
232#define DVFROM_ABOVE                      1
233#define IDV_CANDS                         2
234#else
235#define DVFROM_LEFTBELOW                  0
236#define DVFROM_LEFT                       1
237#define DVFROM_ABOVERIGHT                 2
238#define DVFROM_ABOVE                      3
239#define DVFROM_ABOVELEFT                  4
240#define IDV_CANDS                         5
241#endif
242#endif
243
244///// ***** ADVANCED INTERVIEW RESIDUAL PREDICTION *********
245#if H_3D_ARP
246#define H_3D_ARP_WFNR                     3
247#endif
248///// ***** DEPTH INTRA MODES *********
249#if H_3D_DIM
250#define H_3D_DIM_DMM                      1   // Depth Modeling Modes
251#define H_3D_DIM_RBC                      1   // Region Boundary Chain mode
252#define H_3D_DIM_SDC                      1   // Simplified Depth Coding method
253#define H_3D_DIM_DLT                      1   // Depth Lookup Table
254#define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
255                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
256                                              // LG_ZEROINTRADEPTHRESI_A0087
257#if H_3D_DIM_SDC
258#define LGE_SDC_REMOVE_DC_E0158           1   // Removal of DC mode from SDC
259#endif
260#if H_3D_DIM_DMM
261#define LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   // Removal of overlap between DMM3 and DMM1
262#endif
263#endif
264
265///// ***** VIEW SYNTHESIS PREDICTION *********
266#if H_3D_VSP
267#define H_3D_VSP_BLOCKSIZE                4   // Supported values: 1, 2, and 4
268#if H_3D_VSP_BLOCKSIZE == 1
269#define H_3D_VSP_CONSTRAINED              1   // Constrained VSP @ 1x1
270#else
271#define H_3D_VSP_CONSTRAINED              0
272#endif
273
274#endif
275
276/////////////////////////////////////////////////////////////////////////////////////////
277///////////////////////////////////   HM RELATED DEFINES ////////////////////////////////
278/////////////////////////////////////////////////////////////////////////////////////////
279
280#define FIX1071 1 ///< fix for issue #1071
281
282#define MAX_NUM_PICS_IN_SOP           1024
283
284#define MAX_NESTING_NUM_OPS         1024
285#define MAX_NESTING_NUM_LAYER       64
286
287#define MAX_VPS_NUM_HRD_PARAMETERS                1
288#define MAX_VPS_OP_SETS_PLUS1                     1024
289#if H_MV
290#define MAX_VPS_NUH_LAYER_ID_PLUS1  64
291#define MAX_NUM_SCALABILITY_TYPES   16
292#define ENC_CFG_CONSOUT_SPACE       29           
293#else
294#define MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1  1
295#endif
296
297#define RATE_CONTROL_LAMBDA_DOMAIN                  1  ///< JCTVC-K0103, rate control by R-lambda model
298#define M0036_RC_IMPROVEMENT                        1  ///< JCTVC-M0036, improvement for R-lambda model based rate control
299#define TICKET_1090_FIX                             1
300
301#define RC_FIX                                      1  /// suggested fix for M0036
302#define RATE_CONTROL_INTRA                          1  ///< JCTVC-M0257, rate control for intra
303
304#define MAX_CPB_CNT                     32  ///< Upper bound of (cpb_cnt_minus1 + 1)
305#define MAX_NUM_LAYER_IDS               64
306#if H_MV
307#define MAX_NUM_LAYERS                  64
308#define MAX_VPS_PROFILE_TIER_LEVEL      64
309#define MAX_VPS_ADD_OUTPUT_LAYER_SETS   1024
310#define MAX_VPS_OUTPUTLAYER_SETS        ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 )
311#endif
312
313#define COEF_REMAIN_BIN_REDUCTION        3 ///< indicates the level at which the VLC
314                                           ///< transitions from Golomb-Rice to TU+EG(k)
315
316#define CU_DQP_TU_CMAX 5                   ///< max number bins for truncated unary
317#define CU_DQP_EG_k 0                      ///< expgolomb order
318
319#define SBH_THRESHOLD                    4  ///< I0156: value of the fixed SBH controlling threshold
320 
321#define SEQUENCE_LEVEL_LOSSLESS           0  ///< H0530: used only for sequence or frame-level lossless coding
322
323#define DISABLING_CLIP_FOR_BIPREDME         1  ///< Ticket #175
324 
325#define C1FLAG_NUMBER               8 // maximum number of largerThan1 flag coded in one chunk :  16 in HM5
326#define C2FLAG_NUMBER               1 // maximum number of largerThan2 flag coded in one chunk:  16 in HM5
327
328#define REMOVE_SAO_LCU_ENC_CONSTRAINTS_3 1  ///< disable the encoder constraint that conditionally disable SAO for chroma for entire slice in interleaved mode
329
330#define SAO_ENCODING_CHOICE              1  ///< I0184: picture early termination
331#if SAO_ENCODING_CHOICE
332#define SAO_ENCODING_RATE                0.75
333#define SAO_ENCODING_CHOICE_CHROMA       1 ///< J0044: picture early termination Luma and Chroma are handled separately
334#if SAO_ENCODING_CHOICE_CHROMA
335#define SAO_ENCODING_RATE_CHROMA         0.5
336#endif
337#endif
338
339#define MAX_NUM_VPS                16
340#define MAX_NUM_SPS                16
341#define MAX_NUM_PPS                64
342
343
344
345#define WEIGHTED_CHROMA_DISTORTION  1   ///< F386: weighting of chroma for RDO
346#define RDOQ_CHROMA_LAMBDA          1   ///< F386: weighting of chroma for RDOQ
347#define SAO_CHROMA_LAMBDA           1   ///< F386: weighting of chroma for SAO
348
349#define MIN_SCAN_POS_CROSS          4
350
351#define FAST_BIT_EST                1   ///< G763: Table-based bit estimation for CABAC
352
353#define MLS_GRP_NUM                         64     ///< G644 : Max number of coefficient groups, max(16, 64)
354#define MLS_CG_SIZE                         4      ///< G644 : Coefficient group size of 4x4
355
356#define ADAPTIVE_QP_SELECTION               1      ///< G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection
357#if ADAPTIVE_QP_SELECTION
358#define ARL_C_PRECISION                     7      ///< G382: 7-bit arithmetic precision
359#define LEVEL_RANGE                         30     ///< G382: max coefficient level in statistics collection
360#endif
361
362#define NS_HAD                               0
363
364#define HHI_RQT_INTRA_SPEEDUP             1           ///< tests one best mode with full rqt
365#define HHI_RQT_INTRA_SPEEDUP_MOD         0           ///< tests two best modes with full rqt
366
367#if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP
368#error
369#endif
370
371#define VERBOSE_RATE 0 ///< Print additional rate information in encoder
372
373#define AMVP_DECIMATION_FACTOR            4
374
375#define SCAN_SET_SIZE                     16
376#define LOG2_SCAN_SET_SIZE                4
377
378#define FAST_UDI_MAX_RDMODE_NUM               35          ///< maximum number of RD comparison in fast-UDI estimation loop
379
380#define ZERO_MVD_EST                          0           ///< Zero Mvd Estimation in normal mode
381
382#define NUM_INTRA_MODE 36
383#if !REMOVE_LM_CHROMA
384#define LM_CHROMA_IDX  35
385#endif
386
387#define WRITE_BACK                      1           ///< Enable/disable the encoder to replace the deltaPOC and Used by current from the config file with the values derived by the refIdc parameter.
388#define AUTO_INTER_RPS                  1           ///< Enable/disable the automatic generation of refIdc from the deltaPOC and Used by current from the config file.
389#define PRINT_RPS_INFO                  0           ///< Enable/disable the printing of bits used to send the RPS.
390                                                    // using one nearest frame as reference frame, and the other frames are high quality (POC%4==0) frames (1+X)
391                                                    // this should be done with encoder only decision
392                                                    // but because of the absence of reference frame management, the related code was hard coded currently
393
394#define RVM_VCEGAM10_M 4
395
396#define PLANAR_IDX             0
397#define VER_IDX                26                    // index for intra VERTICAL   mode
398#define HOR_IDX                10                    // index for intra HORIZONTAL mode
399#define DC_IDX                 1                     // index for intra DC mode
400#define NUM_CHROMA_MODE        5                     // total number of chroma modes
401#define DM_CHROMA_IDX          36                    // chroma mode index for derived from luma intra mode
402
403
404#define FAST_UDI_USE_MPM 1
405
406#define RDO_WITHOUT_DQP_BITS              0           ///< Disable counting dQP bits in RDO-based mode decision
407
408#define FULL_NBIT 0 ///< When enabled, compute costs using full sample bitdepth.  When disabled, compute costs as if it is 8-bit source video.
409#if FULL_NBIT
410# define DISTORTION_PRECISION_ADJUSTMENT(x) 0
411#else
412# define DISTORTION_PRECISION_ADJUSTMENT(x) (x)
413#endif
414
415#define LOG2_MAX_NUM_COLUMNS_MINUS1        7
416#define LOG2_MAX_NUM_ROWS_MINUS1           7
417#define LOG2_MAX_COLUMN_WIDTH              13
418#define LOG2_MAX_ROW_HEIGHT                13
419
420#define MATRIX_MULT                             0   // Brute force matrix multiplication instead of partial butterfly
421
422#define REG_DCT 65535
423
424#define AMP_SAD                               1           ///< dedicated SAD functions for AMP
425#define AMP_ENC_SPEEDUP                       1           ///< encoder only speed-up by AMP mode skipping
426#if AMP_ENC_SPEEDUP
427#define AMP_MRG                               1           ///< encoder only force merge for AMP partition (no motion search for AMP)
428#endif
429
430#define SCALING_LIST_OUTPUT_RESULT    0 //JCTVC-G880/JCTVC-G1016 quantization matrices
431
432#define CABAC_INIT_PRESENT_FLAG     1
433
434// ====================================================================================================================
435// Basic type redefinition
436// ====================================================================================================================
437
438typedef       void                Void;
439typedef       bool                Bool;
440
441typedef       char                Char;
442typedef       unsigned char       UChar;
443typedef       short               Short;
444typedef       unsigned short      UShort;
445typedef       int                 Int;
446typedef       unsigned int        UInt;
447typedef       double              Double;
448typedef       float               Float;
449
450// ====================================================================================================================
451// 64-bit integer type
452// ====================================================================================================================
453
454#ifdef _MSC_VER
455typedef       __int64             Int64;
456
457#if _MSC_VER <= 1200 // MS VC6
458typedef       __int64             UInt64;   // MS VC6 does not support unsigned __int64 to double conversion
459#else
460typedef       unsigned __int64    UInt64;
461#endif
462
463#else
464
465typedef       long long           Int64;
466typedef       unsigned long long  UInt64;
467
468#endif
469
470// ====================================================================================================================
471// Type definition
472// ====================================================================================================================
473
474typedef       UChar           Pxl;        ///< 8-bit pixel type
475typedef       Short           Pel;        ///< 16-bit pixel type
476typedef       Int             TCoeff;     ///< transform coefficient
477
478#if H_3D_VSO
479// ====================================================================================================================
480// Define Distortion Types
481// ====================================================================================================================
482typedef       Int64           RMDist;     ///< renderer model distortion
483
484#if H_3D_VSO_DIST_INT
485#if H_3D_FIX_TICKET_036
486typedef       Int64            Dist;       ///< RDO distortion
487#else
488typedef       Int              Dist;       ///< RDO distortion
489#endif
490typedef       Int64            Dist64; 
491#define       RDO_DIST_MIN     MIN_INT
492#define       RDO_DIST_MAX     MAX_INT
493#else
494typedef       UInt             Dist;       ///< RDO distortion
495typedef       UInt64           Dist; 
496#define       RDO_DIST_MIN     0
497#define       RDO_DIST_MAX     MAX_UINT
498#endif
499#endif
500/// parameters for adaptive loop filter
501class TComPicSym;
502
503// Slice / Slice segment encoding modes
504enum SliceConstraint
505{
506  NO_SLICES              = 0,          ///< don't use slices / slice segments
507  FIXED_NUMBER_OF_LCU    = 1,          ///< Limit maximum number of largest coding tree blocks in a slice / slice segments
508  FIXED_NUMBER_OF_BYTES  = 2,          ///< Limit maximum number of bytes in a slice / slice segment
509  FIXED_NUMBER_OF_TILES  = 3,          ///< slices / slice segments span an integer number of tiles
510};
511
512#define NUM_DOWN_PART 4
513
514enum SAOTypeLen
515{
516  SAO_EO_LEN    = 4, 
517  SAO_BO_LEN    = 4,
518  SAO_MAX_BO_CLASSES = 32
519};
520
521enum SAOType
522{
523  SAO_EO_0 = 0, 
524  SAO_EO_1,
525  SAO_EO_2, 
526  SAO_EO_3,
527  SAO_BO,
528  MAX_NUM_SAO_TYPE
529};
530
531typedef struct _SaoQTPart
532{
533  Int         iBestType;
534  Int         iLength;
535  Int         subTypeIdx ;                 ///< indicates EO class or BO band position
536  Int         iOffset[4];
537  Int         StartCUX;
538  Int         StartCUY;
539  Int         EndCUX;
540  Int         EndCUY;
541
542  Int         PartIdx;
543  Int         PartLevel;
544  Int         PartCol;
545  Int         PartRow;
546
547  Int         DownPartsIdx[NUM_DOWN_PART];
548  Int         UpPartIdx;
549
550  Bool        bSplit;
551
552  //---- encoder only start -----//
553  Bool        bProcessed;
554  Double      dMinCost;
555  Int64       iMinDist;
556  Int         iMinRate;
557  //---- encoder only end -----//
558} SAOQTPart;
559
560typedef struct _SaoLcuParam
561{
562  Bool       mergeUpFlag;
563  Bool       mergeLeftFlag;
564  Int        typeIdx;
565  Int        subTypeIdx;                  ///< indicates EO class or BO band position
566  Int        offset[4];
567  Int        partIdx;
568  Int        partIdxTmp;
569  Int        length;
570} SaoLcuParam;
571
572struct SAOParam
573{
574  Bool       bSaoFlag[2];
575  SAOQTPart* psSaoPart[3];
576  Int        iMaxSplitLevel;
577  Bool         oneUnitFlag[3];
578  SaoLcuParam* saoLcuParam[3];
579  Int          numCuInHeight;
580  Int          numCuInWidth;
581  ~SAOParam();
582};
583
584/// parameters for deblocking filter
585typedef struct _LFCUParam
586{
587  Bool bInternalEdge;                     ///< indicates internal edge
588  Bool bLeftEdge;                         ///< indicates left edge
589  Bool bTopEdge;                          ///< indicates top edge
590} LFCUParam;
591
592// ====================================================================================================================
593// Enumeration
594// ====================================================================================================================
595
596/// supported slice type
597enum SliceType
598{
599  B_SLICE,
600  P_SLICE,
601  I_SLICE
602};
603
604/// chroma formats (according to semantics of chroma_format_idc)
605enum ChromaFormat
606{
607  CHROMA_400  = 0,
608  CHROMA_420  = 1,
609  CHROMA_422  = 2,
610  CHROMA_444  = 3
611};
612
613/// supported partition shape
614enum PartSize
615{
616  SIZE_2Nx2N,           ///< symmetric motion partition,  2Nx2N
617  SIZE_2NxN,            ///< symmetric motion partition,  2Nx N
618  SIZE_Nx2N,            ///< symmetric motion partition,   Nx2N
619  SIZE_NxN,             ///< symmetric motion partition,   Nx N
620  SIZE_2NxnU,           ///< asymmetric motion partition, 2Nx( N/2) + 2Nx(3N/2)
621  SIZE_2NxnD,           ///< asymmetric motion partition, 2Nx(3N/2) + 2Nx( N/2)
622  SIZE_nLx2N,           ///< asymmetric motion partition, ( N/2)x2N + (3N/2)x2N
623  SIZE_nRx2N,           ///< asymmetric motion partition, (3N/2)x2N + ( N/2)x2N
624  SIZE_NONE = 15
625};
626
627/// supported prediction type
628enum PredMode
629{
630  MODE_INTER,           ///< inter-prediction mode
631  MODE_INTRA,           ///< intra-prediction mode
632  MODE_NONE = 15
633};
634
635/// texture component type
636enum TextType
637{
638  TEXT_LUMA,            ///< luma
639  TEXT_CHROMA,          ///< chroma (U+V)
640  TEXT_CHROMA_U,        ///< chroma U
641  TEXT_CHROMA_V,        ///< chroma V
642  TEXT_ALL,             ///< Y+U+V
643  TEXT_NONE = 15
644};
645
646/// reference list index
647enum RefPicList
648{
649  REF_PIC_LIST_0 = 0,   ///< reference list 0
650  REF_PIC_LIST_1 = 1,   ///< reference list 1
651  REF_PIC_LIST_X = 100  ///< special mark
652};
653
654/// distortion function index
655enum DFunc
656{
657  DF_DEFAULT  = 0,
658  DF_SSE      = 1,      ///< general size SSE
659  DF_SSE4     = 2,      ///<   4xM SSE
660  DF_SSE8     = 3,      ///<   8xM SSE
661  DF_SSE16    = 4,      ///<  16xM SSE
662  DF_SSE32    = 5,      ///<  32xM SSE
663  DF_SSE64    = 6,      ///<  64xM SSE
664  DF_SSE16N   = 7,      ///< 16NxM SSE
665 
666  DF_SAD      = 8,      ///< general size SAD
667  DF_SAD4     = 9,      ///<   4xM SAD
668  DF_SAD8     = 10,     ///<   8xM SAD
669  DF_SAD16    = 11,     ///<  16xM SAD
670  DF_SAD32    = 12,     ///<  32xM SAD
671  DF_SAD64    = 13,     ///<  64xM SAD
672  DF_SAD16N   = 14,     ///< 16NxM SAD
673 
674  DF_SADS     = 15,     ///< general size SAD with step
675  DF_SADS4    = 16,     ///<   4xM SAD with step
676  DF_SADS8    = 17,     ///<   8xM SAD with step
677  DF_SADS16   = 18,     ///<  16xM SAD with step
678  DF_SADS32   = 19,     ///<  32xM SAD with step
679  DF_SADS64   = 20,     ///<  64xM SAD with step
680  DF_SADS16N  = 21,     ///< 16NxM SAD with step
681 
682  DF_HADS     = 22,     ///< general size Hadamard with step
683  DF_HADS4    = 23,     ///<   4xM HAD with step
684  DF_HADS8    = 24,     ///<   8xM HAD with step
685  DF_HADS16   = 25,     ///<  16xM HAD with step
686  DF_HADS32   = 26,     ///<  32xM HAD with step
687  DF_HADS64   = 27,     ///<  64xM HAD with step
688  DF_HADS16N  = 28,     ///< 16NxM HAD with step
689#if H_3D_VSO
690  DF_VSD      = 29,      ///< general size VSD
691  DF_VSD4     = 30,      ///<   4xM VSD
692  DF_VSD8     = 31,      ///<   8xM VSD
693  DF_VSD16    = 32,      ///<  16xM VSD
694  DF_VSD32    = 33,      ///<  32xM VSD
695  DF_VSD64    = 34,      ///<  64xM VSD
696  DF_VSD16N   = 35,      ///< 16NxM VSD
697#endif
698
699#if AMP_SAD
700  DF_SAD12    = 43,
701  DF_SAD24    = 44,
702  DF_SAD48    = 45,
703
704  DF_SADS12   = 46,
705  DF_SADS24   = 47,
706  DF_SADS48   = 48,
707
708  DF_SSE_FRAME = 50     ///< Frame-based SSE
709#else
710  DF_SSE_FRAME = 33     ///< Frame-based SSE
711#endif
712};
713
714/// index for SBAC based RD optimization
715enum CI_IDX
716{
717  CI_CURR_BEST = 0,     ///< best mode index
718  CI_NEXT_BEST,         ///< next best index
719  CI_TEMP_BEST,         ///< temporal index
720  CI_CHROMA_INTRA,      ///< chroma intra index
721  CI_QT_TRAFO_TEST,
722  CI_QT_TRAFO_ROOT,
723  CI_NUM,               ///< total number
724};
725
726/// motion vector predictor direction used in AMVP
727enum MVP_DIR
728{
729  MD_LEFT = 0,          ///< MVP of left block
730  MD_ABOVE,             ///< MVP of above block
731  MD_ABOVE_RIGHT,       ///< MVP of above right block
732  MD_BELOW_LEFT,        ///< MVP of below left block
733  MD_ABOVE_LEFT         ///< MVP of above left block
734};
735
736/// coefficient scanning type used in ACS
737enum COEFF_SCAN_TYPE
738{
739  SCAN_DIAG = 0,         ///< up-right diagonal scan
740  SCAN_HOR,              ///< horizontal first scan
741  SCAN_VER               ///< vertical first scan
742};
743
744namespace Profile
745{
746  enum Name
747  {
748    NONE = 0,
749    MAIN = 1,
750    MAIN10 = 2,
751    MAINSTILLPICTURE = 3,
752#if H_MV
753    MAINSTEREO = 4,
754    MAINMULTIVIEW = 5,
755#if H_3D
756    MAIN3D = 6, 
757#endif
758#endif
759  };
760}
761
762namespace Level
763{
764  enum Tier
765  {
766    MAIN = 0,
767    HIGH = 1,
768  };
769
770  enum Name
771  {
772    NONE     = 0,
773    LEVEL1   = 30,
774    LEVEL2   = 60,
775    LEVEL2_1 = 63,
776    LEVEL3   = 90,
777    LEVEL3_1 = 93,
778    LEVEL4   = 120,
779    LEVEL4_1 = 123,
780    LEVEL5   = 150,
781    LEVEL5_1 = 153,
782    LEVEL5_2 = 156,
783    LEVEL6   = 180,
784    LEVEL6_1 = 183,
785    LEVEL6_2 = 186,
786  };
787}
788//! \}
789
790#if H_MV
791/// scalability types
792  enum ScalabilityType
793  {
794#if H_MV5
795#if H_3D
796    DEPTH_ID = 0,   
797#endif   
798    VIEW_ORDER_INDEX  = 1,
799#else
800    VIEW_ID  = 0,
801#if H_3D
802    DEPTH_ID = 1,   
803#endif   
804#endif
805  };
806#endif
807#if H_3D
808  // Renderer
809  enum BlenMod
810  {
811    BLEND_NONE  = -1,
812    BLEND_AVRG  = 0,
813    BLEND_LEFT  = 1,
814    BLEND_RIGHT = 2,
815    BLEND_GEN   =  3
816  };
817
818 
819  enum
820  {
821    VIEWPOS_INVALID = -1,
822    VIEWPOS_LEFT    = 0,
823    VIEWPOS_RIGHT   = 1,
824    VIEWPOS_MERGED  = 2
825  };
826
827
828#endif
829#endif
Note: See TracBrowser for help on using the repository browser.