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

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

Poznan Tools

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