Index: branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 46)
+++ branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 48)
@@ -255,10 +255,4 @@
   xReadFlag( uiCode ); pcSPS->setUseSAO       ( uiCode ? true : false );
 #endif
-#if POZNAN_DBMP
-  xReadFlag( uiCode ); pcSPS->setDBMP  ( uiCode );
-#endif
-#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
-  xReadFlag( uiCode ); pcSPS->setUseCUSkip ( uiCode );
-#endif
   xReadFlag( uiCode ); // SPS base view flag
   if( uiCode )
@@ -271,15 +265,57 @@
     pcSPS->setMultiviewResPredMode  ( 0 );
 #endif
+#if POZNAN_DBMP
+    pcSPS->setDBMP  ( false );
+#endif
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+    pcSPS->setUseCUSkip ( false );
+#endif
   }
   else
   {
+#if POZNAN_DBMP
+    xReadFlag( uiCode ); pcSPS->setDBMP  ( uiCode );
+#endif
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+    xReadFlag( uiCode ); pcSPS->setUseCUSkip ( uiCode );
+#endif
     xReadFlag  ( uiCode ); // depth flag
     if( uiCode )
     {
-      xReadUvlc( uiCode ); // view id
+      UInt  uiViewId;
+#if FLEXCO_CAMPARAM_IN_DEPTH
+      UInt  uiCamParPrecision;
+      Int   iVOI;
+      Bool  bCamParSlice;
+      xReadUvlc( uiViewId ); 
+      xReadSvlc( iVOI );
+      if (uiViewId == 0)
+      {
+        pcSPS->initMultiviewSPSDepth    ( uiViewId, iVOI );
+      }
+      else
+      {
+        xReadUvlc( uiCamParPrecision );
+        xReadFlag( uiCode );    bCamParSlice = ( uiCode == 1 );
+        if( !bCamParSlice )
+        {
+          //uiViewId++;
+          for( UInt uiBaseId = 0; uiBaseId < uiViewId; uiBaseId++ )
+          {
+            xReadSvlc( iCode );   m_aaiTempScale [ uiBaseId ][ uiViewId ] = iCode;
+            xReadSvlc( iCode );   m_aaiTempOffset[ uiBaseId ][ uiViewId ] = iCode;
+            xReadSvlc( iCode );   m_aaiTempScale [ uiViewId ][ uiBaseId ] = iCode - m_aaiTempScale [ uiBaseId ][ uiViewId ];
+            xReadSvlc( iCode );   m_aaiTempOffset[ uiViewId ][ uiBaseId ] = iCode - m_aaiTempOffset[ uiBaseId ][ uiViewId ];
+          }
+        }
+        pcSPS->initMultiviewSPS( uiViewId, iVOI, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset, true);
+      }
+#else
+      xReadUvlc( uiViewId ); // view id
       xReadSvlc(  iCode ); // view order index
-      pcSPS->initMultiviewSPSDepth    ( uiCode, iCode );
+      pcSPS->initMultiviewSPSDepth    ( uiViewId, iCode );
+#endif
 #if DEPTH_MAP_GENERATION
-      pcSPS->setPredDepthMapGeneration( uiCode, true );
+      pcSPS->setPredDepthMapGeneration( uiViewId, true );
 #endif
 #if HHI_INTER_VIEW_RESIDUAL_PRED
@@ -2729,15 +2765,18 @@
 #endif
 #if POZNAN_DBMP
-	if(bDBMPAvailable)
-	{
-	  if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND;
-	  else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--;
-	  else uiModIdx = uiIdx;
-	}
-	else uiModIdx = uiIdx;
-	if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) != uiModIdx + 1 )
-	{
-	  ruiMergeIndex++;
-	}
+    {
+      if(bDBMPAvailable)
+      {
+        if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND;
+        else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--;
+        else uiModIdx = uiIdx;
+      }
+      else uiModIdx = uiIdx;
+
+      if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) != uiModIdx + 1 )
+      {
+	ruiMergeIndex++;
+      }
+    }
 #else
     if( pcCU->getNeighbourCandIdx( uiIdx, uiAbsPartIdx ) != uiIdx + 1 )
Index: branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp	(revision 46)
+++ branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp	(revision 48)
@@ -169,5 +169,4 @@
     Int64   iTempScale      = (Int64)uiDepthValue * iScale;
 #endif
-    Int64   iTestScale      = ( iTempScale + iOffset       );   // for checking accuracy of camera parameters
     Int64   iShiftLuma      = ( iTempScale + iOffsetLuma   ) >> iLog2DivLuma;
     Int64   iShiftChroma    = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma;
@@ -232,4 +231,5 @@
 
   AOF( pcSlice->getSPS()->getViewId() < MAX_NUMBER_VIEWS );
+
   if ( pcSlice->getSPS()->isDepth  () )
   {
@@ -238,7 +238,11 @@
     m_cNonlinearDepthModel = pcSlice->getSPS()->getNonlinearDepthModel();    
 #endif
+#if !FLEX_CODING_ORDER //Owieczka
     return;
-  }
+#endif
+  }
+#if !FLEX_CODING_ORDER //Owieczka
   else
+#endif
   {
 #if POZNAN_NONLINEAR_DEPTH
@@ -251,6 +255,8 @@
   Bool  bFirstSliceInView = ( pcSlice->getSPS()->getViewId()  != UInt( m_iLastViewId ) || bFirstSliceInAU );
   AOT(  bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()  != 0 );
+#if !FLEX_CODING_ORDER //Owieczka  
   AOT( !bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()   < UInt( m_iLastViewId ) );
   AOT( !bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()   > UInt( m_iLastViewId + 1 ) );
+#endif
   AOT( !bFirstAU         &&   pcSlice->getSPS()->getViewId()   > m_uiMaxViewId );
   if ( !bFirstSliceInView )
