Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1436)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1437)
@@ -763,5 +763,4 @@
   Int*    cfg_aiPadY        [MAX_LAYERS];
   Int*    cfg_conformanceMode  [MAX_LAYERS];
-  Bool*   cfg_useExtendedPrecision [MAX_LAYERS];
 
   Int*    cfg_maxCuDQPDepth[MAX_LAYERS];
@@ -858,4 +857,6 @@
   ScalingListMode*   cfg_UseScalingListId[MAX_LAYERS];
 
+  Bool*   cfg_bUseSAO[MAX_LAYERS];
+
   for( UInt layer = 0; layer < m_numLayers; layer++ )
   {
@@ -872,5 +873,5 @@
     cfg_FrameRate[layer]            = &m_apcLayerCfg[layer]->m_iFrameRate; 
     cfg_IntraPeriod[layer]          = &m_apcLayerCfg[layer]->m_iIntraPeriod; 
-    cfg_conformanceMode[layer]      = &m_apcLayerCfg[layer]->m_conformanceMode;
+    cfg_conformanceMode[layer]      = &m_apcLayerCfg[layer]->m_conformanceWindowMode;
     cfg_confWinLeft[layer]          = &m_apcLayerCfg[layer]->m_confWinLeft;
     cfg_confWinRight[layer]         = &m_apcLayerCfg[layer]->m_confWinRight;
@@ -879,5 +880,4 @@
     cfg_aiPadX[layer]               = &m_apcLayerCfg[layer]->m_aiPad[0];
     cfg_aiPadY[layer]               = &m_apcLayerCfg[layer]->m_aiPad[1];
-    cfg_useExtendedPrecision[layer] = &m_apcLayerCfg[layer]->m_extendedPrecisionProcessingFlag;
 
     cfg_maxCuDQPDepth[layer]        = &m_apcLayerCfg[layer]->m_iMaxCuDQPDepth;
@@ -955,4 +955,6 @@
 
     cfg_UseScalingListId[layer]     = &m_apcLayerCfg[layer]->m_useScalingListId;
+
+    cfg_bUseSAO[layer]              = &m_apcLayerCfg[layer]->m_bUseSAO;
   }
 
@@ -1103,5 +1105,4 @@
   ("AuxId%d",                                       cfg_auxId,                                 0, m_numLayers, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh")
 #endif
-  ("ExtendedPrecision%d",                           cfg_useExtendedPrecision,              false, m_numLayers, "Increased internal accuracies to support high bit depths (not valid in V1 profiles)")
   ("ConformanceMode%d",                             cfg_conformanceMode,                       0, m_numLayers, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")
   ("ConfLeft%d",                                    cfg_confWinLeft,                           0, m_numLayers, "Deprecated alias of ConfWinLeft")
@@ -1184,6 +1185,8 @@
   ("MSBExtendedBitDepthC",                            m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA],           0, "As per MSBExtendedBitDepth but for chroma component. (default:MSBExtendedBitDepth)")
   ("InternalBitDepthC",                               m_internalBitDepth[CHANNEL_TYPE_CHROMA],              0, "As per InternalBitDepth but for chroma component. (default:InternalBitDepth)")
+#endif
   ("ExtendedPrecision",                               m_extendedPrecisionProcessingFlag,                false, "Increased internal accuracies to support high bit depths (not valid in V1 profiles)")
   ("HighPrecisionPredictionWeighting",                m_highPrecisionOffsetsEnabledFlag,                false, "Use high precision option for weighted prediction (not valid in V1 profiles)")
+#if !SVC_EXTENSION
   ("InputColourSpaceConvert",                         inputColourSpaceConvert,                     string(""), "Colour space conversion to apply to input video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(true))
   ("SNRInternalColourSpace",                          m_snrInternalColourSpace,                         false, "If true, then no colour space conversion is applied prior to SNR, otherwise inverse of input is applied.")
@@ -1391,5 +1394,9 @@
   ("GolombRiceParameterAdaptation",                   m_persistentRiceAdaptationEnabledFlag,            false, "Enable the adaptation of the Golomb-Rice parameter over the course of each slice")
   ("AlignCABACBeforeBypass",                          m_cabacBypassAlignmentEnabledFlag,                false, "Align the CABAC engine to a defined fraction of a bit prior to coding bypass data. Must be 1 in high bit rate profile, 0 otherwise" )
+#if SVC_EXTENSION
+  ("SAO%d",                                           cfg_bUseSAO,                          true, m_numLayers, "Enable Sample Adaptive Offset")
+#else
   ("SAO",                                             m_bUseSAO,                                         true, "Enable Sample Adaptive Offset")
+#endif
   ("TestSAODisableAtPictureLevel",                    m_bTestSAODisableAtPictureLevel,                  false, "Enables the testing of disabling SAO at the picture level after having analysed all blocks")
   ("SaoEncodingRate",                                 m_saoEncodingRate,                                 0.75, "When >0 SAO early picture termination is enabled for luma and chroma")
@@ -1927,7 +1934,4 @@
     m_apcLayerCfg[layer]->m_chromaFormatIDC      = ((tmpChromaFormat == 0) ? (m_apcLayerCfg[layer]->m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat)));
 
-    m_apcLayerCfg[layer]->m_highPrecisionOffsetsEnabledFlag = false;
-    m_apcLayerCfg[layer]->m_extendedPrecisionProcessingFlag = false;
-
     if( m_apcLayerCfg[layer]->m_layerSwitchOffBegin < m_apcLayerCfg[layer]->m_layerSwitchOffEnd )
     {
@@ -1950,5 +1954,5 @@
     for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
     {
-      m_apcLayerCfg[layer]->m_log2SaoOffsetScale[channelType] = 0;
+      m_log2SaoOffsetScale[channelType] = 0;
     }
         
@@ -2002,5 +2006,5 @@
           m_log2MaxTransformSkipBlockSize!=2;
         const Bool bUsingChromaQPAdjustment= m_diffCuChromaQpOffsetDepth >= 0;
-        const Bool bUsingExtendedPrecision = m_apcLayerCfg[layer]->m_extendedPrecisionProcessingFlag;
+        const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag;
         m_apcLayerCfg[layer]->m_chromaFormatConstraint = NUM_CHROMA_FORMAT;
         automaticallySelectRExtProfile(bUsingGeneralRExtTools,
@@ -2635,5 +2639,29 @@
   delete [] cfg_listOfOutputLayers;
   delete cfg_outputLayerSetIdx;
-#else //SVC_EXTENSION
+
+  for( Int layer = 0; layer < m_numLayers; layer++ )
+  {
+    Int& m_conformanceWindowMode    = m_apcLayerCfg[layer]->m_conformanceWindowMode;
+    UInt&  m_uiMaxCUHeight          = m_apcLayerCfg[layer]->m_uiMaxCUHeight;
+    UInt& m_uiMaxCUDepth            = m_apcLayerCfg[layer]->m_uiMaxCUDepth;
+    ChromaFormat& m_chromaFormatIDC = m_apcLayerCfg[layer]->m_chromaFormatIDC;
+
+    Int& m_confWinLeft              = m_apcLayerCfg[layer]->m_confWinLeft;
+    Int& m_confWinRight             = m_apcLayerCfg[layer]->m_confWinLeft;
+    Int& m_confWinTop               = m_apcLayerCfg[layer]->m_confWinLeft;
+    Int& m_confWinBottom            = m_apcLayerCfg[layer]->m_confWinLeft;
+    Int* m_aiPad                    = m_apcLayerCfg[layer]->m_aiPad;
+    Int* m_aidQP                    = m_apcLayerCfg[layer]->m_aidQP;
+
+    Int& m_iSourceWidth             = m_apcLayerCfg[layer]->m_iSourceWidth;
+    Int& m_iSourceHeight            = m_apcLayerCfg[layer]->m_iSourceHeight;
+    Int& m_iSourceHeightOrg         = m_apcLayerCfg[layer]->m_iSourceHeightOrg;
+
+    Int& m_iQP                      = m_apcLayerCfg[layer]->m_iQP;
+    Double& m_fQP                   = m_apcLayerCfg[layer]->m_fQP;
+
+    Char* m_pchdQPFile              = m_apcLayerCfg[layer]->m_pchdQPFile;
+    Int* m_internalBitDepth         = m_apcLayerCfg[layer]->m_internalBitDepth;
+#endif //SVC_EXTENSION
   switch (m_conformanceWindowMode)
   {
@@ -2653,4 +2681,7 @@
         m_aiPad[0] = m_confWinRight  = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
         m_iSourceWidth  += m_confWinRight;
+#if SVC_EXTENSION
+        m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
+#endif
       }
       if (m_iSourceHeight % minCuSize)
@@ -2663,4 +2694,7 @@
           m_aiPad[1] = m_confWinBottom << 1;
         }
+#if SVC_EXTENSION
+        m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
+#endif
       }
       if (m_aiPad[0] % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0)
@@ -2683,4 +2717,9 @@
       m_confWinRight  = m_aiPad[0];
       m_confWinBottom = m_aiPad[1];
+
+#if SVC_EXTENSION
+      m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
+      m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
+#endif
       break;
     }
@@ -2757,4 +2796,6 @@
       fclose(fpt);
     }
+  }
+#if SVC_EXTENSION
   }
 #endif
@@ -3014,23 +3055,50 @@
 Void TAppEncCfg::xCheckParameter(UInt layerIdx)
 {
-  Bool m_extendedPrecisionProcessingFlag     = m_apcLayerCfg[layerIdx]->m_extendedPrecisionProcessingFlag;
-  Bool m_highPrecisionOffsetsEnabledFlag     = m_apcLayerCfg[layerIdx]->m_highPrecisionOffsetsEnabledFlag;
-  ChromaFormat m_chromaFormatIDC             = m_apcLayerCfg[layerIdx]->m_chromaFormatIDC;
-  ChromaFormat m_chromaFormatConstraint      = m_apcLayerCfg[layerIdx]->m_chromaFormatConstraint;
-  ChromaFormat m_InputChromaFormatIDC        = m_apcLayerCfg[layerIdx]->m_InputChromaFormatIDC;
-
-  Int m_inputBitDepth[]       = {m_apcLayerCfg[layerIdx]->m_inputBitDepth[CHANNEL_TYPE_LUMA],       m_apcLayerCfg[layerIdx]->m_inputBitDepth[CHANNEL_TYPE_CHROMA]};
-  Int m_internalBitDepth[]    = {m_apcLayerCfg[layerIdx]->m_internalBitDepth[CHANNEL_TYPE_LUMA],    m_apcLayerCfg[layerIdx]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]};
-  Int m_MSBExtendedBitDepth[] = {m_apcLayerCfg[layerIdx]->m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layerIdx]->m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]};  
-
-  m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA]   = m_apcLayerCfg[layerIdx]->m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA];
-  m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] = m_apcLayerCfg[layerIdx]->m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA];
-
-  Int layerPTLIdx = m_apcLayerCfg[layerIdx]->m_layerPTLIdx;
-  Profile::Name m_profile             = m_profileList[layerPTLIdx];
-  UInt m_bitDepthConstraint           = m_apcLayerCfg[layerIdx]->m_bitDepthConstraint;
-  Bool m_intraConstraintFlag          = m_apcLayerCfg[layerIdx]->m_intraConstraintFlag;
-  Bool m_lowerBitRateConstraintFlag   = m_apcLayerCfg[layerIdx]->m_lowerBitRateConstraintFlag;
-  Bool m_onePictureOnlyConstraintFlag = m_apcLayerCfg[layerIdx]->m_onePictureOnlyConstraintFlag;
+  ChromaFormat& m_chromaFormatIDC             = m_apcLayerCfg[layerIdx]->m_chromaFormatIDC;
+  ChromaFormat& m_chromaFormatConstraint      = m_apcLayerCfg[layerIdx]->m_chromaFormatConstraint;
+  ChromaFormat& m_InputChromaFormatIDC        = m_apcLayerCfg[layerIdx]->m_InputChromaFormatIDC;
+
+  Int* m_inputBitDepth                        = m_apcLayerCfg[layerIdx]->m_inputBitDepth;
+  Int* m_internalBitDepth                     = m_apcLayerCfg[layerIdx]->m_internalBitDepth;
+  Int* m_MSBExtendedBitDepth                  = m_apcLayerCfg[layerIdx]->m_MSBExtendedBitDepth;
+
+  Int& layerPTLIdx                            = m_apcLayerCfg[layerIdx]->m_layerPTLIdx;
+  Profile::Name& m_profile                    = m_profileList[layerPTLIdx];
+  UInt& m_bitDepthConstraint                  = m_apcLayerCfg[layerIdx]->m_bitDepthConstraint;
+  Bool& m_intraConstraintFlag                 = m_apcLayerCfg[layerIdx]->m_intraConstraintFlag;
+  Bool& m_lowerBitRateConstraintFlag          = m_apcLayerCfg[layerIdx]->m_lowerBitRateConstraintFlag;
+  Bool& m_onePictureOnlyConstraintFlag        = m_apcLayerCfg[layerIdx]->m_onePictureOnlyConstraintFlag;
+
+#if RC_SHVC_HARMONIZATION
+  Bool& m_RCEnableRateControl                 = m_apcLayerCfg[layerIdx]->m_RCEnableRateControl;
+  Bool& m_RCForceIntraQP                      = m_apcLayerCfg[layerIdx]->m_RCForceIntraQP;
+  Int&  m_RCInitialQP                         = m_apcLayerCfg[layerIdx]->m_RCInitialQP;
+
+#if U0132_TARGET_BITS_SATURATION
+  Bool& m_RCCpbSaturationEnabled              = m_apcLayerCfg[layerIdx]->m_RCCpbSaturationEnabled;
+  UInt& m_RCCpbSize                           = m_apcLayerCfg[layerIdx]->m_RCCpbSize;
+  Double& m_RCInitialCpbFullness              = m_apcLayerCfg[layerIdx]->m_RCInitialCpbFullness;
+  Level::Name& m_level                        = m_levelList[layerPTLIdx];
+  Level::Tier& m_levelTier                    = m_levelTierList[layerPTLIdx];
+#endif
+#endif
+
+  Int& m_iFrameRate                           = m_apcLayerCfg[layerIdx]->m_iFrameRate;
+  Int& m_iQP                                  = m_apcLayerCfg[layerIdx]->m_iQP;
+  Int& m_iSourceWidth                         = m_apcLayerCfg[layerIdx]->m_iSourceWidth;
+  Int& m_iSourceHeight                        = m_apcLayerCfg[layerIdx]->m_iSourceHeight;
+  Int* m_aiPad                                = m_apcLayerCfg[layerIdx]->m_aiPad;
+  Int& m_iMaxCuDQPDepth                       = m_apcLayerCfg[layerIdx]->m_iMaxCuDQPDepth;
+  UInt& m_uiMaxCUDepth                        = m_apcLayerCfg[layerIdx]->m_uiMaxCUDepth;
+  UInt& m_uiQuadtreeTULog2MinSize             = m_apcLayerCfg[layerIdx]->m_uiQuadtreeTULog2MinSize;
+
+  Int& m_iIntraPeriod                         = m_apcLayerCfg[layerIdx]->m_iIntraPeriod;
+  UInt& m_uiMaxCUWidth                        = m_apcLayerCfg[layerIdx]->m_uiMaxCUWidth;
+  UInt& m_uiMaxCUHeight                       = m_apcLayerCfg[layerIdx]->m_uiMaxCUHeight;
+  UInt& m_uiQuadtreeTULog2MaxSize             = m_apcLayerCfg[layerIdx]->m_uiQuadtreeTULog2MaxSize;
+  UInt& m_uiQuadtreeTUMaxDepthInter           = m_apcLayerCfg[layerIdx]->m_uiQuadtreeTUMaxDepthInter;
+  UInt& m_uiQuadtreeTUMaxDepthIntra           = m_apcLayerCfg[layerIdx]->m_uiQuadtreeTUMaxDepthIntra;
+
+  Int& m_iWaveFrontSynchro                    = m_apcLayerCfg[layerIdx]->m_waveFrontSynchro;
 #else
 Void TAppEncCfg::xCheckParameter()
@@ -3200,13 +3268,9 @@
   xConfirmPara( m_InputChromaFormatIDC >= NUM_CHROMA_FORMAT,                                "InputChromaFormatIDC must be either 400, 420, 422 or 444" );
 
-#if !SVC_EXTENSION  
   xConfirmPara( m_iFrameRate <= 0,                                                          "Frame rate must be more than 1" );
-#endif
   xConfirmPara( m_framesToBeEncoded <= 0,                                                   "Total Number Of Frames encoded must be more than 0" );
   xConfirmPara( m_iGOPSize < 1 ,                                                            "GOP Size must be greater or equal to 1" );
   xConfirmPara( m_iGOPSize > 1 &&  m_iGOPSize % 2,                                          "GOP Size must be a multiple of 2, if GOP Size is greater than 1" );
-#if !SVC_EXTENSION 
   xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
-#endif
   xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3,                   "Decoding Refresh Type must be comprised between 0 and 3 included" );
   if(m_iDecodingRefreshType == 3)
@@ -3255,7 +3319,5 @@
   }
 
-#if !SVC_EXTENSION
   xConfirmPara( m_iQP <  -6 * (m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8) || m_iQP > 51,    "QP exceeds supported range (-QpBDOffsety to 51)" );
-#endif
   xConfirmPara( m_DeblockingFilterMetric && (m_bLoopFilterDisable || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is true then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0");
   xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6,        "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)");
@@ -3265,7 +3327,5 @@
   xConfirmPara( m_minSearchWindow < 0,                                                      "Minimum motion search window size for the adaptive window ME must be greater than or equal to 0" );
   xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
-#if !SVC_EXTENSION  
   xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1,                                          "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
-#endif
 
   xConfirmPara( m_cbQpOffset < -12,   "Min. Chroma Cb QP Offset is -12" );
@@ -3275,5 +3335,4 @@
 
   xConfirmPara( m_iQPAdaptationRange <= 0,                                                  "QP Adaptation Range must be more than 0" );
-#if !SVC_EXTENSION
   if (m_iDecodingRefreshType == 2)
   {
@@ -3298,14 +3357,11 @@
   xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1,                                                         "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
   xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
-#endif
   
   xConfirmPara(  m_maxNumMergeCand < 1,  "MaxNumMergeCand must be 1 or greater.");
   xConfirmPara(  m_maxNumMergeCand > 5,  "MaxNumMergeCand must be 5 or smaller.");
 
-#if !SVC_EXTENSION
 #if ADAPTIVE_QP_SELECTION
   xConfirmPara( m_bUseAdaptQpSelect == true && m_iQP < 0,                                              "AdaptiveQpSelection must be disabled when QP < 0.");
   xConfirmPara( m_bUseAdaptQpSelect == true && (m_cbQpOffset !=0 || m_crQpOffset != 0 ),               "AdaptiveQpSelection must be disabled when ChromaQpOffset is not equal to 0.");
-#endif
 #endif
 
@@ -3333,5 +3389,4 @@
   }
   
-#if !SVC_EXTENSION
   Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 );
   if (m_profile!=Profile::HIGHTHROUGHPUTREXT)
@@ -3346,8 +3401,10 @@
   xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling");
 
+#if !SVC_EXTENSION
   xConfirmPara( m_confWinLeft   % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling");
   xConfirmPara( m_confWinRight  % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling");
   xConfirmPara( m_confWinTop    % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
   xConfirmPara( m_confWinBottom % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
+#endif
 
   xConfirmPara( m_defaultDisplayWindowFlag && !m_vuiParametersPresentFlag, "VUI needs to be enabled for default display window");
@@ -3380,5 +3437,4 @@
     }
   }
-#endif
 
   /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
@@ -3443,7 +3499,5 @@
   }
   Int numOK=0;
-#if !SVC_EXTENSION
   xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
-#endif
 
   for(Int i=0; i<m_iGOPSize; i++)
@@ -3468,12 +3522,4 @@
 
   // verify layer configuration parameters
-  if(m_apcLayerCfg[layerIdx]->xCheckParameter(m_isField))
-  {
-    printf("\nError: invalid configuration parameter found in layer %d \n", layerIdx);
-    check_failed = true;
-  }
-
-  // verify layer configuration parameters
-  Int m_iIntraPeriod = m_apcLayerCfg[layerIdx]->m_iIntraPeriod;
 #endif
   if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && (!m_bLoopFilterDisable) )
@@ -3993,4 +4039,14 @@
     }
     xConfirmPara(errorGOP,"Invalid GOP structure given");
+
+    m_EhMaxTempLayer[layerIdx] = 1;
+    for(Int i=0; i<m_iGOPSize; i++) 
+    {
+      if(m_EhGOPList[layerIdx][i].m_temporalId >= m_EhMaxTempLayer[layerIdx] )
+      {
+        m_EhMaxTempLayer[layerIdx] = m_EhGOPList[layerIdx][i].m_temporalId;
+      }
+      xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I");
+    }
   }
 #endif 
@@ -4006,19 +4062,4 @@
   }
 
-#if SVC_EXTENSION
-  if( layerIdx > 0 )
-  {
-    m_EhMaxTempLayer[layerIdx] = 1;
-    for(Int i=0; i<m_iGOPSize; i++) 
-    {
-      if(m_EhGOPList[layerIdx][i].m_temporalId >= m_EhMaxTempLayer[layerIdx] )
-      {
-        m_EhMaxTempLayer[layerIdx] = m_EhGOPList[layerIdx][i].m_temporalId;
-      }
-      xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I");
-    }
-  }
-#endif
-
   for(Int i=0; i<MAX_TLAYER; i++)
   {
@@ -4078,15 +4119,4 @@
     m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
   }
-
-#if SVC_EXTENSION // ToDo: it should be checked for the case when parameters are different for the layers
-  Int m_iSourceWidth = m_apcLayerCfg[layerIdx]->m_iSourceWidth;
-  Int m_iSourceHeight = m_apcLayerCfg[layerIdx]->m_iSourceHeight;
-  Int m_uiMaxCUWidth = m_apcLayerCfg[layerIdx]->m_uiMaxCUWidth;
-  Int m_uiMaxCUHeight = m_apcLayerCfg[layerIdx]->m_uiMaxCUHeight;
-
-  Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 );
-  Int m_iWaveFrontSynchro = m_apcLayerCfg[layerIdx]->m_waveFrontSynchro;
-  xConfirmPara( tileFlag && m_iWaveFrontSynchro,            "Tile and Wavefront can not be applied together");
-#endif
 
   if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag)
@@ -4163,7 +4193,5 @@
     }
   }
-#if !SVC_EXTENSION
   xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );
-#endif
 
   xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n");
@@ -4224,32 +4252,4 @@
 #endif
 
-#if RC_SHVC_HARMONIZATION
-  if ( m_apcLayerCfg[layerIdx]->m_RCEnableRateControl )
-  {
-    if ( m_apcLayerCfg[layerIdx]->m_RCForceIntraQP )
-    {
-      if ( m_apcLayerCfg[layerIdx]->m_RCInitialQP == 0 )
-      {
-        printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" );
-        m_apcLayerCfg[layerIdx]->m_RCForceIntraQP = false;
-      }
-    }
-    xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" );
-#if U0132_TARGET_BITS_SATURATION
-    if( m_apcLayerCfg[layerIdx]->m_RCCpbSaturationEnabled && m_levelList[layerPTLIdx]!=Level::NONE && m_profileList[layerPTLIdx]!=Profile::NONE )
-    {
-      UInt uiLevelIdx = (m_levelList[layerPTLIdx] / 10) + (UInt)((m_levelList[layerPTLIdx] % 10) / 3);    // (m_level / 30)*3 + ((m_level % 10) / 3);
-      xConfirmPara( m_apcLayerCfg[layerIdx]->m_RCCpbSize > g_uiMaxCpbSize[m_levelTierList[layerPTLIdx]][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level");
-      xConfirmPara( m_apcLayerCfg[layerIdx]->m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1");
-    }
-#endif
-  }
-#if U0132_TARGET_BITS_SATURATION
-  else
-  {
-    xConfirmPara( m_apcLayerCfg[layerIdx]->m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" );
-  }
-#endif
-#else
   if ( m_RCEnableRateControl )
   {
@@ -4277,5 +4277,4 @@
     xConfirmPara( m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" );
   }
-#endif
 #endif
 
@@ -4417,5 +4416,5 @@
 {
   printf("\n");
-#if SVC_EXTENSION  
+#if SVC_EXTENSION
   printf("Total number of layers            : %d\n", m_numLayers       );
   printf("Multiview                         : %d\n", m_scalabilityMask[VIEW_ORDER_INDEX] );
@@ -4433,22 +4432,102 @@
   printf("IDR only for IRAP                 : %d\n", m_crossLayerAlignedIdrOnlyFlag );
   printf("InterLayerWeightedPred            : %d\n", m_useInterLayerWeightedPred );
-  printf("\n");
-  for(UInt layer=0; layer<m_numLayers; layer++)
-  {
-    printf("=== Layer %d settings === \n", layer);
-    m_apcLayerCfg[layer]->xPrintParameter();
-    printf("\n");
-  }
-  printf("=== Common configuration settings === \n");
-  printf("Bitstream File                         : %s\n", m_pchBitstreamFile      );
-#else //SVC_EXTENSION
-  printf("\n");
+
+  for( UInt layer = 0; layer < m_numLayers + 1; layer++ )
+  {
+    UInt layerIdx                          = layer == m_numLayers ? 0 : layer;
+    Int& layerPTLIdx                       = m_apcLayerCfg[layerIdx]->m_layerPTLIdx;
+    Profile::Name& m_profile               = m_profileList[layerPTLIdx];
+    Bool m_onePictureOnlyConstraintFlag    = m_apcLayerCfg[layerIdx]->m_onePictureOnlyConstraintFlag;
+    UInt& m_bitDepthConstraint             = m_apcLayerCfg[layerIdx]->m_bitDepthConstraint;
+    Bool& m_intraConstraintFlag            = m_apcLayerCfg[layerIdx]->m_intraConstraintFlag;
+    ChromaFormat& m_chromaFormatConstraint = m_apcLayerCfg[layerIdx]->m_chromaFormatConstraint;
+
+    UInt& m_uiMaxCUWidth                   = m_apcLayerCfg[layerIdx]->m_uiMaxCUWidth;
+    UInt& m_uiMaxCUHeight                  = m_apcLayerCfg[layerIdx]->m_uiMaxCUHeight;
+    UInt& m_uiMaxCUDepth                   = m_apcLayerCfg[layerIdx]->m_uiMaxCUDepth;
+    ChromaFormat& m_chromaFormatIDC        = m_apcLayerCfg[layerIdx]->m_chromaFormatIDC;
+
+    Int& m_confWinLeft                     = m_apcLayerCfg[layerIdx]->m_confWinLeft;
+    Int& m_confWinRight                    = m_apcLayerCfg[layerIdx]->m_confWinLeft;
+    Int& m_confWinTop                      = m_apcLayerCfg[layerIdx]->m_confWinLeft;
+    Int& m_confWinBottom                   = m_apcLayerCfg[layerIdx]->m_confWinLeft;
+    Int* m_aiPad                           = m_apcLayerCfg[layerIdx]->m_aiPad;
+    Int* m_aidQP                           = m_apcLayerCfg[layerIdx]->m_aidQP;
+
+    Int& m_iSourceWidth                    = m_apcLayerCfg[layerIdx]->m_iSourceWidth;
+    Int& m_iSourceHeight                   = m_apcLayerCfg[layerIdx]->m_iSourceHeight;
+
+    const Char* m_pchInputFile             = m_apcLayerCfg[layerIdx]->m_cInputFile.c_str();
+    const Char* m_pchReconFile             = m_apcLayerCfg[layerIdx]->m_cReconFile.c_str();
+
+    Int& m_iFrameRate                      = m_apcLayerCfg[layerIdx]->m_iFrameRate;
+    Int& m_iIntraPeriod                    = m_apcLayerCfg[layerIdx]->m_iFrameRate;
+
+    UInt& m_uiMaxTotalCUDepth              = m_apcLayerCfg[layerIdx]->m_uiMaxTotalCUDepth;
+    UInt& m_uiQuadtreeTULog2MinSize        = m_apcLayerCfg[layerIdx]->m_uiQuadtreeTULog2MinSize;
+    UInt& m_uiQuadtreeTULog2MaxSize        = m_apcLayerCfg[layerIdx]->m_uiQuadtreeTULog2MaxSize;
+    UInt& m_uiQuadtreeTUMaxDepthInter      = m_apcLayerCfg[layerIdx]->m_uiQuadtreeTUMaxDepthInter;
+    UInt& m_uiQuadtreeTUMaxDepthIntra      = m_apcLayerCfg[layerIdx]->m_uiQuadtreeTUMaxDepthIntra;
+
+    Double& m_fQP                          = m_apcLayerCfg[layerIdx]->m_fQP;
+    Int& m_iMaxCuDQPDepth                  = m_apcLayerCfg[layerIdx]->m_iMaxCuDQPDepth;
+
+    Bool& m_RCEnableRateControl            = m_apcLayerCfg[layerIdx]->m_RCEnableRateControl;
+    Int& m_RCTargetBitrate                 = m_apcLayerCfg[layerIdx]->m_RCTargetBitrate;
+    Bool& m_RCKeepHierarchicalBit          = m_apcLayerCfg[layerIdx]->m_RCKeepHierarchicalBit;
+    Bool& m_RCLCULevelRC                   = m_apcLayerCfg[layerIdx]->m_RCLCULevelRC;
+    Bool& m_RCUseLCUSeparateModel          = m_apcLayerCfg[layerIdx]->m_RCUseLCUSeparateModel;
+    Int& m_RCInitialQP                     = m_apcLayerCfg[layerIdx]->m_RCInitialQP;
+    Bool& m_RCForceIntraQP                 = m_apcLayerCfg[layerIdx]->m_RCForceIntraQP;
+
+    Bool& m_bUseSAO                         = m_apcLayerCfg[layerIdx]->m_bUseSAO;
+
+    Int* m_inputBitDepth                    = m_apcLayerCfg[layerIdx]->m_inputBitDepth;
+    Int* m_MSBExtendedBitDepth              = m_apcLayerCfg[layerIdx]->m_MSBExtendedBitDepth;
+    Int* m_internalBitDepth                 = m_apcLayerCfg[layerIdx]->m_internalBitDepth;
+
+#if U0132_TARGET_BITS_SATURATION
+    Bool& m_RCCpbSaturationEnabled          = m_apcLayerCfg[layerIdx]->m_RCCpbSaturationEnabled;
+    UInt& m_RCCpbSize                       = m_apcLayerCfg[layerIdx]->m_RCCpbSize;
+    Double& m_RCInitialCpbFullness          = m_apcLayerCfg[layerIdx]->m_RCInitialCpbFullness;
+#endif
+
+    if( layer == m_numLayers )
+    {
+      printf("\n=== Common configuration settings === \n");
+    }
+    
+    if( layer < m_numLayers )
+    {
+      printf("\n=== Layer %d settings ===\n", layer);
+#endif
+
   printf("Input          File                    : %s\n", m_pchInputFile          );
+
+#if SVC_EXTENSION
+    }
+    if( layer == m_numLayers )
+    {
+#endif
+
   printf("Bitstream      File                    : %s\n", m_pchBitstreamFile      );
+
+#if SVC_EXTENSION
+    }
+    if( layer < m_numLayers )
+    {
+#endif
+
   printf("Reconstruction File                    : %s\n", m_pchReconFile          );
   printf("Real     Format                        : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate );
   printf("Internal Format                        : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
-#endif //SVC_EXTENSION
-
+
+#if SVC_EXTENSION
+      printf("PTL index                              : %d\n", m_apcLayerCfg[layerIdx]->m_layerPTLIdx );
+    }
+
+    if( layer == m_numLayers )
+    {
+#endif
   printf("Sequence PSNR output                   : %s\n", (m_printMSEBasedSequencePSNR ? "Linear average, MSE-based" : "Linear average only") );
   printf("Sequence MSE output                    : %s\n", (m_printSequenceMSE ? "Enabled" : "Disabled") );
@@ -4467,5 +4546,11 @@
     printf("Frame index                            : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded );
   }
-#if !SVC_EXTENSION
+#if SVC_EXTENSION
+    }
+
+    if( layer < m_numLayers )
+    {
+#endif
+
   if (m_profile == Profile::MAINREXT)
   {
@@ -4501,14 +4586,39 @@
   printf("Max RQT depth inter                    : %d\n", m_uiQuadtreeTUMaxDepthInter);
   printf("Max RQT depth intra                    : %d\n", m_uiQuadtreeTUMaxDepthIntra);
+#if SVC_EXTENSION
+    }
+
+    if( layer == m_numLayers )
+    {
 #endif
   printf("Min PCM size                           : %d\n", 1 << m_uiPCMLog2MinSize);
   printf("Motion search range                    : %d\n", m_iSearchRange );
-#if !SVC_EXTENSION
+#if SVC_EXTENSION
+    }
+
+    if( layer < m_numLayers )
+    {
+#endif
   printf("Intra period                           : %d\n", m_iIntraPeriod );
+#if SVC_EXTENSION
+    }
+
+    if( layer == m_numLayers )
+    {
 #endif
   printf("Decoding refresh type                  : %d\n", m_iDecodingRefreshType );
-#if !SVC_EXTENSION
+#if SVC_EXTENSION
+    }
+
+    if( layer < m_numLayers )
+    {
+#endif
   printf("QP                                     : %5.2f\n", m_fQP );
   printf("Max dQP signaling depth                : %d\n", m_iMaxCuDQPDepth);
+#if SVC_EXTENSION
+    }
+
+    if( layer == m_numLayers )
+    {
 #endif
 
@@ -4517,5 +4627,12 @@
   printf("QP adaptation                          : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) );
   printf("GOP size                               : %d\n", m_iGOPSize );
-#if !SVC_EXTENSION
+
+#if SVC_EXTENSION
+    }
+
+    if( layer < m_numLayers )
+    {
+#endif
+
   printf("Input bit depth                        : (Y:%d, C:%d)\n", m_inputBitDepth[CHANNEL_TYPE_LUMA], m_inputBitDepth[CHANNEL_TYPE_CHROMA] );
   printf("MSB-extended bit depth                 : (Y:%d, C:%d)\n", m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] );
@@ -4523,10 +4640,14 @@
   printf("PCM sample bit depth                   : (Y:%d, C:%d)\n", m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA] : m_internalBitDepth[CHANNEL_TYPE_LUMA],
                                                                     m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] : m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
-#endif
+#if SVC_EXTENSION
+    }
+
+    if( layer == m_numLayers )
+    {
+#endif
+
   printf("Intra reference smoothing              : %s\n", (m_enableIntraReferenceSmoothing           ? "Enabled" : "Disabled") );
   printf("diff_cu_chroma_qp_offset_depth         : %d\n", m_diffCuChromaQpOffsetDepth);
-#if !SVC_EXTENSION
   printf("extended_precision_processing_flag     : %s\n", (m_extendedPrecisionProcessingFlag         ? "Enabled" : "Disabled") );
-#endif
   printf("implicit_rdpcm_enabled_flag            : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT] ? "Enabled" : "Disabled") );
   printf("explicit_rdpcm_enabled_flag            : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] ? "Enabled" : "Disabled") );
@@ -4534,9 +4655,8 @@
   printf("transform_skip_context_enabled_flag    : %s\n", (m_transformSkipContextEnabledFlag         ? "Enabled" : "Disabled") );
   printf("cross_component_prediction_enabled_flag: %s\n", (m_crossComponentPredictionEnabledFlag     ? (m_reconBasedCrossCPredictionEstimate ? "Enabled (reconstructed-residual-based estimate)" : "Enabled (encoder-side-residual-based estimate)") : "Disabled") );
-#if !SVC_EXTENSION
   printf("high_precision_offsets_enabled_flag    : %s\n", (m_highPrecisionOffsetsEnabledFlag         ? "Enabled" : "Disabled") );
-#endif
   printf("persistent_rice_adaptation_enabled_flag: %s\n", (m_persistentRiceAdaptationEnabledFlag     ? "Enabled" : "Disabled") );
   printf("cabac_bypass_alignment_enabled_flag    : %s\n", (m_cabacBypassAlignmentEnabledFlag         ? "Enabled" : "Disabled") );
+
   if (m_bUseSAO)
   {
@@ -4554,10 +4674,28 @@
   }
 
-#if !RC_SHVC_HARMONIZATION
+#if SVC_EXTENSION
+    }
+
+    if( layer < m_numLayers )
+    {
+#endif
+
   printf("RateControl                            : %d\n", m_RCEnableRateControl );
+
+#if SVC_EXTENSION
+    }
+
+    if( layer == m_numLayers )
+    {
 #endif
   printf("WPMethod                               : %d\n", Int(m_weightedPredictionMethod));
 
-#if !RC_SHVC_HARMONIZATION
+#if SVC_EXTENSION
+    }
+
+    if( layer < m_numLayers )
+    {
+#endif
+
   if(m_RCEnableRateControl)
   {
@@ -4577,4 +4715,10 @@
 #endif
   }
+
+#if SVC_EXTENSION
+    }
+
+    if( layer == m_numLayers )
+    {
 #endif
 
@@ -4582,8 +4726,26 @@
   printf("\n");
 
+#if SVC_EXTENSION
+    }
+  }
+
+  for( UInt layer = 0; layer < m_numLayers; layer++ )
+  {
+    Int* m_internalBitDepth               = m_apcLayerCfg[layer]->m_internalBitDepth;
+    Int* m_MSBExtendedBitDepth            = m_apcLayerCfg[layer]->m_MSBExtendedBitDepth;
+    Bool& m_bUseSAO                       = m_apcLayerCfg[layer]->m_bUseSAO;
+    UInt& m_uiMaxCUWidth                  = m_apcLayerCfg[layer]->m_uiMaxCUWidth;
+    UInt& m_uiMaxCUHeight                 = m_apcLayerCfg[layer]->m_uiMaxCUHeight;
+    Int& m_iSourceWidth                   = m_apcLayerCfg[layer]->m_iSourceWidth;
+    Int& m_iSourceHeight                  = m_apcLayerCfg[layer]->m_iSourceHeight;
+    Int& m_iWaveFrontSynchro              = m_apcLayerCfg[layer]->m_waveFrontSynchro;
+    ScalingListMode& m_useScalingListId   = m_apcLayerCfg[layer]->m_useScalingListId;
+
+
+    printf("Layer%d ", layer);
+#endif
+
   printf("TOOL CFG: ");
-#if !SVC_EXTENSION
   printf("IBD:%d ", ((m_internalBitDepth[CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA]) || (m_internalBitDepth[CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA])));
-#endif
   printf("HAD:%d ", m_bUseHADME                          );
   printf("RDQ:%d ", m_useRDOQ                            );
@@ -4615,7 +4777,5 @@
   printf("CIP:%d ", m_bUseConstrainedIntraPred);
   printf("SAO:%d ", (m_bUseSAO)?(1):(0));
-#if !SVC_EXTENSION
   printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
-#endif
 
   if (m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagForce)
@@ -4631,10 +4791,8 @@
   printf("WPB:%d ", (Int)m_useWeightedBiPred);
   printf("PME:%d ", m_log2ParallelMergeLevel);
-#if !SVC_EXTENSION
   const Int iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
   printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d",
           m_iWaveFrontSynchro, iWaveFrontSubstreams);
   printf(" ScalingList:%d ", m_useScalingListId );
-#endif
   printf("TMVPMode:%d ", m_TMVPModeId     );
 #if ADAPTIVE_QP_SELECTION
@@ -4646,5 +4804,8 @@
 
 #if SVC_EXTENSION
-  printf("\n\nSHVC TOOL CFG: ");
+    printf("\n\n");
+  }
+
+  printf("\nSHVC TOOL CFG: ");
   printf("ElRapSliceType: %c-slice ", m_elRapSliceBEnabled ? 'B' : 'P');
   printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV);
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1436)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1437)
@@ -246,8 +246,10 @@
   Int       m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE];      ///< bit-depth of input samples after MSB extension
   Int       m_internalBitDepth[MAX_NUM_CHANNEL_TYPE];         ///< bit-depth codec operates at (input/output files will be converted)
+#endif
   Bool      m_extendedPrecisionProcessingFlag;
   Bool      m_highPrecisionOffsetsEnabledFlag;
 
   //coding tools (chroma format)
+#if !SVC_EXTENSION
   ChromaFormat m_chromaFormatIDC;
 #endif
@@ -257,5 +259,7 @@
 
   // coding tool (SAO)
+#if !SVC_EXTENSION
   Bool      m_bUseSAO;
+#endif
   Bool      m_bTestSAODisableAtPictureLevel;
   Double    m_saoEncodingRate;                                ///< When >0 SAO early picture termination is enabled for luma and chroma
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 1436)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 1437)
@@ -44,6 +44,7 @@
 : m_cInputFile(string(""))
 , m_cReconFile(string(""))
-, m_conformanceMode( 0 )
+, m_conformanceWindowMode(0)
 , m_scalingListFile(NULL)
+, m_pchdQPFile(NULL)
 , m_aidQP(NULL)
 , m_repFormatIdx(-1)
@@ -53,11 +54,8 @@
 {
 #if Q0074_COLOUR_REMAPPING_SEI
-  for( Int c=0 ; c<3 ; c++)
-  {
-    m_colourRemapSEIPreLutCodedValue[c]   = NULL;
-    m_colourRemapSEIPreLutTargetValue[c]  = NULL;
-    m_colourRemapSEIPostLutCodedValue[c]  = NULL;
-    m_colourRemapSEIPostLutTargetValue[c] = NULL;
-  }
+  memset( m_colourRemapSEIPreLutCodedValue,   0, sizeof(m_colourRemapSEIPreLutCodedValue) );
+  memset( m_colourRemapSEIPreLutTargetValue,  0, sizeof(m_colourRemapSEIPreLutTargetValue) );
+  memset( m_colourRemapSEIPostLutCodedValue,  0, sizeof(m_colourRemapSEIPostLutCodedValue) );
+  memset( m_colourRemapSEIPostLutTargetValue, 0, sizeof(m_colourRemapSEIPostLutTargetValue) );
 #endif
   m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0;
@@ -120,335 +118,4 @@
 }
 
-
-// ====================================================================================================================
-// Public member functions
-// ====================================================================================================================
-
-/** \param  argc        number of arguments
-\param  argv        array of arguments
-\retval             true when success
-*/
-bool TAppEncLayerCfg::parseCfg( const string& cfgFileName  )
-{
-  string cfg_InputFile;
-  string cfg_ReconFile;
-  string cfg_dQPFile;
-#if AUXILIARY_PICTURES
-  Int tmpInputChromaFormat;
-  Int tmpChromaFormat;
-#endif
-#if Q0074_COLOUR_REMAPPING_SEI
-  string cfg_colourRemapSEIFileRoot;
-#endif
-
-  po::Options opts;
-  opts.addOptions()
-    ("InputFile,i",           cfg_InputFile,  string(""), "original YUV input file name")
-#if AVC_BASE
-    ("InputBLFile,-ibl",      cfg_InputFile,  string(""), "original YUV input file name")
-#endif
-    ("ReconFile,o",           cfg_ReconFile,  string(""), "reconstructed YUV output file name")
-    ("SourceWidth,-wdt",      m_iSourceWidth,  0, "Source picture width")
-    ("SourceHeight,-hgt",     m_iSourceHeight, 0, "Source picture height")
-    ("CroppingMode",          m_conformanceMode,  0, "Cropping mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")
-#if AUXILIARY_PICTURES
-    ("InputChromaFormat",     tmpInputChromaFormat,  420, "InputChromaFormatIDC")
-    ("ChromaFormatIDC",       tmpChromaFormat,    420, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)")
-#endif
-    ("ConfLeft",              m_confWinLeft,            0, "Deprecated alias of ConfWinLeft")
-    ("ConfRight",             m_confWinRight,           0, "Deprecated alias of ConfWinRight")
-    ("ConfTop",               m_confWinTop,             0, "Deprecated alias of ConfWinTop")
-    ("ConfBottom",            m_confWinBottom,          0, "Deprecated alias of ConfWinBottom")
-    ("ConfWinLeft",           m_confWinLeft,            0, "Left offset for window conformance mode 3")
-    ("ConfWinRight",          m_confWinRight,           0, "Right offset for window conformance mode 3")
-    ("ConfWinTop",            m_confWinTop,             0, "Top offset for window conformance mode 3")
-    ("ConfWinBottom",         m_confWinBottom,          0, "Bottom offset for window conformance mode 3")
-    ("HorizontalPadding,-pdx",m_aiPad[0],      0, "horizontal source padding for cropping mode 2")
-    ("VerticalPadding,-pdy",  m_aiPad[1],      0, "vertical source padding for cropping mode 2")
-    ("IntraPeriod,-ip",       m_iIntraPeriod,  -1, "intra period in frames, (-1: only first frame)")
-    ("FrameRate,-fr",         m_iFrameRate,    0, "Frame rate")
-    ("dQPFile,m",             cfg_dQPFile, string(""), "dQP file name")
-    ("QP,q",                  m_fQP,          30.0, "Qp value, if value is float, QP is switched once during encoding")
-#if Q0074_COLOUR_REMAPPING_SEI
-    ("SEIColourRemappingInfoFileRoot", cfg_colourRemapSEIFileRoot, string(""), "Colour Remapping Information SEI parameters file name")
-#endif
-  ;
-
-  po::setDefaults(opts);
-  po::parseConfigFile(opts, cfgFileName);
-
-  m_cInputFile = cfg_InputFile;
-  m_cReconFile = cfg_ReconFile;
-  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
-#if AUXILIARY_PICTURES
-  m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat);
-  m_chromaFormatIDC   = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat)));
-#endif
-#if Q0074_COLOUR_REMAPPING_SEI
-  if( !cfg_colourRemapSEIFileRoot.empty() )
-  {
-    m_colourRemapSEIFileRoot = strdup(cfg_colourRemapSEIFileRoot.c_str());
-  }
-#endif
-
-  // reading external dQP description from file
-  if ( m_pchdQPFile )
-  {
-    FILE* fpt=fopen( m_pchdQPFile, "r" );
-    if ( fpt )
-    {
-      Int iValue;
-      Int iPOC = 0;
-      while ( iPOC < m_cAppEncCfg->getNumFrameToBeEncoded() )
-      {
-        if ( fscanf(fpt, "%d", &iValue ) == EOF ) break;
-        m_aidQP[ iPOC ] = iValue;
-        iPOC++;
-      }
-      fclose(fpt);
-    }
-  }
-
-  return true;
-}
-
-Void TAppEncLayerCfg::xPrintParameter()
-{
-  printf("Input File                        : %s\n", m_cInputFile.c_str()  );
-  printf("Reconstruction File               : %s\n", m_cReconFile.c_str()  );
-  printf("Real     Format                   : %dx%d %dHz\n", m_iSourceWidth - ( m_confWinLeft + m_confWinRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confWinTop + m_confWinBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate );
-  printf("Internal Format                   : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
-  printf("PTL index                         : %d\n", m_layerPTLIdx );
-  printf("Input bit depth                   : (Y:%d, C:%d)\n", m_inputBitDepth[CHANNEL_TYPE_LUMA], m_inputBitDepth[CHANNEL_TYPE_CHROMA] );
-  printf("Internal bit depth                : (Y:%d, C:%d)\n", m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
-  printf("PCM sample bit depth              : (Y:%d, C:%d)\n", m_cAppEncCfg->getPCMInputBitDepthFlag() ? m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_internalBitDepth[CHANNEL_TYPE_LUMA], m_cAppEncCfg->getPCMInputBitDepthFlag() ? m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
-  std::cout << "Input ChromaFormatIDC             :";
-
-  switch (m_InputChromaFormatIDC)
-  {
-  case CHROMA_400:  std::cout << " 4:0:0"; break;
-  case CHROMA_420:  std::cout << " 4:2:0"; break;
-  case CHROMA_422:  std::cout << " 4:2:2"; break;
-  case CHROMA_444:  std::cout << " 4:4:4"; break;
-  default:
-    std::cerr << "Invalid";
-    exit(1);
-  }
-  std::cout << std::endl;
-
-  std::cout << "Output (internal) ChromaFormatIDC :";
-  switch (m_chromaFormatIDC)
-  {
-  case CHROMA_400:  std::cout << " 4:0:0"; break;
-  case CHROMA_420:  std::cout << " 4:2:0"; break;
-  case CHROMA_422:  std::cout << " 4:2:2"; break;
-  case CHROMA_444:  std::cout << " 4:4:4"; break;
-  default:
-    std::cerr << "Invalid";
-    exit(1);
-  }
-  printf("\n");
-  printf("CU size / depth / total-depth     : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxTotalCUDepth );
-  printf("RQT trans. size (min / max)       : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
-  printf("Max RQT depth inter               : %d\n", m_uiQuadtreeTUMaxDepthInter);
-  printf("Max RQT depth intra               : %d\n", m_uiQuadtreeTUMaxDepthIntra);
-  printf("QP                                : %5.2f\n", m_fQP );
-  printf("Max dQP signaling depth           : %d\n", m_iMaxCuDQPDepth);
-  printf("Intra period                      : %d\n", m_iIntraPeriod );
-#if RC_SHVC_HARMONIZATION                    
-  printf("RateControl                       : %d\n", m_RCEnableRateControl );
-  if(m_RCEnableRateControl)
-  {
-    printf("TargetBitrate                     : %d\n", m_RCTargetBitrate );
-    printf("KeepHierarchicalBit               : %d\n", m_RCKeepHierarchicalBit );
-    printf("LCULevelRC                        : %d\n", m_RCLCULevelRC );
-    printf("UseLCUSeparateModel               : %d\n", m_RCUseLCUSeparateModel );
-    printf("InitialQP                         : %d\n", m_RCInitialQP );
-    printf("ForceIntraQP                      : %d\n", m_RCForceIntraQP );
-#if U0132_TARGET_BITS_SATURATION
-    printf("CpbSaturation                          : %d\n", m_RCCpbSaturationEnabled );
-    if (m_RCCpbSaturationEnabled)
-    {
-      printf("CpbSize                                : %d\n", m_RCCpbSize);
-      printf("InitalCpbFullness                      : %.2f\n", m_RCInitialCpbFullness);
-    }
-#endif
-  }
-#endif
-  printf("WaveFrontSynchro                  : %d\n", m_waveFrontSynchro);
-
-  const Int iWaveFrontSubstreams = m_waveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
-  printf("WaveFrontSubstreams               : %d\n", iWaveFrontSubstreams);
-  printf("ScalingList                       : %d\n", m_useScalingListId );
-  printf("PCM                               : %d\n", (m_cAppEncCfg->getUsePCM() && (1<<m_cAppEncCfg->getPCMLog2MinSize()) <= m_uiMaxCUWidth)? 1 : 0);
-}
-
-Bool confirmPara(Bool bflag, const char* message);
-
-Bool TAppEncLayerCfg::xCheckParameter( Bool isField )
-{
-  switch (m_conformanceMode)
-  {
-  case 0:
-    {
-      // no cropping or padding
-      m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0;
-      m_aiPad[1] = m_aiPad[0] = 0;
-      break;
-    }
-  case 1:
-    {
-      // conformance
-      if ((m_confWinLeft != 0) || (m_confWinRight != 0) || (m_confWinTop != 0) || (m_confWinBottom != 0))
-      {
-        fprintf(stderr, "Warning: Automatic padding enabled, but cropping parameters are set. Undesired size possible.\n");
-      }
-      if ((m_aiPad[1] != 0) || (m_aiPad[0] != 0))
-      {
-        fprintf(stderr, "Warning: Automatic padding enabled, but padding parameters are also set\n");
-      }
-
-      // automatic padding to minimum CU size
-      Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1);
-
-      if (m_iSourceWidth % minCuSize)
-      {
-        m_aiPad[0] = m_confWinRight  = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
-        m_iSourceWidth  += m_confWinRight;
-        m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
-      }
-      if (m_iSourceHeight % minCuSize)
-      {
-        m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
-        m_iSourceHeight += m_confWinBottom;
-        if ( isField )
-        {
-          m_iSourceHeightOrg += m_confWinBottom << 1;
-          m_aiPad[1] = m_confWinBottom << 1;
-        }
-        m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
-      }
-      break;
-    }
-  case 2:
-    {
-      // conformance
-      if ((m_confWinLeft != 0) || (m_confWinRight != 0) || (m_confWinTop != 0) || (m_confWinBottom != 0))
-      {
-        fprintf(stderr, "Warning: Automatic padding enabled, but cropping parameters are set. Undesired size possible.\n");
-      }
-
-      //padding
-      m_iSourceWidth  += m_aiPad[0];
-      m_iSourceHeight += m_aiPad[1];
-      m_confWinRight  = m_aiPad[0];
-      m_confWinBottom = m_aiPad[1];
-      m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
-      m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
-      break;
-    }
-  case 3:
-    {
-      // conformance
-      if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0))
-      {
-        fprintf(stderr, "Warning: Cropping enabled, but all cropping parameters set to zero\n");
-      }
-      if ((m_aiPad[1] != 0) || (m_aiPad[0]!=0))
-      {
-        fprintf(stderr, "Warning: Cropping enabled, padding parameters will be ignored\n");
-      }
-      m_aiPad[1] = m_aiPad[0] = 0;
-      break;
-    }
-  }
-
-  // allocate slice-based dQP values
-  Int iFrameToBeEncoded = m_cAppEncCfg->getNumFrameToBeEncoded();
-  Int iGOPSize = m_cAppEncCfg->getGOPSize();
-  if( m_aidQP == NULL )
-    m_aidQP = new Int[iFrameToBeEncoded + iGOPSize + 1 ];
-  ::memset( m_aidQP, 0, sizeof(Int)*( iFrameToBeEncoded + iGOPSize + 1 ) );
-
-  // handling of floating-point QP values
-  // if QP is not integer, sequence is split into two sections having QP and QP+1
-  m_iQP = (Int)( m_fQP );
-  if ( m_iQP < m_fQP )
-  {
-    Int iSwitchPOC = (Int)( iFrameToBeEncoded - (m_fQP - m_iQP)*iFrameToBeEncoded + 0.5 );
-
-
-    iSwitchPOC = (Int)( (Double)iSwitchPOC / iGOPSize + 0.5 )*iGOPSize;
-    for ( Int i=iSwitchPOC; i<iFrameToBeEncoded + iGOPSize + 1; i++ )
-    {
-      m_aidQP[i] = 1;
-    }
-  }
-
-  UInt maxCUWidth = m_uiMaxCUWidth;
-  UInt maxCUHeight = m_uiMaxCUHeight;
-  UInt maxCUDepth = m_uiMaxCUDepth;
-  bool check_failed = false; /* abort if there is a fatal configuration problem */
-#define xConfirmPara(a,b) check_failed |= confirmPara(a,b)
-  // check range of parameters
-  xConfirmPara( m_iFrameRate <= 0,                                                          "Frame rate must be more than 1" );
-  xConfirmPara( (m_iSourceWidth  % (maxCUWidth  >> (maxCUDepth-1)))!=0,             "Resulting coded frame width must be a multiple of the minimum CU size");
-  xConfirmPara( (m_iSourceHeight % (maxCUHeight >> (maxCUDepth-1)))!=0,             "Resulting coded frame height must be a multiple of the minimum CU size");
-  xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
-  if (m_cAppEncCfg->getDecodingRefreshType() == 2)
-  {
-    xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= iGOPSize ,                      "Intra period must be larger than GOP size for periodic IDR pictures");
-  }
-
-  xConfirmPara( m_iQP <  -6 * (m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8) || m_iQP > 51,                "QP exceeds supported range (-QpBDOffsety to 51)" );
-
-  xConfirmPara( m_waveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );
-
-  //chekc parameters
-  xConfirmPara( m_iSourceWidth  % TComSPS::getWinUnitX(CHROMA_420) != 0, "Picture width must be an integer multiple of the specified chroma subsampling");
-  xConfirmPara( m_iSourceHeight % TComSPS::getWinUnitY(CHROMA_420) != 0, "Picture height must be an integer multiple of the specified chroma subsampling");
-
-  xConfirmPara( m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0, "Horizontal padding must be an integer multiple of the specified chroma subsampling");
-  xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling");
-
-  xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1,                                          "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
-
-  xConfirmPara( (m_uiMaxCUWidth  >> m_uiMaxCUDepth) < 4,                                    "Minimum partition width size should be larger than or equal to 8");
-  xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4,                                    "Minimum partition height size should be larger than or equal to 8");
-  xConfirmPara( m_uiMaxCUWidth < 16,                                                        "Maximum partition width size should be larger than or equal to 16");
-  xConfirmPara( m_uiMaxCUHeight < 16,                                                       "Maximum partition height size should be larger than or equal to 16");
-  xConfirmPara( m_uiQuadtreeTULog2MinSize < 2,                                        "QuadtreeTULog2MinSize must be 2 or greater.");
-  xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5,                                        "QuadtreeTULog2MaxSize must be 5 or smaller.");
-  xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth,                                        "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller.");
-  xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize,                "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");
-  xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS
-  xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS
-  xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth  >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." );
-  xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." );
-  xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1,                                                         "QuadtreeTUMaxDepthInter must be greater than or equal to 1" );
-  xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthInter - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
-  xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1,                                                         "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
-  xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
-
-  // max CU width and height should be power of 2
-  UInt ui = m_uiMaxCUWidth;
-  while(ui)
-  {
-    ui >>= 1;
-    if( (ui & 1) == 1)
-      xConfirmPara( ui != 1 , "Width should be 2^n");
-  }
-  ui = m_uiMaxCUHeight;
-  while(ui)
-  {
-    ui >>= 1;
-    if( (ui & 1) == 1)
-      xConfirmPara( ui != 1 , "Height should be 2^n");
-  }
-
-#undef xConfirmPara
-  return check_failed;
-}
-
 #endif //SVC_EXTENSION
 
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1436)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1437)
@@ -35,5 +35,5 @@
   Int       m_iSourceHeight;                                  ///< source height in pixel (when interlaced = field height)
   Int       m_iSourceHeightOrg;                               ///< original source height in pixel (when interlaced = frame height)
-  Int       m_conformanceMode;
+  Int       m_conformanceWindowMode;
   Int       m_confWinLeft;
   Int       m_confWinRight;
@@ -91,4 +91,6 @@
 #endif
 #endif
+
+  Bool      m_bUseSAO;
 
   ScalingListMode m_useScalingListId;                         ///< using quantization matrix
@@ -125,7 +127,4 @@
   Int       m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE];      ///< bit-depth of input samples after MSB extension
   Int       m_internalBitDepth[MAX_NUM_CHANNEL_TYPE];         ///< bit-depth codec operates at (input/output files will be converted)
-  UInt      m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE];
-  Bool      m_extendedPrecisionProcessingFlag;
-  Bool      m_highPrecisionOffsetsEnabledFlag;
 
   Int       m_repFormatIdx;
@@ -166,8 +165,4 @@
   Void  create    ();                                         ///< create option handling class
   Void  destroy   ();                                         ///< destroy option handling class
-  bool  parseCfg  ( const string& cfgFileName );              ///< parse layer configuration file to fill member variables
-
-  Void  xPrintParameter();
-  Bool  xCheckParameter( Bool isField );
 
   Void    setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p;          }
@@ -175,10 +170,4 @@
   string  getInputFile()              {return m_cInputFile;       }
   string  getReconFile()              {return m_cReconFile;       }
-  Int     getFrameRate()              {return m_iFrameRate;       }
-  Int     getSourceWidth()            {return m_iSourceWidth;     }
-  Int     getSourceHeight()           {return m_iSourceHeight;    }
-  Int     getSourceHeightOrg()        {return m_iSourceHeightOrg; }
-  Int     getConformanceMode()        { return m_conformanceMode; }
-  Int*    getPad()                    {return m_aiPad;            }
   Double  getFloatQP()                {return m_fQP;              }
   Int     getConfWinLeft()            {return m_confWinLeft;         }
@@ -186,12 +175,4 @@
   Int     getConfWinTop()             {return m_confWinTop;          }
   Int     getConfWinBottom()          {return m_confWinBottom;       }
-#if AUXILIARY_PICTURES
-  ChromaFormat getInputChromaFormat()   {return m_InputChromaFormatIDC;}
-  ChromaFormat getChromaFormatIDC()     {return m_chromaFormatIDC;  }
-  Int          getAuxId()               {return m_auxId;            }
-#endif
-
-  Int     getIntQP()                  {return m_iQP;              } 
-  Int*    getdQPs()                   {return m_aidQP;            }
 
   Int     getNumSamplePredRefLayers()    {return m_numSamplePredRefLayers;   }
@@ -206,13 +187,4 @@
   Int     getPredLayerIdx(Int i)      {return m_predLayerIds[i];  }
 
-#if RC_SHVC_HARMONIZATION
-  Bool    getRCEnableRateControl()    {return m_RCEnableRateControl;   }
-  Int     getRCTargetBitrate()        {return m_RCTargetBitrate;       }
-  Bool    getRCKeepHierarchicalBit()  {return m_RCKeepHierarchicalBit; }
-  Bool    getRCLCULevelRC()           {return m_RCLCULevelRC;          }
-  Bool    getRCUseLCUSeparateModel()  {return m_RCUseLCUSeparateModel; }
-  Int     getRCInitialQP()            {return m_RCInitialQP;           }
-  Bool    getRCForceIntraQP()         {return m_RCForceIntraQP;        }
-#endif
   Int     getRepFormatIdx()           { return m_repFormatIdx;  }
   Void    setRepFormatIdx(Int x)      { m_repFormatIdx = x;     }
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1436)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1437)
@@ -111,7 +111,7 @@
       for( UInt idx = 0; idx < layer; idx++ )
       {
-        if( m_apcLayerCfg[layer]->getSourceWidth() == m_apcLayerCfg[idx]->getSourceWidth() && m_apcLayerCfg[layer]->getSourceHeight() == m_apcLayerCfg[idx]->getSourceHeight()
+        if( m_apcLayerCfg[layer]->m_iSourceWidth == m_apcLayerCfg[idx]->m_iSourceWidth && m_apcLayerCfg[layer]->m_iSourceHeight == m_apcLayerCfg[idx]->m_iSourceHeight
 #if AUXILIARY_PICTURES
-          && m_apcLayerCfg[layer]->getChromaFormatIDC() == m_apcLayerCfg[idx]->getChromaFormatIDC()
+          && m_apcLayerCfg[layer]->m_chromaFormatIDC == m_apcLayerCfg[idx]->m_chromaFormatIDC
 #endif
           && m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA] == m_apcLayerCfg[idx]->m_internalBitDepth[CHANNEL_TYPE_LUMA] && m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA] == m_apcLayerCfg[idx]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]
@@ -171,8 +171,8 @@
     }
 
-    repFormat->setPicWidthVpsInLumaSamples                                ( m_apcLayerCfg[mapIdxToLayer[idx]]->getSourceWidth()   );
-    repFormat->setPicHeightVpsInLumaSamples                               ( m_apcLayerCfg[mapIdxToLayer[idx]]->getSourceHeight()  );
+    repFormat->setPicWidthVpsInLumaSamples                                ( m_apcLayerCfg[mapIdxToLayer[idx]]->m_iSourceWidth   );
+    repFormat->setPicHeightVpsInLumaSamples                               ( m_apcLayerCfg[mapIdxToLayer[idx]]->m_iSourceHeight  );
 #if AUXILIARY_PICTURES
-    repFormat->setChromaFormatVpsIdc                                      ( m_apcLayerCfg[mapIdxToLayer[idx]]->getChromaFormatIDC() );
+    repFormat->setChromaFormatVpsIdc                                      ( m_apcLayerCfg[mapIdxToLayer[idx]]->m_chromaFormatIDC );
 #else
     repFormat->setChromaFormatVpsIdc                                      ( 1 );  // Need modification to change for each layer - corresponds to 420
@@ -443,63 +443,62 @@
 #endif
 
-    Int layerPTLIdx = m_apcLayerCfg[layer]->m_layerPTLIdx;
-
-    Profile::Name m_profile                                    = m_profileList[layerPTLIdx];
-    Level::Tier   m_levelTier                                  = m_levelTierList[layerPTLIdx];
-    Level::Name   m_level                                      = m_levelList[layerPTLIdx];
-    UInt          m_bitDepthConstraint                         = m_apcLayerCfg[layer]->m_bitDepthConstraint;
-    ChromaFormat  m_chromaFormatConstraint                     = m_apcLayerCfg[layer]->m_chromaFormatConstraint;
-    Bool          m_intraConstraintFlag                        = m_apcLayerCfg[layer]->m_intraConstraintFlag;
-    Bool          m_onePictureOnlyConstraintFlag               = m_apcLayerCfg[layer]->m_onePictureOnlyConstraintFlag;
-    Bool          m_lowerBitRateConstraintFlag                 = m_apcLayerCfg[layer]->m_lowerBitRateConstraintFlag;
-    Bool          m_progressiveSourceFlag                      = m_progressiveSourceFlagList[layerPTLIdx];
-    Bool          m_interlacedSourceFlag                       = m_interlacedSourceFlagList[layerPTLIdx];
-    Bool          m_nonPackedConstraintFlag                    = m_nonPackedConstraintFlagList[layerPTLIdx];
-    Bool          m_frameOnlyConstraintFlag                    = m_frameOnlyConstraintFlagList[layerPTLIdx];
-
-    Int           m_iFrameRate                                 = m_apcLayerCfg[layer]->getFrameRate();
-    Int           m_iSourceWidth                               = m_apcLayerCfg[layer]->getSourceWidth();
-    Int           m_iSourceHeight                              = m_apcLayerCfg[layer]->getSourceHeight();
-    Int           m_confWinLeft                                = m_apcLayerCfg[layer]->m_confWinLeft;
-    Int           m_confWinRight                               = m_apcLayerCfg[layer]->m_confWinRight;
-    Int           m_confWinTop                                 = m_apcLayerCfg[layer]->m_confWinTop;
-    Int           m_confWinBottom                              = m_apcLayerCfg[layer]->m_confWinBottom;
-
-    Int           m_iIntraPeriod                               = m_apcLayerCfg[layer]->m_iIntraPeriod;
-    Int           m_iQP                                        = m_apcLayerCfg[layer]->getIntQP();
-    Int          *m_aiPad                                      = m_apcLayerCfg[layer]->getPad();
-
-    Int           m_iMaxCuDQPDepth                             = m_apcLayerCfg[layer]->m_iMaxCuDQPDepth;
-    ChromaFormat  m_chromaFormatIDC                            = m_apcLayerCfg[layer]->m_chromaFormatIDC;
-    Bool          m_extendedPrecisionProcessingFlag            = m_apcLayerCfg[layer]->m_extendedPrecisionProcessingFlag;
-    Bool          m_highPrecisionOffsetsEnabledFlag            = m_apcLayerCfg[layer]->m_highPrecisionOffsetsEnabledFlag;
-    Int           *m_aidQP                                     = m_apcLayerCfg[layer]->getdQPs();
-
-    UInt          m_uiMaxCUWidth                               = m_apcLayerCfg[layer]->m_uiMaxCUWidth;
-    UInt          m_uiMaxCUHeight                              = m_apcLayerCfg[layer]->m_uiMaxCUHeight;
-    UInt          m_uiMaxTotalCUDepth                          = m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth;
-    UInt          m_uiLog2DiffMaxMinCodingBlockSize            = m_apcLayerCfg[layer]->m_uiLog2DiffMaxMinCodingBlockSize;
-    UInt          m_uiQuadtreeTULog2MaxSize                    = m_apcLayerCfg[layer]->m_uiQuadtreeTULog2MaxSize;
-    UInt          m_uiQuadtreeTULog2MinSize                    = m_apcLayerCfg[layer]->m_uiQuadtreeTULog2MinSize;
-    UInt          m_uiQuadtreeTUMaxDepthInter                  = m_apcLayerCfg[layer]->m_uiQuadtreeTUMaxDepthInter;
-    UInt          m_uiQuadtreeTUMaxDepthIntra                  = m_apcLayerCfg[layer]->m_uiQuadtreeTUMaxDepthIntra;
-
-    Int           m_iWaveFrontSynchro                          = m_apcLayerCfg[layer]->m_waveFrontSynchro;
-    Bool          m_RCEnableRateControl                        = m_apcLayerCfg[layer]->getRCEnableRateControl();
-    Int           m_RCTargetBitrate                            = m_apcLayerCfg[layer]->getRCTargetBitrate();
-    Bool          m_RCKeepHierarchicalBit                      = m_apcLayerCfg[layer]->getRCKeepHierarchicalBit();
-    Bool          m_RCLCULevelRC                               = m_apcLayerCfg[layer]->getRCLCULevelRC();
-    Bool          m_RCUseLCUSeparateModel                      = m_apcLayerCfg[layer]->getRCUseLCUSeparateModel();
-    Int           m_RCInitialQP                                = m_apcLayerCfg[layer]->getRCInitialQP();
-    Bool          m_RCForceIntraQP                             = m_apcLayerCfg[layer]->getRCForceIntraQP();
+    Int& layerPTLIdx                                            = m_apcLayerCfg[layer]->m_layerPTLIdx;
+
+    Profile::Name& m_profile                                    = m_profileList[layerPTLIdx];
+    Level::Tier&   m_levelTier                                  = m_levelTierList[layerPTLIdx];
+    Level::Name&   m_level                                      = m_levelList[layerPTLIdx];
+    UInt&          m_bitDepthConstraint                         = m_apcLayerCfg[layer]->m_bitDepthConstraint;
+    ChromaFormat&  m_chromaFormatConstraint                     = m_apcLayerCfg[layer]->m_chromaFormatConstraint;
+    Bool&          m_intraConstraintFlag                        = m_apcLayerCfg[layer]->m_intraConstraintFlag;
+    Bool&          m_onePictureOnlyConstraintFlag               = m_apcLayerCfg[layer]->m_onePictureOnlyConstraintFlag;
+    Bool&          m_lowerBitRateConstraintFlag                 = m_apcLayerCfg[layer]->m_lowerBitRateConstraintFlag;
+    Bool&          m_progressiveSourceFlag                      = m_progressiveSourceFlagList[layerPTLIdx];
+    Bool&          m_interlacedSourceFlag                       = m_interlacedSourceFlagList[layerPTLIdx];
+    Bool&          m_nonPackedConstraintFlag                    = m_nonPackedConstraintFlagList[layerPTLIdx];
+    Bool&          m_frameOnlyConstraintFlag                    = m_frameOnlyConstraintFlagList[layerPTLIdx];
+
+    Int&           m_iFrameRate                                 = m_apcLayerCfg[layer]->m_iFrameRate;
+    Int&           m_iSourceWidth                               = m_apcLayerCfg[layer]->m_iSourceWidth;
+    Int&           m_iSourceHeight                              = m_apcLayerCfg[layer]->m_iSourceHeight;
+    Int&           m_confWinLeft                                = m_apcLayerCfg[layer]->m_confWinLeft;
+    Int&           m_confWinRight                               = m_apcLayerCfg[layer]->m_confWinRight;
+    Int&           m_confWinTop                                 = m_apcLayerCfg[layer]->m_confWinTop;
+    Int&           m_confWinBottom                              = m_apcLayerCfg[layer]->m_confWinBottom;
+
+    Int&           m_iIntraPeriod                               = m_apcLayerCfg[layer]->m_iIntraPeriod;
+    Int&           m_iQP                                        = m_apcLayerCfg[layer]->m_iQP;
+    Int           *m_aiPad                                      = m_apcLayerCfg[layer]->m_aiPad;
+
+    Int&           m_iMaxCuDQPDepth                             = m_apcLayerCfg[layer]->m_iMaxCuDQPDepth;
+    ChromaFormat&  m_chromaFormatIDC                            = m_apcLayerCfg[layer]->m_chromaFormatIDC;
+    Int           *m_aidQP                                      = m_apcLayerCfg[layer]->m_aidQP;
+
+    UInt&          m_uiMaxCUWidth                               = m_apcLayerCfg[layer]->m_uiMaxCUWidth;
+    UInt&          m_uiMaxCUHeight                              = m_apcLayerCfg[layer]->m_uiMaxCUHeight;
+    UInt&          m_uiMaxTotalCUDepth                          = m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth;
+    UInt&          m_uiLog2DiffMaxMinCodingBlockSize            = m_apcLayerCfg[layer]->m_uiLog2DiffMaxMinCodingBlockSize;
+    UInt&          m_uiQuadtreeTULog2MaxSize                    = m_apcLayerCfg[layer]->m_uiQuadtreeTULog2MaxSize;
+    UInt&          m_uiQuadtreeTULog2MinSize                    = m_apcLayerCfg[layer]->m_uiQuadtreeTULog2MinSize;
+    UInt&          m_uiQuadtreeTUMaxDepthInter                  = m_apcLayerCfg[layer]->m_uiQuadtreeTUMaxDepthInter;
+    UInt&          m_uiQuadtreeTUMaxDepthIntra                  = m_apcLayerCfg[layer]->m_uiQuadtreeTUMaxDepthIntra;
+
+    Int&           m_iWaveFrontSynchro                          = m_apcLayerCfg[layer]->m_waveFrontSynchro;
+    Bool&          m_RCEnableRateControl                        = m_apcLayerCfg[layer]->m_RCEnableRateControl;
+    Int&           m_RCTargetBitrate                            = m_apcLayerCfg[layer]->m_RCTargetBitrate;
+    Bool&          m_RCKeepHierarchicalBit                      = m_apcLayerCfg[layer]->m_RCKeepHierarchicalBit;
+    Bool&          m_RCLCULevelRC                               = m_apcLayerCfg[layer]->m_RCLCULevelRC;
+    Bool&          m_RCUseLCUSeparateModel                      = m_apcLayerCfg[layer]->m_RCUseLCUSeparateModel;
+    Int&           m_RCInitialQP                                = m_apcLayerCfg[layer]->m_RCInitialQP;
+    Bool&          m_RCForceIntraQP                             = m_apcLayerCfg[layer]->m_RCForceIntraQP;
 
 #if U0132_TARGET_BITS_SATURATION
-    Bool          m_RCCpbSaturationEnabled                     = m_apcLayerCfg[layer]->m_RCCpbSaturationEnabled;
-    UInt          m_RCCpbSize                                  = m_apcLayerCfg[layer]->m_RCCpbSize;
-    Double        m_RCInitialCpbFullness                       = m_apcLayerCfg[layer]->m_RCInitialCpbFullness;
-#endif
-
-    ScalingListMode m_useScalingListId                         = m_apcLayerCfg[layer]->m_useScalingListId;
-    Char*         m_scalingListFile                            = m_apcLayerCfg[layer]->m_scalingListFile;
+    Bool&          m_RCCpbSaturationEnabled                     = m_apcLayerCfg[layer]->m_RCCpbSaturationEnabled;
+    UInt&          m_RCCpbSize                                  = m_apcLayerCfg[layer]->m_RCCpbSize;
+    Double&        m_RCInitialCpbFullness                       = m_apcLayerCfg[layer]->m_RCInitialCpbFullness;
+#endif
+
+    ScalingListMode& m_useScalingListId                         = m_apcLayerCfg[layer]->m_useScalingListId;
+    Char*          m_scalingListFile                            = m_apcLayerCfg[layer]->m_scalingListFile;
+    Bool&          m_bUseSAO                                    = m_apcLayerCfg[layer]->m_bUseSAO;
 #endif
 
@@ -879,5 +878,5 @@
     // Video I/O
     m_apcTVideoIOYuvInputFile[layer]->open( (Char *)m_apcLayerCfg[layer]->getInputFile().c_str(),  false, m_apcLayerCfg[layer]->m_inputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth );  // read  mode
-    m_apcTVideoIOYuvInputFile[layer]->skipFrames(m_FrameSkip, m_apcLayerCfg[layer]->getSourceWidth() - m_apcLayerCfg[layer]->getPad()[0], m_apcLayerCfg[layer]->getSourceHeight() - m_apcLayerCfg[layer]->getPad()[1], m_apcLayerCfg[layer]->m_InputChromaFormatIDC);
+    m_apcTVideoIOYuvInputFile[layer]->skipFrames(m_FrameSkip, m_apcLayerCfg[layer]->m_iSourceWidth - m_apcLayerCfg[layer]->m_aiPad[0], m_apcLayerCfg[layer]->m_iSourceHeight - m_apcLayerCfg[layer]->m_aiPad[1], m_apcLayerCfg[layer]->m_InputChromaFormatIDC);
 
     if( !m_apcLayerCfg[layer]->getReconFile().empty() )
@@ -1094,7 +1093,7 @@
     for(i = 1; i < vps->getMaxLayers(); i++)
     {
-      if (m_apcLayerCfg[i]->getAuxId() > maxAuxId)
-      {
-        maxAuxId = m_apcLayerCfg[i]->getAuxId();
+      if (m_apcLayerCfg[i]->m_auxId > maxAuxId)
+      {
+        maxAuxId = m_apcLayerCfg[i]->m_auxId;
       }
     }
@@ -1106,5 +1105,5 @@
     for(i = 1; i < vps->getMaxLayers(); i++)
     {
-      vps->setDimensionId(i, auxId, m_apcLayerCfg[i]->getAuxId());
+      vps->setDimensionId(i, auxId, m_apcLayerCfg[i]->m_auxId);
     }
   }
@@ -1481,11 +1480,11 @@
     if( m_isField )
     {
-      pcPicYuvOrg[layer]->create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeightOrg(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
-      acPicYuvTrueOrg[layer].create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeightOrg(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
+      pcPicYuvOrg[layer]->create( m_apcLayerCfg[layer]->m_iSourceWidth, m_apcLayerCfg[layer]->m_iSourceHeightOrg, m_apcLayerCfg[layer]->m_chromaFormatIDC, m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
+      acPicYuvTrueOrg[layer].create( m_apcLayerCfg[layer]->m_iSourceWidth, m_apcLayerCfg[layer]->m_iSourceHeightOrg, m_apcLayerCfg[layer]->m_chromaFormatIDC, m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
     }
     else
     {
-      pcPicYuvOrg[layer]->create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeight(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
-      acPicYuvTrueOrg[layer].create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeight(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
+      pcPicYuvOrg[layer]->create( m_apcLayerCfg[layer]->m_iSourceWidth, m_apcLayerCfg[layer]->m_iSourceHeight, m_apcLayerCfg[layer]->m_chromaFormatIDC, m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
+      acPicYuvTrueOrg[layer].create( m_apcLayerCfg[layer]->m_iSourceWidth, m_apcLayerCfg[layer]->m_iSourceHeight, m_apcLayerCfg[layer]->m_chromaFormatIDC, m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
     }
   }
@@ -1505,8 +1504,8 @@
 
         // read input YUV file
-        m_apcTVideoIOYuvInputFile[layer]->read( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer], ipCSC, m_apcLayerCfg[layer]->getPad(), m_apcLayerCfg[layer]->getInputChromaFormat(), m_bClipInputVideoToRec709Range );
+        m_apcTVideoIOYuvInputFile[layer]->read( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer], ipCSC, m_apcLayerCfg[layer]->m_aiPad, m_apcLayerCfg[layer]->m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range );
 
 #if AUXILIARY_PICTURES
-        if( m_apcLayerCfg[layer]->getChromaFormatIDC() == CHROMA_400 || (m_apcTEncTop[0]->getVPS()->getScalabilityMask(AUX_ID) && (m_apcLayerCfg[layer]->getAuxId() == AUX_ALPHA || m_apcLayerCfg[layer]->getAuxId() == AUX_DEPTH)) )
+        if( m_apcLayerCfg[layer]->m_chromaFormatIDC == CHROMA_400 || (m_apcTEncTop[0]->getVPS()->getScalabilityMask(AUX_ID) && (m_apcLayerCfg[layer]->m_auxId == AUX_ALPHA || m_apcLayerCfg[layer]->m_auxId == AUX_DEPTH)) )
         {
           pcPicYuvOrg[layer]->convertToMonochrome(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
@@ -1701,8 +1700,8 @@
   for(layer = 0; layer < m_numLayers; layer++)
   {
-    m_apcTEncTop[layer]->getAnalyzeAll()->setFrmRate( m_apcLayerCfg[layer]->getFrameRate() * rateMultiplier );
-    m_apcTEncTop[layer]->getAnalyzeI()->setFrmRate( m_apcLayerCfg[layer]->getFrameRate() * rateMultiplier );
-    m_apcTEncTop[layer]->getAnalyzeP()->setFrmRate( m_apcLayerCfg[layer]->getFrameRate() * rateMultiplier );
-    m_apcTEncTop[layer]->getAnalyzeB()->setFrmRate( m_apcLayerCfg[layer]->getFrameRate() * rateMultiplier );
+    m_apcTEncTop[layer]->getAnalyzeAll()->setFrmRate( m_apcLayerCfg[layer]->m_iFrameRate * rateMultiplier );
+    m_apcTEncTop[layer]->getAnalyzeI()->setFrmRate( m_apcLayerCfg[layer]->m_iFrameRate * rateMultiplier );
+    m_apcTEncTop[layer]->getAnalyzeP()->setFrmRate( m_apcLayerCfg[layer]->m_iFrameRate * rateMultiplier );
+    m_apcTEncTop[layer]->getAnalyzeB()->setFrmRate( m_apcLayerCfg[layer]->m_iFrameRate * rateMultiplier );
   }
 
@@ -1712,5 +1711,5 @@
   {
     const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]);    
-    m_apcTEncTop[layer]->getAnalyzeAll()->printOut('a', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
+    m_apcTEncTop[layer]->getAnalyzeAll()->printOut('a', m_apcLayerCfg[layer]->m_chromaFormatIDC, printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
   }
 
@@ -1719,5 +1718,5 @@
   {
     const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
-    m_apcTEncTop[layer]->getAnalyzeI()->printOut('i', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
+    m_apcTEncTop[layer]->getAnalyzeI()->printOut('i', m_apcLayerCfg[layer]->m_chromaFormatIDC, printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
   }
 
@@ -1726,5 +1725,5 @@
   {
     const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
-    m_apcTEncTop[layer]->getAnalyzeP()->printOut('p', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
+    m_apcTEncTop[layer]->getAnalyzeP()->printOut('p', m_apcLayerCfg[layer]->m_chromaFormatIDC, printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
   }
 
@@ -1733,5 +1732,5 @@
   {
     const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
-    m_apcTEncTop[layer]->getAnalyzeB()->printOut('b', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
+    m_apcTEncTop[layer]->getAnalyzeB()->printOut('b', m_apcLayerCfg[layer]->m_chromaFormatIDC, printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
   }
 
@@ -1742,5 +1741,5 @@
       const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
 
-      m_apcTEncTop[layer]->getAnalyzeAll()->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryOutFilename());
+      m_apcTEncTop[layer]->getAnalyzeAll()->printSummary(m_apcLayerCfg[layer]->m_chromaFormatIDC, printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryOutFilename());
     }
   }
@@ -1752,7 +1751,7 @@
       const BitDepths bitDepths(m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_LUMA], m_apcLayerCfg[layer]->m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
 
-      m_apcTEncTop[layer]->getAnalyzeI()->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"I.txt");
-      m_apcTEncTop[layer]->getAnalyzeP()->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"P.txt");
-      m_apcTEncTop[layer]->getAnalyzeB()->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"B.txt");
+      m_apcTEncTop[layer]->getAnalyzeI()->printSummary(m_apcLayerCfg[layer]->m_chromaFormatIDC, printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"I.txt");
+      m_apcTEncTop[layer]->getAnalyzeP()->printSummary(m_apcLayerCfg[layer]->m_chromaFormatIDC, printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"P.txt");
+      m_apcTEncTop[layer]->getAnalyzeB()->printSummary(m_apcLayerCfg[layer]->m_chromaFormatIDC, printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryPicFilenameBase()+"B.txt");
     }
   }
@@ -1766,14 +1765,14 @@
 
       //-- interlaced summary
-      analyze->setFrmRate( m_apcLayerCfg[layer]->getFrameRate());
+      analyze->setFrmRate( m_apcLayerCfg[layer]->m_iFrameRate);
       analyze->setBits(m_apcTEncTop[layer]->getAnalyzeB()->getBits());
       // prior to the above statement, the interlace analyser does not contain the correct total number of bits.
 
       printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" );
-      analyze->printOut('a', m_apcLayerCfg[layer]->getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
+      analyze->printOut('a', m_apcLayerCfg[layer]->m_chromaFormatIDC, printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
 
       if (!m_apcTEncTop[layer]->getSummaryOutFilename().empty())
       {
-        analyze->printSummary(m_apcLayerCfg[layer]->getChromaFormatIDC(), printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryOutFilename());
+        analyze->printSummary(m_apcLayerCfg[layer]->m_chromaFormatIDC, printSequenceMSE, bitDepths, m_apcTEncTop[layer]->getSummaryOutFilename());
       }
     }
@@ -1928,5 +1927,5 @@
     rpcPicYuvRec = new TComPicYuv;
 
-    rpcPicYuvRec->create( m_apcLayerCfg[layer]->getSourceWidth(), m_apcLayerCfg[layer]->getSourceHeight(), m_apcLayerCfg[layer]->getChromaFormatIDC(), m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
+    rpcPicYuvRec->create( m_apcLayerCfg[layer]->m_iSourceWidth, m_apcLayerCfg[layer]->m_iSourceHeight, m_apcLayerCfg[layer]->m_chromaFormatIDC, m_apcLayerCfg[layer]->m_uiMaxCUWidth, m_apcLayerCfg[layer]->m_uiMaxCUHeight, m_apcLayerCfg[layer]->m_uiMaxTotalCUDepth, true, NULL );
   }
   m_acListPicYuvRec[layer].pushBack( rpcPicYuvRec );
@@ -1952,5 +1951,5 @@
 Void TAppEncTop::xWriteRecon(UInt layer, Int iNumEncoded)
 {
-  ChromaFormat chromaFormatIdc = m_apcLayerCfg[layer]->getChromaFormatIDC();
+  ChromaFormat& chromaFormatIdc = m_apcLayerCfg[layer]->m_chromaFormatIDC;
   Int xScal = TComSPS::getWinUnitX( chromaFormatIdc );
   Int yScal = TComSPS::getWinUnitY( chromaFormatIdc );
@@ -2189,5 +2188,5 @@
 {
 #if SVC_EXTENSION
-  Double time = (Double) m_iFrameRcvd / m_apcLayerCfg[m_numLayers-1]->getFrameRate();
+  Double time = (Double) m_iFrameRcvd / m_apcLayerCfg[m_numLayers-1]->m_iFrameRate;
 #else
   Double time = (Double) m_iFrameRcvd / m_iFrameRate;
