Index: /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibCommon/ContextTables.h	(revision 405)
+++ /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibCommon/ContextTables.h	(revision 406)
@@ -138,8 +138,12 @@
 #define SDC_NUM_SIGN_FLAG_CTX            1
 #endif
+#if LGE_CONCATENATE
+#define SDC_NUM_RESIDUAL_CTX             1
+#else
 #if RWTH_SDC_CTX_SIMPL_D0032
 #define SDC_NUM_RESIDUAL_CTX             8
 #else
 #define SDC_NUM_RESIDUAL_CTX             10
+#endif
 #endif
 
@@ -576,7 +580,21 @@
   }
 };
-
+    
+#if LGE_CONCATENATE
 static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] =
 {
+    {
+         155
+    },
+    {
+         155
+    },
+    {
+        155
+    }
+};
+#else
+static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] =
+{
   {
     CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU
@@ -589,4 +607,5 @@
   }
 };
+#endif
 
 static const UChar INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX] =
Index: /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibCommon/TypeDef.h	(revision 405)
+++ /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibCommon/TypeDef.h	(revision 406)
@@ -74,4 +74,5 @@
 #define INTEL_SDC64_D0193                 1   // JCT3V-D0193: SDC binary clean up (use a 1 bit binary code to signal sdc_pred_mode when CU size is 64x64)
 #define RWTH_SDC_CTX_SIMPL_D0032          1   // JCT3V-D0032: CABAC Context Reduction for Simplified Depth Coding
+#define LGE_CONCATENATE                 1 // JCT3V-D0141: concatenate binarization for residual index coding
 #endif
 #define FIX_SDC_ENC_RD_WVSO_D0163         1   // JCT3V-D0163: fix for SDC encoder rd-cost (VSO -> WVSO)
Index: /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 405)
+++ /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 406)
@@ -41,4 +41,8 @@
 #define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
 #define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
+#if LGE_CONCATENATE
+#define PrefixThreshold ( ((GetNumDepthValues() * 3) >> 2) )
+#define BitsPerSuffix ( (UInt)ceil( Log2(GetNumDepthValues() - PrefixThreshold) ) )
+#endif
 #endif
 
@@ -2673,4 +2677,28 @@
     
     // decode residual magnitude
+#if LGE_CONCATENATE
+    //prefix part
+    UInt uiCount = 0;
+    for ( UInt ui = 0; ui < PrefixThreshold; ui++)
+    {
+        m_pcTDecBinIf->decodeBin( uiBit, m_cSDCResidualSCModel.get(0, 0, 0) );
+        if ( uiBit == 0 )
+            break;
+        else
+            uiCount++;
+    }
+    //suffix part
+    if ( uiCount == PrefixThreshold )
+    {
+        for ( UInt ui = 0; ui < BitsPerSuffix; ui++ )
+        {
+            m_pcTDecBinIf->decodeBinEP( uiBit );
+            uiAbsIdx |= uiBit << ui;
+        }
+        uiAbsIdx += uiCount;
+    }
+    else
+        uiAbsIdx = uiCount;
+#else
     for (Int i=0; i<uiMaxResidualBits; i++)
     {
@@ -2682,4 +2710,5 @@
       uiAbsIdx |= uiBit << i;
     }
+#endif
     
     uiAbsIdx += 1;
Index: /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 405)
+++ /branches/HTM-6.2-dev3-LG-2/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 406)
@@ -45,4 +45,8 @@
 #define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
 #define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
+#if LGE_CONCATENATE
+#define PrefixThreshold ( ((GetNumDepthValues() * 3) >> 2) )
+#define BitsPerSuffix ( (UInt)ceil( Log2(GetNumDepthValues() - PrefixThreshold) ) )
+#endif
 #endif
 
@@ -2649,5 +2653,7 @@
   UInt uiSign     = segmentDCOffset < 0 ? 1 : 0;
   UInt uiAbsIdx   = abs(segmentDCOffset);
+#if !LGE_CONCATENATE
   UInt uiBit = 0;
+#endif
   
   UInt uiMaxResidualBits  = GetBitsPerDepthValue();
@@ -2674,4 +2680,34 @@
     // encode residual magnitude
     uiAbsIdx -= 1;
+#if LGE_CONCATENATE
+    //prefix part
+    if ( uiAbsIdx == 0 )
+        m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
+    else
+    {
+        UInt l = uiAbsIdx;
+        UInt k = 0;
+        while ( l > 0 && k < PrefixThreshold )
+        {
+            m_pcBinIf->encodeBin( 1, m_cSDCResidualSCModel.get(0, 0, 0) );
+            l--;
+            k++;
+        }
+        if ( uiAbsIdx < PrefixThreshold )
+            m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
+        //suffix part
+        else
+        {
+            uiAbsIdx -= PrefixThreshold;
+            UInt uiSuffixLength = BitsPerSuffix;
+            UInt uiBitInfo = 0;
+            for ( Int i = 0; i < uiSuffixLength; i++)
+            {
+                uiBitInfo = ( uiAbsIdx & ( 1 << i ) ) >> i;
+                m_pcBinIf->encodeBinEP( uiBitInfo);
+            }
+        }
+    }
+#else
     for (Int i=0; i<uiMaxResidualBits; i++)
     {
@@ -2684,4 +2720,5 @@
 #endif
     }
+#endif
     
   }
