Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 408)
@@ -265,4 +265,5 @@
     xParseDblParam( aps );    
   }
+#if !LGE_SAO_MIGRATION_D0091
   READ_FLAG(uiCode, "aps_sao_interleaving_flag");      aps->setSaoInterleavingFlag( (uiCode==1)?true:false );
   if(!aps->getSaoInterleavingFlag())
@@ -275,4 +276,5 @@
   }
   }
+#endif
   READ_FLAG(uiCode, "aps_adaptive_loop_filter_flag");      aps->setAlfEnabled( (uiCode==1)?true:false );
   if(aps->getAlfEnabled())
@@ -307,4 +309,5 @@
   }
 }
+#if !LGE_SAO_MIGRATION_D0091
 /** parse SAO parameters
  * \param pSaoParam
@@ -532,5 +535,5 @@
   }
 }
-
+#endif
 
 Void TDecCavlc::xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS, Int firstLCUAddr, Bool acrossSlice, Int numLCUInWidth, Int numLCUInHeight)
@@ -1866,4 +1869,8 @@
       if (sps->getUseSAO())
       {
+#if LGE_SAO_MIGRATION_D0091
+        READ_FLAG(uiCode, "slice_sao_luma_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
+        READ_FLAG(uiCode, "slice_sao_chroma_flag");  rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode);
+#else
         READ_FLAG(uiCode, "slice_sao_interleaving_flag");        rpcSlice->setSaoInterleavingFlag(uiCode);
         READ_FLAG(uiCode, "slice_sample_adaptive_offset_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
@@ -1878,4 +1885,5 @@
           rpcSlice->setSaoEnabledFlagCr(0);
         }
+#endif
       }
       READ_UVLC (    uiCode, "aps_id" );  rpcSlice->setAPSId(uiCode);
Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 408)
@@ -177,7 +177,9 @@
 protected:
   Void  xParseDblParam       ( TComAPS* aps );
+#if !LGE_SAO_MIGRATION_D0091
   Void  xParseSaoParam       ( SAOParam* pSaoParam );
   Void  xParseSaoOffset      (SaoLcuParam* saoLcuParam);
   Void  xParseSaoUnit        (Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool& repeatedRow );
+#endif
   Void  xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS = true, Int firstLCUAddr = 0, Bool acrossSlice = true, Int numLCUInWidth= -1, Int numLCUInHeight= -1);
   Void  parseAlfParamSet(AlfParamSet* pAlfParamSet, Int firstLCUAddr, Bool alfAcrossSlice);
Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCu.cpp	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecCu.cpp	(revision 408)
@@ -371,5 +371,13 @@
     UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
 #if MERL_VSP_C0152
+#if LGE_VSP_INHERIT_D0092
+    Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM];
+    for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
+    {
+        iVSPIndexTrue[i] = 0;
+    }
+#else
     Int iVSPIndexTrue[3] = {-1, -1, -1};
+#endif
     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
     
@@ -383,4 +391,10 @@
     {
       Int iVSPIdx = 0;
+#if LGE_VSP_INHERIT_D0092
+      if (iVSPIndexTrue[uiMergeIndex] == 1)
+      {
+          iVSPIdx = 1;
+      }
+#else
       Int numVspIdx;
       numVspIdx = 3;
@@ -393,6 +407,7 @@
           }
       }
+#endif
       pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth );  //Initialize the VSP, may change later in get InterMergeCandidates()
-#if QC_BVSP_CleanUP_D0191
+#if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092
       if(iVSPIdx != 0)
       {
Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 408)
@@ -301,5 +301,13 @@
       UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
 #if MERL_VSP_C0152
+#if LGE_VSP_INHERIT_D0092
+      Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM];
+      for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
+      {
+          iVSPIndexTrue[i] = 0;
+      }
+#else
       Int iVSPIndexTrue[3] = {-1, -1, -1};
+#endif
       pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
 
@@ -326,4 +334,10 @@
       {
         Int iVSPIdx = 0;
+#if LGE_VSP_INHERIT_D0092
+        if (iVSPIndexTrue[uiMergeIndex] == 1)
+        {
+            iVSPIdx = 1;
+        }
+#else
         Int numVspIdx;
         numVspIdx = 3;
@@ -336,7 +350,8 @@
             }
         }
+#endif
         pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth );  //Initialize the VSP, may change later in get InterMergeCandidates()
-#if QC_BVSP_CleanUP_D0191
-       if(iVSPIdx != 0)
+#if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092
+       if(iVSPIdx != 0) 
        {
          Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0);
Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecEntropy.h	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecEntropy.h	(revision 408)
@@ -225,7 +225,9 @@
   Void setSliceGranularity (Int iSliceGranularity) {m_pcEntropyDecoderIf->setSliceGranularity(iSliceGranularity);}
 
+#if !LGE_SAO_MIGRATION_D0091
   Void decodeSaoParam         (SAOParam* saoParam);
   void decodeSaoLcu(Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool &repeatedRow );
   Void decodeSaoOneLcu(SaoLcuParam* saoLcuParam);
+#endif
 
   Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); }
Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecGop.cpp	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecGop.cpp	(revision 408)
@@ -372,4 +372,17 @@
     if( pcSlice->getSPS()->getUseSAO() )
     {
+#if LGE_SAO_MIGRATION_D0091
+        if(pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma())
+        {
+            SAOParam *saoParam = pcSlice->getAPS()->getSaoParam();
+            saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
+            saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma();
+            m_pcSAO->setSaoLcuBasedOptimization(1);
+            m_pcSAO->createPicSaoInfo(rpcPic, m_uiILSliceCount);
+            m_pcSAO->SAOProcess(rpcPic, saoParam);
+            m_pcSAO->PCMLFDisableProcess(rpcPic);
+            m_pcSAO->destroyPicSaoInfo();
+        }
+#else
       if(pcSlice->getSaoEnabledFlag())
       {
@@ -388,4 +401,5 @@
         m_pcSAO->destroyPicSaoInfo();
       }
+#endif
     }
 
Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 408)
@@ -88,4 +88,8 @@
 , m_cALFSvlcSCModel           ( 1,             1,               NUM_ALF_SVLC_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cCUAMPSCModel             ( 1,             1,               NUM_CU_AMP_CTX                , m_contextModels + m_numContextModels, m_numContextModels)
+#if LGE_SAO_MIGRATION_D0091
+, m_cSaoMergeSCModel          ( 1,             1,               NUM_SAO_MERGE_FLAG_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
+, m_cSaoTypeIdxSCModel        ( 1,             1,               NUM_SAO_TYPE_IDX_CTX          , m_contextModels + m_numContextModels, m_numContextModels)
+#else
 , m_cSaoFlagSCModel           ( 1,             1,               NUM_SAO_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSaoUvlcSCModel           ( 1,             1,               NUM_SAO_UVLC_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
@@ -94,4 +98,5 @@
 , m_cSaoMergeUpSCModel        ( 1,             1,               NUM_SAO_MERGE_UP_FLAG_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSaoTypeIdxSCModel        ( 1,             1,               NUM_SAO_TYPE_IDX_CTX          , m_contextModels + m_numContextModels, m_numContextModels)
+#endif
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
 , m_cDmmFlagSCModel           ( 1,             1,               NUM_DMM_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
@@ -184,4 +189,8 @@
   m_cALFUvlcSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_ALF_UVLC );
   m_cALFSvlcSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_ALF_SVLC );
+#if LGE_SAO_MIGRATION_D0091
+  m_cSaoMergeSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_SAO_MERGE_FLAG );
+  m_cSaoTypeIdxSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SAO_TYPE_IDX );
+#else
   m_cSaoFlagSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_SAO_FLAG );
   m_cSaoUvlcSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_SAO_UVLC );
@@ -190,4 +199,5 @@
   m_cSaoMergeUpSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SAO_MERGE_UP_FLAG );
   m_cSaoTypeIdxSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SAO_TYPE_IDX );
+#endif
 
   m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG );
@@ -271,4 +281,8 @@
   m_cALFUvlcSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_ALF_UVLC );
   m_cALFSvlcSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_ALF_SVLC );
+#if LGE_SAO_MIGRATION_D0091
+  m_cSaoMergeSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_FLAG );
+  m_cSaoTypeIdxSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX );
+#else
   m_cSaoFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_SAO_FLAG );
   m_cSaoUvlcSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_SAO_UVLC );
@@ -277,4 +291,5 @@
   m_cSaoMergeUpSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_UP_FLAG );
   m_cSaoTypeIdxSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX );
+#endif
   m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG );
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
@@ -1672,5 +1687,250 @@
 }
 
-
+#if LGE_SAO_MIGRATION_D0091
+Void TDecSbac::parseSaoMaxUvlc ( UInt& val, UInt maxSymbol )
+{
+    if (maxSymbol == 0)
+    {
+        val = 0;
+        return;
+    }
+
+    UInt code;
+    Int  i;
+    m_pcTDecBinIf->decodeBinEP( code );
+    if ( code == 0 )
+    {
+        val = 0;
+        return;
+    }
+
+    i=1;
+    while (1)
+    {
+        m_pcTDecBinIf->decodeBinEP( code );
+        if ( code == 0 )
+        {
+            break;
+        }
+        i++;
+        if (i == maxSymbol)
+        {
+            break;
+        }
+    }   
+
+    val = i;
+}
+
+Void TDecSbac::parseSaoUflc (UInt uiLength, UInt&  riVal)
+{
+    m_pcTDecBinIf->decodeBinsEP ( riVal, uiLength );
+}
+
+Void TDecSbac::parseSaoMerge (UInt&  ruiVal)
+{
+    UInt uiCode;
+    m_pcTDecBinIf->decodeBin( uiCode, m_cSaoMergeSCModel.get( 0, 0, 0 ) );
+    ruiVal = (Int)uiCode;
+}
+
+Void TDecSbac::parseSaoTypeIdx (UInt&  ruiVal)
+{
+    UInt uiCode;
+    m_pcTDecBinIf->decodeBin( uiCode, m_cSaoTypeIdxSCModel.get( 0, 0, 0 ) );
+    if (uiCode == 0) 
+    {
+        ruiVal = 0;
+    }
+    else
+    {
+        m_pcTDecBinIf->decodeBinEP( uiCode ); 
+        if (uiCode == 0)
+        {
+            ruiVal = 5;
+        }
+        else
+        {
+            ruiVal = 1;
+        }
+    }
+}
+
+inline Void copySaoOneLcuParam(SaoLcuParam* psDst,  SaoLcuParam* psSrc)
+{
+    Int i;
+    psDst->partIdx = psSrc->partIdx;
+    psDst->typeIdx = psSrc->typeIdx;
+    if (psDst->typeIdx != -1)
+    {
+        psDst->subTypeIdx = psSrc->subTypeIdx ;
+        psDst->length  = psSrc->length;
+        for (i=0;i<psDst->length;i++)
+        {
+            psDst->offset[i] = psSrc->offset[i];
+        }
+    }
+    else
+    {
+        psDst->length  = 0;
+        for (i=0;i<SAO_BO_LEN;i++)
+        {
+            psDst->offset[i] = 0;
+        }
+    }
+}
+
+Void TDecSbac::parseSaoOffset(SaoLcuParam* psSaoLcuParam, UInt compIdx)
+{
+    UInt uiSymbol;
+    static Int iTypeLength[MAX_NUM_SAO_TYPE] =
+    {
+        SAO_EO_LEN,
+        SAO_EO_LEN,
+        SAO_EO_LEN,
+        SAO_EO_LEN,
+        SAO_BO_LEN
+    }; 
+
+    if (compIdx==2)
+    {
+        uiSymbol = (UInt)( psSaoLcuParam->typeIdx + 1);
+    }
+    else
+    {
+        parseSaoTypeIdx(uiSymbol);
+    }
+    psSaoLcuParam->typeIdx = (Int)uiSymbol - 1;
+
+    if (uiSymbol)
+    {
+        psSaoLcuParam->length = iTypeLength[psSaoLcuParam->typeIdx];
+#if FULL_NBIT
+        Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + (g_uiBitDepth-8)-5),5) );
+#else
+        Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + g_uiBitIncrement-5),5) );
+#endif
+
+        if( psSaoLcuParam->typeIdx == SAO_BO )
+        {
+            for(Int i=0; i< psSaoLcuParam->length; i++)
+            {
+                parseSaoMaxUvlc(uiSymbol, offsetTh -1 );
+                psSaoLcuParam->offset[i] = uiSymbol;
+            }   
+            for(Int i=0; i< psSaoLcuParam->length; i++)
+            {
+                if (psSaoLcuParam->offset[i] != 0)
+                {
+                    m_pcTDecBinIf->decodeBinEP ( uiSymbol);
+                    if (uiSymbol)
+                    {
+                        psSaoLcuParam->offset[i] = -psSaoLcuParam->offset[i] ;
+                    }
+                }
+            }
+            parseSaoUflc(5, uiSymbol );
+            psSaoLcuParam->subTypeIdx = uiSymbol;
+        }
+        else if( psSaoLcuParam->typeIdx < 4 )
+        {
+            parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[0] = uiSymbol;   
+            parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[1] = uiSymbol;
+            parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[2] = -(Int)uiSymbol;
+            parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[3] = -(Int)uiSymbol;
+            if (compIdx != 2)
+            {
+                parseSaoUflc(2, uiSymbol );
+                psSaoLcuParam->subTypeIdx = uiSymbol;
+                psSaoLcuParam->typeIdx += psSaoLcuParam->subTypeIdx;
+            }
+        }
+    }
+    else
+    {
+        psSaoLcuParam->length = 0;
+    }
+}
+
+Void TDecSbac::parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp)
+{
+    Int iAddr = pcCU->getAddr();
+    UInt uiSymbol;
+
+    for (Int iCompIdx=0; iCompIdx<3; iCompIdx++)
+    {
+        pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag    = 0;
+        pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag  = 0;
+        pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx     = 0;
+        pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx        =-1;
+        pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[0]      = 0;
+        pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[1]      = 0;
+        pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[2]      = 0;
+        pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[3]      = 0;
+    }
+    if (pSaoParam->bSaoFlag[0] || pSaoParam->bSaoFlag[1] )
+    {
+        if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft)
+        {
+            parseSaoMerge(uiSymbol); 
+            pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag = (Bool)uiSymbol;  
+        }
+        if (pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag==0)
+        {
+            if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp)
+            {
+                parseSaoMerge(uiSymbol);
+                pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag = (Bool)uiSymbol;
+            }
+        }
+    }
+
+    for (Int iCompIdx=0; iCompIdx<3; iCompIdx++)
+    {
+        if ((iCompIdx == 0  && pSaoParam->bSaoFlag[0]) || (iCompIdx > 0  && pSaoParam->bSaoFlag[1]) )
+        {
+            if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft)
+            {
+                pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag;
+            }
+            else
+            {
+                pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = 0;
+            }
+
+            if (pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag==0)
+            {
+                if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp)
+                {
+                    pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag;
+                }
+                else
+                {
+                    pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = 0;
+                }
+    
+                if (!pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag)
+                {
+                    pSaoParam->saoLcuParam[2][iAddr].typeIdx = pSaoParam->saoLcuParam[1][iAddr].typeIdx;
+                    parseSaoOffset(&(pSaoParam->saoLcuParam[iCompIdx][iAddr]), iCompIdx);
+                }
+                else
+                {
+                    copySaoOneLcuParam(&pSaoParam->saoLcuParam[iCompIdx][iAddr], &pSaoParam->saoLcuParam[iCompIdx][iAddr-pSaoParam->numCuInWidth]);
+                }
+            }
+            else
+            {
+                copySaoOneLcuParam(&pSaoParam->saoLcuParam[iCompIdx][iAddr],  &pSaoParam->saoLcuParam[iCompIdx][iAddr-1]);
+            }
+        }
+        else
+        {
+            pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx    = -1;
+            pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx = 0;
+        }
+    }
+}
+#else
 Void TDecSbac::parseSaoUvlc (UInt& ruiVal)
 {
@@ -1909,4 +2169,5 @@
   }
 }
+#endif
 
 /**
Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSbac.h	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSbac.h	(revision 408)
@@ -110,4 +110,12 @@
 #endif
   
+#if LGE_SAO_MIGRATION_D0091
+  Void  parseSaoMaxUvlc           ( UInt& val, UInt maxSymbol );
+  Void  parseSaoMerge             ( UInt&  ruiVal   );
+  Void  parseSaoTypeIdx           ( UInt&  ruiVal  );
+  Void  parseSaoUflc              ( UInt uiLength, UInt& ruiVal     );
+  Void  parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp);
+  Void  parseSaoOffset            (SaoLcuParam* psSaoLcuParam, UInt compIdx);
+#else
   Void  parseSaoUvlc              ( UInt& ruiVal           );
   Void  parseSaoSvlc              ( Int&  riVal            );
@@ -118,4 +126,5 @@
   Void  parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Bool bLFCrossSliceBoundaryFlag);
   Void  parseSaoOffset            (SaoLcuParam* psSaoLcuParam);
+#endif
   
 #if RWTH_SDC_DLT_B0036
@@ -245,4 +254,8 @@
   ContextModel3DBuffer m_cALFSvlcSCModel;
   ContextModel3DBuffer m_cCUAMPSCModel;
+#if LGE_SAO_MIGRATION_D0091
+  ContextModel3DBuffer m_cSaoMergeSCModel;
+  ContextModel3DBuffer m_cSaoTypeIdxSCModel;
+#else
   ContextModel3DBuffer m_cSaoFlagSCModel;
   ContextModel3DBuffer m_cSaoUvlcSCModel;
@@ -251,4 +264,5 @@
   ContextModel3DBuffer m_cSaoMergeUpSCModel;
   ContextModel3DBuffer m_cSaoTypeIdxSCModel;
+#endif
 
 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
Index: branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSlice.cpp
===================================================================
--- branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 388)
+++ branches/HTM-6.2-dev1-LG/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 408)
@@ -286,4 +286,37 @@
     g_bJustDoIt = g_bEncDecTraceEnable;
 #endif
+#if LGE_SAO_MIGRATION_D0091
+    if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) )
+    {
+        SAOParam *saoParam =  pcSlice->getAPS()->getSaoParam();
+        saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
+    if (iCUAddr == iStartCUAddr)
+    {
+        saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma();
+    }
+    Int numCuInWidth     = saoParam->numCuInWidth;
+    Int cuAddrInSlice = iCUAddr - rpcPic->getPicSym()->getCUOrderMap(pcSlice->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU());
+    Int cuAddrUpInSlice  = cuAddrInSlice - numCuInWidth;
+    Int rx = iCUAddr % numCuInWidth;
+    Int ry = iCUAddr / numCuInWidth;
+    Int allowMergeLeft = 1;
+    Int allowMergeUp   = 1;
+    if (rx!=0)
+    {
+        if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-1) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
+        {
+            allowMergeLeft = 0;
+        }
+    }
+    if (ry!=0)
+    {
+        if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-numCuInWidth) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
+        {
+        allowMergeUp = 0;
+        }
+    }
+    pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, saoParam,pcCU, cuAddrInSlice, cuAddrUpInSlice, allowMergeLeft, allowMergeUp);
+    }
+#else
     if ( pcSlice->getSPS()->getUseSAO() && pcSlice->getSaoInterleavingFlag() && pcSlice->getSaoEnabledFlag() )
     {
@@ -301,4 +334,5 @@
       pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, pcSlice->getAPS()->getSaoParam(),pcCU, cuAddrInSlice, cuAddrUpInSlice, pcSlice->getSPS()->getLFCrossSliceBoundaryFlag() );
     }
+#endif
 
     m_pcCuDecoder->decodeCU     ( pcCU, uiIsLast );
