source: 3DVCSoftware/trunk/source/Lib/TLibCommon/TypeDef.h @ 56

Last change on this file since 56 was 56, checked in by hschwarz, 12 years ago

updated trunk (move to HM6.1)

  • Property svn:eol-style set to native
File size: 28.0 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license.
5 *
6 * Copyright (c) 2010-2012, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/** \file     TypeDef.h
35    \brief    Define basic types, new types and enumerations
36*/
37
38#ifndef _TYPEDEF__
39#define _TYPEDEF__
40
41//! \ingroup TLibCommon
42//! \{
43
44#define SONY_COLPIC_AVAILABILITY          1
45
46#define HHI_INTER_VIEW_MOTION_PRED        1   // inter-view motion parameter prediction
47#define HHI_INTER_VIEW_RESIDUAL_PRED      1   // inter-view residual prediction
48
49#define HHI_VSO                           1
50#define HHI_VSO_LS_TABLE                  1
51#define HHI_VSO_DIST_INT                  1
52
53#define HHI_INTERVIEW_SKIP                1
54#define HHI_INTERVIEW_SKIP_LAMBDA_SCALE   1
55
56#define HHI_DMM_WEDGE_INTRA 1   // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction)
57#define HHI_DMM_PRED_TEX    1   // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction )
58
59#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
60#define DMM_WEDGEMODEL_MIN_SIZE           4
61#define DMM_WEDGEMODEL_MAX_SIZE          32
62#define DMM_WEDGE_PREDDIR_DELTAEND_MAX    4
63#endif
64
65#define HHI_MPI                         1   // motion parameter inheritance from texture picture for depth map coding
66#define HHI_MPI_MERGE_POS               0
67#define HHI_FULL_PEL_DEPTH_MAP_MV_ACC   1   // full-pel mv accuracy for depth maps
68
69
70
71
72
73#define SKIPFRAME_BUGFIX                  1 ///< bug fix to enable skipFrame at decoder
74#define START_DECODING_AT_CRA             1 ///< H0496, start decoding at clear random access point
75#define NO_COMBINED_PARALLEL              1 ///< Disallow any combined usage of parallel tools among Tile, EntropySlice and Wavefont
76
77#define LOSSLESS_CODING                   1  ///< H0530: lossless and lossy (mixed) coding
78#if LOSSLESS_CODING
79#define SEQUENCE_LEVEL_LOSSLESS           0  ///< H0530: used only for sequence or frame-level lossless coding
80#endif
81
82#define PARALLEL_MERGE  1                   //< H0082 parallel merge/skip
83#define LOG2_PARALLEL_MERGE_LEVEL_MINUS2 0  //< H0082 parallel merge level 0-> 4x4, 1-> 8x8, 2->16x16, 3->32x32, 4->64x64
84#if PARALLEL_MERGE && LOG2_PARALLEL_MERGE_LEVEL_MINUS2
85#define CU_BASED_MRG_CAND_LIST           1  //< H0240: single merge candidate list for all PUs inside a 8x8 CU conditioned on LOG2_PARALLEL_MERGE_LEVEL_MINUS2 > 0
86#endif
87#define MVP_AT_ENTROPYSLICE_BOUNDARY  1     //< H0362 enable motion prediction accross entropy slice boundary
88
89#define FAST_DECISION_FOR_MRG_RD_COST  1 ////< H0178: Fast Decision for Merge 2Nx2N RDCost
90
91#define PIC_CROPPING              1 ///< Picture cropping and size constraints
92#define NAL_REF_FLAG              1 ///< Change nal_ref_idc to nal_ref_flag (JCTVC-F463)
93#define REMOVE_DIV_OPERATION      1 ///< H0238: Simplified intra horizontal and vertical filtering
94#define LOGI_INTRA_NAME_3MPM      1  ///< H0407: logical Intra mode naming (sequential angular mode numbering) and 3 MPM mode coding
95
96#define LEVEL_CTX_LUMA_RED        1  ///<H0130: Luma level context reduction
97#define REMOVE_INFER_SIGGRP       1  ///<H0131: Remove inferred significant_coeff_group_flag
98
99#define SET_MERGE_TMVP_REFIDX     1  ///< H0278/H0199: Setting the merge TMVP refidx to 0 for the non-first partition
100
101#define MULTILEVEL_SIGMAP_EXT     1  ///< H0526: multi-level significance map extended to smaller TUs
102#define MULTIBITS_DATA_HIDING     1  ///< H0481: multiple sign bit hiding
103
104#define DEQUANT_CLIPPING           1  ///< H0312/H0541: transformed coefficients clipping before de-quantization
105
106#define REMOVE_NON_SCALED         1 ///< H0164/H0250: Removal of non-scaled merge candidate
107#define MRG_IDX_CTX_RED           1 ///< H0251: Merge index context reduction
108#define SIMP_MRG_PRUN             1 ///< H0252: simplification of merge pruning process
109
110#define AMVP_PRUNING_SIMPLIFICATION         1     ///H0316: simplify the pruning process of AMVP by exempting the temporal candidate
111#define AMVP_ZERO_CHECKING_REMOVAL          1     ///H0239/H0316: remove zero motion vector checking of AMVP
112
113#define H0111_MVD_L1_ZERO         1  ///< H0111: modification of bi-prediction
114#define DISABLING_CLIP_FOR_BIPREDME         1  ///< Ticket #175
115
116#define CLIPSCALEDMVP               1  ///< H0216: Clipping scaled MV to 16 bit
117
118#define UNIFIED_TRANSFORM_TREE      1   ///< H0123: unified tree structure for TU
119
120#define SIGMAP_CTX_SUBBLOCK       1 ///< H0290: 4x4 sub-block based region for significant_flag context selection
121
122#define SIGMAP_CONST_AT_HIGH_FREQUENCY      1      ///< H0095 method2.1: const significance map at high freaquency
123
124#define LAST_CTX_REDUCTION        1  ///< H0537/H514: contexts reduction for last position coding
125
126#define AMP_CTX                   1 ///<H0545: context reduction for asymmetric partition
127
128#define RESTRICT_GR1GR2FLAG_NUMBER    1 ///< H0554: Throughput improvement of CABAC coefficients level coding
129#if RESTRICT_GR1GR2FLAG_NUMBER    //
130#define C1FLAG_NUMBER               8 // maximum number of largerThan1 flag coded in one chunk :  16 in HM5
131#define C2FLAG_NUMBER               1 // maximum number of largerThan2 flag coded in one chunk:  16 in HM5
132#endif
133
134#define EIGHT_BITS_RICE_CODE        1 ///< H0498 : 8 bits rice codes
135
136#define SAO_UNIT_INTERLEAVING      1   ///< H0273
137#define REMOVE_SAO_LCU_ENC_CONSTRAINTS_1 0  ///< disable the encoder constraint that does not test SAO/BO mode for chroma in interleaved mode
138#define REMOVE_SAO_LCU_ENC_CONSTRAINTS_2 0  ///< disable the encoder constraint that reduce the range of SAO/EO for chroma in interleaved mode
139#define REMOVE_SAO_LCU_ENC_CONSTRAINTS_3 0  ///< disable the encoder constraint that conditionally disable SAO for chroma for entire slice in interleaved mode
140
141#define ALF_SINGLE_FILTER_SHAPE    1     //< !!! H0068: Single filter type : 9x7 cross + 3x3 square
142
143#define ALF_16_BA_GROUPS        1     ///< H0409 16 BA groups
144#define LCU_SYNTAX_ALF          1     ///< H0274 LCU-syntax ALF
145#define ALF_CHROMA_COEF_PRED_HARMONIZATION 1 ///< H0483: ALF chroma coeff pred harmonization
146
147#define CABAC_LINEAR_INIT       1     ///< H0535 : linear CABAC initialization
148
149#define COLLOCATED_REF_IDX      1     ///< H0442: signal collocated reference index
150
151#define UNIFIED_TRANSFORM       1     ///< H0492: unify square and non-square transform
152
153#define MAX_NUM_SPS                32
154#define MAX_NUM_PPS                256
155#define MAX_NUM_APS                32         //< !!!KS: number not defined in WD yet
156
157#define MRG_MAX_NUM_CANDS_SIGNALED         5   //<G091: value of maxNumMergeCand signaled in slice header
158
159#define WEIGHTED_CHROMA_DISTORTION  1   ///< F386: weighting of chroma for RDO
160#define RDOQ_CHROMA_LAMBDA          1   ///< F386: weighting of chroma for RDOQ
161#define ALF_CHROMA_LAMBDA           1   ///< F386: weighting of chroma for ALF
162#define SAO_CHROMA_LAMBDA           1   ///< F386: weighting of chroma for SAO
163
164#define MIN_SCAN_POS_CROSS          4
165
166#define FAST_BIT_EST                1   ///< G763: Table-based bit estimation for CABAC
167
168#define G519_TU_AMP_NSQT_HARMONIZATION  1   ///< G519: Harmonization of implicit TU, AMP and NSQT
169
170#define MLS_GRP_NUM                         64     ///< G644 : Max number of coefficient groups, max(16, 64)
171#define MLS_CG_SIZE                         4      ///< G644 : Coefficient group size of 4x4
172
173#define ADAPTIVE_QP_SELECTION               1      ///< G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection
174#if ADAPTIVE_QP_SELECTION
175#define ARL_C_PRECISION                     7      ///< G382: 7-bit arithmetic precision
176#define LEVEL_RANGE                         30     ///< G382: max coefficient level in statistics collection
177#endif
178
179
180#define CHROMA_MODE_CODING                   1     //H0326/H0475 : 2-length fixed, bypass coding for chroma intra prediction mode
181
182#define NSQT_LFFIX                           1     ///< Bug fix related to NSQT and deblocking filter
183#define NS_HAD                               1
184
185#define APS_BITS_FOR_SAO_BYTE_LENGTH 12
186#define APS_BITS_FOR_ALF_BYTE_LENGTH 8
187
188#define H0736_AVC_STYLE_QP_RANGE             1    ///< H0736: AVC style qp range and wrapping.
189#define H0204_QP_PREDICTION                  1    ///< H0204: improved QP prediction
190
191#define HHI_RQT_INTRA_SPEEDUP             1           ///< tests one best mode with full rqt
192#define HHI_RQT_INTRA_SPEEDUP_MOD         0           ///< tests two best modes with full rqt
193
194#define BURST_IPCM                        1           ///< H0051: Burst IPCM
195
196#if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP
197#error
198#endif
199
200#define H0137_0138_LIST_MODIFICATION      1           // Enabled reference picture lists combination (H0137) and reference picture list modification (H0138) updates
201#if !H0137_0138_LIST_MODIFICATION
202#error "H0137_0138_LIST_MODIFICATION must be enabled for multi-view coding."
203#endif
204
205#define VERBOSE_RATE 0                               ///< Print additional rate information in encoder
206
207#define AMVP_DECIMATION_FACTOR            4
208
209#define SCAN_SET_SIZE                     16
210#define LOG2_SCAN_SET_SIZE                4
211
212#define FAST_UDI_MAX_RDMODE_NUM               35          ///< maximum number of RD comparison in fast-UDI estimation loop
213
214#define ZERO_MVD_EST                          0           ///< Zero Mvd Estimation in normal mode
215
216#define NUM_INTRA_MODE 36
217#define LM_CHROMA_IDX  35
218
219#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
220enum MODE_IDX
221{
222  DMM_WEDGE_FULL_IDX         = NUM_INTRA_MODE,
223  DMM_WEDGE_FULL_D_IDX       = NUM_INTRA_MODE+1,
224  DMM_WEDGE_PREDTEX_IDX      = NUM_INTRA_MODE+2,
225  DMM_WEDGE_PREDTEX_D_IDX    = NUM_INTRA_MODE+3,
226  DMM_CONTOUR_PREDTEX_IDX    = NUM_INTRA_MODE+4,
227  DMM_CONTOUR_PREDTEX_D_IDX  = NUM_INTRA_MODE+5,
228  DMM_WEDGE_PREDDIR_IDX      = NUM_INTRA_MODE+6,
229  DMM_WEDGE_PREDDIR_D_IDX    = NUM_INTRA_MODE+7
230};
231#define NUM_DMM_MODE 8
232#elif HHI_DMM_WEDGE_INTRA && !HHI_DMM_PRED_TEX
233enum MODE_IDX
234{
235  DMM_WEDGE_FULL_IDX         = NUM_INTRA_MODE,
236  DMM_WEDGE_FULL_D_IDX       = NUM_INTRA_MODE+1,
237  DMM_WEDGE_PREDDIR_IDX      = NUM_INTRA_MODE+2,
238  DMM_WEDGE_PREDDIR_D_IDX    = NUM_INTRA_MODE+3
239};
240#define NUM_DMM_MODE 4
241#elif !HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
242enum MODE_IDX
243{
244  DMM_WEDGE_PREDTEX_IDX      = NUM_INTRA_MODE,
245  DMM_WEDGE_PREDTEX_D_IDX    = NUM_INTRA_MODE+1,
246  DMM_CONTOUR_PREDTEX_IDX    = NUM_INTRA_MODE+2,
247  DMM_CONTOUR_PREDTEX_D_IDX  = NUM_INTRA_MODE+3,
248};
249#define NUM_DMM_MODE 4
250#endif
251
252#define IBDI_DISTORTION                0           ///< enable/disable SSE modification when IBDI is used (JCTVC-D152)
253#define FIXED_ROUNDING_FRAME_MEMORY    0           ///< enable/disable fixed rounding to 8-bitdepth of frame memory when IBDI is used
254
255#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.
256#define PRINT_RPS_INFO                  0           ///< Enable/disable the printing of bits used to send the RPS.
257                                                    // using one nearest frame as reference frame, and the other frames are high quality (POC%4==0) frames (1+X)
258                                                    // this should be done with encoder only decision
259                                                    // but because of the absence of reference frame management, the related code was hard coded currently
260#define LTRP_MULT                       1           ///< enable/disable multiple long term reference pictures with same POC LSB
261
262#define OL_FLUSH 1          // Set to 1 to enable Wavefront Flush.
263#define OL_FLUSH_ALIGN 0    // Align flush to byte boundary.  This preserves byte operations in CABAC (faster) but at the expense of an average
264                            // of 4 bits per flush.
265                            // Setting to 0 will slow cabac by an as yet unknown amount.
266                            // This is here just to perform timing tests -- OL_FLUSH_ALIGN should be 0 for WPP.
267
268#define RVM_VCEGAM10_M 4
269
270#define PLANAR_IDX             0
271#if LOGI_INTRA_NAME_3MPM
272#define VER_IDX                26                    // index for intra VERTICAL   mode
273#define HOR_IDX                10                    // index for intra HORIZONTAL mode
274#define DC_IDX                 1                     // index for intra DC mode
275#else
276#define DC_IDX                 3                     // index for intra DC mode
277#endif
278#define NUM_CHROMA_MODE        6                     // total number of chroma modes
279#define DM_CHROMA_IDX          36                    // chroma mode index for derived from luma intra mode
280
281
282#define FAST_UDI_USE_MPM 1
283
284#define RDO_WITHOUT_DQP_BITS              0           ///< Disable counting dQP bits in RDO-based mode decision
285
286#define FULL_NBIT 0 ///< When enabled, does not use g_uiBitIncrement anymore to support > 8 bit data
287
288#define FIXED_NUMBER_OF_TILES_SLICE_MODE                1
289#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
290#define AD_HOC_SLICES_FIXED_NUMBER_OF_BYTES_IN_SLICE    2          ///< OPTION IDENTIFIER. mode==2 -> Limit maximum number of bins/bits in a slice
291#if FIXED_NUMBER_OF_TILES_SLICE_MODE
292#define AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE    3
293#endif
294
295// Entropy slice options
296#define SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE            1          ///< OPTION IDENTIFIER. Limit maximum number of largest coding tree blocks in an entropy slice
297#define SHARP_MULTIPLE_CONSTRAINT_BASED_ENTROPY_SLICE         2          ///< OPTION IDENTIFIER. Limit maximum number of bins/bits in an entropy slice
298
299#define LOG2_MAX_NUM_COLUMNS_MINUS1        7
300#define LOG2_MAX_NUM_ROWS_MINUS1           7
301#define LOG2_MAX_COLUMN_WIDTH              13
302#define LOG2_MAX_ROW_HEIGHT                13
303
304#define MAX_MARKER_PER_NALU                 1000
305
306#define MATRIX_MULT                             0   // Brute force matrix multiplication instead of partial butterfly
307
308#define REG_DCT 65535
309
310#define AMP_SAD                               1           ///< dedicated SAD functions for AMP
311#define AMP_ENC_SPEEDUP                       1           ///< encoder only speed-up by AMP mode skipping
312#if AMP_ENC_SPEEDUP
313#define AMP_MRG                               1           ///< encoder only force merge for AMP partition (no motion search for AMP)
314#endif
315
316#define SCALING_LIST_OUTPUT_RESULT    0 //JCTVC-G880/JCTVC-G1016 quantization matrices
317#define SCALING_LIST                  1 //JCTVC-H0230/H0461/H0237
318
319#define DEFAULT_DC                    1 // JCTVC-H0242
320
321#define RPS_IN_SPS                    1 // Adopted during discussion of JCTVC-H0423
322
323#define H0412_REF_PIC_LIST_RESTRICTION 1
324
325#define H0566_TLA                     1
326#if H0566_TLA
327#define H0566_TLA_SET_FOR_SWITCHING_POINTS 1
328#endif
329
330#define H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER 1
331
332#define DBL_H0473_PART_1          1   //Deblocking filtering simplification
333#define DBL_CONTROL               1   //PPS deblocking_filter_control_present_flag (JCTVC-H0398); condition for inherit params flag in SH (JCTVC-H0424)
334#define DBL_STRONG_FILTER_CLIP    1   //Introduction of strong filter clipping in deblocking filter (JCTVC-H0275)
335
336#define CABAC_INIT_FLAG             1 // JCTVC-H0540
337#define CABAC_INIT_PRESENT_FLAG     1
338
339#define H0388                       1 // JCTVC-H0388
340
341#define TILES_WPP_ENTRY_POINT_SIGNALLING        1 // JCTVC-H0556. Assumes either Tiles is ON or WPP is ON (not both simultaneously).
342#define REMOVE_TILE_DEPENDENCE                  1 // remove tile_boundary_independence_flag and dependent tiles
343#define TILES_OR_ENTROPY_SYNC_IDC               1 // tiles_or_entropy_coding_sync_idc flag
344#define COMPLETE_SLICES_IN_TILE     1 // Among the constraints between slices and tiles, all slices within a tile shall be complete (JCTVC-H0348/JCTVC-H0463) for SliceMode 1&2
345#define WPP_SIMPLIFICATION          1 // JCTVC-H0349/JCTVC-0517
346// ====================================================================================================================
347// Basic type redefinition
348// ====================================================================================================================
349
350typedef       void                Void;
351typedef       bool                Bool;
352
353typedef       char                Char;
354typedef       unsigned char       UChar;
355typedef       short               Short;
356typedef       unsigned short      UShort;
357typedef       int                 Int;
358typedef       unsigned int        UInt;
359typedef       double              Double;
360
361// ====================================================================================================================
362// 64-bit integer type
363// ====================================================================================================================
364
365#ifdef _MSC_VER
366typedef       __int64             Int64;
367
368#if _MSC_VER <= 1200 // MS VC6
369typedef       __int64             UInt64;   // MS VC6 does not support unsigned __int64 to double conversion
370#else
371typedef       unsigned __int64    UInt64;
372#endif
373
374#else
375
376typedef       long long           Int64;
377typedef       unsigned long long  UInt64;
378
379#endif
380
381// ====================================================================================================================
382// Type definition
383// ====================================================================================================================
384
385typedef       UChar           Pxl;        ///< 8-bit pixel type
386typedef       Short           Pel;        ///< 16-bit pixel type
387typedef       Int             TCoeff;     ///< transform coefficient
388
389
390// ====================================================================================================================
391// Define Distortion Types
392// ====================================================================================================================
393typedef       Int64           RMDist;     ///< renderer model distortion
394
395#if HHI_VSO_DIST_INT
396typedef       Int              Dist;       ///< RDO distortion
397#define       RDO_DIST_MIN     MIN_INT
398#define       RDO_DIST_MAX     MAX_INT
399#else
400typedef       UInt             Dist;       ///< RDO distortion
401#define       RDO_DIST_MIN     0
402#define       RDO_DIST_MAX     MAX_UINT
403#endif
404
405/// parameters for adaptive loop filter
406class TComPicSym;
407
408#define NUM_DOWN_PART 4
409
410enum SAOTypeLen
411{
412  SAO_EO_LEN    = 4,
413#if SAO_UNIT_INTERLEAVING
414  SAO_BO_LEN    = 4,
415  SAO_MAX_BO_CLASSES = 32
416#else
417  SAO_BO_LEN    = 16
418#endif
419};
420
421enum SAOType
422{
423  SAO_EO_0 = 0,
424  SAO_EO_1,
425  SAO_EO_2,
426  SAO_EO_3,
427#if SAO_UNIT_INTERLEAVING
428  SAO_BO,
429#else
430  SAO_BO_0,
431  SAO_BO_1,
432#endif
433  MAX_NUM_SAO_TYPE
434};
435
436typedef struct _SaoQTPart
437{
438#if !SAO_UNIT_INTERLEAVING
439  Bool        bEnableFlag;
440#endif
441  Int         iBestType;
442  Int         iLength;
443#if SAO_UNIT_INTERLEAVING
444  Int         bandPosition ;
445  Int         iOffset[4];
446#else
447  Int         iOffset[32];
448#endif
449  Int         StartCUX;
450  Int         StartCUY;
451  Int         EndCUX;
452  Int         EndCUY;
453
454  Int         PartIdx;
455  Int         PartLevel;
456  Int         PartCol;
457  Int         PartRow;
458
459  Int         DownPartsIdx[NUM_DOWN_PART];
460  Int         UpPartIdx;
461
462  Bool        bSplit;
463
464  //---- encoder only start -----//
465  Bool        bProcessed;
466  Double      dMinCost;
467  Int64       iMinDist;
468  Int         iMinRate;
469  //---- encoder only end -----//
470} SAOQTPart;
471
472#if SAO_UNIT_INTERLEAVING
473typedef struct _SaoLcuParam
474{
475  Bool       mergeUpFlag;
476  Bool       mergeLeftFlag;
477  Int        typeIdx;
478  Int        bandPosition;
479  Int        offset[4];
480  Int        runDiff;
481  Int        run;
482  Int        partIdx;
483  Int        partIdxTmp;
484  Int        length;
485} SaoLcuParam;
486#endif
487
488struct SAOParam
489{
490  Bool       bSaoFlag[3];
491  SAOQTPart* psSaoPart[3];
492  Int        iMaxSplitLevel;
493  Int        iNumClass[MAX_NUM_SAO_TYPE];
494#if SAO_UNIT_INTERLEAVING
495  Bool         oneUnitFlag[3];
496  SaoLcuParam* saoLcuParam[3];
497  Int          numCuInHeight;
498  Int          numCuInWidth;
499#endif
500  ~SAOParam();
501};
502
503struct ALFParam
504{
505  Int alf_flag;                           ///< indicates use of ALF
506#if !LCU_SYNTAX_ALF
507  Int chroma_idc;                         ///< indicates use of ALF for chroma
508#endif
509  Int num_coeff;                          ///< number of filter coefficients
510  Int filter_shape;
511#if !LCU_SYNTAX_ALF
512  Int filter_shape_chroma;
513  Int num_coeff_chroma;                   ///< number of filter coefficients (chroma)
514  Int *coeff_chroma;                      ///< filter coefficient array (chroma)
515#endif
516  Int *filterPattern;
517  Int startSecondFilter;
518  Int filters_per_group;
519  Int predMethod;
520  Int *nbSPred;
521  Int **coeffmulti;
522  Int minKStart;
523#if !LCU_SYNTAX_ALF
524  Int maxScanVal;
525  Int kMinTab[42];
526
527  Int alf_pcr_region_flag;
528  ~ALFParam();
529#endif
530#if LCU_SYNTAX_ALF
531  Int componentID;
532  Int* kMinTab;
533  //constructor, operator
534  ALFParam():componentID(-1){}
535  ALFParam(Int cID){create(cID);}
536  ALFParam(const ALFParam& src) {*this = src;}
537  ~ALFParam(){destroy();}
538  const ALFParam& operator= (const ALFParam& src);
539private:
540  Void create(Int cID);
541  Void destroy();
542  Void copy(const ALFParam& src);
543#endif
544};
545
546#if LCU_SYNTAX_ALF
547struct AlfUnitParam
548{
549  Int   mergeType;
550  Bool  isEnabled;
551  Bool  isNewFilt;
552  Int   storedFiltIdx;
553  ALFParam* alfFiltParam;
554  //constructor, operator
555  AlfUnitParam();
556  AlfUnitParam(const AlfUnitParam& src){ *this = src;}
557  const AlfUnitParam& operator= (const AlfUnitParam& src);
558  Bool operator == (const AlfUnitParam& cmp);
559};
560
561struct AlfParamSet
562{
563  Bool isEnabled[3];
564  Bool isUniParam[3];
565  Int  numLCUInWidth;
566  Int  numLCUInHeight;
567  Int  numLCU;
568  AlfUnitParam* alfUnitParam[3];
569  //constructor, operator
570  AlfParamSet(){create();}
571  ~AlfParamSet(){destroy();}
572  Void create(Int width =0, Int height=0, Int num=0);
573  Void init();
574  Void releaseALFParam();
575  Void createALFParam();
576private:
577  Void destroy();
578};
579#endif
580
581
582
583/// parameters for deblocking filter
584typedef struct _LFCUParam
585{
586  Bool bInternalEdge;                     ///< indicates internal edge
587  Bool bLeftEdge;                         ///< indicates left edge
588  Bool bTopEdge;                          ///< indicates top edge
589} LFCUParam;
590
591// ====================================================================================================================
592// Enumeration
593// ====================================================================================================================
594
595/// supported slice type
596enum SliceType
597{
598  I_SLICE,
599  P_SLICE,
600  B_SLICE
601};
602
603/// chroma formats (according to semantics of chroma_format_idc)
604enum ChromaFormat
605{
606  CHROMA_400  = 0,
607  CHROMA_420  = 1,
608  CHROMA_422  = 2,
609  CHROMA_444  = 3
610};
611
612/// supported partition shape
613enum PartSize
614{
615  SIZE_2Nx2N,           ///< symmetric motion partition,  2Nx2N
616  SIZE_2NxN,            ///< symmetric motion partition,  2Nx N
617  SIZE_Nx2N,            ///< symmetric motion partition,   Nx2N
618  SIZE_NxN,             ///< symmetric motion partition,   Nx N
619  SIZE_2NxnU,           ///< asymmetric motion partition, 2Nx( N/2) + 2Nx(3N/2)
620  SIZE_2NxnD,           ///< asymmetric motion partition, 2Nx(3N/2) + 2Nx( N/2)
621  SIZE_nLx2N,           ///< asymmetric motion partition, ( N/2)x2N + (3N/2)x2N
622  SIZE_nRx2N,           ///< asymmetric motion partition, (3N/2)x2N + ( N/2)x2N
623  SIZE_NONE = 15
624};
625
626/// supported prediction type
627enum PredMode
628{
629  MODE_SKIP,            ///< SKIP mode
630  MODE_INTER,           ///< inter-prediction mode
631  MODE_INTRA,           ///< intra-prediction mode
632  MODE_NONE = 15
633};
634
635/// texture component type
636enum TextType
637{
638  TEXT_LUMA,            ///< luma
639  TEXT_CHROMA,          ///< chroma (U+V)
640  TEXT_CHROMA_U,        ///< chroma U
641  TEXT_CHROMA_V,        ///< chroma V
642  TEXT_ALL,             ///< Y+U+V
643  TEXT_NONE = 15
644};
645
646/// reference list index
647enum RefPicList
648{
649  REF_PIC_LIST_0 = 0,   ///< reference list 0
650  REF_PIC_LIST_1 = 1,   ///< reference list 1
651  REF_PIC_LIST_C = 2,   ///< combined reference list for uni-prediction in B-Slices
652  REF_PIC_LIST_X = 100  ///< special mark
653};
654
655/// distortion function index
656enum DFunc
657{
658  DF_DEFAULT  = 0,
659  DF_SSE      = 1,      ///< general size SSE
660  DF_SSE4     = 2,      ///<   4xM SSE
661  DF_SSE8     = 3,      ///<   8xM SSE
662  DF_SSE16    = 4,      ///<  16xM SSE
663  DF_SSE32    = 5,      ///<  32xM SSE
664  DF_SSE64    = 6,      ///<  64xM SSE
665  DF_SSE16N   = 7,      ///< 16NxM SSE
666
667  DF_SAD      = 8,      ///< general size SAD
668  DF_SAD4     = 9,      ///<   4xM SAD
669  DF_SAD8     = 10,     ///<   8xM SAD
670  DF_SAD16    = 11,     ///<  16xM SAD
671  DF_SAD32    = 12,     ///<  32xM SAD
672  DF_SAD64    = 13,     ///<  64xM SAD
673  DF_SAD16N   = 14,     ///< 16NxM SAD
674
675  DF_SADS     = 15,     ///< general size SAD with step
676  DF_SADS4    = 16,     ///<   4xM SAD with step
677  DF_SADS8    = 17,     ///<   8xM SAD with step
678  DF_SADS16   = 18,     ///<  16xM SAD with step
679  DF_SADS32   = 19,     ///<  32xM SAD with step
680  DF_SADS64   = 20,     ///<  64xM SAD with step
681  DF_SADS16N  = 21,     ///< 16NxM SAD with step
682
683  DF_HADS     = 22,     ///< general size Hadamard with step
684  DF_HADS4    = 23,     ///<   4xM HAD with step
685  DF_HADS8    = 24,     ///<   8xM HAD with step
686  DF_HADS16   = 25,     ///<  16xM HAD with step
687  DF_HADS32   = 26,     ///<  32xM HAD with step
688  DF_HADS64   = 27,     ///<  64xM HAD with step
689  DF_HADS16N  = 28,     ///< 16NxM HAD with step
690
691#if AMP_SAD
692  DF_SAD12    = 43,
693  DF_SAD24    = 44,
694  DF_SAD48    = 45,
695
696  DF_SADS12   = 46,
697  DF_SADS24   = 47,
698  DF_SADS48   = 48,
699
700  DF_SSE_FRAME = 50     ///< Frame-based SSE
701#else
702  DF_SSE_FRAME = 33     ///< Frame-based SSE
703#endif
704};
705
706/// index for SBAC based RD optimization
707enum CI_IDX
708{
709  CI_CURR_BEST = 0,     ///< best mode index
710  CI_NEXT_BEST,         ///< next best index
711  CI_TEMP_BEST,         ///< temporal index
712  CI_CHROMA_INTRA,      ///< chroma intra index
713  CI_QT_TRAFO_TEST,
714  CI_QT_TRAFO_ROOT,
715  CI_NUM,               ///< total number
716};
717
718/// motion vector predictor direction used in AMVP
719enum MVP_DIR
720{
721  MD_LEFT = 0,          ///< MVP of left block
722  MD_ABOVE,             ///< MVP of above block
723  MD_ABOVE_RIGHT,       ///< MVP of above right block
724  MD_BELOW_LEFT,        ///< MVP of below left block
725  MD_ABOVE_LEFT         ///< MVP of above left block
726};
727
728/// motion vector prediction mode used in AMVP
729enum AMVP_MODE
730{
731  AM_NONE = 0,          ///< no AMVP mode
732  AM_EXPL,              ///< explicit signalling of motion vector index
733};
734
735/// coefficient scanning type used in ACS
736enum COEFF_SCAN_TYPE
737{
738  SCAN_ZIGZAG = 0,      ///< typical zigzag scan
739  SCAN_HOR,             ///< horizontal first scan
740  SCAN_VER,              ///< vertical first scan
741  SCAN_DIAG              ///< up-right diagonal scan
742};
743
744// Renderer
745enum
746{
747  VIEWPOS_INVALID = -1,
748  VIEWPOS_LEFT    = 0,
749  VIEWPOS_RIGHT   = 1,
750  VIEWPOS_MERGED  = 2
751};
752
753
754//! \}
755
756#endif
757
758
Note: See TracBrowser for help on using the repository browser.