Index: /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1442)
@@ -63,10 +63,8 @@
     \param argv array of arguments
  */
-Bool TAppDecCfg::parseCfg( Int argc, Char* argv[] )
+Bool TAppDecCfg::parseCfg( Int argc, TChar* argv[] )
 {
   Bool do_help = false;
-  string cfg_BitstreamFile;
-#if SVC_EXTENSION
-  string cfg_ReconFile [MAX_LAYERS];
+#if SVC_EXTENSION  
   Int layerNum, targetLayerId;
   Int olsIdx;
@@ -74,9 +72,4 @@
   string cfg_confPrefix;
 #endif
-#if AVC_BASE
-  string cfg_BLReconFile;
-#endif
-#else
-  string cfg_ReconFile;
 #endif
 
@@ -90,10 +83,10 @@
 
   ("help",                      do_help,                               false,      "this help text")
-  ("BitstreamFile,b",           cfg_BitstreamFile,                     string(""), "bitstream input file name")
-#if SVC_EXTENSION
-  ("ReconFileL%d,-o%d",                   cfg_ReconFile,   string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n"
+  ("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"
                                                                                    "YUV writing is skipped if omitted")
 #if AVC_BASE
-  ("BLReconFile,-ibl",                               cfg_BLReconFile,  string(""), "BL reconstructed YUV input file name")
+  ("BLReconFile,-ibl",                              m_reconFileNameBL, string(""), "BL reconstructed YUV input file name")
 #endif
   ("TargetLayerId,-lid",                                        targetLayerId, -1, "Target layer id")
@@ -105,5 +98,5 @@
 #endif
 #else
-  ("ReconFile,o",               cfg_ReconFile,                         string(""), "reconstructed YUV output file name\n"
+  ("ReconFile,o",               m_reconFileName,                       string(""), "reconstructed YUV output file name\n"
                                                                                    "YUV writing is skipped if omitted")
 #endif
@@ -134,7 +127,7 @@
   po::setDefaults(opts);
   po::ErrorReporter err;
-  const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv, err);
-
-  for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
+  const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err);
+
+  for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
   {
     fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it);
@@ -163,6 +156,4 @@
   }
 
-  /* convert std::string to c string for compatability */
-  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
 #if SVC_EXTENSION
   if( targetLayerId < 0 )
@@ -204,23 +195,7 @@
   m_commonDecoderParams.setTargetOutputLayerSetIdx( olsIdx );
   m_commonDecoderParams.setTargetLayerId( targetLayerId );
-
-#if CONFORMANCE_BITSTREAM_MODE
-  for(Int layer = 0; layer < MAX_VPS_LAYER_IDX_PLUS1; layer++ )
-  {
-#else
-  for(UInt layer=0; layer<= m_tgtLayerId; layer++)
-  {
-    assert( layer < MAX_LAYERS );
-#endif
-    m_pchReconFile[layer] = cfg_ReconFile[layer].empty() ? NULL : strdup(cfg_ReconFile[layer].c_str());
-  }
-#if AVC_BASE
-  m_pchBLReconFile = cfg_BLReconFile.empty() ? NULL : strdup(cfg_BLReconFile.c_str());
-#endif
-#else
-  m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
-#endif
-
-  if (!m_pchBitstreamFile)
+#endif
+
+  if (m_bitstreamFileName.empty())
   {
     fprintf(stderr, "No input file specified, aborting\n");
Index: /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h
===================================================================
--- /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h	(revision 1442)
@@ -57,9 +57,9 @@
 {
 protected:
-  Char*         m_pchBitstreamFile;                     ///< input bitstream file name
+  std::string   m_bitstreamFileName;                    ///< input bitstream file name
 #if SVC_EXTENSION
-  Char*         m_pchReconFile [MAX_LAYERS];          ///< output reconstruction file name
+  std::string   m_reconFileName[MAX_LAYERS];            ///< output reconstruction file name
 #else
-  Char*         m_pchReconFile;                         ///< output reconstruction file name
+  std::string   m_reconFileName;                        ///< output reconstruction file name
 #endif
   Int           m_iSkipFrame;                           ///< counter for frames prior to the random access point to skip
@@ -84,5 +84,5 @@
 #if SVC_EXTENSION
 #if AVC_BASE
-  Char*         m_pchBLReconFile;                     ///< input BL reconstruction file name
+  std::string   m_reconFileNameBL;                     ///< input BL reconstruction file name
 #endif
   CommonDecoderParams             m_commonDecoderParams;
@@ -99,13 +99,15 @@
 public:
   TAppDecCfg()
-  : m_pchBitstreamFile(NULL)
+  : m_bitstreamFileName()
 #if !SVC_EXTENSION
-  , m_pchReconFile(NULL)
+  , m_reconFileName()
 #endif
   , m_iSkipFrame(0)
+  // m_outputBitDepth array initialised below
   , m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
   , m_iMaxTemporalLayer(-1)
   , m_decodedPictureHashSEIEnabled(0)
   , m_decodedNoDisplaySEIEnabled(false)
+  , m_targetDecLayerIdSet()
 #if Q0074_COLOUR_REMAPPING_SEI
   , m_colourRemapSEIEnabled(0)
@@ -115,4 +117,6 @@
   , m_forceDecodeBitDepth(0)
 #endif
+  , m_outputDecodedSEIMessagesFilename()
+  , m_bClipOutputVideoToRec709Range(false)
   {
     for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)
@@ -124,5 +128,5 @@
   virtual ~TAppDecCfg() {}
 
-  Bool  parseCfg        ( Int argc, Char* argv[] );   ///< initialize option class from configuration
+  Bool  parseCfg        ( Int argc, TChar* argv[] );   ///< initialize option class from configuration
 
 #if SVC_EXTENSION
Index: /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 1442)
@@ -90,9 +90,5 @@
 Void TAppDecTop::destroy()
 {
-  if (m_pchBitstreamFile)
-  {
-    free (m_pchBitstreamFile);
-    m_pchBitstreamFile = NULL;
-  }
+  m_bitstreamFileName.clear();
 #if SVC_EXTENSION
 #if CONFORMANCE_BITSTREAM_MODE
@@ -102,9 +98,5 @@
 #endif
   {
-    if( m_pchReconFile[i] )
-    {
-      free ( m_pchReconFile[i] );
-      m_pchReconFile[i] = NULL;
-    }
+    m_reconFileName[i].clear();
 
     if( m_apcTDecTop[i] )
@@ -121,16 +113,8 @@
   }
 #if AVC_BASE
-  if( m_pchBLReconFile )
-  {
-    free ( m_pchBLReconFile );
-    m_pchBLReconFile = NULL;
-  }
-#endif
-#else
-  if (m_pchReconFile)
-  {
-    free (m_pchReconFile);
-    m_pchReconFile = NULL;
-  }
+  m_reconFileNameBL.clear();
+#endif
+#else
+  m_reconFileName.clear();
 #endif
 #if Q0074_COLOUR_REMAPPING_SEI
@@ -160,8 +144,8 @@
   TComList<TComPic*>* pcListPic = NULL;
 
-  ifstream bitstreamFile(m_pchBitstreamFile, ifstream::in | ifstream::binary);
+  ifstream bitstreamFile(m_bitstreamFileName.c_str(), ifstream::in | ifstream::binary);
   if (!bitstreamFile)
   {
-    fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_pchBitstreamFile);
+    fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_bitstreamFileName.c_str());
     exit(EXIT_FAILURE);
   }
@@ -203,7 +187,7 @@
   TComPic pcBLPic;
   fstream streamYUV;
-  if( m_pchBLReconFile )
-  {
-    streamYUV.open( m_pchBLReconFile, fstream::in | fstream::binary );
+  if( !m_reconFileNameBL.empty() )
+  {
+    streamYUV.open( m_reconFileNameBL, fstream::in | fstream::binary );
   }
   TComList<TComPic*> *cListPic = m_apcTDecTop[0]->getListPic();
@@ -329,5 +313,5 @@
     if( pcListPic )
     {
-      if ( m_pchReconFile[curLayerId] && !openedReconFile[curLayerId] )
+      if ( !m_reconFileName[curLayerId].empty() && !openedReconFile[curLayerId] )
       {
         const BitDepths &bitDepths=pcListPic->front()->getSlice(0)->getBitDepths(); // use bit depths of first reconstructed picture.
@@ -339,5 +323,5 @@
           }
         }
-        m_apcTVideoIOYuvReconFile[curLayerId]->open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
+        m_apcTVideoIOYuvReconFile[curLayerId]->open( m_reconFileName[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
 
         openedReconFile[curLayerId] = true;
@@ -442,8 +426,8 @@
   TComList<TComPic*>* pcListPic = NULL;
 
-  ifstream bitstreamFile(m_pchBitstreamFile, ifstream::in | ifstream::binary);
+  ifstream bitstreamFile(m_bitstreamFileName.c_str(), ifstream::in | ifstream::binary);
   if (!bitstreamFile)
   {
-    fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_pchBitstreamFile);
+    fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_bitstreamFileName.c_str());
     exit(EXIT_FAILURE);
   }
@@ -548,5 +532,5 @@
     if( pcListPic )
     {
-      if ( m_pchReconFile && !openedReconFile )
+      if ( (!m_reconFileName.empty()) && (!openedReconFile) )
       {
         const BitDepths &bitDepths=pcListPic->front()->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture.
@@ -559,5 +543,5 @@
         }
 
-        m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
+        m_cTVideoIOYuvReconFile.open( m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
         openedReconFile = true;
       }
@@ -648,5 +632,5 @@
 #endif
   {
-    if ( m_pchReconFile[layer] )
+    if ( !m_reconFileName[layer].empty() )
     {
       m_apcTVideoIOYuvReconFile[layer]->close();
@@ -657,7 +641,7 @@
   }
 #else
-  if ( m_pchReconFile )
-  {
-    m_cTVideoIOYuvReconFile. close();
+  if ( !m_reconFileName.empty() )
+  {
+    m_cTVideoIOYuvReconFile.close();
   }
 
@@ -792,5 +776,5 @@
         numPicsNotYetDisplayed = numPicsNotYetDisplayed-2;
 #if SVC_EXTENSION
-        if ( m_pchReconFile[layerId] )
+        if ( !m_reconFileName[layerId].empty() )
         {
           const Window &conf = pcPicTop->getConformanceWindow();
@@ -826,5 +810,5 @@
         m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC();
 #else
-        if ( m_pchReconFile )
+        if ( !m_reconFileName.empty() )
         {
           const Window &conf = pcPicTop->getConformanceWindow();
@@ -901,5 +885,5 @@
         }
 #if SVC_EXTENSION
-        if( m_pchReconFile[layerId] )
+        if ( !m_reconFileName[layerId].empty() )
         {
           const Window &conf = pcPic->getConformanceWindow();
@@ -920,5 +904,5 @@
         m_aiPOCLastDisplay[layerId] = pcPic->getPOC();
 #else
-        if ( m_pchReconFile )
+        if ( !m_reconFileName.empty() )
         {
           const Window &conf    = pcPic->getConformanceWindow();
@@ -1024,5 +1008,5 @@
         // write to file
 #if SVC_EXTENSION
-        if ( m_pchReconFile[layerId] )
+        if ( !m_reconFileName[layerId].empty() )
         {
           const Window &conf = pcPicTop->getConformanceWindow();
@@ -1043,5 +1027,5 @@
         m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC();
 #else
-        if ( m_pchReconFile )
+        if ( !m_reconFileName.empty() )
         {
           const Window &conf = pcPicTop->getConformanceWindow();
@@ -1103,5 +1087,5 @@
         // write to file
 #if SVC_EXTENSION
-        if ( m_pchReconFile[layerId] )
+        if ( !m_reconFileName[layerId].empty() )
         {
           const Window &conf = pcPic->getConformanceWindow();
@@ -1123,5 +1107,5 @@
         m_aiPOCLastDisplay[layerId] = pcPic->getPOC();
 #else
-        if ( m_pchReconFile )
+        if ( !m_reconFileName.empty() )
         {
           const Window &conf    = pcPic->getConformanceWindow();
@@ -1234,7 +1218,7 @@
 #if ALIGNED_BUMPING
 // Function outputs a picture, and marks it as not needed for output.
-Void TAppDecTop::xOutputAndMarkPic( TComPic *pic, const Char *reconFile, const Int layerId, Int &pocLastDisplay, DpbStatus &dpbStatus )
-{
-  if ( reconFile )
+Void TAppDecTop::xOutputAndMarkPic( TComPic *pic, std::string& reconFileName, const Int layerId, Int &pocLastDisplay, DpbStatus &dpbStatus )
+{
+  if( !reconFileName.empty() )
   {
     const Window &conf = pic->getConformanceWindow();
@@ -1488,5 +1472,5 @@
       TComPic *pic = *iterPic;
 
-      xOutputAndMarkPic( pic, m_pchReconFile[layerId], layerId, m_aiPOCLastDisplay[layerId], dpbStatus );
+      xOutputAndMarkPic( pic, m_reconFileName[layerId], layerId, m_aiPOCLastDisplay[layerId], dpbStatus );
 
 #if CONFORMANCE_BITSTREAM_MODE
@@ -1961,5 +1945,5 @@
 
     //Write remapped picture in decoding order
-    Char  cTemp[255];
+    TChar  cTemp[255];
     sprintf(cTemp, "seiColourRemappedPic_L%d_%dx%d_%dbits.yuv", layerId, iWidth, iHeight, storeCriSEI[layerId].m_colourRemapBitDepth );
     picColourRemapped.dump( cTemp, true, storeCriSEI[layerId].m_colourRemapBitDepth );
@@ -1974,5 +1958,5 @@
     if (storeCriSEI[layerId].m_colourRemapBitDepth == 8 || storeCriSEI[layerId].m_colourRemapBitDepth == 10)
     {
-      Char  cTemp[255];
+      TChar  cTemp[255];
       sprintf(cTemp, "seiColourRemappedPic_L%d_%dx%d_%dbits.yuv", layerId, pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), storeCriSEI[layerId].m_colourRemapBitDepth );
       pic.dump( cTemp, true, storeCriSEI[layerId].m_colourRemapBitDepth );
Index: /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h
===================================================================
--- /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h	(revision 1442)
@@ -136,5 +136,5 @@
   Void flushAllPictures(Int layerId, Bool outputPictures);
 
-  Void xOutputAndMarkPic( TComPic *pic, const Char *reconFile, const Int layerId, Int &pocLastDisplay, DpbStatus &dpbStatus);
+  Void xOutputAndMarkPic( TComPic *pic, std::string& reconFileName, const Int layerId, Int &pocLastDisplay, DpbStatus &dpbStatus);
   Void outputAllPictures(Int layerId, Bool notOutputCurrAu);
   Void xFindDPBStatus( std::vector<Int> &listOfPocs
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1442)
@@ -110,10 +110,9 @@
 TAppEncCfg::TAppEncCfg()
 #if AVC_BASE
-: m_nonHEVCBaseLayerFlag(0)
+: m_nonHEVCBaseLayerFlag(false)
 #endif
 , m_maxTidRefPresentFlag(1)
 , m_defaultTargetOutputLayerIdc (-1)
 , m_numOutputLayerSets          (-1)
-, m_pchBitstreamFile()
 , m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
 , m_snrInternalColourSpace(false)
@@ -126,12 +125,7 @@
 #else
 TAppEncCfg::TAppEncCfg()
-: m_pchInputFile()
-, m_pchBitstreamFile()
-, m_pchReconFile()
-, m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
+: m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
 , m_snrInternalColourSpace(false)
 , m_outputInternalColourSpace(false)
-, m_pchdQPFile()
-, m_scalingListFile()
 {
   m_aidQP = NULL;
@@ -164,13 +158,5 @@
     m_targetPivotValue = NULL;
   }
-
-  free(m_pchInputFile);
-#endif
-  free(m_pchBitstreamFile);
-#if !SVC_EXTENSION  
-  free(m_pchReconFile);
-  free(m_pchdQPFile);
-  free(m_scalingListFile);
-#endif
+#endif  
 }
 
@@ -240,5 +226,5 @@
 }
 
-Bool confirmPara(Bool bflag, const Char* message);
+Bool confirmPara(Bool bflag, const TChar* message);
 
 static inline ChromaFormat numberToChromaFormat(const Int val)
@@ -254,33 +240,7 @@
 }
 
-#if SVC_EXTENSION
-void TAppEncCfg::getDirFilename(string& filename, string& dir, const string path)
-{
-  size_t pos = path.find_last_of("\\");
-  if(pos != std::string::npos)
-  {
-    filename.assign(path.begin() + pos + 1, path.end());
-    dir.assign(path.begin(), path.begin() + pos + 1);
-  }
-  else
-  {
-    pos = path.find_last_of("/");
-    if(pos != std::string::npos)
-    {
-      filename.assign(path.begin() + pos + 1, path.end());
-      dir.assign(path.begin(), path.begin() + pos + 1);
-    }
-    else
-    {
-      filename = path;
-      dir.assign("");
-    }
-  }
-}
-#endif
-
 static const struct MapStrToProfile
 {
-  const Char* str;
+  const TChar* str;
   Profile::Name value;
 }
@@ -302,5 +262,5 @@
 static const struct MapStrToExtendedProfile
 {
-  const Char* str;
+  const TChar* str;
   ExtendedProfileName value;
 }
@@ -366,5 +326,5 @@
 static const struct MapStrToTier
 {
-  const Char* str;
+  const TChar* str;
   Level::Tier value;
 }
@@ -377,5 +337,5 @@
 static const struct MapStrToLevel
 {
-  const Char* str;
+  const TChar* str;
   Level::Name value;
 }
@@ -410,5 +370,5 @@
 static const struct MapStrToCostMode
 {
-  const Char* str;
+  const TChar* str;
   CostMode    value;
 }
@@ -423,5 +383,5 @@
 static const struct MapStrToScalingListMode
 {
-  const Char* str;
+  const TChar* str;
   ScalingListMode value;
 }
@@ -526,5 +486,5 @@
   SMultiValueInput<T> &operator=(const SMultiValueInput<T> &userValues) { values=userValues.values; return *this; }
 
-  T readValue(const Char *&pStr, Bool &bSuccess);
+  T readValue(const TChar *&pStr, Bool &bSuccess);
 
   istream& readValues(std::istream &in);
@@ -538,7 +498,7 @@
 
 template<>
-UInt SMultiValueInput<UInt>::readValue(const Char *&pStr, Bool &bSuccess)
+UInt SMultiValueInput<UInt>::readValue(const TChar *&pStr, Bool &bSuccess)
 {
-  Char *eptr;
+  TChar *eptr;
   UInt val=strtoul(pStr, &eptr, 0);
   pStr=eptr;
@@ -548,7 +508,7 @@
 
 template<>
-Int SMultiValueInput<Int>::readValue(const Char *&pStr, Bool &bSuccess)
+Int SMultiValueInput<Int>::readValue(const TChar *&pStr, Bool &bSuccess)
 {
-  Char *eptr;
+  TChar *eptr;
   Int val=strtol(pStr, &eptr, 0);
   pStr=eptr;
@@ -558,7 +518,7 @@
 
 template<>
-Double SMultiValueInput<Double>::readValue(const Char *&pStr, Bool &bSuccess)
+Double SMultiValueInput<Double>::readValue(const TChar *&pStr, Bool &bSuccess)
 {
-  Char *eptr;
+  TChar *eptr;
   Double val=strtod(pStr, &eptr);
   pStr=eptr;
@@ -568,7 +528,7 @@
 
 template<>
-Bool SMultiValueInput<Bool>::readValue(const Char *&pStr, Bool &bSuccess)
+Bool SMultiValueInput<Bool>::readValue(const TChar *&pStr, Bool &bSuccess)
 {
-  Char *eptr;
+  TChar *eptr;
   Int val=strtol(pStr, &eptr, 0);
   pStr=eptr;
@@ -588,5 +548,5 @@
   if (!str.empty())
   {
-    const Char *pStr=str.c_str();
+    const TChar *pStr=str.c_str();
     // soak up any whitespace
     for(;isspace(*pStr);pStr++);
@@ -703,52 +663,18 @@
 // ====================================================================================================================
 
-#if SVC_EXTENSION
 /** \param  argc        number of arguments
     \param  argv        array of arguments
     \retval             true when success
  */
-Bool TAppEncCfg::parseCfgNumLayersAndInit( Int argc, Char* argv[] )
-{
-  po::Options opts;
-  opts.addOptions()
-  ("c",    po::parseConfigFile, "configuration file name")
-  ("NumLayers",                                     m_numLayers,                                             1, "Number of layers to code")
-  ;
-
-  po::setDefaults(opts);
-  po::ErrorReporter err;
-  err.verbose = false;
-  po::scanArgv(opts, argc, (const Char**) argv, err);
-
-  if( m_numLayers <= 0 )
-  {
-    printf("Wrong number of layers %d\n", m_numLayers);
-    return false;
-  }
-
-  for( Int layer = 0; layer < m_numLayers; layer++ )
-  {
-    m_apcLayerCfg[layer] = new TAppEncLayerCfg;
-    m_apcLayerCfg[layer]->setAppEncCfg(this);
-  }
-
-  return true;
-}
-#endif
-
-/** \param  argc        number of arguments
-    \param  argv        array of arguments
-    \retval             true when success
- */
-Bool TAppEncCfg::parseCfg( Int argc, Char* argv[] )
+Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
 {
   Bool do_help = false;
   
-#if SVC_EXTENSION
-  string  cfg_BitstreamFile;
-  string* cfg_InputFile      [MAX_LAYERS];
-  string* cfg_ReconFile      [MAX_LAYERS];
-  Double* cfg_fQP            [MAX_LAYERS];
-  Int*    cfg_layerId        [MAX_LAYERS];
+#if SVC_EXTENSION  
+  string* cfg_InputFile     [MAX_LAYERS];
+  string* cfg_ReconFile     [MAX_LAYERS];
+  string* cfg_dQPFileName   [MAX_LAYERS];
+  Double* cfg_fQP           [MAX_LAYERS];
+  Int*    cfg_layerId       [MAX_LAYERS];
   Int*    cfg_repFormatIdx  [MAX_LAYERS];
   Int*    cfg_SourceWidth   [MAX_LAYERS]; 
@@ -848,5 +774,5 @@
   Int*    cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; 
 #if Q0074_COLOUR_REMAPPING_SEI
-  string* cfg_colourRemapSEIFileRoot[MAX_LAYERS];
+  string* cfg_colourRemapSEIFileName[MAX_LAYERS];
 #endif
   Int*    cfg_waveFrontSynchro[MAX_LAYERS];
@@ -861,9 +787,10 @@
   for( UInt layer = 0; layer < m_numLayers; layer++ )
   {
-    cfg_InputFile[layer]    = &m_apcLayerCfg[layer]->m_cInputFile;
-    cfg_ReconFile[layer]    = &m_apcLayerCfg[layer]->m_cReconFile;
+    cfg_InputFile[layer]    = &m_apcLayerCfg[layer]->m_inputFileName;
+    cfg_ReconFile[layer]    = &m_apcLayerCfg[layer]->m_reconFileName;
+    cfg_dQPFileName[layer]  = &m_apcLayerCfg[layer]->m_dQPFileName;
     cfg_fQP[layer]          = &m_apcLayerCfg[layer]->m_fQP;
 #if Q0074_COLOUR_REMAPPING_SEI
-    cfg_colourRemapSEIFileRoot[layer] = &m_apcLayerCfg[layer]->m_colourRemapSEIFileRoot;
+    cfg_colourRemapSEIFileName[layer] = &m_apcLayerCfg[layer]->m_colourRemapSEIFileName;
 #endif
     cfg_repFormatIdx[layer]         = &m_apcLayerCfg[layer]->m_repFormatIdx;
@@ -979,18 +906,9 @@
   string* cfg_listOfLayerPTLOfOlss   = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
 #if AVC_BASE
-  string  cfg_BLInputFile;
+  string  m_inputFileNameBL;
 #endif
 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI
-  string  cfg_tileSets;
-#endif
-#else //SVC_EXTENSION
-  string cfg_InputFile;
-  string cfg_BitstreamFile;
-  string cfg_ReconFile;
-  string cfg_dQPFile;
-#if Q0074_COLOUR_REMAPPING_SEI
-  string cfg_colourRemapSEIFileRoot;
-#endif
-  string cfg_ScalingListFile;
+  string  m_tileSets;
+#endif 
 #endif //SVC_EXTENSION
 
@@ -1121,6 +1039,6 @@
   ("ScalabilityMask3",                              m_scalabilityMask[AUX_ID],                              0, "scalability_mask[3] (auxiliary pictures)" )
 #endif
-  ("BitstreamFile,b",                               cfg_BitstreamFile,                             string(""), "Bitstream output file name")
-  ("NumRefLocationOffsets%d",                       cfg_numRefLayerLocationOffsets,            0, m_numLayers,  "Number of reference layer offset sets ")
+  ("BitstreamFile,b",                               m_bitstreamFileName,                           string(""), "Bitstream output file name")
+  ("NumRefLocationOffsets%d",                       cfg_numRefLayerLocationOffsets,            0, m_numLayers, "Number of reference layer offset sets ")
   ("RefLocationOffsetLayerId%d",                    cfg_refLocationOffsetLayerIdPtr,  string(""), m_numLayers, "Layer ID of reference location offset")
   ("ScaledRefLayerLeftOffset%d",                    cfg_scaledRefLayerLeftOffsetPtr,  string(""), m_numLayers, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"
@@ -1148,5 +1066,5 @@
   ("PhaseVerChroma%d",                              cfg_phaseVerChromaPtr,            string(""), m_numLayers, "chroma shift in the vertical   direction used in resampling proces")
 #if Q0074_COLOUR_REMAPPING_SEI
-  ("SEIColourRemappingInfoFileRoot%d",              cfg_colourRemapSEIFileRoot,       string(""), m_numLayers, "Colour Remapping Information SEI parameters file name for layer %d")
+  ("SEIColourRemappingInfoFileRoot%d",              cfg_colourRemapSEIFileName,       string(""), m_numLayers, "Colour Remapping Information SEI parameters file name for layer %d")
 #endif
   ("InputBitDepth%d",                                cfg_InputBitDepth[CHANNEL_TYPE_LUMA],     8, m_numLayers, "Bit-depth of input file for layer %d")
@@ -1165,6 +1083,6 @@
   ("InterLayerWeightedPred",                          m_useInterLayerWeightedPred,                      false, "enable IL WP parameters estimation at encoder" )  
 #if AVC_BASE
-  ("NonHEVCBase,-nonhevc",                            m_nonHEVCBaseLayerFlag,                               0, "BL is available but not internal")
-  ("InputBLFile,-ibl",                                cfg_BLInputFile,                             string(""), "Base layer rec YUV input file name")
+  ("NonHEVCBase,-nonhevc",                            m_nonHEVCBaseLayerFlag,                           false, "BL is available but not internal")
+  ("InputBLFile,-ibl",                                m_inputFileNameBL,                           string(""), "Base layer rec YUV input file name")
 #endif
   ("EnableElRapB,-use-rap-b",                         m_elRapSliceBEnabled,                             false, "Set ILP over base-layer I picture to B picture (default is P picture)")
@@ -1172,7 +1090,7 @@
   ("ChromaFormatIDC,-cf",                             tmpChromaFormat,                                      0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)")
 #else //SVC_EXTENSION
-  ("InputFile,i",                                     cfg_InputFile,                               string(""), "Original YUV input file name")
-  ("BitstreamFile,b",                                 cfg_BitstreamFile,                           string(""), "Bitstream output file name")
-  ("ReconFile,o",                                     cfg_ReconFile,                               string(""), "Reconstructed YUV output file name")
+  ("InputFile,i",                                     m_inputFileName,                             string(""), "Original YUV input file name")
+  ("BitstreamFile,b",                                 m_bitstreamFileName,                         string(""), "Bitstream output file name")
+  ("ReconFile,o",                                     m_reconFileName,                             string(""), "Reconstructed YUV output file name")
   ("SourceWidth,-wdt",                                m_iSourceWidth,                                       0, "Source picture width")
   ("SourceHeight,-hgt",                               m_iSourceHeight,                                      0, "Source picture height")
@@ -1217,5 +1135,5 @@
   ("FrameRate,-fr",                                   m_iFrameRate,                                         0, "Frame rate")
 #if Q0074_COLOUR_REMAPPING_SEI
-  ("SEIColourRemappingInfoFileRoot",                  cfg_colourRemapSEIFileRoot, string(""), "Colour Remapping Information SEI parameters file name")
+  ("SEIColourRemappingInfoFileRoot",                  m_colourRemapSEIFileName,                    string(""), "Colour Remapping Information SEI parameters file name")
 #endif
 #endif //SVC_EXTENSION
@@ -1362,6 +1280,8 @@
   ("AdaptiveQP,-aq",                                  m_bUseAdaptiveQP,                                 false, "QP adaptation based on a psycho-visual model")
   ("MaxQPAdaptationRange,-aqr",                       m_iQPAdaptationRange,                                 6, "QP adaptation range")
-#if !SVC_EXTENSION
-  ("dQPFile,m",                                       cfg_dQPFile,                                 string(""), "dQP file name")
+#if SVC_EXTENSION
+  ("dQPFile,m",                                       cfg_dQPFileName,                string(""), m_numLayers, "dQP file name")
+#else
+  ("dQPFile,m",                                       m_dQPFileName,                               string(""), "dQP file name")
 #endif
   ("RDOQ",                                            m_useRDOQ,                                         true)
@@ -1452,5 +1372,5 @@
   ("WaveFrontSynchro",                                m_iWaveFrontSynchro,                                  0, "0: no synchro; 1 synchro with top-right-right")
   ("ScalingList",                                     m_useScalingListId,                    SCALING_LIST_OFF, "0/off: no scaling list, 1/default: default scaling lists, 2/file: scaling lists specified in ScalingListFile")
-  ("ScalingListFile",                                 cfg_ScalingListFile,                         string(""), "Scaling list file name. Use an empty string to produce help.")
+  ("ScalingListFile",                                 m_scalingListFileName,                       string(""), "Scaling list file name. Use an empty string to produce help.")
 #endif
   ("SignHideFlag,-SBH",                               m_signHideFlag,                                    true)
@@ -1714,5 +1634,5 @@
   ("SEIInterLayerConstrainedTileSets",       m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message")
   ("IlNumSetsInMessage",                     m_ilNumSetsInMessage,                         0u, "Number of inter layer constrained tile sets")
-  ("TileSetsArray",                          cfg_tileSets,                         string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ")
+  ("TileSetsArray",                          m_tileSets,                           string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ")
 #endif
   ("AltOutputLayerFlag",                     m_altOutputLayerFlag,                      false, "Specifies the value of alt_output_layer_flag in VPS extension")
@@ -1753,7 +1673,14 @@
   po::setDefaults(opts);
   po::ErrorReporter err;
-  const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv, err);
-
-#if SVC_EXTENSION
+  const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err);
+
+#if SVC_EXTENSION
+#if AVC_BASE
+  if( m_nonHEVCBaseLayerFlag )
+  {
+    *cfg_InputFile[0] = m_inputFileNameBL;
+  }
+#endif
+
   for (Int i=1; i<m_numLayers; i++)
   {
@@ -1775,5 +1702,5 @@
 #endif 
   
-  for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
+  for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
   {
     fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it);
@@ -1799,27 +1726,4 @@
    * Set any derived parameters
    */
-  /* convert std::string to c string for compatability */
-#if SVC_EXTENSION
-#if AVC_BASE
-  if( m_nonHEVCBaseLayerFlag )
-  {
-    *cfg_InputFile[0] = cfg_BLInputFile;
-  }
-#endif
-#else //SVC_EXTENSION
-  m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str());
-#endif
-  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
-#if !SVC_EXTENSION
-  m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
-  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
-#if Q0074_COLOUR_REMAPPING_SEI
-  if( !cfg_colourRemapSEIFileRoot.empty() )
-  {
-    m_colourRemapSEIFileRoot = strdup(cfg_colourRemapSEIFileRoot.c_str());
-  }
-#endif
-#endif //SVC_EXTENSION
-
 
   m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values;
@@ -1895,10 +1799,9 @@
     m_tileRowHeight.clear();
   }
-    
-  /* rules for input, output and internal bitdepths as per help text */
+  
 #if SVC_EXTENSION
   for( Int layer = 0; layer < m_numLayers; layer++ )
   {
-    m_apcLayerCfg[layer]->m_scalingListFile = cfg_ScalingListFile[layer].empty() ? NULL : strdup(cfg_ScalingListFile[layer].c_str());
+    m_apcLayerCfg[layer]->m_scalingListFileName = cfg_ScalingListFile[layer].empty() ? NULL : strdup(cfg_ScalingListFile[layer].c_str());
 
     if( m_apcLayerCfg[layer]->m_layerId < 0 )
@@ -2034,6 +1937,4 @@
   }
 #else
-  m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
-
   /* rules for input, output and internal bitdepths as per help text */
   if (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA  ] == 0)
@@ -2436,5 +2337,5 @@
     }
 
-    Char* pSamplePredRefLayerIds = cfg_samplePredRefLayerIds[layer].empty() ? NULL: strdup(cfg_samplePredRefLayerIds[layer].c_str());
+    TChar* pSamplePredRefLayerIds = cfg_samplePredRefLayerIds[layer].empty() ? NULL: strdup(cfg_samplePredRefLayerIds[layer].c_str());
     if( m_apcLayerCfg[layer]->m_numSamplePredRefLayers > 0 )
     {
@@ -2471,5 +2372,5 @@
     }
 
-    Char* pMotionPredRefLayerIds = cfg_motionPredRefLayerIds[layer].empty() ? NULL: strdup(cfg_motionPredRefLayerIds[layer].c_str());
+    TChar* pMotionPredRefLayerIds = cfg_motionPredRefLayerIds[layer].empty() ? NULL: strdup(cfg_motionPredRefLayerIds[layer].c_str());
     if( m_apcLayerCfg[layer]->m_numMotionPredRefLayers > 0 )
     {
@@ -2506,9 +2407,9 @@
     }
 
-    Char* pPredLayerIds = cfg_predLayerIds[layer].empty() ? NULL: strdup(cfg_predLayerIds[layer].c_str());
+    TChar* pPredLayerIds = cfg_predLayerIds[layer].empty() ? NULL: strdup(cfg_predLayerIds[layer].c_str());
     if( m_apcLayerCfg[layer]->m_numActiveRefLayers > 0 )
     {
-      char *refLayerId;
-      int  i=0;
+      TChar *refLayerId;
+      Int  i=0;
       m_apcLayerCfg[layer]->m_predLayerIds = new Int[m_apcLayerCfg[layer]->m_numActiveRefLayers];
       refLayerId = strtok(pPredLayerIds, " ,-");
@@ -2661,7 +2562,8 @@
     Double& m_fQP                   = m_apcLayerCfg[layer]->m_fQP;
 
-    Char* m_pchdQPFile              = m_apcLayerCfg[layer]->m_pchdQPFile;
+    string& m_dQPFileName           = m_apcLayerCfg[layer]->m_dQPFileName;
     Int* m_internalBitDepth         = m_apcLayerCfg[layer]->m_internalBitDepth;
 #endif //SVC_EXTENSION
+
   switch (m_conformanceWindowMode)
   {
@@ -2778,7 +2680,8 @@
 
   // reading external dQP description from file
-  if ( m_pchdQPFile )
-  {
-    FILE* fpt=fopen( m_pchdQPFile, "r" );
+  if ( !m_dQPFileName.empty() )
+  {
+    FILE* fpt=fopen( m_dQPFileName.c_str(), "r" );
+
     if ( fpt )
     {
@@ -2965,7 +2868,7 @@
       exit( EXIT_FAILURE );
     }
-    Char* pTileSets = cfg_tileSets.empty() ? NULL : strdup(cfg_tileSets.c_str());
+    TChar* pTileSets = m_tileSets.empty() ? NULL : strdup(m_tileSets.c_str());
     int i = 0;
-    char *topLeftTileIndex = strtok(pTileSets, " ,");
+    TChar *topLeftTileIndex = strtok(pTileSets, " ,");
     while(topLeftTileIndex != NULL)
     {
@@ -3161,5 +3064,5 @@
 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b)
 
-  xConfirmPara(m_pchBitstreamFile==NULL, "A bitstream file name must be specified (BitstreamFile)");
+  xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)");
   const UInt maxBitDepth=(m_chromaFormatIDC==CHROMA_400) ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
   xConfirmPara(m_bitDepthConstraint<maxBitDepth, "The internalBitDepth must not be greater than the bitDepthConstraint value");
@@ -4394,5 +4297,5 @@
 }
 
-const Char *profileToString(const Profile::Name profile)
+const TChar *profileToString(const Profile::Name profile)
 {
   static const UInt numberOfProfiles = sizeof(strToProfile)/sizeof(*strToProfile);
@@ -4454,6 +4357,6 @@
     Int& m_iSourceHeight                   = m_apcLayerCfg[layerIdx]->m_iSourceHeight;
 
-    const Char* m_pchInputFile             = m_apcLayerCfg[layerIdx]->m_cInputFile.c_str();
-    const Char* m_pchReconFile             = m_apcLayerCfg[layerIdx]->m_cReconFile.c_str();
+    string& m_inputFileName                = m_apcLayerCfg[layerIdx]->m_inputFileName;
+    string& m_reconFileName                = m_apcLayerCfg[layerIdx]->m_reconFileName;
 
     Int& m_iFrameRate                      = m_apcLayerCfg[layerIdx]->m_iFrameRate;
@@ -4499,5 +4402,5 @@
 #endif
 
-  printf("Input          File                    : %s\n", m_pchInputFile          );
+  printf("Input          File                    : %s\n", m_inputFileName.c_str()          );
 
 #if SVC_EXTENSION
@@ -4507,5 +4410,5 @@
 #endif
 
-  printf("Bitstream      File                    : %s\n", m_pchBitstreamFile      );
+  printf("Bitstream      File                    : %s\n", m_bitstreamFileName.c_str()      );
 
 #if SVC_EXTENSION
@@ -4514,6 +4417,6 @@
     {
 #endif
-
-  printf("Reconstruction File                    : %s\n", m_pchReconFile          );
+  
+  printf("Reconstruction File                    : %s\n", m_reconFileName.c_str()          );
   printf("Real     Format                        : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate );
   printf("Internal Format                        : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
@@ -4801,5 +4704,5 @@
   }
 
-  printf("\nSHVC TOOL CFG: ");
+  printf("SHVC TOOL CFG: ");
   printf("ElRapSliceType: %c-slice ", m_elRapSliceBEnabled ? 'B' : 'P');
   printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV);
@@ -4822,5 +4725,5 @@
 }
 
-Bool confirmPara(Bool bflag, const Char* message)
+Bool confirmPara(Bool bflag, const TChar* message)
 {
   if (!bflag)
@@ -4836,8 +4739,8 @@
 Void TAppEncCfg::cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString)
 {
-  Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str());
+  TChar *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str());
   if( numEntries > 0 )
   {
-    Char *arrayEntry;
+    TChar *arrayEntry;
     Int i = 0;
     *arr = new Int[numEntries];
@@ -4918,8 +4821,8 @@
 Void TAppEncCfg::cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString)
 {
-  Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str());
+  TChar *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str());
   if (numEntries > 0)
   {
-    Char *arrayEntry;
+    TChar *arrayEntry;
     Int i = 0;
     *arr = new Int[numEntries];
@@ -4983,4 +4886,60 @@
   return false;
 }
+
+void TAppEncCfg::getDirFilename(string& filename, string& dir, const string path)
+{
+  size_t pos = path.find_last_of("\\");
+  if(pos != std::string::npos)
+  {
+    filename.assign(path.begin() + pos + 1, path.end());
+    dir.assign(path.begin(), path.begin() + pos + 1);
+  }
+  else
+  {
+    pos = path.find_last_of("/");
+    if(pos != std::string::npos)
+    {
+      filename.assign(path.begin() + pos + 1, path.end());
+      dir.assign(path.begin(), path.begin() + pos + 1);
+    }
+    else
+    {
+      filename = path;
+      dir.assign("");
+    }
+  }
+}
+
+/** \param  argc        number of arguments
+    \param  argv        array of arguments
+    \retval             true when success
+ */
+Bool TAppEncCfg::parseCfgNumLayersAndInit( Int argc, TChar* argv[] )
+{
+  po::Options opts;
+  opts.addOptions()
+  ("c",    po::parseConfigFile, "configuration file name")
+  ("NumLayers",                                     m_numLayers,                                             1, "Number of layers to code")
+  ;
+
+  po::setDefaults(opts);
+  po::ErrorReporter err;
+  err.verbose = false;
+  po::scanArgv(opts, argc, (const TChar**) argv, err);
+
+  if( m_numLayers <= 0 )
+  {
+    printf("Wrong number of layers %d\n", m_numLayers);
+    return false;
+  }
+
+  for( Int layer = 0; layer < m_numLayers; layer++ )
+  {
+    m_apcLayerCfg[layer] = new TAppEncLayerCfg;
+    m_apcLayerCfg[layer]->setAppEncCfg(this);
+  }
+
+  return true;
+}
 #endif //SVC_EXTENSION
 //! \}
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1442)
@@ -65,5 +65,5 @@
   Int       m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask
 #if AVC_BASE
-  Int       m_nonHEVCBaseLayerFlag;                           ///< non HEVC BL
+  Bool      m_nonHEVCBaseLayerFlag;                           ///< non HEVC BL
 #endif
   Bool      m_maxTidRefPresentFlag; 
@@ -82,9 +82,9 @@
   std::vector< std::vector<Int> > m_listOfOutputLayers;
 #else
-  Char*     m_pchInputFile;                                   ///< source file name
-#endif
-  Char*     m_pchBitstreamFile;                               ///< output bitstream file
-#if !SVC_EXTENSION
-  Char*     m_pchReconFile;                                   ///< output reconstruction file
+  std::string m_inputFileName;                                ///< source file name
+#endif
+  std::string m_bitstreamFileName;                            ///< output bitstream file
+#if !SVC_EXTENSION
+  std::string m_reconFileName;                                ///< output reconstruction file
 #endif
   // Lambda modifiers
@@ -199,5 +199,5 @@
   Double    m_fQP;                                            ///< QP value of key-picture (floating point)
   Int       m_iQP;                                            ///< QP value of key-picture (integer)
-  Char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
+  std::string m_dQPFileName;                                  ///< QP offset for each slice (initialized from external file)
   Int*      m_aidQP;                                          ///< array of slice QP values
 #endif
@@ -419,5 +419,5 @@
 #if !SVC_EXTENSION
   ScalingListMode m_useScalingListId;                         ///< using quantization matrix
-  Char*     m_scalingListFile;                                ///< quantization matrix file name
+  std::string m_scalingListFileName;                          ///< quantization matrix file name
 #endif
 
@@ -495,5 +495,5 @@
 #if Q0074_COLOUR_REMAPPING_SEI
 #if !SVC_EXTENSION
-  string    m_colourRemapSEIFileRoot;
+  string    m_colourRemapSEIFileName;
 #endif
 #endif
@@ -567,8 +567,8 @@
   Void  create    ();                                         ///< create option handling class
   Void  destroy   ();                                         ///< destroy option handling class
-  Bool  parseCfg  ( Int argc, Char* argv[] );                 ///< parse configuration file to fill member variables
+  Bool  parseCfg  ( Int argc, TChar* argv[] );                ///< parse configuration file to fill member variables
   
 #if SVC_EXTENSION
-  Bool parseCfgNumLayersAndInit( Int argc, Char* argv[] );    ///< parse configuration file to to get number of layers and allocate memory
+  Bool parseCfgNumLayersAndInit( Int argc, TChar* argv[] );   ///< parse configuration file to to get number of layers and allocate memory
   Int  getNumFrameToBeEncoded()                               { return m_framesToBeEncoded;                          }
   Int  getNumLayer()                                          { return m_numLayers;                                  }
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 1442)
@@ -42,14 +42,7 @@
 #if SVC_EXTENSION
 TAppEncLayerCfg::TAppEncLayerCfg()
-: m_cInputFile(string(""))
-, m_cReconFile(string(""))
-, m_conformanceWindowMode(0)
-, m_scalingListFile(NULL)
-, m_pchdQPFile(NULL)
+: m_conformanceWindowMode(0)
 , m_aidQP(NULL)
 , m_repFormatIdx(-1)
-#if Q0074_COLOUR_REMAPPING_SEI
-, m_colourRemapSEIFileRoot(string(""))
-#endif
 {
 #if Q0074_COLOUR_REMAPPING_SEI
@@ -107,5 +100,4 @@
   }
 #endif
-  free(m_scalingListFile);
 }
 
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1442)
@@ -28,6 +28,6 @@
 protected:
   // file I/O0
-  string    m_cInputFile;                                     ///< source file name
-  string    m_cReconFile;                                     ///< output reconstruction file
+  string    m_inputFileName;                                     ///< source file name
+  string    m_reconFileName;                                     ///< output reconstruction file
   Int       m_layerId;                                        ///< layer Id
   Int       m_iFrameRate;                                     ///< source frame-rates (Hz)
@@ -95,5 +95,5 @@
 
   ScalingListMode m_useScalingListId;                         ///< using quantization matrix
-  Char*     m_scalingListFile;                                ///< quantization matrix file name
+  std::string m_scalingListFileName;                          ///< quantization matrix file name
 
   Int       m_maxTidIlRefPicsPlus1;
@@ -102,5 +102,5 @@
 
   Int       m_iQP;                                            ///< QP value of key-picture (integer)
-  Char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
+  std::string m_dQPFileName;                                  ///< QP offset for each slice (initialized from external file)
   Int*      m_aidQP;                                          ///< array of slice QP values
   TAppEncCfg* m_cAppEncCfg;                                   ///< pointer to app encoder config
@@ -130,5 +130,5 @@
   Int       m_repFormatIdx;
 #if Q0074_COLOUR_REMAPPING_SEI
-  string    m_colourRemapSEIFileRoot;                           ///< Colour Remapping Information SEI message parameters file
+  string    m_colourRemapSEIFileName;                         ///< Colour Remapping Information SEI message parameters file
   Int       m_colourRemapSEIId;
   Bool      m_colourRemapSEICancelFlag;
@@ -168,7 +168,7 @@
   Void    setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p;          }
 
-  string  getInputFile()              {return m_cInputFile;       }
-  string  getReconFile()              {return m_cReconFile;       }
-  Double  getFloatQP()                {return m_fQP;              }
+  string& getInputFileName()          {return m_inputFileName;       }
+  string& getReconFileName()          {return m_reconFileName;       }
+  Double  getFloatQP()                {return m_fQP;                 }
   Int     getConfWinLeft()            {return m_confWinLeft;         }
   Int     getConfWinRight()           {return m_confWinRight;        }
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1441)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1442)
@@ -499,6 +499,8 @@
 
     ScalingListMode& m_useScalingListId                         = m_apcLayerCfg[layer]->m_useScalingListId;
-    Char*          m_scalingListFile                            = m_apcLayerCfg[layer]->m_scalingListFile;
+    string&        m_scalingListFileName                        = m_apcLayerCfg[layer]->m_scalingListFileName;
     Bool&          m_bUseSAO                                    = m_apcLayerCfg[layer]->m_bUseSAO;
+
+    string&        m_colourRemapSEIFileName                     = m_apcLayerCfg[layer]->m_colourRemapSEIFileName;
 #endif
 
@@ -785,5 +787,5 @@
   m_cTEncTop.setTMVPModeId                                        ( m_TMVPModeId );
   m_cTEncTop.setUseScalingListId                                  ( m_useScalingListId  );
-  m_cTEncTop.setScalingListFile                                   ( m_scalingListFile   );
+  m_cTEncTop.setScalingListFileName                               ( m_scalingListFileName );
   m_cTEncTop.setSignHideFlag                                      ( m_signHideFlag);
   m_cTEncTop.setUseRateCtrl                                       ( m_RCEnableRateControl );
@@ -843,9 +845,5 @@
 
 #if Q0074_COLOUR_REMAPPING_SEI
-#if SVC_EXTENSION
-  m_cTEncTop.xSetCRISEIFileRoot                                    ( const_cast<Char*>(m_apcLayerCfg[layer]->m_colourRemapSEIFileRoot.c_str()) );
-#else
-  m_cTEncTop.xSetCRISEIFileRoot                                    ( const_cast<Char*>(m_colourRemapSEIFileRoot.c_str()) );
-#endif
+  m_cTEncTop.xSetCRISEIFileRoot                                   ( m_colourRemapSEIFileName );
 #endif
 #if LAYERS_NOT_PRESENT_SEI
@@ -877,10 +875,10 @@
     //2
     // Video I/O
-    m_apcTVideoIOYuvInputFile[layer]->open( (Char *)m_apcLayerCfg[layer]->getInputFile().c_str(),  false, m_apcLayerCfg[layer]->m_inputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth );  // read  mode
+    m_apcTVideoIOYuvInputFile[layer]->open( m_apcLayerCfg[layer]->getInputFileName(),  false, m_apcLayerCfg[layer]->m_inputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth );  // read  mode
     m_apcTVideoIOYuvInputFile[layer]->skipFrames(m_FrameSkip, m_apcLayerCfg[layer]->m_iSourceWidth - m_apcLayerCfg[layer]->m_aiPad[0], m_apcLayerCfg[layer]->m_iSourceHeight - m_apcLayerCfg[layer]->m_aiPad[1], m_apcLayerCfg[layer]->m_InputChromaFormatIDC);
 
-    if( !m_apcLayerCfg[layer]->getReconFile().empty() )
-    {
-      m_apcTVideoIOYuvReconFile[layer]->open((Char *)m_apcLayerCfg[layer]->getReconFile().c_str(), true, m_apcLayerCfg[layer]->m_outputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth );  // write mode
+    if( !m_apcLayerCfg[layer]->getReconFileName().empty() )
+    {
+      m_apcTVideoIOYuvReconFile[layer]->open( m_apcLayerCfg[layer]->getReconFileName(), true, m_apcLayerCfg[layer]->m_outputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth );  // write mode
     }
 
@@ -890,10 +888,10 @@
 #else //SVC_EXTENSION
   // Video I/O
-  m_cTVideoIOYuvInputFile.open( m_pchInputFile,     false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth );  // read  mode
+  m_cTVideoIOYuvInputFile.open( m_inputFileName,     false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth );  // read  mode
   m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC);
 
-  if (m_pchReconFile)
-  {
-    m_cTVideoIOYuvReconFile.open(m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth);  // write mode
+  if (!m_reconFileName.empty())
+  {
+    m_cTVideoIOYuvReconFile.open(m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth);  // write mode
   }
 
@@ -1439,8 +1437,8 @@
 Void TAppEncTop::encode()
 {
-  fstream bitstreamFile(m_pchBitstreamFile, fstream::binary | fstream::out);
+  fstream bitstreamFile(m_bitstreamFileName.c_str(), fstream::binary | fstream::out);
   if (!bitstreamFile)
   {
-    fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_pchBitstreamFile);
+    fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_bitstreamFileName.c_str());
     exit(EXIT_FAILURE);
   }
@@ -1801,8 +1799,8 @@
 Void TAppEncTop::encode()
 {
-  fstream bitstreamFile(m_pchBitstreamFile, fstream::binary | fstream::out);
+  fstream bitstreamFile(m_bitstreamFileName.c_str(), fstream::binary | fstream::out);
   if (!bitstreamFile)
   {
-    fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_pchBitstreamFile);
+    fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_bitstreamFileName.c_str());
     exit(EXIT_FAILURE);
   }
@@ -1973,5 +1971,5 @@
       TComPicYuv*  pcPicYuvRecBottom  = *(iterPicYuvRec++);
 
-      if( !m_apcLayerCfg[layer]->getReconFile().empty() && pcPicYuvRecTop->isReconstructed() && pcPicYuvRecBottom->isReconstructed() )
+      if( !m_apcLayerCfg[layer]->getReconFileName().empty() && pcPicYuvRecTop->isReconstructed() && pcPicYuvRecBottom->isReconstructed() )
       {
         m_apcTVideoIOYuvReconFile[layer]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_apcLayerCfg[layer]->getConfWinLeft() * xScal, m_apcLayerCfg[layer]->getConfWinRight() * xScal, 
@@ -1994,5 +1992,5 @@
     {
       TComPicYuv*  pcPicYuvRec  = *(iterPicYuvRec++);
-      if( !m_apcLayerCfg[layer]->getReconFile().empty() && pcPicYuvRec->isReconstructed() )
+      if( !m_apcLayerCfg[layer]->getReconFileName().empty() && pcPicYuvRec->isReconstructed() )
       {
         m_apcTVideoIOYuvReconFile[layer]->write( pcPicYuvRec, ipCSC, m_apcLayerCfg[layer]->getConfWinLeft() * xScal, m_apcLayerCfg[layer]->getConfWinRight() * xScal,
@@ -2101,5 +2099,5 @@
       TComPicYuv*  pcPicYuvRecBottom  = *(iterPicYuvRec++);
 
-      if (m_pchReconFile)
+      if (!m_reconFileName.empty())
       {
         m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst );
@@ -2130,5 +2128,5 @@
     {
       TComPicYuv*  pcPicYuvRec  = *(iterPicYuvRec++);
-      if (m_pchReconFile)
+      if (!m_reconFileName.empty())
       {
         m_cTVideoIOYuvReconFile.write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom,
Index: /branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp	(revision 1442)
@@ -49,7 +49,7 @@
 #if DEBUG_STRING
 // these strings are used to reorder the debug output so that the encoder and decoder match.
-const Char *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1]
+const TChar *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1]
  = {"Start of channel 0 inter debug\n", "Start of channel 1 inter debug\n", "Start of channel 2 inter debug\n", "End of inter residual debug\n"} ;
-const Char *partSizeToString[NUMBER_OF_PART_SIZES]={"2Nx2N(0)", "2NxN(1)", "Nx2N(2)", "NxN(3)", "2Nx(N/2+3N/2)(4)", "2Nx(3N/2+N/2)(5)", "(N/2+3N/2)x2N(6)", "(3N/2+N/2)x2N(7)"};
+const TChar *partSizeToString[NUMBER_OF_PART_SIZES]={"2Nx2N(0)", "2NxN(1)", "Nx2N(2)", "NxN(3)", "2Nx(N/2+3N/2)(4)", "2Nx(3N/2+N/2)(5)", "(N/2+3N/2)x2N(6)", "(3N/2+N/2)x2N(7)"};
 #endif
 
@@ -421,5 +421,5 @@
 
 
-Void printBlockToStream( std::ostream &ss, const Char *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross, const UInt numSubBlocksUp, const UInt defWidth )
+Void printBlockToStream( std::ostream &ss, const TChar *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross, const UInt numSubBlocksUp, const UInt defWidth )
 {
   const UInt numValidComp=src.getNumberValidComponents();
Index: /branches/SHM-dev/source/Lib/TLibCommon/Debug.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/Debug.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/Debug.h	(revision 1442)
@@ -48,6 +48,6 @@
 
 #if DEBUG_STRING
-extern const Char *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1];
-extern const Char *partSizeToString[NUMBER_OF_PART_SIZES];
+extern const TChar *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1];
+extern const TChar *partSizeToString[NUMBER_OF_PART_SIZES];
 #endif
 
@@ -150,7 +150,7 @@
 UInt getZScanIndex(const UInt x, const UInt y);
 
-//template specialisation for Char types to get it to render as a number
+//template specialisation for SChar/UChar types to get it to render as a number
 template <typename ValueType> inline Void writeValueToStream       (const ValueType &value, std::ostream &stream, const UInt outputWidth) { stream << std::setw(outputWidth) <<      value;  }
-template <>                   inline Void writeValueToStream<Char >(const Char      &value, std::ostream &stream, const UInt outputWidth) { stream << std::setw(outputWidth) <<  Int(value); }
+template <>                   inline Void writeValueToStream<SChar>(const SChar     &value, std::ostream &stream, const UInt outputWidth) { stream << std::setw(outputWidth) <<  Int(value); }
 template <>                   inline Void writeValueToStream<UChar>(const UChar     &value, std::ostream &stream, const UInt outputWidth) { stream << std::setw(outputWidth) << UInt(value); }
 
@@ -232,5 +232,5 @@
 
 template <typename T>
-Void printBlockToStream( std::ostream &ss, const Char *pLinePrefix, const T * blkSrc, const UInt width, const UInt height, const UInt stride, const UInt subBlockWidth=0, const UInt subBlockHeight=0, const UInt defWidth=3 )
+Void printBlockToStream( std::ostream &ss, const TChar *pLinePrefix, const T * blkSrc, const UInt width, const UInt height, const UInt stride, const UInt subBlockWidth=0, const UInt subBlockHeight=0, const UInt defWidth=3 )
 {
   for (UInt y=0; y<height; y++)
@@ -256,5 +256,5 @@
 
 class TComYuv;
-Void printBlockToStream( std::ostream &ss, const Char *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross=1, const UInt numSubBlocksUp=1, const UInt defWidth=3 );
+Void printBlockToStream( std::ostream &ss, const TChar *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross=1, const UInt numSubBlocksUp=1, const UInt defWidth=3 );
 
 // ---------------------------------------------------------------------------------------------- //
Index: /branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp	(revision 1442)
@@ -115,5 +115,5 @@
 
 // Static member
-const Char *SEI::getSEIMessageString(SEI::PayloadType payloadType)
+const TChar *SEI::getSEIMessageString(SEI::PayloadType payloadType)
 {
   switch (payloadType)
Index: /branches/SHM-dev/source/Lib/TLibCommon/SEI.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/SEI.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/SEI.h	(revision 1442)
@@ -124,5 +124,5 @@
   virtual ~SEI() {}
 
-  static const Char *getSEIMessageString(SEI::PayloadType payloadType);
+  static const TChar *getSEIMessageString(SEI::PayloadType payloadType);
 
   virtual PayloadType payloadType() const = 0;
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.cpp	(revision 1442)
@@ -91,7 +91,7 @@
 }
 
-Char* TComOutputBitstream::getByteStream() const
-{
-  return (Char*) &m_fifo.front();
+UChar* TComOutputBitstream::getByteStream() const
+{
+  return (UChar*) &m_fifo.front();
 }
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h	(revision 1442)
@@ -115,5 +115,5 @@
    * bytestream are stored in ascending addresses.
    */
-  Char* getByteStream() const;
+  UChar* getByteStream() const;
 
   /**
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComCodingStatistics.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComCodingStatistics.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComCodingStatistics.h	(revision 1442)
@@ -95,7 +95,7 @@
 };
 
-static inline const Char* getName(TComCodingStatisticsType name)
+static inline const TChar* getName(TComCodingStatisticsType name)
 {
-  static const Char *statNames[]=
+  static const TChar *statNames[]=
   {
     "NAL_UNIT_TOTAL_BODY", // This is a special case and is not included in the total sums.
@@ -143,5 +143,5 @@
     "CABAC_BITS__ALIGNED_ESCAPE_BITS"
   };
-  assert(STATS__NUM_STATS == sizeof(statNames)/sizeof(Char *) && name < STATS__NUM_STATS);
+  assert(STATS__NUM_STATS == sizeof(statNames)/sizeof(TChar *) && name < STATS__NUM_STATS);
   return statNames[name];
 }
@@ -183,8 +183,8 @@
   }
 
-  static const Char *GetSubClassString(const UInt subClass)
+  static const TChar *GetSubClassString(const UInt subClass)
   {
     assert (subClass<CODING_STATS_NUM_SUBCLASSES);
-    static const Char *strings[1+MAX_NUM_COMPONENT+MAX_NUM_CHANNEL_TYPE]={"-", "Y", "Cb", "Cr", "Luma", "Chroma"};
+    static const TChar *strings[1+MAX_NUM_COMPONENT+MAX_NUM_CHANNEL_TYPE]={"-", "Y", "Cb", "Cr", "Luma", "Chroma"};
     return strings[subClass/CODING_STATS_NUM_WIDTHS];
   }
@@ -243,5 +243,5 @@
     { }
 
-    static Void OutputLine(const Char *pName, const Char sep, UInt width, const Char *pSubClassStr, const SStat &sCABAC, const SStat &sEP)
+    static Void OutputLine(const TChar *pName, const TChar sep, UInt width, const TChar *pSubClassStr, const SStat &sCABAC, const SStat &sEP)
     {
       if (width==0)
@@ -256,5 +256,5 @@
       }
     }
-    static Void OutputLine(const Char *pName, const Char sep, const Char *pWidthString, const Char *pSubClassStr, const SStat &sCABAC, const SStat &sEP)
+    static Void OutputLine(const TChar *pName, const TChar sep, const TChar *pWidthString, const TChar *pSubClassStr, const SStat &sCABAC, const SStat &sEP)
     {
       printf("%c%-45s%c  %6s %6s %12lld %12lld %12lld %12lld %12lld %12lld %12lld (%12lld)%c\n",
@@ -262,5 +262,5 @@
               sCABAC.count, sCABAC.sum, sCABAC.bits, sEP.count, sEP.sum, sEP.bits, sCABAC.bits+sEP.bits, (sCABAC.bits+sEP.bits)/8, sep=='~'?']':' ');
     }
-    static Void OutputLine(const Char *pName, const Char sep, const Char *pWidthString, const Char *pSubClassStr,  const SStat &sEP)
+    static Void OutputLine(const TChar *pName, const TChar sep, const TChar *pWidthString, const TChar *pSubClassStr,  const SStat &sEP)
     {
       printf("%c%-45s%c  %6s %6s %12s %12s %12s %12lld %12lld %12lld %12lld (%12lld)%c\n",
@@ -269,5 +269,5 @@
     }
 
-    static Void OutputDashedLine(const Char *pText)
+    static Void OutputDashedLine(const TChar *pText)
     {
       printf("--%s",pText);
@@ -314,5 +314,5 @@
         SStat cabacSubTotal, epSubTotal;
         Bool bHadClassifiedEntry=false;
-        const Char *pName=getName(TComCodingStatisticsType(i));
+        const TChar *pName=getName(TComCodingStatisticsType(i));
 
         for(UInt c=0; c<CODING_STATS_NUM_SUBCLASSES; c++)
@@ -442,5 +442,5 @@
     static SStat &GetStatisticEP(const std::string &str) { return GetSingletonInstance().data.mappings_ep[str]; }
 
-    static SStat &GetStatisticEP(const Char *pKey) {return GetStatisticEP(std::string(pKey)); }
+    static SStat &GetStatisticEP(const TChar *pKey) {return GetStatisticEP(std::string(pKey)); }
 
     static Void IncrementStatisticEP(const TComCodingStatisticsClassType &stat, const Int numBits, const Int value)
@@ -460,5 +460,5 @@
     }
 
-    static Void IncrementStatisticEP(const Char *pKey, const Int numBits, const Int value)
+    static Void IncrementStatisticEP(const TChar *pKey, const Int numBits, const Int value)
     {
       SStat &s=GetStatisticEP(pKey);
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1442)
@@ -127,5 +127,5 @@
   if ( !bDecSubCu )
   {
-    m_phQP               = (Char*     )xMalloc(Char,     uiNumPartition);
+    m_phQP               = (SChar*    )xMalloc(SChar,    uiNumPartition);
     m_puhDepth           = (UChar*    )xMalloc(UChar,    uiNumPartition);
     m_puhWidth           = (UChar*    )xMalloc(UChar,    uiNumPartition);
@@ -134,7 +134,7 @@
     m_ChromaQpAdj        = new UChar[ uiNumPartition ];
     m_skipFlag           = new Bool[ uiNumPartition ];
-    m_pePartSize         = new Char[ uiNumPartition ];
+    m_pePartSize         = new SChar[ uiNumPartition ];
     memset( m_pePartSize, NUMBER_OF_PART_SIZES,uiNumPartition * sizeof( *m_pePartSize ) );
-    m_pePredMode         = new Char[ uiNumPartition ];
+    m_pePredMode         = new SChar[ uiNumPartition ];
     m_CUTransquantBypass = new Bool[ uiNumPartition ];
 
@@ -153,7 +153,7 @@
     {
       const RefPicList rpl=RefPicList(i);
-      m_apiMVPIdx[rpl]       = new Char[ uiNumPartition ];
-      m_apiMVPNum[rpl]       = new Char[ uiNumPartition ];
-      memset( m_apiMVPIdx[rpl], -1,uiNumPartition * sizeof( Char ) );
+      m_apiMVPIdx[rpl]       = new SChar[ uiNumPartition ];
+      m_apiMVPNum[rpl]       = new SChar[ uiNumPartition ];
+      memset( m_apiMVPIdx[rpl], -1,uiNumPartition * sizeof( SChar ) );
     }
 
@@ -164,5 +164,5 @@
       const UInt totalSize   = (uiWidth * uiHeight) >> chromaShift;
 
-      m_crossComponentPredictionAlpha[compID] = (Char*  )xMalloc(Char,   uiNumPartition);
+      m_crossComponentPredictionAlpha[compID] = (SChar* )xMalloc(SChar,  uiNumPartition);
       m_puhTransformSkip[compID]              = (UChar* )xMalloc(UChar,  uiNumPartition);
       m_explicitRdpcmMode[compID]             = (UChar* )xMalloc(UChar,  uiNumPartition);
@@ -660,5 +660,5 @@
   Int iSizeInUchar = sizeof( UChar  ) * m_uiNumPartition;
   Int iSizeInBool  = sizeof( Bool   ) * m_uiNumPartition;
-  Int sizeInChar = sizeof( Char  ) * m_uiNumPartition;
+  Int sizeInChar = sizeof( SChar  ) * m_uiNumPartition;
 
   memset( m_phQP,              qp,  sizeInChar );
@@ -887,5 +887,5 @@
   Int iSizeInBool   = sizeof( Bool  ) * uiNumPartition;
 
-  Int sizeInChar  = sizeof( Char ) * uiNumPartition;
+  Int sizeInChar  = sizeof( SChar ) * uiNumPartition;
   memcpy( m_skipFlag   + uiOffset, pcCU->getSkipFlag(),       sizeof( *m_skipFlag )   * uiNumPartition );
   memcpy( m_phQP       + uiOffset, pcCU->getQP(),             sizeInChar                        );
@@ -969,5 +969,5 @@
   Int iSizeInUchar  = sizeof( UChar ) * m_uiNumPartition;
   Int iSizeInBool   = sizeof( Bool  ) * m_uiNumPartition;
-  Int sizeInChar  = sizeof( Char ) * m_uiNumPartition;
+  Int sizeInChar  = sizeof( SChar ) * m_uiNumPartition;
 
   memcpy( pCtu->getSkipFlag() + m_absZIdxInCtu, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition );
@@ -1158,5 +1158,5 @@
   const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
   UInt uiAbsZorderCUIdxLB = g_auiZscanToRaster[ m_absZIdxInCtu ] + ((m_puhHeight[0] / m_pcPic->getMinCUHeight()) - 1)*numPartInCtuWidth;
-  
+
 #if SVC_EXTENSION
   if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicHeightInLumaSamples())
@@ -1206,5 +1206,5 @@
   UInt uiAbsZorderCUIdx   = g_auiZscanToRaster[ m_absZIdxInCtu ] + (m_puhWidth[0] / m_pcPic->getMinCUWidth()) - 1;
   const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
-  
+
 #if SVC_EXTENSION
   if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicWidthInLumaSamples() )
@@ -1318,7 +1318,7 @@
 /** Get reference QP from left QpMinCu or latest coded QP
 *\param   uiCurrAbsIdxInCtu
-*\returns Char   reference QP value
+*\returns SChar   reference QP value
 */
-Char TComDataCU::getRefQP( UInt uiCurrAbsIdxInCtu )
+SChar TComDataCU::getRefQP( UInt uiCurrAbsIdxInCtu )
 {
   UInt lPartIdx = MAX_UINT;
@@ -1341,5 +1341,5 @@
 }
 
-Char TComDataCU::getLastCodedQP( UInt uiAbsPartIdx )
+SChar TComDataCU::getLastCodedQP( UInt uiAbsPartIdx )
 {
   UInt uiQUPartIdxMask = ~((1<<((getSlice()->getSPS()->getMaxTotalCUDepth() - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1);
@@ -1836,10 +1836,10 @@
 Void TComDataCU::setMVPIdxSubParts( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
 {
-  setSubPart<Char>( iMVPIdx, m_apiMVPIdx[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx );
+  setSubPart<SChar>( iMVPIdx, m_apiMVPIdx[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx );
 }
 
 Void TComDataCU::setMVPNumSubParts( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
 {
-  setSubPart<Char>( iMVPNum, m_apiMVPNum[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx );
+  setSubPart<SChar>( iMVPNum, m_apiMVPNum[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx );
 }
 
@@ -1874,7 +1874,7 @@
 }
 
-Void TComDataCU::setCrossComponentPredictionAlphaPartRange( Char alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes )
-{
-  memset((m_crossComponentPredictionAlpha[compID] + uiAbsPartIdx), alphaValue, (sizeof(Char) * uiCoveredPartIdxes));
+Void TComDataCU::setCrossComponentPredictionAlphaPartRange( SChar alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes )
+{
+  memset((m_crossComponentPredictionAlpha[compID] + uiAbsPartIdx), alphaValue, (sizeof(SChar) * uiCoveredPartIdxes));
 }
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h	(revision 1442)
@@ -86,5 +86,5 @@
   UChar*        m_puhDepth;           ///< array of depths
   Int           m_unitSize;           ///< size of a "minimum partition"
-  
+
 #if SVC_EXTENSION
   UInt          m_layerId;          ///< layer id
@@ -99,9 +99,9 @@
 
   Bool*          m_skipFlag;           ///< array of skip flags
-  Char*          m_pePartSize;         ///< array of partition sizes
-  Char*          m_pePredMode;         ///< array of prediction modes
-  Char*          m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]; ///< array of cross-component prediction alpha values
+  SChar*         m_pePartSize;         ///< array of partition sizes
+  SChar*         m_pePredMode;         ///< array of prediction modes
+  SChar*         m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]; ///< array of cross-component prediction alpha values
   Bool*          m_CUTransquantBypass;   ///< array of cu_transquant_bypass flags
-  Char*          m_phQP;               ///< array of QP values
+  SChar*         m_phQP;               ///< array of QP values
   UChar*         m_ChromaQpAdj;        ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1
   UInt           m_codedChromaQpAdj;
@@ -143,6 +143,6 @@
   UChar*        m_puhIntraDir[MAX_NUM_CHANNEL_TYPE]; // 0-> Luma, 1-> Chroma
   UChar*        m_puhInterDir;        ///< array of inter directions
-  Char*         m_apiMVPIdx[NUM_REF_PIC_LIST_01];       ///< array of motion vector predictor candidates
-  Char*         m_apiMVPNum[NUM_REF_PIC_LIST_01];       ///< array of number of possible motion vectors predictors
+  SChar*        m_apiMVPIdx[NUM_REF_PIC_LIST_01];       ///< array of motion vector predictor candidates
+  SChar*        m_apiMVPNum[NUM_REF_PIC_LIST_01];       ///< array of number of possible motion vectors predictors
   Bool*         m_pbIPCMFlag;         ///< array of intra_pcm flags
 
@@ -156,5 +156,5 @@
   UInt          m_uiTotalBits;        ///< sum of partition bits
   UInt          m_uiTotalBins;        ///< sum of partition bins
-  Char          m_codedQP;
+  SChar         m_codedQP;
   UChar*        m_explicitRdpcmMode[MAX_NUM_COMPONENT]; ///< Stores the explicit RDPCM mode for all TUs belonging to this CU
 
@@ -223,5 +223,5 @@
   // -------------------------------------------------------------------------------------------------------------------
 
-  Char*         getPartitionSize      ()                        { return m_pePartSize;        }
+  SChar*        getPartitionSize      ()                        { return m_pePartSize;        }
   PartSize      getPartitionSize      ( UInt uiIdx )            { return static_cast<PartSize>( m_pePartSize[uiIdx] ); }
   Void          setPartitionSize      ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh;   }
@@ -234,11 +234,11 @@
   Void          setSkipFlagSubParts   ( Bool skip, UInt absPartIdx, UInt depth );
 
-  Char*         getPredictionMode     ()                        { return m_pePredMode;        }
+  SChar*        getPredictionMode     ()                        { return m_pePredMode;        }
   PredMode      getPredictionMode     ( UInt uiIdx )            { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
   Void          setPredictionMode     ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh;   }
   Void          setPredModeSubParts   ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth );
 
-  Char*         getCrossComponentPredictionAlpha( ComponentID compID )             { return m_crossComponentPredictionAlpha[compID];         }
-  Char          getCrossComponentPredictionAlpha( UInt uiIdx, ComponentID compID ) { return m_crossComponentPredictionAlpha[compID][uiIdx];  }
+  SChar*        getCrossComponentPredictionAlpha( ComponentID compID )             { return m_crossComponentPredictionAlpha[compID];         }
+  SChar         getCrossComponentPredictionAlpha( UInt uiIdx, ComponentID compID ) { return m_crossComponentPredictionAlpha[compID][uiIdx];  }
 
   Bool*         getCUTransquantBypass ()                        { return m_CUTransquantBypass;        }
@@ -255,13 +255,13 @@
   Void          setSizeSubParts       ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth );
 
-  Char*         getQP                 ()                        { return m_phQP;              }
-  Char          getQP                 ( UInt uiIdx ) const      { return m_phQP[uiIdx];       }
-  Void          setQP                 ( UInt uiIdx, Char value ){ m_phQP[uiIdx] =  value;     }
+  SChar*        getQP                 ()                        { return m_phQP;              }
+  SChar         getQP                 ( UInt uiIdx ) const      { return m_phQP[uiIdx];       }
+  Void          setQP                 ( UInt uiIdx, SChar value){ m_phQP[uiIdx] =  value;     }
   Void          setQPSubParts         ( Int qp,   UInt uiAbsPartIdx, UInt uiDepth );
   Int           getLastValidPartIdx   ( Int iAbsPartIdx );
-  Char          getLastCodedQP        ( UInt uiAbsPartIdx );
+  SChar         getLastCodedQP        ( UInt uiAbsPartIdx );
   Void          setQPSubCUs           ( Int qp, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf );
-  Void          setCodedQP            ( Char qp )               { m_codedQP = qp;             }
-  Char          getCodedQP            ()                        { return m_codedQP;           }
+  Void          setCodedQP            ( SChar qp )              { m_codedQP = qp;             }
+  SChar         getCodedQP            ()                        { return m_codedQP;           }
 
   UChar*        getChromaQpAdj        ()                        { return m_ChromaQpAdj;       } ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1
@@ -269,6 +269,6 @@
   Void          setChromaQpAdj        (Int idx, UChar val)      { m_ChromaQpAdj[idx] = val;   } ///< When val = 0,   cu_chroma_qp_offset_flag=0; when val>0,   indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=val-1
   Void          setChromaQpAdjSubParts( UChar val, Int absPartIdx, Int depth );
-  Void          setCodedChromaQpAdj   ( Char qp )               { m_codedChromaQpAdj = qp;    }
-  Char          getCodedChromaQpAdj   ()                        { return m_codedChromaQpAdj;  }
+  Void          setCodedChromaQpAdj   ( SChar qp )              { m_codedChromaQpAdj = qp;    }
+  SChar         getCodedChromaQpAdj   ()                        { return m_codedChromaQpAdj;  }
 
   Bool          isLosslessCoded       ( UInt absPartIdx );
@@ -289,5 +289,5 @@
   Bool          isRDPCMEnabled         ( UInt uiAbsPartIdx )  { return getSlice()->getSPS()->getSpsRangeExtension().getRdpcmEnabledFlag(isIntra(uiAbsPartIdx) ? RDPCM_SIGNAL_IMPLICIT : RDPCM_SIGNAL_EXPLICIT); }
 
-  Void          setCrossComponentPredictionAlphaPartRange    ( Char alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes );
+  Void          setCrossComponentPredictionAlphaPartRange    ( SChar alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes );
   Void          setTransformSkipPartRange                    ( UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes );
 
@@ -375,9 +375,9 @@
   Void          setMVPIdx             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx)  { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx;  }
   Int           getMVPIdx             ( RefPicList eRefPicList, UInt uiIdx)               { return m_apiMVPIdx[eRefPicList][uiIdx];     }
-  Char*         getMVPIdx             ( RefPicList eRefPicList )                          { return m_apiMVPIdx[eRefPicList];            }
+  SChar*        getMVPIdx             ( RefPicList eRefPicList )                          { return m_apiMVPIdx[eRefPicList];            }
 
   Void          setMVPNum             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum;  }
   Int           getMVPNum             ( RefPicList eRefPicList, UInt uiIdx )              { return m_apiMVPNum[eRefPicList][uiIdx];     }
-  Char*         getMVPNum             ( RefPicList eRefPicList )                          { return m_apiMVPNum[eRefPicList];            }
+  SChar*        getMVPNum             ( RefPicList eRefPicList )                          { return m_apiMVPNum[eRefPicList];            }
 
   Void          setMVPIdxSubParts     ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
@@ -420,5 +420,5 @@
   TComDataCU*   getQpMinCuLeft              ( UInt&  uiLPartUnitIdx , UInt uiCurrAbsIdxInCtu );
   TComDataCU*   getQpMinCuAbove             ( UInt&  uiAPartUnitIdx , UInt uiCurrAbsIdxInCtu );
-  Char          getRefQP                    ( UInt   uiCurrAbsIdxInCtu                       );
+  SChar         getRefQP                    ( UInt   uiCurrAbsIdxInCtu                       );
 
   /// returns CU and part index of the PU above the top row of the current uiCurrPartUnitIdx of the CU, at a horizontal offset (to the right) of uiPartUnitOffset (in parts)
@@ -475,5 +475,5 @@
 
   UInt          getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const ;
- 
+
 #if SVC_EXTENSION
   Void          setLayerId (UInt layerId)       { m_layerId = layerId; }
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.cpp	(revision 1442)
@@ -60,5 +60,5 @@
   m_pcMv     = new TComMv[ uiNumPartition ];
   m_pcMvd    = new TComMv[ uiNumPartition ];
-  m_piRefIdx = new Char  [ uiNumPartition ];
+  m_piRefIdx = new SChar [ uiNumPartition ];
 
   m_uiNumPartition = uiNumPartition;
@@ -315,5 +315,5 @@
 Void TComCUMvField::setAllRefIdx ( Int iRefIdx, PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx )
 {
-  setAll(m_piRefIdx, static_cast<Char>(iRefIdx), eCUMode, iPartAddr, uiDepth, iPartIdx);
+  setAll(m_piRefIdx, static_cast<SChar>(iRefIdx), eCUMode, iPartAddr, uiDepth, iPartIdx);
 }
 
@@ -328,5 +328,5 @@
  * \param scale      Factor by which to subsample motion information
  */
-Void TComCUMvField::compress(Char* pePredMode, Int scale)
+Void TComCUMvField::compress(SChar* pePredMode, Int scale)
 {
   Int N = scale * scale;
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h	(revision 1442)
@@ -94,5 +94,5 @@
   TComMv*   m_pcMv;
   TComMv*   m_pcMvd;
-  Char*     m_piRefIdx;
+  SChar*    m_piRefIdx;
   UInt      m_uiNumPartition;
   AMVPInfo  m_cAMVPInfo;
@@ -153,5 +153,5 @@
   }
 
-  Void compress(Char* pePredMode, Int scale);
+  Void compress(SChar* pePredMode, Int scale);
 
 #if SVC_EXTENSION
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 1442)
@@ -363,5 +363,5 @@
       }
     }
-    memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(Char)*numPartitions );
+    memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(SChar)*numPartitions );
   }
 }
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp	(revision 1442)
@@ -296,16 +296,7 @@
 
 // NOTE: This function is never called, but may be useful for developers.
-Void TComPicYuv::dump (const Char* pFileName, const BitDepths &bitDepths, Bool bAdd) const
-{
-  FILE* pFile;
-  if (!bAdd)
-  {
-    pFile = fopen (pFileName, "wb");
-  }
-  else
-  {
-    pFile = fopen (pFileName, "ab");
-  }
-
+Void TComPicYuv::dump (const std::string &fileName, const BitDepths &bitDepths, Bool bAdd) const
+{
+  FILE* pFile = fopen (fileName.c_str(), bAdd?"ab":"wb");
 
   for(Int comp = 0; comp < getNumberValidComponents(); comp++)
@@ -333,19 +324,11 @@
 }
 
-Void TComPicYuv::dump( Char* pFileName, Bool bAdd, Int bitDepth )
-{
-  FILE* pFile;
-  if (!bAdd)
-  {
-    pFile = fopen (pFileName, "wb");
-  }
-  else
-  {
-    pFile = fopen (pFileName, "ab");
-  }
+Void TComPicYuv::dump( const std::string &fileName, const Bool bAdd, const Int bitDepth )
+{
+  FILE* pFile = fopen (fileName.c_str(), bAdd?"ab":"wb");
 
   if( bitDepth == 8 )
   {
-    dump( pFileName, bitDepth, bAdd );
+    dump( fileName, bitDepth, bAdd );
     return;
   }
@@ -378,5 +361,5 @@
 
 #if AUXILIARY_PICTURES
-Void TComPicYuv::convertToMonochrome(Int bitDepthChroma)
+Void TComPicYuv::convertToMonochrome(const Int bitDepthChroma)
 {
   Pel grayVal = (1 << (bitDepthChroma - 1));
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h	(revision 1442)
@@ -180,5 +180,5 @@
 
   //  Dump picture
-  Void          dump              (const Char* pFileName, const BitDepths &bitDepths, Bool bAdd = false) const ;
+  Void          dump              (const std::string &fileName, const BitDepths &bitDepths, Bool bAdd = false) const ;
 
   // Set border extension flag
@@ -192,9 +192,9 @@
   Bool          isReconstructed()                                { return m_isReconstructed;                }
 #if AUXILIARY_PICTURES  
-  Void          convertToMonochrome(Int bitDepthChroma);
-#endif
-#endif
-
-  Void          dump( Char* pFileName, Bool bAdd, Int bitDepth );
+  Void          convertToMonochrome(const Int bitDepthChroma);
+#endif
+#endif
+
+  Void          dump( const std::string &fileName, const Bool bAdd, const Int bitDepth );
 
 };// END CLASS DEFINITION TComPicYuv
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuvMD5.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuvMD5.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPicYuvMD5.cpp	(revision 1442)
@@ -209,5 +209,5 @@
 std::string hashToString(const TComPictureHash &digest, Int numChar)
 {
-  static const Char* hex = "0123456789abcdef";
+  static const TChar* hex = "0123456789abcdef";
   std::string result;
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp	(revision 1442)
@@ -51,5 +51,5 @@
 //! \{
 
-const Char* nalUnitTypeToString(NalUnitType type)
+const TChar* nalUnitTypeToString(NalUnitType type)
 {
 #if SVC_EXTENSION
@@ -602,5 +602,5 @@
 // ====================================================================================================================
 
-Char  g_aucConvertToBit  [ MAX_CU_SIZE+1 ];
+SChar  g_aucConvertToBit  [ MAX_CU_SIZE+1 ];
 
 #if ENC_DEC_TRACE
@@ -630,5 +630,5 @@
 const UInt g_uiGroupIdx[ MAX_TU_SIZE ]   = {0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9};
 
-const Char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
+const TChar *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
 {
   {
@@ -666,5 +666,5 @@
 };
 
-const Char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
+const TChar *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
 {
   {
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComRom.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComRom.h	(revision 1442)
@@ -125,5 +125,5 @@
 // ====================================================================================================================
 
-extern       Char   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2
+extern       SChar   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2
 
 
@@ -159,8 +159,8 @@
 #endif
 
-const Char* nalUnitTypeToString(NalUnitType type);
+const TChar* nalUnitTypeToString(NalUnitType type);
 
-extern const Char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
-extern const Char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
+extern const TChar *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
+extern const TChar *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
 
 extern const Int g_quantTSDefault4x4[4*4];
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp	(revision 1442)
@@ -324,5 +324,5 @@
       m_signLineBuf1 = NULL;
     }
-    m_signLineBuf1 = new Char[m_lineBufWidth+1];
+    m_signLineBuf1 = new SChar[m_lineBufWidth+1];
 
     if (m_signLineBuf2)
@@ -331,5 +331,5 @@
       m_signLineBuf2 = NULL;
     }
-    m_signLineBuf2 = new Char[m_lineBufWidth+1];
+    m_signLineBuf2 = new SChar[m_lineBufWidth+1];
   }
 
@@ -338,5 +338,5 @@
   Int x,y, startX, startY, endX, endY, edgeType;
   Int firstLineStartX, firstLineEndX, lastLineStartX, lastLineEndX;
-  Char signLeft, signRight, signDown;
+  SChar signLeft, signRight, signDown;
 
   Pel* srcLine = srcBlk;
@@ -352,8 +352,8 @@
       for (y=0; y< height; y++)
       {
-        signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
+        signLeft = (SChar)sgn(srcLine[startX] - srcLine[startX-1]);
         for (x=startX; x< endX; x++)
         {
-          signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 
+          signRight = (SChar)sgn(srcLine[x] - srcLine[x+1]);
           edgeType =  signRight + signLeft;
           signLeft  = -signRight;
@@ -370,5 +370,5 @@
     {
       offset += 2;
-      Char *signUpLine = m_signLineBuf1;
+      SChar *signUpLine = m_signLineBuf1;
 
       startY = isAboveAvail ? 0 : 1;
@@ -383,5 +383,5 @@
       for (x=0; x< width; x++)
       {
-        signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]);
+        signUpLine[x] = (SChar)sgn(srcLine[x] - srcLineAbove[x]);
       }
 
@@ -393,5 +393,5 @@
         for (x=0; x< width; x++)
         {
-          signDown  = (Char)sgn(srcLine[x] - srcLineBelow[x]);
+          signDown  = (SChar)sgn(srcLine[x] - srcLineBelow[x]);
           edgeType = signDown + signUpLine[x];
           signUpLine[x]= -signDown;
@@ -408,5 +408,5 @@
     {
       offset += 2;
-      Char *signUpLine, *signDownLine, *signTmpLine;
+      SChar *signUpLine, *signDownLine, *signTmpLine;
 
       signUpLine  = m_signLineBuf1;
@@ -420,5 +420,5 @@
       for (x=startX; x< endX+1; x++)
       {
-        signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x- 1]);
+        signUpLine[x] = (SChar)sgn(srcLineBelow[x] - srcLine[x- 1]);
       }
 
@@ -444,5 +444,5 @@
         for (x=startX; x<endX; x++)
         {
-          signDown =  (Char)sgn(srcLine[x] - srcLineBelow[x+ 1]);
+          signDown =  (SChar)sgn(srcLine[x] - srcLineBelow[x+ 1]);
           edgeType =  signDown + signUpLine[x];
           resLine[x] = Clip3<Int>(0, maxSampleValueIncl, srcLine[x] + offset[edgeType]);
@@ -450,5 +450,5 @@
           signDownLine[x+1] = -signDown;
         }
-        signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]);
+        signDownLine[startX] = (SChar)sgn(srcLineBelow[startX] - srcLine[startX-1]);
 
         signTmpLine  = signUpLine;
@@ -475,5 +475,5 @@
     {
       offset += 2;
-      Char *signUpLine = m_signLineBuf1+1;
+      SChar *signUpLine = m_signLineBuf1+1;
 
       startX = isLeftAvail ? 0 : 1;
@@ -484,5 +484,5 @@
       for (x=startX-1; x< endX; x++)
       {
-        signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]);
+        signUpLine[x] = (SChar)sgn(srcLineBelow[x] - srcLine[x+1]);
       }
 
@@ -507,10 +507,10 @@
         for(x= startX; x< endX; x++)
         {
-          signDown =  (Char)sgn(srcLine[x] - srcLineBelow[x-1]);
+          signDown =  (SChar)sgn(srcLine[x] - srcLineBelow[x-1]);
           edgeType =  signDown + signUpLine[x];
           resLine[x] = Clip3<Int>(0, maxSampleValueIncl, srcLine[x] + offset[edgeType]);
           signUpLine[x-1] = -signDown;
         }
-        signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]);
+        signUpLine[endX-1] = (SChar)sgn(srcLineBelow[endX-1] - srcLine[endX]);
         srcLine  += srcStride;
         resLine += resStride;
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h	(revision 1442)
@@ -96,6 +96,6 @@
 
   Int m_lineBufWidth;
-  Char* m_signLineBuf1;
-  Char* m_signLineBuf2;
+  SChar* m_signLineBuf1;
+  SChar* m_signLineBuf2;
   ChromaFormat m_chromaFormatIDC;
 private:
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1442)
@@ -2444,11 +2444,11 @@
 }
 
-Bool TComScalingList::xParseScalingList(Char* pchFile)
+Bool TComScalingList::xParseScalingList(const std::string &fileName)
 {
   static const Int LINE_SIZE=1024;
   FILE *fp = NULL;
-  Char line[LINE_SIZE];
-
-  if (pchFile == NULL)
+  TChar line[LINE_SIZE];
+
+  if (fileName.empty())
   {
     fprintf(stderr, "Error: no scaling list file specified. Help on scaling lists being output\n");
@@ -2459,7 +2459,7 @@
     return true;
   }
-  else if ((fp = fopen(pchFile,"r")) == (FILE*)NULL)
-  {
-    fprintf(stderr, "Error: cannot open scaling list file %s for reading\n",pchFile);
+  else if ((fp = fopen(fileName.c_str(),"r")) == (FILE*)NULL)
+  {
+    fprintf(stderr, "Error: cannot open scaling list file %s for reading\n", fileName.c_str());
     return true;
   }
@@ -2489,6 +2489,6 @@
           while ((!feof(fp)) && (!bFound))
           {
-            Char *ret = fgets(line, LINE_SIZE, fp);
-            Char *findNamePosition= ret==NULL ? NULL : strstr(line, MatrixType[sizeIdc][listIdc]);
+            TChar *ret = fgets(line, LINE_SIZE, fp);
+            TChar *findNamePosition= ret==NULL ? NULL : strstr(line, MatrixType[sizeIdc][listIdc]);
             // This could be a match against the DC string as well, so verify it isn't
             if (findNamePosition!= NULL && (MatrixType_DC[sizeIdc][listIdc]==NULL || strstr(line, MatrixType_DC[sizeIdc][listIdc])==NULL))
@@ -2499,5 +2499,5 @@
           if (!bFound)
           {
-            fprintf(stderr, "Error: cannot find Matrix %s from scaling list file %s\n", MatrixType[sizeIdc][listIdc], pchFile);
+            fprintf(stderr, "Error: cannot find Matrix %s from scaling list file %s\n", MatrixType[sizeIdc][listIdc], fileName.c_str());
             return true;
           }
@@ -2508,10 +2508,10 @@
           if (fscanf(fp, "%d,", &data)!=1)
           {
-            fprintf(stderr, "Error: cannot read value #%d for Matrix %s from scaling list file %s at file position %ld\n", i, MatrixType[sizeIdc][listIdc], pchFile, ftell(fp));
+            fprintf(stderr, "Error: cannot read value #%d for Matrix %s from scaling list file %s at file position %ld\n", i, MatrixType[sizeIdc][listIdc], fileName.c_str(), ftell(fp));
             return true;
           }
           if (data<0 || data>255)
           {
-            fprintf(stderr, "Error: QMatrix entry #%d of value %d for Matrix %s from scaling list file %s at file position %ld is out of range (0 to 255)\n", i, data, MatrixType[sizeIdc][listIdc], pchFile, ftell(fp));
+            fprintf(stderr, "Error: QMatrix entry #%d of value %d for Matrix %s from scaling list file %s at file position %ld is out of range (0 to 255)\n", i, data, MatrixType[sizeIdc][listIdc], fileName.c_str(), ftell(fp));
             return true;
           }
@@ -2529,6 +2529,6 @@
             while ((!feof(fp)) && (!bFound))
             {
-              Char *ret = fgets(line, LINE_SIZE, fp);
-              Char *findNamePosition= ret==NULL ? NULL : strstr(line, MatrixType_DC[sizeIdc][listIdc]);
+              TChar *ret = fgets(line, LINE_SIZE, fp);
+              TChar *findNamePosition= ret==NULL ? NULL : strstr(line, MatrixType_DC[sizeIdc][listIdc]);
               if (findNamePosition!= NULL)
               {
@@ -2539,5 +2539,5 @@
             if (!bFound)
             {
-              fprintf(stderr, "Error: cannot find DC Matrix %s from scaling list file %s\n", MatrixType_DC[sizeIdc][listIdc], pchFile);
+              fprintf(stderr, "Error: cannot find DC Matrix %s from scaling list file %s\n", MatrixType_DC[sizeIdc][listIdc], fileName.c_str());
               return true;
             }
@@ -2546,10 +2546,10 @@
           if (fscanf(fp, "%d,", &data)!=1)
           {
-            fprintf(stderr, "Error: cannot read DC %s from scaling list file %s at file position %ld\n", MatrixType_DC[sizeIdc][listIdc], pchFile, ftell(fp));
+            fprintf(stderr, "Error: cannot read DC %s from scaling list file %s at file position %ld\n", MatrixType_DC[sizeIdc][listIdc], fileName.c_str(), ftell(fp));
             return true;
           }
           if (data<0 || data>255)
           {
-            fprintf(stderr, "Error: DC value %d for Matrix %s from scaling list file %s at file position %ld is out of range (0 to 255)\n", data, MatrixType[sizeIdc][listIdc], pchFile, ftell(fp));
+            fprintf(stderr, "Error: DC value %d for Matrix %s from scaling list file %s at file position %ld is out of range (0 to 255)\n", data, MatrixType[sizeIdc][listIdc], fileName.c_str(), ftell(fp));
             return true;
           }
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1442)
@@ -176,5 +176,5 @@
   Void       checkDcOfMatrix();
   Void       processRefMatrix(UInt sizeId, UInt listId , UInt refListId );
-  Bool       xParseScalingList(Char* pchFile);
+  Bool       xParseScalingList(const std::string &fileName);
   Void       setDefaultScalingList();
   Bool       checkDefaultScalingList();
@@ -789,5 +789,5 @@
   UInt              getNumHrdParameters() const                          { return m_numHrdParameters;                                       }
   Void              setNumHrdParameters(UInt v)                          { m_numHrdParameters = v;                                          }
-  
+
 #if !SVC_EXTENSION
   UInt              getMaxNuhReservedZeroLayerId() const                 { return m_maxNuhReservedZeroLayerId;                              }
@@ -1140,4 +1140,5 @@
 #endif //SVC_EXTENSION
 };
+
 
 class TComVUI
Index: /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1442)
@@ -259,10 +259,7 @@
 typedef       bool                Bool;
 
-#ifdef __arm__
-typedef       signed char         Char;
-#else
-typedef       char                Char;
-#endif
-typedef       unsigned char       UChar;
+typedef       char                TChar; // Used for text/characters
+typedef       signed char         SChar; // Signed 8-bit values
+typedef       unsigned char       UChar; // Unsigned 8-bit values
 typedef       short               Short;
 typedef       unsigned short      UShort;
Index: /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 1442)
@@ -63,5 +63,5 @@
 #endif
 
-Void SEIReader::sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const Char *pSymbolName)
+Void SEIReader::sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const TChar *pSymbolName)
 {
   READ_CODE(uiLength, ruiCode, pSymbolName);
@@ -72,5 +72,5 @@
 }
 
-Void SEIReader::sei_read_uvlc(std::ostream *pOS, UInt& ruiCode, const Char *pSymbolName)
+Void SEIReader::sei_read_uvlc(std::ostream *pOS, UInt& ruiCode, const TChar *pSymbolName)
 {
   READ_UVLC(ruiCode, pSymbolName);
@@ -81,5 +81,5 @@
 }
 
-Void SEIReader::sei_read_svlc(std::ostream *pOS, Int& ruiCode, const Char *pSymbolName)
+Void SEIReader::sei_read_svlc(std::ostream *pOS, Int& ruiCode, const TChar *pSymbolName)
 {
   READ_SVLC(ruiCode, pSymbolName);
@@ -90,5 +90,5 @@
 }
 
-Void SEIReader::sei_read_flag(std::ostream *pOS, UInt& ruiCode, const Char *pSymbolName)
+Void SEIReader::sei_read_flag(std::ostream *pOS, UInt& ruiCode, const TChar *pSymbolName)
 {
   READ_FLAG(ruiCode, pSymbolName);
@@ -522,5 +522,5 @@
   sei.method = static_cast<SEIDecodedPictureHash::Method>(val); bytesRead++;
 
-  const Char *traceString="\0";
+  const TChar *traceString="\0";
   switch (sei.method)
   {
Index: /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h	(revision 1442)
@@ -109,8 +109,8 @@
   Void xParseSEIMasteringDisplayColourVolume  (SEIMasteringDisplayColourVolume& sei,  UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
 
-  Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const Char *pSymbolName);
-  Void sei_read_uvlc(std::ostream *pOS,                UInt& ruiCode, const Char *pSymbolName);
-  Void sei_read_svlc(std::ostream *pOS,                Int&  ruiCode, const Char *pSymbolName);
-  Void sei_read_flag(std::ostream *pOS,                UInt& ruiCode, const Char *pSymbolName);
+  Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const TChar *pSymbolName);
+  Void sei_read_uvlc(std::ostream *pOS,                UInt& ruiCode, const TChar *pSymbolName);
+  Void sei_read_svlc(std::ostream *pOS,                Int&  ruiCode, const TChar *pSymbolName);
+  Void sei_read_flag(std::ostream *pOS,                UInt& ruiCode, const TChar *pSymbolName);
 
 #if Q0074_COLOUR_REMAPPING_SEI
Index: /branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1442)
@@ -49,5 +49,5 @@
 #if ENC_DEC_TRACE
 
-Void  SyntaxElementParser::xReadCodeTr           (UInt length, UInt& rValue, const Char *pSymbolName)
+Void  SyntaxElementParser::xReadCodeTr           (UInt length, UInt& rValue, const TChar *pSymbolName)
 {
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
@@ -68,5 +68,5 @@
 }
 
-Void  SyntaxElementParser::xReadUvlcTr           (UInt& rValue, const Char *pSymbolName)
+Void  SyntaxElementParser::xReadUvlcTr           (UInt& rValue, const TChar *pSymbolName)
 {
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
@@ -80,5 +80,5 @@
 }
 
-Void  SyntaxElementParser::xReadSvlcTr           (Int& rValue, const Char *pSymbolName)
+Void  SyntaxElementParser::xReadSvlcTr           (Int& rValue, const TChar *pSymbolName)
 {
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
@@ -92,5 +92,5 @@
 }
 
-Void  SyntaxElementParser::xReadFlagTr           (UInt& rValue, const Char *pSymbolName)
+Void  SyntaxElementParser::xReadFlagTr           (UInt& rValue, const TChar *pSymbolName)
 {
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
@@ -135,5 +135,5 @@
 // ====================================================================================================================
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
-Void SyntaxElementParser::xReadCode (UInt uiLength, UInt& ruiCode, const Char *pSymbolName)
+Void SyntaxElementParser::xReadCode (UInt uiLength, UInt& ruiCode, const TChar *pSymbolName)
 #else
 Void SyntaxElementParser::xReadCode (UInt uiLength, UInt& ruiCode)
@@ -148,5 +148,5 @@
 
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
-Void SyntaxElementParser::xReadUvlc( UInt& ruiVal, const Char *pSymbolName)
+Void SyntaxElementParser::xReadUvlc( UInt& ruiVal, const TChar *pSymbolName)
 #else
 Void SyntaxElementParser::xReadUvlc( UInt& ruiVal)
@@ -186,5 +186,5 @@
 
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
-Void SyntaxElementParser::xReadSvlc( Int& riVal, const Char *pSymbolName)
+Void SyntaxElementParser::xReadSvlc( Int& riVal, const TChar *pSymbolName)
 #else
 Void SyntaxElementParser::xReadSvlc( Int& riVal)
@@ -224,5 +224,5 @@
 
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
-Void SyntaxElementParser::xReadFlag (UInt& ruiCode, const Char *pSymbolName)
+Void SyntaxElementParser::xReadFlag (UInt& ruiCode, const TChar *pSymbolName)
 #else
 Void SyntaxElementParser::xReadFlag (UInt& ruiCode)
@@ -281,5 +281,5 @@
 #if Q0096_OVERLAY_SEI
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
-Void SyntaxElementParser::xReadString (UInt bufSize, UChar *pVal, UInt& rLength, const Char *pSymbolName)
+Void SyntaxElementParser::xReadString (UInt bufSize, UChar *pVal, UInt& rLength, const TChar *pSymbolName)
 #else
 Void  SyntaxElementParser::xReadString (UInt bufSize, UChar *pVal, UInt& rLength)
Index: /branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.h	(revision 1442)
@@ -98,10 +98,10 @@
 
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
-  Void  xReadCode    ( UInt   length, UInt& val, const Char *pSymbolName );
-  Void  xReadUvlc    ( UInt&  val, const Char *pSymbolName );
-  Void  xReadSvlc    ( Int&   val, const Char *pSymbolName );
-  Void  xReadFlag    ( UInt&  val, const Char *pSymbolName );
+  Void  xReadCode    ( UInt   length, UInt& val, const TChar *pSymbolName );
+  Void  xReadUvlc    ( UInt&  val, const TChar *pSymbolName );
+  Void  xReadSvlc    ( Int&   val, const TChar *pSymbolName );
+  Void  xReadFlag    ( UInt&  val, const TChar *pSymbolName );
 #if Q0096_OVERLAY_SEI
-  Void  xReadString  (UInt bufSize, UChar *pValue, UInt& rLength, const Char *pSymbolName);
+  Void  xReadString  (UInt bufSize, UChar *pValue, UInt& rLength, const TChar *pSymbolName);
 #endif
 #else
@@ -115,8 +115,8 @@
 #endif
 #if ENC_DEC_TRACE
-  Void  xReadCodeTr  (UInt  length, UInt& rValue, const Char *pSymbolName);
-  Void  xReadUvlcTr  (              UInt& rValue, const Char *pSymbolName);
-  Void  xReadSvlcTr  (               Int& rValue, const Char *pSymbolName);
-  Void  xReadFlagTr  (              UInt& rValue, const Char *pSymbolName);
+  Void  xReadCodeTr  (UInt  length, UInt& rValue, const TChar *pSymbolName);
+  Void  xReadUvlcTr  (              UInt& rValue, const TChar *pSymbolName);
+  Void  xReadSvlcTr  (               Int& rValue, const TChar *pSymbolName);
+  Void  xReadFlagTr  (              UInt& rValue, const TChar *pSymbolName);
 #if Q0096_OVERLAY_SEI
   Void  xReadStringTr(UInt bufSize, UChar *pValue, UInt& rLength, const Char *pSymbolName);
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp	(revision 1442)
@@ -169,5 +169,5 @@
   if (g_debugCounter >= debugCabacBinTargetLine)
   {
-    Char breakPointThis;
+    UChar breakPointThis;
     breakPointThis = 7;
   }
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1442)
@@ -343,12 +343,12 @@
   {
 #if ENC_DEC_TRACE || RExt__DECODER_DEBUG_BIT_STATISTICS
-    static const char *syntaxStrings[]={ "pps_range_extension_flag",
-                                         "pps_multilayer_extension_flag",
-                                         "pps_extension_6bits[0]",
-                                         "pps_extension_6bits[1]",
-                                         "pps_extension_6bits[2]",
-                                         "pps_extension_6bits[3]",
-                                         "pps_extension_6bits[4]",
-                                         "pps_extension_6bits[5]" };
+    static const TChar *syntaxStrings[]={ "pps_range_extension_flag",
+                                          "pps_multilayer_extension_flag",
+                                          "pps_extension_6bits[0]",
+                                          "pps_extension_6bits[1]",
+                                          "pps_extension_6bits[2]",
+                                          "pps_extension_6bits[3]",
+                                          "pps_extension_6bits[4]",
+                                          "pps_extension_6bits[5]" };
 #endif
 
@@ -969,12 +969,12 @@
   {
 #if ENC_DEC_TRACE || RExt__DECODER_DEBUG_BIT_STATISTICS
-    static const char *syntaxStrings[]={ "sps_range_extension_flag",
-                                         "sps_multilayer_extension_flag",
-                                         "sps_extension_6bits[0]",
-                                         "sps_extension_6bits[1]",
-                                         "sps_extension_6bits[2]",
-                                         "sps_extension_6bits[3]",
-                                         "sps_extension_6bits[4]",
-                                         "sps_extension_6bits[5]" };
+    static const TChar *syntaxStrings[]={ "sps_range_extension_flag",
+                                          "sps_multilayer_extension_flag",
+                                          "sps_extension_6bits[0]",
+                                          "sps_extension_6bits[1]",
+                                          "sps_extension_6bits[2]",
+                                          "sps_extension_6bits[3]",
+                                          "sps_extension_6bits[4]",
+                                          "sps_extension_6bits[5]" };
 #endif
     Bool sps_extension_flags[NUM_SPS_EXTENSION_FLAGS];
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp	(revision 1442)
@@ -181,5 +181,5 @@
 
   pcPic->compressMotion();
-  Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
+  TChar c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
   if (!pcSlice->isReferenced())
   {
@@ -284,5 +284,5 @@
   TComPictureHash recon_digest;
   Int numChar=0;
-  const Char* hashType = "\0";
+  const TChar* hashType = "\0";
 
   if (pictureHashSEI)
@@ -317,5 +317,5 @@
 
   /* compare digest against received version */
-  const Char* ok = "(unk)";
+  const TChar* ok = "(unk)";
   Bool mismatch = false;
 
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1442)
@@ -860,5 +860,5 @@
   if (!pcCU->isIntra(uiAbsPartIdx) || (pcCU->getIntraDir( CHANNEL_TYPE_CHROMA, uiAbsPartIdx ) == DM_CHROMA_IDX))
   {
-    Char alpha  = 0;
+    SChar alpha = 0;
     UInt symbol = 0;
 
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1442)
@@ -1386,5 +1386,5 @@
         for( Int i = 0; i < uiHeight; i++ )
         {
-          pFile->read(reinterpret_cast<Char*>(buf), len);
+          pFile->read(reinterpret_cast<TChar*>(buf), len);
 
           if( !is16bit )
@@ -1415,5 +1415,5 @@
         for( Int i = 0; i < uiHeight; i++ )
         {
-          pFile->read(reinterpret_cast<Char*>(buf), len);
+          pFile->read(reinterpret_cast<TChar*>(buf), len);
 
           if( !is16bit )
@@ -1440,5 +1440,5 @@
         for( Int i = 0; i < uiHeight; i++ )
         {
-          pFile->read(reinterpret_cast<Char*>(buf), len);
+          pFile->read(reinterpret_cast<TChar*>(buf), len);
 
           if( !is16bit )
Index: /branches/SHM-dev/source/Lib/TLibEncoder/AnnexBwrite.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/AnnexBwrite.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/AnnexBwrite.h	(revision 1442)
@@ -60,5 +60,5 @@
     UInt size = 0; /* size of annexB unit in bytes */
 
-    static const Char start_code_prefix[] = {0,0,0,1};
+    static const UChar start_code_prefix[] = {0,0,0,1};
     if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
     {
@@ -71,10 +71,10 @@
        *    7.4.1.2.3.
        */
-      out.write(start_code_prefix, 4);
+      out.write(reinterpret_cast<const TChar*>(start_code_prefix), 4);
       size += 4;
     }
     else
     {
-      out.write(start_code_prefix+1, 3);
+      out.write(reinterpret_cast<const TChar*>(start_code_prefix+1), 3);
       size += 3;
     }
Index: /branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp	(revision 1442)
@@ -45,5 +45,5 @@
 //! \{
 
-static const Char emulation_prevention_three_byte[] = {3};
+static const UChar emulation_prevention_three_byte[] = {3};
 
 Void writeNalUnitHeader(ostream& out, OutputNALUnit& nalu)       // nal_unit_header()
@@ -56,5 +56,5 @@
   bsNALUHeader.write(nalu.m_temporalId+1, 3); // nuh_temporal_id_plus1
 
-  out.write(bsNALUHeader.getByteStream(), bsNALUHeader.getByteStreamLength());
+  out.write(reinterpret_cast<const TChar*>(bsNALUHeader.getByteStream()), bsNALUHeader.getByteStreamLength());
 }
 /**
@@ -120,5 +120,5 @@
     outputBuffer[outputAmount++]=emulation_prevention_three_byte[0];
   }
-  out.write((Char*)&(*outputBuffer.begin()), outputAmount);
+  out.write(reinterpret_cast<const TChar*>(&(*outputBuffer.begin())), outputAmount);
 }
 
Index: /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1442)
@@ -306,5 +306,5 @@
 Void SEIWriter::xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei)
 {
-  const Char *traceString="\0";
+  const TChar *traceString="\0";
   switch (sei.method)
   {
Index: /branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1442)
@@ -44,5 +44,5 @@
 #if ENC_DEC_TRACE
 
-Void  SyntaxElementWriter::xWriteCodeTr (UInt value, UInt  length, const Char *pSymbolName)
+Void  SyntaxElementWriter::xWriteCodeTr (UInt value, UInt  length, const TChar *pSymbolName)
 {
   xWriteCode (value,length);
@@ -61,5 +61,5 @@
 }
 
-Void  SyntaxElementWriter::xWriteUvlcTr (UInt value, const Char *pSymbolName)
+Void  SyntaxElementWriter::xWriteUvlcTr (UInt value, const TChar *pSymbolName)
 {
   xWriteUvlc (value);
@@ -71,5 +71,5 @@
 }
 
-Void  SyntaxElementWriter::xWriteSvlcTr (Int value, const Char *pSymbolName)
+Void  SyntaxElementWriter::xWriteSvlcTr (Int value, const TChar *pSymbolName)
 {
   xWriteSvlc(value);
@@ -81,5 +81,5 @@
 }
 
-Void  SyntaxElementWriter::xWriteFlagTr(UInt value, const Char *pSymbolName)
+Void  SyntaxElementWriter::xWriteFlagTr(UInt value, const TChar *pSymbolName)
 {
   xWriteFlag(value);
Index: /branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1442)
@@ -92,8 +92,8 @@
 #endif
 #if ENC_DEC_TRACE
-  Void  xWriteCodeTr          ( UInt value, UInt  length, const Char *pSymbolName);
-  Void  xWriteUvlcTr          ( UInt value,               const Char *pSymbolName);
-  Void  xWriteSvlcTr          ( Int  value,               const Char *pSymbolName);
-  Void  xWriteFlagTr          ( UInt value,               const Char *pSymbolName);
+  Void  xWriteCodeTr          ( UInt value, UInt  length, const TChar *pSymbolName);
+  Void  xWriteUvlcTr          ( UInt value,               const TChar *pSymbolName);
+  Void  xWriteSvlcTr          ( Int  value,               const TChar *pSymbolName);
+  Void  xWriteFlagTr          ( UInt value,               const TChar *pSymbolName);
 #if Q0096_OVERLAY_SEI
   Void  xWriteStringTr        ( UChar* value, UInt length, const Char *pSymbolName);
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.h	(revision 1442)
@@ -137,7 +137,7 @@
 
 #if SVC_EXTENSION
-  Void    printOut ( Char cDelim, const ChromaFormat chFmt, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths, UInt layer = 0 )
-#else
-  Void    printOut ( Char cDelim, const ChromaFormat chFmt, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths )
+  Void    printOut ( TChar cDelim, const ChromaFormat chFmt, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths, UInt layer = 0 )
+#else
+  Void    printOut ( TChar cDelim, const ChromaFormat chFmt, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths )
 #endif
   {
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp	(revision 1442)
@@ -236,5 +236,5 @@
   if (g_debugCounter >= debugCabacBinTargetLine)
   {
-    Char breakPointThis;
+    UChar breakPointThis;
     breakPointThis = 7;
   }
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp	(revision 1442)
@@ -90,5 +90,5 @@
   if (g_debugCounter >= debugEncoderSearchBinTargetLine)
   {
-    Char breakPointThis;
+    UChar breakPointThis;
     breakPointThis = 7;
   }
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1442)
@@ -269,12 +269,12 @@
   {
 #if ENC_DEC_TRACE || RExt__DECODER_DEBUG_BIT_STATISTICS
-    static const char *syntaxStrings[]={ "pps_range_extension_flag",
-                                         "pps_multilayer_extension_flag",
-                                         "pps_extension_6bits[0]",
-                                         "pps_extension_6bits[1]",
-                                         "pps_extension_6bits[2]",
-                                         "pps_extension_6bits[3]",
-                                         "pps_extension_6bits[4]",
-                                         "pps_extension_6bits[5]" };
+    static const TChar *syntaxStrings[]={ "pps_range_extension_flag",
+                                          "pps_multilayer_extension_flag",
+                                          "pps_extension_6bits[0]",
+                                          "pps_extension_6bits[1]",
+                                          "pps_extension_6bits[2]",
+                                          "pps_extension_6bits[3]",
+                                          "pps_extension_6bits[4]",
+                                          "pps_extension_6bits[5]" };
 #endif
 
@@ -748,12 +748,12 @@
   {
 #if ENC_DEC_TRACE || RExt__DECODER_DEBUG_BIT_STATISTICS
-    static const char *syntaxStrings[]={ "sps_range_extension_flag",
-                                         "sps_multilayer_extension_flag",
-                                         "sps_extension_6bits[0]",
-                                         "sps_extension_6bits[1]",
-                                         "sps_extension_6bits[2]",
-                                         "sps_extension_6bits[3]",
-                                         "sps_extension_6bits[4]",
-                                         "sps_extension_6bits[5]" };
+    static const TChar *syntaxStrings[]={ "sps_range_extension_flag",
+                                          "sps_multilayer_extension_flag",
+                                          "sps_extension_6bits[0]",
+                                          "sps_extension_6bits[1]",
+                                          "sps_extension_6bits[2]",
+                                          "sps_extension_6bits[3]",
+                                          "sps_extension_6bits[4]",
+                                          "sps_extension_6bits[5]" };
 #endif
 
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1442)
@@ -57,5 +57,5 @@
   Bool m_refPic;
   Int m_numRefPicsActive;
-  Char m_sliceType;
+  SChar m_sliceType;
   Int m_numRefPics;
   Int m_referencePics[MAX_NUM_REF_PICS];
@@ -328,6 +328,6 @@
   UInt      m_log2ParallelMergeLevelMinus2;       ///< Parallel merge estimation region
   UInt      m_maxNumMergeCand;                    ///< Maximum number of merge candidates
-  ScalingListMode m_useScalingListId;            ///< Using quantization matrix i.e. 0=off, 1=default, 2=file.
-  Char*     m_scalingListFile;          ///< quantization matrix file name
+  ScalingListMode m_useScalingListId;             ///< Using quantization matrix i.e. 0=off, 1=default, 2=file.
+  std::string m_scalingListFileName;              ///< quantization matrix file name
   Int       m_TMVPModeId;
   Bool      m_signHideFlag;
@@ -484,5 +484,5 @@
 #endif //SVC_EXTENSION
 #if Q0074_COLOUR_REMAPPING_SEI
-  Char*                               m_colourRemapSEIFileRoot;          ///< SEI Colour Remapping File (initialized from external file)
+  string                              m_colourRemapSEIFileName;          ///< SEI Colour Remapping File (initialized from external file)
 #endif
 
@@ -492,5 +492,5 @@
   , m_tileRowHeight()
 #if Q0074_COLOUR_REMAPPING_SEI
-  , m_colourRemapSEIFileRoot(NULL)
+  , m_colourRemapSEIFileName()
 #endif
   {
@@ -919,6 +919,6 @@
   Void         setUseScalingListId    ( ScalingListMode u )          { m_useScalingListId       = u;   }
   ScalingListMode getUseScalingListId    ()                          { return m_useScalingListId;      }
-  Void         setScalingListFile     ( Char*  pch )                 { m_scalingListFile     = pch; }
-  Char*        getScalingListFile     ()                             { return m_scalingListFile;    }
+  Void         setScalingListFileName       ( const std::string &s ) { m_scalingListFileName = s;      }
+  const std::string& getScalingListFileName () const                 { return m_scalingListFileName;   }
   Void         setTMVPModeId ( Int  u )                              { m_TMVPModeId = u;    }
   Int          getTMVPModeId ()                                      { return m_TMVPModeId; }
@@ -1100,6 +1100,6 @@
 #endif
 #if Q0074_COLOUR_REMAPPING_SEI
-  Void  xSetCRISEIFileRoot( Char* pch )                       { m_colourRemapSEIFileRoot = pch; }
-  Char* getCRISEIFileRoot()                                  { return m_colourRemapSEIFileRoot; }
+  Void  xSetCRISEIFileRoot( std::string pch )                { m_colourRemapSEIFileName = pch; }
+  std::string& getCRISEIFileRoot()                           { return m_colourRemapSEIFileName; }
 #endif
 #if SVC_EXTENSION
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1442)
@@ -814,5 +814,6 @@
   return 1;
 }
-Bool confirmParameter(Bool bflag, const Char* message);
+
+Bool confirmParameter(Bool bflag, const TChar* message);
 // ====================================================================================================================
 // Private member functions
@@ -939,9 +940,9 @@
     string  colourRemapSEIFileWithPoc(m_pcCfg->getCRISEIFileRoot());
     colourRemapSEIFileWithPoc.append(suffix);
-    xSetCRISEIFile( const_cast<Char*>(colourRemapSEIFileWithPoc.c_str()) );
+    xSetCRISEIFile( colourRemapSEIFileWithPoc );
   
     Int ret = xReadingCRIparameters();
 
-    if(ret != -1 && m_pcCfg->getCRISEIFileRoot())
+    if(ret != -1 && !m_pcCfg->getCRISEIFileRoot().empty())
     {
       // check validity of input parameters
@@ -1269,10 +1270,10 @@
       if (cabacZeroWordPaddingEnabled)
       {
-        std::vector<Char> zeroBytesPadding(numberOfAdditionalCabacZeroBytes, Char(0));
+        std::vector<UChar> zeroBytesPadding(numberOfAdditionalCabacZeroBytes, UChar(0));
         for(std::size_t i=0; i<numberOfAdditionalCabacZeroWords; i++)
         {
           zeroBytesPadding[i*3+2]=3;  // 00 00 03
         }
-        nalUnitData.write(&(zeroBytesPadding[0]), numberOfAdditionalCabacZeroBytes);
+        nalUnitData.write(reinterpret_cast<const TChar*>(&(zeroBytesPadding[0])), numberOfAdditionalCabacZeroBytes);
         printf("Adding %d bytes of padding\n", UInt(numberOfAdditionalCabacZeroWords*3));
       }
@@ -3295,5 +3296,5 @@
   }
 
-  Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
+  TChar c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
   if (!pcSlice->isReferenced())
   {
@@ -4571,5 +4572,5 @@
 
 #if Q0074_COLOUR_REMAPPING_SEI
-Bool confirmParameter(Bool bflag, const Char* message)
+Bool confirmParameter(Bool bflag, const TChar* message)
 {
   if (!bflag)
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 1442)
@@ -152,6 +152,6 @@
   TComPicYuv*             m_pColorMappedPic;
 
-  Char                    m_cgsFilterLength;
-  Char                    m_cgsFilterPhases;
+  UChar                   m_cgsFilterLength;
+  UChar                   m_cgsFilterPhases;
   Int                     m_iN;
   Int                   **m_temp;
@@ -276,5 +276,5 @@
 #if Q0074_COLOUR_REMAPPING_SEI
   TComSEIColourRemappingInfo* xGetSEIColourRemappingInfo()  { return &m_seiColourRemappingInfo; }
-  Void xSetCRISEIFile( Char* pch )                          { m_seiColourRemappingInfo.m_colourRemapSEIFile = pch; }
+  Void xSetCRISEIFile( std::string pch )                    { m_seiColourRemappingInfo.m_colourRemapSEIFile = pch; }
 
   Void xFreeColourCRI();
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp	(revision 1442)
@@ -917,5 +917,5 @@
       m_signLineBuf1 = NULL;
     }
-    m_signLineBuf1 = new Char[m_lineBufWidth+1];
+    m_signLineBuf1 = new SChar[m_lineBufWidth+1];
 
     if (m_signLineBuf2)
@@ -924,9 +924,9 @@
       m_signLineBuf2 = NULL;
     }
-    m_signLineBuf2 = new Char[m_lineBufWidth+1];
+    m_signLineBuf2 = new SChar[m_lineBufWidth+1];
   }
 
   Int x,y, startX, startY, endX, endY, edgeType, firstLineStartX, firstLineEndX;
-  Char signLeft, signRight, signDown;
+  SChar signLeft, signRight, signDown;
   Int64 *diff, *count;
   Pel *srcLine, *orgLine;
@@ -958,8 +958,8 @@
         for (y=0; y<endY; y++)
         {
-          signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
+          signLeft = (SChar)sgn(srcLine[startX] - srcLine[startX-1]);
           for (x=startX; x<endX; x++)
           {
-            signRight =  (Char)sgn(srcLine[x] - srcLine[x+1]);
+            signRight =  (SChar)sgn(srcLine[x] - srcLine[x+1]);
             edgeType  =  signRight + signLeft;
             signLeft  = -signRight;
@@ -980,8 +980,8 @@
             for(y=0; y<skipLinesB[typeIdx]; y++)
             {
-              signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
+              signLeft = (SChar)sgn(srcLine[startX] - srcLine[startX-1]);
               for (x=startX; x<endX; x++)
               {
-                signRight =  (Char)sgn(srcLine[x] - srcLine[x+1]);
+                signRight =  (SChar)sgn(srcLine[x] - srcLine[x+1]);
                 edgeType  =  signRight + signLeft;
                 signLeft  = -signRight;
@@ -1001,5 +1001,5 @@
         diff +=2;
         count+=2;
-        Char *signUpLine = m_signLineBuf1;
+        SChar *signUpLine = m_signLineBuf1;
 
         startX = (!isCalculatePreDeblockSamples) ? 0
@@ -1020,5 +1020,5 @@
         for (x=startX; x<endX; x++)
         {
-          signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]);
+          signUpLine[x] = (SChar)sgn(srcLine[x] - srcLineAbove[x]);
         }
 
@@ -1030,5 +1030,5 @@
           for (x=startX; x<endX; x++)
           {
-            signDown  = (Char)sgn(srcLine[x] - srcLineBelow[x]); 
+            signDown  = (SChar)sgn(srcLine[x] - srcLineBelow[x]);
             edgeType  = signDown + signUpLine[x];
             signUpLine[x]= -signDown;
@@ -1070,5 +1070,5 @@
         diff +=2;
         count+=2;
-        Char *signUpLine, *signDownLine, *signTmpLine;
+        SChar *signUpLine, *signDownLine, *signTmpLine;
 
         signUpLine  = m_signLineBuf1;
@@ -1088,5 +1088,5 @@
         for (x=startX; x<endX+1; x++)
         {
-          signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x-1]);
+          signUpLine[x] = (SChar)sgn(srcLineBelow[x] - srcLine[x-1]);
         }
 
@@ -1112,5 +1112,5 @@
           for (x=startX; x<endX; x++)
           {
-            signDown = (Char)sgn(srcLine[x] - srcLineBelow[x+1]);
+            signDown = (SChar)sgn(srcLine[x] - srcLineBelow[x+1]);
             edgeType = signDown + signUpLine[x];
             diff [edgeType] += (orgLine[x] - srcLine[x]);
@@ -1119,5 +1119,5 @@
             signDownLine[x+1] = -signDown;
           }
-          signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]);
+          signDownLine[startX] = (SChar)sgn(srcLineBelow[startX] - srcLine[startX-1]);
 
           signTmpLine  = signUpLine;
@@ -1157,5 +1157,5 @@
         diff +=2;
         count+=2;
-        Char *signUpLine = m_signLineBuf1+1;
+        SChar *signUpLine = m_signLineBuf1+1;
 
         startX = (!isCalculatePreDeblockSamples) ? (isLeftAvail  ? 0 : 1)
@@ -1171,5 +1171,5 @@
         for (x=startX-1; x<endX; x++)
         {
-          signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]);
+          signUpLine[x] = (SChar)sgn(srcLineBelow[x] - srcLine[x+1]);
         }
 
@@ -1200,5 +1200,5 @@
           for(x=startX; x<endX; x++)
           {
-            signDown = (Char)sgn(srcLine[x] - srcLineBelow[x-1]);
+            signDown = (SChar)sgn(srcLine[x] - srcLineBelow[x-1]);
             edgeType = signDown + signUpLine[x];
 
@@ -1208,5 +1208,5 @@
             signUpLine[x-1] = -signDown;
           }
-          signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]);
+          signUpLine[endX-1] = (SChar)sgn(srcLineBelow[endX-1] - srcLine[endX]);
           srcLine  += srcStride;
           orgLine  += orgStride;
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1442)
@@ -305,5 +305,5 @@
     }
 
-    m_phQTTempCrossComponentPredictionAlpha[ch]    = new Char  [uiNumPartitions];
+    m_phQTTempCrossComponentPredictionAlpha[ch]    = new SChar  [uiNumPartitions];
     m_pSharedPredTransformSkip[ch]                 = new Pel   [MAX_CU_SIZE*MAX_CU_SIZE];
     m_pcQTTempTUCoeff[ch]                          = new TCoeff[MAX_CU_SIZE*MAX_CU_SIZE];
@@ -1884,5 +1884,5 @@
 }
 
-Char
+SChar
 TEncSearch::xCalcCrossComponentPredictionAlpha(       TComTU &rTu,
                                                 const ComponentID compID,
@@ -1901,5 +1901,5 @@
   const Int diffBitDepth = pCU->getSlice()->getSPS()->getDifferentialLumaChromaBitDepth();
 
-  Char alpha = 0;
+  SChar alpha = 0;
   Int SSxy  = 0;
   Int SSxx  = 0;
@@ -1921,7 +1921,7 @@
   {
     Double dAlpha = SSxy / Double( SSxx );
-    alpha = Char(Clip3<Int>(-16, 16, (Int)(dAlpha * 16)));
-
-    static const Char alphaQuant[17] = {0, 1, 1, 2, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8};
+    alpha = SChar(Clip3<Int>(-16, 16, (Int)(dAlpha * 16)));
+
+    static const SChar alphaQuant[17] = {0, 1, 1, 2, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8};
 
     alpha = (alpha < 0) ? -alphaQuant[Int(-alpha)] : alphaQuant[Int(alpha)];
@@ -2002,5 +2002,5 @@
         Double     singleCostTmp             = 0;
         UInt       singleCbfCTmp             = 0;
-        Char       bestCrossCPredictionAlpha = 0;
+        SChar      bestCrossCPredictionAlpha = 0;
         Int        bestTransformSkipMode     = 0;
 
@@ -2701,5 +2701,5 @@
               ::memcpy( m_puhQTTempCbf[compID], pcCU->getCbf( compID )+uiPartOffset, uiQPartNum * sizeof( UChar ) );
               ::memcpy( m_puhQTTempTransformSkipFlag[compID], pcCU->getTransformSkip( compID )+uiPartOffset, uiQPartNum * sizeof( UChar ) );
-              ::memcpy( m_phQTTempCrossComponentPredictionAlpha[compID], pcCU->getCrossComponentPredictionAlpha(compID)+uiPartOffset, uiQPartNum * sizeof( Char ) );
+              ::memcpy( m_phQTTempCrossComponentPredictionAlpha[compID], pcCU->getCrossComponentPredictionAlpha(compID)+uiPartOffset, uiQPartNum * sizeof( SChar ) );
             }
           }
@@ -2714,5 +2714,5 @@
           ::memcpy( pcCU->getCbf( compID )+uiPartOffset, m_puhQTTempCbf[compID], uiQPartNum * sizeof( UChar ) );
           ::memcpy( pcCU->getTransformSkip( compID )+uiPartOffset, m_puhQTTempTransformSkipFlag[compID], uiQPartNum * sizeof( UChar ) );
-          ::memcpy( pcCU->getCrossComponentPredictionAlpha(compID)+uiPartOffset, m_phQTTempCrossComponentPredictionAlpha[compID], uiQPartNum * sizeof( Char ) );
+          ::memcpy( pcCU->getCrossComponentPredictionAlpha(compID)+uiPartOffset, m_phQTTempCrossComponentPredictionAlpha[compID], uiQPartNum * sizeof( SChar ) );
         }
       }
@@ -3325,5 +3325,5 @@
 
         Bool bChanged = false;
-        
+
 #if ENCODER_FAST_MODE
         Bool     testIter = true;
@@ -3414,5 +3414,5 @@
         } // for loop-iRefIdxTemp
 #endif
-        
+  
         if ( !bChanged )
         {
@@ -3963,5 +3963,5 @@
   }
 #endif
-  
+
   m_pcRdCost->getMotionCost( true, 0, pcCU->getCUTransquantBypass(uiPartAddr) );
   m_pcRdCost->setCostScale ( 1 );
@@ -4739,5 +4739,5 @@
       const ComponentID component = ComponentID(comp);
       ::memset( pcCU->getCbf( component ) , 0, uiQPartNum * sizeof(UChar) );
-      ::memset( pcCU->getCrossComponentPredictionAlpha(component), 0, ( uiQPartNum * sizeof(Char) ) );
+      ::memset( pcCU->getCrossComponentPredictionAlpha(component), 0, ( uiQPartNum * sizeof(SChar) ) );
     }
     static const UInt useTS[MAX_NUM_COMPONENT]={0,0,0};
@@ -4847,5 +4847,5 @@
   //  Stores the best explicit RDPCM mode for a TU encoded without split
   UInt       bestExplicitRdpcmModeUnSplit[MAX_NUM_COMPONENT][2/*0 = top (or whole TU for non-4:2:2) sub-TU, 1 = bottom sub-TU*/] = {{3,3}, {3,3}, {3,3}};
-  Char       bestCrossCPredictionAlpha   [MAX_NUM_COMPONENT][2/*0 = top (or whole TU for non-4:2:2) sub-TU, 1 = bottom sub-TU*/] = {{0,0},{0,0},{0,0}};
+  SChar      bestCrossCPredictionAlpha   [MAX_NUM_COMPONENT][2/*0 = top (or whole TU for non-4:2:2) sub-TU, 1 = bottom sub-TU*/] = {{0,0},{0,0},{0,0}};
 
   m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
@@ -4918,5 +4918,5 @@
                                                          && (pcCU->getCbf(subTUAbsPartIdx, COMPONENT_Y, uiTrMode) != 0);
 
-          Char preCalcAlpha = 0;
+          SChar preCalcAlpha = 0;
           const Pel *pLumaResi = m_pcQTTempTComYuv[uiQTTempAccessLayer].getAddrPix( COMPONENT_Y, rTu.getRect( COMPONENT_Y ).x0, rTu.getRect( COMPONENT_Y ).y0 );
 
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h	(revision 1442)
@@ -81,5 +81,5 @@
   TComYuv         m_tmpYuvPred; // To be used in xGetInterPredictionError() to avoid constant memory allocation/deallocation
 
-  Char*           m_phQTTempCrossComponentPredictionAlpha[MAX_NUM_COMPONENT];
+  SChar*          m_phQTTempCrossComponentPredictionAlpha[MAX_NUM_COMPONENT];
   Pel*            m_pSharedPredTransformSkip[MAX_NUM_COMPONENT];
   TCoeff*         m_pcQTTempTUCoeff[MAX_NUM_COMPONENT];
@@ -297,5 +297,5 @@
                                                const Int     strideBest );
 
-  Char xCalcCrossComponentPredictionAlpha    (       TComTU &rTu,
+  SChar xCalcCrossComponentPredictionAlpha   (       TComTU &rTu,
                                                const ComponentID compID,
                                                const Pel*        piResiL,
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1442)
@@ -350,5 +350,5 @@
 #endif
     m_cSPS.getScalingList().setDefaultScalingList ();
-    if(m_cSPS.getScalingList().xParseScalingList(getScalingListFile()))
+    if(m_cSPS.getScalingList().xParseScalingList(getScalingListFileName()))
     {
       Bool bParsedScalingList=false; // Use of boolean so that assertion outputs useful string
Index: /branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.cpp	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.cpp	(revision 1442)
@@ -118,5 +118,5 @@
  * \param internalBitDepth bit-depth array to scale image data to/from when reading/writing.
  */
-Void TVideoIOYuv::open( 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] )
+Void TVideoIOYuv::open( const std::string &fileName, Bool bWriteMode, const Int fileBitDepth[MAX_NUM_CHANNEL_TYPE], const Int MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE], const Int internalBitDepth[MAX_NUM_CHANNEL_TYPE] )
 {
   //NOTE: files cannot have bit depth greater than 16
@@ -143,5 +143,5 @@
   if ( bWriteMode )
   {
-    m_cHandle.open( pchFile, ios::binary | ios::out );
+    m_cHandle.open( fileName.c_str(), ios::binary | ios::out );
 
     if( m_cHandle.fail() )
@@ -153,5 +153,5 @@
   else
   {
-    m_cHandle.open( pchFile, ios::binary | ios::in );
+    m_cHandle.open( fileName.c_str(), ios::binary | ios::in );
 
     if( m_cHandle.fail() )
@@ -219,5 +219,5 @@
 
   /* fall back to consuming the input */
-  Char buf[512];
+  TChar buf[512];
   const streamoff offset_mod_bufsize = offset % sizeof(buf);
   for (streamoff i = 0; i < offset - offset_mod_bufsize; i += sizeof(buf))
@@ -275,6 +275,6 @@
 
   const UInt stride_file      = (width444 * (is16bit ? 2 : 1)) >> csx_file;
-
-  UChar  *buf   = new UChar[stride_file];
+  std::vector<UChar> bufVec(stride_file);
+  UChar *buf=&(bufVec[0]);
 
   if (compID!=COMPONENT_Y && (fileFormat==CHROMA_400 || destFormat==CHROMA_400))
@@ -299,5 +299,4 @@
       if (fd.eof() || fd.fail() )
       {
-        delete[] buf;
         return false;
       }
@@ -313,8 +312,7 @@
       {
         // read a new line
-        fd.read(reinterpret_cast<Char*>(buf), stride_file);
+        fd.read(reinterpret_cast<TChar*>(buf), stride_file);
         if (fd.eof() || fd.fail() )
         {
-          delete[] buf;
           return false;
         }
@@ -383,5 +381,4 @@
     }
   }
-  delete[] buf;
   return true;
 }
@@ -421,5 +418,6 @@
   const UInt height_file      = height444>>csy_file;
 
-  UChar  *buf   = new UChar[stride_file];
+  std::vector<UChar> bufVec(stride_file);
+  UChar *buf=&(bufVec[0]);
 
   if (compID!=COMPONENT_Y && (fileFormat==CHROMA_400 || srcFormat==CHROMA_400))
@@ -449,8 +447,7 @@
         }
 
-        fd.write(reinterpret_cast<Char*>(buf), stride_file);
+        fd.write(reinterpret_cast<const TChar*>(buf), stride_file);
         if (fd.eof() || fd.fail() )
         {
-          delete[] buf;
           return false;
         }
@@ -508,8 +505,7 @@
         }
 
-        fd.write(reinterpret_cast<Char*>(buf), stride_file);
+        fd.write(reinterpret_cast<const TChar*>(buf), stride_file);
         if (fd.eof() || fd.fail() )
         {
-          delete[] buf;
           return false;
         }
@@ -523,5 +519,4 @@
     }
   }
-  delete[] buf;
   return true;
 }
@@ -546,5 +541,6 @@
   const UInt height_file      = height444>>csy_file;
 
-  UChar  *buf   = new UChar[stride_file * 2];
+  std::vector<UChar> bufVec(stride_file * 2);
+  UChar *buf=&(bufVec[0]);
 
   if (compID!=COMPONENT_Y && (fileFormat==CHROMA_400 || srcFormat==CHROMA_400))
@@ -579,8 +575,7 @@
         }
 
-        fd.write(reinterpret_cast<Char*>(buf), (stride_file * 2));
+        fd.write(reinterpret_cast<const TChar*>(buf), (stride_file * 2));
         if (fd.eof() || fd.fail() )
         {
-          delete[] buf;
           return false;
         }
@@ -644,8 +639,7 @@
         }
 
-        fd.write(reinterpret_cast<Char*>(buf), (stride_file * 2));
+        fd.write(reinterpret_cast<const TChar*>(buf), (stride_file * 2));
         if (fd.eof() || fd.fail() )
         {
-          delete[] buf;
           return false;
         }
@@ -660,5 +654,4 @@
     }
   }
-  delete[] buf;
   return true;
 }
Index: /branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.h	(revision 1441)
+++ /branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.h	(revision 1442)
@@ -64,5 +64,5 @@
   virtual ~TVideoIOYuv()  {}
 
-  Void  open  ( 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] ); ///< open or create file
+  Void  open  ( const std::string &fileName, Bool bWriteMode, const Int fileBitDepth[MAX_NUM_CHANNEL_TYPE], const Int MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE], const Int internalBitDepth[MAX_NUM_CHANNEL_TYPE] ); ///< open or create file
   Void  close ();                                           ///< close file
 
