source: 3DVCSoftware/branches/0.3-poznan-univ/source/Lib/TLibCommon/TypeDef.h @ 46

Last change on this file since 46 was 46, checked in by poznan-univ, 13 years ago

Added Ericsson Extraction Tool

  • Property svn:eol-style set to native
File size: 30.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-2011, 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 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
42#define BITSTREAM_EXTRACTION            1
43
44#define FLEX_CODING_ORDER               1
45
46#define SONY_COLPIC_AVAILABILITY        1
47
48//>>>>> HHI 3DV tools >>>>>
49#define HHI_INTER_VIEW_MOTION_PRED      1   // inter-view motion parameter prediction
50#define HHI_INTER_VIEW_RESIDUAL_PRED    1   // inter-view residual prediction
51#define HHI_FULL_PEL_DEPTH_MAP_MV_ACC   1   // full-pel mv accuracy for depth maps
52#define HHI_MPI                         1   // motion parameter inheritance from texture picture for depth map coding
53#define HHI_INTERVIEW_SKIP              1   // skipping of residual for renderable regions
54#define HHI_INTERVIEW_SKIP_LAMBDA_SCALE 1   // scaling of lambda in cost calculation in rederable regions
55#define HHI_VSO                         1   // view synthesis optimization
56#define HHI_VSO_COLOR_PLANES            1   // view synthesis optimization in color planes
57#define HHI_VSO_DIST_INT                1   // view synthesis optimization integer distorition in rdo process
58#define HHI_VSO_LS_TABLE                1   // table based lambda scaling
59
60#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE && !HHI_INTERVIEW_SKIP
61  #error "HHI_INTERVIEW_SKIP_LAMBDA_SCALE cannot be enabled if HHI_INTERVIEW_SKIP is not"
62#endif
63
64#define HHI_DMM_WEDGE_INTRA             1   // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction)
65#define HHI_DMM_PRED_TEX                1   // depth model model dependent on texture (inter-component Wedgelet and Contour prediction )
66
67#define HHI_NO_LowDelayCoding           0   // old-fashioned encoder control, should be adapted to hm5.0
68//<<<<< HHI 3DV tools <<<<<
69
70//<<<<< Poznan 3DV tools <<<<<<
71#define POZNAN_CU_SKIP              1 //Poznan Cu Skip
72#define POZNAN_CU_SYNTH             1 //Poznan Cu Synth
73
74#define POZNAN_AVAIL_MAP            1 //Creates Availibity buffers in all needed classes
75
76#define POZNAN_SYNTH_VIEW           1 //Creates view synthesis buffers in all needed classes
77#define POZNAN_SYNTH_DEPTH          1
78
79#define POZNAN_SYNTH                1 //Creates aligned synthesis classes in encoder and decoder
80
81#define POZNAN_ENCODE_ONLY_DISOCCLUDED_CU          1 //Poznan CU Skip
82#define POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS     1 //Fill not sended CUs with synthesized data
83
84#define POZNAN_VSO_FIX              0
85
86#define POZNAN_CU_SKIP_PSNR         1 //Poznan Cu Skip Display psnr of the codded CUs only
87
88#define POZNAN_NONLINEAR_DEPTH              1    /// Non-linear depth processing
89#define POZNAN_NONLINEAR_DEPTH_THRESHOLD    1  /// Non-linear depth thrasholding
90
91#if POZNAN_SYNTH
92#define POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 1 /// Increase QP for texture CUs that are in the background (according to proper depth map). This QP change is not encoded in a bitstream
93#endif
94#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH     
95 #define POZNAN_TEXTURE_TU_DELTA_QP_NOT_IN_BASE_VIEW 1     /// should not be disabled in current software version - no depth synthesis map is available for base view anyway 
96 #define POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW 1    /// increase of QP param for top and bottom LCU row in frame
97 #define POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 0 /// used for optimization of function calculating dQP from depth block max value. Standard values set if disabled. If enabled params are set in cfg file for encoder (no decoder is supported in that case).
98  #if !POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
99    #define POZNAN_TEXTURE_TU_DELTA_QP_OFFSET (-2.6)
100    #define POZNAN_TEXTURE_TU_DELTA_QP_MUL (1)
101    #define POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_ROW_VAL (0)
102  #endif
103#endif
104
105#define POZNAN_MP                                  1    /// Depth-Based Multiview Prediction of CU parameters
106#if POZNAN_MP
107
108#define POZNAN_MP_USE_DEPTH_MAP_GENERATION 0 // determines if DEPTH_MAP_GENERATION is used for calculating corresponding pixel position in PUT multiview prediction (POZNAN_MP):
109                                                                                                                                        //                      POZNAN_MP_USE_DEPTH_MAP_GENERATION=1 - use DEPTH_MAP_GENERATION,
110                                                                                                                                        //                      POZNAN_MP_USE_DEPTH_MAP_GENERATION=0 - use reconstructed depth maps from neighboring views
111
112#if !POZNAN_MP_USE_DEPTH_MAP_GENERATION
113#define POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 1 // Depth-Based Multiview Prediction of CU parameters will use depth picture of current view if this picture is available, otherwise reference view depth is utilized
114#endif
115
116#define POZNAN_MP_FILL                             1    // Depth-Based Multiview Prediction of CU parameters with fill option for occluded areas
117#if POZNAN_MP_FILL
118#define POZNAN_MP_FILL_TYPE                        0    // Variant of fill algorithm used for occluded areas (0 - smaller disparity, 1 - larger disparity)
119#endif
120
121// ---------------------------------------
122
123#define POZNAN_DBMP                                1    // Depth Based Motion Prediction prediction for MERGE
124#if POZNAN_DBMP
125#define POZNAN_DBMP_USE_FOR_TEXTURE                  1    //use Depth Based Motion Prediction in texture pictures (0 - no, 1 -yes)
126#define POZNAN_DBMP_USE_FOR_DEPTH                  1    // use Depth Based Motion Prediction in depth pictures (0 - no, 1 -yes)
127
128#define POZNAN_DBMP_CALC_PRED_DATA              1    // Depth Based Motion Prediction motion data used for prediction in other CUs is calculated based on all CU points (otherwise motion data for none-MP points is used for prediction)
129#define POZNAN_DBMP_COMPRESS_ME_DATA            0    // Depth Based Motion Prediction derives representative motion data from reference CUs even if they are DBMP-based predicted (otherwise motion data is derived with per-point resolution for DBMP-based predicted reference CUs)
130#define POZNAN_DBMP_USE_IN_NONANCHOR_PIC_ONLY           1    // determines if Depth Based Motion Prediction is used in non-anchor pictures only
131#endif
132
133#endif
134
135
136//<<<<< Poznan 3DV tools <<<<<<
137
138////////////////////////////
139// AHG18 Weighted Prediction defines section start
140////////////////////////////
141#define WEIGHT_PRED           ///< enable AVC based weighted prediction
142
143//////////////////////////
144// AHG18 Weighted Prediction defines section end
145//////////////////////////
146
147////////////////////////////
148// JCT-VC E start
149////////////////////////////
150
151#define E253                              1
152
153////////////////////////////
154// JCT-VC E end
155////////////////////////////
156
157
158
159#define HHI_DISABLE_INTER_NxN_SPLIT       1           ///< TN: disable redundant use of pu-mode NxN for CTBs larger 8x8 (inter only)
160#define HHI_RMP_SWITCH                    0
161
162#define HHI_RQT_FORCE_SPLIT_NxN           0           ///< MSHK: force split flags of residual quadtree for NxN PUs such that transform blocks are guaranteed to not span NxN PUs
163#define HHI_RQT_FORCE_SPLIT_RECT          0           ///< MSHK: force split flags of residual quadtree for rectangular PUs such that transform blocks are guaranteed to not span rectangular PUs
164#define HHI_RQT_INTRA_SPEEDUP             1           ///< tests one best mode with full rqt
165#define HHI_RQT_INTRA_SPEEDUP_MOD         0           ///< tests two best modes with full rqt
166
167#define PART_MRG                          1            // If the number of partitions is two and size > 8, only merging mode is enabled for the first partition & do not code merge_flag for the first partition
168#define HHI_MRG_SKIP                      1            // (JCTVC-E481 - merge skip) replaces the AMVP based skip by merge based skip (E481 - MERGE skip)
169
170#if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP
171#error
172#endif
173
174#if ( HHI_RQT_FORCE_SPLIT_NxN || HHI_RQT_FORCE_SPLIT_RECT)
175#define HHI_RQT_FORCE_SPLIT_ACC2_PU       1
176#else
177#define HHI_RQT_FORCE_SPLIT_ACC2_PU       0
178#endif
179
180// COLOCATED PREDICTOR
181// FOR MERGE
182#define MRG_NEIGH_COL                     1           ///< use of colocated MB in MERGE
183#define FT_TCTR_MRG                       1           ///< central colocated in MERGE
184#if !FT_TCTR_MRG
185#define PANASONIC_MERGETEMPORALEXT        1           ///<
186#endif
187#define MTK_TMVP_H_MRG                    1           ///< (JCTVC-E481 - D125 2.1) right-bottom collocated for merge
188#define PANASONIC_MRG_TMVP_REFIDX         1           ///< (JCTVC-E481 - D274 (2) ) refidx derivation for merge TMVP
189// FOR AMVP
190#define AMVP_NEIGH_COL                    1           ///< use of colocated MB in AMVP
191#define FT_TCTR_AMVP                      1           ///< central colocated in AMVP
192#if !FT_TCTR_AMVP
193#define PANASONIC_AMVPTEMPORALEXT         1           ///<
194#endif
195#define MTK_TMVP_H_AMVP                   1           ///< (JCTVC-E481 - D125 2.1) right-bottom collocated for amvp
196// FOR BOTH
197#define PANASONIC_AMVPTEMPORALMOD         1           ///< (JCTVC-E481 - D125 2.4' / D274 3')
198#define AMVP_BUFFERCOMPRESS               1           ///< motion vector buffer compression
199#define AMVP_DECIMATION_FACTOR            4
200#define MV_COMPRESS_MODE_REFIDX           1           ///< (JCTVC-E147) compress all inter prediction parameters according to 1)
201
202#define HIGH_ACCURACY_BI                  1          // High precision bi-prediction JCTVC-D321
203#define REMOVE_INTERMEDIATE_CLIPPING      1          // No intermediate clipping in bi-prediction JCTVC-E242
204
205////////////////
206// E494 (E227/E338/E344/E489/E494): PCP SIGMAP + REDUCED CONTEXTS
207////////////////
208
209#define PCP_SIGMAP_SIMPLE_LAST            1
210#define SIMPLE_CONTEXT_SIG                1
211
212
213#define QC_MOD_LCEC                       1           // JCTVC-D374: modified LCEC coeff. coding
214#define LCEC_INTRA_MODE                   1           // JCTVC-D366: improved luma intra mode coding
215#define QC_MOD_LCEC_RDOQ                  1           // JCTVC-D374: improved RDOQ
216#define QC_LCEC_INTER_MODE                1
217#define QC_MDIS                           1           // JCTVC-D282: enable mode dependent intra smoothing
218#define QC_MDCS                           1           // JCTVC-D393: mode dependent coefficients coding
219#if QC_MOD_LCEC
220#define RUNLEVEL_TABLE_CUT                1           // JCTVC-E384: Run-Level table size reduction
221#if RUNLEVEL_TABLE_CUT
222#define CAVLC_COEF_LRG_BLK                1           // JCTVC-E383: enable large block coeff. coding
223#endif
224#endif
225
226
227#define ENABLE_FORCECOEFF0  0
228
229/* Rounding control */
230//#define ROUNDING_CONTROL_BIPRED ///< From JCTVC-B074 This part of the code is not needed anymore : KU
231#define TRANS_PRECISION_EXT     ///< From JCTVC-B074
232
233#define HHI_RQT_DISABLE_SUB                   0           ///< disabling subtree whose node size is smaller than partition size
234
235#define FAST_UDI_MAX_RDMODE_NUM               35          ///< maximum number of RD comparison in fast-UDI estimation loop
236
237#define SAMSUNG_FAST_UDI_MODESET              0           ///< 0: {9,9,4,4,5} (default) and 1: {9,9,9,9,5} for {4x4,8x8,16x16,32x32,64x64}
238
239#define ZERO_MVD_EST                          0           ///< Zero Mvd Estimation in normal mode
240
241#define LM_CHROMA                             1           // JCTVC-E266: Chroma intra prediction based on luma signal
242
243#define UNIFY_INTER_TABLE                     1           // JCTVC-E381 CAVLC: Inter pred coding
244
245#define DCM_RDCOST_TEMP_FIX //Enables temporary bug fixes to RD cost computation
246
247#define DCM_DECODING_REFRESH              1           ///< enable/disable decoding refresh (IDR and CDR)
248#if DCM_DECODING_REFRESH
249#define DCM_SKIP_DECODING_FRAMES          1           ///< enable/disable the random access by the decoder
250#endif
251
252#define DCM_SIMPLIFIED_MVP                1           ///< enable/disable the simplified motion vector prediction(D231)
253#if DCM_SIMPLIFIED_MVP
254#define MTK_AMVP_SMVP_DERIVATION          1              ///< (JCTVC-E481 - D125 2.1) amvp spatial candidate derivation
255#define TI_AMVP_SMVP_SIMPLIFIED           1              ///< (JCTVC-E481 - F)amvp spatial candidate simplified scanning
256#endif
257
258#define DCM_COMB_LIST                  1           ///< Use of combined list for uni-prediction in B-slices
259
260#define ADD_PLANAR_MODE                   1           ///< enable/disable Planar mode for intra prediction (JCTVC-E321)
261#if ADD_PLANAR_MODE
262#define NUM_INTRA_MODE                    35
263#define PLANAR_IDX                        (NUM_INTRA_MODE-1)
264#endif
265
266#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
267#define DMM_WEDGEMODEL_MIN_SIZE           4           
268#define DMM_WEDGEMODEL_MAX_SIZE          32
269#define DMM_WEDGE_PREDDIR_DELTAEND_MAX    4           
270
271#if ADD_PLANAR_MODE
272#define  MAX_MODE_ID_INTRA_DIR            34
273#else
274#define  MAX_MODE_ID_INTRA_DIR            33
275#endif
276#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
277enum MODE_IDX
278{
279  DMM_WEDGE_FULL_IDX         = MAX_MODE_ID_INTRA_DIR+1,
280  DMM_WEDGE_FULL_D_IDX       = MAX_MODE_ID_INTRA_DIR+2,
281  DMM_WEDGE_PREDTEX_IDX      = MAX_MODE_ID_INTRA_DIR+3,
282  DMM_WEDGE_PREDTEX_D_IDX    = MAX_MODE_ID_INTRA_DIR+4,
283  DMM_CONTOUR_PREDTEX_IDX    = MAX_MODE_ID_INTRA_DIR+5,
284  DMM_CONTOUR_PREDTEX_D_IDX  = MAX_MODE_ID_INTRA_DIR+6,
285  DMM_WEDGE_PREDDIR_IDX      = MAX_MODE_ID_INTRA_DIR+7,
286  DMM_WEDGE_PREDDIR_D_IDX    = MAX_MODE_ID_INTRA_DIR+8
287};
288#elif HHI_DMM_WEDGE_INTRA && !HHI_DMM_PRED_TEX
289enum MODE_IDX
290{
291  DMM_WEDGE_FULL_IDX         = MAX_MODE_ID_INTRA_DIR+1,
292  DMM_WEDGE_FULL_D_IDX       = MAX_MODE_ID_INTRA_DIR+2,
293  DMM_WEDGE_PREDDIR_IDX      = MAX_MODE_ID_INTRA_DIR+3,
294  DMM_WEDGE_PREDDIR_D_IDX    = MAX_MODE_ID_INTRA_DIR+4
295};
296#elif !HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
297enum MODE_IDX
298{
299  DMM_WEDGE_PREDTEX_IDX      = MAX_MODE_ID_INTRA_DIR+1,
300  DMM_WEDGE_PREDTEX_D_IDX    = MAX_MODE_ID_INTRA_DIR+2,
301  DMM_CONTOUR_PREDTEX_IDX    = MAX_MODE_ID_INTRA_DIR+3,
302  DMM_CONTOUR_PREDTEX_D_IDX  = MAX_MODE_ID_INTRA_DIR+4,
303};
304#endif
305#endif
306
307#define TSB_ALF_HEADER                 1           // Send ALF ON/OFF flag in slice header
308#define IBDI_DISTORTION                0           ///< enable/disable SSE modification when IBDI is used (JCTVC-D152)
309#define FIXED_ROUNDING_FRAME_MEMORY    0           ///< enable/disable fixed rounding to 8-bitdepth of frame memory when IBDI is used
310
311#define MS_LCEC_ONE_FRAME               1           // change the initial table in LCEC when there is up to one reference frame in each list, JCTVC-D141
312#define MS_LCEC_LOOKUP_TABLE_MAX_VALUE  1           // use the information of the max position in the lookup table, JCTVC-D141
313#define MS_LCEC_LOOKUP_TABLE_EXCEPTION  1           // deal with the case when the number of reference frames is greater than 2, JCTVC-D141
314#define MS_LCEC_UNI_EXCEPTION_THRES     1           // for GPB case, uni-prediction, > MS_LCEC_UNI_EXCEPTION_THRES is exception
315#define CAVLC_COUNTER_ADAPT             1          // counter based CAVLC adaptation, JCTVC-E143
316#if CAVLC_COUNTER_ADAPT
317#define CAVLC_RQT_CBP                   1           //CAVLC coding of cbf and split flag, JCTVC-E404
318#endif
319
320
321#define AVOID_ZERO_MERGE_CANDIDATE      1           // (JCTVC-E146/E118) insert zero MV if no merge candidates are available
322#define CHANGE_MERGE_CONTEXT            1           // (JCTVC-E146/E118) change merge flag context derivation
323#define CHANGE_GET_MERGE_CANDIDATE      1           // (JCTVC-E146/E118) merge flag parsing independent of number of merge candidates
324#if CHANGE_GET_MERGE_CANDIDATE && !CHANGE_MERGE_CONTEXT
325#error CHANGE_GET_MERGE_CANDIDATE can only be defined with CHANGE_MERGE_CONTEXT
326#endif
327
328#define MTK_DISABLE_INTRA_NxN_SPLIT       1           ///< Disable use of PUs-mode NxN for CUs larger 8x8 (intra only)
329#define MTK_NONCROSS_INLOOP_FILTER        1           ///< Allow non-cross-slice-boundary in-loop filtering, including DB & ALF (JCTVC-D128)
330
331#define RVM_VCEGAM10 1 // RVM model proposed in VCEG-AM10
332#if RVM_VCEGAM10
333#define RVM_VCEGAM10_M 4
334#endif
335
336#define MTK_DCM_MPM 1 // MostProbableModeSignaling
337
338#define FAST_UDI_USE_MPM 1
339#define SONY_SIG_CTX 1
340#define SNY_DQP                          1           ///< syntax change of dQP (JCT-VC D258)
341
342#define TI_ALF_MAX_VSIZE_7 1
343
344#define CHROMA_CODEWORD 1                             ///< enable new intra chroma mode encoding by setting to 1. setting to 0 should yield same results as TMuC 0.9
345#define CHROMA_CODEWORD_SWITCH  1                     ///< Switch the places of the last two codewords
346
347#define FULL_NBIT 0 ///< When enabled, does not use g_uiBitIncrement anymore to support > 8 bit data
348
349/////////////////////////////////
350// AHG SLICES defines section start
351/////////////////////////////////
352#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
353#define AD_HOC_SLICES_FIXED_NUMBER_OF_BYTES_IN_SLICE    2          ///< OPTION IDENTIFIER. mode==2 -> Limit maximum number of bins/bits in a slice
354
355// Entropy slice options
356#define SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE            1          ///< OPTION IDENTIFIER. Limit maximum number of largest coding tree blocks in an entropy slice
357#define SHARP_MULTIPLE_CONSTRAINT_BASED_ENTROPY_SLICE         2          ///< OPTION IDENTIFIER. Limit maximum number of bins/bits in an entropy slice
358/////////////////////////////////
359// AHG SLICES defines section end
360/////////////////////////////////
361
362#define CONSTRAINED_INTRA_PRED            1           // JCTVC-D086: constrained intra prediction
363
364#define MTK_SAO                           1           // JCTVC-E049: Sample adaptive offset
365
366#define MQT_ALF_NPASS                       1
367
368#define MQT_BA_RA                        1  // JCTVC-E323+E046
369#if MQT_BA_RA
370#define VAR_SIZE_H           4
371#define VAR_SIZE_W           4
372#define NO_VAR_BIN          16
373#endif
374
375#if QC_MDIS
376#define MN_MDIS_SIMPLIFICATION       1       ///< JCTVC-E069: simplification of MDIS
377#endif
378#define MN_DC_PRED_FILTER            1       ///< JCTVC-E069: DC prediction samples filtering
379
380#define MVD_CTX            1           // JCTVC-E324: Modified context selection for MVD
381#define PARALLEL_DEBLK_DECISION      1 // JCTC-E224: Parallel decisions
382#define PARALLEL_MERGED_DEBLK        1 // JCTC-E224, JCTVC-E181: Parallel decisions + Parallel filtering
383#define REFERENCE_SAMPLE_PADDING                1   // JCTVC-E488 padding of unavailable reference samples for intra prediction
384
385#define E243_CORE_TRANSFORMS                    1
386#if E243_CORE_TRANSFORMS
387#define MATRIX_MULT                             0   // Brute force matrix multiplication instead of partial butterfly
388#endif
389
390// Discrete Sine Transform (DST) Type - 7
391// Currently DST operates with E-243 only
392#define INTRA_DST_TYPE_7                      1           // JCTVC-E125 4x4 DST
393#if INTRA_DST_TYPE_7
394#define REG_DCT 65535
395#if !E243_CORE_TRANSFORMS                   // E243_CORE_TRANSFORMS should be ON when DST is used
396#error "E243_CORE_TRANSFORMS should be ON"
397#endif
398#endif
399
400// ====================================================================================================================
401// Basic type redefinition
402// ====================================================================================================================
403
404typedef       void                Void;
405typedef       bool                Bool;
406
407typedef       char                Char;
408typedef       unsigned char       UChar;
409typedef       short               Short;
410typedef       unsigned short      UShort;
411typedef       int                 Int;
412typedef       unsigned int        UInt;
413typedef       long                Long;
414typedef       unsigned long       ULong;
415typedef       double              Double;
416
417// ====================================================================================================================
418// 64-bit integer type
419// ====================================================================================================================
420
421#ifdef _MSC_VER
422typedef       __int64             Int64;
423
424#if _MSC_VER <= 1200 // MS VC6
425typedef       __int64             UInt64;   // MS VC6 does not support unsigned __int64 to double conversion
426#else
427typedef       unsigned __int64    UInt64;
428#endif
429
430#else
431
432typedef       long long           Int64;
433typedef       unsigned long long  UInt64;
434
435#endif
436
437// ====================================================================================================================
438// Type definition
439// ====================================================================================================================
440
441typedef       UChar           Pxl;        ///< 8-bit pixel type
442typedef       Short           Pel;        ///< 16-bit pixel type
443typedef       Int             TCoeff;     ///< transform coefficient
444
445
446
447// ====================================================================================================================
448// Define Distortion Types
449// ====================================================================================================================
450typedef       Int64           RMDist;     ///< renderer model distortion
451
452#if HHI_VSO_DIST_INT
453typedef       Int              Dist;       ///< RDO distortion
454#define       RDO_DIST_MIN     MIN_INT
455#define       RDO_DIST_MAX     MAX_INT
456#else
457typedef       UInt             Dist;       ///< RDO distortion
458#define       RDO_DIST_MIN     0
459#define       RDO_DIST_MAX     MAX_UINT
460#endif
461
462/// parameters for adaptive loop filter
463class TComPicSym;
464
465#if MTK_SAO
466
467#define NUM_DOWN_PART 4
468
469enum QAOTypeLen
470{
471  SAO_EO_LEN    = 4,
472  SAO_EO_LEN_2D = 6,
473  SAO_BO_LEN    = 16
474};
475
476enum QAOType
477{
478  SAO_EO_0 = 0,
479  SAO_EO_1,
480  SAO_EO_2,
481  SAO_EO_3,
482  SAO_BO_0,
483  SAO_BO_1,
484  MAX_NUM_SAO_TYPE
485};
486
487typedef struct _SaoQTPart
488{
489  Bool        bEnableFlag;
490  Int         iBestType;
491  Int         iLength;
492  Int         iOffset[32];
493
494  Int         StartCUX;
495  Int         StartCUY;
496  Int         EndCUX;
497  Int         EndCUY;
498
499  Int         part_xs;
500  Int         part_xe;
501  Int         part_ys;
502  Int         part_ye;
503  Int         part_width;
504  Int         part_height;
505
506  Int         PartIdx;
507  Int         PartLevel;
508  Int         PartCol;
509  Int         PartRow;
510
511  Int         DownPartsIdx[NUM_DOWN_PART];
512  Int         UpPartIdx;
513
514  Int*        pSubPartList;
515  Int         iLengthSubPartList;
516
517  Bool        bBottomLevel;
518  Bool        bSplit;
519  //    Bool        bAvailable;
520
521  //---- encoder only start -----//
522  Int64***    pppiCorr; //[filt_type][corr_row][corr_col]
523  Int**       ppCoeff;  //[filt_type][coeff]
524  Bool        bProcessed;
525  Double      dMinCost;
526  Int64       iMinDist;
527  Int         iMinRate;
528  //---- encoder only end -----//
529} SAOQTPart;
530
531struct _SaoParam
532{
533  Bool       bSaoFlag;
534  SAOQTPart* psSaoPart;
535  Int        iMaxSplitLevel;
536  Int        iNumClass[MAX_NUM_SAO_TYPE];
537};
538
539#endif
540
541struct _AlfParam
542{
543  Int alf_flag;                           ///< indicates use of ALF
544  Int cu_control_flag;                    ///< coding unit based control flag
545  Int chroma_idc;                         ///< indicates use of ALF for chroma
546#if TI_ALF_MAX_VSIZE_7
547  Int tap;                                ///< number of filter taps - horizontal
548  Int tapV;                               ///< number of filter taps - vertical
549#else
550  Int tap;                                ///< number of filter taps
551#endif
552  Int num_coeff;                          ///< number of filter coefficients
553  Int *coeff;                             ///< filter coefficient array
554  Int tap_chroma;                         ///< number of filter taps (chroma)
555  Int num_coeff_chroma;                   ///< number of filter coefficients (chroma)
556  Int *coeff_chroma;                      ///< filter coefficient array (chroma)
557  //CodeAux related
558  Int realfiltNo;
559  Int filtNo;
560#if MQT_BA_RA
561  Int filterPattern[NO_VAR_BIN];
562#else
563  Int filterPattern[16];
564#endif
565  Int startSecondFilter;
566  Int noFilters;
567#if MQT_BA_RA
568  Int varIndTab[NO_VAR_BIN];
569#else
570  Int varIndTab[16];
571#endif
572
573  //Coeff send related
574  Int filters_per_group_diff; //this can be updated using codedVarBins
575  Int filters_per_group;
576#if MQT_BA_RA
577  Int codedVarBins[NO_VAR_BIN];
578#else
579  Int codedVarBins[16];
580#endif
581  Int forceCoeff0;
582  Int predMethod;
583  Int **coeffmulti;
584  Int minKStart;
585  Int maxScanVal;
586  Int kMinTab[42];
587#if TSB_ALF_HEADER
588  UInt num_alf_cu_flag;
589  UInt num_cus_in_frame;
590  UInt alf_max_depth;
591  UInt *alf_cu_flag;
592#endif
593
594#if MQT_BA_RA
595  Int alf_pcr_region_flag;
596#endif
597};
598
599/// parameters for deblocking filter
600typedef struct _LFCUParam
601{
602  Bool bInternalEdge;                     ///< indicates internal edge
603  Bool bLeftEdge;                         ///< indicates left edge
604  Bool bTopEdge;                          ///< indicates top edge
605} LFCUParam;
606
607/// parapeters for TENTM coefficient VLC
608typedef struct _LastCoeffStruct
609{
610  int level;
611  int last_pos;
612} LastCoeffStruct;
613
614// ====================================================================================================================
615// Enumeration
616// ====================================================================================================================
617
618/// supported slice type
619enum SliceType
620{
621  I_SLICE,
622  P_SLICE,
623  B_SLICE
624};
625
626/// supported partition shape
627enum PartSize
628{
629  SIZE_2Nx2N,           ///< symmetric motion partition,  2Nx2N
630  SIZE_2NxN,            ///< symmetric motion partition,  2Nx N
631  SIZE_Nx2N,            ///< symmetric motion partition,   Nx2N
632  SIZE_NxN,             ///< symmetric motion partition,   Nx N
633
634  SIZE_NONE = 15
635};
636
637//GT
638enum InterViewReference
639{
640  PREVVIEW = 0,
641  CURRVIEW = 1,
642  NEXTVIEW = 2
643};
644
645/// supported prediction type
646enum PredMode
647{
648  MODE_SKIP,            ///< SKIP mode
649  MODE_INTER,           ///< inter-prediction mode
650  MODE_INTRA,           ///< intra-prediction mode
651#if POZNAN_SYNTH
652  MODE_SYNTH,           ///< synth-mode
653#endif
654  MODE_NONE = 15
655};
656
657/// texture component type
658enum TextType
659{
660  TEXT_LUMA,            ///< luma
661  TEXT_CHROMA,          ///< chroma (U+V)
662  TEXT_CHROMA_U,        ///< chroma U
663  TEXT_CHROMA_V,        ///< chroma V
664  TEXT_ALL,             ///< Y+U+V
665  TEXT_NONE = 15
666};
667
668enum
669{
670  VIEWPOS_INVALID = -1,
671  VIEWPOS_LEFT    = 0,
672  VIEWPOS_RIGHT   = 1,
673  VIEWPOS_MERGED  = 2
674};
675
676/// reference list index
677enum RefPicList
678{
679  REF_PIC_LIST_0 = 0,   ///< reference list 0
680  REF_PIC_LIST_1 = 1,   ///< reference list 1
681#if DCM_COMB_LIST
682  REF_PIC_LIST_C = 2,   ///< combined reference list for uni-prediction in B-Slices
683#endif
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
723  DF_SSE_FRAME = 33     ///< Frame-based SSE
724};
725
726
727/// index for SBAC based RD optimization
728enum CI_IDX
729{
730  CI_CURR_BEST = 0,     ///< best mode index
731  CI_NEXT_BEST,         ///< next best index
732  CI_TEMP_BEST,         ///< temporal index
733  CI_CHROMA_INTRA,      ///< chroma intra index
734  CI_QT_TRAFO_TEST,
735  CI_QT_TRAFO_ROOT,
736  CI_NUM,               ///< total number
737};
738
739/// motion vector predictor direction used in AMVP
740enum MVP_DIR
741{
742  MD_LEFT = 0,          ///< MVP of left block
743  MD_ABOVE,             ///< MVP of above block
744  MD_ABOVE_RIGHT,       ///< MVP of above right block
745  MD_BELOW_LEFT,        ///< MVP of below left block
746  MD_ABOVE_LEFT         ///< MVP of above left block
747};
748
749/// motion vector prediction mode used in AMVP
750enum AMVP_MODE
751{
752  AM_NONE = 0,          ///< no AMVP mode
753  AM_EXPL,              ///< explicit signalling of motion vector index
754};
755
756/// interpolation filter type
757enum InterpFilterType
758{
759  IPF_SAMSUNG_DIF_DEFAULT = 0,          ///< Samsung DCT-based filter
760  IPF_HHI_4TAP_MOMS,                    ///< HHI 4-tap MOMS filter
761  IPF_HHI_6TAP_MOMS,                    ///< HHI 6-tap MOMS filter
762  IPF_LAST
763};
764
765#if QC_MDCS
766/// coefficient scanning type used in ACS
767enum COEFF_SCAN_TYPE
768{
769  SCAN_ZIGZAG = 0,      ///< typical zigzag scan
770  SCAN_HOR,             ///< horizontal first scan
771  SCAN_VER              ///< vertical first scan
772};
773#endif //QC_MDCS
774
775#endif
776
Note: See TracBrowser for help on using the repository browser.