Index: trunk/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- trunk/source/App/TAppDecoder/TAppDecTop.cpp	(revision 964)
+++ trunk/source/App/TAppDecoder/TAppDecTop.cpp	(revision 976)
@@ -71,5 +71,5 @@
 #endif
 
-#if H_MV_HLS_7_VPS_P0300_27
+#if H_MV
     m_markedForOutput = false; 
 #endif
@@ -161,7 +161,5 @@
   Int  pocLastPic        = -MAX_INT;   
 
-#if H_MV_HLS_7_VPS_P0300_27
   Int  layerIdLastPic    = -MAX_INT; 
-#endif
   Int  layerIdCurrPic    = 0; 
 
@@ -216,7 +214,5 @@
           || (nalu.m_nalUnitType == NAL_UNIT_VPS && nalu.m_layerId > 0)           
           || (nalu.m_nalUnitType == NAL_UNIT_EOB && nalu.m_layerId > 0)    
-#if H_MV_HLS_8_MIS_Q0177_47
           || (nalu.m_nalUnitType == NAL_UNIT_EOS && nalu.m_layerId > 0)    
-#endif
          ) 
       {
@@ -237,5 +233,4 @@
         // - nalu.isSlice() == true      
 
-#if H_MV_HLS_7_VPS_P0300_27
         if ( nalu.m_nalUnitType == NAL_UNIT_VPS )
         {
@@ -244,10 +239,4 @@
           {
             TComVPS* vps = m_vps; 
-#else
-        // Update TargetDecLayerIdList only when not specified by layer id file, specification by file might actually out of conformance. 
-        if (nalu.m_nalUnitType == NAL_UNIT_VPS && m_targetDecLayerIdSetFileEmpty )
-        {
-          TComVPS* vps = m_tDecTop[decIdx]->getPrefetchedVPS(); 
-#endif
           if ( m_targetOptLayerSetIdx == -1 )
           {
@@ -255,10 +244,9 @@
             m_targetOptLayerSetIdx = vps->getVpsNumLayerSetsMinus1(); 
           }
-#if H_MV_HLS_8_HRD_Q0102_08
+
           for (Int dI = 0; dI < m_numDecoders; dI++ )
           {
             m_tDecTop[decIdx]->setTargetOptLayerSetIdx( m_targetOptLayerSetIdx ); 
           }
-#endif
 
           if ( m_targetOptLayerSetIdx < 0 || m_targetOptLayerSetIdx >= vps->getNumOutputLayerSets() )
@@ -269,7 +257,5 @@
           m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx ); 
         }
-#if H_MV_HLS_7_VPS_P0300_27
-      }
-#endif
+      }
 #if H_3D
         if (nalu.m_nalUnitType == NAL_UNIT_VPS )
@@ -289,7 +275,5 @@
         if ( bNewPicture || !bitstreamFile )
         { 
-#if H_MV_HLS_7_VPS_P0300_27
           layerIdLastPic    = layerIdCurrPic; 
-#endif
           layerIdCurrPic    = nalu.m_layerId; 
           pocLastPic        = pocCurrPic; 
@@ -340,7 +324,5 @@
         assert( decIdxLastPic != -1 ); 
         m_tDecTop[decIdxLastPic]->endPicDecoding(poc, pcListPic, m_targetDecLayerIdSet );
-#if H_MV_HLS_7_VPS_P0300_27
         xMarkForOutput( allLayersDecoded, poc, layerIdLastPic ); 
-#endif
 #else
         m_cTDecTop.executeLoopFilters(poc, pcListPic);
@@ -664,4 +646,188 @@
           const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
 
+          const Bool isTff = pcPicTop->isTopField();
+#if H_MV
+        assert( conf   .getScaledFlag() );
+        assert( defDisp.getScaledFlag() );
+#if ENC_DEC_TRACE 
+        g_bJustDoIt = true;  
+        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  ); 
+        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
+        g_bJustDoIt = false;  
+#endif
+        m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
+#else
+          m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
+#endif
+                                        conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
+                                        conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
+                                        conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
+                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );
+        }
+        
+        // update POC of display order
+#if H_MV
+        m_pocLastDisplay[decIdx] = pcPic->getPOC();
+#else
+        m_iPOCLastDisplay = pcPicBottom->getPOC();
+#endif
+        
+        // erase non-referenced picture in the reference picture list after display
+        if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true )
+        {
+#if !DYN_REF_FREE
+          pcPicTop->setReconMark(false);
+          
+          // mark it should be extended later
+          pcPicTop->getPicYuvRec()->setBorderExtension( false );
+          
+#else
+          pcPicTop->destroy();
+          pcListPic->erase( iterPic );
+          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
+          continue;
+#endif
+        }
+        if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true )
+        {
+#if !DYN_REF_FREE
+          pcPicBottom->setReconMark(false);
+          
+          // mark it should be extended later
+          pcPicBottom->getPicYuvRec()->setBorderExtension( false );
+          
+#else
+          pcPicBottom->destroy();
+          pcListPic->erase( iterPic );
+          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
+          continue;
+#endif
+        }
+        pcPicTop->setOutputMark(false);
+        pcPicBottom->setOutputMark(false);
+      }
+    }
+  }
+  else if (!pcPic->isField()) //Frame Decoding
+  {
+    iterPic = pcListPic->begin();
+    while (iterPic != pcListPic->end())
+    {
+      pcPic = *(iterPic);
+
+#if H_MV
+      if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx] &&
+        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
+#else      
+      if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay &&
+        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
+#endif
+      {
+        // write to file
+        numPicsNotYetDisplayed--;
+        if(pcPic->getSlice(0)->isReferenced() == false)
+        {
+          dpbFullness--;
+        }
+#if H_MV
+      if ( m_pchReconFiles[decIdx] )
+#else
+        if ( m_pchReconFile )
+#endif
+        {
+          const Window &conf = pcPic->getConformanceWindow();
+          const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
+#if H_MV
+        assert( conf   .getScaledFlag() );
+        assert( defDisp.getScaledFlag() );
+#if ENC_DEC_TRACE
+        g_bJustDoIt = true;  
+        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  ); 
+        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
+        g_bJustDoIt = false; 
+#endif
+        m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
+#else
+          m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),
+#endif
+                                        conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
+                                        conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
+                                        conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
+                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
+        }
+        
+        // update POC of display order
+#if H_MV
+        m_pocLastDisplay[decIdx] = pcPic->getPOC();
+#else
+        m_iPOCLastDisplay = pcPic->getPOC();
+#endif
+        
+        // erase non-referenced picture in the reference picture list after display
+        if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )
+        {
+#if !DYN_REF_FREE
+          pcPic->setReconMark(false);
+          
+          // mark it should be extended later
+          pcPic->getPicYuvRec()->setBorderExtension( false );
+          
+#else
+          pcPic->destroy();
+          pcListPic->erase( iterPic );
+          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
+          continue;
+#endif
+        }
+        pcPic->setOutputMark(false);
+#if H_MV
+        pcPic->setPicOutputFlag(false);
+#endif
+      }
+      
+      iterPic++;
+    }
+  }
+}
+/** \param pcListPic list of pictures to be written to file
+    \todo            DYN_REF_FREE should be revised
+ */
+#if H_MV
+Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, Int decIdx )
+#else
+Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic )
+#endif
+{
+  if(!pcListPic || pcListPic->empty())
+  {
+    return;
+  }
+  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
+  
+  iterPic   = pcListPic->begin();
+  TComPic* pcPic = *(iterPic);
+  
+  if (pcPic->isField()) //Field Decoding
+  {
+    TComList<TComPic*>::iterator endPic   = pcListPic->end();
+    endPic--;
+    TComPic *pcPicTop, *pcPicBottom = NULL;
+    while (iterPic != endPic)
+    {
+      pcPicTop = *(iterPic);
+      iterPic++;
+      pcPicBottom = *(iterPic);
+      
+      if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) )
+      {
+        // write to file
+#if H_MV
+      if ( m_pchReconFiles[decIdx] )
+#else
+        if ( m_pchReconFile )
+#endif
+        {
+          const Window &conf = pcPicTop->getConformanceWindow();
+          const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
           const Bool isTff = pcPicTop->isTopField();
 #if H_MV
@@ -686,9 +852,8 @@
         // update POC of display order
 #if H_MV
-        m_pocLastDisplay[decIdx] = pcPic->getPOC();
-#else
-        m_iPOCLastDisplay = pcPicBottom->getPOC();
-#endif
-        
+      m_pocLastDisplay[decIdx] = pcPic->getPOC();
+#else
+      m_iPOCLastDisplay = pcPicBottom->getPOC();
+#endif        
         // erase non-referenced picture in the reference picture list after display
         if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true )
@@ -724,28 +889,31 @@
         pcPicTop->setOutputMark(false);
         pcPicBottom->setOutputMark(false);
-      }
-    }
-  }
-  else if (!pcPic->isField()) //Frame Decoding
-  {
-    iterPic = pcListPic->begin();
+        
+#if !DYN_REF_FREE
+        if(pcPicTop)
+        {
+          pcPicTop->destroy();
+          delete pcPicTop;
+          pcPicTop = NULL;
+        }
+#endif
+      }
+    }
+    if(pcPicBottom)
+    {
+      pcPicBottom->destroy();
+      delete pcPicBottom;
+      pcPicBottom = NULL;
+    }
+  }
+  else //Frame decoding
+  {
     while (iterPic != pcListPic->end())
     {
       pcPic = *(iterPic);
-
-#if H_MV
-      if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx] &&
-        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
-#else      
-      if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay &&
-        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
-#endif
+      
+      if ( pcPic->getOutputMark() )
       {
         // write to file
-        numPicsNotYetDisplayed--;
-        if(pcPic->getSlice(0)->isReferenced() == false)
-        {
-          dpbFullness--;
-        }
 #if H_MV
       if ( m_pchReconFiles[decIdx] )
@@ -756,97 +924,4 @@
           const Window &conf = pcPic->getConformanceWindow();
           const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
-#if H_MV
-        assert( conf   .getScaledFlag() );
-        assert( defDisp.getScaledFlag() );
-#if ENC_DEC_TRACE
-        g_bJustDoIt = true;  
-        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  ); 
-        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
-        g_bJustDoIt = false; 
-#endif
-        m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
-#else
-          m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),
-#endif
-                                        conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
-                                        conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
-                                        conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
-                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
-        }
-        
-        // update POC of display order
-#if H_MV
-        m_pocLastDisplay[decIdx] = pcPic->getPOC();
-#else
-        m_iPOCLastDisplay = pcPic->getPOC();
-#endif
-        
-        // erase non-referenced picture in the reference picture list after display
-        if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )
-        {
-#if !DYN_REF_FREE
-          pcPic->setReconMark(false);
-          
-          // mark it should be extended later
-          pcPic->getPicYuvRec()->setBorderExtension( false );
-          
-#else
-          pcPic->destroy();
-          pcListPic->erase( iterPic );
-          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
-          continue;
-#endif
-        }
-        pcPic->setOutputMark(false);
-#if H_MV_HLS_7_VPS_P0300_27
-        pcPic->setPicOutputFlag(false);
-#endif
-      }
-      
-      iterPic++;
-    }
-  }
-}
-/** \param pcListPic list of pictures to be written to file
-    \todo            DYN_REF_FREE should be revised
- */
-#if H_MV
-Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, Int decIdx )
-#else
-Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic )
-#endif
-{
-  if(!pcListPic || pcListPic->empty())
-  {
-    return;
-  }
-  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
-  
-  iterPic   = pcListPic->begin();
-  TComPic* pcPic = *(iterPic);
-  
-  if (pcPic->isField()) //Field Decoding
-  {
-    TComList<TComPic*>::iterator endPic   = pcListPic->end();
-    endPic--;
-    TComPic *pcPicTop, *pcPicBottom = NULL;
-    while (iterPic != endPic)
-    {
-      pcPicTop = *(iterPic);
-      iterPic++;
-      pcPicBottom = *(iterPic);
-      
-      if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) )
-      {
-        // write to file
-#if H_MV
-      if ( m_pchReconFiles[decIdx] )
-#else
-        if ( m_pchReconFile )
-#endif
-        {
-          const Window &conf = pcPicTop->getConformanceWindow();
-          const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
-          const Bool isTff = pcPicTop->isTopField();
 #if H_MV
         assert( conf   .getScaledFlag() );
@@ -858,97 +933,4 @@
         g_bJustDoIt = false;  
 #endif
-        m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
-#else
-          m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
-#endif
-                                        conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
-                                        conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
-                                        conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
-                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );
-        }
-        
-        // update POC of display order
-#if H_MV
-      m_pocLastDisplay[decIdx] = pcPic->getPOC();
-#else
-      m_iPOCLastDisplay = pcPicBottom->getPOC();
-#endif        
-        // erase non-referenced picture in the reference picture list after display
-        if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true )
-        {
-#if !DYN_REF_FREE
-          pcPicTop->setReconMark(false);
-          
-          // mark it should be extended later
-          pcPicTop->getPicYuvRec()->setBorderExtension( false );
-          
-#else
-          pcPicTop->destroy();
-          pcListPic->erase( iterPic );
-          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
-          continue;
-#endif
-        }
-        if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true )
-        {
-#if !DYN_REF_FREE
-          pcPicBottom->setReconMark(false);
-          
-          // mark it should be extended later
-          pcPicBottom->getPicYuvRec()->setBorderExtension( false );
-          
-#else
-          pcPicBottom->destroy();
-          pcListPic->erase( iterPic );
-          iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!
-          continue;
-#endif
-        }
-        pcPicTop->setOutputMark(false);
-        pcPicBottom->setOutputMark(false);
-        
-#if !DYN_REF_FREE
-        if(pcPicTop)
-        {
-          pcPicTop->destroy();
-          delete pcPicTop;
-          pcPicTop = NULL;
-        }
-#endif
-      }
-    }
-    if(pcPicBottom)
-    {
-      pcPicBottom->destroy();
-      delete pcPicBottom;
-      pcPicBottom = NULL;
-    }
-  }
-  else //Frame decoding
-  {
-    while (iterPic != pcListPic->end())
-    {
-      pcPic = *(iterPic);
-      
-      if ( pcPic->getOutputMark() )
-      {
-        // write to file
-#if H_MV
-      if ( m_pchReconFiles[decIdx] )
-#else
-        if ( m_pchReconFile )
-#endif
-        {
-          const Window &conf = pcPic->getConformanceWindow();
-          const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
-#if H_MV
-        assert( conf   .getScaledFlag() );
-        assert( defDisp.getScaledFlag() );
-#if ENC_DEC_TRACE
-        g_bJustDoIt = true;  
-        writeToTraceFile( "OutputPic Poc"   , pcPic->getPOC    (), g_decTracePicOutput  ); 
-        writeToTraceFile( "OutputPic LayerId", pcPic->getLayerId(), g_decTracePicOutput );         
-        g_bJustDoIt = false;  
-#endif
         m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(),
 #else
@@ -985,5 +967,5 @@
         }
         pcPic->setOutputMark(false);
-#if H_MV_HLS_7_VPS_P0300_27
+#if H_MV
         pcPic->setPicOutputFlag(false);
 #endif
@@ -1061,7 +1043,5 @@
     m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists ); 
     m_tDecTop[ decIdx ]->setLayerInitilizedFlags( m_layerInitilizedFlags );
-#if    H_MV_HLS_8_HRD_Q0102_08
     m_tDecTop[ decIdx ]->setTargetOptLayerSetIdx( m_targetOptLayerSetIdx );    
-#endif
 
 #if H_3D
@@ -1099,6 +1079,4 @@
 }
 
-
-#if H_MV_HLS_7_VPS_P0300_27
 Void TAppDecTop::xMarkForOutput( Bool allLayersDecoded, Int pocLastPic, Int layerIdLastPic )
 {  
@@ -1152,5 +1130,39 @@
   }
 }
-#endif
+
+Void TAppDecTop::xMarkAltOutPic( Int targetOutputLayer, Int pocLastPic )
+{
+  Int optLayerIdxInVps = m_vps->getLayerIdInNuh( targetOutputLayer ); 
+  Int highestNuhLayerId = -1; 
+  TComPic* picWithHighestNuhLayerId = NULL; 
+  for (Int dIdx = 0; dIdx < m_numDecoders; dIdx++)
+  {
+    Int curLayerId = m_tDecTop[dIdx]->getLayerId();
+    Int curLayerIdxInVps = m_vps->getLayerIdInNuh( curLayerId  ); 
+    if ( m_vps->getInDirectDependencyFlag(optLayerIdxInVps, curLayerIdxInVps ) )
+    {
+      TComPic* curPic = m_ivPicLists.getPic( curLayerId, pocLastPic ); 
+      if (curPic != NULL)
+      {
+        if (curPic->getReconMark() && curPic->getPicOutputFlag() )
+        {
+          curPic->setOutputMark   ( false ); 
+          curPic->setPicOutputFlag( false ); 
+          if ( curLayerId > highestNuhLayerId)
+          {
+            highestNuhLayerId = curLayerId ; 
+            picWithHighestNuhLayerId = curPic; 
+          }            
+        }
+      }
+    }
+  }
+  if ( picWithHighestNuhLayerId != NULL )
+  {
+    picWithHighestNuhLayerId->setPicOutputFlag(true); 
+    picWithHighestNuhLayerId->setOutputMark   (true); 
+  }
+}
+
 #endif
 //! \}
Index: trunk/source/App/TAppDecoder/TAppDecTop.h
===================================================================
--- trunk/source/App/TAppDecoder/TAppDecTop.h	(revision 964)
+++ trunk/source/App/TAppDecoder/TAppDecTop.h	(revision 976)
@@ -68,7 +68,5 @@
   TComPicLists                    m_ivPicLists;                                ///< picture buffers of decoder instances
   Bool                            m_layerInitilizedFlags[ MAX_NUM_LAYER_IDS ]; ///< for layerwise startup 
-#if H_MV_HLS_7_VPS_P0300_27
   TComVPS*                        m_vps;                                ///< active VPS
-#endif
 #else
   TDecTop                         m_cTDecTop;                     ///< decoder class
@@ -79,11 +77,8 @@
   Int                             m_pocLastDisplay      [ MAX_NUM_LAYERS ]; ///< last POC in display order
   Bool                            m_reconOpen           [ MAX_NUM_LAYERS ]; ///< reconstruction file opened
+  Bool                            m_markedForOutput; 
 #else
   Int                             m_iPOCLastDisplay;              ///< last POC in display order
 #endif
-#if H_MV_HLS_7_VPS_P0300_27
-  Bool                            m_markedForOutput; 
-#endif
-
 
 #if H_3D
@@ -107,40 +102,6 @@
   Void  xWriteOutput      ( TComList<TComPic*>* pcListPic, Int layerId, Int tId ); ///< write YUV to file
 
-#if H_MV_HLS_7_VPS_P0300_27
   Void  xMarkForOutput   ( Bool allLayersDecoded, Int pocLastPic, Int layerIdLastPic );         
-  Void  xMarkAltOutPic    ( Int targetOutputLayer, Int pocLastPic )
-  {
-    Int optLayerIdxInVps = m_vps->getLayerIdInNuh( targetOutputLayer ); 
-    Int highestNuhLayerId = -1; 
-    TComPic* picWithHighestNuhLayerId = NULL; 
-    for (Int dIdx = 0; dIdx < m_numDecoders; dIdx++)
-    {
-      Int curLayerId = m_tDecTop[dIdx]->getLayerId();
-      Int curLayerIdxInVps = m_vps->getLayerIdInNuh( curLayerId  ); 
-      if ( m_vps->getInDirectDependencyFlag(optLayerIdxInVps, curLayerIdxInVps ) )
-      {
-        TComPic* curPic = m_ivPicLists.getPic( curLayerId, pocLastPic ); 
-        if (curPic != NULL)
-        {
-          if (curPic->getReconMark() && curPic->getPicOutputFlag() )
-          {
-            curPic->setOutputMark   ( false ); 
-            curPic->setPicOutputFlag( false ); 
-            if ( curLayerId > highestNuhLayerId)
-            {
-              highestNuhLayerId = curLayerId ; 
-              picWithHighestNuhLayerId = curPic; 
-            }            
-          }
-        }
-      }
-    }
-    if ( picWithHighestNuhLayerId != NULL )
-    {
-      picWithHighestNuhLayerId->setPicOutputFlag(true); 
-      picWithHighestNuhLayerId->setOutputMark   (true); 
-    }
-  }
-#endif
+  Void  xMarkAltOutPic    ( Int targetOutputLayer, Int pocLastPic );
 
   Void  xFlushOutput      ( TComList<TComPic*>* pcListPic, Int layerId ); ///< flush all remaining decoded pictures to file
