Index: Lib/TLibCommon/TComRom.cpp
===================================================================
--- Lib/TLibCommon/TComRom.cpp	(revision 2427)
+++ Lib/TLibCommon/TComRom.cpp	(working copy)
@@ -494,6 +494,7 @@
 };
 #endif
 
+#if !FIX_COEF_REMAIN_BINARNIZATION
 // Rice parameters for absolute transform levels
 const UInt g_auiGoRiceRange[5] =
 {
@@ -504,6 +505,7 @@
 {
   8, 7, 6, 5, 4
 };
+#endif
 
 #if !SIMPLE_PARAM_UPDATE
 const UInt g_aauiGoRiceUpdate[5][24] =
Index: Lib/TLibCommon/TComRom.h
===================================================================
--- Lib/TLibCommon/TComRom.h	(revision 2427)
+++ Lib/TLibCommon/TComRom.h	(working copy)
@@ -137,8 +137,10 @@
 extern const UInt   g_uiLastCtx[ 28 ];
 #endif
 
+#if !FIX_COEF_REMAIN_BINARNIZATION
 extern const UInt   g_auiGoRiceRange[5];                  //!< maximum value coded with Rice codes
 extern const UInt   g_auiGoRicePrefixLen[5];              //!< prefix length for each maximum value
+#endif
 #if !SIMPLE_PARAM_UPDATE
 extern const UInt   g_aauiGoRiceUpdate[5][24];            //!< parameter update rules for Rice codes
 #endif
Index: Lib/TLibCommon/TComTrQuant.cpp
===================================================================
--- Lib/TLibCommon/TComTrQuant.cpp	(revision 2427)
+++ Lib/TLibCommon/TComTrQuant.cpp	(working copy)
@@ -2623,6 +2623,25 @@
 
   if ( uiAbsLevel >= baseLevel )
   {
+#if FIX_COEF_REMAIN_BINARNIZATION
+    UInt symbol     = uiAbsLevel - baseLevel;
+    UInt length;
+    if (symbol < (8 << ui16AbsGoRice))
+    {
+      length = symbol>>ui16AbsGoRice;
+      iRate += (length+1+ui16AbsGoRice)<< 15;
+    }
+    else
+    {
+      length = ui16AbsGoRice;
+      symbol  = symbol - ( 8 << ui16AbsGoRice);    
+      while (symbol >= (1<<length))
+      {
+        symbol -=  (1<<(length++));    
+      }
+      iRate += (8+length+1-ui16AbsGoRice+length)<< 15;
+    }
+#else
     UInt uiSymbol     = uiAbsLevel - baseLevel;
     UInt uiMaxVlc     = g_auiGoRiceRange[ ui16AbsGoRice ];
     Bool bExpGolomb   = ( uiSymbol > uiMaxVlc );
@@ -2639,6 +2658,7 @@
     UShort ui16NumBins = min<UInt>( ui16PrefLen, g_auiGoRicePrefixLen[ ui16AbsGoRice ] ) + ui16AbsGoRice;
 
     iRate += ui16NumBins << 15;
+#endif
 
     if (c1Idx < C1FLAG_NUMBER)
     {
Index: Lib/TLibCommon/TypeDef.h
===================================================================
--- Lib/TLibCommon/TypeDef.h	(revision 2427)
+++ Lib/TLibCommon/TypeDef.h	(working copy)
@@ -40,6 +40,7 @@
 
 //! \ingroup TLibCommon
 //! \{
+#define FIX_COEF_REMAIN_BINARNIZATION    1
 #define REMOVE_LASTTU_CBFDERIV           1  ///< I0152: CBF coding for last TU without derivation process 
 
 #define INTRAMODE_BYPASSGROUP            1  ///< I0302: group coding of Intra_NxN
Index: Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- Lib/TLibDecoder/TDecSbac.cpp	(revision 2427)
+++ Lib/TLibDecoder/TDecSbac.cpp	(working copy)
@@ -344,9 +344,13 @@
     m_pcTDecBinIf->decodeBinEP( codeWord );
   }
   while( codeWord);
+#if FIX_COEF_REMAIN_BINARNIZATION
+  prefix--;
+#else
   codeWord  = 1 - codeWord;
   prefix -= codeWord;
   codeWord=0;
+#endif
   if (prefix < 8 )
   {
     m_pcTDecBinIf->decodeBinsEP(codeWord,rParam);
