source: 3DVCSoftware/branches/HTM-9.0r1-F0122/source/Lib/TLibCommon/TypeDef.h @ 747

Last change on this file since 747 was 747, checked in by qualcomm, 10 years ago

MV-HEVC+D support based on JCT3V-F0122

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