source: 3DVCSoftware/branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon/TypeDef.h @ 277

Last change on this file since 277 was 277, checked in by lg, 12 years ago

Bug fix of JCT3V-C0046

  • Property svn:eol-style set to native
File size: 35.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-2012, 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#define QC_MVHEVC_B0046                   0   //JCT3V-B0046: disable 3DHEVC tools
44#define QC_IV_AS_LT_B0046                 1   //JCT3V-B0046: inter-view reference pictures are treated as long-term pictures
45#define QC_TMVP_IDX_MOD_B0046             1   //JCT3V-B0046: the reference index for temporal merging candidate is set to 0, as defined in HEVC
46#define QC_REM_IDV_B0046                  1   //JCT3V-B0046: removal of IDV NAL unit type
47#define FIX_DEL_NULLPTR                   1
48#define FIX_MISUSE_REFINDEX               1
49#define FIX_FCO_COMP_WARNING              1
50#define DV_V_RESTRICTION_B0037            1   // JCT3V-B0037 disparity vector vertical range restriction
51
52#if !QC_MVHEVC_B0046
53///// ***** FIXES *********
54// A
55#define FIX_POZNAN_CABAC_INIT_FLAG        1
56#define FIX_LG_RESTRICTEDRESPRED_M24766   1
57
58// B
59#define FIX_LGE_IVMP_PARALLEL_MERGE_B0136 1
60#define FIX_RDO_NEGDIST                   1
61#define FIX_DMM_NEG_DIST                  1
62#define FIX_LGE_DVMCP_B0133               1
63
64// 3rd meeting
65#define FIX_DMM_CTX_INIT_C0034            1    // JCT3V-C0034 fix for wrong init type of DMM contexts (UChar instead of Short)
66
67
68// FCO
69#define FLEX_CODING_ORDER_M23723          1
70#if FLEX_CODING_ORDER_M23723
71  #define DISABLE_FCO_FOR_VSO             0 // Optional compile settings to disable VSO with FCO.
72#endif
73
74///// ***** PATCHES *********
75#define TMVP_DEPTH_SWITCH                 1   // JCT3V-B0092 additional encoder option only
76
77///// ***** DEPTH MODELING MODES *********
78#define HHI_DMM_WEDGE_INTRA               1   // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction)
79#define HHI_DMM_PRED_TEX                  1   // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction )
80#define LGE_EDGE_INTRA_A0070              1   // JCT3V-A0070
81#define RWTH_SDC_DLT_B0036                1   // JCT3V-B0036: Simplified Depth Coding + Depth Lookup Table
82#define HHIQC_DMMFASTSEARCH_B0039         1   // JCT3V-B0039: fast Wedgelet search for DMM modes 1 and 3
83#define HHI_DMM_DELTADC_Q1_C0034          1   // JCT3V-C0034: no quantization and fast encoder search for DMM delta DC values
84#if HHIQC_DMMFASTSEARCH_B0039 && HHI_DMM_PRED_TEX
85#define LGE_DMM3_SIMP_C0044               1
86#endif
87
88///// ***** INTERVIEW MOTION VECTOR PREDICTION *********
89#define HHI_INTER_VIEW_MOTION_PRED        1   // inter-view motion parameter prediction
90#define SHARP_INTERVIEW_DECOUPLE_B0111    1   // JCT3V-B0111 decoupling inter-view candidate
91#define QC_MRG_CANS_B0048                 1   // JCT3V-B0048, B0086, B0069
92#if     QC_MRG_CANS_B0048
93#define OL_DISMV_POS_B0069                1   // different pos for disparity MV candidate, B0069
94#endif
95#define MTK_INTERVIEW_MERGE_A0049         1   // JCT3V-A0049 second part
96#if HHI_INTER_VIEW_MOTION_PRED         
97#define SAIT_IMPROV_MOTION_PRED_M24829    1   // improved inter-view motion vector prediction
98#else                                 
99#define SAIT_IMPROV_MOTION_PRED_M24829    0   
100#endif                                 
101
102///// ***** INTERVIEW RESIDUAL PREDICTION *********
103#define HHI_INTER_VIEW_RESIDUAL_PRED      1   // inter-view residual prediction
104#if HHI_INTER_VIEW_RESIDUAL_PRED       
105#define LG_RESTRICTEDRESPRED_M24766       1   // restricted inter-view residual prediction
106#define QC_SIMPLIFIEDIVRP_M24938          1
107#else                                 
108#define LG_RESTRICTEDRESPRED_M24766       0
109#define QC_SIMPLIFIEDIVRP_M24938          0
110#endif
111
112///// ***** DISPARITY VECTOR DERIVATION *********
113#define QC_MULTI_DIS_CAN_A0097            1   // JCT3V-A0097
114#define LGE_DVMCP_A0126                   1   // JCT3V-A0126     
115#define LGE_DVMCP_MEM_REDUCTION_B0135     1   // JCT3V-B0135     
116#define DV_DERIVATION_PARALLEL_B0096      1   // JCT3V-B0096, enable parallel derivation of disparity vector
117#define QC_SIMPLE_NBDV_B0047              1   // JCT3V-B0047
118
119///// ***** MOTION PARAMETER INHERITANCE  *********
120#define HHI_MPI                           1   // motion parameter inheritance from texture picture for depth map coding
121#if HHI_MPI
122#define FIX_MPI_B0065                     1   // JCT3V-B0065, fix the MPI bug when RQT is off
123#endif
124#define MTK_UNCONSTRAINED_MVI_B0083       1    //JCT3V-B0083
125
126///// ***** VIEW SYNTHESIS OPTIMIZAION *********
127#define HHI_VSO                           1
128#define HHI_VSO_LS_TABLE_M23714           1   // m23714, enable table base Lagrange multiplier optimization
129#define HHI_VSO_DIST_INT                  1   // Allow negative synthesized view distortion change
130#define HHI_VSO_COLOR_PLANES              1   // Compute VSO distortion on color planes
131#define HHI_VSO_RM_ASSERTIONS             0   // Output VSO assertions
132#define HHI_VSO_SYNTH_DIST_OUT            0   // Output of synthesized view distortion instead of depth distortion in encoder output
133#define SAIT_VSO_EST_A0033                1   // JCT3V-A0033 modification 3
134#define LGE_VSO_EARLY_SKIP_A0093          1   // JCT3V-A0093 modification 4
135#define LGE_WVSO_A0119                    1   // JCT3V-A0119 & JCT3V-B0131 Depth Metric with a weighted depth fidelity term
136
137
138///// ***** ILLUMINATION COMPENSATON *********
139#define LGE_ILLUCOMP_B0045                1   // JCT2-B0045 Illumination compensation for Luma and Chroma
140#if LGE_ILLUCOMP_B0045
141#define LGE_ILLUCOMP_B0045_ENCSIMP        1
142#define FIX_LGE_ILLUCOMP_B0045            1
143#define LGE_ILLUCOMP_DEPTH_C0046          1   // JCT2-C0046 Apply illumination compensation to depth
144#if LGE_ILLUCOMP_DEPTH_C0046
145#define FIX_ILLUCOMP_DEPTH                1
146#endif
147#endif
148
149///// ***** INTERVIEW SKIP *********
150#define HHI_INTERVIEW_SKIP                1
151
152///// ***** QUADTREE LIMITATION *********
153#define OL_QTLIMIT_PREDCODING_B0068       1    //JCT3V-B0068
154#define HHI_QTLPC_RAU_OFF_C0160           1   // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
155
156///// ***** OTHERS *********
157#define LG_ZEROINTRADEPTHRESI_A0087       1   // JCT2-A0087
158#define SONY_COLPIC_AVAILABILITY          1
159#define HHI_FULL_PEL_DEPTH_MAP_MV_ACC     1   // full-pel mv accuracy for depth maps
160#define VIDYO_VPS_INTEGRATION             1
161#define HHI_DEPTH_INTRA_SEARCH_RAU_C0160  1   // JCT3V-C0160 change 1: full Intra search in depth random access units
162
163
164///// ***** DEFINED PARAMETERS *********
165#if QC_MULTI_DIS_CAN_A0097                   
166#define DIS_CANS                          1
167#endif                                 
168
169#define HHI_INTERVIEW_SKIP_LAMBDA_SCALE   1
170
171#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
172#define DMM_WEDGEMODEL_MIN_SIZE           4
173#define DMM_WEDGEMODEL_MAX_SIZE          32
174#define DMM_WEDGE_PREDDIR_DELTAEND_MAX    4
175#endif
176
177#if LGE_EDGE_INTRA_A0070
178#define LGE_EDGE_INTRA_MIN_SIZE           4
179#define LGE_EDGE_INTRA_MAX_SIZE           32
180#define LGE_EDGE_INTRA_THRESHOLD          20
181#define LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 8
182#define LGE_EDGE_INTRA_DELTA_DC           1
183#define LGE_EDGE_INTRA_PIXEL_DIFFERENCE   1
184#endif
185
186
187#if LGE_DVMCP_A0126                           
188#define DVFROM_LEFTBELOW                  1
189#define DVFROM_LEFT                       2
190#define DVFROM_ABOVERIGHT                 3
191#define DVFROM_ABOVE                      4
192#define DVFROM_ABOVELEFT                  5
193#define DVFROM_COL                        6
194#endif
195
196
197#if HHIQC_DMMFASTSEARCH_B0039
198#define DMM3_SIMPLIFY_TR                  1
199#endif
200
201
202#if RWTH_SDC_DLT_B0036
203#define Log2( n ) ( log((double)n) / log(2.0) )
204#define HS_REFERENCE_SUBSAMPLE_C0154      1
205#endif
206
207#define HHI_MPI_MERGE_POS                 0
208#endif
209///// ***** HM 6.1 *********
210#define SKIPFRAME_BUGFIX                  1 ///< bug fix to enable skipFrame at decoder
211#define START_DECODING_AT_CRA             1 ///< H0496, start decoding at clear random access point
212#define NO_COMBINED_PARALLEL              1 ///< Disallow any combined usage of parallel tools among Tile, EntropySlice and Wavefont
213
214#define LOSSLESS_CODING                   1 ///< H0530: lossless and lossy (mixed) coding
215#if LOSSLESS_CODING
216#define SEQUENCE_LEVEL_LOSSLESS           0 ///< H0530: used only for sequence or frame-level lossless coding
217#endif
218
219#define PARALLEL_MERGE  1                   //< H0082 parallel merge/skip
220#define LGE_IVMP_PARALLEL_MERGE_B0136     1 //< B0136 support of parallel merge/skip in disparity vector derivation
221#define LOG2_PARALLEL_MERGE_LEVEL_MINUS2  0 //< H0082 parallel merge level 0-> 4x4, 1-> 8x8, 2->16x16, 3->32x32, 4->64x64
222
223#if PARALLEL_MERGE && LOG2_PARALLEL_MERGE_LEVEL_MINUS2
224#define CU_BASED_MRG_CAND_LIST            1  //< H0240: single merge candidate list for all PUs inside a 8x8 CU conditioned on LOG2_PARALLEL_MERGE_LEVEL_MINUS2 > 0
225#define FIX_CU_BASED_MRG_CAND_LIST_B0136  1  //< B0136 bug fix for CU_BASED_MRG_CAND_LIST
226#endif
227
228#define MVP_AT_ENTROPYSLICE_BOUNDARY      1  //< H0362 enable motion prediction accross entropy slice boundary
229
230#define FAST_DECISION_FOR_MRG_RD_COST     1  ////< H0178: Fast Decision for Merge 2Nx2N RDCost
231
232#define PIC_CROPPING              1  ///< Picture cropping and size constraints
233#define NAL_REF_FLAG              1  ///< Change nal_ref_idc to nal_ref_flag (JCTVC-F463)
234#define REMOVE_DIV_OPERATION      1  ///< H0238: Simplified intra horizontal and vertical filtering
235#define LOGI_INTRA_NAME_3MPM      1  ///< H0407: logical Intra mode naming (sequential angular mode numbering) and 3 MPM mode coding
236
237#define LEVEL_CTX_LUMA_RED        1  ///<H0130: Luma level context reduction
238#define REMOVE_INFER_SIGGRP       1  ///<H0131: Remove inferred significant_coeff_group_flag
239
240#define SET_MERGE_TMVP_REFIDX     1  ///< H0278/H0199: Setting the merge TMVP refidx to 0 for the non-first partition
241
242#define MULTILEVEL_SIGMAP_EXT     1  ///< H0526: multi-level significance map extended to smaller TUs
243#define MULTIBITS_DATA_HIDING     1  ///< H0481: multiple sign bit hiding
244
245#define DEQUANT_CLIPPING          1  ///< H0312/H0541: transformed coefficients clipping before de-quantization
246
247#define REMOVE_NON_SCALED         1 ///< H0164/H0250: Removal of non-scaled merge candidate
248#define MRG_IDX_CTX_RED           1 ///< H0251: Merge index context reduction
249#define SIMP_MRG_PRUN             1 ///< H0252: simplification of merge pruning process
250
251#define AMVP_PRUNING_SIMPLIFICATION         1     ///H0316: simplify the pruning process of AMVP by exempting the temporal candidate
252#define AMVP_ZERO_CHECKING_REMOVAL          1     ///H0239/H0316: remove zero motion vector checking of AMVP
253
254#define H0111_MVD_L1_ZERO         1  ///< H0111: modification of bi-prediction
255#define DISABLING_CLIP_FOR_BIPREDME         1  ///< Ticket #175
256
257#define CLIPSCALEDMVP               1  ///< H0216: Clipping scaled MV to 16 bit
258
259#define UNIFIED_TRANSFORM_TREE      1   ///< H0123: unified tree structure for TU
260
261#define SIGMAP_CTX_SUBBLOCK       1 ///< H0290: 4x4 sub-block based region for significant_flag context selection
262
263#define SIGMAP_CONST_AT_HIGH_FREQUENCY      1      ///< H0095 method2.1: const significance map at high freaquency
264
265#define LAST_CTX_REDUCTION        1  ///< H0537/H514: contexts reduction for last position coding
266
267#define AMP_CTX                   1 ///<H0545: context reduction for asymmetric partition
268
269#define RESTRICT_GR1GR2FLAG_NUMBER    1 ///< H0554: Throughput improvement of CABAC coefficients level coding
270#if RESTRICT_GR1GR2FLAG_NUMBER    //
271#define C1FLAG_NUMBER               8 // maximum number of largerThan1 flag coded in one chunk :  16 in HM5
272#define C2FLAG_NUMBER               1 // maximum number of largerThan2 flag coded in one chunk:  16 in HM5
273#endif
274
275#define EIGHT_BITS_RICE_CODE        1 ///< H0498 : 8 bits rice codes
276
277#define SAO_UNIT_INTERLEAVING      1   ///< H0273
278#define REMOVE_SAO_LCU_ENC_CONSTRAINTS_1 0  ///< disable the encoder constraint that does not test SAO/BO mode for chroma in interleaved mode
279#define REMOVE_SAO_LCU_ENC_CONSTRAINTS_2 0  ///< disable the encoder constraint that reduce the range of SAO/EO for chroma in interleaved mode
280#define REMOVE_SAO_LCU_ENC_CONSTRAINTS_3 0  ///< disable the encoder constraint that conditionally disable SAO for chroma for entire slice in interleaved mode
281
282#define ALF_SINGLE_FILTER_SHAPE    1     //< !!! H0068: Single filter type : 9x7 cross + 3x3 square
283
284#define ALF_16_BA_GROUPS        1     ///< H0409 16 BA groups
285#define LCU_SYNTAX_ALF          1     ///< H0274 LCU-syntax ALF
286#define ALF_CHROMA_COEF_PRED_HARMONIZATION 1 ///< H0483: ALF chroma coeff pred harmonization
287
288#define CABAC_LINEAR_INIT       1     ///< H0535 : linear CABAC initialization
289
290#define COLLOCATED_REF_IDX      1     ///< H0442: signal collocated reference index
291
292#define UNIFIED_TRANSFORM       1     ///< H0492: unify square and non-square transform
293
294#define MAX_NUM_SPS                32
295#define MAX_NUM_PPS                256
296#define MAX_NUM_APS                32         //< !!!KS: number not defined in WD yet
297
298#define MRG_MAX_NUM_CANDS_SIGNALED         5   //<G091: value of maxNumMergeCand signaled in slice header
299
300#define WEIGHTED_CHROMA_DISTORTION  1   ///< F386: weighting of chroma for RDO
301#define RDOQ_CHROMA_LAMBDA          1   ///< F386: weighting of chroma for RDOQ
302#define ALF_CHROMA_LAMBDA           1   ///< F386: weighting of chroma for ALF
303#define SAO_CHROMA_LAMBDA           1   ///< F386: weighting of chroma for SAO
304
305#define MIN_SCAN_POS_CROSS          4
306
307#define FAST_BIT_EST                1   ///< G763: Table-based bit estimation for CABAC
308
309#define G519_TU_AMP_NSQT_HARMONIZATION  1   ///< G519: Harmonization of implicit TU, AMP and NSQT
310
311#define MLS_GRP_NUM                         64     ///< G644 : Max number of coefficient groups, max(16, 64)
312#define MLS_CG_SIZE                         4      ///< G644 : Coefficient group size of 4x4
313
314#define ADAPTIVE_QP_SELECTION               1      ///< G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection
315#if ADAPTIVE_QP_SELECTION
316#define ARL_C_PRECISION                     7      ///< G382: 7-bit arithmetic precision
317#define LEVEL_RANGE                         30     ///< G382: max coefficient level in statistics collection
318#endif
319
320
321#define CHROMA_MODE_CODING                   1     //H0326/H0475 : 2-length fixed, bypass coding for chroma intra prediction mode
322
323#define NSQT_LFFIX                           1     ///< Bug fix related to NSQT and deblocking filter
324#define NS_HAD                               1
325
326#define APS_BITS_FOR_SAO_BYTE_LENGTH 12
327#define APS_BITS_FOR_ALF_BYTE_LENGTH 8
328
329#define H0736_AVC_STYLE_QP_RANGE             1    ///< H0736: AVC style qp range and wrapping.
330#define H0204_QP_PREDICTION                  1    ///< H0204: improved QP prediction
331
332#define HHI_RQT_INTRA_SPEEDUP             1           ///< tests one best mode with full rqt
333#define HHI_RQT_INTRA_SPEEDUP_MOD         0           ///< tests two best modes with full rqt
334
335#define BURST_IPCM                        1           ///< H0051: Burst IPCM
336
337#if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP
338#error
339#endif
340
341#define H0137_0138_LIST_MODIFICATION      1           // Enabled reference picture lists combination (H0137) and reference picture list modification (H0138) updates
342#if !H0137_0138_LIST_MODIFICATION
343#error "H0137_0138_LIST_MODIFICATION must be enabled for multi-view coding."
344#endif
345
346#define VERBOSE_RATE 0                               ///< Print additional rate information in encoder
347
348#define AMVP_DECIMATION_FACTOR            4
349
350#define SCAN_SET_SIZE                     16
351#define LOG2_SCAN_SET_SIZE                4
352
353#if LGE_EDGE_INTRA_A0070
354#if LGE_EDGE_INTRA_DELTA_DC
355#define FAST_UDI_MAX_RDMODE_NUM               37          ///< maximum number of RD comparison in fast-UDI estimation loop
356#else
357#define FAST_UDI_MAX_RDMODE_NUM               36          ///< maximum number of RD comparison in fast-UDI estimation loop
358#endif
359#else
360#define FAST_UDI_MAX_RDMODE_NUM               35          ///< maximum number of RD comparison in fast-UDI estimation loop
361#endif
362
363#define ZERO_MVD_EST                          0           ///< Zero Mvd Estimation in normal mode
364
365#define NUM_INTRA_MODE 36
366#define LM_CHROMA_IDX  35
367
368#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
369enum MODE_IDX
370{
371  DMM_WEDGE_FULL_IDX         = NUM_INTRA_MODE,
372  DMM_WEDGE_FULL_D_IDX       = NUM_INTRA_MODE+1,
373  DMM_WEDGE_PREDTEX_IDX      = NUM_INTRA_MODE+2,
374  DMM_WEDGE_PREDTEX_D_IDX    = NUM_INTRA_MODE+3,
375  DMM_CONTOUR_PREDTEX_IDX    = NUM_INTRA_MODE+4,
376  DMM_CONTOUR_PREDTEX_D_IDX  = NUM_INTRA_MODE+5,
377  DMM_WEDGE_PREDDIR_IDX      = NUM_INTRA_MODE+6,
378  DMM_WEDGE_PREDDIR_D_IDX    = NUM_INTRA_MODE+7
379};
380#define NUM_DMM_MODE 8
381#elif HHI_DMM_WEDGE_INTRA && !HHI_DMM_PRED_TEX
382enum MODE_IDX
383{
384  DMM_WEDGE_FULL_IDX         = NUM_INTRA_MODE,
385  DMM_WEDGE_FULL_D_IDX       = NUM_INTRA_MODE+1,
386  DMM_WEDGE_PREDDIR_IDX      = NUM_INTRA_MODE+2,
387  DMM_WEDGE_PREDDIR_D_IDX    = NUM_INTRA_MODE+3
388};
389#define NUM_DMM_MODE 4
390#elif !HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
391enum MODE_IDX
392{
393  DMM_WEDGE_PREDTEX_IDX      = NUM_INTRA_MODE,
394  DMM_WEDGE_PREDTEX_D_IDX    = NUM_INTRA_MODE+1,
395  DMM_CONTOUR_PREDTEX_IDX    = NUM_INTRA_MODE+2,
396  DMM_CONTOUR_PREDTEX_D_IDX  = NUM_INTRA_MODE+3,
397};
398#define NUM_DMM_MODE 4
399#endif
400
401#if LGE_EDGE_INTRA_A0070
402#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
403#define EDGE_INTRA_IDX  (NUM_INTRA_MODE+NUM_DMM_MODE)
404#endif // HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
405#if LGE_EDGE_INTRA_DELTA_DC
406#define EDGE_INTRA_DELTA_IDX          (EDGE_INTRA_IDX+1)
407#endif
408#endif // LGE_EDGE_INTRA
409
410#define IBDI_DISTORTION                0           ///< enable/disable SSE modification when IBDI is used (JCTVC-D152)
411#define FIXED_ROUNDING_FRAME_MEMORY    0           ///< enable/disable fixed rounding to 8-bitdepth of frame memory when IBDI is used
412
413#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.
414#define PRINT_RPS_INFO                  0           ///< Enable/disable the printing of bits used to send the RPS.
415                                                    // using one nearest frame as reference frame, and the other frames are high quality (POC%4==0) frames (1+X)
416                                                    // this should be done with encoder only decision
417                                                    // but because of the absence of reference frame management, the related code was hard coded currently
418#define LTRP_MULT                       1           ///< enable/disable multiple long term reference pictures with same POC LSB
419
420#define OL_FLUSH 1          // Set to 1 to enable Wavefront Flush.
421#define OL_FLUSH_ALIGN 0    // Align flush to byte boundary.  This preserves byte operations in CABAC (faster) but at the expense of an average
422                            // of 4 bits per flush.
423                            // Setting to 0 will slow cabac by an as yet unknown amount.
424                            // This is here just to perform timing tests -- OL_FLUSH_ALIGN should be 0 for WPP.
425
426#define RVM_VCEGAM10_M         4
427
428#define PLANAR_IDX             0
429#if LOGI_INTRA_NAME_3MPM
430#define VER_IDX                26                    // index for intra VERTICAL   mode
431#define HOR_IDX                10                    // index for intra HORIZONTAL mode
432#define DC_IDX                 1                     // index for intra DC mode
433#else
434#define DC_IDX                 3                     // index for intra DC mode
435#endif
436#define NUM_CHROMA_MODE        6                     // total number of chroma modes
437#define DM_CHROMA_IDX          36                    // chroma mode index for derived from luma intra mode
438
439
440#define FAST_UDI_USE_MPM 1
441
442#define RDO_WITHOUT_DQP_BITS              0           ///< Disable counting dQP bits in RDO-based mode decision
443
444#define FULL_NBIT 0 ///< When enabled, does not use g_uiBitIncrement anymore to support > 8 bit data
445
446#define FIXED_NUMBER_OF_TILES_SLICE_MODE                1
447#define AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE      1          ///< OPTION IDENTIFIER. mode==1 -> Limit maximum number of largest coding tree blocks in a slice
448#define AD_HOC_SLICES_FIXED_NUMBER_OF_BYTES_IN_SLICE    2          ///< OPTION IDENTIFIER. mode==2 -> Limit maximum number of bins/bits in a slice
449#if FIXED_NUMBER_OF_TILES_SLICE_MODE
450#define AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE    3
451#endif
452
453// Entropy slice options
454#define SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE            1          ///< OPTION IDENTIFIER. Limit maximum number of largest coding tree blocks in an entropy slice
455#define SHARP_MULTIPLE_CONSTRAINT_BASED_ENTROPY_SLICE         2          ///< OPTION IDENTIFIER. Limit maximum number of bins/bits in an entropy slice
456
457#define LOG2_MAX_NUM_COLUMNS_MINUS1        7
458#define LOG2_MAX_NUM_ROWS_MINUS1           7
459#define LOG2_MAX_COLUMN_WIDTH              13
460#define LOG2_MAX_ROW_HEIGHT                13
461
462#define MAX_MARKER_PER_NALU                 1000
463
464#define MATRIX_MULT                             0   // Brute force matrix multiplication instead of partial butterfly
465
466#define REG_DCT 65535
467
468#define AMP_SAD                               1           ///< dedicated SAD functions for AMP
469#define AMP_ENC_SPEEDUP                       1           ///< encoder only speed-up by AMP mode skipping
470#if AMP_ENC_SPEEDUP
471#define AMP_MRG                               1           ///< encoder only force merge for AMP partition (no motion search for AMP)
472#endif
473
474#define SCALING_LIST_OUTPUT_RESULT    0 //JCTVC-G880/JCTVC-G1016 quantization matrices
475#define SCALING_LIST                  1 //JCTVC-H0230/H0461/H0237
476
477#define DEFAULT_DC                    1 // JCTVC-H0242
478
479#define RPS_IN_SPS                    1 // Adopted during discussion of JCTVC-H0423
480
481#define H0412_REF_PIC_LIST_RESTRICTION 1
482
483#define H0566_TLA                     1
484#if H0566_TLA
485#define H0566_TLA_SET_FOR_SWITCHING_POINTS 1
486#endif
487
488#define H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER 1
489
490#define DBL_H0473_PART_1          1   //Deblocking filtering simplification
491#define DBL_CONTROL               1   //PPS deblocking_filter_control_present_flag (JCTVC-H0398); condition for inherit params flag in SH (JCTVC-H0424)
492#define DBL_STRONG_FILTER_CLIP    1   //Introduction of strong filter clipping in deblocking filter (JCTVC-H0275)
493
494#define CABAC_INIT_FLAG             1 // JCTVC-H0540
495#define CABAC_INIT_PRESENT_FLAG     1
496
497#define H0388                       1 // JCTVC-H0388
498
499#define TILES_WPP_ENTRY_POINT_SIGNALLING        1 // JCTVC-H0556. Assumes either Tiles is ON or WPP is ON (not both simultaneously).
500#define REMOVE_TILE_DEPENDENCE                  1 // remove tile_boundary_independence_flag and dependent tiles
501#define TILES_OR_ENTROPY_SYNC_IDC               1 // tiles_or_entropy_coding_sync_idc flag
502#define COMPLETE_SLICES_IN_TILE     1 // Among the constraints between slices and tiles, all slices within a tile shall be complete (JCTVC-H0348/JCTVC-H0463) for SliceMode 1&2
503#define WPP_SIMPLIFICATION          1 // JCTVC-H0349/JCTVC-0517
504
505// ====================================================================================================================
506// VPS INTEGRATION
507// ====================================================================================================================
508#if !QC_MVHEVC_B0046
509#if VIDYO_VPS_INTEGRATION
510#define MAX_NUM_VPS 10
511#endif
512#else
513#define MAX_NUM_VPS 1
514#endif
515
516
517// ====================================================================================================================
518// Basic type redefinition
519// ====================================================================================================================
520
521typedef       void                Void;
522typedef       bool                Bool;
523
524typedef       char                Char;
525typedef       unsigned char       UChar;
526typedef       short               Short;
527typedef       unsigned short      UShort;
528typedef       int                 Int;
529typedef       unsigned int        UInt;
530typedef       double              Double;
531
532// ====================================================================================================================
533// 64-bit integer type
534// ====================================================================================================================
535
536#ifdef _MSC_VER
537typedef       __int64             Int64;
538
539#if _MSC_VER <= 1200 // MS VC6
540typedef       __int64             UInt64;   // MS VC6 does not support unsigned __int64 to double conversion
541#else
542typedef       unsigned __int64    UInt64;
543#endif
544
545#else
546
547typedef       long long           Int64;
548typedef       unsigned long long  UInt64;
549
550#endif
551
552// ====================================================================================================================
553// Type definition
554// ====================================================================================================================
555
556typedef       UChar           Pxl;        ///< 8-bit pixel type
557typedef       Short           Pel;        ///< 16-bit pixel type
558typedef       Int             TCoeff;     ///< transform coefficient
559
560
561// ====================================================================================================================
562// Define Distortion Types
563// ====================================================================================================================
564typedef       Int64           RMDist;     ///< renderer model distortion
565
566#if HHI_VSO_DIST_INT
567typedef       Int              Dist;       ///< RDO distortion
568#define       RDO_DIST_MIN     MIN_INT
569#define       RDO_DIST_MAX     MAX_INT
570#else
571typedef       UInt             Dist;       ///< RDO distortion
572#define       RDO_DIST_MIN     0
573#define       RDO_DIST_MAX     MAX_UINT
574#endif
575
576/// parameters for adaptive loop filter
577class TComPicSym;
578
579#define NUM_DOWN_PART 4
580
581enum SAOTypeLen
582{
583  SAO_EO_LEN    = 4,
584#if SAO_UNIT_INTERLEAVING
585  SAO_BO_LEN    = 4,
586  SAO_MAX_BO_CLASSES = 32
587#else
588  SAO_BO_LEN    = 16
589#endif
590};
591
592enum SAOType
593{
594  SAO_EO_0 = 0,
595  SAO_EO_1,
596  SAO_EO_2,
597  SAO_EO_3,
598#if SAO_UNIT_INTERLEAVING
599  SAO_BO,
600#else
601  SAO_BO_0,
602  SAO_BO_1,
603#endif
604  MAX_NUM_SAO_TYPE
605};
606
607typedef struct _SaoQTPart
608{
609#if !SAO_UNIT_INTERLEAVING
610  Bool        bEnableFlag;
611#endif
612  Int         iBestType;
613  Int         iLength;
614#if SAO_UNIT_INTERLEAVING
615  Int         bandPosition ;
616  Int         iOffset[4];
617#else
618  Int         iOffset[32];
619#endif
620  Int         StartCUX;
621  Int         StartCUY;
622  Int         EndCUX;
623  Int         EndCUY;
624
625  Int         PartIdx;
626  Int         PartLevel;
627  Int         PartCol;
628  Int         PartRow;
629
630  Int         DownPartsIdx[NUM_DOWN_PART];
631  Int         UpPartIdx;
632
633  Bool        bSplit;
634
635  //---- encoder only start -----//
636  Bool        bProcessed;
637  Double      dMinCost;
638  Int64       iMinDist;
639  Int         iMinRate;
640  //---- encoder only end -----//
641} SAOQTPart;
642
643#if SAO_UNIT_INTERLEAVING
644typedef struct _SaoLcuParam
645{
646  Bool       mergeUpFlag;
647  Bool       mergeLeftFlag;
648  Int        typeIdx;
649  Int        bandPosition;
650  Int        offset[4];
651  Int        runDiff;
652  Int        run;
653  Int        partIdx;
654  Int        partIdxTmp;
655  Int        length;
656} SaoLcuParam;
657#endif
658
659struct SAOParam
660{
661  Bool       bSaoFlag[3];
662  SAOQTPart* psSaoPart[3];
663  Int        iMaxSplitLevel;
664  Int        iNumClass[MAX_NUM_SAO_TYPE];
665#if SAO_UNIT_INTERLEAVING
666  Bool         oneUnitFlag[3];
667  SaoLcuParam* saoLcuParam[3];
668  Int          numCuInHeight;
669  Int          numCuInWidth;
670#endif
671  ~SAOParam();
672};
673
674struct ALFParam
675{
676  Int alf_flag;                           ///< indicates use of ALF
677#if !LCU_SYNTAX_ALF
678  Int chroma_idc;                         ///< indicates use of ALF for chroma
679#endif
680  Int num_coeff;                          ///< number of filter coefficients
681  Int filter_shape;
682#if !LCU_SYNTAX_ALF
683  Int filter_shape_chroma;
684  Int num_coeff_chroma;                   ///< number of filter coefficients (chroma)
685  Int *coeff_chroma;                      ///< filter coefficient array (chroma)
686#endif
687  Int *filterPattern;
688  Int startSecondFilter;
689  Int filters_per_group;
690  Int predMethod;
691  Int *nbSPred;
692  Int **coeffmulti;
693  Int minKStart;
694#if !LCU_SYNTAX_ALF
695  Int maxScanVal;
696  Int kMinTab[42];
697
698  Int alf_pcr_region_flag;
699  ~ALFParam();
700#endif
701#if LCU_SYNTAX_ALF
702  Int componentID;
703  Int* kMinTab;
704  //constructor, operator
705  ALFParam():componentID(-1){}
706  ALFParam(Int cID){create(cID);}
707  ALFParam(const ALFParam& src) {*this = src;}
708  ~ALFParam(){destroy();}
709  const ALFParam& operator= (const ALFParam& src);
710private:
711  Void create(Int cID);
712  Void destroy();
713  Void copy(const ALFParam& src);
714#endif
715};
716
717#if LCU_SYNTAX_ALF
718struct AlfUnitParam
719{
720  Int   mergeType;
721  Bool  isEnabled;
722  Bool  isNewFilt;
723  Int   storedFiltIdx;
724  ALFParam* alfFiltParam;
725  //constructor, operator
726  AlfUnitParam();
727  AlfUnitParam(const AlfUnitParam& src){ *this = src;}
728  const AlfUnitParam& operator= (const AlfUnitParam& src);
729  Bool operator == (const AlfUnitParam& cmp);
730};
731
732struct AlfParamSet
733{
734  Bool isEnabled[3];
735  Bool isUniParam[3];
736  Int  numLCUInWidth;
737  Int  numLCUInHeight;
738  Int  numLCU;
739  AlfUnitParam* alfUnitParam[3];
740  //constructor, operator
741  AlfParamSet(){create();}
742  ~AlfParamSet(){destroy();}
743  Void create(Int width =0, Int height=0, Int num=0);
744  Void init();
745  Void releaseALFParam();
746  Void createALFParam();
747private:
748  Void destroy();
749};
750#endif
751
752
753
754/// parameters for deblocking filter
755typedef struct _LFCUParam
756{
757  Bool bInternalEdge;                     ///< indicates internal edge
758  Bool bLeftEdge;                         ///< indicates left edge
759  Bool bTopEdge;                          ///< indicates top edge
760} LFCUParam;
761
762// ====================================================================================================================
763// Enumeration
764// ====================================================================================================================
765
766/// supported slice type
767enum SliceType
768{
769  I_SLICE,
770  P_SLICE,
771  B_SLICE
772};
773
774/// chroma formats (according to semantics of chroma_format_idc)
775enum ChromaFormat
776{
777  CHROMA_400  = 0,
778  CHROMA_420  = 1,
779  CHROMA_422  = 2,
780  CHROMA_444  = 3
781};
782
783/// supported partition shape
784enum PartSize
785{
786  SIZE_2Nx2N,           ///< symmetric motion partition,  2Nx2N
787  SIZE_2NxN,            ///< symmetric motion partition,  2Nx N
788  SIZE_Nx2N,            ///< symmetric motion partition,   Nx2N
789  SIZE_NxN,             ///< symmetric motion partition,   Nx N
790  SIZE_2NxnU,           ///< asymmetric motion partition, 2Nx( N/2) + 2Nx(3N/2)
791  SIZE_2NxnD,           ///< asymmetric motion partition, 2Nx(3N/2) + 2Nx( N/2)
792  SIZE_nLx2N,           ///< asymmetric motion partition, ( N/2)x2N + (3N/2)x2N
793  SIZE_nRx2N,           ///< asymmetric motion partition, (3N/2)x2N + ( N/2)x2N
794  SIZE_NONE = 15
795};
796
797
798enum BlenMod
799{
800    BLEND_NONE  = -1,
801    BLEND_AVRG  = 0,
802    BLEND_LEFT  = 1,
803    BLEND_RIGHT = 2,
804    BLEND_GEN   =  3
805};
806
807/// supported prediction type
808enum PredMode
809{
810  MODE_SKIP,            ///< SKIP mode
811  MODE_INTER,           ///< inter-prediction mode
812  MODE_INTRA,           ///< intra-prediction mode
813  MODE_NONE = 15
814};
815
816/// texture component type
817enum TextType
818{
819  TEXT_LUMA,            ///< luma
820  TEXT_CHROMA,          ///< chroma (U+V)
821  TEXT_CHROMA_U,        ///< chroma U
822  TEXT_CHROMA_V,        ///< chroma V
823  TEXT_ALL,             ///< Y+U+V
824  TEXT_NONE = 15
825};
826
827/// reference list index
828enum RefPicList
829{
830  REF_PIC_LIST_0 = 0,   ///< reference list 0
831  REF_PIC_LIST_1 = 1,   ///< reference list 1
832  REF_PIC_LIST_C = 2,   ///< combined reference list for uni-prediction in B-Slices
833  REF_PIC_LIST_X = 100  ///< special mark
834};
835
836/// distortion function index
837enum DFunc
838{
839  DF_DEFAULT  = 0,
840  DF_SSE      = 1,      ///< general size SSE
841  DF_SSE4     = 2,      ///<   4xM SSE
842  DF_SSE8     = 3,      ///<   8xM SSE
843  DF_SSE16    = 4,      ///<  16xM SSE
844  DF_SSE32    = 5,      ///<  32xM SSE
845  DF_SSE64    = 6,      ///<  64xM SSE
846  DF_SSE16N   = 7,      ///< 16NxM SSE
847
848  DF_SAD      = 8,      ///< general size SAD
849  DF_SAD4     = 9,      ///<   4xM SAD
850  DF_SAD8     = 10,     ///<   8xM SAD
851  DF_SAD16    = 11,     ///<  16xM SAD
852  DF_SAD32    = 12,     ///<  32xM SAD
853  DF_SAD64    = 13,     ///<  64xM SAD
854  DF_SAD16N   = 14,     ///< 16NxM SAD
855
856  DF_SADS     = 15,     ///< general size SAD with step
857  DF_SADS4    = 16,     ///<   4xM SAD with step
858  DF_SADS8    = 17,     ///<   8xM SAD with step
859  DF_SADS16   = 18,     ///<  16xM SAD with step
860  DF_SADS32   = 19,     ///<  32xM SAD with step
861  DF_SADS64   = 20,     ///<  64xM SAD with step
862  DF_SADS16N  = 21,     ///< 16NxM SAD with step
863
864  DF_HADS     = 22,     ///< general size Hadamard with step
865  DF_HADS4    = 23,     ///<   4xM HAD with step
866  DF_HADS8    = 24,     ///<   8xM HAD with step
867  DF_HADS16   = 25,     ///<  16xM HAD with step
868  DF_HADS32   = 26,     ///<  32xM HAD with step
869  DF_HADS64   = 27,     ///<  64xM HAD with step
870  DF_HADS16N  = 28,     ///< 16NxM HAD with step
871
872#if SAIT_VSO_EST_A0033
873  DF_VSD      = 29,      ///< general size VSD
874  DF_VSD4     = 30,      ///<   4xM VSD
875  DF_VSD8     = 31,      ///<   8xM VSD
876  DF_VSD16    = 32,      ///<  16xM VSD
877  DF_VSD32    = 33,      ///<  32xM VSD
878  DF_VSD64    = 34,      ///<  64xM VSD
879  DF_VSD16N   = 35,      ///< 16NxM VSD
880#endif
881
882
883#if AMP_SAD
884  DF_SAD12    = 43,
885  DF_SAD24    = 44,
886  DF_SAD48    = 45,
887
888  DF_SADS12   = 46,
889  DF_SADS24   = 47,
890  DF_SADS48   = 48,
891
892  DF_SSE_FRAME = 50     ///< Frame-based SSE
893#else
894  DF_SSE_FRAME = 33     ///< Frame-based SSE
895#endif
896};
897
898/// index for SBAC based RD optimization
899enum CI_IDX
900{
901  CI_CURR_BEST = 0,     ///< best mode index
902  CI_NEXT_BEST,         ///< next best index
903  CI_TEMP_BEST,         ///< temporal index
904  CI_CHROMA_INTRA,      ///< chroma intra index
905  CI_QT_TRAFO_TEST,
906  CI_QT_TRAFO_ROOT,
907  CI_NUM,               ///< total number
908};
909
910/// motion vector predictor direction used in AMVP
911enum MVP_DIR
912{
913  MD_LEFT = 0,          ///< MVP of left block
914  MD_ABOVE,             ///< MVP of above block
915  MD_ABOVE_RIGHT,       ///< MVP of above right block
916  MD_BELOW_LEFT,        ///< MVP of below left block
917  MD_ABOVE_LEFT         ///< MVP of above left block
918};
919
920/// motion vector prediction mode used in AMVP
921enum AMVP_MODE
922{
923  AM_NONE = 0,          ///< no AMVP mode
924  AM_EXPL,              ///< explicit signalling of motion vector index
925};
926
927/// coefficient scanning type used in ACS
928enum COEFF_SCAN_TYPE
929{
930  SCAN_ZIGZAG = 0,      ///< typical zigzag scan
931  SCAN_HOR,             ///< horizontal first scan
932  SCAN_VER,              ///< vertical first scan
933  SCAN_DIAG              ///< up-right diagonal scan
934};
935
936// Renderer
937enum
938{
939  VIEWPOS_INVALID = -1,
940  VIEWPOS_LEFT    = 0,
941  VIEWPOS_RIGHT   = 1,
942  VIEWPOS_MERGED  = 2
943};
944
945//! \}
946
947#endif
948
949
Note: See TracBrowser for help on using the repository browser.