Changeset 1413 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TypeDef.h


Ignore:
Timestamp:
11 Jul 2018, 15:19:49 (6 years ago)
Author:
tech
Message:

Merged HTM-16.2-dev@1412

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4040#endif
    4141#include <vector>
     42#include <utility>
     43
    4244//! \ingroup TLibCommon
    4345//! \{
     
    6062#define NH_MV          ( HEVC_EXT != 0)
    6163#define NH_3D          ( HEVC_EXT == 2)
     64
     65#define NH_MV_ALLOW_NON_CONFORMING                0   // Allow non-conforming representations formats
    6266/////////////////////////////////////////////////////////////////////////////////////////
    6367///////////////////////////////////   FIXES AND INTEGRATIONS     ////////////////////////
    6468/////////////////////////////////////////////////////////////////////////////////////////
    6569#if NH_MV
    66 // Recent bug fixes
    67 #define RM_INIT_FIX                      1
    68 #define RM_FIX_SETUP                     1
    69 #define NH_MV_FIX_VERT_MV_REST                         1
    70 
    71 #define NH_3D_FIX_INTRA_SDC_VSO_OFF              1
    72 #define NH_3D_FIX_TICKET_114                     1  //Mismatch between text and software on DPB size syntax
    73 #define NH_3D_FIX_LEAK                           1
    74 // Things that needs to be fixed also in the Specification ...
     70// Things that needs to be fixed also in the Specification ... CHECK if this has been done
    7571#define NH_MV_FIX_NO_REF_PICS_CHECK               1 // !!SPEC!!
    7672#define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS  1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!!
    7773#define NH_MV_FIX_NUM_POC_TOTAL_CUR               1 // Derivation of NumPocTotalCur for IDR pictures. !!SPEC!!
    7874// To be done
    79 #define NH_MV_HLS_PTL_LIMITS                       0
     75#define NH_MV_HLS_PTL_LIMITS                      0
    8076#define NH_MV_SEI_TBD                             0
    8177#endif
     
    8379///////////////////////////////////   MAJOR DEFINES   ///////////////////////////////////
    8480/////////////////////////////////////////////////////////////////////////////////////////
     81
     82
    8583#if NH_MV
    8684#define NH_MV_ENC_DEC_TRAC                 1  //< CU/PU level tracking
    8785#if NH_3D
    88 #define NH_3D_INTEGER_MV_DEPTH            1
    89 #define NH_3D_ENC_DEPTH                   1   // Encoder optimizations for depth, incl.
     86#define NH_3D_VSO                          1  // VSO, View synthesis optimization, includes:
     87// HHI_VSO
     88// HHI_VSO_LS_TABLE_M23714 enable table base Lagrange multiplier optimization
     89// SAIT_VSO_EST_A0033, JCT3V-A0033 modification 3
     90// LGE_WVSO_A0119
     91// SCU_HS_VSD_BUGFIX_IMPROV_G0163
     92
     93#define NH_3D_FAST_TEXTURE_ENCODING        1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
     94
     95/////////////////////////////////////////////////////////////////////////////////////////
     96///////////////////////////////////   REMOVED DEFINES   /////////////////////////////////
     97/////////////////////////////////////////////////////////////////////////////////////////
     98
     99//#define NH_3D_INTEGER_MV_DEPTH            1
     100
     101//#define NH_3D_ENC_DEPTH                   1   // Encoder optimizations for depth, incl.
    90102                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
    91103                                              // LG_ZEROINTRADEPTHRESI_A0087
    92104                                              // HHI_DMM4_ENC_I0066
    93105                                              // H_3D_FAST_DEPTH_INTRA
    94 #define NH_3D_FAST_TEXTURE_ENCODING       1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
    95 #define NH_3D_ARP                         1  // Advanced residual prediction (ARP), JCT3V-D0177
     106
     107//#define NH_3D_ARP                         1  // Advanced residual prediction (ARP), JCT3V-D0177
    96108                                             // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108
    97109                                             // SHARP_ARP_REF_CHECK_F0105        ARP reference picture selection and DPB check
     
    105117                                             // SEC_ARP_VIEW_REF_CHECK_J0037    Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1
    106118                                             // SEC_ARP_REM_ENC_RESTRICT_K0035    Removal of encoder restriction of ARP, JCT3V-K0035
    107 #define NH_3D_QTL                          1
    108 #define NH_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
     119//#define NH_3D_QTL                          1
     120//#define NH_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
    109121                                              // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
    110122                                              // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055
    111 #define NH_3D_VSO                          1   // VSO, View synthesis optimization, includes:
    112                                               // HHI_VSO
    113                                               // HHI_VSO_LS_TABLE_M23714 enable table base Lagrange multiplier optimization
    114                                               // SAIT_VSO_EST_A0033, JCT3V-A0033 modification 3
    115                                               // LGE_WVSO_A0119
    116                                               // SCU_HS_VSD_BUGFIX_IMPROV_G0163
    117 #define NH_3D_NBDV                         1   // Neighboring block disparity derivation
     123//#define NH_3D_NBDV                         1   // Neighboring block disparity derivation
    118124                                              // QC_JCT3V-A0097
    119125                                              // LGE_DVMCP_A0126
     
    131137                                              // MTK_TEXTURE_MRGCAND_BUGFIX_E0182  Bug fix for TEXTURE MERGING CANDIDATE     , JCT3V-E0182
    132138                                              // LGE_SIMP_DISP_AVAIL_J0041    // Use 2 status for disparity availability - DISP_AVAILABLE and DISP_NONE
    133 #define NH_3D_IC                          1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
     139//#define NH_3D_IC                          1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
    134140                                              // Unifying rounding offset, for IC part, JCT3V-D0135
    135141                                              // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     
    144150                                              // SEC_IC_NEIGHBOR_CLIP_I0080    // Clipping of neighboring sample position, JCT3V-I0080
    145151                                              // LGE_CHROMA_IC_J0050_J0034
    146 #if NH_3D_NBDV
    147 #define NH_3D_NBDV_REF                     1   // Depth oriented neighboring block disparity derivation
     152//#if NH_3D_NBDV
     153//#define NH_3D_NBDV_REF                     1   // Depth oriented neighboring block disparity derivation
    148154                                              // MTK_D0156
    149155                                              // MERL_D0166: Reference view selection in NBDV & Bi-VSP
     
    152158                                              // NTT_DoNBDV_VECTOR_CLIP_E0141 disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209
    153159                                              // SEC_VER_DONBDV_H0103          Vertical DV Restriction for DoNBDV
    154 #endif
    155 #define NH_3D_VSP                          1   // View synthesis prediction
     160//#endif
     161//#define NH_3D_VSP                          1   // View synthesis prediction
    156162                                              // MERL_C0152: Basic VSP
    157163                                              // MERL_D0166: Reference view selection in NBDV & Bi-VSP
     
    171177                                              // MTK_MRG_LIST_SIZE_CLEANUP_J0059   1   // Include VSP for deriving merge candidate list size, JCT3V-J0059
    172178                                              // SEC_A1_BASED_VSP_J0039            1   // Removal of redundant VSP in Merge list
    173 #define NH_3D_MLC                          1
    174 #define NH_3D_IV_MERGE                     1  // Inter-view motion merge candidate
     179//#define NH_3D_MLC                          1
     180//#define NH_3D_IV_MERGE                     1  // Inter-view motion merge candidate
    175181                                              // HHI_INTER_VIEW_MOTION_PRED
    176182                                              // SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction
     
    193199                                              // SEC_SIMP_SHIFTED_DV_I0086     Simplification of Shifted DV candidate, JCT3V-I0086
    194200                                              // SEC_SHIFTED_IVMC_POS_K0036    Position Derivation for Shifted-IVMC, JCT3V-K0036
    195 #define NH_3D_TEXT_MERGE                  1
     201//#define NH_3D_TEXT_MERGE                  1
    196202                                              // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
    197203                                              // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode
    198 #define NH_3D_TMVP                        1   // QC_TMVP_C0047
     204//#define NH_3D_TMVP                        1   // QC_TMVP_C0047
    199205                                              // Sony_M23639
    200206                                              // H_3D_TMVP_SCALING_FIX_K0053       1   // QC/CY for K0053
    201 #define NH_3D_DMM                         1   // Depth modeling modes
     207//#define NH_3D_DMM                         1   // Depth modeling modes
    202208                                              // HHI_DMM_PRED_TEX
    203209                                              // HHI_DMM_WEDGE_INTRA
     
    223229                                              // MTK_DMM_SIM_J0035
    224230                                              // SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation
    225 #define NH_3D_DLT                         1   // Depth Lookup Table
     231//#define NH_3D_DLT                         1   // Depth Lookup Table
    226232                                              // HHI_DELTADC_DLT_D0035
    227233                                              // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159
     
    231237                                              // RWTH_DLT_CLIP_I0057
    232238                                              // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup
    233 #define NH_3D_SDC_INTRA                   1   // Segment-wise DC Coding method for INTRA
    234 #define NH_3D_SDC_INTER                   1   // Segment-wise DC Coding method for INTER
     239//#define NH_3D_SDC_INTRA                   1   // Segment-wise DC Coding method for INTRA
     240//#define NH_3D_SDC_INTER                   1   // Segment-wise DC Coding method for INTER
    235241                                              // RWTH_SDC_DLT_B0036
    236242                                              // INTEL_SDC64_D0193
     
    252258                                              // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding
    253259                                              // SEC_INTER_SDC_G0101 Improved inter SDC with multiple DC candidates
    254 #define NH_3D_SPIVMP                       1   // H_3D_SPIVMP JCT3V-F0110: Sub-PU level inter-view motion prediction
     260//#define NH_3D_SPIVMP                       1   // H_3D_SPIVMP JCT3V-F0110: Sub-PU level inter-view motion prediction
    255261                                              // SEC_SPIVMP_MCP_SIZE_G0077, Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077
    256262                                              // QC_SPIVMP_MPI_G0119 Sub-PU level MPI merge candidate
    257263                                              // Simplification on Sub-PU level temporal interview motion prediction
    258264                                              // MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
    259 #define NH_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
     265//#define NH_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
    260266                                              // MTK_DBBP_AMP_REM_H0072
    261267                                              // RWTH_DBBP_NO_SPU_H0057
     
    270276                                              // RWTH_DBBP_NO_SATD_K0028
    271277                                              // HS_DBBP_CLEAN_K0048
    272 #define NH_3D_DIS                         1   // Depth intra skip
     278//#define NH_3D_DIS                         1   // Depth intra skip
    273279                                              // SEC_DEPTH_INTRA_SKIP_MODE_K0033  Depth intra skip mode
    274 #define H_3D_FCO                          0   // Flexible coding order for 3D
    275280// OTHERS
    276281                                              // MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 // Progressive MV Compression, JCT3V-E0170
     
    315320#endif
    316321////   ****** NEIGHBOURING BLOCK-BASED DISPARITY VECTOR  *********
    317 #if NH_3D_NBDV
     322#if NH_3D
    318323#define DVFROM_LEFT                       0
    319324#define DVFROM_ABOVE                      1
    320325#define IDV_CANDS                         2
    321 #endif
     326
    322327/////////////////////////////////////////////////////////////////////////////////////
    323328/// GT: Move values which are not flags to CommonDef.h and convert to static int !!
    324329///////////////////////////////////////////////////////////////////////////////////
    325330///// ***** ILLUMATION COMPENSATION *********
    326 #if NH_3D_IC
     331
    327332#define IC_REG_COST_SHIFT                 7
    328333#define IC_CONST_SHIFT                    5
    329334#define IC_SHIFT_DIFF                     12
    330335#define IC_LOW_LATENCY_ENCODING_THRESHOLD 0.1 // Threshold for low-latency IC encoding in JCT3V-H0086
    331 #endif
     336
    332337///// ***** DEPTH BASED BLOCK PARTITIONING *********
    333 #if NH_3D_DBBP
     338
    334339#define DBBP_INVALID_SHORT                (-4)
    335340#endif
     
    358363#endif
    359364
    360 #if NH_MV
    361 #if ENC_DEC_TRACE
    362 #define GT_DEBUG   1
    363 #else
    364 #define GT_DEBUG   0
    365 #endif
    366 #endif
    367365#define DEC_NUH_TRACE                                     0 ///< When trace enabled, enable tracing of NAL unit headers at the decoder (currently not possible at the encoder)
     366
    368367#define PRINT_RPS_INFO                                    0 ///< Enable/disable the printing of bits used to send the RPS.
    369368// ====================================================================================================================
     
    371370// ====================================================================================================================
    372371#define DECODER_CHECK_SUBSTREAM_AND_SLICE_TRAILING_BYTES  1 ///< TODO: integrate this macro into a broader conformance checking system.
    373 #define T0196_SELECTIVE_RDOQ                              1 ///< selective RDOQ
    374 #define U0040_MODIFIED_WEIGHTEDPREDICTION_WITH_BIPRED_AND_CLIPPING 1
    375 #define U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI    1 ///< Alternative transfer characteristics SEI message (JCTVC-U0033, with syntax naming from V1005)
    376 #define W0062_RECALCULATE_QP_TO_ALIGN_WITH_LAMBDA         0 ///< This recalculates QP to align with the derived lambda (same relation as for all intra coding is used). Currently disabled by default.
    377 #define OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP            1 ///< Adds command line option to reset SAO parameters after each IRAP.
    378 
     372#define X0038_LAMBDA_FROM_QP_CAPABILITY                   ( HEVC_EXT == 0 ) ///< This approach derives lambda from QP+QPoffset+QPoffset2. QPoffset2 is derived from QP+QPoffset using a linear model that is clipped between 0 and 3.
     373                                                            // To use this capability enable config parameter LambdaFromQpEnable
     374                                                            // GT: This is currently disabled for MV-HEVC and 3D-HEVC. Enabling requires modifications of the cfg-files
     375#define JCTVC_Y0038_PARAMS                                1
     376
     377#define JVET_E0059_FLOATING_POINT_QP_FIX                  1 ///< Replace floating point QP with a source-file frame number.
     378#define JVET_G0101_QP_SWITCHING                           1 ///< After switching POC, increase base QP instead of frame level QP.
     379
     380#define JVET_F0064_MSSSIM                                 1 ///< Calculate MS-SSIM scores
     381
     382#ifndef EXTENSION_360_VIDEO
     383#define EXTENSION_360_VIDEO                               0   ///< extension for 360/spherical video coding support; this macro should be controlled by makefile, as it would be used to control whether the library is built and linked
     384#endif
     385
     386#define MCTS_ENC_CHECK                                    1  ///< Temporal MCTS encoder constraint and decoder checks. Also requires SEITMCTSTileConstraint to be enabled to enforce constraint
    379387// ====================================================================================================================
    380388// Tool Switches
    381389// ====================================================================================================================
     390
     391// Please also refer to "TDecConformance.h" for DECODER_PARTIAL_CONFORMANCE_CHECK
     392
     393#define REDUCED_ENCODER_MEMORY                            0 ///< When 1, the encoder will allocate TComPic memory when required and release it when no longer required.
     394// GT: To be aligned
     395
    382396#define ADAPTIVE_QP_SELECTION                             1 ///< G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection
    383397#define AMP_ENC_SPEEDUP                                   1 ///< encoder only speed-up by AMP mode skipping
     
    399413#define RExt__HIGH_BIT_DEPTH_SUPPORT                                           0 ///< 0 (default) use data type definitions for 8-10 bit video, 1 = use larger data types to allow for up to 16-bit video (originally developed as part of N0188)
    400414#endif
    401 #define U0132_TARGET_BITS_SATURATION                      1 ///< Rate control with target bits saturation method
    402 #ifdef  U0132_TARGET_BITS_SATURATION
    403 #define V0078_ADAPTIVE_LOWER_BOUND                        1 ///< Target bits saturation with adaptive lower bound
    404 #endif
    405 #define W0038_DB_OPT                                      1 ///< adaptive DB parameter selection, LoopFilterOffsetInPPS and LoopFilterDisable are set to 0 and DeblockingFilterMetric=2;
    406 #define W0038_CQP_ADJ                                     1 ///< chroma QP adjustment based on TL, CQPTLAdjustEnabled is set to 1;
     415
     416#if defined __SSE2__ || defined __AVX2__ || defined __AVX__ || defined _M_AMD64 || defined _M_X64
     417#define VECTOR_CODING__INTERPOLATION_FILTER               1 ///< enable vector coding for the interpolation filter. 1 (default if SSE possible) disable SSE vector coding. Should not affect RD costs/decisions. Code back-ported from JEM2.0.
     418#define VECTOR_CODING__DISTORTION_CALCULATIONS            1 ///< enable vector coding for distortion calculations   1 (default if SSE possible) disable SSE vector coding. Should not affect RD costs/decisions. Code back-ported from JEM2.0.
     419#else
     420#define VECTOR_CODING__INTERPOLATION_FILTER               0 ///< enable vector coding for the interpolation filter. 0 (default if SSE not possible) disable SSE vector coding. Should not affect RD costs/decisions. Code back-ported from JEM2.0.
     421#define VECTOR_CODING__DISTORTION_CALCULATIONS            0 ///< enable vector coding for distortion calculations   0 (default if SSE not possible) disable SSE vector coding. Should not affect RD costs/decisions. Code back-ported from JEM2.0.
     422#endif
    407423
    408424// ====================================================================================================================
     
    706722  MD_ABOVE_LEFT         ///< MVP of above left block
    707723};
    708 #if NH_3D_MLC
     724#if NH_3D
    709725enum DefaultMergCandOrder
    710726{
     
    858874#if NH_MV
    859875    ,MULTIVIEWMAIN = 6,
    860 #if NH_3D
    861876    MAIN3D = 8,
     877#if NH_MV_ALLOW_NON_CONFORMING
     878    MULTIVIEWMAIN_NONCONFORMING = 29,
     879    MAIN3D_NONCONFORMING= 31,
    862880#endif
    863881#endif
     
    870888    MAIN = 0,
    871889    HIGH = 1,
     890    NUMBER_OF_TIERS = 2
    872891  };
    873892  enum Name
     
    9981017  NAL_UNIT_INVALID,
    9991018};
     1019
     1020enum LumaLevelToDQPMode
     1021{
     1022  LUMALVL_TO_DQP_DISABLED   = 0,
     1023  LUMALVL_TO_DQP_AVG_METHOD = 1, // use average of CTU to determine luma level
     1024  LUMALVL_TO_DQP_MAX_METHOD = 2,  // use maximum value of CTU to determine luma level
     1025  LUMALVL_TO_DQP_NUM_MODES  = 3
     1026};
     1027
    10001028#if NH_MV
    10011029/// scalability types
     
    11591187  UShort    whitePoint[2];
    11601188};
     1189
     1190struct LumaLevelToDeltaQPMapping
     1191{
     1192  LumaLevelToDQPMode                 mode;             ///< use deltaQP determined by block luma level
     1193  Double                             maxMethodWeight;  ///< weight of max luma value when mode = 2
     1194  std::vector< std::pair<Int, Int> > mapping;          ///< first=luma level, second=delta QP.
     1195  Bool isEnabled() const { return mode!=LUMALVL_TO_DQP_DISABLED; }
     1196};
     1197
     1198struct WCGChromaQPControl
     1199{
     1200  Bool isEnabled() const { return enabled; }
     1201  Bool   enabled;         ///< Enabled flag (0:default)
     1202  Double chromaCbQpScale; ///< Chroma Cb QP Scale (1.0:default)
     1203  Double chromaCrQpScale; ///< Chroma Cr QP Scale (1.0:default)
     1204  Double chromaQpScale;   ///< Chroma QP Scale (0.0:default)
     1205  Double chromaQpOffset;  ///< Chroma QP Offset (0.0:default)
     1206};
     1207
    11611208//! \}
    11621209#endif
Note: See TracChangeset for help on using the changeset viewer.