Index: /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1471)
+++ /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1472)
@@ -70,6 +70,15 @@
   Int olsIdx;
 #if CONFORMANCE_BITSTREAM_MODE
-  string cfg_confPrefix;
-#endif
+  string confPrefix;
+#endif
+
+  Int* cfg_outputBitDepthY[MAX_LAYERS];
+  Int* cfg_outputBitDepthC[MAX_LAYERS];
+
+  for( Int layer = 0; layer < MAX_LAYERS; layer++ )
+  {
+    cfg_outputBitDepthY[layer] = &m_outputBitDepth[layer][CHANNEL_TYPE_LUMA];
+    cfg_outputBitDepthC[layer] = &m_outputBitDepth[layer][CHANNEL_TYPE_CHROMA];
+  }
 #endif
 
@@ -85,5 +94,6 @@
   ("BitstreamFile,b",           m_bitstreamFileName,                   string(""), "bitstream input file name")
 #if SVC_EXTENSION
-  ("ReconFileL%d,-o%d",                 m_reconFileName,   string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n"
+  ("c",                         po::parseConfigFile,                               "configuration file name")
+  ("ReconFile%d,-o%d",          m_reconFileName,           string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n"
                                                                                    "YUV writing is skipped if omitted")
 #if AVC_BASE
@@ -94,6 +104,6 @@
   ("OutpuLayerSetIdx,-olsidx",                                         olsIdx, -1, "Index of output layer set to be decoded.")
 #if CONFORMANCE_BITSTREAM_MODE
-  ("ConformanceBitstremMode,-confMode",                     m_confModeFlag, false, "Enable generation of conformance bitstream metadata; True: Generate metadata, False: No metadata generated")
-  ("ConformanceMetadataPrefix,           -confPrefix", cfg_confPrefix, string(""), "Prefix for the file name of the conformance data. Default name - 'decodedBitstream'")
+  ("ConformanceBitstremMode,-confMode",                      m_confModeFlag, false, "Enable generation of conformance bitstream metadata; True: Generate metadata, False: No metadata generated")
+  ("ConformanceMetadataPrefix,-confPrefix",                 confPrefix, string(""), "Prefix for the file name of the conformance data. Default name - 'decodedBitstream'")
 #endif
 #else
@@ -103,6 +113,11 @@
   ("WarnUnknowParameter,w",     warnUnknowParameter,                                  0, "warn for unknown configuration parameters instead of failing")
   ("SkipFrames,s",              m_iSkipFrame,                          0,          "number of frames to skip before random access")
+#if SVC_EXTENSION
+  ("OutputBitDepth%d,%d",       cfg_outputBitDepthY,                0, MAX_LAYERS, "bit depth of YUV output luma component (default: use 0 for native depth)")
+  ("OutputBitDepthC%d,%d",      cfg_outputBitDepthC,                0, MAX_LAYERS, "bit depth of YUV output chroma component (default: use 0 for native depth)")
+#else
   ("OutputBitDepth,d",          m_outputBitDepth[CHANNEL_TYPE_LUMA],   0,          "bit depth of YUV output luma component (default: use 0 for native depth)")
   ("OutputBitDepthC,d",         m_outputBitDepth[CHANNEL_TYPE_CHROMA], 0,          "bit depth of YUV output chroma component (default: use 0 for native depth)")
+#endif
   ("OutputColourSpaceConvert",  outputColourSpaceConvert,              string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false))
   ("MaxTemporalLayer,t",        m_iMaxTemporalLayer,                   -1,         "Maximum Temporal Layer to be decoded. -1 to decode all layers")
@@ -168,5 +183,5 @@
     assert( olsIdx != -1 ); // In the conformance mode, target output layer set index is to be explicitly specified.
 
-    if( cfg_confPrefix.empty() )
+    if( confPrefix.empty() )
     {
       m_confPrefix = string("decodedBitstream");
@@ -174,5 +189,5 @@
     else
     {
-      m_confPrefix = cfg_confPrefix;
+      m_confPrefix = confPrefix;
     }
       // Open metadata file and write
Index: /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h
===================================================================
--- /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h	(revision 1471)
+++ /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h	(revision 1472)
@@ -64,5 +64,9 @@
 #endif
   Int           m_iSkipFrame;                           ///< counter for frames prior to the random access point to skip
+#if SVC_EXTENSION
+  Int           m_outputBitDepth[MAX_LAYERS][MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output
+#else
   Int           m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output
+#endif
   InputColourSpaceConversion m_outputColourSpaceConvert;
 
@@ -119,8 +123,18 @@
   , m_bClipOutputVideoToRec709Range(false)
   {
+#if SVC_EXTENSION
+    for( Int layerId = 0; layerId < MAX_LAYERS; layerId++ )
+    {
+      for( UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++ )
+      {
+        m_outputBitDepth[layerId][channelTypeIndex] = 0;
+      }
+    }
+#else
     for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)
     {
       m_outputBitDepth[channelTypeIndex] = 0;
     }
+#endif
   }
 
Index: /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 1471)
+++ /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 1472)
@@ -325,13 +325,14 @@
       if ( !m_reconFileName[curLayerId].empty() && !openedReconFile[curLayerId] )
       {
-        const BitDepths &bitDepths=pcListPic->front()->getSlice(0)->getBitDepths(); // use bit depths of first reconstructed picture.
-        for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
-        {
-          if (m_outputBitDepth[channelType] == 0)
+        const BitDepths& bitDepths = m_apcTDecTop[curLayerId]->getParameterSetManager()->getActiveVPS()->getBitDepths( m_apcTDecTop[curLayerId]->getParameterSetManager()->getActiveSPS(), curLayerId );
+
+        for( UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
+        {
+          if( m_outputBitDepth[curLayerId][channelType] == 0 )
           {
-            m_outputBitDepth[channelType] = bitDepths.recon[channelType];
+            m_outputBitDepth[curLayerId][channelType] = bitDepths.recon[channelType];
           }
         }
-        m_apcTVideoIOYuvReconFile[curLayerId]->open( m_reconFileName[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
+        m_apcTVideoIOYuvReconFile[curLayerId]->open( m_reconFileName[curLayerId], true, m_outputBitDepth[curLayerId], m_outputBitDepth[curLayerId], bitDepths.recon ); // write mode
 
         openedReconFile[curLayerId] = true;
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1471)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1472)
@@ -3477,5 +3477,7 @@
 const BitDepths& TComVPS::getBitDepths( const TComSPS* sps, const UInt layerId ) const
 {
-  static const BitDepths bitDepths( getBitDepth(CHANNEL_TYPE_LUMA, sps, layerId), getBitDepth(CHANNEL_TYPE_CHROMA, sps, layerId) );
+  static BitDepths bitDepths;
+  bitDepths.recon[CHANNEL_TYPE_LUMA]   = getBitDepth(CHANNEL_TYPE_LUMA, sps, layerId);
+  bitDepths.recon[CHANNEL_TYPE_CHROMA] = getBitDepth(CHANNEL_TYPE_CHROMA, sps, layerId);
   return bitDepths;
 }
