source: 3DVCSoftware/branches/HTM-9.3-dev2-MediaTek/source/Lib/TLibCommon/TypeDef.h @ 804

Last change on this file since 804 was 804, checked in by mediatek-htm, 10 years ago

The integration of JCT3V-G0053. The MACRO is "MTK_ARP_REF_SELECTION_G0053".

by Yi-Wen Chen (yiwen.chen@…)

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