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 );
+        }
       }
     }
