Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/CommonDef.h	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/CommonDef.h	(revision 438)
@@ -57,8 +57,8 @@
 
 #if H_MV
-#define NV_VERSION        "0.2"                 ///< Current software version
-#define HM_VERSION        "10.1"                ///< 
-#else
-#define NV_VERSION        "10.1"                 ///< Current software version
+#define NV_VERSION        "0.1"                 ///< Current software version
+#define HM_VERSION        "10.0"                ///< 
+#else
+#define NV_VERSION        "10.0"                 ///< Current software version
 #endif
 
@@ -115,7 +115,5 @@
 #define MAX_NUM_REF_PICS            16          ///< max. number of pictures used for reference
 #define MAX_NUM_REF                 16          ///< max. number of entries in picture reference list
-#if !L0034_COMBINED_LIST_CLEANUP
 #define MAX_NUM_REF_LC              MAX_NUM_REF_PICS  // TODO: remove this macro definition (leftover from combined list concept)
-#endif
 
 #define MAX_UINT                    0xFFFFFFFFU ///< max. value of unsigned 32-bit integer
@@ -138,4 +136,6 @@
 template <typename T> inline T ClipY(T x) { return std::min<T>(T((1 << g_bitDepthY)-1), std::max<T>( T(0), x)); }
 template <typename T> inline T ClipC(T x) { return std::min<T>(T((1 << g_bitDepthC)-1), std::max<T>( T(0), x)); }
+
+template <typename T> inline T Clip(T x) { return std::min<T>(T((1 << g_bitDepthY)-1), std::max<T>( T(0), x)); }
 
 /** clip a, such that minVal <= a <= maxVal */
@@ -168,4 +168,5 @@
 
 #endif
+
 
 // ====================================================================================================================
@@ -215,5 +216,5 @@
   
   NAL_UNIT_CODED_SLICE_TSA_N,     // 2
-  NAL_UNIT_CODED_SLICE_TLA_R,       // 3
+  NAL_UNIT_CODED_SLICE_TLA,       // 3   // Current name in the spec: TSA_R
   
   NAL_UNIT_CODED_SLICE_STSA_N,    // 4
@@ -221,33 +222,33 @@
 
   NAL_UNIT_CODED_SLICE_RADL_N,    // 6
-  NAL_UNIT_CODED_SLICE_RADL_R,      // 7
+  NAL_UNIT_CODED_SLICE_DLP,       // 7 // Current name in the spec: RADL_R
   
   NAL_UNIT_CODED_SLICE_RASL_N,    // 8
-  NAL_UNIT_CODED_SLICE_RASL_R,      // 9
-
-  NAL_UNIT_RESERVED_VCL_N10,
-  NAL_UNIT_RESERVED_VCL_R11,
-  NAL_UNIT_RESERVED_VCL_N12,
-  NAL_UNIT_RESERVED_VCL_R13,
-  NAL_UNIT_RESERVED_VCL_N14,
-  NAL_UNIT_RESERVED_VCL_R15,
-
-  NAL_UNIT_CODED_SLICE_BLA_W_LP,    // 16
-  NAL_UNIT_CODED_SLICE_BLA_W_RADL,  // 17
+  NAL_UNIT_CODED_SLICE_TFD,       // 9 // Current name in the spec: RASL_R
+
+  NAL_UNIT_RESERVED_10,
+  NAL_UNIT_RESERVED_11,
+  NAL_UNIT_RESERVED_12,
+  NAL_UNIT_RESERVED_13,
+  NAL_UNIT_RESERVED_14,
+  NAL_UNIT_RESERVED_15,
+
+  NAL_UNIT_CODED_SLICE_BLA,       // 16   // Current name in the spec: BLA_W_LP
+  NAL_UNIT_CODED_SLICE_BLANT,     // 17   // Current name in the spec: BLA_W_DLP
   NAL_UNIT_CODED_SLICE_BLA_N_LP,  // 18
-  NAL_UNIT_CODED_SLICE_IDR_W_RADL,  // 19
+  NAL_UNIT_CODED_SLICE_IDR,       // 19  // Current name in the spec: IDR_W_DLP
   NAL_UNIT_CODED_SLICE_IDR_N_LP,  // 20
   NAL_UNIT_CODED_SLICE_CRA,       // 21
-  NAL_UNIT_RESERVED_IRAP_VCL22,
-  NAL_UNIT_RESERVED_IRAP_VCL23,
-
-  NAL_UNIT_RESERVED_VCL24,
-  NAL_UNIT_RESERVED_VCL25,
-  NAL_UNIT_RESERVED_VCL26,
-  NAL_UNIT_RESERVED_VCL27,
-  NAL_UNIT_RESERVED_VCL28,
-  NAL_UNIT_RESERVED_VCL29,
-  NAL_UNIT_RESERVED_VCL30,
-  NAL_UNIT_RESERVED_VCL31,
+  NAL_UNIT_RESERVED_22,
+  NAL_UNIT_RESERVED_23,
+
+  NAL_UNIT_RESERVED_24,
+  NAL_UNIT_RESERVED_25,
+  NAL_UNIT_RESERVED_26,
+  NAL_UNIT_RESERVED_27,
+  NAL_UNIT_RESERVED_28,
+  NAL_UNIT_RESERVED_29,
+  NAL_UNIT_RESERVED_30,
+  NAL_UNIT_RESERVED_31,
 
   NAL_UNIT_VPS,                   // 32
@@ -258,13 +259,13 @@
   NAL_UNIT_EOB,                   // 37
   NAL_UNIT_FILLER_DATA,           // 38
-  NAL_UNIT_PREFIX_SEI,              // 39
-  NAL_UNIT_SUFFIX_SEI,              // 40
-  NAL_UNIT_RESERVED_NVCL41,
-  NAL_UNIT_RESERVED_NVCL42,
-  NAL_UNIT_RESERVED_NVCL43,
-  NAL_UNIT_RESERVED_NVCL44,
-  NAL_UNIT_RESERVED_NVCL45,
-  NAL_UNIT_RESERVED_NVCL46,
-  NAL_UNIT_RESERVED_NVCL47,
+  NAL_UNIT_SEI,                   // 39 Prefix SEI
+  NAL_UNIT_SEI_SUFFIX,            // 40 Suffix SEI
+  NAL_UNIT_RESERVED_41,
+  NAL_UNIT_RESERVED_42,
+  NAL_UNIT_RESERVED_43,
+  NAL_UNIT_RESERVED_44,
+  NAL_UNIT_RESERVED_45,
+  NAL_UNIT_RESERVED_46,
+  NAL_UNIT_RESERVED_47,
   NAL_UNIT_UNSPECIFIED_48,
   NAL_UNIT_UNSPECIFIED_49,
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/NAL.h
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/NAL.h	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/NAL.h	(revision 438)
@@ -47,4 +47,5 @@
   NalUnitType m_nalUnitType; ///< nal_unit_type
   UInt        m_temporalId;  ///< temporal_id
+
 #if H_MV
   Int         m_layerId;     ///< layer id
@@ -79,24 +80,24 @@
     return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA_R
+        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
+        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA
+        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLANT
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
+        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R
+        || m_nalUnitType == NAL_UNIT_CODED_SLICE_DLP
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R;
+        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TFD;
   }
 #if L0045_NON_NESTED_SEI_RESTRICTIONS
   Bool isSei()
   {
-    return m_nalUnitType == NAL_UNIT_PREFIX_SEI 
-        || m_nalUnitType == NAL_UNIT_SUFFIX_SEI;
+    return m_nalUnitType == NAL_UNIT_SEI 
+        || m_nalUnitType == NAL_UNIT_SEI_SUFFIX;
   }
 
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.cpp	(revision 438)
@@ -38,9 +38,4 @@
 #include "CommonDef.h"
 #include "SEI.h"
-
-#if J0149_TONE_MAPPING_SEI 
-//Table D-7 Meaning of camera iso sensitivity indicator and exposure index rating indicator
-Int  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};
-#endif
 
 SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.h
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.h	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/SEI.h	(revision 438)
@@ -355,58 +355,4 @@
 };
 
-#if L0208_SOP_DESCRIPTION_SEI
-class SEISOPDescription : public SEI
-{
-public:
-  PayloadType payloadType() const { return SOP_DESCRIPTION; }
-
-  SEISOPDescription() {}
-  virtual ~SEISOPDescription() {}
-
-  UInt m_sopSeqParameterSetId;
-  UInt m_numPicsInSopMinus1;
-
-  UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP];
-  UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP];
-  UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP];
-  Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP];
-};
-#endif
-
-#if J0149_TONE_MAPPING_SEI 
-class SEIToneMappingInfo : public SEI
-{
-public:
-  PayloadType payloadType() const { return TONE_MAPPING_INFO; }
-  SEIToneMappingInfo() {}
-  virtual ~SEIToneMappingInfo() {}
-
-  Int    m_toneMapId;
-  Bool   m_toneMapCancelFlag;
-  Bool   m_toneMapPersistenceFlag;
-  Int    m_codedDataBitDepth;
-  Int    m_targetBitDepth;
-  Int    m_modelId;
-  Int    m_minValue;
-  Int    m_maxValue;
-  Int    m_sigmoidMidpoint;
-  Int    m_sigmoidWidth;
-  std::vector<Int> m_startOfCodedInterval;
-  Int    m_numPivots;
-  std::vector<Int> m_codedPivotValue;
-  std::vector<Int> m_targetPivotValue;
-  Int    m_cameraIsoSpeedIdc;
-  Int    m_cameraIsoSpeedValue;
-  Int    m_exposureCompensationValueSignFlag;
-  Int    m_exposureCompensationValueNumerator;
-  Int    m_exposureCompensationValueDenomIdc;
-  Int    m_refScreenLuminanceWhite;
-  Int    m_extendedRangeWhiteLevel;
-  Int    m_nominalBlackLevelLumaCodeValue;
-  Int    m_nominalWhiteLevelLumaCodeValue;
-  Int    m_extendedWhiteLevelLumaCodeValue;
-};
-#endif
-
 typedef std::list<SEI*> SEIMessages;
 
@@ -420,35 +366,3 @@
 Void deleteSEIs (SEIMessages &seiList);
 
-#if K0180_SCALABLE_NESTING_SEI
-class SEIScalableNesting : public SEI
-{
-public:
-  PayloadType payloadType() const { return SCALABLE_NESTING; }
-
-  SEIScalableNesting() {}
-  virtual ~SEIScalableNesting()
-  {
-    if (!m_callerOwnsSEIs)
-    {
-      deleteSEIs(m_nestedSEIs);
-    }
-  }
-
-  Bool  m_bitStreamSubsetFlag;
-  Bool  m_nestingOpFlag;
-  Bool  m_defaultOpFlag;                             //value valid if m_nestingOpFlag != 0
-  UInt  m_nestingNumOpsMinus1;                       // -"-
-  UInt  m_nestingMaxTemporalIdPlus1[MAX_TLAYER];     // -"-
-  UInt  m_nestingOpIdx[MAX_NESTING_NUM_OPS];         // -"-
-
-  Bool  m_allLayersFlag;                             //value valid if m_nestingOpFlag == 0
-  UInt  m_nestingNoOpMaxTemporalIdPlus1;             //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
-  UInt  m_nestingNumLayersMinus1;                    //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
-  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
-
-  Bool  m_callerOwnsSEIs;
-  SEIMessages m_nestedSEIs;
-};
-#endif
-
 //! \}
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.cpp	(revision 438)
@@ -177,5 +177,4 @@
   }
 }
-
 Void TComOutputBitstream::writeByteAlignment()
 {
@@ -183,37 +182,4 @@
   writeAlignZero();
 }
-
-Int TComOutputBitstream::countStartCodeEmulations()
-{
-  UInt cnt = 0;
-  vector<uint8_t>& rbsp   = getFIFO();
-  for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();)
-  {
-    vector<uint8_t>::iterator found = it;
-    do
-    {
-      // find the next emulated 00 00 {00,01,02,03}
-      // NB, end()-1, prevents finding a trailing two byte sequence
-      found = search_n(found, rbsp.end()-1, 2, 0);
-      found++;
-      // if not found, found == end, otherwise found = second zero byte
-      if (found == rbsp.end())
-      {
-        break;
-      }
-      if (*(++found) <= 3)
-      {
-        break;
-      }
-    } while (true);
-    it = found;
-    if (found != rbsp.end())
-    {
-      cnt++;
-    }
-  }
-  return cnt;
-}
-
 /**
  * read #uiNumberOfBits# from bitstream without updating the bitstream
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.h
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.h	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComBitStream.h	(revision 438)
@@ -154,7 +154,4 @@
   Void          addSubstream    ( TComOutputBitstream* pcSubstream );
   Void writeByteAlignment();
-
-  //! returns the number of start code emulations contained in the current buffer
-  Int countStartCodeEmulations();
 };
 
@@ -166,5 +163,4 @@
 {
   std::vector<uint8_t> *m_fifo; /// FIFO for storage of complete bytes
-  std::vector<UInt> m_emulationPreventionByteLocation;
 
 protected:
@@ -210,11 +206,4 @@
   UInt  getNumBitsRead() { return m_numBitsRead; }
   Void readByteAlignment();
-
-  Void      pushEmulationPreventionByteLocation ( UInt pos )                  { m_emulationPreventionByteLocation.push_back( pos ); }
-  UInt      numEmulationPreventionBytesRead     ()                            { return (UInt) m_emulationPreventionByteLocation.size();    }
-  std::vector<UInt>  getEmulationPreventionByteLocation  ()                   { return m_emulationPreventionByteLocation;           }
-  UInt      getEmulationPreventionByteLocation  ( UInt idx )                  { return m_emulationPreventionByteLocation[ idx ];    }
-  Void      clearEmulationPreventionByteLocation()                            { m_emulationPreventionByteLocation.clear();          }
-  Void      setEmulationPreventionByteLocation  ( std::vector<UInt> vec )     { m_emulationPreventionByteLocation = vec;            }
 };
 
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 438)
@@ -3200,4 +3200,5 @@
   Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm();
   Bool bIsNeibRefLongTerm = false;
+
   //---------------  V1 (END) ------------------//
   if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0)
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.cpp	(revision 438)
@@ -57,10 +57,10 @@
 // ====================================================================================================================
 
-const UChar TComLoopFilter::sm_tcTable[54] =
+const UChar tctable_8x8[54] =
 {
   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
 };
 
-const UChar TComLoopFilter::sm_betaTable[52] =
+const UChar betatable_8x8[52] =
 {
   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
@@ -585,6 +585,6 @@
       Int iIndexB = Clip3(0, MAX_QP, iQP + (betaOffsetDiv2 << 1));
       
-      Int iTc =  sm_tcTable[iIndexTC]*iBitdepthScale;
-      Int iBeta = sm_betaTable[iIndexB]*iBitdepthScale;
+      Int iTc =  tctable_8x8[iIndexTC]*iBitdepthScale;
+      Int iBeta = betatable_8x8[iIndexB]*iBitdepthScale;
       Int iSideThreshold = (iBeta+(iBeta>>1))>>3;
       Int iThrCut = iTc*10;
@@ -735,5 +735,5 @@
 
         Int iIndexTC = Clip3(0, MAX_QP+DEFAULT_INTRA_TC_OFFSET, iQP + DEFAULT_INTRA_TC_OFFSET*(ucBs - 1) + (tcOffsetDiv2 << 1));
-        Int iTc =  sm_tcTable[iIndexTC]*iBitdepthScale;
+        Int iTc =  tctable_8x8[iIndexTC]*iBitdepthScale;
 
         for ( UInt uiStep = 0; uiStep < uiPelsInPartChroma; uiStep++ )
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.h
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.h	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComLoopFilter.h	(revision 438)
@@ -99,7 +99,4 @@
   __inline Int xCalcDQ( Pel* piSrc, Int iOffset);
   
-  static const UChar sm_tcTable[54];
-  static const UChar sm_betaTable[52];
-
 public:
   TComLoopFilter();
@@ -114,10 +111,4 @@
   /// picture-level deblocking filter
   Void loopFilterPic( TComPic* pcPic );
-
-  static Int getBeta( Int qp )
-  {
-    Int indexB = Clip3( 0, MAX_QP, qp );
-    return sm_betaTable[ indexB ];
-  }
 };
 
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 438)
@@ -481,4 +481,3 @@
 #endif
 
-
 //! \}
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.h	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPic.h	(revision 438)
@@ -93,4 +93,5 @@
 #endif
 #endif
+
 public:
   TComPic();
@@ -115,4 +116,5 @@
 #endif
 #endif
+
   Bool          getUsedByCurr()             { return m_bUsedByCurr; }
   Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
@@ -184,4 +186,7 @@
   Void          print( Bool legend );
 #endif
+
+
+
   /** transfer ownership of seis to this picture */
   void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 438)
@@ -83,6 +83,6 @@
   if( m_piYuvExt == NULL )
   {
-    Int extWidth  = MAX_CU_SIZE + 16; 
-    Int extHeight = MAX_CU_SIZE + 1;
+    Int extWidth  = g_uiMaxCUWidth + 16; 
+    Int extHeight = g_uiMaxCUHeight + 1;
     Int i, j;
     for (i = 0; i < 4; i++)
@@ -94,18 +94,18 @@
       }
     }
-    m_iYuvExtHeight  = ((MAX_CU_SIZE + 2) << 4);
-    m_iYuvExtStride = ((MAX_CU_SIZE  + 8) << 4);
+    m_iYuvExtHeight  = ((g_uiMaxCUHeight + 2) << 4);
+    m_iYuvExtStride = ((g_uiMaxCUWidth  + 8) << 4);
     m_piYuvExt = new Int[ m_iYuvExtStride * m_iYuvExtHeight ];
 
     // new structure
-    m_acYuvPred[0] .create( MAX_CU_SIZE, MAX_CU_SIZE );
-    m_acYuvPred[1] .create( MAX_CU_SIZE, MAX_CU_SIZE );
-
-    m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE );
-  }
-
-  if (m_iLumaRecStride != (MAX_CU_SIZE>>1) + 1)
-  {
-    m_iLumaRecStride =  (MAX_CU_SIZE>>1) + 1;
+    m_acYuvPred[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
+    m_acYuvPred[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
+
+    m_cYuvPredTemp.create( g_uiMaxCUWidth, g_uiMaxCUHeight );
+  }
+
+  if (m_iLumaRecStride != (g_uiMaxCUWidth>>1) + 1)
+  {
+    m_iLumaRecStride =  (g_uiMaxCUWidth>>1) + 1;
     if (!m_pLumaRecBuffer)
     {
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 438)
@@ -62,4 +62,5 @@
   g_aucConvertToBit[ i ] = c;
   
+  // g_auiFrameScanXY[ g_aucConvertToBit[ transformSize ] ]: zigzag scan array for transformSize
   c=2;
   for ( i=0; i<MAX_CU_DEPTH; i++ )
@@ -76,5 +77,7 @@
 Void destroyROM()
 {
-  for (Int i=0; i<MAX_CU_DEPTH; i++ )
+  Int i;
+  
+  for ( i=0; i<MAX_CU_DEPTH; i++ )
   {
     delete[] g_auiSigLastScan[0][i];
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 438)
@@ -49,5 +49,5 @@
 , m_iPOC                          ( 0 )
 , m_iLastIDR                      ( 0 )
-, m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR_W_RADL )
+, m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR )
 , m_eSliceType                    ( I_SLICE )
 , m_iSliceQp                      ( 0 )
@@ -60,8 +60,6 @@
 , m_deblockingFilterBetaOffsetDiv2 ( 0 )
 , m_deblockingFilterTcOffsetDiv2   ( 0 )
-#if !L0034_COMBINED_LIST_CLEANUP
 , m_bRefPicListModificationFlagLC ( false )
 , m_bRefPicListCombinationFlag    ( false )
-#endif
 , m_bCheckLDC                     ( false )
 , m_iSliceQpDelta                 ( 0 )
@@ -81,7 +79,5 @@
 , m_dLambda                       ( 0.0 )
 #endif
-#if !L0034_COMBINED_LIST_CLEANUP
 , m_bNoBackPredFlag               ( false )
-#endif
 , m_uiTLayer                      ( 0 )
 , m_bTLayerSwitchingFlag          ( false )
@@ -115,18 +111,8 @@
 #endif
 {
-#if L0034_COMBINED_LIST_CLEANUP
-  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0;
-#else
   m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
-#endif
   
   initEqualRef();
   
-#if L0034_COMBINED_LIST_CLEANUP
-  for ( Int idx = 0; idx < MAX_NUM_REF; idx++ )
-  {
-    m_list1IdxToList0Idx[idx] = -1;
-  }
-#else
   for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)
   {
@@ -138,5 +124,4 @@
     m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;
   }    
-#endif
   for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++)
   {
@@ -150,5 +135,5 @@
 #endif
   }
-  resetWpScaling();
+  resetWpScaling(m_weightPredTable);
   initWpAcDcParam();
   m_saoEnabledFlag = false;
@@ -171,16 +156,12 @@
   m_colRefIdx = 0;
   initEqualRef();
-#if !L0034_COMBINED_LIST_CLEANUP
   m_bNoBackPredFlag = false;
   m_bRefPicListCombinationFlag = false;
   m_bRefPicListModificationFlagLC = false;
-#endif
   m_bCheckLDC = false;
   m_iSliceQpDeltaCb = 0;
   m_iSliceQpDeltaCr = 0;
 
-#if !L0034_COMBINED_LIST_CLEANUP
   m_aiNumRefIdx[REF_PIC_LIST_C]      = 0;
-#endif
 
   m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
@@ -196,9 +177,9 @@
 Bool TComSlice::getRapPicFlag()
 {
-  return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
+  return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR
       || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
-      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
+      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
+      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
       || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
 }
@@ -270,28 +251,14 @@
 
 
-TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb)
+TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic,
+                                        Int                 poc)
 {
   TComList<TComPic*>::iterator  iterPic = rcListPic.begin();  
   TComPic*                      pcPic = *(iterPic);
   TComPic*                      pcStPic = pcPic;
-  
-  Int pocCycle = 1 << getSPS()->getBitsForPOC();
-  if (!pocHasMsb)
-  {
-    poc = poc % pocCycle;
-  }
-  
   while ( iterPic != rcListPic.end() )
   {
     pcPic = *(iterPic);
-    if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced())
-    {
-      Int picPoc = pcPic->getPOC();
-      if (!pocHasMsb)
-      {
-        picPoc = picPoc % pocCycle;
-      }
-      
-      if (poc == picPoc)
+    if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC())))
     {
       if(pcPic->getIsLongTerm())
@@ -305,9 +272,7 @@
       break;
     }
-    }
 
     iterPic++;
   }
-  
   return  pcStPic;
 }
@@ -328,22 +293,4 @@
 }
 
-#if L0034_COMBINED_LIST_CLEANUP
-Void TComSlice::setList1IdxToList0Idx()
-{
-  Int idxL0, idxL1;
-  for ( idxL1 = 0; idxL1 < getNumRefIdx( REF_PIC_LIST_1 ); idxL1++ )
-  {
-    m_list1IdxToList0Idx[idxL1] = -1;
-    for ( idxL0 = 0; idxL0 < getNumRefIdx( REF_PIC_LIST_0 ); idxL0++ )
-    {
-      if ( m_apcRefPicList[REF_PIC_LIST_0][idxL0]->getPOC() == m_apcRefPicList[REF_PIC_LIST_1][idxL1]->getPOC() )
-      {
-        m_list1IdxToList0Idx[idxL1] = idxL0;
-        break;
-      }
-    }
-  }
-}
-#else
 Void TComSlice::generateCombinedList()
 {
@@ -418,33 +365,23 @@
   }
 }
-#endif
 
 #if H_MV
-Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)
-#else
-#if FIX1071
-Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
+Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer )
 #else
 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )
 #endif
-#endif
-{
-#if FIX1071
-  if (!checkNumPocTotalCurr)
-#endif
-  {
-    if (m_eSliceType == I_SLICE)
-    {
-      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
-      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
-      
-      return;
-    }
+{
+  if (m_eSliceType == I_SLICE)
+  {
+    ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
+    ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     
+    return;
+  }
+  
 #if !H_MV
-    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
-    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
-#endif
-  }
+  m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
+  m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
+#endif
 
   TComPic*  pcRefPic= NULL;
@@ -473,5 +410,4 @@
     }
   }
-  
   for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
   {
@@ -486,10 +422,9 @@
     }
   }
-  
   for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)
   {
     if(m_pcRPS->getUsed(i))
     {
-      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
+      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
       pcRefPic->setIsLongTerm(1);
       pcRefPic->getPicYuvRec()->extendPicBorder();
@@ -499,5 +434,5 @@
     if(pcRefPic==NULL) 
     {
-      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
+      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
     }
     pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i));  
@@ -513,62 +448,33 @@
   Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
 #endif
-#if FIX1071
-  if (checkNumPocTotalCurr)
-  {
-    // 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:
+
+  {
+    Int cIdx = 0;
+    for ( i=0; i<NumPocStCurr0; i++, cIdx++)
+    {
+      rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
+    }
+    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
+    {
+      rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
+    }
+    for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
+    {
+      rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
+    }
 #if H_MV
-    // – If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0.
-    // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
-    if ( getRapPicFlag() && m_layerId == 0 )
-#else
-    // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
-    // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
-    if (getRapPicFlag())
-#endif
-    {
-      assert(numPocTotalCurr == 0);
-    }
-
-    if (m_eSliceType == I_SLICE)
-    {
-      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
-      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
-      
-      return;
-    }
-    
-    assert(numPocTotalCurr != 0);
-    
-    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
-    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
-  }
-#endif
-
-  Int cIdx = 0;
-  for ( i=0; i<NumPocStCurr0; i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
-  }
-  for ( i=0; i<NumPocStCurr1; i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
-  }
-  for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
-  }
-#if H_MV
-  for ( i=0; i<numDirectRefLayers;  i++, cIdx++)
-  {
-    if( cIdx <= MAX_NUM_REF )
-    {
-      rpsCurrList0[cIdx] = refPicSetInterLayer[i];
-    }
-  }
-#endif
+    for ( i=0; i<numDirectRefLayers;  i++, cIdx++)
+    {
+      if( cIdx <= MAX_NUM_REF )
+      {
+        rpsCurrList0[cIdx] = refPicSetInterLayer[i];
+      }
+    }
+#endif
+  }
 
   if (m_eSliceType==B_SLICE)
   {
-    cIdx = 0;
+    Int cIdx = 0;
     for ( i=0; i<NumPocStCurr1; i++, cIdx++)
     {
@@ -679,5 +585,5 @@
 }
 
-Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)
+Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA)
 {
   for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++)
@@ -692,15 +598,8 @@
     if(pocCRA < MAX_UINT && getPOC() > pocCRA)
     {
-      if (!pReferencePictureSet->getCheckLTMSBPresent(i))
-      {
-        assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA);
-      }
-      else
-      {
       assert(pReferencePictureSet->getPOC(i) >= pocCRA);
     }
   }
-  }
-  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
+  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
   {
     pocCRA = getPOC();
@@ -712,6 +611,6 @@
     prevRAPisBLA = false;
   }
-  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
+  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
+         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
          || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found
   {
@@ -744,8 +643,8 @@
   Int pocCurr = getPOC(); 
 
-  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
+  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
+    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
     || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
-    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
+    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR
     || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )  // IDR or BLA picture
   {
@@ -759,6 +658,6 @@
       iterPic++;
     }
-    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
+    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
+      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
     {
@@ -774,8 +673,5 @@
       {
         rpcPic = *(iterPic);
-        if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA)
-        {
-          rpcPic->getSlice(0)->setReferenced(false);
-        }
+        if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false);
         iterPic++;
       }
@@ -811,19 +707,9 @@
   m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2;
   
-#if L0034_COMBINED_LIST_CLEANUP
-  for (i = 0; i < 2; i++)
-#else
   for (i = 0; i < 3; i++)
-#endif
   {
     m_aiNumRefIdx[i]     = pSrc->m_aiNumRefIdx[i];
   }
 
-#if L0034_COMBINED_LIST_CLEANUP
-  for (i = 0; i < MAX_NUM_REF; i++)
-  {
-    m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i];
-  } 
-#else
   for (i = 0; i < 2; i++)
   {
@@ -842,5 +728,4 @@
   m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC;
   m_bRefPicListCombinationFlag    = pSrc->m_bRefPicListCombinationFlag;
-#endif
   m_bCheckLDC             = pSrc->m_bCheckLDC;
   m_iSliceQpDelta        = pSrc->m_iSliceQpDelta;
@@ -900,7 +785,5 @@
   }
 
-#if !L0034_COMBINED_LIST_CLEANUP
   m_bNoBackPredFlag      = pSrc->m_bNoBackPredFlag;
-#endif
   m_uiTLayer                      = pSrc->m_uiTLayer;
   m_bTLayerSwitchingFlag          = pSrc->m_bTLayerSwitchingFlag;
@@ -936,5 +819,4 @@
 
 Int TComSlice::m_prevPOC = 0;
-
 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag.
  * \param uiTLayer Temporal layer ID of the current slice
@@ -997,14 +879,11 @@
   Int i, isReference;
 
+  Int j = 0;
   // loop through all pictures in the reference picture buffer
   TComList<TComPic*>::iterator iterPic = rcListPic.begin();
   while ( iterPic != rcListPic.end())
   {
+    j++;
     rpcPic = *(iterPic++);
-
-    if(!rpcPic->getSlice( 0 )->isReferenced())
-    {
-      continue;
-    }
 
     isReference = 0;
@@ -1045,5 +924,4 @@
     {            
       rpcPic->getSlice( 0 )->setReferenced( false );   
-      rpcPic->setUsedByCurr(0);
       rpcPic->setIsLongTerm(0);
     }
@@ -1051,8 +929,9 @@
     assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer());
     //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture
-    if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
+    if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
     {
       assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer());
     }
+
     //check that pictures marked as temporal layer non-reference pictures are not used for reference
     if(rpcPic->getPicSym()->getSlice(0)->getPOC() != this->getPOC() && rpcPic->getTLayer()==this->getTLayer())
@@ -1068,5 +947,5 @@
 {
   TComPic* rpcPic;
-  Int i, isAvailable;
+  Int i, isAvailable, j;
   Int atLeastOneLost = 0;
   Int atLeastOneRemoved = 0;
@@ -1077,4 +956,5 @@
   for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++)
   {
+    j = 0;
     isAvailable = 0;
     // loop through all pictures in the reference picture buffer
@@ -1082,4 +962,5 @@
     while ( iterPic != rcListPic.end())
     {
+      j++;
       rpcPic = *(iterPic++);
       if(pReferencePictureSet->getCheckLTMSBPresent(i)==true)
@@ -1104,16 +985,8 @@
       while ( iterPic != rcListPic.end())
       {
+        j++;
         rpcPic = *(iterPic++);
 
-        Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
-        Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC();
-        Int refPoc = pReferencePictureSet->getPOC(i);
-        if (!pReferencePictureSet->getCheckLTMSBPresent(i))
-        {
-          curPoc = curPoc % pocCycle;
-          refPoc = refPoc % pocCycle;
-        }
-        
-        if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc)
+        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())
         {
           isAvailable = 1;
@@ -1153,4 +1026,5 @@
   for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++)
   {
+    j = 0;
     isAvailable = 0;
     // loop through all pictures in the reference picture buffer
@@ -1158,4 +1032,5 @@
     while ( iterPic != rcListPic.end())
     {
+      j++;
       rpcPic = *(iterPic++);
 
@@ -1174,7 +1049,5 @@
         {
           if(printErrors)
-          {
             printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
-          }
           atLeastOneRemoved = 1;
         }
@@ -1182,7 +1055,5 @@
         {
           if(printErrors)
-          {
             printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
-          }
           atLeastOneLost = 1;
           iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i);
@@ -1330,5 +1201,5 @@
  * \returns Void
  */
-Void  TComSlice::resetWpScaling()
+Void  TComSlice::resetWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
 {
   for ( Int e=0 ; e<2 ; e++ )
@@ -1338,5 +1209,5 @@
       for ( Int yuv=0 ; yuv<3 ; yuv++ )
       {
-        wpScalingParam  *pwp = &(m_weightPredTable[e][i][yuv]);
+        wpScalingParam  *pwp = &(wp[e][i][yuv]);
         pwp->bPresentFlag      = false;
         pwp->uiLog2WeightDenom = 0;
@@ -1354,4 +1225,13 @@
 Void  TComSlice::initWpScaling()
 {
+  initWpScaling(m_weightPredTable);
+}
+
+/** set WP tables 
+ * \param wpScalingParam
+ * \returns Void
+ */
+Void  TComSlice::initWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
+{
   for ( Int e=0 ; e<2 ; e++ )
   {
@@ -1360,7 +1240,6 @@
       for ( Int yuv=0 ; yuv<3 ; yuv++ )
       {
-        wpScalingParam  *pwp = &(m_weightPredTable[e][i][yuv]);
-        if ( !pwp->bPresentFlag ) 
-        {
+        wpScalingParam  *pwp = &(wp[e][i][yuv]);
+        if ( !pwp->bPresentFlag ) {
           // Inferring values not present :
           pwp->iWeight = (1 << pwp->uiLog2WeightDenom);
@@ -1396,12 +1275,9 @@
 , m_cprmsPresentFlag          (NULL)
 {
+
   for( Int i = 0; i < MAX_TLAYER; i++)
   {
     m_numReorderPics[i] = 0;
-#if L0323_DPB
-    m_uiMaxDecPicBuffering[i] = 1; 
-#else
     m_uiMaxDecPicBuffering[i] = 0; 
-#endif
     m_uiMaxLatencyIncrease[i] = 0;
   }
@@ -1457,7 +1333,7 @@
 TComVPS::~TComVPS()
 {
-if( m_hrdParameters    != NULL )     delete[] m_hrdParameters;
-  if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
-  if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
+  if( m_hrdParameters    != NULL )     delete m_hrdParameters;
+  if( m_hrdOpSetIdx      != NULL )     delete m_hrdOpSetIdx;
+  if( m_cprmsPresentFlag != NULL )     delete m_cprmsPresentFlag;
 }
 
@@ -1549,4 +1425,5 @@
 }
 #endif
+
 // ------------------------------------------------------------------------------------------------
 // Sequence parameter set (SPS)
@@ -1561,9 +1438,9 @@
 , m_picWidthInLumaSamples     (352)
 , m_picHeightInLumaSamples    (288)
-, m_log2MinCodingBlockSize    (  0)
-, m_log2DiffMaxMinCodingBlockSize (0)
 , m_uiMaxCUWidth              ( 32)
 , m_uiMaxCUHeight             ( 32)
 , m_uiMaxCUDepth              (  3)
+, m_uiMinTrDepth              (  0)
+, m_uiMaxTrDepth              (  1)
 , m_bLongTermRefsPresent      (false)
 , m_uiQuadtreeTULog2MaxSize   (  0)
@@ -1575,7 +1452,5 @@
 , m_pcmLog2MaxSize            (  5)
 , m_uiPCMLog2MinSize          (  7)
-#if !L0034_COMBINED_LIST_CLEANUP
 , m_bUseLComb                 (false)
-#endif
 , m_bitDepthY                 (  8)
 , m_bitDepthC                 (  8)
@@ -1595,16 +1470,9 @@
 , m_vuiParametersPresentFlag  (false)
 , m_vuiParameters             ()
-#if H_MV
-, m_interViewMvVertConstraintFlag (false)
-#endif
 {
   for ( Int i = 0; i < MAX_TLAYER; i++ )
   {
     m_uiMaxLatencyIncrease[i] = 0;
-#if L0323_DPB
-    m_uiMaxDecPicBuffering[i] = 1;
-#else
     m_uiMaxDecPicBuffering[i] = 0;
-#endif
     m_numReorderPics[i]       = 0;
   }
@@ -1625,5 +1493,4 @@
   m_RPSList.create(numRPS);
 }
-
 Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess )
 {
@@ -1870,15 +1737,12 @@
   return m_POC[bufferNum];
 }
-
 Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC)
 {
   m_POC[bufferNum] = POC;
 }
-
 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum)
 {
   return m_bCheckLTMSB[bufferNum];
 }
-
 Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b)
 {
@@ -2148,4 +2012,5 @@
 }
 #endif
+
 /** get scaling matrix from RefMatrixID
  * \param sizeId size index
@@ -2157,5 +2022,4 @@
   ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]));
 }
-
 /** parse syntax infomation 
  *  \param pchFile syntax infomation
@@ -2250,5 +2114,4 @@
   m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32
 }
-
 /** destroy quantization matrix array
  */
@@ -2263,5 +2126,4 @@
   }
 }
-
 /** get default address of quantization matrix 
  * \param sizeId size index
@@ -2293,5 +2155,4 @@
   return src;
 }
-
 /** process of default matrix
  * \param sizeId size index
@@ -2303,5 +2164,4 @@
   setScalingListDC(sizeId,listId,SCALING_LIST_DC);
 }
-
 /** check DC value of matrix for default matrix signaling
  */
@@ -2364,5 +2224,5 @@
 //! activate a PPS and depending on isIDR parameter also SPS and VPS
 //! \returns true, if activation is successful
-Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)
+Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR)
 {
   TComPPS *pps = m_ppsMap.getPS(ppsId);
@@ -2373,7 +2233,7 @@
     // active parameter sets per layer should be used here
 #else
-    if (!isIRAP && (spsId != m_activeSPSId))
-    {
-      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");
+    if (!isIDR && (spsId != m_activeSPSId))
+    {
+      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR.");
       return false;
     }
@@ -2383,7 +2243,7 @@
     {
       Int vpsId = sps->getVPSId();
-      if (!isIRAP && (vpsId != m_activeVPSId))
-      {
-        printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");
+      if (!isIDR && (vpsId != m_activeVPSId))
+      {
+        printf("Warning: tried to activate PPS referring to a inactive VPS at non-IDR.");
         return false;
       }
@@ -2444,4 +2304,5 @@
 }
 #endif
+
 #if SIGNAL_BITRATE_PICRATE_IN_VPS
 TComBitRatePicRateInfo::TComBitRatePicRateInfo()
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.h	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComSlice.h	(revision 438)
@@ -248,4 +248,5 @@
   ProfileTierLevel* getGeneralPTL()  { return &m_generalPTL; }
   ProfileTierLevel* getSubLayerPTL(Int i)  { return &m_subLayerPTL[i]; }
+
 #if H_MV
   Void copyLevelFrom( TComPTL* source );
@@ -535,4 +536,5 @@
 
 #endif
+
 public:
   TComVPS();
@@ -594,4 +596,5 @@
   TComPTL* getPTL() { return &m_pcPTL; }
 #endif
+
 #if SIGNAL_BITRATE_PICRATE_IN_VPS
   TComBitRatePicRateInfo *getBitratePicrateInfo() { return &m_bitRatePicRateInfo; }
@@ -600,4 +603,5 @@
   TimingInfo* getTimingInfo() { return &m_timingInfo; }
 #endif
+
 #if H_MV
   Void    setAvcBaseLayerFlag( Bool val )                                  { m_avcBaseLayerFlag = val;  }
@@ -901,12 +905,11 @@
   UInt        m_picHeightInLumaSamples;
   
-  Int         m_log2MinCodingBlockSize;
-  Int         m_log2DiffMaxMinCodingBlockSize;
+  Window      m_conformanceWindow;
+
   UInt        m_uiMaxCUWidth;
   UInt        m_uiMaxCUHeight;
   UInt        m_uiMaxCUDepth;
-
-  Window      m_conformanceWindow;
-
+  UInt        m_uiMinTrDepth;
+  UInt        m_uiMaxTrDepth;
   TComRPSList m_RPSList;
   Bool        m_bLongTermRefsPresent;
@@ -924,7 +927,5 @@
   Bool        m_useAMP;
 
-#if !L0034_COMBINED_LIST_CLEANUP
   Bool        m_bUseLComb;
-#endif
   
   // Parameter
@@ -967,7 +968,4 @@
   static const Int   m_winUnitY[MAX_CHROMA_FORMAT_IDC+1];
   TComPTL     m_pcPTL;
-#if H_MV
-  Bool        m_interViewMvVertConstraintFlag;
-#endif
 public:
   TComSPS();
@@ -1001,10 +999,4 @@
   Bool getUsedByCurrPicLtSPSFlag(Int i)        {return m_usedByCurrPicLtSPSFlag[i];}
   Void setUsedByCurrPicLtSPSFlag(Int i, Bool x)      { m_usedByCurrPicLtSPSFlag[i] = x;}
-
-  Int  getLog2MinCodingBlockSize() const           { return m_log2MinCodingBlockSize; }
-  Void setLog2MinCodingBlockSize(Int val)          { m_log2MinCodingBlockSize = val; }
-  Int  getLog2DiffMaxMinCodingBlockSize() const    { return m_log2DiffMaxMinCodingBlockSize; }
-  Void setLog2DiffMaxMinCodingBlockSize(Int val)   { m_log2DiffMaxMinCodingBlockSize = val; }
-
   Void setMaxCUWidth  ( UInt u ) { m_uiMaxCUWidth = u;      }
   UInt getMaxCUWidth  ()         { return  m_uiMaxCUWidth;  }
@@ -1023,4 +1015,8 @@
   Bool getUseAMP() { return m_useAMP; }
   Void setUseAMP( Bool b ) { m_useAMP = b; }
+  Void setMinTrDepth  ( UInt u ) { m_uiMinTrDepth = u;      }
+  UInt getMinTrDepth  ()         { return  m_uiMinTrDepth;  }
+  Void setMaxTrDepth  ( UInt u ) { m_uiMaxTrDepth = u;      }
+  UInt getMaxTrDepth  ()         { return  m_uiMaxTrDepth;  }
   Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u;    }
   UInt getQuadtreeTULog2MaxSize()         { return m_uiQuadtreeTULog2MaxSize; }
@@ -1044,8 +1040,6 @@
   
   // Tool list
-#if !L0034_COMBINED_LIST_CLEANUP
   Void setUseLComb    (Bool b)   { m_bUseLComb = b;         }
   Bool getUseLComb    ()         { return m_bUseLComb;      }
-#endif
 
   Bool getUseLossless ()         { return m_useLossless; }
@@ -1100,8 +1094,4 @@
 
   TComPTL* getPTL()     { return &m_pcPTL; }
-#if H_MV
-  Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; }
-  Bool getInterViewMvVertConstraintFlag()         { return m_interViewMvVertConstraintFlag;}
-#endif
 };
 
@@ -1130,4 +1120,5 @@
   Void       setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; }
   UInt       getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; }
+
 #if H_MV
   // Why not an listIdx for all members, would avoid code duplication?? 
@@ -1366,8 +1357,5 @@
   Int         m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
   Int         m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
-#if L0034_COMBINED_LIST_CLEANUP
-  Int         m_list1IdxToList0Idx[MAX_NUM_REF];
-  Int         m_aiNumRefIdx   [2];    //  for multiple reference of current slice
-#else
+  
   Int         m_aiNumRefIdx   [3];    //  for multiple reference of current slice
 
@@ -1379,5 +1367,4 @@
   Bool        m_bRefPicListModificationFlagLC;
   Bool        m_bRefPicListCombinationFlag;
-#endif
 
   Bool        m_bCheckLDC;
@@ -1420,7 +1407,6 @@
 
   Bool        m_abEqualRef  [2][MAX_NUM_REF][MAX_NUM_REF];
-#if !L0034_COMBINED_LIST_CLEANUP
+  
   Bool        m_bNoBackPredFlag;
-#endif
   UInt        m_uiTLayer;
   Bool        m_bTLayerSwitchingFlag;
@@ -1457,4 +1443,5 @@
 
   Bool       m_enableTMVPFlag;
+
 #if H_MV
   Int        m_layerId; 
@@ -1464,4 +1451,5 @@
 #endif
 #endif
+
 public:
   TComSlice();
@@ -1528,7 +1516,4 @@
   Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
   Int       getNumRpsCurrTempList();
-#if L0034_COMBINED_LIST_CLEANUP
-  Int       getList1IdxToList0Idx ( Int list1Idx )               { return m_list1IdxToList0Idx[list1Idx]; }
-#else
   Int       getRefIdxOfLC       (RefPicList e, Int iRefIdx)     { return m_iRefIdxOfLC[e][iRefIdx];           }
   Int       getListIdFromIdxOfLC(Int iRefIdx)                   { return m_eListIdFromIdxOfLC[iRefIdx];       }
@@ -1540,14 +1525,12 @@
   Bool      getRefPicListCombinationFlag()                      {return m_bRefPicListCombinationFlag;}
   Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}   
-#endif
   Void      setReferenced(Bool b)                               { m_bRefenced = b; }
   Bool      isReferenced()                                      { return m_bRefenced; }
   Void      setPOC              ( Int i )                       { m_iPOC              = i; if(getTLayer()==0) m_prevPOC=i; }
   Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
-  NalUnitType getNalUnitType    () const                        { return m_eNalUnitType;        }
+  NalUnitType getNalUnitType    ()                              { return m_eNalUnitType;        }
   Bool      getRapPicFlag       ();  
-  Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
-  Bool      isIRAP              () const                        { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); }  
-  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic);
+  Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
+  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA);
   Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
   Void      setSliceType        ( SliceType e )                 { m_eSliceType        = e;      }
@@ -1575,11 +1558,7 @@
 #endif
 #if H_MV
-  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false );
-#else
-#if FIX1071
-  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false );
+  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet );
 #else
   Void      setRefPicList       ( TComList<TComPic*>& rcListPic );
-#endif
 #endif
   Void      setRefPOCList       ();
@@ -1615,11 +1594,8 @@
   
   static Void      sortPicList         ( TComList<TComPic*>& rcListPic );
-#if L0034_COMBINED_LIST_CLEANUP
-  Void setList1IdxToList0Idx();
-#else
+  
   Bool getNoBackPredFlag() { return m_bNoBackPredFlag; }
   Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; }
   Void generateCombinedList       ();
-#endif
 
   UInt getTLayer             ()                            { return m_uiTLayer;                      }
@@ -1629,4 +1605,5 @@
   Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 
   Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
+
 #if H_MV
   Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer );
@@ -1637,4 +1614,5 @@
   Void xPrintRefPicList();
 #endif
+
   Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
   Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic );
@@ -1677,5 +1655,6 @@
   Void  getWpScaling    ( RefPicList e, Int iRefIdx, wpScalingParam *&wp);
 
-  Void  resetWpScaling  ();
+  Void  resetWpScaling  (wpScalingParam  wp[2][MAX_NUM_REF][3]);
+  Void  initWpScaling    (wpScalingParam  wp[2][MAX_NUM_REF][3]);
   Void  initWpScaling   ();
   inline Bool applyWP   () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); }
@@ -1723,8 +1702,10 @@
 #endif
 #endif
+
 protected:
   TComPic*  xGetRefPic  (TComList<TComPic*>& rcListPic,
                          Int                 poc);
-TComPic*  xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);
+  TComPic*  xGetLongTermRefPic  (TComList<TComPic*>& rcListPic,
+                         Int                 poc);
 #if H_MV
   TComPic*  xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId );
@@ -1813,5 +1794,5 @@
   //! activate a PPS and depending on isIDR parameter also SPS and VPS
   //! \returns true, if activation is successful
-  Bool activatePPS(Int ppsId, Bool isIRAP);
+  Bool activatePPS(Int ppsId, Bool isIDR);
 
   TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComTrQuant.cpp
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComTrQuant.cpp	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TComTrQuant.cpp	(revision 438)
@@ -1986,5 +1986,5 @@
           }
           
-          if(piDstCoeff[minPos] == 32767 || piDstCoeff[minPos] == -32768)
+          if(piQCoef[minPos] == 32767 || piQCoef[minPos] == -32768)
           {
             finalChange = -1;
Index: branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TypeDef.h	(revision 437)
+++ branches/HTM-DEV-0.2-dev/source/Lib/TLibCommon/TypeDef.h	(revision 438)
@@ -49,15 +49,6 @@
 #endif
 
-///// ***** HM 10.1 *********
-#define FIX1071 1 ///< Temporary fix for issue #1071
-
-#define L0208_SOP_DESCRIPTION_SEI     1 ///< L0208: add SOP descrioption SEI
-#define MAX_NUM_PICS_IN_SOP           1024
-
-#define K0180_SCALABLE_NESTING_SEI  1   ///JCTVC-K0180 scalable nesting sei message
-#define MAX_NESTING_NUM_OPS         1024
-#define MAX_NESTING_NUM_LAYER       64
-
-#define J0149_TONE_MAPPING_SEI        1 ///< J0149: Tone mapping information SEI
+///// ***** HM 10.0 *********
+
 #define L0363_DU_BIT_RATE             1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters
 #define L0328_SPLICING                1 ///< L0328: splicing support in HRD
@@ -84,11 +75,8 @@
 #define SIGNAL_BITRATE_PICRATE_IN_VPS               0  ///< K0125: Signal bit_rate and pic_rate in VPS
 #define L0232_RD_PENALTY           1  ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices
-#define L0386_DB_METRIC            1  ///< L0386: non-normative blockiness metric (automatically configures deblocking parameters in bitstream)
-#define L0323_DPB                     1 ///< L0323: Specification of active reference indices and decoded picture buffer
-
-#define L0034_COMBINED_LIST_CLEANUP 1
 
 #define MAX_VPS_NUM_HRD_PARAMETERS                1
 #define MAX_VPS_OP_SETS_PLUS1                     1024
+
 #if H_MV
 #define MAX_VPS_NUH_LAYER_ID_PLUS1  64
@@ -104,7 +92,5 @@
 #define MAX_CPB_CNT                     32  ///< Upper bound of (cpb_cnt_minus1 + 1)
 #define MAX_NUM_LAYER_IDS               64
-#if H_MV
 #define MAX_NUM_LAYERS                  64
-#endif
 
 #define COEF_REMAIN_BIN_REDUCTION        3 ///< indicates the level at which the VLC 
@@ -426,7 +412,5 @@
   REF_PIC_LIST_0 = 0,   ///< reference list 0
   REF_PIC_LIST_1 = 1,   ///< reference list 1
-#if !L0034_COMBINED_LIST_CLEANUP
   REF_PIC_LIST_C = 2,   ///< combined reference list for uni-prediction in B-Slices
-#endif
   REF_PIC_LIST_X = 100  ///< special mark
 };
@@ -570,2 +554,3 @@
 #endif
 #endif
+
