Index: trunk/source/App/TAppRenderer/TAppRendererTop.cpp
===================================================================
--- trunk/source/App/TAppRenderer/TAppRendererTop.cpp	(revision 1179)
+++ trunk/source/App/TAppRenderer/TAppRendererTop.cpp	(revision 1313)
@@ -41,5 +41,5 @@
 #include "TAppRendererTop.h"
 
-#if H_3D
+#if NH_3D
 
 // ====================================================================================================================
@@ -67,8 +67,10 @@
     TVideoIOYuv* pcDepthInput = new TVideoIOYuv;
 
-    pcVideoInput->open( m_pchVideoInputFileList[iViewIdx], false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC);  // read mode
-    pcDepthInput->open( m_pchDepthInputFileList[iViewIdx], false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC  );  // read mode
-    pcVideoInput->skipFrames(m_iFrameSkip, m_iSourceWidth, m_iSourceHeight  );
-    pcDepthInput->skipFrames(m_iFrameSkip, m_iSourceWidth, m_iSourceHeight  );
+//    ( Char* pchFile, Bool bWriteMode, const Int fileBitDepth[MAX_NUM_CHANNEL_TYPE], const Int MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE], const Int internalBitDepth[MAX_NUM_CHANNEL_TYPE] )
+
+    pcVideoInput->open( m_pchVideoInputFileList[iViewIdx], false, m_inputBitDepth, m_internalBitDepth, m_internalBitDepth );  // read mode
+    pcDepthInput->open( m_pchDepthInputFileList[iViewIdx], false, m_inputBitDepth, m_internalBitDepth, m_internalBitDepth );  // read mode
+    pcVideoInput->skipFrames(m_iFrameSkip, m_iSourceWidth, m_iSourceHeight, CHROMA_420 );
+    pcDepthInput->skipFrames(m_iFrameSkip, m_iSourceWidth, m_iSourceHeight, CHROMA_420 );
 
     m_apcTVideoIOYuvVideoInput.push_back( pcVideoInput );
@@ -79,5 +81,5 @@
   {
     TVideoIOYuv* pcSynthOutput = new TVideoIOYuv;
-    pcSynthOutput->open( m_pchSynthOutputFileList[iViewIdx], true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // write mode
+    pcSynthOutput->open( m_pchSynthOutputFileList[iViewIdx], true, m_outputBitDepth, m_internalBitDepth, m_internalBitDepth );  // write mode
     m_apcTVideoIOYuvSynthOutput.push_back( pcSynthOutput );
   }
@@ -148,4 +150,7 @@
   Int aiPad[2] = { 0, 0 };
 
+  TComPicYuv* pcNewOrg = new TComPicYuv;
+  pcNewOrg->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
+
   for ( UInt uiBaseView = 0; uiBaseView < m_iNumberOfInputViews; uiBaseView++ )
   {
@@ -153,8 +158,8 @@
     TComPicYuv* pcNewDepthPic = new TComPicYuv;
 
-    pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+    pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
     apcPicYuvBaseVideo.push_back(pcNewVideoPic);
 
-    pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+    pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true);
     apcPicYuvBaseDepth.push_back(pcNewDepthPic);
 
@@ -165,8 +170,8 @@
       pcNewDepthPic = new TComPicYuv;
 
-      pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+      pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
       apcPicYuvLastBaseVideo.push_back(pcNewVideoPic);
 
-      pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+      pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
       apcPicYuvLastBaseDepth.push_back(pcNewDepthPic);
     }
@@ -175,5 +180,5 @@
   // Create Buffer for synthesized View
   TComPicYuv* pcPicYuvSynthOut = new TComPicYuv;
-  pcPicYuvSynthOut->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+  pcPicYuvSynthOut->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
 
   Bool bAnyEOS = false;
@@ -189,5 +194,5 @@
       for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ )
       {
-        m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad  ) ;
+        m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx],pcNewOrg, IPCOLOURSPACE_UNCHANGED, aiPad, CHROMA_420  ) ;
 
         apcPicYuvBaseVideo[iBaseViewIdx]->extendPicBorder();
@@ -195,5 +200,5 @@
         bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof();
 
-        m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad  ) ;
+        m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx],pcNewOrg, IPCOLOURSPACE_UNCHANGED, aiPad, CHROMA_420  ) ;
         apcPicYuvBaseDepth[iBaseViewIdx]->extendPicBorder();
         bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof();
@@ -428,5 +433,5 @@
       // Write Output
 
-      m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, 0, 0, 0, 0 );
+      m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, IPCOLOURSPACE_UNCHANGED, 0, 0, 0, 0, CHROMA_420 );
     }
     iFrame++;
@@ -435,4 +440,7 @@
 
   // Delete Buffers
+  pcNewOrg->destroy(); 
+  delete pcNewOrg; 
+
   for ( UInt uiBaseView = 0; uiBaseView < m_iNumberOfInputViews; uiBaseView++ )
   {
@@ -468,5 +476,5 @@
     render();
     break;
-#if H_3D_VSO
+#if NH_3D_VSO
   case 1:
     renderModel();
@@ -490,5 +498,5 @@
 }
 
-#if H_3D_VSO
+#if NH_3D_VSO
 Void TAppRendererTop::renderModel()
 {
@@ -520,12 +528,14 @@
       TComPicYuv* pcNewDepthPic = new TComPicYuv;
 
-      pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+      pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
       apcPicYuvBaseVideo.push_back(pcNewVideoPic);
 
-      pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+      pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
       apcPicYuvBaseDepth.push_back(pcNewDepthPic);
     }
 
     Int aiPad[2] = { 0, 0 };
+    TComPicYuv* pcNewOrg = new TComPicYuv;
+    pcNewOrg->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
 
     // Init Model
@@ -550,5 +560,4 @@
         m_cRenModStrParser.getSingleModelData  ( iViewIdx, 1, iCurModel, iModelNum, iBlendMode, iLeftViewNum, iRightViewNum, iOrgRefNum, iDump ) ;
         cCurModel         .createSingleModel   ( iViewIdx, 1, iModelNum, iLeftViewNum, iRightViewNum, false, iBlendMode );
-
       }
     }
@@ -556,5 +565,5 @@
     // Create Buffer for synthesized View
     TComPicYuv* pcPicYuvSynthOut = new TComPicYuv;
-    pcPicYuvSynthOut->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+    pcPicYuvSynthOut->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
 
     Bool bAnyEOS = false;
@@ -571,8 +580,8 @@
         for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ )
         {
-          m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad  ) ;
+          m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], pcNewOrg, IPCOLOURSPACE_UNCHANGED, aiPad, CHROMA_420  ) ;
           bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof();
 
-          m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad  ) ;
+          m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], pcNewOrg, IPCOLOURSPACE_UNCHANGED, aiPad, CHROMA_420  ) ;
           bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof();
         }
@@ -672,5 +681,5 @@
 
           // Write Output
-          m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iModelNum]->write( pcPicYuvSynthOut, 0 ,0 ,0, 0 );
+          m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iModelNum]->write( pcPicYuvSynthOut, IPCOLOURSPACE_UNCHANGED,  0 ,0 ,0, 0, CHROMA_420 );
         }
       }
@@ -706,4 +715,7 @@
 
   Int aiPad[2] = { 0, 0 };
+  TComPicYuv* pcNewOrg = new TComPicYuv;
+  pcNewOrg->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
+
 
   // Init Model
@@ -711,5 +723,5 @@
 
   AOT( m_iLog2SamplingFactor != 0 );
-  cCurModel.setupPart( 0, m_iSourceHeight  ); 
+
 #if H_3D_VSO_EARLY_SKIP
   cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false );
@@ -717,4 +729,5 @@
   cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin );
 #endif
+  cCurModel.setupPart( 0, m_iSourceHeight  ); 
 
   for ( UInt uiBaseView = 0; uiBaseView < m_iNumberOfInputViews; uiBaseView++ )
@@ -723,8 +736,8 @@
     TComPicYuv* pcNewDepthPic = new TComPicYuv;
 
-    pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+    pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
     apcPicYuvBaseVideo.push_back(pcNewVideoPic);
 
-    pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+    pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
     apcPicYuvBaseDepth.push_back(pcNewDepthPic);
   }
@@ -768,5 +781,5 @@
   // Create Buffer for synthesized View
   TComPicYuv* pcPicYuvSynthOut = new TComPicYuv;
-  pcPicYuvSynthOut->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+  pcPicYuvSynthOut->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
 
   Bool bAnyEOS = false;
@@ -783,8 +796,8 @@
       for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ )
       {
-        m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad  ) ;
+        m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], pcNewOrg, IPCOLOURSPACE_UNCHANGED, aiPad, CHROMA_420  ) ;
         bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof();
 
-        m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad  ) ;
+        m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], pcNewOrg, IPCOLOURSPACE_UNCHANGED, aiPad, CHROMA_420  ) ;
         bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof();
 
@@ -871,5 +884,5 @@
 
       // Write Output
-      m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, 0, 0, 0, 0 );
+      m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, IPCOLOURSPACE_UNCHANGED,  0 ,0 ,0, 0, CHROMA_420 );
     }
     iFrame++;
@@ -909,4 +922,7 @@
   Int aiPad[2] = { 0, 0 };
 
+  TComPicYuv* pcNewOrg = new TComPicYuv;
+  pcNewOrg->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
+
   for ( UInt uiBaseView = 0; uiBaseView < m_iNumberOfInputViews; uiBaseView++ )
   {
@@ -914,9 +930,10 @@
     TComPicYuv* pcNewDepthPic = new TComPicYuv;
 
-    pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+    pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight,CHROMA_420, 1, 1, 1, true );
     apcPicYuvBaseVideo.push_back(pcNewVideoPic);
 
-    pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+    pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1, true );
     apcPicYuvBaseDepth.push_back(pcNewDepthPic);
+
 
     //Temporal improvement Filter
@@ -926,8 +943,8 @@
       pcNewDepthPic = new TComPicYuv;
 
-      pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+      pcNewVideoPic->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1, 1 , true);
       apcPicYuvLastBaseVideo.push_back(pcNewVideoPic);
 
-      pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+      pcNewDepthPic->create( m_iSourceWidth, m_iSourceHeight,CHROMA_420, 1, 1, 1 , true);
       apcPicYuvLastBaseDepth.push_back(pcNewDepthPic);
     }
@@ -936,5 +953,5 @@
   // Create Buffer for synthesized View
   TComPicYuv* pcPicYuvSynthOut = new TComPicYuv;
-  pcPicYuvSynthOut->create( m_iSourceWidth, m_iSourceHeight, 1, 1, 1 );
+  pcPicYuvSynthOut->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, 1, 1 ,1, true);
 
   Bool bAnyEOS = false;
@@ -950,9 +967,9 @@
       for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ )
       {
-        m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad  ) ;
+        m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], pcNewOrg, IPCOLOURSPACE_UNCHANGED,  aiPad, CHROMA_420  ) ;
         apcPicYuvBaseVideo[iBaseViewIdx]->extendPicBorder();
         bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof();
 
-        m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad  ) ;
+        m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], pcNewOrg, IPCOLOURSPACE_UNCHANGED,  aiPad, CHROMA_420  ) ;
         apcPicYuvBaseDepth[iBaseViewIdx]->extendPicBorder();
         bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof();
@@ -997,5 +1014,5 @@
 
       // Write Output
-      m_apcTVideoIOYuvSynthOutput[iViewIdx-1]->write( pcPicYuvSynthOut, 0, 0, 0 );
+      m_apcTVideoIOYuvSynthOutput[iViewIdx-1]->write( pcPicYuvSynthOut,  IPCOLOURSPACE_UNCHANGED, 0, 0, 0, 0, CHROMA_420 );
 
     }
@@ -1005,4 +1022,8 @@
 
   // Delete Buffers
+
+  pcNewOrg->destroy(); 
+  delete pcNewOrg; 
+
   for ( UInt uiBaseView = 0; uiBaseView < m_iNumberOfInputViews; uiBaseView++ )
   {
