Changeset 362 in 3DVCSoftware for branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
3 May 2013, 15:34:11 (12 years ago)
Author:
tech
Message:

Update to HM-10.1.

Location:
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/CommonDef.h

    r324 r362  
    5858#if H_MV
    5959#define NV_VERSION        "0.1"                 ///< Current software version
    60 #define HM_VERSION        "10.0"                ///<
    61 #else
    62 #define NV_VERSION        "10.0"                 ///< Current software version
     60#define HM_VERSION        "10.1"                ///<
     61#else
     62#define NV_VERSION        "10.1"                 ///< Current software version
    6363#endif
    6464
     
    115115#define MAX_NUM_REF_PICS            16          ///< max. number of pictures used for reference
    116116#define MAX_NUM_REF                 16          ///< max. number of entries in picture reference list
     117#if !L0034_COMBINED_LIST_CLEANUP
    117118#define MAX_NUM_REF_LC              MAX_NUM_REF_PICS  // TODO: remove this macro definition (leftover from combined list concept)
     119#endif
    118120
    119121#define MAX_UINT                    0xFFFFFFFFU ///< max. value of unsigned 32-bit integer
     
    214216 
    215217  NAL_UNIT_CODED_SLICE_TSA_N,     // 2
    216   NAL_UNIT_CODED_SLICE_TLA,       // 3   // Current name in the spec: TSA_R
     218  NAL_UNIT_CODED_SLICE_TLA_R,       // 3
    217219 
    218220  NAL_UNIT_CODED_SLICE_STSA_N,    // 4
     
    220222
    221223  NAL_UNIT_CODED_SLICE_RADL_N,    // 6
    222   NAL_UNIT_CODED_SLICE_DLP,       // 7 // Current name in the spec: RADL_R
     224  NAL_UNIT_CODED_SLICE_RADL_R,      // 7
    223225 
    224226  NAL_UNIT_CODED_SLICE_RASL_N,    // 8
    225   NAL_UNIT_CODED_SLICE_TFD,       // 9 // Current name in the spec: RASL_R
    226 
    227   NAL_UNIT_RESERVED_10,
    228   NAL_UNIT_RESERVED_11,
    229   NAL_UNIT_RESERVED_12,
    230   NAL_UNIT_RESERVED_13,
    231   NAL_UNIT_RESERVED_14,
    232   NAL_UNIT_RESERVED_15,
    233 
    234   NAL_UNIT_CODED_SLICE_BLA,       // 16   // Current name in the spec: BLA_W_LP
    235   NAL_UNIT_CODED_SLICE_BLANT,     // 17   // Current name in the spec: BLA_W_DLP
     227  NAL_UNIT_CODED_SLICE_RASL_R,      // 9
     228
     229  NAL_UNIT_RESERVED_VCL_N10,
     230  NAL_UNIT_RESERVED_VCL_R11,
     231  NAL_UNIT_RESERVED_VCL_N12,
     232  NAL_UNIT_RESERVED_VCL_R13,
     233  NAL_UNIT_RESERVED_VCL_N14,
     234  NAL_UNIT_RESERVED_VCL_R15,
     235
     236  NAL_UNIT_CODED_SLICE_BLA_W_LP,    // 16
     237  NAL_UNIT_CODED_SLICE_BLA_W_RADL,  // 17
    236238  NAL_UNIT_CODED_SLICE_BLA_N_LP,  // 18
    237   NAL_UNIT_CODED_SLICE_IDR,       // 19  // Current name in the spec: IDR_W_DLP
     239  NAL_UNIT_CODED_SLICE_IDR_W_RADL,  // 19
    238240  NAL_UNIT_CODED_SLICE_IDR_N_LP,  // 20
    239241  NAL_UNIT_CODED_SLICE_CRA,       // 21
    240   NAL_UNIT_RESERVED_22,
    241   NAL_UNIT_RESERVED_23,
    242 
    243   NAL_UNIT_RESERVED_24,
    244   NAL_UNIT_RESERVED_25,
    245   NAL_UNIT_RESERVED_26,
    246   NAL_UNIT_RESERVED_27,
    247   NAL_UNIT_RESERVED_28,
    248   NAL_UNIT_RESERVED_29,
    249   NAL_UNIT_RESERVED_30,
    250   NAL_UNIT_RESERVED_31,
     242  NAL_UNIT_RESERVED_IRAP_VCL22,
     243  NAL_UNIT_RESERVED_IRAP_VCL23,
     244
     245  NAL_UNIT_RESERVED_VCL24,
     246  NAL_UNIT_RESERVED_VCL25,
     247  NAL_UNIT_RESERVED_VCL26,
     248  NAL_UNIT_RESERVED_VCL27,
     249  NAL_UNIT_RESERVED_VCL28,
     250  NAL_UNIT_RESERVED_VCL29,
     251  NAL_UNIT_RESERVED_VCL30,
     252  NAL_UNIT_RESERVED_VCL31,
    251253
    252254  NAL_UNIT_VPS,                   // 32
     
    257259  NAL_UNIT_EOB,                   // 37
    258260  NAL_UNIT_FILLER_DATA,           // 38
    259   NAL_UNIT_SEI,                   // 39 Prefix SEI
    260   NAL_UNIT_SEI_SUFFIX,            // 40 Suffix SEI
    261   NAL_UNIT_RESERVED_41,
    262   NAL_UNIT_RESERVED_42,
    263   NAL_UNIT_RESERVED_43,
    264   NAL_UNIT_RESERVED_44,
    265   NAL_UNIT_RESERVED_45,
    266   NAL_UNIT_RESERVED_46,
    267   NAL_UNIT_RESERVED_47,
     261  NAL_UNIT_PREFIX_SEI,              // 39
     262  NAL_UNIT_SUFFIX_SEI,              // 40
     263  NAL_UNIT_RESERVED_NVCL41,
     264  NAL_UNIT_RESERVED_NVCL42,
     265  NAL_UNIT_RESERVED_NVCL43,
     266  NAL_UNIT_RESERVED_NVCL44,
     267  NAL_UNIT_RESERVED_NVCL45,
     268  NAL_UNIT_RESERVED_NVCL46,
     269  NAL_UNIT_RESERVED_NVCL47,
    268270  NAL_UNIT_UNSPECIFIED_48,
    269271  NAL_UNIT_UNSPECIFIED_49,
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/NAL.h

    r324 r362  
    8080    return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R
    8181        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N
    82         || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA
     82        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA_R
    8383        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N
    8484        || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R
    8585        || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N
    86         || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA
    87         || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLANT
     86        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
     87        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    8888        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
    89         || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR
     89        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    9090        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
    9191        || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
    9292        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N
    93         || m_nalUnitType == NAL_UNIT_CODED_SLICE_DLP
     93        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R
    9494        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N
    95         || m_nalUnitType == NAL_UNIT_CODED_SLICE_TFD;
     95        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R;
    9696  }
    9797#if L0045_NON_NESTED_SEI_RESTRICTIONS
    9898  Bool isSei()
    9999  {
    100     return m_nalUnitType == NAL_UNIT_SEI
    101         || m_nalUnitType == NAL_UNIT_SEI_SUFFIX;
     100    return m_nalUnitType == NAL_UNIT_PREFIX_SEI
     101        || m_nalUnitType == NAL_UNIT_SUFFIX_SEI;
    102102  }
    103103
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/SEI.cpp

    r324 r362  
    3838#include "CommonDef.h"
    3939#include "SEI.h"
     40
     41#if J0149_TONE_MAPPING_SEI
     42//Table D-7 Meaning of camera iso sensitivity indicator and exposure index rating indicator
     43Int  Table_exp_indicator[32] = {0, 10, 12, 16, 20, 25, 32, 40, 50, 64, 80, 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, -1};
     44#endif
    4045
    4146SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/SEI.h

    r324 r362  
    355355};
    356356
     357#if L0208_SOP_DESCRIPTION_SEI
     358class SEISOPDescription : public SEI
     359{
     360public:
     361  PayloadType payloadType() const { return SOP_DESCRIPTION; }
     362
     363  SEISOPDescription() {}
     364  virtual ~SEISOPDescription() {}
     365
     366  UInt m_sopSeqParameterSetId;
     367  UInt m_numPicsInSopMinus1;
     368
     369  UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP];
     370  UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP];
     371  UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP];
     372  Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP];
     373};
     374#endif
     375
     376#if J0149_TONE_MAPPING_SEI
     377class SEIToneMappingInfo : public SEI
     378{
     379public:
     380  PayloadType payloadType() const { return TONE_MAPPING_INFO; }
     381  SEIToneMappingInfo() {}
     382  virtual ~SEIToneMappingInfo() {}
     383
     384  Int    m_toneMapId;
     385  Bool   m_toneMapCancelFlag;
     386  Bool   m_toneMapPersistenceFlag;
     387  Int    m_codedDataBitDepth;
     388  Int    m_targetBitDepth;
     389  Int    m_modelId;
     390  Int    m_minValue;
     391  Int    m_maxValue;
     392  Int    m_sigmoidMidpoint;
     393  Int    m_sigmoidWidth;
     394  std::vector<Int> m_startOfCodedInterval;
     395  Int    m_numPivots;
     396  std::vector<Int> m_codedPivotValue;
     397  std::vector<Int> m_targetPivotValue;
     398  Int    m_cameraIsoSpeedIdc;
     399  Int    m_cameraIsoSpeedValue;
     400  Int    m_exposureCompensationValueSignFlag;
     401  Int    m_exposureCompensationValueNumerator;
     402  Int    m_exposureCompensationValueDenomIdc;
     403  Int    m_refScreenLuminanceWhite;
     404  Int    m_extendedRangeWhiteLevel;
     405  Int    m_nominalBlackLevelLumaCodeValue;
     406  Int    m_nominalWhiteLevelLumaCodeValue;
     407  Int    m_extendedWhiteLevelLumaCodeValue;
     408};
     409#endif
     410
    357411typedef std::list<SEI*> SEIMessages;
    358412
     
    366420Void deleteSEIs (SEIMessages &seiList);
    367421
     422#if K0180_SCALABLE_NESTING_SEI
     423class SEIScalableNesting : public SEI
     424{
     425public:
     426  PayloadType payloadType() const { return SCALABLE_NESTING; }
     427
     428  SEIScalableNesting() {}
     429  virtual ~SEIScalableNesting()
     430  {
     431    if (!m_callerOwnsSEIs)
     432    {
     433      deleteSEIs(m_nestedSEIs);
     434    }
     435  }
     436
     437  Bool  m_bitStreamSubsetFlag;
     438  Bool  m_nestingOpFlag;
     439  Bool  m_defaultOpFlag;                             //value valid if m_nestingOpFlag != 0
     440  UInt  m_nestingNumOpsMinus1;                       // -"-
     441  UInt  m_nestingMaxTemporalIdPlus1[MAX_TLAYER];     // -"-
     442  UInt  m_nestingOpIdx[MAX_NESTING_NUM_OPS];         // -"-
     443
     444  Bool  m_allLayersFlag;                             //value valid if m_nestingOpFlag == 0
     445  UInt  m_nestingNoOpMaxTemporalIdPlus1;             //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
     446  UInt  m_nestingNumLayersMinus1;                    //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
     447  UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER];     //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 unsigned char values
     448
     449  Bool  m_callerOwnsSEIs;
     450  SEIMessages m_nestedSEIs;
     451};
     452#endif
     453
    368454//! \}
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComBitStream.cpp

    r324 r362  
    177177  }
    178178}
     179
    179180Void TComOutputBitstream::writeByteAlignment()
    180181{
     
    182183  writeAlignZero();
    183184}
     185
     186Int TComOutputBitstream::countStartCodeEmulations()
     187{
     188  UInt cnt = 0;
     189  vector<uint8_t>& rbsp   = getFIFO();
     190  for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();)
     191  {
     192    vector<uint8_t>::iterator found = it;
     193    do
     194    {
     195      // find the next emulated 00 00 {00,01,02,03}
     196      // NB, end()-1, prevents finding a trailing two byte sequence
     197      found = search_n(found, rbsp.end()-1, 2, 0);
     198      found++;
     199      // if not found, found == end, otherwise found = second zero byte
     200      if (found == rbsp.end())
     201      {
     202        break;
     203      }
     204      if (*(++found) <= 3)
     205      {
     206        break;
     207      }
     208    } while (true);
     209    it = found;
     210    if (found != rbsp.end())
     211    {
     212      cnt++;
     213    }
     214  }
     215  return cnt;
     216}
     217
    184218/**
    185219 * read #uiNumberOfBits# from bitstream without updating the bitstream
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComBitStream.h

    r324 r362  
    154154  Void          addSubstream    ( TComOutputBitstream* pcSubstream );
    155155  Void writeByteAlignment();
     156
     157  //! returns the number of start code emulations contained in the current buffer
     158  Int countStartCodeEmulations();
    156159};
    157160
     
    163166{
    164167  std::vector<uint8_t> *m_fifo; /// FIFO for storage of complete bytes
     168  std::vector<UInt> m_emulationPreventionByteLocation;
    165169
    166170protected:
     
    206210  UInt  getNumBitsRead() { return m_numBitsRead; }
    207211  Void readByteAlignment();
     212
     213  Void      pushEmulationPreventionByteLocation ( UInt pos )                  { m_emulationPreventionByteLocation.push_back( pos ); }
     214  UInt      numEmulationPreventionBytesRead     ()                            { return (UInt) m_emulationPreventionByteLocation.size();    }
     215  std::vector<UInt>  getEmulationPreventionByteLocation  ()                   { return m_emulationPreventionByteLocation;           }
     216  UInt      getEmulationPreventionByteLocation  ( UInt idx )                  { return m_emulationPreventionByteLocation[ idx ];    }
     217  Void      clearEmulationPreventionByteLocation()                            { m_emulationPreventionByteLocation.clear();          }
     218  Void      setEmulationPreventionByteLocation  ( std::vector<UInt> vec )     { m_emulationPreventionByteLocation = vec;            }
    208219};
    209220
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComLoopFilter.cpp

    r324 r362  
    5757// ====================================================================================================================
    5858
    59 const UChar tctable_8x8[54] =
     59const UChar TComLoopFilter::sm_tcTable[54] =
    6060{
    6161  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,6,6,7,8,9,10,11,13,14,16,18,20,22,24
    6262};
    6363
    64 const UChar betatable_8x8[52] =
     64const UChar TComLoopFilter::sm_betaTable[52] =
    6565{
    6666  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
     
    585585      Int iIndexB = Clip3(0, MAX_QP, iQP + (betaOffsetDiv2 << 1));
    586586     
    587       Int iTc =  tctable_8x8[iIndexTC]*iBitdepthScale;
    588       Int iBeta = betatable_8x8[iIndexB]*iBitdepthScale;
     587      Int iTc =  sm_tcTable[iIndexTC]*iBitdepthScale;
     588      Int iBeta = sm_betaTable[iIndexB]*iBitdepthScale;
    589589      Int iSideThreshold = (iBeta+(iBeta>>1))>>3;
    590590      Int iThrCut = iTc*10;
     
    735735
    736736        Int iIndexTC = Clip3(0, MAX_QP+DEFAULT_INTRA_TC_OFFSET, iQP + DEFAULT_INTRA_TC_OFFSET*(ucBs - 1) + (tcOffsetDiv2 << 1));
    737         Int iTc =  tctable_8x8[iIndexTC]*iBitdepthScale;
     737        Int iTc =  sm_tcTable[iIndexTC]*iBitdepthScale;
    738738
    739739        for ( UInt uiStep = 0; uiStep < uiPelsInPartChroma; uiStep++ )
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComLoopFilter.h

    r324 r362  
    9999  __inline Int xCalcDQ( Pel* piSrc, Int iOffset);
    100100 
     101  static const UChar sm_tcTable[54];
     102  static const UChar sm_betaTable[52];
     103
    101104public:
    102105  TComLoopFilter();
     
    111114  /// picture-level deblocking filter
    112115  Void loopFilterPic( TComPic* pcPic );
     116
     117  static Int getBeta( Int qp )
     118  {
     119    Int indexB = Clip3( 0, MAX_QP, qp );
     120    return sm_betaTable[ indexB ];
     121  }
    113122};
    114123
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r324 r362  
    8383  if( m_piYuvExt == NULL )
    8484  {
    85     Int extWidth  = g_uiMaxCUWidth + 16;
    86     Int extHeight = g_uiMaxCUHeight + 1;
     85    Int extWidth  = MAX_CU_SIZE + 16;
     86    Int extHeight = MAX_CU_SIZE + 1;
    8787    Int i, j;
    8888    for (i = 0; i < 4; i++)
     
    9494      }
    9595    }
    96     m_iYuvExtHeight  = ((g_uiMaxCUHeight + 2) << 4);
    97     m_iYuvExtStride = ((g_uiMaxCUWidth  + 8) << 4);
     96    m_iYuvExtHeight  = ((MAX_CU_SIZE + 2) << 4);
     97    m_iYuvExtStride = ((MAX_CU_SIZE  + 8) << 4);
    9898    m_piYuvExt = new Int[ m_iYuvExtStride * m_iYuvExtHeight ];
    9999
    100100    // new structure
    101     m_acYuvPred[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
    102     m_acYuvPred[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
    103 
    104     m_cYuvPredTemp.create( g_uiMaxCUWidth, g_uiMaxCUHeight );
    105   }
    106 
    107   if (m_iLumaRecStride != (g_uiMaxCUWidth>>1) + 1)
    108   {
    109     m_iLumaRecStride =  (g_uiMaxCUWidth>>1) + 1;
     101    m_acYuvPred[0] .create( MAX_CU_SIZE, MAX_CU_SIZE );
     102    m_acYuvPred[1] .create( MAX_CU_SIZE, MAX_CU_SIZE );
     103
     104    m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE );
     105  }
     106
     107  if (m_iLumaRecStride != (MAX_CU_SIZE>>1) + 1)
     108  {
     109    m_iLumaRecStride =  (MAX_CU_SIZE>>1) + 1;
    110110    if (!m_pLumaRecBuffer)
    111111    {
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComRom.cpp

    r324 r362  
    6262  g_aucConvertToBit[ i ] = c;
    6363 
    64   // g_auiFrameScanXY[ g_aucConvertToBit[ transformSize ] ]: zigzag scan array for transformSize
    6564  c=2;
    6665  for ( i=0; i<MAX_CU_DEPTH; i++ )
     
    7776Void destroyROM()
    7877{
    79   Int i;
    80  
    81   for ( i=0; i<MAX_CU_DEPTH; i++ )
     78  for (Int i=0; i<MAX_CU_DEPTH; i++ )
    8279  {
    8380    delete[] g_auiSigLastScan[0][i];
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComSlice.cpp

    r331 r362  
    4949, m_iPOC                          ( 0 )
    5050, m_iLastIDR                      ( 0 )
    51 , m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR )
     51, m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR_W_RADL )
    5252, m_eSliceType                    ( I_SLICE )
    5353, m_iSliceQp                      ( 0 )
     
    6060, m_deblockingFilterBetaOffsetDiv2 ( 0 )
    6161, m_deblockingFilterTcOffsetDiv2   ( 0 )
     62#if !L0034_COMBINED_LIST_CLEANUP
    6263, m_bRefPicListModificationFlagLC ( false )
    6364, m_bRefPicListCombinationFlag    ( false )
     65#endif
    6466, m_bCheckLDC                     ( false )
    6567, m_iSliceQpDelta                 ( 0 )
     
    7981, m_dLambda                       ( 0.0 )
    8082#endif
     83#if !L0034_COMBINED_LIST_CLEANUP
    8184, m_bNoBackPredFlag               ( false )
     85#endif
    8286, m_uiTLayer                      ( 0 )
    8387, m_bTLayerSwitchingFlag          ( false )
     
    111115#endif
    112116{
     117#if L0034_COMBINED_LIST_CLEANUP
     118  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0;
     119#else
    113120  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
     121#endif
    114122 
    115123  initEqualRef();
    116124 
     125#if L0034_COMBINED_LIST_CLEANUP
     126  for ( Int idx = 0; idx < MAX_NUM_REF; idx++ )
     127  {
     128    m_list1IdxToList0Idx[idx] = -1;
     129  }
     130#else
    117131  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)
    118132  {
     
    124138    m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;
    125139  }   
     140#endif
    126141  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++)
    127142  {
     
    135150#endif
    136151  }
    137   resetWpScaling(m_weightPredTable);
     152  resetWpScaling();
    138153  initWpAcDcParam();
    139154  m_saoEnabledFlag = false;
     
    156171  m_colRefIdx = 0;
    157172  initEqualRef();
     173#if !L0034_COMBINED_LIST_CLEANUP
    158174  m_bNoBackPredFlag = false;
    159175  m_bRefPicListCombinationFlag = false;
    160176  m_bRefPicListModificationFlagLC = false;
     177#endif
    161178  m_bCheckLDC = false;
    162179  m_iSliceQpDeltaCb = 0;
    163180  m_iSliceQpDeltaCr = 0;
    164181
     182#if !L0034_COMBINED_LIST_CLEANUP
    165183  m_aiNumRefIdx[REF_PIC_LIST_C]      = 0;
     184#endif
    166185
    167186  m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
     
    177196Bool TComSlice::getRapPicFlag()
    178197{
    179   return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR
     198  return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    180199      || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
    181200      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    182       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
    183       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
     201      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     202      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    184203      || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
    185204}
     
    251270
    252271
    253 TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic,
    254                                         Int                 poc)
     272TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb)
    255273{
    256274  TComList<TComPic*>::iterator  iterPic = rcListPic.begin(); 
    257275  TComPic*                      pcPic = *(iterPic);
    258276  TComPic*                      pcStPic = pcPic;
     277 
     278  Int pocCycle = 1 << getSPS()->getBitsForPOC();
     279  if (!pocHasMsb)
     280  {
     281    poc = poc % pocCycle;
     282  }
     283 
    259284  while ( iterPic != rcListPic.end() )
    260285  {
    261286    pcPic = *(iterPic);
    262     if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC())))
     287    if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced())
     288    {
     289      Int picPoc = pcPic->getPOC();
     290      if (!pocHasMsb)
     291      {
     292        picPoc = picPoc % pocCycle;
     293      }
     294     
     295      if (poc == picPoc)
    263296    {
    264297      if(pcPic->getIsLongTerm())
     
    272305      break;
    273306    }
     307    }
    274308
    275309    iterPic++;
    276310  }
     311 
    277312  return  pcStPic;
    278313}
     
    293328}
    294329
     330#if L0034_COMBINED_LIST_CLEANUP
     331Void TComSlice::setList1IdxToList0Idx()
     332{
     333  Int idxL0, idxL1;
     334  for ( idxL1 = 0; idxL1 < getNumRefIdx( REF_PIC_LIST_1 ); idxL1++ )
     335  {
     336    m_list1IdxToList0Idx[idxL1] = -1;
     337    for ( idxL0 = 0; idxL0 < getNumRefIdx( REF_PIC_LIST_0 ); idxL0++ )
     338    {
     339      if ( m_apcRefPicList[REF_PIC_LIST_0][idxL0]->getPOC() == m_apcRefPicList[REF_PIC_LIST_1][idxL1]->getPOC() )
     340      {
     341        m_list1IdxToList0Idx[idxL1] = idxL0;
     342        break;
     343      }
     344    }
     345  }
     346}
     347#else
    295348Void TComSlice::generateCombinedList()
    296349{
     
    365418  }
    366419}
     420#endif
    367421
    368422#if H_MV
    369 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer )
     423Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr,std::vector<TComPic*>& refPicSetInterLayer )
     424#else
     425#if FIX1071
     426Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
    370427#else
    371428Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )
    372429#endif
    373 {
    374   if (m_eSliceType == I_SLICE)
    375   {
    376     ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
    377     ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     430#endif
     431{
     432#if FIX1071
     433  if (!checkNumPocTotalCurr)
     434#endif
     435  {
     436    if (m_eSliceType == I_SLICE)
     437    {
     438      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
     439      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     440     
     441      return;
     442    }
    378443   
    379     return;
    380   }
    381  
    382444#if !H_MV
    383   m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
    384   m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
    385 #endif
     445    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
     446    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
     447#endif
     448  }
    386449
    387450  TComPic*  pcRefPic= NULL;
     
    410473    }
    411474  }
     475 
    412476  for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
    413477  {
     
    422486    }
    423487  }
     488 
    424489  for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)
    425490  {
    426491    if(m_pcRPS->getUsed(i))
    427492    {
    428       pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
     493      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
    429494      pcRefPic->setIsLongTerm(1);
    430495      pcRefPic->getPicYuvRec()->extendPicBorder();
     
    434499    if(pcRefPic==NULL)
    435500    {
    436       pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
     501      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
    437502    }
    438503    pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 
     
    448513  Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
    449514#endif
    450 
    451   {
    452     Int cIdx = 0;
    453     for ( i=0; i<NumPocStCurr0; i++, cIdx++)
    454     {
    455       rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
    456     }
    457     for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    458     {
    459       rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
    460     }
    461     for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
    462     {
    463       rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
    464     }
     515#if FIX1071
     516  if (checkNumPocTotalCurr)
     517  {
     518    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
     519    // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     520    // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     521    if (getRapPicFlag())
     522    {
     523      assert(numPocTotalCurr == 0);
     524    }
     525
     526    if (m_eSliceType == I_SLICE)
     527    {
     528      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
     529      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     530     
     531      return;
     532    }
     533   
     534    assert(numPocTotalCurr != 0);
     535   
     536    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
     537    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
     538  }
     539#endif
     540
     541  Int cIdx = 0;
     542  for ( i=0; i<NumPocStCurr0; i++, cIdx++)
     543  {
     544    rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
     545  }
     546  for ( i=0; i<NumPocStCurr1; i++, cIdx++)
     547  {
     548    rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
     549  }
     550  for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
     551  {
     552    rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
     553  }
    465554#if H_MV
    466     for ( i=0; i<numDirectRefLayers;  i++, cIdx++)
    467     {
    468       if( cIdx <= MAX_NUM_REF )
    469       {
    470         rpsCurrList0[cIdx] = refPicSetInterLayer[i];
    471       }
    472     }
    473 #endif
    474   }
     555  for ( i=0; i<numDirectRefLayers;  i++, cIdx++)
     556  {
     557    if( cIdx <= MAX_NUM_REF )
     558    {
     559      rpsCurrList0[cIdx] = refPicSetInterLayer[i];
     560    }
     561  }
     562#endif
    475563
    476564  if (m_eSliceType==B_SLICE)
    477565  {
    478     Int cIdx = 0;
     566    cIdx = 0;
    479567    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    480568    {
     
    585673}
    586674
    587 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA)
     675Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)
    588676{
    589677  for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++)
     
    598686    if(pocCRA < MAX_UINT && getPOC() > pocCRA)
    599687    {
     688      if (!pReferencePictureSet->getCheckLTMSBPresent(i))
     689      {
     690        assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA);
     691      }
     692      else
     693      {
    600694      assert(pReferencePictureSet->getPOC(i) >= pocCRA);
    601695    }
    602696  }
    603   if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
     697  }
     698  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
    604699  {
    605700    pocCRA = getPOC();
     
    611706    prevRAPisBLA = false;
    612707  }
    613   else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
    614          || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
     708  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     709         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    615710         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found
    616711  {
     
    643738  Int pocCurr = getPOC();
    644739
    645   if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
    646     || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
     740  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     741    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    647742    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    648     || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR
     743    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    649744    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )  // IDR or BLA picture
    650745  {
     
    658753      iterPic++;
    659754    }
    660     if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
    661       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
     755    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     756      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    662757      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
    663758    {
     
    673768      {
    674769        rpcPic = *(iterPic);
    675         if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false);
     770        if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA)
     771        {
     772          rpcPic->getSlice(0)->setReferenced(false);
     773        }
    676774        iterPic++;
    677775      }
     
    707805  m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2;
    708806 
     807#if L0034_COMBINED_LIST_CLEANUP
     808  for (i = 0; i < 2; i++)
     809#else
    709810  for (i = 0; i < 3; i++)
     811#endif
    710812  {
    711813    m_aiNumRefIdx[i]     = pSrc->m_aiNumRefIdx[i];
    712814  }
    713815
     816#if L0034_COMBINED_LIST_CLEANUP
     817  for (i = 0; i < MAX_NUM_REF; i++)
     818  {
     819    m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i];
     820  }
     821#else
    714822  for (i = 0; i < 2; i++)
    715823  {
     
    728836  m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC;
    729837  m_bRefPicListCombinationFlag    = pSrc->m_bRefPicListCombinationFlag;
     838#endif
    730839  m_bCheckLDC             = pSrc->m_bCheckLDC;
    731840  m_iSliceQpDelta        = pSrc->m_iSliceQpDelta;
     
    785894  }
    786895
     896#if !L0034_COMBINED_LIST_CLEANUP
    787897  m_bNoBackPredFlag      = pSrc->m_bNoBackPredFlag;
     898#endif
    788899  m_uiTLayer                      = pSrc->m_uiTLayer;
    789900  m_bTLayerSwitchingFlag          = pSrc->m_bTLayerSwitchingFlag;
     
    819930
    820931Int TComSlice::m_prevPOC = 0;
     932
    821933/** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag.
    822934 * \param uiTLayer Temporal layer ID of the current slice
     
    879991  Int i, isReference;
    880992
    881   Int j = 0;
    882993  // loop through all pictures in the reference picture buffer
    883994  TComList<TComPic*>::iterator iterPic = rcListPic.begin();
    884995  while ( iterPic != rcListPic.end())
    885996  {
    886     j++;
    887997    rpcPic = *(iterPic++);
     998
     999    if(!rpcPic->getSlice( 0 )->isReferenced())
     1000    {
     1001      continue;
     1002    }
    8881003
    8891004    isReference = 0;
     
    9241039    {           
    9251040      rpcPic->getSlice( 0 )->setReferenced( false );   
     1041      rpcPic->setUsedByCurr(0);
    9261042      rpcPic->setIsLongTerm(0);
    9271043    }
     
    9291045    assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer());
    9301046    //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture
    931     if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
     1047    if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
    9321048    {
    9331049      assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer());
    9341050    }
    935 
    9361051    //check that pictures marked as temporal layer non-reference pictures are not used for reference
    9371052    if(rpcPic->getPicSym()->getSlice(0)->getPOC() != this->getPOC() && rpcPic->getTLayer()==this->getTLayer())
     
    9471062{
    9481063  TComPic* rpcPic;
    949   Int i, isAvailable, j;
     1064  Int i, isAvailable;
    9501065  Int atLeastOneLost = 0;
    9511066  Int atLeastOneRemoved = 0;
     
    9561071  for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++)
    9571072  {
    958     j = 0;
    9591073    isAvailable = 0;
    9601074    // loop through all pictures in the reference picture buffer
     
    9621076    while ( iterPic != rcListPic.end())
    9631077    {
    964       j++;
    9651078      rpcPic = *(iterPic++);
    9661079      if(pReferencePictureSet->getCheckLTMSBPresent(i)==true)
     
    9851098      while ( iterPic != rcListPic.end())
    9861099      {
    987         j++;
    9881100        rpcPic = *(iterPic++);
    9891101
    990         if((rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == (this->getPOC() + pReferencePictureSet->getDeltaPOC(i))%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced())
     1102        Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
     1103        Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC();
     1104        Int refPoc = pReferencePictureSet->getPOC(i);
     1105        if (!pReferencePictureSet->getCheckLTMSBPresent(i))
     1106        {
     1107          curPoc = curPoc % pocCycle;
     1108          refPoc = refPoc % pocCycle;
     1109        }
     1110       
     1111        if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc)
    9911112        {
    9921113          isAvailable = 1;
     
    10261147  for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++)
    10271148  {
    1028     j = 0;
    10291149    isAvailable = 0;
    10301150    // loop through all pictures in the reference picture buffer
     
    10321152    while ( iterPic != rcListPic.end())
    10331153    {
    1034       j++;
    10351154      rpcPic = *(iterPic++);
    10361155
     
    10491168        {
    10501169          if(printErrors)
     1170          {
    10511171            printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
     1172          }
    10521173          atLeastOneRemoved = 1;
    10531174        }
     
    10551176        {
    10561177          if(printErrors)
     1178          {
    10571179            printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
     1180          }
    10581181          atLeastOneLost = 1;
    10591182          iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i);
     
    12011324 * \returns Void
    12021325 */
    1203 Void  TComSlice::resetWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
     1326Void  TComSlice::resetWpScaling()
    12041327{
    12051328  for ( Int e=0 ; e<2 ; e++ )
     
    12091332      for ( Int yuv=0 ; yuv<3 ; yuv++ )
    12101333      {
    1211         wpScalingParam  *pwp = &(wp[e][i][yuv]);
     1334        wpScalingParam  *pwp = &(m_weightPredTable[e][i][yuv]);
    12121335        pwp->bPresentFlag      = false;
    12131336        pwp->uiLog2WeightDenom = 0;
     
    12251348Void  TComSlice::initWpScaling()
    12261349{
    1227   initWpScaling(m_weightPredTable);
    1228 }
    1229 
    1230 /** set WP tables
    1231  * \param wpScalingParam
    1232  * \returns Void
    1233  */
    1234 Void  TComSlice::initWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
    1235 {
    12361350  for ( Int e=0 ; e<2 ; e++ )
    12371351  {
     
    12401354      for ( Int yuv=0 ; yuv<3 ; yuv++ )
    12411355      {
    1242         wpScalingParam  *pwp = &(wp[e][i][yuv]);
    1243         if ( !pwp->bPresentFlag ) {
     1356        wpScalingParam  *pwp = &(m_weightPredTable[e][i][yuv]);
     1357        if ( !pwp->bPresentFlag )
     1358        {
    12441359          // Inferring values not present :
    12451360          pwp->iWeight = (1 << pwp->uiLog2WeightDenom);
     
    12751390, m_cprmsPresentFlag          (NULL)
    12761391{
    1277 
    12781392  for( Int i = 0; i < MAX_TLAYER; i++)
    12791393  {
    12801394    m_numReorderPics[i] = 0;
     1395#if L0323_DPB
     1396    m_uiMaxDecPicBuffering[i] = 1;
     1397#else
    12811398    m_uiMaxDecPicBuffering[i] = 0;
     1399#endif
    12821400    m_uiMaxLatencyIncrease[i] = 0;
    12831401  }
     
    13331451TComVPS::~TComVPS()
    13341452{
    1335   if( m_hrdParameters    != NULL )     delete m_hrdParameters;
    1336   if( m_hrdOpSetIdx      != NULL )     delete m_hrdOpSetIdx;
    1337   if( m_cprmsPresentFlag != NULL )     delete m_cprmsPresentFlag;
     1453if( m_hrdParameters    != NULL )     delete[] m_hrdParameters;
     1454  if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
     1455  if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
    13381456}
    13391457
     
    14381556, m_picWidthInLumaSamples     (352)
    14391557, m_picHeightInLumaSamples    (288)
     1558, m_log2MinCodingBlockSize    (  0)
     1559, m_log2DiffMaxMinCodingBlockSize (0)
    14401560, m_uiMaxCUWidth              ( 32)
    14411561, m_uiMaxCUHeight             ( 32)
    14421562, m_uiMaxCUDepth              (  3)
    1443 , m_uiMinTrDepth              (  0)
    1444 , m_uiMaxTrDepth              (  1)
    14451563, m_bLongTermRefsPresent      (false)
    14461564, m_uiQuadtreeTULog2MaxSize   (  0)
     
    14521570, m_pcmLog2MaxSize            (  5)
    14531571, m_uiPCMLog2MinSize          (  7)
     1572#if !L0034_COMBINED_LIST_CLEANUP
    14541573, m_bUseLComb                 (false)
     1574#endif
    14551575, m_bitDepthY                 (  8)
    14561576, m_bitDepthC                 (  8)
     
    14771597  {
    14781598    m_uiMaxLatencyIncrease[i] = 0;
     1599#if L0323_DPB
     1600    m_uiMaxDecPicBuffering[i] = 1;
     1601#else
    14791602    m_uiMaxDecPicBuffering[i] = 0;
     1603#endif
    14801604    m_numReorderPics[i]       = 0;
    14811605  }
     
    14961620  m_RPSList.create(numRPS);
    14971621}
     1622
    14981623Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess )
    14991624{
     
    17401865  return m_POC[bufferNum];
    17411866}
     1867
    17421868Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC)
    17431869{
    17441870  m_POC[bufferNum] = POC;
    17451871}
     1872
    17461873Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum)
    17471874{
    17481875  return m_bCheckLTMSB[bufferNum];
    17491876}
     1877
    17501878Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b)
    17511879{
     
    20252153  ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]));
    20262154}
     2155
    20272156/** parse syntax infomation
    20282157 *  \param pchFile syntax infomation
     
    21172246  m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32
    21182247}
     2248
    21192249/** destroy quantization matrix array
    21202250 */
     
    21292259  }
    21302260}
     2261
    21312262/** get default address of quantization matrix
    21322263 * \param sizeId size index
     
    21582289  return src;
    21592290}
     2291
    21602292/** process of default matrix
    21612293 * \param sizeId size index
     
    21672299  setScalingListDC(sizeId,listId,SCALING_LIST_DC);
    21682300}
     2301
    21692302/** check DC value of matrix for default matrix signaling
    21702303 */
     
    22272360//! activate a PPS and depending on isIDR parameter also SPS and VPS
    22282361//! \returns true, if activation is successful
    2229 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR)
     2362Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)
    22302363{
    22312364  TComPPS *pps = m_ppsMap.getPS(ppsId);
     
    22362369    // active parameter sets per layer should be used here
    22372370#else
    2238     if (!isIDR && (spsId != m_activeSPSId))
    2239     {
    2240       printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR.");
     2371    if (!isIRAP && (spsId != m_activeSPSId))
     2372    {
     2373      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");
    22412374      return false;
    22422375    }
     
    22462379    {
    22472380      Int vpsId = sps->getVPSId();
    2248       if (!isIDR && (vpsId != m_activeVPSId))
    2249       {
    2250         printf("Warning: tried to activate PPS referring to a inactive VPS at non-IDR.");
     2381      if (!isIRAP && (vpsId != m_activeVPSId))
     2382      {
     2383        printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");
    22512384        return false;
    22522385      }
     
    23072440}
    23082441#endif
    2309 
    23102442#if SIGNAL_BITRATE_PICRATE_IN_VPS
    23112443TComBitRatePicRateInfo::TComBitRatePicRateInfo()
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComSlice.h

    r331 r362  
    905905  UInt        m_picHeightInLumaSamples;
    906906 
    907   Window      m_conformanceWindow;
    908 
     907  Int         m_log2MinCodingBlockSize;
     908  Int         m_log2DiffMaxMinCodingBlockSize;
    909909  UInt        m_uiMaxCUWidth;
    910910  UInt        m_uiMaxCUHeight;
    911911  UInt        m_uiMaxCUDepth;
    912   UInt        m_uiMinTrDepth;
    913   UInt        m_uiMaxTrDepth;
     912
     913  Window      m_conformanceWindow;
     914
    914915  TComRPSList m_RPSList;
    915916  Bool        m_bLongTermRefsPresent;
     
    927928  Bool        m_useAMP;
    928929
     930#if !L0034_COMBINED_LIST_CLEANUP
    929931  Bool        m_bUseLComb;
     932#endif
    930933 
    931934  // Parameter
     
    10041007  Bool getUsedByCurrPicLtSPSFlag(Int i)        {return m_usedByCurrPicLtSPSFlag[i];}
    10051008  Void setUsedByCurrPicLtSPSFlag(Int i, Bool x)      { m_usedByCurrPicLtSPSFlag[i] = x;}
     1009
     1010  Int  getLog2MinCodingBlockSize() const           { return m_log2MinCodingBlockSize; }
     1011  Void setLog2MinCodingBlockSize(Int val)          { m_log2MinCodingBlockSize = val; }
     1012  Int  getLog2DiffMaxMinCodingBlockSize() const    { return m_log2DiffMaxMinCodingBlockSize; }
     1013  Void setLog2DiffMaxMinCodingBlockSize(Int val)   { m_log2DiffMaxMinCodingBlockSize = val; }
     1014
    10061015  Void setMaxCUWidth  ( UInt u ) { m_uiMaxCUWidth = u;      }
    10071016  UInt getMaxCUWidth  ()         { return  m_uiMaxCUWidth;  }
     
    10201029  Bool getUseAMP() { return m_useAMP; }
    10211030  Void setUseAMP( Bool b ) { m_useAMP = b; }
    1022   Void setMinTrDepth  ( UInt u ) { m_uiMinTrDepth = u;      }
    1023   UInt getMinTrDepth  ()         { return  m_uiMinTrDepth;  }
    1024   Void setMaxTrDepth  ( UInt u ) { m_uiMaxTrDepth = u;      }
    1025   UInt getMaxTrDepth  ()         { return  m_uiMaxTrDepth;  }
    10261031  Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u;    }
    10271032  UInt getQuadtreeTULog2MaxSize()         { return m_uiQuadtreeTULog2MaxSize; }
     
    10451050 
    10461051  // Tool list
     1052#if !L0034_COMBINED_LIST_CLEANUP
    10471053  Void setUseLComb    (Bool b)   { m_bUseLComb = b;         }
    10481054  Bool getUseLComb    ()         { return m_bUseLComb;      }
     1055#endif
    10491056
    10501057  Bool getUseLossless ()         { return m_useLossless; }
     
    11301137  Void       setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; }
    11311138  UInt       getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; }
    1132 
    11331139#if H_MV
    11341140  // Why not an listIdx for all members, would avoid code duplication??
     
    13671373  Int         m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
    13681374  Int         m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
    1369  
     1375#if L0034_COMBINED_LIST_CLEANUP
     1376  Int         m_list1IdxToList0Idx[MAX_NUM_REF];
     1377  Int         m_aiNumRefIdx   [2];    //  for multiple reference of current slice
     1378#else
    13701379  Int         m_aiNumRefIdx   [3];    //  for multiple reference of current slice
    13711380
     
    13771386  Bool        m_bRefPicListModificationFlagLC;
    13781387  Bool        m_bRefPicListCombinationFlag;
     1388#endif
    13791389
    13801390  Bool        m_bCheckLDC;
     
    14171427
    14181428  Bool        m_abEqualRef  [2][MAX_NUM_REF][MAX_NUM_REF];
    1419  
     1429#if !L0034_COMBINED_LIST_CLEANUP
    14201430  Bool        m_bNoBackPredFlag;
     1431#endif
    14211432  UInt        m_uiTLayer;
    14221433  Bool        m_bTLayerSwitchingFlag;
     
    15261537  Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
    15271538  Int       getNumRpsCurrTempList();
     1539#if L0034_COMBINED_LIST_CLEANUP
     1540  Int       getList1IdxToList0Idx ( Int list1Idx )               { return m_list1IdxToList0Idx[list1Idx]; }
     1541#else
    15281542  Int       getRefIdxOfLC       (RefPicList e, Int iRefIdx)     { return m_iRefIdxOfLC[e][iRefIdx];           }
    15291543  Int       getListIdFromIdxOfLC(Int iRefIdx)                   { return m_eListIdFromIdxOfLC[iRefIdx];       }
     
    15351549  Bool      getRefPicListCombinationFlag()                      {return m_bRefPicListCombinationFlag;}
    15361550  Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}   
     1551#endif
    15371552  Void      setReferenced(Bool b)                               { m_bRefenced = b; }
    15381553  Bool      isReferenced()                                      { return m_bRefenced; }
    15391554  Void      setPOC              ( Int i )                       { m_iPOC              = i; if(getTLayer()==0) m_prevPOC=i; }
    15401555  Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
    1541   NalUnitType getNalUnitType    ()                              { return m_eNalUnitType;        }
     1556  NalUnitType getNalUnitType    () const                        { return m_eNalUnitType;        }
    15421557  Bool      getRapPicFlag       (); 
    1543   Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
    1544   Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA);
     1558  Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
     1559  Bool      isIRAP              () const                        { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 
     1560  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic);
    15451561  Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
    15461562  Void      setSliceType        ( SliceType e )                 { m_eSliceType        = e;      }
     
    15681584#endif
    15691585#if H_MV
    1570   Void      setRefPicList       ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet );
     1586  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false , std::vector<TComPic*>& interLayerRefPicSet );
     1587#else
     1588#if FIX1071
     1589  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false );
    15711590#else
    15721591  Void      setRefPicList       ( TComList<TComPic*>& rcListPic );
     1592#endif
     1593
    15731594#endif
    15741595  Void      setRefPOCList       ();
     
    16041625 
    16051626  static Void      sortPicList         ( TComList<TComPic*>& rcListPic );
    1606  
     1627#if L0034_COMBINED_LIST_CLEANUP
     1628  Void setList1IdxToList0Idx();
     1629#else
    16071630  Bool getNoBackPredFlag() { return m_bNoBackPredFlag; }
    16081631  Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; }
    16091632  Void generateCombinedList       ();
     1633#endif
    16101634
    16111635  UInt getTLayer             ()                            { return m_uiTLayer;                      }
     
    16651689  Void  getWpScaling    ( RefPicList e, Int iRefIdx, wpScalingParam *&wp);
    16661690
    1667   Void  resetWpScaling  (wpScalingParam  wp[2][MAX_NUM_REF][3]);
    1668   Void  initWpScaling    (wpScalingParam  wp[2][MAX_NUM_REF][3]);
     1691  Void  resetWpScaling  ();
    16691692  Void  initWpScaling   ();
    16701693  inline Bool applyWP   () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); }
     
    17121735#endif
    17131736#endif
    1714 
    17151737protected:
    17161738  TComPic*  xGetRefPic  (TComList<TComPic*>& rcListPic,
    17171739                         Int                 poc);
    1718   TComPic*  xGetLongTermRefPic  (TComList<TComPic*>& rcListPic,
    1719                          Int                 poc);
     1740TComPic*  xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);
    17201741#if H_MV
    17211742  TComPic*  xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId );
     
    18041825  //! activate a PPS and depending on isIDR parameter also SPS and VPS
    18051826  //! \returns true, if activation is successful
    1806   Bool activatePPS(Int ppsId, Bool isIDR);
     1827  Bool activatePPS(Int ppsId, Bool isIRAP);
    18071828
    18081829  TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r324 r362  
    19861986          }
    19871987         
    1988           if(piQCoef[minPos] == 32767 || piQCoef[minPos] == -32768)
     1988          if(piDstCoeff[minPos] == 32767 || piDstCoeff[minPos] == -32768)
    19891989          {
    19901990            finalChange = -1;
  • branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TypeDef.h

    r324 r362  
    4949#endif
    5050
    51 ///// ***** HM 10.0 *********
    52 
     51///// ***** HM 10.1 *********
     52#define FIX1071 1 ///< Temporary fix for issue #1071
     53
     54#define L0208_SOP_DESCRIPTION_SEI     1 ///< L0208: add SOP descrioption SEI
     55#define MAX_NUM_PICS_IN_SOP           1024
     56
     57#define K0180_SCALABLE_NESTING_SEI  1   ///JCTVC-K0180 scalable nesting sei message
     58#define MAX_NESTING_NUM_OPS         1024
     59#define MAX_NESTING_NUM_LAYER       64
     60
     61#define J0149_TONE_MAPPING_SEI        1 ///< J0149: Tone mapping information SEI
    5362#define L0363_DU_BIT_RATE             1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters
    5463#define L0328_SPLICING                1 ///< L0328: splicing support in HRD
     
    7584#define SIGNAL_BITRATE_PICRATE_IN_VPS               0  ///< K0125: Signal bit_rate and pic_rate in VPS
    7685#define L0232_RD_PENALTY           1  ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices
     86#define L0386_DB_METRIC            1  ///< L0386: non-normative blockiness metric (automatically configures deblocking parameters in bitstream)
     87#define L0323_DPB                     1 ///< L0323: Specification of active reference indices and decoded picture buffer
     88
     89#define L0034_COMBINED_LIST_CLEANUP 1
    7790
    7891#define MAX_VPS_NUM_HRD_PARAMETERS                1
     
    412425  REF_PIC_LIST_0 = 0,   ///< reference list 0
    413426  REF_PIC_LIST_1 = 1,   ///< reference list 1
     427#if !L0034_COMBINED_LIST_CLEANUP
    414428  REF_PIC_LIST_C = 2,   ///< combined reference list for uni-prediction in B-Slices
     429#endif
    415430  REF_PIC_LIST_X = 100  ///< special mark
    416431};
Note: See TracChangeset for help on using the changeset viewer.