Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 373)
@@ -1493,6 +1493,12 @@
 #endif
 #if H3D_IVRP
-    pcSPS->setMultiviewResPredMode  ( 0 );
-#endif
+#if QC_ARP_D0177
+     pcSPS->setUseAdvRP  ( 0 );
+     pcSPS->setARPStepNum( 1 );
+#else
+     pcSPS->setMultiviewResPredMode  ( 0 );
+#endif
+#endif
+
     }
     else
@@ -1544,6 +1550,12 @@
 #endif
 #if H3D_IVRP
+#if QC_ARP_D0177
+      pcSPS->setUseAdvRP  ( 0 );
+      pcSPS->setARPStepNum( 1 );
+#else
       pcSPS->setMultiviewResPredMode  ( 0 );
 #endif
+#endif
+
       }
       else
@@ -1573,5 +1585,5 @@
         UInt uiMultiviewMvPredMode = 0;
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
       UInt uiMultiviewResPredMode = 0;
 #endif
@@ -1588,5 +1600,5 @@
           READ_UVLC( uiMultiviewMvPredMode, "multi_view_mv_pred_mode" );
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
           READ_FLAG( uiMultiviewResPredMode, "multi_view_residual_pred_mode" );
 #endif
@@ -1599,6 +1611,15 @@
 #endif
 #if H3D_IVRP
+#if QC_ARP_D0177
+      READ_FLAG( uiCode , "advanced_residual_pred_flag" );           pcSPS->setUseAdvRP( uiCode );
+      if( pcSPS->getUseAdvRP()  )
+          pcSPS->setARPStepNum( QC_ARP_WFNR );
+      else
+       pcSPS->setARPStepNum( 1 );
+#else
       pcSPS->setMultiviewResPredMode  ( uiMultiviewResPredMode );
 #endif
+#endif
+
       }
     }
@@ -2424,5 +2445,10 @@
 }
 #endif
-
+#if QC_ARP_D0177
+Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
+{
+  assert( false );
+}
+#endif
 #if RWTH_SDC_DLT_B0036
 Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 373)
@@ -144,4 +144,7 @@
   Void parseResPredFlag     ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
+#if QC_ARP_D0177
+  Void parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx,UInt uiDepth );
+#endif
   Void parseSplitFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   Void parsePartSize        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCu.cpp	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCu.cpp	(revision 373)
@@ -54,5 +54,5 @@
   m_ppcYuvResi = NULL;
   m_ppcYuvReco = NULL;
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   m_ppcYuvResPred = NULL;
 #endif
@@ -82,5 +82,5 @@
   m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1];
   m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1];
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   m_ppcYuvResPred = new TComYuv*   [m_uiMaxDepth-1];
 #endif
@@ -96,5 +96,5 @@
     m_ppcYuvResi[ui] = new TComYuv;    m_ppcYuvResi[ui]->create( uiWidth, uiHeight );
     m_ppcYuvReco[ui] = new TComYuv;    m_ppcYuvReco[ui]->create( uiWidth, uiHeight );
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
     m_ppcYuvResPred[ui] = new TComYuv;    m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );
 #endif
@@ -120,5 +120,5 @@
     m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL;
     m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
     m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;
 #endif
@@ -128,5 +128,5 @@
   delete [] m_ppcYuvResi; m_ppcYuvResi = NULL;
   delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;
 #endif
@@ -317,5 +317,9 @@
       if(!pcCU->getSlice()->isIntra())
       {
+#if QC_ARP_D0177
+        if(( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() || pcCU->getSlice()->getSPS()->getUseAdvRP())             && pcCU->getSlice()->getViewId())
+#else
         if(( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() || pcCU->getSlice()->getSPS()->getMultiviewResPredMode()) && pcCU->getSlice()->getViewId())
+#endif
         {  
           m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true );
@@ -443,4 +447,12 @@
     }
 #endif
+#if QC_ARP_D0177
+    if( pcCU->getSlice()->getSPS()->getUseAdvRP() )
+    {
+      pcCU->setResPredAvailSubParts ( false, uiAbsPartIdx, 0, uiDepth );
+      pcCU->setResPredFlagSubParts  ( false, uiAbsPartIdx, 0, uiDepth );
+      m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth, m_ppcCU[uiDepth], 0 );
+    }
+#endif
     xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
     return;
@@ -494,5 +506,11 @@
   }
 #endif
-
+#if QC_ARP_D0177 
+  if (pcCU->getSlice()->getSPS()->getUseAdvRP() && pcCU->isIntra( uiAbsPartIdx ) )
+  {
+    pcCU->setResPredAvailSubParts ( 0, uiAbsPartIdx, 0, uiDepth );
+    pcCU->setResPredFlagSubParts  ( 0, uiAbsPartIdx, 0, uiDepth );
+  }
+#endif
 #if HHI_MPI
     if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth )
@@ -704,5 +722,5 @@
   m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
   {
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCu.h
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCu.h	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCu.h	(revision 373)
@@ -61,5 +61,5 @@
   TComYuv**           m_ppcYuvResi;       ///< array of residual buffer
   TComYuv**           m_ppcYuvReco;       ///< array of prediction & reconstruction buffer
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   TComYuv**           m_ppcYuvResPred;    ///< residual prediction buffer
 #endif
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 373)
@@ -108,4 +108,17 @@
 }
 
+#if QC_ARP_D0177
+Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx )
+{
+  if( pcCU->getSlice()->getViewId() == 0 || pcCU->getSlice()->getIsDepth() == true || !pcCU->getSlice()->getARPStepNum() )
+    return;
+  assert( !pcCU->isIntra( uiAbsPartIdx ) );
+  Bool bResPredAvailable = !pcCU->getSlice()->getARPStepNum() ? false: ((pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N || pcCU->isSkipped(uiAbsPartIdx)) ? true: false);
+  if(!bResPredAvailable)
+    pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth );  
+  else
+    m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth );
+}
+#endif
 Void TDecEntropy::decodeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -189,4 +202,10 @@
   {
     decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU );
+#if QC_ARP_D0177
+    if( pcCU->getSlice()->getSPS()->getUseAdvRP() )
+    {
+      decodeARPW( pcCU , uiAbsPartIdx , uiDepth, pcSubCU, 0  );
+    }
+#endif
   }
 }
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h	(revision 373)
@@ -106,4 +106,7 @@
   virtual Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
 #endif
+#if QC_ARP_D0177
+  virtual Void parseARPW         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
+#endif
   virtual Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
   virtual Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
@@ -198,4 +201,7 @@
   Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
   Void decodeMergeIndex        ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth );
+#if QC_ARP_D0177
+  Void decodeARPW              ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx );
+#endif
   Void decodePredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   Void decodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecGop.cpp	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecGop.cpp	(revision 373)
@@ -93,5 +93,5 @@
                    ,TComDepthMapGenerator*  pcDepthMapGenerator
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
                   ,TComResidualGenerator*  pcResidualGenerator
 #endif
@@ -109,5 +109,5 @@
   m_pcDepthMapGenerator   = pcDepthMapGenerator;
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   m_pcResidualGenerator   = pcResidualGenerator;
 #endif
@@ -298,5 +298,5 @@
       m_pcDepthMapGenerator->predictDepthMap  ( rpcPic );
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
       m_pcResidualGenerator->initViewComponent( rpcPic );
 #endif
@@ -331,5 +331,5 @@
   else
   {
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
     // set residual picture
     m_pcResidualGenerator->setRecResidualPic( rpcPic );
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecGop.h
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecGop.h	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecGop.h	(revision 373)
@@ -90,5 +90,5 @@
   TComDepthMapGenerator*  m_pcDepthMapGenerator;
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   TComResidualGenerator*  m_pcResidualGenerator;
 #endif
@@ -118,5 +118,5 @@
                  ,TComDepthMapGenerator*  pcDepthMapGenerator
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
                 ,TComResidualGenerator*  pcResidualGenerator
 #endif
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 373)
@@ -64,4 +64,7 @@
 #if H3D_IVRP
 , m_cResPredFlagSCModel       ( 1,             1,               NUM_RES_PRED_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
+#endif
+#if QC_ARP_D0177
+, m_cCUPUARPW                 ( 1,             1,               NUM_ARPW_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
 , m_cCUPartSizeSCModel        ( 1,             1,               NUM_PART_SIZE_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
@@ -162,4 +165,7 @@
   m_cResPredFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_RES_PRED_FLAG );
 #endif
+#if QC_ARP_D0177
+  m_cCUPUARPW.initBuffer                ( sliceType, qp, (UChar*)INIT_ARPW );
+#endif
   m_cCUAlfCtrlFlagSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_ALF_CTRL_FLAG );
   m_cCUPartSizeSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_PART_SIZE );
@@ -248,4 +254,7 @@
 #if H3D_IVRP
   m_cResPredFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_RES_PRED_FLAG );
+#endif
+#if QC_ARP_D0177
+  m_cCUPUARPW.initBuffer                 ( eSliceType, iQp, (UChar*)INIT_ARPW );
 #endif
   m_cCUAlfCtrlFlagSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG );
@@ -2235,5 +2244,26 @@
 }
 #endif
-
+#if QC_ARP_D0177
+Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
+{
+  UInt nMaxW = pcCU->getSlice()->getARPStepNum() - 1;
+  assert (nMaxW >= 0);
+  UInt nW = 0;
+  if( nMaxW > 0 )
+  {
+    UInt nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx);
+    assert( 0 <= nOffset && nOffset <= 2 );
+    UInt uiCode = 0;
+    m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 0 + nOffset ) );
+    nW = uiCode;
+    if( nW == 1 )   
+    {
+      m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 3 ) );
+      nW += ( uiCode == 1 );
+    }
+  }
+  pcCU->setARPWSubParts( ( UChar )( nW ) , uiAbsPartIdx, uiDepth );  
+}
+#endif
 #if LGE_EDGE_INTRA_A0070
 Void TDecSbac::xParseEdgeIntraInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h	(revision 373)
@@ -176,4 +176,7 @@
   Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
+#if QC_ARP_D0177
+  Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
+#endif
   Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
@@ -218,4 +221,7 @@
 #if H3D_IVRP
   ContextModel3DBuffer m_cResPredFlagSCModel;
+#endif
+#if QC_ARP_D0177
+  ContextModel3DBuffer m_cCUPUARPW;
 #endif
   ContextModel3DBuffer m_cCUPartSizeSCModel;
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecTop.cpp	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecTop.cpp	(revision 373)
@@ -403,5 +403,5 @@
   m_cDepthMapGenerator.destroy();
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   m_cResidualGenerator.destroy();
 #endif
@@ -420,5 +420,5 @@
                     , &m_cDepthMapGenerator
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
                     , &m_cResidualGenerator
 #endif
@@ -434,5 +434,5 @@
 #endif
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator );
 #endif
@@ -860,5 +860,5 @@
     }
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
     m_cResidualGenerator.create( true, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
 #endif
@@ -1083,5 +1083,13 @@
     std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() );
     pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics );
-
+#if QC_ARP_D0177
+    //pcSlice->setBaseViewRefPicList( m_tAppDecTop->getTDecTop( 0 , false )->getListPic() );
+    pcSlice->setARPStepNum();
+    if(pcSlice->getARPStepNum() > 1)
+    {
+      for(Int iViewIdx = 0; iViewIdx < pcSlice->getViewId(); iViewIdx ++ )
+        pcSlice->setBaseViewRefPicList( m_tAppDecTop->getTDecTop( iViewIdx, false )->getListPic(), iViewIdx );
+    }
+#endif
     // For generalized B
     // note: maybe not existed case (always L0 is copied to L1 if L1 is empty)
Index: branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecTop.h	(revision 351)
+++ branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecTop.h	(revision 373)
@@ -213,5 +213,5 @@
   TComDepthMapGenerator   m_cDepthMapGenerator;
 #endif
-#if H3D_IVRP
+#if H3D_IVRP & !QC_ARP_D0177
   TComResidualGenerator   m_cResidualGenerator;
 #endif
