source: 3DVCSoftware/branches/HTM-5.1-dev2-Qualcomm/source/Lib/TLibCommon/TypeDef.h

Last change on this file was 238, checked in by qualcomm, 12 years ago

The setting of the macro 'QC_AMVP_MRG_UNIFY_IVCAN_C0051' is enabled.

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