source: 3DVCSoftware/branches/0.2-poznan-univ/source/Lib/TLibCommon/TypeDef.h @ 15

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

Poznan Tool disability bug fix

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