Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/CommonDef.h	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/CommonDef.h	(revision 11)
@@ -58,5 +58,5 @@
 
 #define HM_VERSION        "3.0rc2"                 ///< Current software version
-#define NV_VERSION        "0.2"                   ///< Current software version
+#define NV_VERSION        "0.3"                   ///< Current software version
 
 // ====================================================================================================================
@@ -137,5 +137,4 @@
 #define LOG2_DISP_PREC_LUT   				2		  		///< log2 of disparity precision used in integer disparity LUTs
 
-
 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED )
 #define DEPTH_MAP_GENERATION        1
@@ -171,6 +170,11 @@
 #define OUTPUT_RESIDUAL_PICTURES          0         // output residual pictures (for debugging)
 
-#define HHI_MPI_MERGE_POS                     0         // position of mvi in merge list (0..5)
-
+#define HHI_MPI_MERGE_POS                 0           // position of mvi in merge list (0..5)
+
+// ====================================================================================================================
+// POZNAN DEFINE SECTION
+// ====================================================================================================================
+#define POZNAN_OUTPUT_AVAILABLE_MAP       0           // output available map (for debugging)
+#define POZNAN_OUTPUT_SYNTH               0           // output synthesised view (for debugging)
 
 // ====================================================================================================================
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp	(revision 11)
@@ -2711,5 +2711,9 @@
     pcCULeft = NULL;
   }
-  if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) )
+  if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+    && !pcCULeft->isCUSkiped( uiLeftPartIdx )
+#endif
+  )
   {
     abCandIsInter[uiLeftAddr] = true;
@@ -2737,5 +2741,9 @@
     pcCUAbove = NULL;
   }
-  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) )
+  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+    && !pcCUAbove->isCUSkiped( uiAbovePartIdx )
+#endif
+  )
   {
     abCandIsInter[uiAboveAddr] = true;
@@ -3271,5 +3279,9 @@
   if( uiIter == 0 )
   {
-    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
+    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+       && !pcCorner->isCUSkiped( uiCornerPUIdx )
+#endif
+    )
     {
       rbValidCand = true;
@@ -3306,5 +3318,9 @@
   else
   {
-    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
+    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+       && !pcCorner->isCUSkiped( uiCornerPUIdx )
+#endif
+    )
     {
       rbValidCand = true;
@@ -4425,4 +4441,9 @@
   if (pColCU->isIntra(uiPartIdxCenter))
     return false;
+
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+  if (pColCU->isSkipped(uiPartIdxCenter))
+    return false;
+#endif
   
   if( m_pcSlice->getRefPic(eRefPicList, iRefIdx)->getViewIdx() != m_pcSlice->getViewIdx() )
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.h	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.h	(revision 11)
@@ -529,4 +529,7 @@
   Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
   Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+  Bool          isCUSkiped( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; }
+#endif
   
   // -------------------------------------------------------------------------------------------------------------------
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDepthMapGenerator.cpp	(revision 11)
@@ -971,4 +971,10 @@
     xInterPredictCUDepthMap( pcSubCU, pcSubDM );
     break;
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+  case MODE_SYNTH:
+    //What to do? Need Fix!
+    xIntraPredictCUDepthMap( pcSubCU, pcSubDM );
+    break;
+#endif
   default:
     AOT( true );
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp	(revision 11)
@@ -444,11 +444,19 @@
   
   //-- Set BS for Intra MB : BS = 4 or 3
-  if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) )
+  if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) 
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+     || pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ) 
+#endif
+  )
   {
     uiBs = bAtCUBoundary ? 4 : 3;   // Intra MB && MB boundary
   }
-  
+
   //-- Set BS for not Intra MB : BS = 2 or 1 or 0
-  if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) )
+  if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) 
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+     && !pcCUP->isCUSkiped(uiPartP) && !pcCUQ->isCUSkiped(uiPartQ) 
+#endif
+  )
   {
     if ( pcCUQ->getCbf( uiPartQ, TEXT_LUMA, pcCUQ->getTransformIdx(uiPartQ)) != 0 || pcCUP->getCbf( uiPartP, TEXT_LUMA, pcCUP->getTransformIdx(uiPartP) ) != 0)
@@ -527,5 +535,12 @@
     }   // enf of "if( one of BCBP == 0 )"
   }   // enf of "if( not Intra )"
-  
+
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //if one of the block is CUSkipped dont use loop filter
+  if ( pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ))
+  {
+    uiBs = 0;
+  }
+#endif
+
   m_aapucBS[iDir][0][uiAbsPartIdx] = uiBs;
   if ( bAtCUBoundary || bAtCUHalf )
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.cpp	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.cpp	(revision 11)
@@ -50,4 +50,10 @@
   m_apcPicYuv[0]      = NULL;
   m_apcPicYuv[1]      = NULL;
+#if POZNAN_AVAIL_MAP
+  m_apcPicYuvAvail     = NULL;
+#endif
+#if POZNAN_SYNTH_VIEW
+  m_apcPicYuvSynth     = NULL;
+#endif
 #if DEPTH_MAP_GENERATION
   m_pcPredDepthMap    = NULL;
@@ -116,4 +122,21 @@
     m_apcPicYuv[1]  = NULL;
   }
+#if POZNAN_AVAIL_MAP
+  if (m_apcPicYuvAvail)
+  {
+    m_apcPicYuvAvail->destroy();
+    delete m_apcPicYuvAvail;
+    m_apcPicYuvAvail  = NULL;
+  }
+#endif
+
+#if POZNAN_SYNTH_VIEW
+  if (m_apcPicYuvSynth)
+  {
+    m_apcPicYuvSynth->destroy();
+    delete m_apcPicYuvSynth;
+    m_apcPicYuvSynth  = NULL;
+  }
+#endif
   
 #if DEPTH_MAP_GENERATION
@@ -193,4 +216,36 @@
 }
 
+#if POZNAN_AVAIL_MAP
+Void
+TComPic::addAvailabilityBuffer()
+{
+  AOT( m_apcPicYuvAvail );
+  AOF( m_apcPicYuv[1] );
+  Int   iWidth        = m_apcPicYuv[1]->getWidth      ();
+  Int   iHeight       = m_apcPicYuv[1]->getHeight     ();
+  UInt  uiMaxCuWidth  = m_apcPicYuv[1]->getMaxCuWidth ();
+  UInt  uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight();
+  UInt  uiMaxCuDepth  = m_apcPicYuv[1]->getMaxCuDepth ();
+  m_apcPicYuvAvail      = new TComPicYuv;
+  m_apcPicYuvAvail      ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );
+}
+#endif
+
+#if POZNAN_SYNTH_VIEW
+Void
+TComPic::addSynthesisBuffer()
+{
+  AOT( m_apcPicYuvSynth );
+  AOF( m_apcPicYuv[1] );
+  Int   iWidth        = m_apcPicYuv[1]->getWidth      ();
+  Int   iHeight       = m_apcPicYuv[1]->getHeight     ();
+  UInt  uiMaxCuWidth  = m_apcPicYuv[1]->getMaxCuWidth ();
+  UInt  uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight();
+  UInt  uiMaxCuDepth  = m_apcPicYuv[1]->getMaxCuDepth ();
+  m_apcPicYuvSynth      = new TComPicYuv;
+  m_apcPicYuvSynth      ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );
+}
+#endif
+
 #if PARALLEL_MERGED_DEBLK
 Void
@@ -284,4 +339,30 @@
 }
 
+#if POZNAN_AVAIL_MAP
+Void
+TComPic::removeAvailabilityBuffer()
+{
+  if( m_apcPicYuvAvail )
+  {
+    m_apcPicYuvAvail->destroy();
+    delete m_apcPicYuvAvail;
+    m_apcPicYuvAvail  = NULL;
+  }
+}
+#endif
+
+#if POZNAN_SYNTH_VIEW
+Void
+TComPic::removeSynthesisBuffer()
+{
+  if( m_apcPicYuvSynth )
+  {
+    m_apcPicYuvSynth->destroy();
+    delete m_apcPicYuvSynth;
+    m_apcPicYuvSynth  = NULL;
+  }
+}
+#endif
+
 #if PARALLEL_MERGED_DEBLK
 Void
@@ -349,2 +430,58 @@
 #endif
 
+#if POZNAN_AVAIL_MAP
+Void TComPic::checkSynthesisAvailability( TComDataCU*& rpcCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied )
+{ 
+  rpbCUSynthesied[0] = true;
+  rpbCUSynthesied[1] = true;
+  rpbCUSynthesied[2] = true;
+  rpbCUSynthesied[3] = true;
+
+  if (!getPicYuvAvail())
+  {
+    rpbCUSynthesied[0] = false;
+    rpbCUSynthesied[1] = false;
+    rpbCUSynthesied[2] = false;
+    rpbCUSynthesied[3] = false;
+    return;    
+  }
+  
+  Int x, y;
+  Bool bAvailable = true;
+  Pel* pAvail  = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx );
+  Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx);
+  Int CUWidth  = g_uiMaxCUWidth  >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx);
+  
+  Int  iStride  = getPicYuvAvail()->getStride();
+  for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- )
+  {
+    for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- )
+    {
+      rpbCUSynthesied[0] &= (pAvail[x] != 0);
+    }
+    for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- )
+    {
+      rpbCUSynthesied[1] &= (pAvail[x] != 0);
+    }
+    pAvail += iStride;
+  }
+  //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- )
+  for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka
+  {
+    for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- )
+    {
+      rpbCUSynthesied[2] &= (pAvail[x] != 0);
+    }
+    for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- )
+    {
+      rpbCUSynthesied[3] &= (pAvail[x] != 0);
+    }
+    pAvail += iStride;
+  }
+
+  //rpbCUSynthesied[0] = !rpbCUSynthesied[0];
+  //rpbCUSynthesied[1] = !rpbCUSynthesied[1];
+  //rpbCUSynthesied[2] = !rpbCUSynthesied[2];
+  //rpbCUSynthesied[3] = !rpbCUSynthesied[3];
+}
+#endif
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.h	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.h	(revision 11)
@@ -61,4 +61,13 @@
 
   TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
+
+#if POZNAN_AVAIL_MAP
+  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
+#endif
+
+#if POZNAN_SYNTH_VIEW
+  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
+#endif
+
 #if DEPTH_MAP_GENERATION
   TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
@@ -126,4 +135,12 @@
   TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
   TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
+
+#if POZNAN_AVAIL_MAP
+  TComPicYuv*   getPicYuvAvail()      { return  m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image
+#endif
+
+#if POZNAN_SYNTH_VIEW
+  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image
+#endif
 
 #if DEPTH_MAP_GENERATION
@@ -196,4 +213,10 @@
 
   Void          addOriginalBuffer       ();
+#if POZNAN_AVAIL_MAP
+  Void          addAvailabilityBuffer   ();
+#endif
+#if POZNAN_SYNTH_VIEW
+  Void          addSynthesisBuffer      ();
+#endif
 #if PARALLEL_MERGED_DEBLK
   Void          addDeblockBuffer        ();
@@ -214,4 +237,10 @@
 
   Void          removeOriginalBuffer    ();
+#if POZNAN_SYNTH_VIEW
+  Void          removeSynthesisBuffer   ();
+#endif
+#if POZNAN_AVAIL_MAP
+  Void          removeAvailabilityBuffer();
+#endif
 #if PARALLEL_MERGED_DEBLK
   Void          removeDeblockBuffer     ();
@@ -228,4 +257,8 @@
 #if HHI_INTERVIEW_SKIP
   Void          removeUsedPelsMapBuffer ();
+#endif
+
+#if POZNAN_AVAIL_MAP
+  Void          checkSynthesisAvailability(  TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
 #endif
 
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComResidualGenerator.cpp
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComResidualGenerator.cpp	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComResidualGenerator.cpp	(revision 11)
@@ -306,4 +306,9 @@
     xSetRecResidualInterCU( pcSubCU, pcSubRes );
     break;
+#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
+  case MODE_SYNTH:
+    xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function
+    break;
+#endif
   default:
     AOT( true );
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp	(revision 11)
@@ -676,5 +676,7 @@
   // AMVP parameter
   ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) );
+#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
   m_bUseDMM = false;
+#endif
 }
 
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.h	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.h	(revision 11)
@@ -452,5 +452,5 @@
 
   Void      setSPS          ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
-  TComSPS*  getSPS          () { return m_pcSPS; }
+                                                                                               TComSPS*  getSPS          () { return m_pcSPS; }
 
   Void      setPPS          ( TComPPS* pcPPS ) { m_pcPPS = pcPPS; }
Index: branches/0.2-poznan-univ/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/0.2-poznan-univ/source/Lib/TLibCommon/TypeDef.h	(revision 10)
+++ branches/0.2-poznan-univ/source/Lib/TLibCommon/TypeDef.h	(revision 11)
@@ -61,4 +61,20 @@
 //<<<<< HHI 3DV tools <<<<<
 
+//<<<<< Poznan 3DV tools <<<<<<
+#define POZNAN_CU_SKIP              1 //Poznan Cu Skip
+#define POZNAN_CU_SYNTH             1 //Poznan Cu Synth
+
+#define POZNAN_AVAIL_MAP            1 //Creates Availibity buffers in all needed classes
+
+#define POZNAN_SYNTH_VIEW           1 //Creates view synthesis buffers in all needed classes
+#define POZNAN_SYNTH_DEPTH          1
+
+#define POZNAN_SYNTH                1 //Creates aligned synthesis classes in encoder and decoder
+
+#define POZNAN_ENCODE_ONLY_DISOCCLUDED_CU          1 //Poznan CU Skip
+#define POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS     1 //Fills not sended CUs with synthesized data
+
+#define POZNAN_CU_SKIP_PSNR         1 //Poznan Cu Skip Display psnr of the codded CU only
+//<<<<< Poznan 3DV tools <<<<<<
 
 ////////////////////////////
@@ -575,4 +591,7 @@
   MODE_INTER,           ///< inter-prediction mode
   MODE_INTRA,           ///< intra-prediction mode
+#if POZNAN_CU_SKIP
+  MODE_SYNTH,           ///< synth-mode
+#endif
   MODE_NONE = 15
 };
