Changeset 1335 in SHVCSoftware


Ignore:
Timestamp:
22 Jul 2015, 02:37:09 (9 years ago)
Author:
seregin
Message:

port rev 4413

Location:
branches/SHM-dev/source
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppDownConvert/DownConvert.h

    r1259 r1335  
    4040
    4141#include <cassert>
    42 #include "../../Lib/TLibCommon/TypeDef.h"
     42#include "../../Lib/TLibCommon/CommonDef.h"
    4343
    4444#ifndef  gMax
  • branches/SHM-dev/source/Lib/TLibCommon/CommonDef.h

    r1333 r1335  
    3333
    3434/** \file     CommonDef.h
    35     \brief    Defines constants, macros and tool parameters
     35    \brief    Defines version information, constants and small in-line functions
    3636*/
    3737
     
    116116// ====================================================================================================================
    117117
    118 #define MAX_GOP                     64          ///< max. value of hierarchical GOP size
    119 
    120 #define MAX_NUM_REF_PICS            16          ///< max. number of pictures used for reference
    121 #define MAX_NUM_REF                 16          ///< max. number of entries in picture reference list
    122 
    123 #define MAX_UINT                    0xFFFFFFFFU ///< max. value of unsigned 32-bit integer
    124 #define MAX_INT                     2147483647  ///< max. value of signed 32-bit integer
    125 #define MAX_INT64                   0x7FFFFFFFFFFFFFFFLL  ///< max. value of signed 64-bit integer
    126 #if RExt__HIGH_BIT_DEPTH_SUPPORT
    127 #define MAX_INTERMEDIATE_INT        MAX_INT64
    128 #else
    129 #define MAX_INTERMEDIATE_INT        MAX_INT
    130 #endif
    131 
    132 #define MAX_DOUBLE                  1.7e+308    ///< max. value of Double-type value
    133 
    134 #define MIN_QP                      0
    135 #define MAX_QP                      51
    136 
    137 #define NOT_VALID                   -1
     118static const UInt   MAX_UINT =                            0xFFFFFFFFU; ///< max. value of unsigned 32-bit integer
     119static const Int    MAX_INT =                              2147483647; ///< max. value of signed 32-bit integer
     120static const Double MAX_DOUBLE =                             1.7e+308; ///< max. value of Double-type value
     121
     122// ====================================================================================================================
     123// Coding tool configuration
     124// ====================================================================================================================
     125// Most of these should not be changed - they resolve the meaning of otherwise magic numbers.
     126
     127static const Int MAX_GOP =                                         64; ///< max. value of hierarchical GOP size
     128static const Int MAX_NUM_REF_PICS =                                16; ///< max. number of pictures used for reference
     129static const Int MAX_NUM_REF =                                     16; ///< max. number of entries in picture reference list
     130static const Int MAX_QP =                                          51;
     131static const Int NOT_VALID =                                       -1;
     132
     133static const Int AMVP_MAX_NUM_CANDS =                               2; ///< AMVP: advanced motion vector prediction - max number of final candidates
     134static const Int AMVP_MAX_NUM_CANDS_MEM =                           3; ///< AMVP: advanced motion vector prediction - max number of candidates
     135static const Int AMVP_DECIMATION_FACTOR =                           4;
     136static const Int MRG_MAX_NUM_CANDS =                                5; ///< MERGE
     137
     138
     139static const Int MAX_TLAYER =                                       7; ///< Explicit temporal layer QP offset - max number of temporal layer
     140
     141static const Int ADAPT_SR_SCALE =                                   1; ///< division factor for adaptive search range
     142
     143static const Int MAX_NUM_PICS_IN_SOP =                           1024;
     144
     145static const Int MAX_NESTING_NUM_OPS =                           1024;
     146static const Int MAX_NESTING_NUM_LAYER =                           64;
     147
     148static const Int MAX_VPS_NUM_HRD_PARAMETERS =                       1;
     149static const Int MAX_VPS_OP_SETS_PLUS1 =                         1024;
     150static const Int MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 =         1;
     151
     152static const Int MAXIMUM_INTRA_FILTERED_WIDTH =                    16;
     153static const Int MAXIMUM_INTRA_FILTERED_HEIGHT =                   16;
     154
     155static const Int MAX_CPB_CNT =                                     32; ///< Upper bound of (cpb_cnt_minus1 + 1)
     156#if SVC_EXTENSION
     157static const Int MAX_NUM_LAYER_IDS =                               63;
     158#else
     159static const Int MAX_NUM_LAYER_IDS =                               64;
     160#endif
     161
     162static const Int COEF_REMAIN_BIN_REDUCTION =                        3; ///< indicates the level at which the VLC transitions from Golomb-Rice to TU+EG(k)
     163
     164static const Int CU_DQP_TU_CMAX =                                   5; ///< max number bins for truncated unary
     165static const Int CU_DQP_EG_k =                                      0; ///< expgolomb order
     166
     167static const Int SBH_THRESHOLD =                                    4; ///< value of the fixed SBH controlling threshold
     168
     169static const Int C1FLAG_NUMBER =                                    8; // maximum number of largerThan1 flag coded in one chunk:  16 in HM5
     170static const Int C2FLAG_NUMBER =                                    1; // maximum number of largerThan2 flag coded in one chunk:  16 in HM5
     171
     172static const Int MAX_NUM_VPS =                                     16;
     173static const Int MAX_NUM_SPS =                                     16;
     174static const Int MAX_NUM_PPS =                                     64;
     175
     176
     177static const Int MLS_GRP_NUM =                                     64; ///< Max number of coefficient groups, max(16, 64)
     178static const Int MLS_CG_LOG2_WIDTH =                                2;
     179static const Int MLS_CG_LOG2_HEIGHT =                               2;
     180static const Int MLS_CG_SIZE =                                      4; ///< Coefficient group size of 4x4; = MLS_CG_LOG2_WIDTH + MLS_CG_LOG2_HEIGHT
     181
     182#if ADAPTIVE_QP_SELECTION
     183static const Int ARL_C_PRECISION =                                  7; ///< G382: 7-bit arithmetic precision
     184static const Int LEVEL_RANGE =                                     30; ///< G382: max coefficient level in statistics collection
     185#endif
     186
     187static const Int RVM_VCEGAM10_M =                                   4;
     188
     189static const Int FAST_UDI_MAX_RDMODE_NUM =                         35; ///< maximum number of RD comparison in fast-UDI estimation loop
     190
     191static const Int NUM_INTRA_MODE =                                  36;
     192static const Int PLANAR_IDX =                                       0;
     193static const Int VER_IDX =                                         26; ///< index for intra VERTICAL   mode
     194static const Int HOR_IDX =                                         10; ///< index for intra HORIZONTAL mode
     195static const Int DC_IDX =                                           1; ///< index for intra DC mode
     196static const Int NUM_CHROMA_MODE =                                  5; ///< total number of chroma modes
     197static const Int DM_CHROMA_IDX =                                   36; ///< chroma mode index for derived from luma intra mode
     198
     199static const Int MDCS_ANGLE_LIMIT =                                 4; ///< 0 = Horizontal/vertical only, 1 = Horizontal/vertical +/- 1, 2 = Horizontal/vertical +/- 2 etc...
     200static const Int MDCS_MAXIMUM_WIDTH =                               8; ///< (measured in pixels) TUs with width greater than this can only use diagonal scan
     201static const Int MDCS_MAXIMUM_HEIGHT =                              8; ///< (measured in pixels) TUs with height greater than this can only use diagonal scan
     202
     203
     204static const Int LOG2_MAX_NUM_COLUMNS_MINUS1 =                      7;
     205static const Int LOG2_MAX_NUM_ROWS_MINUS1 =                         7;
     206
     207static const Int CABAC_INIT_PRESENT_FLAG =                          1;
     208
     209static const Int LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS =   4;
     210static const Int CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS = 8;
     211
     212static const Int MAX_NUM_LONG_TERM_REF_PICS =                      33;
     213static const Int NUM_LONG_TERM_REF_PIC_SPS =                        0;
     214
     215
     216static const Int MAX_QP_OFFSET_LIST_SIZE =                          6; ///< Maximum size of QP offset list is 6 entries
     217
     218// Cost mode support
     219static const Int LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP =      0; ///< QP to use for lossless coding.
     220static const Int LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME =4; ///< QP' to use for mixed_lossy_lossless coding.
     221
     222static const Int RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS =     4;
     223static const Int RExt__GOLOMB_RICE_INCREMENT_DIVISOR =              4;
     224
     225static const Int RExt__PREDICTION_WEIGHTING_ANALYSIS_DC_PRECISION = 0; ///< Additional fixed bit precision used during encoder-side weighting prediction analysis. Currently only used when high_precision_prediction_weighting_flag is set, for backwards compatibility reasons.
     226
     227static const Int MAX_TIMECODE_SEI_SETS =                            3; ///< Maximum number of time sets
     228
     229static const Int MAX_CU_DEPTH =                                     6; ///< log2(CTUSize)
     230static const Int MAX_CU_SIZE =                                     64; ///< = 1<<(MAX_CU_DEPTH)
     231static const Int MIN_PU_SIZE =                                      4;
     232static const Int MIN_TU_SIZE =                                      4;
     233static const Int MAX_TU_SIZE =                                     32;
     234static const Int MAX_NUM_PART_IDXS_IN_CTU_WIDTH = MAX_CU_SIZE/MIN_PU_SIZE; ///< maximum number of partition indices across the width of a CTU (or height of a CTU)
     235static const Int SCALING_LIST_REM_NUM =                             6;
     236
     237static const Int QUANT_SHIFT =                                     14; ///< Q(4) = 2^14
     238static const Int IQUANT_SHIFT =                                     6;
     239static const Int SCALE_BITS =                                      15; ///< For fractional bit estimates in RDOQ
     240
     241static const Int SCALING_LIST_NUM = MAX_NUM_COMPONENT * NUMBER_OF_PREDICTION_MODES; ///< list number for quantization matrix
     242
     243static const Int SCALING_LIST_START_VALUE =                        8 ; ///< start value for dpcm mode
     244static const Int MAX_MATRIX_COEF_NUM =                            64 ; ///< max coefficient number for quantization matrix
     245static const Int MAX_MATRIX_SIZE_NUM =                             8 ; ///< max size number for quantization matrix
     246static const Int SCALING_LIST_BITS =                               8 ; ///< bit depth of scaling list entries
     247static const Int LOG2_SCALING_LIST_NEUTRAL_VALUE =                 4 ; ///< log2 of the value that, when used in a scaling list, has no effect on quantisation
     248static const Int SCALING_LIST_DC =                                16 ; ///< default DC value
     249
     250static const Int CONTEXT_STATE_BITS =                              6 ;
     251static const Int LAST_SIGNIFICANT_GROUPS =                        10 ;
     252
    138253
    139254// ====================================================================================================================
     
    180295template <typename ValueType> inline ValueType rightShiftEvenRounding(const ValueType value, const UInt shift) { return (shift == 0) ? value : ((value + (1<<(shift-1))-1 + ((value>>shift)&1)) >> shift) ; }
    181296#endif
    182 
    183 // ====================================================================================================================
    184 // Coding tool configuration
    185 // ====================================================================================================================
    186 
    187 // AMVP: advanced motion vector prediction
    188 #define AMVP_MAX_NUM_CANDS          2           ///< max number of final candidates
    189 #define AMVP_MAX_NUM_CANDS_MEM      3           ///< max number of candidates
    190 // MERGE
    191 #define MRG_MAX_NUM_CANDS           5
    192 
    193 // Reference memory management
    194 #define DYN_REF_FREE                0           ///< dynamic free of reference memories
    195 
    196 // Explicit temporal layer QP offset
    197 #define MAX_TLAYER                  7           ///< max number of temporal layer
    198 
    199 // Fast estimation of generalized B in low-delay mode
    200 #define GPB_SIMPLE_UNI              1           ///< Simple mode for uni-direction
    201 
    202 // Adaptive search range depending on POC difference
    203 #define ADAPT_SR_SCALE              1           ///< division factor for adaptive search range
    204 
    205 // Early-skip threshold (encoder)
    206 #define EARLY_SKIP_THRES            1.50        ///< if RD < thres*avg[BestSkipRD]
    207 
    208 
    209 #define MAX_CHROMA_FORMAT_IDC      3
    210 
    211 // TODO: Existing names used for the different NAL unit types can be altered to better reflect the names in the spec.
    212 //       However, the names in the spec are not yet stable at this point. Once the names are stable, a cleanup
    213 //       effort can be done without use of macros to alter the names used to indicate the different NAL unit types.
    214 enum NalUnitType
    215 {
    216   NAL_UNIT_CODED_SLICE_TRAIL_N = 0, // 0
    217   NAL_UNIT_CODED_SLICE_TRAIL_R,     // 1
    218 
    219   NAL_UNIT_CODED_SLICE_TSA_N,       // 2
    220   NAL_UNIT_CODED_SLICE_TSA_R,       // 3
    221 
    222   NAL_UNIT_CODED_SLICE_STSA_N,      // 4
    223   NAL_UNIT_CODED_SLICE_STSA_R,      // 5
    224 
    225   NAL_UNIT_CODED_SLICE_RADL_N,      // 6
    226   NAL_UNIT_CODED_SLICE_RADL_R,      // 7
    227 
    228   NAL_UNIT_CODED_SLICE_RASL_N,      // 8
    229   NAL_UNIT_CODED_SLICE_RASL_R,      // 9
    230 
    231   NAL_UNIT_RESERVED_VCL_N10,
    232   NAL_UNIT_RESERVED_VCL_R11,
    233   NAL_UNIT_RESERVED_VCL_N12,
    234   NAL_UNIT_RESERVED_VCL_R13,
    235   NAL_UNIT_RESERVED_VCL_N14,
    236   NAL_UNIT_RESERVED_VCL_R15,
    237 
    238   NAL_UNIT_CODED_SLICE_BLA_W_LP,    // 16
    239   NAL_UNIT_CODED_SLICE_BLA_W_RADL,  // 17
    240   NAL_UNIT_CODED_SLICE_BLA_N_LP,    // 18
    241   NAL_UNIT_CODED_SLICE_IDR_W_RADL,  // 19
    242   NAL_UNIT_CODED_SLICE_IDR_N_LP,    // 20
    243   NAL_UNIT_CODED_SLICE_CRA,         // 21
    244   NAL_UNIT_RESERVED_IRAP_VCL22,
    245   NAL_UNIT_RESERVED_IRAP_VCL23,
    246 
    247   NAL_UNIT_RESERVED_VCL24,
    248   NAL_UNIT_RESERVED_VCL25,
    249   NAL_UNIT_RESERVED_VCL26,
    250   NAL_UNIT_RESERVED_VCL27,
    251   NAL_UNIT_RESERVED_VCL28,
    252   NAL_UNIT_RESERVED_VCL29,
    253   NAL_UNIT_RESERVED_VCL30,
    254   NAL_UNIT_RESERVED_VCL31,
    255 
    256   NAL_UNIT_VPS,                     // 32
    257   NAL_UNIT_SPS,                     // 33
    258   NAL_UNIT_PPS,                     // 34
    259   NAL_UNIT_ACCESS_UNIT_DELIMITER,   // 35
    260   NAL_UNIT_EOS,                     // 36
    261   NAL_UNIT_EOB,                     // 37
    262   NAL_UNIT_FILLER_DATA,             // 38
    263   NAL_UNIT_PREFIX_SEI,              // 39
    264   NAL_UNIT_SUFFIX_SEI,              // 40
    265 
    266   NAL_UNIT_RESERVED_NVCL41,
    267   NAL_UNIT_RESERVED_NVCL42,
    268   NAL_UNIT_RESERVED_NVCL43,
    269   NAL_UNIT_RESERVED_NVCL44,
    270   NAL_UNIT_RESERVED_NVCL45,
    271   NAL_UNIT_RESERVED_NVCL46,
    272   NAL_UNIT_RESERVED_NVCL47,
    273   NAL_UNIT_UNSPECIFIED_48,
    274   NAL_UNIT_UNSPECIFIED_49,
    275   NAL_UNIT_UNSPECIFIED_50,
    276   NAL_UNIT_UNSPECIFIED_51,
    277   NAL_UNIT_UNSPECIFIED_52,
    278   NAL_UNIT_UNSPECIFIED_53,
    279   NAL_UNIT_UNSPECIFIED_54,
    280   NAL_UNIT_UNSPECIFIED_55,
    281   NAL_UNIT_UNSPECIFIED_56,
    282   NAL_UNIT_UNSPECIFIED_57,
    283   NAL_UNIT_UNSPECIFIED_58,
    284   NAL_UNIT_UNSPECIFIED_59,
    285   NAL_UNIT_UNSPECIFIED_60,
    286   NAL_UNIT_UNSPECIFIED_61,
    287   NAL_UNIT_UNSPECIFIED_62,
    288   NAL_UNIT_UNSPECIFIED_63,
    289   NAL_UNIT_INVALID,
    290 };
    291297
    292298#if SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp

    r1286 r1335  
    4747static const UInt settingValueWidth = 3;
    4848
    49 #ifdef DEBUG_STRING
     49#if DEBUG_STRING
    5050// these strings are used to reorder the debug output so that the encoder and decoder match.
    5151const Char *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1]
     
    153153EnvVar DebugOptionList::ForceChromaMode       ("FORCE_CHROMA_MODE", "0", "Force a particular intra direction for chroma (0-5)"                                            );
    154154
    155 #ifdef DEBUG_STRING
     155#if DEBUG_STRING
    156156EnvVar DebugOptionList::DebugString_Structure ("DEBUG_STRUCTURE",   "0", "Produce output on chosen structure                        bit0=intra, bit1=inter");
    157157EnvVar DebugOptionList::DebugString_Pred      ("DEBUG_PRED",        "0", "Produce output on prediction data.                        bit0=intra, bit1=inter");
     
    179179  PRINT_CONSTANT(O0043_BEST_EFFORT_DECODING,                                        settingNameWidth, settingValueWidth);
    180180
    181   PRINT_CONSTANT(RD_TEST_SAO_DISABLE_AT_PICTURE_LEVEL,                              settingNameWidth, settingValueWidth);
    182 
    183181  //------------------------------------------------
    184182
     
    193191UInt  g_debugCounter  = 0;
    194192
    195 #ifdef DEBUG_ENCODER_SEARCH_BINS
     193#if DEBUG_ENCODER_SEARCH_BINS
    196194const UInt debugEncoderSearchBinTargetLine = 0;
    197195const UInt debugEncoderSearchBinWindow     = 1000000;
    198196#endif
    199197
    200 #ifdef DEBUG_CABAC_BINS
     198#if DEBUG_CABAC_BINS
    201199const UInt debugCabacBinTargetLine = 0;
    202200const UInt debugCabacBinWindow     = 1000000;
     
    458456}
    459457
    460 #ifdef DEBUG_STRING
     458#if DEBUG_STRING
    461459Int DebugStringGetPredModeMask(PredMode mode)
    462460{
  • branches/SHM-dev/source/Lib/TLibCommon/Debug.h

    r1286 r1335  
    4747#include <TLibCommon/CommonDef.h>
    4848
    49 #ifdef DEBUG_STRING
     49#if DEBUG_STRING
    5050extern const Char *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1];
    5151extern const Char *partSizeToString[NUMBER_OF_PART_SIZES];
     
    103103  extern EnvVar ForceChromaMode;
    104104
    105 #ifdef DEBUG_STRING
     105#if DEBUG_STRING
    106106  extern EnvVar DebugString_Structure;
    107107  extern EnvVar DebugString_Pred;
     
    122122extern UInt g_debugCounter;
    123123
    124 #ifdef DEBUG_ENCODER_SEARCH_BINS
     124#if DEBUG_ENCODER_SEARCH_BINS
    125125extern const UInt debugEncoderSearchBinTargetLine;
    126126extern const UInt debugEncoderSearchBinWindow;
    127127#endif
    128128
    129 #ifdef DEBUG_CABAC_BINS
     129#if DEBUG_CABAC_BINS
    130130extern const UInt debugCabacBinTargetLine;
    131131extern const UInt debugCabacBinWindow;
     
    270270// ---------------------------------------------------------------------------------------------- //
    271271
    272 #ifdef DEBUG_STRING
     272#if DEBUG_STRING
    273273  Int DebugStringGetPredModeMask(PredMode mode);
    274274  Void DebugInterPredResiReco(std::string &sDebug, TComYuv &pred, TComYuv &resi, TComYuv &reco, Int predmode_mask);
  • branches/SHM-dev/source/Lib/TLibCommon/SEI.h

    r1302 r1335  
    4040#include <cstring>
    4141
    42 #include "TypeDef.h"
     42#include "CommonDef.h"
    4343#include "libmd5/MD5.h"
    4444#if SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.cpp

    r1297 r1335  
    4242#include <algorithm>
    4343
    44 #include "TypeDef.h"
     44#include "CommonDef.h"
    4545#include "TCom3DAsymLUT.h"
    4646#include "TComPicYuv.h"
  • branches/SHM-dev/source/Lib/TLibCommon/TCom3DAsymLUT.h

    r1297 r1335  
    4040#define __TCOM3DASYMLUT__
    4141
    42 #include "TypeDef.h"
     42#include "CommonDef.h"
    4343
    4444#if CGS_3D_ASYMLUT
  • branches/SHM-dev/source/Lib/TLibCommon/TComCodingStatistics.h

    r1259 r1335  
    3535#define __TCOMCODINGSTATISTICS__
    3636
    37 #include "TypeDef.h"
     37#include "CommonDef.h"
    3838#include <stdio.h>
    3939#include <string>
  • branches/SHM-dev/source/Lib/TLibCommon/TComInterpolationFilter.h

    r1287 r1335  
    4040#define __TCOMINTERPOLATIONFILTER__
    4141
    42 #include "TypeDef.h"
     42#include "CommonDef.h"
    4343
    4444//! \ingroup TLibCommon
  • branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp

    r1315 r1335  
    146146
    147147  Int   iPicStride = pcCU->getPic()->getStride(compID);
    148   Bool  bNeighborFlags[4 * MAX_NUM_SPU_W + 1];
     148  Bool  bNeighborFlags[4 * MAX_NUM_PART_IDXS_IN_CTU_WIDTH + 1];
    149149  Int   iNumIntraNeighbor = 0;
    150150
     
    164164  assert(uiROIWidth*uiROIHeight <= m_iYuvExtSize);
    165165
    166 #ifdef DEBUG_STRING
     166#if DEBUG_STRING
    167167  std::stringstream ss(stringstream::out);
    168168#endif
     
    181181
    182182
    183 #ifdef DEBUG_STRING
     183#if DEBUG_STRING
    184184    if (DebugOptionList::DebugString_Pred.getInt()&DebugStringGetPredModeMask(MODE_INTRA))
    185185    {
     
    301301      *piDestPtr=*piSrcPtr; // far right is not filtered
    302302
    303 #ifdef DEBUG_STRING
     303#if DEBUG_STRING
    304304    if (DebugOptionList::DebugString_Pred.getInt()&DebugStringGetPredModeMask(MODE_INTRA))
    305305    {
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp

    r1327 r1335  
    249249// ====================================================================================================================
    250250
    251 UInt g_auiZscanToRaster [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
    252 UInt g_auiRasterToZscan [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
    253 UInt g_auiRasterToPelX  [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
    254 UInt g_auiRasterToPelY  [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
     251UInt g_auiZscanToRaster [ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ] = { 0, };
     252UInt g_auiRasterToZscan [ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ] = { 0, };
     253UInt g_auiRasterToPelX  [ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ] = { 0, };
     254UInt g_auiRasterToPelY  [ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ] = { 0, };
    255255
    256256const UInt g_auiPUOffset[NUMBER_OF_PART_SIZES] = { 0, 8, 4, 4, 2, 10, 1, 5};
     
    668668Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}};
    669669
    670 std::string NaluToStr( NalUnitType nalu )
    671 {
    672   switch( nalu )
    673   {
    674   case NAL_UNIT_CODED_SLICE_TRAIL_N:
    675     return "TRAIL_N";
    676   case NAL_UNIT_CODED_SLICE_TRAIL_R:
    677     return "TRAIL_R";
    678  
    679   case NAL_UNIT_CODED_SLICE_TSA_N:
    680     return "  TSA_N";
    681   case NAL_UNIT_CODED_SLICE_TSA_R:
    682     return "  TSA_R";
    683  
    684   case NAL_UNIT_CODED_SLICE_STSA_N:
    685     return " STSA_N";
    686   case NAL_UNIT_CODED_SLICE_STSA_R:
    687     return " STSA_R";
    688 
    689   case NAL_UNIT_CODED_SLICE_RADL_N:
    690     return " RADL_N";
    691   case NAL_UNIT_CODED_SLICE_RADL_R:
    692     return " RADL_R";
    693  
    694   case NAL_UNIT_CODED_SLICE_RASL_N:
    695     return " RASL_N";
    696   case NAL_UNIT_CODED_SLICE_RASL_R:
    697     return " RASL_R";
    698 
    699   case NAL_UNIT_CODED_SLICE_BLA_W_LP:
    700   case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
    701   case NAL_UNIT_CODED_SLICE_BLA_N_LP:
    702     return "    BLA";
    703 
    704   case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
    705   case NAL_UNIT_CODED_SLICE_IDR_N_LP:
    706     return "    IDR";
    707  
    708   case NAL_UNIT_CODED_SLICE_CRA:
    709     return "    CRA";
    710 
    711   default:
    712     return "       ";
    713   };
     670std::string NaluToStr( NalUnitType type )
     671{
     672  switch (type)
     673  {
     674    case NAL_UNIT_CODED_SLICE_TRAIL_R:    return "   TRAIL_R";
     675    case NAL_UNIT_CODED_SLICE_TRAIL_N:    return "   TRAIL_N";
     676    case NAL_UNIT_CODED_SLICE_TSA_R:      return "     TSA_R";
     677    case NAL_UNIT_CODED_SLICE_TSA_N:      return "     TSA_N";
     678    case NAL_UNIT_CODED_SLICE_STSA_R:     return "    STSA_R";
     679    case NAL_UNIT_CODED_SLICE_STSA_N:     return "    STSA_N";
     680    case NAL_UNIT_CODED_SLICE_BLA_W_LP:   return "  BLA_W_LP";
     681    case NAL_UNIT_CODED_SLICE_BLA_W_RADL: return "BLA_W_RADL";
     682    case NAL_UNIT_CODED_SLICE_BLA_N_LP:   return "  BLA_N_LP";
     683    case NAL_UNIT_CODED_SLICE_IDR_W_RADL: return "IDR_W_RADL";
     684    case NAL_UNIT_CODED_SLICE_IDR_N_LP:   return "  IDR_N_LP";
     685    case NAL_UNIT_CODED_SLICE_CRA:        return "       CRA";
     686    case NAL_UNIT_CODED_SLICE_RADL_R:     return "    RADL_R";
     687    case NAL_UNIT_CODED_SLICE_RADL_N:     return "    RADL_N";
     688    case NAL_UNIT_CODED_SLICE_RASL_R:     return "    RASL_R";
     689    case NAL_UNIT_CODED_SLICE_RASL_N:     return "    RASL_N";
     690    case NAL_UNIT_VPS:                    return "       VPS";
     691    case NAL_UNIT_SPS:                    return "       SPS";
     692    case NAL_UNIT_PPS:                    return "       PPS";
     693    case NAL_UNIT_ACCESS_UNIT_DELIMITER:  return "       AUD";
     694    case NAL_UNIT_EOS:                    return "       EOS";
     695    case NAL_UNIT_EOB:                    return "       EOB";
     696    case NAL_UNIT_FILLER_DATA:            return "    FILLER";
     697    case NAL_UNIT_PREFIX_SEI:             return "       SEI";
     698    case NAL_UNIT_SUFFIX_SEI:             return "       SEI";
     699    default:                              return "       UNK";
     700  }
    714701}
    715702#if LAYER_CTB
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.h

    r1327 r1335  
    4848
    4949// ====================================================================================================================
    50 // Macros
    51 // ====================================================================================================================
    52 
    53 #define     MAX_CU_DEPTH             6                          // log2(CTUSize)
    54 #define     MAX_CU_SIZE             (1<<(MAX_CU_DEPTH))         // maximum allowable size of CU, surely 64? (not 1<<7 = 128)
    55 #define     MIN_PU_SIZE              4
    56 #define     MIN_TU_SIZE              4
    57 #define     MAX_TU_SIZE             32
    58 #define     MAX_NUM_SPU_W           (MAX_CU_SIZE/MIN_PU_SIZE)   // maximum number of SPU in horizontal line
    59 
    60 #define     SCALING_LIST_REM_NUM     6
    61 
    62 // ====================================================================================================================
    6350// Initialize / destroy functions
    6451// ====================================================================================================================
     
    7259
    7360// flexible conversion from relative to absolute index
    74 extern       UInt   g_auiZscanToRaster[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
    75 extern       UInt   g_auiRasterToZscan[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     61extern       UInt   g_auiZscanToRaster[ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ];
     62extern       UInt   g_auiRasterToZscan[ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ];
    7663extern       UInt*  g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][ MAX_CU_DEPTH ][ MAX_CU_DEPTH ];
    7764
     
    8067
    8168// conversion of partition index to picture pel position
    82 extern       UInt   g_auiRasterToPelX[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
    83 extern       UInt   g_auiRasterToPelY[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
     69extern       UInt   g_auiRasterToPelX[ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ];
     70extern       UInt   g_auiRasterToPelY[ MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH ];
    8471
    8572Void         initRasterToPelXY ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth );
    8673
    8774extern const UInt g_auiPUOffset[NUMBER_OF_PART_SIZES];
    88 
    89 #define QUANT_SHIFT                14 // Q(4) = 2^14
    90 #define IQUANT_SHIFT                6
    91 #define SCALE_BITS                 15 // Inherited from TMuC, pressumably for fractional bit estimates in RDOQ
    92 
    93 #define SQRT2                      11585
    94 #define SQRT2_SHIFT                13
    95 #define INVSQRT2                   11585
    96 #define INVSQRT2_SHIFT             14
    97 #define ADDITIONAL_MULTIPLIER_BITS 14
    98 
    99 #define SHIFT_INV_1ST               7 // Shift after first inverse transform stage
    100 #define SHIFT_INV_2ND              12 // Shift after second inverse transform stage
    10175
    10276extern const Int g_quantScales[SCALING_LIST_REM_NUM];             // Q(QP%6)
     
    12296extern const UChar  g_aucChromaScale[NUM_CHROMA_FORMAT][chromaQPMappingTableSize];
    12397
    124 // ====================================================================================================================
    125 // Entropy Coding
    126 // ====================================================================================================================
    127 
    128 #define CONTEXT_STATE_BITS             6
    129 #define LAST_SIGNIFICANT_GROUPS       10
    13098
    13199// ====================================================================================================================
     
    158126
    159127extern       Char   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2
    160 
    161 #ifndef ENC_DEC_TRACE
    162 #define ENC_DEC_TRACE 0
    163 #endif
    164128
    165129
     
    195159#endif
    196160
    197 
    198 #define SCALING_LIST_NUM (MAX_NUM_COMPONENT * NUMBER_OF_PREDICTION_MODES) ///< list number for quantization matrix
    199 
    200 #define SCALING_LIST_START_VALUE 8                                        ///< start value for dpcm mode
    201 #define MAX_MATRIX_COEF_NUM 64                                            ///< max coefficient number for quantization matrix
    202 #define MAX_MATRIX_SIZE_NUM 8                                             ///< max size number for quantization matrix
    203 #define SCALING_LIST_BITS 8                                               ///< bit depth of scaling list entries
    204 #define LOG2_SCALING_LIST_NEUTRAL_VALUE 4                                 ///< log2 of the value that, when used in a scaling list, has no effect on quantisation
    205 #define SCALING_LIST_DC 16                                                ///< default DC value
    206 
    207161extern const Char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
    208162extern const Char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1325 r1335  
    14291429  TComSPSRExt      m_spsRangeExtension;
    14301430
    1431   static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1];
    1432   static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1];
     1431  static const Int m_winUnitX[NUM_CHROMA_FORMAT];
     1432  static const Int m_winUnitY[NUM_CHROMA_FORMAT];
    14331433  TComPTL          m_pcPTL;
    14341434
     
    14651465  Void                   setChromaFormatIdc (ChromaFormat i)                                             { m_chromaFormatIdc = i;                                               }
    14661466
    1467   static Int             getWinUnitX (Int chromaFormatIdc)                                               { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; }
    1468   static Int             getWinUnitY (Int chromaFormatIdc)                                               { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; }
     1467  static Int             getWinUnitX (Int chromaFormatIdc)                                               { assert (chromaFormatIdc >= 0 && chromaFormatIdc < NUM_CHROMA_FORMAT); return m_winUnitX[chromaFormatIdc]; }
     1468  static Int             getWinUnitY (Int chromaFormatIdc)                                               { assert (chromaFormatIdc >= 0 && chromaFormatIdc < NUM_CHROMA_FORMAT); return m_winUnitY[chromaFormatIdc]; }
    14691469
    14701470  // structure
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r1316 r1335  
    15161516    else
    15171517    {
    1518 #ifdef DEBUG_TRANSFORM_AND_QUANTISE
     1518#if DEBUG_TRANSFORM_AND_QUANTISE
    15191519      std::cout << g_debugCounter << ": " << uiWidth << "x" << uiHeight << " channel " << compID << " TU at input to transform\n";
    15201520      printBlock(pcResidual, uiWidth, uiHeight, uiStride);
     
    15371537      }
    15381538
    1539 #ifdef DEBUG_TRANSFORM_AND_QUANTISE
     1539#if DEBUG_TRANSFORM_AND_QUANTISE
    15401540      std::cout << g_debugCounter << ": " << uiWidth << "x" << uiHeight << " channel " << compID << " TU between transform and quantiser\n";
    15411541      printBlock(m_plTempCoeff, uiWidth, uiHeight, uiWidth);
     
    15491549              uiAbsSum, compID, cQP );
    15501550
    1551 #ifdef DEBUG_TRANSFORM_AND_QUANTISE
     1551#if DEBUG_TRANSFORM_AND_QUANTISE
    15521552      std::cout << g_debugCounter << ": " << uiWidth << "x" << uiHeight << " channel " << compID << " TU at output of quantiser\n";
    15531553      printBlock(rpcCoeff, uiWidth, uiHeight, uiWidth);
     
    16031603  }
    16041604
    1605 #if defined DEBUG_STRING
     1605#if DEBUG_STRING
    16061606  if (psDebug)
    16071607  {
     
    16271627  else
    16281628  {
    1629 #ifdef DEBUG_TRANSFORM_AND_QUANTISE
     1629#if DEBUG_TRANSFORM_AND_QUANTISE
    16301630    std::cout << g_debugCounter << ": " << uiWidth << "x" << uiHeight << " channel " << compID << " TU at input to dequantiser\n";
    16311631    printBlock(pcCoeff, uiWidth, uiHeight, uiWidth);
     
    16341634    xDeQuant(rTu, pcCoeff, m_plTempCoeff, compID, cQP);
    16351635
    1636 #ifdef DEBUG_TRANSFORM_AND_QUANTISE
     1636#if DEBUG_TRANSFORM_AND_QUANTISE
    16371637    std::cout << g_debugCounter << ": " << uiWidth << "x" << uiHeight << " channel " << compID << " TU between dequantiser and inverse-transform\n";
    16381638    printBlock(m_plTempCoeff, uiWidth, uiHeight, uiWidth);
    16391639#endif
    16401640
    1641 #if defined DEBUG_STRING
     1641#if DEBUG_STRING
    16421642    if (psDebug)
    16431643    {
     
    16521652      xITransformSkip( m_plTempCoeff, pcResidual, uiStride, rTu, compID );
    16531653
    1654 #if defined DEBUG_STRING
     1654#if DEBUG_STRING
    16551655      if (psDebug)
    16561656      {
     
    16751675      xIT( channelBitDepth, rTu.useDST(compID), m_plTempCoeff, pcResidual, uiStride, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) );
    16761676
    1677 #if defined DEBUG_STRING
     1677#if DEBUG_STRING
    16781678      if (psDebug)
    16791679      {
     
    16861686    }
    16871687
    1688 #ifdef DEBUG_TRANSFORM_AND_QUANTISE
     1688#if DEBUG_TRANSFORM_AND_QUANTISE
    16891689    std::cout << g_debugCounter << ": " << uiWidth << "x" << uiHeight << " channel " << compID << " TU at output of inverse-transform\n";
    16901690    printBlock(pcResidual, uiWidth, uiHeight, uiStride);
     
    17271727    {
    17281728      DEBUG_STRING_NEW(sTemp)
    1729 #ifdef DEBUG_STRING
     1729#if DEBUG_STRING
    17301730      std::string *psDebug=((DebugOptionList::DebugString_InvTran.getInt()&(pcCU->isIntra(absPartIdxTU)?1:(pcCU->isInter(absPartIdxTU)?2:4)))!=0) ? &sTemp : 0;
    17311731#endif
     
    17331733      invTransformNxN( rTu, compID, pResi, uiStride, pcCoeff, cQP DEBUG_STRING_PASS_INTO(psDebug) );
    17341734
    1735 #ifdef DEBUG_STRING
     1735#if DEBUG_STRING
    17361736      if (psDebug != 0)
    17371737      {
     
    22892289      const Int64  tmpLevel                = Int64(abs(plSrcCoeff[ uiBlkPos ])) * quantisationCoefficient;
    22902290
    2291       const Intermediate_Int lLevelDouble  = (Intermediate_Int)min<Int64>(tmpLevel, MAX_INTERMEDIATE_INT - (Intermediate_Int(1) << (iQBits - 1)));
     2291      const Intermediate_Int lLevelDouble  = (Intermediate_Int)min<Int64>(tmpLevel, std::numeric_limits<Intermediate_Int>::max() - (Intermediate_Int(1) << (iQBits - 1)));
    22922292
    22932293#if ADAPTIVE_QP_SELECTION
     
    26212621        {
    26222622          // calculate the cost
    2623           Int64 minCostInc = MAX_INT64, curCost = MAX_INT64;
     2623          Int64 minCostInc = std::numeric_limits<Int64>::max(), curCost = std::numeric_limits<Int64>::max();
    26242624          Int minPos = -1, finalChange = 0, curChange = 0;
    26252625
     
    26482648                if(n==firstNZPosInCG && abs(piDstCoeff[uiBlkPos])==1)
    26492649                {
    2650                   curCost = MAX_INT64;
     2650                  curCost = std::numeric_limits<Int64>::max();
    26512651                }
    26522652                else
     
    26662666                if(thissignbit != signbit )
    26672667                {
    2668                   curCost = MAX_INT64;
     2668                  curCost = std::numeric_limits<Int64>::max();
    26692669                }
    26702670              }
  • branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r1287 r1335  
    1 #include "TypeDef.h"
     1#include "CommonDef.h"
    22#if SVC_EXTENSION
    33#include "TComUpsampleFilter.h"
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1334 r1335  
    3333
    3434/** \file     TypeDef.h
    35     \brief    Define basic types, new types and enumerations
     35    \brief    Define macros, basic types, new types and enumerations
    3636*/
    3737
    3838#ifndef __TYPEDEF__
    3939#define __TYPEDEF__
     40
     41#ifndef __COMMONDEF__
     42#error Include CommonDef.h not TypeDef.h
     43#endif
    4044
    4145#include <vector>
     
    117121#define MAX_VPS_NUM_SCALABILITY_TYPES    16
    118122#define MAX_REF_LAYERS                   7
     123#define MAX_VPS_OP_LAYER_SETS_PLUS1          (MAX_LAYERS+1)
     124#define MAX_VPS_LAYER_SETS_PLUS1                       1024
     125#define MAX_VPS_OUTPUT_LAYER_SETS_PLUS1                1024
     126#define MAX_VPS_LAYER_IDX_PLUS1                   MAX_LAYERS
    119127
    120128#endif // SVC_EXTENSION
     
    128136// ====================================================================================================================
    129137
    130 // #define DEBUG_STRING                 // enable to print out final decision debug info at encoder and decoder
    131 // #define DEBUG_ENCODER_SEARCH_BINS    // enable to print out each bin as it is coded during encoder search
    132 // #define DEBUG_CABAC_BINS             // enable to print out each bin as it is coded during final encode and decode
    133 // #define DEBUG_INTRA_SEARCH_COSTS     // enable to print out the cost for each mode during encoder search
    134 // #define DEBUG_TRANSFORM_AND_QUANTISE // enable to print out each TU as it passes through the transform-quantise-dequantise-inverseTransform process
    135 
    136 #ifdef DEBUG_STRING
     138#define DEBUG_STRING                                      0 ///< When enabled, prints out final decision debug info at encoder and decoder
     139#define DEBUG_ENCODER_SEARCH_BINS                         0 ///< When enabled, prints out each bin as it is coded during encoder search
     140#define DEBUG_CABAC_BINS                                  0 ///< When enabled, prints out each bin as it is coded during final encode and decode
     141#define DEBUG_INTRA_SEARCH_COSTS                          0 ///< When enabled, prints out the cost for each mode during encoder search
     142#define DEBUG_TRANSFORM_AND_QUANTISE                      0 ///< When enabled, prints out each TU as it passes through the transform-quantise-dequantise-inverseTransform process
     143
     144#define ENVIRONMENT_VARIABLE_DEBUG_AND_TEST               0 ///< When enabled, allows control of debug modifications via environment variables
     145#define PRINT_MACRO_VALUES                                1 ///< When enabled, the encoder prints out a list of the non-environment-variable controlled macros and their values on startup
     146
     147// TODO: rename this macro to DECODER_DEBUG_BIT_STATISTICS (may currently cause merge issues with other branches)
     148// This can be enabled by the makefile
     149#ifndef RExt__DECODER_DEBUG_BIT_STATISTICS
     150#define RExt__DECODER_DEBUG_BIT_STATISTICS                0 ///< 0 (default) = decoder reports as normal, 1 = decoder produces bit usage statistics (will impact decoder run time by up to ~10%)
     151#endif
     152
     153// This can be enabled by the makefile
     154#ifndef ENC_DEC_TRACE
     155#define ENC_DEC_TRACE                                     0
     156#endif
     157
     158#define PRINT_RPS_INFO                                    0 ///< Enable/disable the printing of bits used to send the RPS.
     159
     160// ====================================================================================================================
     161// Tool Switches - transitory (these macros are likely to be removed in future revisions)
     162// ====================================================================================================================
     163
     164#define ALLOW_RECOVERY_POINT_AS_RAP                       1
     165#define AMP_SAD                                           1 ///< dedicated SAD functions for AMP
     166#define BUGFIX_INTRAPERIOD                                1
     167#define DECODER_CHECK_SUBSTREAM_AND_SLICE_TRAILING_BYTES  1
     168#define DYN_REF_FREE                                      0 ///< Reference memory management - dynamic free of reference memories
     169#define RDO_WITHOUT_DQP_BITS                              0 ///< Disable counting dQP bits in RDO-based mode decision
     170#define SAO_ENCODE_ALLOW_USE_PREDEBLOCK                   1
     171#define T0196_SELECTIVE_RDOQ                              1 ///< selective RDOQ
     172#define TILE_SIZE_CHECK                                   1
     173#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.
     174
     175// ====================================================================================================================
     176// Tool Switches
     177// ====================================================================================================================
     178
     179#define ADAPTIVE_QP_SELECTION                             1 ///< G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection
     180
     181#define AMP_ENC_SPEEDUP                                   1 ///< encoder only speed-up by AMP mode skipping
     182#if AMP_ENC_SPEEDUP
     183#define AMP_MRG                                           1 ///< encoder only force merge for AMP partition (no motion search for AMP)
     184#endif
     185
     186#define FAST_BIT_EST                                      1 ///< G763: Table-based bit estimation for CABAC
     187
     188#define HHI_RQT_INTRA_SPEEDUP                             1 ///< tests one best mode with full rqt
     189#define HHI_RQT_INTRA_SPEEDUP_MOD                         0 ///< tests two best modes with full rqt
     190
     191#if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP
     192#error
     193#endif
     194
     195#define MATRIX_MULT                                       0 ///< Brute force matrix multiplication instead of partial butterfly
     196
     197#define O0043_BEST_EFFORT_DECODING                        0 ///< 0 (default) = disable code related to best effort decoding, 1 = enable code relating to best effort decoding [ decode-side only ].
     198
     199#define RDOQ_CHROMA_LAMBDA                                1 ///< F386: weighting of chroma for RDOQ
     200
     201// This can be enabled by the makefile
     202#ifndef RExt__HIGH_BIT_DEPTH_SUPPORT
     203#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)
     204#endif
     205
     206
     207// ====================================================================================================================
     208// Derived macros
     209// ====================================================================================================================
     210
     211#if RExt__HIGH_BIT_DEPTH_SUPPORT
     212#define FULL_NBIT                                         1 ///< When enabled, use distortion measure derived from all bits of source data, otherwise discard (bitDepth - 8) least-significant bits of distortion
     213#define RExt__HIGH_PRECISION_FORWARD_TRANSFORM            1 ///< 0 use original 6-bit transform matrices for both forward and inverse transform, 1 (default) = use original matrices for inverse transform and high precision matrices for forward transform
     214#else
     215#define FULL_NBIT                                         0 ///< When enabled, use distortion measure derived from all bits of source data, otherwise discard (bitDepth - 8) least-significant bits of distortion
     216#define RExt__HIGH_PRECISION_FORWARD_TRANSFORM            0 ///< 0 (default) use original 6-bit transform matrices for both forward and inverse transform, 1 = use original matrices for inverse transform and high precision matrices for forward transform
     217#endif
     218
     219#if FULL_NBIT
     220# define DISTORTION_PRECISION_ADJUSTMENT(x)  0
     221#else
     222# define DISTORTION_PRECISION_ADJUSTMENT(x) (x)
     223#endif
     224
     225#if DEBUG_STRING
    137226  #define DEBUG_STRING_PASS_INTO(name) , name
    138227  #define DEBUG_STRING_PASS_INTO_OPTIONAL(name, exp) , (exp==0)?0:name
     
    158247#endif
    159248
    160 
    161 // ====================================================================================================================
    162 // Tool Switches
    163 // ====================================================================================================================
    164 #define T0196_SELECTIVE_RDOQ                              1 ///< selective RDOQ
    165 
    166 #define ALLOW_RECOVERY_POINT_AS_RAP                       1
    167 #define BUGFIX_INTRAPERIOD                                1
    168 
    169 #define SAO_ENCODE_ALLOW_USE_PREDEBLOCK                   1
    170 
    171 #define TILE_SIZE_CHECK                                   1
    172 
    173 #define MAX_NUM_PICS_IN_SOP                            1024
    174 
    175 #define MAX_NESTING_NUM_OPS                            1024
    176 #define MAX_NESTING_NUM_LAYER                            64
    177 
    178 #if SVC_EXTENSION
    179 #define MAX_VPS_OP_LAYER_SETS_PLUS1          (MAX_LAYERS+1)
    180 #define MAX_VPS_LAYER_SETS_PLUS1                       1024
    181 #define MAX_VPS_OUTPUT_LAYER_SETS_PLUS1                1024
    182 #define MAX_VPS_LAYER_IDX_PLUS1                   MAX_LAYERS
    183 #else
    184 #define MAX_VPS_NUM_HRD_PARAMETERS                        1
    185 #define MAX_VPS_OP_SETS_PLUS1                          1024
    186 #define MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1          1
    187 #endif
    188 
    189 #define MAXIMUM_INTRA_FILTERED_WIDTH                     16
    190 #define MAXIMUM_INTRA_FILTERED_HEIGHT                    16
    191 
    192 #define MAX_CPB_CNT                                      32 ///< Upper bound of (cpb_cnt_minus1 + 1)
    193 
    194 #if SVC_EXTENSION
    195 #define MAX_NUM_LAYER_IDS                                63
    196 #else
    197 #define MAX_NUM_LAYER_IDS                                64
    198 #endif
    199 
    200 #define COEF_REMAIN_BIN_REDUCTION                         3 ///< indicates the level at which the VLC
    201                                                             ///< transitions from Golomb-Rice to TU+EG(k)
    202 
    203 #define CU_DQP_TU_CMAX                                    5 ///< max number bins for truncated unary
    204 #define CU_DQP_EG_k                                       0 ///< expgolomb order
    205 
    206 #define SBH_THRESHOLD                                     4  ///< I0156: value of the fixed SBH controlling threshold
    207 
    208 #define C1FLAG_NUMBER                                     8 // maximum number of largerThan1 flag coded in one chunk :  16 in HM5
    209 #define C2FLAG_NUMBER                                     1 // maximum number of largerThan2 flag coded in one chunk:  16 in HM5
    210 
    211 #define SAO_ENCODING_CHOICE                               1  ///< I0184: picture early termination
    212 #if SAO_ENCODING_CHOICE
    213 #define SAO_ENCODING_RATE                                 0.75
    214 #define SAO_ENCODING_CHOICE_CHROMA                        1 ///< J0044: picture early termination Luma and Chroma are handled separately
    215 #if SAO_ENCODING_CHOICE_CHROMA
    216 #define SAO_ENCODING_RATE_CHROMA                          0.5
    217 #endif
    218 #endif
    219 
    220 #define MAX_NUM_SAO_OFFSETS                               4
    221 
    222 #define MAX_NUM_VPS                                      16
    223 #define MAX_NUM_SPS                                      16
    224 #define MAX_NUM_PPS                                      64
    225 
    226 #define RDOQ_CHROMA_LAMBDA                                1   ///< F386: weighting of chroma for RDOQ
    227 
    228 #define MIN_SCAN_POS_CROSS                                4
    229 
    230 #define FAST_BIT_EST                                      1   ///< G763: Table-based bit estimation for CABAC
    231 
    232 #define MLS_GRP_NUM                                      64     ///< G644 : Max number of coefficient groups, max(16, 64)
    233 #define MLS_CG_LOG2_WIDTH                                 2
    234 #define MLS_CG_LOG2_HEIGHT                                2
    235 #define MLS_CG_SIZE                                     (MLS_CG_LOG2_WIDTH + MLS_CG_LOG2_HEIGHT)  ///< G644 : Coefficient group size of 4x4
    236 
    237 #define ADAPTIVE_QP_SELECTION                             1      ///< G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection
    238 #if ADAPTIVE_QP_SELECTION
    239 #define ARL_C_PRECISION                                   7      ///< G382: 7-bit arithmetic precision
    240 #define LEVEL_RANGE                                      30     ///< G382: max coefficient level in statistics collection
    241 #endif
    242 
    243 #define HHI_RQT_INTRA_SPEEDUP                             1           ///< tests one best mode with full rqt
    244 #define HHI_RQT_INTRA_SPEEDUP_MOD                         0           ///< tests two best modes with full rqt
    245 
    246 #if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP
    247 #error
    248 #endif
    249 
    250 #define AMVP_DECIMATION_FACTOR                            4
    251 
    252 #define SCAN_SET_SIZE                                    16
    253 #define LOG2_SCAN_SET_SIZE                                4
    254 
    255 #define FAST_UDI_MAX_RDMODE_NUM                          35          ///< maximum number of RD comparison in fast-UDI estimation loop
    256 
    257 #define NUM_INTRA_MODE                                   36
    258 
    259 #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.
    260 #define PRINT_RPS_INFO                                    0           ///< Enable/disable the printing of bits used to send the RPS.
    261                                                                         // using one nearest frame as reference frame, and the other frames are high quality (POC%4==0) frames (1+X)
    262                                                                         // this should be done with encoder only decision
    263                                                                         // but because of the absence of reference frame management, the related code was hard coded currently
    264 
    265 #define RVM_VCEGAM10_M 4
    266 
    267 #define PLANAR_IDX                                        0
    268 #define VER_IDX                                          26                    // index for intra VERTICAL   mode
    269 #define HOR_IDX                                          10                    // index for intra HORIZONTAL mode
    270 #define DC_IDX                                            1                    // index for intra DC mode
    271 #define NUM_CHROMA_MODE                                   5                    // total number of chroma modes
    272 #define DM_CHROMA_IDX                                    36                    // chroma mode index for derived from luma intra mode
    273 #define INVALID_MODE_IDX                                 (NUM_INTRA_MODE+1)    // value used to indicate an invalid intra mode
    274 #define STOPCHROMASEARCH_MODE_IDX                        (INVALID_MODE_IDX+1)  // value used to signal the end of a chroma mode search
    275 
    276 #define MDCS_ANGLE_LIMIT                                  4         ///< (default 4) 0 = Horizontal/vertical only, 1 = Horizontal/vertical +/- 1, 2 = Horizontal/vertical +/- 2 etc...
    277 #define MDCS_MAXIMUM_WIDTH                                8         ///< (default 8) (measured in pixels) TUs with width greater than this can only use diagonal scan
    278 #define MDCS_MAXIMUM_HEIGHT                               8         ///< (default 8) (measured in pixels) TUs with height greater than this can only use diagonal scan
    279 
    280 #define RDO_WITHOUT_DQP_BITS                              0           ///< Disable counting dQP bits in RDO-based mode decision
    281 
    282 #define LOG2_MAX_NUM_COLUMNS_MINUS1                       7
    283 #define LOG2_MAX_NUM_ROWS_MINUS1                          7
    284 #define LOG2_MAX_COLUMN_WIDTH                            13
    285 #define LOG2_MAX_ROW_HEIGHT                              13
    286 
    287 #define MATRIX_MULT                                       0 // Brute force matrix multiplication instead of partial butterfly
    288 
    289 #define AMP_SAD                                           1 ///< dedicated SAD functions for AMP
    290 #define AMP_ENC_SPEEDUP                                   1 ///< encoder only speed-up by AMP mode skipping
    291 #if AMP_ENC_SPEEDUP
    292 #define AMP_MRG                                           1 ///< encoder only force merge for AMP partition (no motion search for AMP)
    293 #endif
    294 
    295 #define CABAC_INIT_PRESENT_FLAG                           1
    296 
    297 #define LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS    4
    298 #define CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS  8
    299 
    300 #define MAX_NUM_LONG_TERM_REF_PICS                       33
    301 #define NUM_LONG_TERM_REF_PIC_SPS                         0
    302 
    303 #define DECODER_CHECK_SUBSTREAM_AND_SLICE_TRAILING_BYTES  1
    304 
    305 #define RD_TEST_SAO_DISABLE_AT_PICTURE_LEVEL              0 ///< 1 = tests whether SAO should be disabled at the picture level,  0 (default) = does not apply this additional test
    306 
    307 #define O0043_BEST_EFFORT_DECODING                        0 ///< 0 (default) = disable code related to best effort decoding, 1 = enable code relating to best effort decoding [ decode-side only ].
    308 
    309 #define MAX_QP_OFFSET_LIST_SIZE                           6 ///< Maximum size of QP offset list is 6 entries
    310 // Cost mode support
    311 
    312 #define LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP       0 ///< QP to use for lossless coding.
    313 #define LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME 4 ///< QP' to use for mixed_lossy_lossless coding.
    314 
    315 // Debug support
    316 
    317 #define ENVIRONMENT_VARIABLE_DEBUG_AND_TEST               0 ///< When enabled, allows control of debug modifications via environment variables
    318 
    319 #define PRINT_MACRO_VALUES                                1 ///< When enabled, the encoder prints out a list of the non-environment-variable controlled macros and their values on startup
    320 
    321 // TODO: rename this macro to DECODER_DEBUG_BIT_STATISTICS (may currently cause merge issues with other branches)
    322 // This can be enabled by the makefile
    323 #ifndef RExt__DECODER_DEBUG_BIT_STATISTICS
    324 #define RExt__DECODER_DEBUG_BIT_STATISTICS                                     0 ///< 0 (default) = decoder reports as normal, 1 = decoder produces bit usage statistics (will impact decoder run time by up to ~10%)
    325 #endif
    326 
    327 // This can be enabled by the makefile
    328 #ifndef RExt__HIGH_BIT_DEPTH_SUPPORT
    329 #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)
    330 #endif
    331 
    332 #define RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS                           4
    333 #define RExt__GOLOMB_RICE_INCREMENT_DIVISOR                                    4
    334 
    335 #define RExt__PREDICTION_WEIGHTING_ANALYSIS_DC_PRECISION                       0 ///< Additional fixed bit precision used during encoder-side weighting prediction analysis. Currently only used when high_precision_prediction_weighting_flag is set, for backwards compatibility reasons.
    336 
    337 #define MAX_TIMECODE_SEI_SETS                                                  3 ///< Maximum number of time sets
    338 
    339 //------------------------------------------------
    340 // Derived macros
    341 //------------------------------------------------
    342 
    343 #if RExt__HIGH_BIT_DEPTH_SUPPORT
    344 #define FULL_NBIT                                                              1 ///< When enabled, use distortion measure derived from all bits of source data, otherwise discard (bitDepth - 8) least-significant bits of distortion
    345 #define RExt__HIGH_PRECISION_FORWARD_TRANSFORM                                 1 ///< 0 use original 6-bit transform matrices for both forward and inverse transform, 1 (default) = use original matrices for inverse transform and high precision matrices for forward transform
    346 #else
    347 #define FULL_NBIT                                                              0 ///< When enabled, use distortion measure derived from all bits of source data, otherwise discard (bitDepth - 8) least-significant bits of distortion
    348 #define RExt__HIGH_PRECISION_FORWARD_TRANSFORM                                 0 ///< 0 (default) use original 6-bit transform matrices for both forward and inverse transform, 1 = use original matrices for inverse transform and high precision matrices for forward transform
    349 #endif
    350 
    351 #if FULL_NBIT
    352 # define DISTORTION_PRECISION_ADJUSTMENT(x)  0
    353 #else
    354 # define DISTORTION_PRECISION_ADJUSTMENT(x) (x)
    355 #endif
    356 
    357 
    358 //------------------------------------------------
     249// ====================================================================================================================
    359250// Error checks
    360 //------------------------------------------------
     251// ====================================================================================================================
    361252
    362253#if ((RExt__HIGH_PRECISION_FORWARD_TRANSFORM != 0) && (RExt__HIGH_BIT_DEPTH_SUPPORT == 0))
     
    405296#endif
    406297
     298// ====================================================================================================================
     299// Named numerical types
     300// ====================================================================================================================
     301
     302#if RExt__HIGH_BIT_DEPTH_SUPPORT
     303typedef       Int             Pel;               ///< pixel type
     304typedef       Int64           TCoeff;            ///< transform coefficient
     305typedef       Int             TMatrixCoeff;      ///< transform matrix coefficient
     306typedef       Short           TFilterCoeff;      ///< filter coefficient
     307typedef       Int64           Intermediate_Int;  ///< used as intermediate value in calculations
     308typedef       UInt64          Intermediate_UInt; ///< used as intermediate value in calculations
     309#else
     310typedef       Short           Pel;               ///< pixel type
     311typedef       Int             TCoeff;            ///< transform coefficient
     312typedef       Short           TMatrixCoeff;      ///< transform matrix coefficient
     313typedef       Short           TFilterCoeff;      ///< filter coefficient
     314typedef       Int             Intermediate_Int;  ///< used as intermediate value in calculations
     315typedef       UInt            Intermediate_UInt; ///< used as intermediate value in calculations
     316#endif
     317
     318#if FULL_NBIT
     319typedef       UInt64          Distortion;        ///< distortion measurement
     320#else
     321typedef       UInt            Distortion;        ///< distortion measurement
     322#endif
    407323
    408324// ====================================================================================================================
     
    776692};
    777693
     694// TODO: Existing names used for the different NAL unit types can be altered to better reflect the names in the spec.
     695//       However, the names in the spec are not yet stable at this point. Once the names are stable, a cleanup
     696//       effort can be done without use of macros to alter the names used to indicate the different NAL unit types.
     697enum NalUnitType
     698{
     699  NAL_UNIT_CODED_SLICE_TRAIL_N = 0, // 0
     700  NAL_UNIT_CODED_SLICE_TRAIL_R,     // 1
     701
     702  NAL_UNIT_CODED_SLICE_TSA_N,       // 2
     703  NAL_UNIT_CODED_SLICE_TSA_R,       // 3
     704
     705  NAL_UNIT_CODED_SLICE_STSA_N,      // 4
     706  NAL_UNIT_CODED_SLICE_STSA_R,      // 5
     707
     708  NAL_UNIT_CODED_SLICE_RADL_N,      // 6
     709  NAL_UNIT_CODED_SLICE_RADL_R,      // 7
     710
     711  NAL_UNIT_CODED_SLICE_RASL_N,      // 8
     712  NAL_UNIT_CODED_SLICE_RASL_R,      // 9
     713
     714  NAL_UNIT_RESERVED_VCL_N10,
     715  NAL_UNIT_RESERVED_VCL_R11,
     716  NAL_UNIT_RESERVED_VCL_N12,
     717  NAL_UNIT_RESERVED_VCL_R13,
     718  NAL_UNIT_RESERVED_VCL_N14,
     719  NAL_UNIT_RESERVED_VCL_R15,
     720
     721  NAL_UNIT_CODED_SLICE_BLA_W_LP,    // 16
     722  NAL_UNIT_CODED_SLICE_BLA_W_RADL,  // 17
     723  NAL_UNIT_CODED_SLICE_BLA_N_LP,    // 18
     724  NAL_UNIT_CODED_SLICE_IDR_W_RADL,  // 19
     725  NAL_UNIT_CODED_SLICE_IDR_N_LP,    // 20
     726  NAL_UNIT_CODED_SLICE_CRA,         // 21
     727  NAL_UNIT_RESERVED_IRAP_VCL22,
     728  NAL_UNIT_RESERVED_IRAP_VCL23,
     729
     730  NAL_UNIT_RESERVED_VCL24,
     731  NAL_UNIT_RESERVED_VCL25,
     732  NAL_UNIT_RESERVED_VCL26,
     733  NAL_UNIT_RESERVED_VCL27,
     734  NAL_UNIT_RESERVED_VCL28,
     735  NAL_UNIT_RESERVED_VCL29,
     736  NAL_UNIT_RESERVED_VCL30,
     737  NAL_UNIT_RESERVED_VCL31,
     738
     739  NAL_UNIT_VPS,                     // 32
     740  NAL_UNIT_SPS,                     // 33
     741  NAL_UNIT_PPS,                     // 34
     742  NAL_UNIT_ACCESS_UNIT_DELIMITER,   // 35
     743  NAL_UNIT_EOS,                     // 36
     744  NAL_UNIT_EOB,                     // 37
     745  NAL_UNIT_FILLER_DATA,             // 38
     746  NAL_UNIT_PREFIX_SEI,              // 39
     747  NAL_UNIT_SUFFIX_SEI,              // 40
     748
     749  NAL_UNIT_RESERVED_NVCL41,
     750  NAL_UNIT_RESERVED_NVCL42,
     751  NAL_UNIT_RESERVED_NVCL43,
     752  NAL_UNIT_RESERVED_NVCL44,
     753  NAL_UNIT_RESERVED_NVCL45,
     754  NAL_UNIT_RESERVED_NVCL46,
     755  NAL_UNIT_RESERVED_NVCL47,
     756  NAL_UNIT_UNSPECIFIED_48,
     757  NAL_UNIT_UNSPECIFIED_49,
     758  NAL_UNIT_UNSPECIFIED_50,
     759  NAL_UNIT_UNSPECIFIED_51,
     760  NAL_UNIT_UNSPECIFIED_52,
     761  NAL_UNIT_UNSPECIFIED_53,
     762  NAL_UNIT_UNSPECIFIED_54,
     763  NAL_UNIT_UNSPECIFIED_55,
     764  NAL_UNIT_UNSPECIFIED_56,
     765  NAL_UNIT_UNSPECIFIED_57,
     766  NAL_UNIT_UNSPECIFIED_58,
     767  NAL_UNIT_UNSPECIFIED_59,
     768  NAL_UNIT_UNSPECIFIED_60,
     769  NAL_UNIT_UNSPECIFIED_61,
     770  NAL_UNIT_UNSPECIFIED_62,
     771  NAL_UNIT_UNSPECIFIED_63,
     772  NAL_UNIT_INVALID,
     773};
     774
    778775// ====================================================================================================================
    779776// Type definition
    780777// ====================================================================================================================
    781 
    782 #if RExt__HIGH_BIT_DEPTH_SUPPORT
    783 typedef       Int             Pel;               ///< pixel type
    784 typedef       Int64           TCoeff;            ///< transform coefficient
    785 typedef       Int             TMatrixCoeff;      ///< transform matrix coefficient
    786 typedef       Short           TFilterCoeff;      ///< filter coefficient
    787 typedef       Int64           Intermediate_Int;  ///< used as intermediate value in calculations
    788 typedef       UInt64          Intermediate_UInt; ///< used as intermediate value in calculations
    789 #else
    790 typedef       Short           Pel;               ///< pixel type
    791 typedef       Int             TCoeff;            ///< transform coefficient
    792 typedef       Short           TMatrixCoeff;      ///< transform matrix coefficient
    793 typedef       Short           TFilterCoeff;      ///< filter coefficient
    794 typedef       Int             Intermediate_Int;  ///< used as intermediate value in calculations
    795 typedef       UInt            Intermediate_UInt; ///< used as intermediate value in calculations
    796 #endif
    797 
    798 #if FULL_NBIT
    799 typedef       UInt64          Distortion;        ///< distortion measurement
    800 #else
    801 typedef       UInt            Distortion;        ///< distortion measurement
    802 #endif
    803778
    804779/// parameters for adaptive loop filter
  • branches/SHM-dev/source/Lib/TLibDecoder/AnnexBread.h

    r1259 r1335  
    4646#include <vector>
    4747
    48 #include "TLibCommon/TypeDef.h"
     48#include "TLibCommon/CommonDef.h"
    4949
    5050//! \ingroup TLibDecoder
  • branches/SHM-dev/source/Lib/TLibDecoder/NALread.h

    r1319 r1335  
    4242#define __NALREAD__
    4343
    44 #include "TLibCommon/TypeDef.h"
     44#include "TLibCommon/CommonDef.h"
    4545#include "TLibCommon/TComBitStream.h"
    4646#include "TLibCommon/NAL.h"
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp

    r1259 r1335  
    111111#endif
    112112{
    113 #ifdef DEBUG_CABAC_BINS
     113#if DEBUG_CABAC_BINS
    114114  const UInt startingRange = m_uiRange;
    115115#endif
     
    161161  }
    162162
    163 #ifdef DEBUG_CABAC_BINS
     163#if DEBUG_CABAC_BINS
    164164  if ((g_debugCounter + debugCabacBinWindow) >= debugCabacBinTargetLine)
    165165  {
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r1316 r1335  
    457457  }
    458458
    459 #ifdef DEBUG_STRING
     459#if DEBUG_STRING
    460460  const PredMode predMode=m_ppcCU[uiDepth]->getPredictionMode(0);
    461461  if (DebugOptionList::DebugString_Structure.getInt()&DebugStringGetPredModeMask(predMode))
     
    482482  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
    483483
    484 #ifdef DEBUG_STRING
     484#if DEBUG_STRING
    485485  const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTER);
    486486  if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask)
     
    493493  xDecodeInterTexture( pcCU, uiDepth );
    494494
    495 #ifdef DEBUG_STRING
     495#if DEBUG_STRING
    496496  if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask)
    497497  {
     
    513513    m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 ));
    514514  }
    515 #ifdef DEBUG_STRING
     515#if DEBUG_STRING
    516516  if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask)
    517517  {
     
    578578  const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    579579
    580 #ifdef DEBUG_STRING
     580#if DEBUG_STRING
    581581  std::ostream &ss(std::cout);
    582582#endif
     
    590590  m_pcPrediction->predIntraAng( compID,   uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions );
    591591
    592 #ifdef DEBUG_STRING
     592#if DEBUG_STRING
    593593  ss << sTemp;
    594594#endif
     
    602602
    603603  DEBUG_STRING_NEW(sDebug);
    604 #ifdef DEBUG_STRING
     604#if DEBUG_STRING
    605605  const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTRA);
    606606  std::string *psDebug=(DebugOptionList::DebugString_InvTran.getInt()&debugPredModeMask) ? &sDebug : 0;
     
    622622  }
    623623
    624 #ifdef DEBUG_STRING
     624#if DEBUG_STRING
    625625  if (psDebug)
    626626  {
     
    642642
    643643
    644 #ifdef DEBUG_STRING
     644#if DEBUG_STRING
    645645  const Bool bDebugPred=((DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID));
    646646  const Bool bDebugResi=((DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID));
     
    668668  for( UInt uiY = 0; uiY < uiHeight; uiY++ )
    669669  {
    670 #ifdef DEBUG_STRING
     670#if DEBUG_STRING
    671671    if (bDebugPred || bDebugResi || bDebugReco)
    672672    {
     
    690690    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    691691    {
    692 #ifdef DEBUG_STRING
     692#if DEBUG_STRING
    693693      if (bDebugResi)
    694694      {
     
    703703      pRecIPred[ uiX ] = pReco[ uiX ];
    704704    }
    705 #ifdef DEBUG_STRING
     705#if DEBUG_STRING
    706706    if (bDebugReco)
    707707    {
  • branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.h

    r1259 r1335  
    3939#include <ostream>
    4040
    41 #include "TLibCommon/TypeDef.h"
     41#include "TLibCommon/CommonDef.h"
    4242#include "TLibCommon/TComBitStream.h"
    4343#include "TLibCommon/NAL.h"
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp

    r1259 r1335  
    196196  //}
    197197
    198 #ifdef DEBUG_CABAC_BINS
     198#if DEBUG_CABAC_BINS
    199199  const UInt startingRange = m_uiRange;
    200200#endif
     
    228228  }
    229229
    230 #ifdef DEBUG_CABAC_BINS
     230#if DEBUG_CABAC_BINS
    231231  if ((g_debugCounter + debugCabacBinWindow) >= debugCabacBinTargetLine)
    232232  {
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp

    r1307 r1335  
    7474Void TEncBinCABACCounter::encodeBin( UInt binValue, ContextModel &rcCtxModel )
    7575{
    76 #ifdef DEBUG_ENCODER_SEARCH_BINS
     76#if DEBUG_ENCODER_SEARCH_BINS
    7777  const UInt64 startingFracBits = m_fracBits;
    7878#endif
     
    8282  rcCtxModel.update( binValue );
    8383
    84 #ifdef DEBUG_ENCODER_SEARCH_BINS
     84#if DEBUG_ENCODER_SEARCH_BINS
    8585  if ((g_debugCounter + debugEncoderSearchBinWindow) >= debugEncoderSearchBinTargetLine)
    8686  {
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp

    r1316 r1335  
    13761376                                                     (uiNoResidual != 0) DEBUG_STRING_PASS_INTO(tmpStr) );
    13771377
    1378 #ifdef DEBUG_STRING
     1378#if DEBUG_STRING
    13791379          DebugInterPredResiReco(tmpStr, *(m_ppcPredYuvTemp[uhDepth]), *(m_ppcResiYuvBest[uhDepth]), *(m_ppcRecoYuvTemp[uhDepth]), DebugStringGetPredModeMask(rpcTempCU->getPredictionMode(0)));
    13801380#endif
     
    14861486  rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    14871487
    1488 #ifdef DEBUG_STRING
     1488#if DEBUG_STRING
    14891489  DebugInterPredResiReco(sTest, *(m_ppcPredYuvTemp[uhDepth]), *(m_ppcResiYuvBest[uhDepth]), *(m_ppcRecoYuvTemp[uhDepth]), DebugStringGetPredModeMask(rpcTempCU->getPredictionMode(0)));
    14901490#endif
     
    16351635
    16361636
    1637 #ifdef DEBUG_STRING
     1637#if DEBUG_STRING
    16381638    DEBUG_STRING_SWAP(sParent, sTest)
    16391639    const PredMode predMode=rpcBestCU->getPredictionMode(0);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1307 r1335  
    3737
    3838#include "TEncEntropy.h"
    39 #include "TLibCommon/TypeDef.h"
     39#include "TLibCommon/CommonDef.h"
    4040#include "TLibCommon/TComSampleAdaptiveOffset.h"
    4141#include "TLibCommon/TComTU.h"
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1328 r1335  
    3636 */
    3737
    38 #include "TLibCommon/TypeDef.h"
     38#include "TLibCommon/CommonDef.h"
    3939#include "TLibCommon/TComRom.h"
    4040#include "TLibCommon/TComMotionInfo.h"
     
    11531153        Pel *const     lumaResidualForEstimate              = bUseReconstructedResidualForEstimate ? reconstructedLumaResidual : encoderLumaResidual;
    11541154
    1155 #ifdef DEBUG_STRING
     1155#if DEBUG_STRING
    11561156  const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTRA);
    11571157#endif
     
    11631163  DEBUG_STRING_NEW(sTemp)
    11641164
    1165 #ifndef DEBUG_STRING
     1165#if !DEBUG_STRING
    11661166  if( default0Save1Load2 != 2 )
    11671167#endif
     
    11901190    }
    11911191  }
    1192 #ifndef DEBUG_STRING
     1192#if !DEBUG_STRING
    11931193  else
    11941194  {
     
    12731273  //--- inverse transform ---
    12741274
    1275 #ifdef DEBUG_STRING
     1275#if DEBUG_STRING
    12761276  if ( (uiAbsSum > 0) || (DebugOptionList::DebugString_InvTran.getInt()&debugPredModeMask) )
    12771277#else
     
    13131313    }
    13141314
    1315  #ifdef DEBUG_STRING
     1315 #if DEBUG_STRING
    13161316    std::stringstream ss(stringstream::out);
    13171317    const Bool bDebugPred=((DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID));
     
    23312331        Double cost      = (Double)uiSad + (Double)iModeBits * sqrtLambdaForFirstPass;
    23322332
    2333 #ifdef DEBUG_INTRA_SEARCH_COSTS
     2333#if DEBUG_INTRA_SEARCH_COSTS
    23342334        std::cout << "1st pass mode " << uiMode << " SAD = " << uiSad << ", mode bits = " << iModeBits << ", cost = " << cost << "\n";
    23352335#endif
     
    24122412#endif
    24132413
    2414 #ifdef DEBUG_INTRA_SEARCH_COSTS
     2414#if DEBUG_INTRA_SEARCH_COSTS
    24152415      std::cout << "2nd pass [luma,chroma] mode [" << Int(pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiPartOffset)) << "," << Int(pcCU->getIntraDir(CHANNEL_TYPE_CHROMA, uiPartOffset)) << "] cost = " << dPUCost << "\n";
    24162416#endif
     
    45504550    m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_TEMP_BEST]);
    45514551
    4552 #ifdef DEBUG_STRING
     4552#if DEBUG_STRING
    45534553    pcYuvResiBest->clear(); // Clear the residual image, if we didn't code it.
    45544554    for(UInt i=0; i<MAX_NUM_COMPONENT+1; i++)
     
    45984598    static const UInt useTS[MAX_NUM_COMPONENT]={0,0,0};
    45994599    pcCU->setTransformSkipSubParts ( useTS, 0, pcCU->getDepth(0) );
    4600 #ifdef DEBUG_STRING
     4600#if DEBUG_STRING
    46014601    sDebug.clear();
    46024602    for(UInt i=0; i<MAX_NUM_COMPONENT+1; i++)
     
    46744674
    46754675  UInt SplitFlag = ((pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && pcCU->isInter(uiAbsPartIdx) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ));
    4676 #ifdef DEBUG_STRING
     4676#if DEBUG_STRING
    46774677  const Int debugPredModeMask = DebugStringGetPredModeMask(pcCU->getPredictionMode(uiAbsPartIdx));
    46784678#endif
     
    50025002                }
    50035003
    5004 #ifdef DEBUG_STRING
     5004#if DEBUG_STRING
    50055005                if (currAbsSum > 0)
    50065006                {
     
    51675167      DEBUG_STRING_NEW(childString)
    51685168      xEstimateInterResidualQT( pcResi, dSubdivCost, uiSubdivBits, uiSubdivDist, bCheckFull ? NULL : puiZeroDist,  tuRecurseChild DEBUG_STRING_PASS_INTO(childString));
    5169 #ifdef DEBUG_STRING
     5169#if DEBUG_STRING
    51705170      // split the string by component and append to the relevant output (because decoder decodes in channel order, whereas this search searches by TU-order)
    51715171      std::size_t lastPos=0;
     
    52235223      ruiBits += uiSubdivBits;
    52245224      ruiDist += uiSubdivDist;
    5225 #ifdef DEBUG_STRING
     5225#if DEBUG_STRING
    52265226      for(UInt ch = 0; ch < numValidComp; ch++)
    52275227      {
     
    52835283    ruiBits += uiSingleBits;
    52845284    ruiDist += uiSingleDist;
    5285 #ifdef DEBUG_STRING
     5285#if DEBUG_STRING
    52865286    for(UInt ch = 0; ch < numValidComp; ch++)
    52875287    {
  • branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r1316 r1335  
    3636*/
    3737
    38 #include "../TLibCommon/TypeDef.h"
     38#include "../TLibCommon/CommonDef.h"
    3939#include "../TLibCommon/TComSlice.h"
    4040#include "../TLibCommon/TComPic.h"
  • branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.h

    r1259 r1335  
    3838#define __WEIGHTPREDANALYSIS__
    3939
    40 #include "../TLibCommon/TypeDef.h"
     40#include "../TLibCommon/CommonDef.h"
    4141#include "../TLibCommon/TComSlice.h"
    4242#include "TEncCavlc.h"
     
    4646private:
    4747
    48   // member variables 
     48  // member variables
    4949  WPScalingParam  m_wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT];
    5050
Note: See TracChangeset for help on using the changeset viewer.