Index: branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 488)
+++ branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 489)
@@ -766,7 +766,20 @@
 #if SVC_UPSAMPLING
 #if O0215_PHASE_ALIGNMENT
+#if O0194_JOINT_US_BITSHIFT
+Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )
+{
+  m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag );
+}
+#else
 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )
 {
   m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag );
+}
+#endif
+#else
+#if O0194_JOINT_US_BITSHIFT
+Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window)
+{
+  m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window);
 }
 #else
@@ -775,4 +788,5 @@
   m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window);
 }
+#endif
 #endif
 #endif
Index: branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 488)
+++ branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 489)
@@ -121,7 +121,15 @@
 #if SVC_UPSAMPLING
 #if O0215_PHASE_ALIGNMENT
+#if O0194_JOINT_US_BITSHIFT
+  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );
+#else
   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );
+#endif
+#else
+#if O0194_JOINT_US_BITSHIFT
+  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
 #else
   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
+#endif
 #endif
 #endif
Index: branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 488)
+++ branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 489)
@@ -98,7 +98,15 @@
 
 #if O0215_PHASE_ALIGNMENT
+#if O0194_JOINT_US_BITSHIFT
+Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )
+#else
 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )
+#endif
+#else
+#if O0194_JOINT_US_BITSHIFT
+Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )
 #else
 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )
+#endif
 #endif
 {
@@ -141,4 +149,11 @@
   Int scaleX = g_posScalingFactor[refLayerIdc][0];
   Int scaleY = g_posScalingFactor[refLayerIdc][1];
+
+#if O0194_JOINT_US_BITSHIFT
+  UInt currLayerId = currSlice->getLayerId();
+  UInt refLayerId  = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc );
+  currLayerId = 1;
+  refLayerId = 0;
+#endif
 
   if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x
@@ -241,5 +256,5 @@
 #if O0194_JOINT_US_BITSHIFT
     // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
-    Int shift1 = g_bitDepthYLayer[0] - 8;
+    Int shift1 = g_bitDepthYLayer[refLayerId] - 8;
 #else
     Int shift1 = g_bitDepthY - 8;
@@ -279,5 +294,5 @@
 #if  N0214_INTERMEDIATE_BUFFER_16BITS
 #if O0194_JOINT_US_BITSHIFT
-    Int nShift = 20 - g_bitDepthYLayer[1];
+    Int nShift = 20 - g_bitDepthYLayer[currLayerId];
 #else
     Int nShift = US_FILTER_PREC*2 - shift1;
@@ -391,5 +406,5 @@
 #if O0194_JOINT_US_BITSHIFT
     // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
-    shift1 = g_bitDepthCLayer[0] - 8;
+    shift1 = g_bitDepthCLayer[refLayerId] - 8;
 #else
     shift1 = g_bitDepthC - 8;
@@ -436,5 +451,5 @@
 #if  N0214_INTERMEDIATE_BUFFER_16BITS
 #if O0194_JOINT_US_BITSHIFT
-    nShift = 20 - g_bitDepthCLayer[1];
+    nShift = 20 - g_bitDepthCLayer[refLayerId];
 #else
     nShift = US_FILTER_PREC*2 - shift1;
Index: branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.h
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.h	(revision 488)
+++ branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.h	(revision 489)
@@ -44,7 +44,15 @@
 
 #if O0215_PHASE_ALIGNMENT
+#if O0194_JOINT_US_BITSHIFT
+  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );
+#else
   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );
+#endif
+#else
+#if O0194_JOINT_US_BITSHIFT
+  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
 #else
   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
+#endif
 #endif
 
Index: branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 488)
+++ branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 489)
@@ -2100,6 +2100,6 @@
 #if REPN_FORMAT_IN_VPS
 #if O0194_DIFFERENT_BITDEPTH_EL_BL
-    g_bitDepthYLayer[rpcSlice->getLayerId()]     = rpcSlice->getBitDepthY();
-    g_bitDepthCLayer[rpcSlice->getLayerId()]     = rpcSlice->getBitDepthC();
+    g_bitDepthYLayer[rpcSlice->getLayerId()] = rpcSlice->getBitDepthY();
+    g_bitDepthCLayer[rpcSlice->getLayerId()] = rpcSlice->getBitDepthC();
 #endif
     assert( rpcSlice->getSliceQp() >= -rpcSlice->getQpBDOffsetY() );
Index: branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 488)
+++ branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 489)
@@ -1212,7 +1212,15 @@
         {    
 #if O0215_PHASE_ALIGNMENT
+#if O0194_JOINT_US_BITSHIFT
+          m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
+#else
           m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
+#endif
+#else
+#if O0194_JOINT_US_BITSHIFT
+          m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
 #else
           m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
+#endif
 #endif
         }
Index: branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 488)
+++ branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 489)
@@ -801,7 +801,15 @@
         {
 #if O0215_PHASE_ALIGNMENT
+#if O0194_JOINT_US_BITSHIFT
+          m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
+#else
           m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
+#endif
+#else
+#if O0194_JOINT_US_BITSHIFT
+          m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
 #else
           m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
+#endif
 #endif
         }
