Index: branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 636)
@@ -84,5 +84,5 @@
 
 #if KWU_RC_MADPRED_E0227
-  m_uiDepthMADPred = 0;
+  m_DepthMADPred = 0;
 #endif
 }
@@ -600,21 +600,21 @@
 
 #if KWU_RC_VIEWRC_E0227
-  ("ViewWiseTargetBits, -vtbr" ,  m_pchViewTargetBits,  std::vector<Int>(1, 32), "View-wise target bit-rate setting")
-  ("TargetBitAssign, -ta", m_bViewWiseRateCtrl, false, "View-wise rate control on/off")
+  ("ViewWiseTargetBits, -vtbr" ,  m_ViewTargetBits,  std::vector<Int>(1, 32), "View-wise target bit-rate setting")
+  ("TargetBitAssign, -ta", m_ViewWiseRateCtrl, false, "View-wise rate control on/off")
 #endif
 #if KWU_RC_MADPRED_E0227
-  ("DepthMADPred, -dm", m_uiDepthMADPred, (UInt)0, "Depth based MAD prediction on/off")
-#endif
-#else
-  ("RateControl,-rc", m_enableRateCtrl, false, "Rate control on/off")
+  ("DepthMADPred, -dm", m_DepthMADPred, (UInt)0, "Depth based MAD prediction on/off")
+#endif
+#else
+  ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off")
   ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate")
   ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit")
 
 #if KWU_RC_VIEWRC_E0227
-  ("ViewWiseTargetBits, -vtbr" ,  m_pchViewTargetBits,  std::vector<Int>(1, 32), "View-wise target bit-rate setting")
-  ("TargetBitAssign, -ta", m_bViewWiseRateCtrl, false, "View-wise rate control on/off")
+  ("ViewWiseTargetBits, -vtbr" ,  m_ViewTargetBits,  std::vector<Int>(1, 32), "View-wise target bit-rate setting")
+  ("TargetBitAssign, -ta", m_ViewWiseRateCtrl, false, "View-wise rate control on/off")
 #endif
 #if KWU_RC_MADPRED_E0227
-  ("DepthMADPred, -dm", m_uiDepthMADPred, (UInt)0, "Depth based MAD prediction on/off")
+  ("DepthMADPred, -dm", m_DepthMADPred, (UInt)0, "Depth based MAD prediction on/off")
 #endif
 #endif
@@ -2179,5 +2179,7 @@
     xConfirmPara( (numLCUInPic % m_numLCUInUnit) != 0, "total number of LCUs in a frame should be completely divided by NumLCUInUnit" );
 
-    //m_iMaxDeltaQP       = MAX_DELTA_QP;
+#if !(KWU_RC_MADPRED_E0227 || KWU_RC_VIEWRC_E0227)
+    m_iMaxDeltaQP       = MAX_DELTA_QP;
+#endif
     m_iMaxCuDQPDepth    = MAX_CUDQP_DEPTH;
   }
@@ -2323,14 +2325,14 @@
 
 #if KWU_RC_MADPRED_E0227
-    printf("Depth based MAD prediction   : %d\n", m_uiDepthMADPred);
+    printf("Depth based MAD prediction   : %d\n", m_DepthMADPred);
 #endif
 #if KWU_RC_VIEWRC_E0227
-    printf("View-wise Rate control       : %d\n", m_bViewWiseRateCtrl);
-    if(m_bViewWiseRateCtrl)
+    printf("View-wise Rate control       : %d\n", m_ViewWiseRateCtrl);
+    if(m_ViewWiseRateCtrl)
     {
 
       printf("ViewWiseTargetBits           : ");
       for (int i = 0 ; i < m_iNumberOfViews ; i++)
-        printf("%d ", m_pchViewTargetBits[i]);
+        printf("%d ", m_ViewTargetBits[i]);
       printf("\n");
     }
@@ -2349,14 +2351,14 @@
 
 #if KWU_RC_MADPRED_E0227
-    printf("Depth based MAD prediction   : %d\n", m_uiDepthMADPred);
+    printf("Depth based MAD prediction   : %d\n", m_DepthMADPred);
 #endif
 #if KWU_RC_VIEWRC_E0227
-    printf("View-wise Rate control       : %d\n", m_bViewWiseRateCtrl);
-    if(m_bViewWiseRateCtrl)
+    printf("View-wise Rate control       : %d\n", m_ViewWiseRateCtrl);
+    if(m_ViewWiseRateCtrl)
     {
 
       printf("ViewWiseTargetBits           : ");
       for (int i = 0 ; i < m_iNumberOfViews ; i++)
-        printf("%d ", m_pchViewTargetBits[i]);
+        printf("%d ", m_ViewTargetBits[i]);
       printf("\n");
     }
Index: branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.h	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncCfg.h	(revision 636)
@@ -369,9 +369,9 @@
 
 #if KWU_RC_VIEWRC_E0227
-  vector<Int>     m_pchViewTargetBits;
-  bool      m_bViewWiseRateCtrl;                              ///< Flag for using view-wise rate control
+  vector<Int>     m_ViewTargetBits;
+  bool      m_ViewWiseRateCtrl;                              ///< Flag for using view-wise rate control
 #endif
 #if KWU_RC_MADPRED_E0227
-  UInt       m_uiDepthMADPred;
+  UInt       m_DepthMADPred;
 #endif
 #else
@@ -381,9 +381,9 @@
 
 #if KWU_RC_VIEWRC_E0227
-  vector<Int>     m_pchViewTargetBits;
-  bool      m_bViewWiseRateCtrl;                              ///< Flag for using view-wise rate control
+  vector<Int>     m_ViewTargetBits;
+  bool      m_ViewWiseRateCtrl;                              ///< Flag for using view-wise rate control
 #endif
 #if KWU_RC_MADPRED_E0227
-  UInt       m_uiDepthMADPred;
+  UInt       m_DepthMADPred;
 #endif
 #endif
Index: branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncTop.cpp	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/App/TAppEncoder/TAppEncTop.cpp	(revision 636)
@@ -512,8 +512,16 @@
   m_cTEncTop.setSignHideFlag(m_signHideFlag);
 #if RATE_CONTROL_LAMBDA_DOMAIN
+#if KWU_RC_MADPRED_E0227
   if(!m_cTEncTop.getIsDepth())    //only for texture
+  {
     m_cTEncTop.setUseRateCtrl         ( m_RCEnableRateControl );
+  }
   else
+  {
     m_cTEncTop.setUseRateCtrl         ( 0 );
+  }
+#else
+  m_cTEncTop.setUseRateCtrl         ( m_RCEnableRateControl );
+#endif
 #if !KWU_RC_VIEWRC_E0227
   m_cTEncTop.setTargetBitrate       ( m_RCTargetBitrate );
@@ -528,8 +536,10 @@
   if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())
   {
-    m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_uiDepthMADPred       : 0);
+    m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_DepthMADPred       : 0);
 
     if(m_cTEncTop.getUseDepthMADPred())
+    {
       m_cTEncTop.setCamParam(&m_cCameraData);
+    }
   }
 #endif
@@ -537,20 +547,22 @@
   if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())
   {
-    m_cTEncTop.setUseViewWiseRateCtrl(m_bViewWiseRateCtrl);
+    m_cTEncTop.setUseViewWiseRateCtrl(m_ViewWiseRateCtrl);
 
     if(m_iNumberOfViews == 1)
     {
-      if(m_bViewWiseRateCtrl)
-      {
-        m_cTEncTop.setTargetBitrate(m_pchViewTargetBits[layerIdInVps>>1]);
+      if(m_ViewWiseRateCtrl)
+      {
+        m_cTEncTop.setTargetBitrate(m_ViewTargetBits[layerIdInVps>>1]);
       }
       else
+      {
         m_cTEncTop.setTargetBitrate       ( m_RCTargetBitrate );
+      }
     }
     else
     {
-      if(m_bViewWiseRateCtrl)
-      {
-        m_cTEncTop.setTargetBitrate(m_pchViewTargetBits[layerIdInVps>>1]);
+      if(m_ViewWiseRateCtrl)
+      {
+        m_cTEncTop.setTargetBitrate(m_ViewTargetBits[layerIdInVps>>1]);
       }
       else
@@ -559,24 +571,37 @@
         {
           if(m_cTEncTop.getViewId() == 0)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*80)/100 );
+          }
           else if(m_cTEncTop.getViewId() == 1)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*20)/100 );
+          }
         }
         else if(m_iNumberOfViews == 3)
         {
           if(m_cTEncTop.getViewId() == 0)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*66)/100 );
+          }
           else if(m_cTEncTop.getViewId() == 1)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*17)/100 );
+          }
           else if(m_cTEncTop.getViewId() == 2)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*17)/100 );
+          }
         }
         else
+        {
           m_cTEncTop.setTargetBitrate              ( m_RCTargetBitrate );
-      }
-    }
-  }
-#endif
-#else
+        }
+      }
+    }
+  }
+#endif
+#else
+#if KWU_RC_MADPRED_E0227
   if(!m_cTEncTop.getIsDepth())    //only for texture
   {
@@ -588,13 +613,22 @@
   }
   else
+  {
     m_cTEncTop.setUseRateCtrl         ( 0 );
+  }
+#else
+  m_cTEncTop.setUseRateCtrl     ( m_enableRateCtrl);
+  m_cTEncTop.setTargetBitrate   ( m_targetBitrate);
+  m_cTEncTop.setNumLCUInUnit    ( m_numLCUInUnit);
+#endif
   
 #if KWU_RC_MADPRED_E0227
   if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())
   {
-    m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_uiDepthMADPred       : 0);
+    m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_DepthMADPred       : 0);
 
     if(m_cTEncTop.getUseDepthMADPred())
+    {
       m_cTEncTop.setCamParam(&m_cCameraData);
+    }
   }
 #endif
@@ -603,19 +637,21 @@
   if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())
   {
-    m_cTEncTop.setUseViewWiseRateCtrl(m_bViewWiseRateCtrl);
+    m_cTEncTop.setUseViewWiseRateCtrl(m_ViewWiseRateCtrl);
     if(m_iNumberOfViews == 1)
     {
-      if(m_bViewWiseRateCtrl)
-      {
-        m_cTEncTop.setTargetBitrate(m_pchViewTargetBits[layerIdInVps>>1]);
+      if(m_ViewWiseRateCtrl)
+      {
+        m_cTEncTop.setTargetBitrate(m_ViewTargetBits[layerIdInVps>>1]);
       }
       else
+      {
         m_cTEncTop.setTargetBitrate       ( m_targetBitrate );
+      }
     }
     else
     {
-      if(m_bViewWiseRateCtrl)
-      {
-        m_cTEncTop.setTargetBitrate(m_pchViewTargetBits[layerIdInVps>>1]);
+      if(m_ViewWiseRateCtrl)
+      {
+        m_cTEncTop.setTargetBitrate(m_ViewTargetBits[layerIdInVps>>1]);
       }
       else
@@ -624,19 +660,31 @@
         {
           if(m_cTEncTop.getViewId() == 0)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_targetBitrate*80)/100 );
+          }
           else if(m_cTEncTop.getViewId() == 1)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_targetBitrate*20)/100 );
+          }
         }
         else if(m_iNumberOfViews == 3)
         {
           if(m_cTEncTop.getViewId() == 0)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_targetBitrate*66)/100 );
+          }
           else if(m_cTEncTop.getViewId() == 1)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_targetBitrate*17)/100 );
+          }
           else if(m_cTEncTop.getViewId() == 2)
+          {
             m_cTEncTop.setTargetBitrate              ( (m_targetBitrate*17)/100 );
+          }
         }
         else
+        {
           m_cTEncTop.setTargetBitrate              ( m_targetBitrate );
+        }
       }
     }
Index: branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.cpp
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.cpp	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.cpp	(revision 636)
@@ -1530,5 +1530,5 @@
 #if KWU_RC_MADPRED_E0227
 Void
-  TAppComCamPara::RCGetZNearZFar( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar )
+  TAppComCamPara::getZNearZFar( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar )
 {
   UInt uiFoundLine = -1;
@@ -1547,5 +1547,5 @@
 
 Void
-  TAppComCamPara::RCGetGeometryData( Int iView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated )
+  TAppComCamPara::getGeometryData( Int iView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated )
 {
   UInt uiFoundLine = -1;
Index: branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.h
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.h	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.h	(revision 636)
@@ -222,6 +222,6 @@
 
 #if KWU_RC_MADPRED_E0227
-  Void  RCGetZNearZFar             ( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar );
-  Void  RCGetGeometryData          ( Int dView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated );
+  Void  getZNearZFar             ( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar );
+  Void  getGeometryData          ( Int dView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated );
 #endif
 };
Index: branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TypeDef.h	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/Lib/TLibCommon/TypeDef.h	(revision 636)
@@ -310,6 +310,6 @@
 #define RATE_CONTROL_INTRA                          1  ///< JCTVC-M0257, rate control for intra 
 #endif
-#define KWU_RC_VIEWRC_E0227                         0  ///< JCT3V-E0227, view-wise target bitrate allocation
-#define KWU_RC_MADPRED_E0227                        0  ///< JCT3V-E0227, inter-view MAD prediction
+#define KWU_RC_VIEWRC_E0227                         1  ///< JCT3V-E0227, view-wise target bitrate allocation
+#define KWU_RC_MADPRED_E0227                        1  ///< JCT3V-E0227, inter-view MAD prediction
 
 #define MAX_CPB_CNT                     32  ///< Upper bound of (cpb_cnt_minus1 + 1)
Index: branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.cpp	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncCu.cpp	(revision 636)
@@ -242,10 +242,17 @@
   
   m_bUseSBACRD        = pcEncTop->getUseSBACRD();
+
+#if KWU_RC_MADPRED_E0227
   if(!pcEncTop->getIsDepth())
+  {
     m_pcRateCtrl        = pcEncTop->getRateCtrl();
+  }
   else
   {
     m_pcRateCtrl = NULL;
   }
+#else
+  m_pcRateCtrl        = pcEncTop->getRateCtrl();
+#endif
 }
 
@@ -2124,6 +2131,5 @@
 #endif
 
-#if RATE_CONTROL_LAMBDA_DOMAIN  && !M0036_RC_IMPROVEMENT
-#if KWU_RC_MADPRED_E0227
+#if RATE_CONTROL_LAMBDA_DOMAIN  && (!M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227)
   if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth )
   {
@@ -2133,5 +2139,4 @@
     m_temporalSAD = (Int)SAD;
   }
-#endif
 #endif
 #if !RATE_CONTROL_LAMBDA_DOMAIN  && KWU_RC_MADPRED_E0227
@@ -2268,6 +2273,5 @@
   rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
   
-#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
-#if KWU_RC_MADPRED_E0227
+#if RATE_CONTROL_LAMBDA_DOMAIN && (!M0036_RC_IMPROVEMENT || KWU_RC_MADPRED_E0227)
   UChar uhDepth = rpcTempCU->getDepth( 0 );
   if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && eSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth )
@@ -2278,5 +2282,4 @@
     m_spatialSAD = (Int)SAD;
   }
-#endif
 #endif
 #if !RATE_CONTROL_LAMBDA_DOMAIN && KWU_RC_MADPRED_E0227
Index: branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 636)
@@ -984,6 +984,7 @@
 #if KWU_RC_MADPRED_E0227
       if(m_pcCfg->getLayerId() != 0)
+      {
         m_pcRateCtrl->getRCPic()->setIVPic( m_pcEncTop->getEncTop()->getTEncTop(0)->getRateCtrl()->getRCPic() );
-      //getEncTop()->getEncTop();//->getTEncTop(0);//->getUseRateCtrl()->getRCPic();
+      }
 #endif
 
@@ -1037,5 +1038,4 @@
           list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList();
           lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambdaIV( listPreviousPicture, pcSlice->getPOC() );
-          //printf("lambda : %lf\n", lambda);
           sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture );
         }
Index: branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncRateCtrl.cpp
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncRateCtrl.cpp	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncRateCtrl.cpp	(revision 636)
@@ -726,4 +726,5 @@
   m_lastPicture = NULL;
   list<TEncRCPic*>::reverse_iterator it;
+#if KWU_RC_MADPRED_E0227
   for ( it = listPreviousPictures.rbegin(); it != listPreviousPictures.rend(); it++ )
   {
@@ -734,4 +735,5 @@
     }
   }
+#endif
 #endif
 
@@ -1092,5 +1094,5 @@
   {
     Pel*  pOrg    = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);
-    Pel*  pRec    = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvPred()->getLumaAddr(pcCU->getAddr(), 0);
+    Pel*  pRec    = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0);
     Pel*  pDep    = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);
     Int   iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride();
@@ -1121,5 +1123,7 @@
     pcCU->getPosInPic(0, PosX, PosY);
     if((PosX + *iDisparity) < 0 || (PosX + *iDisparity + iWidth) >= pcCU->getSlice()->getSPS()->getMaxCUWidth())
+    {
       Disp = 0;
+    }
 
     for( y = 0; y < iHeight; y++ )
@@ -1138,5 +1142,7 @@
     m_LCUs[ LCUIdx ].m_IVMAD = IVMAD;
     if(m_lastPicture)
+    {
       m_LCUs[ LCUIdx ].m_MAD = m_lastPicture->getLCU(LCUIdx).m_MAD;
+    }
 
     MAD = m_LCUs[ LCUIdx ].m_IVMAD;
@@ -2076,6 +2082,11 @@
   m_sourceHeightInLCU        = (sourceHeight / maxCUHeight) + (( sourceHeight %  maxCUHeight) ? 1 : 0);  
   m_isLowdelay               = (sizeIntraPeriod == -1) ? true : false;
+#if KWU_RC_MADPRED_E0227
   m_prevBitrate              = ( targetKbps * 1000 );  // in units of 1,024 bps
   m_currBitrate              = ( targetKbps * 1000 );
+#else
+  m_prevBitrate              = ( targetKbps << 10 );  // in units of 1,024 bps
+  m_currBitrate              = ( targetKbps << 10 );
+#endif
   m_frameRate                = frameRate;
   m_refFrameNum              = m_isLowdelay ? (sizeGOP) : (sizeGOP>>1);
@@ -2453,5 +2464,5 @@
 
   Pel*  pOrg   = pcCU->getPic()->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);
-  Pel*  pRec   = pcCU->getPic()->getPicYuvPred()->getLumaAddr(pcCU->getAddr(), 0);
+  Pel*  pRec   = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0);
   Int   stride = pcCU->getPic()->getStride();
 
@@ -2483,5 +2494,5 @@
 
   Pel*  pOrg    = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);
-  Pel*  pRec    = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvPred()->getLumaAddr(pcCU->getAddr(), 0);
+  Pel*  pRec    = pcCU->getSlice()->getIvPic(false, 0)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), 0);
   Pel*  pDep    = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);
   Int   iStride = pcCU->getSlice()->getIvPic(true, pcCU->getSlice()->getViewIndex())->getPicYuvOrg()->getStride();
Index: branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 635)
+++ branches/HTM-8.2-dev0-KWU/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 636)
@@ -157,8 +157,16 @@
   m_pdRdPicQp         = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 );
   m_piRdPicQp         = (Int*   )xMalloc( Int,    m_pcCfg->getDeltaQpRD() * 2 + 1 );
+#if KWU_RC_MADPRED_E0227
   if(m_pcCfg->getUseRateCtrl())
+  {
     m_pcRateCtrl        = pcEncTop->getRateCtrl();
+  }
   else
+  {
     m_pcRateCtrl        = NULL;
+  }
+#else
+  m_pcRateCtrl        = pcEncTop->getRateCtrl();
+#endif
 }
 
@@ -1136,7 +1144,7 @@
         Int Direction = pcSlice->getViewId() - pcCU->getSlice()->getIvPic(false, 0)->getViewId();
 
-        pcEncTop->getCamParam()->RCGetZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf);
-        pcEncTop->getCamParam()->RCGetGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated);
-        pcEncTop->getCamParam()->RCGetGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated);
+        pcEncTop->getCamParam()->getZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf);
+        pcEncTop->getCamParam()->getGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated);
+        pcEncTop->getCamParam()->getGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated);
 
         m_pcRateCtrl->updateLCUDataEnhancedView(pcCU, pcCU->getTotalBits(), pcCU->getQP(0), BasePos, Position, FocalLength, Zn, Zf, (Direction > 0 ? 1 : -1));
@@ -1250,7 +1258,7 @@
             Int iDisparity;
 
-            pcEncTop->getCamParam()->RCGetZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf);
-            pcEncTop->getCamParam()->RCGetGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated);
-            pcEncTop->getCamParam()->RCGetGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated);
+            pcEncTop->getCamParam()->getZNearZFar(pcSlice->getViewId(), pcSlice->getPOC(), Zn, Zf);
+            pcEncTop->getCamParam()->getGeometryData(0, pcSlice->getPOC(), FocalLength, BasePos, CamShift, bInterpolated);
+            pcEncTop->getCamParam()->getGeometryData(pcSlice->getViewId(), pcSlice->getPOC(), FocalLength, Position, CamShift, bInterpolated);
             bpp       = m_pcRateCtrl->getRCPic()->getLCUTargetBppforInterView( m_pcRateCtrl->getPicList(), pcCU,
                             BasePos, Position, FocalLength, Zn, Zf, (Direction > 0 ? 1 : -1), &iDisparity );
