Index: trunk/source/App/utils/BitrateTargeting/ExtractBitrates.cpp
===================================================================
--- trunk/source/App/utils/BitrateTargeting/ExtractBitrates.cpp	(revision 872)
+++ trunk/source/App/utils/BitrateTargeting/ExtractBitrates.cpp	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
- *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * granted under this license.
+ *
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -45,19 +45,19 @@
   {
     public:
-      
+
       /// Contructs a new zeroed tally
       Tally( ): m_sum( 0.0 ), m_numSlices( 0 ) { }
-      
+
       /// Adds to the sum and increments the sample-count
       void add( double in ) { ++m_numSlices; m_sum += in; }
-      
+
       /// \return The calculated average
       double average( ) const { return m_sum / ( double )m_numSlices; }
-    
+
     private:
       double m_sum;
       unsigned long m_numSlices;
   };
-  
+
   /// Ignores all of the the characters up to and including a given character
   /// \param line The line being read from
@@ -69,7 +69,10 @@
     while( iLine.good( ) && character != iLine.get( ) )
       ;
-    if( !iLine.good( ) ) throw POCParseException( line );
+    if( !iLine.good( ) )
+    {
+      throw POCParseException( line );
+    }
   }
-  
+
   /// Extracts the average bitrates for each of the temporal layers from the given log
   /// \param i The input stream that represents the log
@@ -79,5 +82,5 @@
   {
     std::map< unsigned char, Tally > tallyMap;
-    
+
     while( i.good( ) )
     {
@@ -86,40 +89,82 @@
       std::getline( i, line );
       std::istringstream iLine( line );
-      if( !iLine.good( ) ) continue;
-      
+      if( !iLine.good( ) )
+      {
+        continue;
+      }
+
       // Ignore the "POC"
-      if( iLine.get( ) != 'P' ) continue;
-      if( !iLine.good( ) ) continue;
-      if( iLine.get( ) != 'O' ) continue;
-      if( !iLine.good( ) ) continue;
-      if( iLine.get( ) != 'C' ) continue;
-      if( !iLine.good( ) ) throw POCParseException( line );
-      
+      if( iLine.get( ) != 'P' )
+      {
+        continue;
+      }
+      if( !iLine.good( ) )
+      {
+        continue;
+      }
+      if( iLine.get( ) != 'O' )
+      {
+        continue;
+      }
+      if( !iLine.good( ) )
+      {
+        continue;
+      }
+      if( iLine.get( ) != 'C' )
+      {
+        continue;
+      }
+      if( !iLine.good( ) )
+      {
+        throw POCParseException( line );
+      }
+
       ignoreUpTo( line, iLine, '(' );
-      
-      if( iLine.get( ) != ' ' ) throw POCParseException( line );
-      if( !iLine.good( ) ) throw POCParseException( line );
-      
-      if( 'I' == iLine.get( ) ) continue;
-      if( !iLine.good( ) ) throw POCParseException( line );
-      
+
+      if( iLine.get( ) != ' ' )
+      {
+        throw POCParseException( line );
+      }
+      if( !iLine.good( ) )
+      {
+        throw POCParseException( line );
+      }
+
+      if( 'I' == iLine.get( ) )
+      {
+        continue;
+      }
+      if( !iLine.good( ) )
+      {
+        throw POCParseException( line );
+      }
+
       ignoreUpTo( line, iLine, ' ' );
       ignoreUpTo( line, iLine, ' ' );
-      
+
       // Parse the qpIndex
       long qpIndexLong;
       iLine >> qpIndexLong;
-      if( ( long )std::numeric_limits< unsigned char >::max( ) < qpIndexLong ) throw POCParseException( line );
+      if( ( long )std::numeric_limits< unsigned char >::max( ) < qpIndexLong )
+      {
+        throw POCParseException( line );
+      }
       unsigned char qpIndex( ( unsigned char )qpIndexLong );
-      if( !iLine.good( ) ) throw POCParseException( line );
-      
+      if( !iLine.good( ) )
+      {
+        throw POCParseException( line );
+      }
+
       ignoreUpTo( line, iLine, ')' );
       ignoreUpTo( line, iLine, ' ' );
-      
+
       // Parse the number of bits
       unsigned long bitsULong;
       iLine >> bitsULong;
-      if( !iLine.good( ) ) throw POCParseException( line );
-      
+      if( !iLine.good( ) )
+      {
+        throw POCParseException( line );
+      }
+
       // Find the tally that corresponds to our QP.  If there is no such tally yet, then add a new one to the map.
       std::map< unsigned char, Tally >::iterator iter( tallyMap.find( qpIndex ) );
@@ -130,8 +175,8 @@
       }
       assert( iter != tallyMap.end( ) );
-      
+
       iter->second.add( ( double )bitsULong );
     }
-    
+
     // Populate and return the result based on all of the tallies
     std::map< unsigned char, double > result;
@@ -147,18 +192,21 @@
 {
   std::vector< double > result;
-  
+
   std::map< unsigned char, double > bitratesForQPsMap( extractBitratesForQPs( i ) );
   if( !bitratesForQPsMap.empty( ) )
   {
     unsigned char expectedNextQPIndex( bitratesForQPsMap.begin( )->first );
-    
+
     for( std::map< unsigned char, double >::const_iterator i( bitratesForQPsMap.begin( ) ); i != bitratesForQPsMap.end( ); ++i )
     {
-      if( i->first != expectedNextQPIndex ) throw NonContiguousQPSetException( );
+      if( i->first != expectedNextQPIndex )
+      {
+        throw NonContiguousQPSetException( );
+      }
       ++expectedNextQPIndex;
       result.push_back( i->second );
     }
   }
-  
+
   return result;
 }
Index: trunk/source/App/utils/BitrateTargeting/ExtractBitrates.h
===================================================================
--- trunk/source/App/utils/BitrateTargeting/ExtractBitrates.h	(revision 872)
+++ trunk/source/App/utils/BitrateTargeting/ExtractBitrates.h	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
+ * granted under this license.
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -32,6 +32,6 @@
  */
 
-#ifndef EXTRACT_BITRATES_H
-#define EXTRACT_BITRATES_H
+#ifndef __EXTRACTBITRATES__
+#define __EXTRACTBITRATES__
 
 #include "RuntimeError.h"
@@ -44,8 +44,8 @@
     POCParseException( const std::string& pocLine ): m_pocLine( pocLine ) { }
     virtual ~POCParseException( ) throw ( ) { }
-  
+
   protected:
     void outputWhat( std::ostream& o ) const { o << "POC parse exception: " << m_pocLine; }
-  
+
   private:
     std::string m_pocLine;
@@ -57,5 +57,5 @@
   public:
     virtual ~NonContiguousQPSetException( ) throw( ) { }
-  
+
   protected:
     void outputWhat( std::ostream& o ) const { o << "Non-contiguous QP set exception"; }
Index: trunk/source/App/utils/BitrateTargeting/ExtractBitratesMain.cpp
===================================================================
--- trunk/source/App/utils/BitrateTargeting/ExtractBitratesMain.cpp	(revision 872)
+++ trunk/source/App/utils/BitrateTargeting/ExtractBitratesMain.cpp	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
+ * granted under this license.
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -44,5 +44,5 @@
   assert( 2 == toFind.size( ) );
   assert( 'e' == toFind[ 0 ] );
-  
+
   std::string::size_type pos( out.find( toFind ) );
   assert( pos != std::string::npos );
@@ -57,8 +57,8 @@
   oss << std::scientific << right;
   std::string s( oss.str( ) );
-  
+
   replaceWithE( s, "e+" );
   replaceWithE( s, "e0" );
-  
+
   left << s;
 }
@@ -69,5 +69,5 @@
   {
     std::vector< double > result( extractBitratesForTemporalLayers( std::cin ) );  // Extract the bitrate vector
-    
+
     // Output the bitrate vector
     if( 0 < result.size( ) )
@@ -89,5 +89,5 @@
       }
     }
-    
+
     return 0;
   }
Index: trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiers.cpp
===================================================================
--- trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiers.cpp	(revision 872)
+++ trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiers.cpp	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
+ * granted under this license.
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -46,12 +46,15 @@
   {
     assert( right.empty( ) );
-    
+
     for( ; ; )
     {
       assert( left.good( ) );
-      
+
       double bitrate;
       left >> bitrate;
-      if( left.fail( ) ) break;
+      if( left.fail( ) )
+      {
+        break;
+      }
       if( bitrate <= ( double )0.0 )
       {
@@ -62,6 +65,9 @@
         right.push_back( bitrate );
       }
-      if( !left.good( ) ) break;
-      
+      if( !left.good( ) )
+      {
+        break;
+      }
+
       if( left.peek( ) == ' ' )
       {
@@ -74,5 +80,5 @@
     }
   }
-  
+
   /// Makes a next guess for a single Lambda-modifier based on only one previous guess
   /// \param initialAdjustmentParameter The proportionality to use between the target bitrate and the previous guess
@@ -88,5 +94,5 @@
     assert( ( double )0.0 < previousPoint.lambdaModifier );
     assert( ( double )0.0 < previousPoint.bitrate );
-    
+
     double extrapolated( previousPoint.lambdaModifier * targetBitrate / previousPoint.bitrate );
     return previousPoint.lambdaModifier + initialAdjustmentParameter * ( extrapolated - previousPoint.lambdaModifier );
@@ -102,5 +108,5 @@
   assert( point1.lambdaModifier != point2.lambdaModifier );
   assert( point1.bitrate != point2.bitrate );
-  
+
   // Calculate and return the result
   double denominator( point1.bitrate - point2.bitrate );
@@ -119,7 +125,7 @@
   assert( interDampeningFactor <= ( double )1.0 );
   assert( !pointList.empty( ) );
-  
+
   double preliminaryResult;
-  
+
   if( 1 == pointList.size( ) )  // If there is only one prevous point, then we cannot interpolate, so we call incrementLambdaModifier
   {
@@ -132,5 +138,5 @@
     ++i;
     Point point2 = *i;
-    
+
     // If the slope is either horizontal or vertical, we cannot interpolate
     if( point1.lambdaModifier == point2.lambdaModifier || point1.bitrate == point2.bitrate )
@@ -143,7 +149,7 @@
     }
   }
-  
+
   double previousResult( pointList.back( ).lambdaModifier );
-  
+
   // Apply "intra dampening"
   {
@@ -159,5 +165,5 @@
     }
   }
-  
+
   // Apply "inter dampening factor".  If necessary, reduce the factor until a positive result is acheived.
   double result;
@@ -180,5 +186,5 @@
     return result;
   }
-  
+
   /// Calculates the inter dampening factor based
   /// \param parameter The inter dampening parameter which determines how severely the inter dampening factor is affected by Lambda-modifier changes at previous temporal layers
@@ -202,5 +208,5 @@
   assert( !targetBitrateVector.empty( ) );
   assert( !metaLogEntryList.empty( ) );
-  
+
   double cumulativeDelta( 0.0 );
   std::vector< double > resultVector;
@@ -212,6 +218,9 @@
     pointList.push_front( pointFromFullMetaLogEntry( i, *j ) );
     ++j;
-    if( j != metaLogEntryList.rend( ) ) pointList.push_front( pointFromFullMetaLogEntry( i, *j ) );
-    
+    if( j != metaLogEntryList.rend( ) )
+    {
+      pointList.push_front( pointFromFullMetaLogEntry( i, *j ) );
+    }
+
     // Calculate the new Lambda-modifier guess and add it to the result vector
     const double newLambdaModifier( guessLambdaModifier(
@@ -221,10 +230,10 @@
         interDampeningFactor( 50.0, cumulativeDelta ) ) );
     resultVector.push_back( newLambdaModifier );
-    
+
     // Increment the cumulativeDelta
     const double oldLambdaModifier( pointList.back( ).lambdaModifier );
     cumulativeDelta += std::abs( newLambdaModifier - oldLambdaModifier ) / oldLambdaModifier;
   }
-  
+
   return resultVector;
 }
@@ -240,7 +249,10 @@
     while( i.good( ) && character != i.get( ) )
       ;
-    if( !i.good( ) ) throw MetaLogParseException( );
-  }
-  
+    if( !i.good( ) )
+    {
+      throw MetaLogParseException( );
+    }
+  }
+
   /// Parses a Lambda-modifier map
   /// \param right The map to write the output to
@@ -250,25 +262,61 @@
     {
       assert( left.good( ) );
-      
+
       // Ignore the "-LM"
-      if( '-' != left.get( ) ) left.setstate( std::istream::failbit );
-      if( !left.good( ) ) break;
-      if( 'L' != left.get( ) ) left.setstate( std::istream::failbit );
-      if( !left.good( ) ) break;
-      if( 'M' != left.get( ) ) left.setstate( std::istream::failbit );
-      if( !left.good( ) ) break;
-      
+      if( '-' != left.get( ) )
+      {
+        left.setstate( std::istream::failbit );
+      }
+      if( !left.good( ) )
+      {
+        break;
+      }
+      if( 'L' != left.get( ) )
+      {
+        left.setstate( std::istream::failbit );
+      }
+      if( !left.good( ) )
+      {
+        break;
+      }
+      if( 'M' != left.get( ) )
+      {
+        left.setstate( std::istream::failbit );
+      }
+      if( !left.good( ) )
+      {
+        break;
+      }
+
       // Parse the index
       long indexLong;
       left >> indexLong;
-      if( !left.good( ) ) break;
-      if( indexLong < std::numeric_limits< unsigned char >::min( ) ) left.setstate( std::istream::failbit );
-      if( std::numeric_limits< unsigned char >::max( ) < indexLong ) left.setstate( std::istream::failbit );
-      if( !left.good( ) ) break;
+      if( !left.good( ) )
+      {
+        break;
+      }
+      if( indexLong < std::numeric_limits< unsigned char >::min( ) )
+      {
+        left.setstate( std::istream::failbit );
+      }
+      if( std::numeric_limits< unsigned char >::max( ) < indexLong )
+      {
+        left.setstate( std::istream::failbit );
+      }
+      if( !left.good( ) )
+      {
+        break;
+      }
       unsigned char index( ( unsigned char )indexLong );
-      
-      if( ' ' != left.get( ) ) left.setstate( std::istream::failbit );
-      if( !left.good( ) ) break;
-      
+
+      if( ' ' != left.get( ) )
+      {
+        left.setstate( std::istream::failbit );
+      }
+      if( !left.good( ) )
+      {
+        break;
+      }
+
       // Parse the Lambda-modifier
       double lambdaModifier;
@@ -282,6 +330,9 @@
         right[ index ] = lambdaModifier;
       }
-      if( !left.good( ) ) break;
-      
+      if( !left.good( ) )
+      {
+        break;
+      }
+
       // If we peek and see a space, then there should be more Lambda-modifiers to parse.  Otherwise, we are finished.
       if( left.peek( ) == ' ' )
@@ -295,5 +346,5 @@
     }
   }
-  
+
   /// Extracts the indexes from the given maps
   /// \return The set of indexes
@@ -322,10 +373,13 @@
     throw InitialAdjustmentParameterParseException( );
   }
-  
+
   // Parse the targets
   std::vector< double > targetVector;
   parseBitrateVector( targetsIstream, targetVector );
-  if( targetVector.empty( ) || targetsIstream.fail( ) || targetsIstream.good( ) ) throw TargetsParseException( );
-  
+  if( targetVector.empty( ) || targetsIstream.fail( ) || targetsIstream.good( ) )
+  {
+    throw TargetsParseException( );
+  }
+
   // Parse the metalog
   std::list< MetaLogEntry< std::map< unsigned char, double > > > metaLogEntryList;
@@ -335,32 +389,62 @@
     MetaLogEntry< std::map< unsigned char, double > > entry;
     parseLambdaModifierMap( metaLogIstream, entry.lambdaModifiers );
-    if( !metaLogIstream.good( ) ) throw MetaLogParseException( );
-    
+    if( !metaLogIstream.good( ) )
+    {
+      throw MetaLogParseException( );
+    }
+
     // Skip the ';'
-    if( ';' != metaLogIstream.get( ) ) throw MetaLogParseException( );
-    if( !metaLogIstream.good( ) ) throw MetaLogParseException( );
-    
+    if( ';' != metaLogIstream.get( ) )
+    {
+      throw MetaLogParseException( );
+    }
+    if( !metaLogIstream.good( ) )
+    {
+      throw MetaLogParseException( );
+    }
+
     // Parse the bitrates
     parseBitrateVector( metaLogIstream, entry.bitrateVector );
-    if( metaLogIstream.fail( ) ) throw MetaLogParseException( );
+    if( metaLogIstream.fail( ) )
+    {
+      throw MetaLogParseException( );
+    }
     metaLogEntryList.push_back( entry );
-    
-    if( !metaLogIstream.good( ) ) break;
-    if( metaLogIstream.get( ) != '\n' ) throw MetaLogParseException( );
+
+    if( !metaLogIstream.good( ) )
+    {
+      break;
+    }
+    if( metaLogIstream.get( ) != '\n' )
+    {
+      throw MetaLogParseException( );
+    }
     metaLogIstream.peek( );
   } while( metaLogIstream.good( ) );
-  if( metaLogEntryList.empty( ) ) throw MetaLogParseException( );  // The meta-log should not be empty
-  
+  if( metaLogEntryList.empty( ) )
+  {
+    throw MetaLogParseException( );  // The meta-log should not be empty
+  }
+
   // Initialize firstIndexVector and check that the sizes and indexes match
   std::set< unsigned char > firstIndexSet( indexSetFromMap( metaLogEntryList.front( ).lambdaModifiers ) );
-  if( firstIndexSet.size( ) != targetVector.size( ) ) throw MismatchedIndexesException( );
+  if( firstIndexSet.size( ) != targetVector.size( ) )
+  {
+    throw MismatchedIndexesException( );
+  }
   for( std::list< MetaLogEntry< std::map< unsigned char, double > > >::const_iterator i( metaLogEntryList.begin( ) );
       i != metaLogEntryList.end( );
       ++i )
   {
-    if( indexSetFromMap( i->lambdaModifiers ) != firstIndexSet ) throw MismatchedIndexesException( );
-    if( i->bitrateVector.size( ) != targetVector.size( ) ) throw MismatchedIndexesException( );
-  }
-  
+    if( indexSetFromMap( i->lambdaModifiers ) != firstIndexSet )
+    {
+      throw MismatchedIndexesException( );
+    }
+    if( i->bitrateVector.size( ) != targetVector.size( ) )
+    {
+      throw MismatchedIndexesException( );
+    }
+  }
+
   // Initialize simplifiedMetaLogEntryList
   std::list< MetaLogEntry< std::vector< double > > > simplifiedMetaLogEntryList;
@@ -376,8 +460,8 @@
     simplifiedMetaLogEntryList.back( ).bitrateVector = i->bitrateVector;
   }
-  
+
   // Run the calculations
   std::vector< double > resultVector( guessLambdaModifiers( initialAdjustmentParameter, targetVector, simplifiedMetaLogEntryList ) );
-  
+
   // Output the results
   std::set< unsigned char >::const_iterator indexIter( firstIndexSet.begin( ) );
@@ -385,10 +469,13 @@
   do
   {
-    if( indexIter != firstIndexSet.begin( ) ) o << " ";
+    if( indexIter != firstIndexSet.begin( ) )
+    {
+      o << " ";
+    }
     o << "-LM" << ( long )( *indexIter ) << " ";
     o.setf( std::ostream::fixed, std::ostream::floatfield );
     o.precision( 7 );
     o << ( *resultIter );
-    
+
     ++indexIter;
     ++resultIter;
Index: trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiers.h
===================================================================
--- trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiers.h	(revision 872)
+++ trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiers.h	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
+ * granted under this license.
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -32,6 +32,6 @@
  */
 
-#ifndef CALCULATE_LAMBDA_MODIFIER_H
-#define CALCULATE_LAMBDA_MODIFIER_H
+#ifndef __GUESSLAMBDAMODIFIERS__
+#define __GUESSLAMBDAMODIFIERS__
 
 #include "RuntimeError.h"
@@ -94,5 +94,5 @@
 
 /// Performs interpolation/extrapolation to guess a single Lambda-modifier
-/// \param target The target bitrate value that this Lambda-modifier is trying to reach
+/// \param targetBitrate The target bitrate value that this Lambda-modifier is trying to reach
 /// \param point1 One of the two previously tried points where first is the Lambda-modifier and second is the obtained bitrate
 /// \param point2 One of the two previously tried points where first is the Lambda-modifier and second is the obtained bitrate
@@ -134,5 +134,5 @@
 /// \param o The output stream to write the guessed Lambda-modifiers to
 /// \param initialAdjustmentParameterIstream The input stream that contains the initial adjustment parameter
-/// \param targetIstream The input stream that contains the target bitrates
+/// \param targetsIstream The input stream that contains the target bitrates
 /// \param metaLogIstream The input stream that contains the meta-log
 /// \throw InitialAdjustmentParameterParseException if there is an error parsing the initial adjustment parameter
Index: trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiersMain.cpp
===================================================================
--- trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiersMain.cpp	(revision 872)
+++ trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiersMain.cpp	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
+ * granted under this license.
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -49,15 +49,18 @@
   try
   {
-    if( argc != 3 ) throw WrongNumberOfArgumentsException( );
-    
+    if( argc != 3 )
+    {
+      throw WrongNumberOfArgumentsException( );
+    }
+
     std::string initialAdjustmentParameterString( ppArgv[ 1 ] );
     std::istringstream initialAdjustmentParameterIstream( initialAdjustmentParameterString );
-    
+
     std::string targetBitratesString( ppArgv[ 2 ] );
     std::istringstream targetBitratesIstream( targetBitratesString );
-    
+
     guessLambdaModifiers( std::cout, initialAdjustmentParameterIstream, targetBitratesIstream, std::cin );
     return 0;
-  
+
   }
   catch( std::exception& e )
Index: trunk/source/App/utils/BitrateTargeting/RuntimeError.h
===================================================================
--- trunk/source/App/utils/BitrateTargeting/RuntimeError.h	(revision 872)
+++ trunk/source/App/utils/BitrateTargeting/RuntimeError.h	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
+ * granted under this license.
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -32,6 +32,6 @@
  */
 
-#ifndef DIRECTORY_LIB_RUNTIME_ERROR_H
-#define DIRECTORY_LIB_RUNTIME_ERROR_H
+#ifndef __RUNTIMEERROR__
+#define __RUNTIMEERROR__
 
 #include <sstream>
@@ -44,5 +44,5 @@
     RuntimeError( ): std::runtime_error( "" ), m_firstWhat( true ) { }
     virtual ~RuntimeError( ) throw ( ) { }
-    
+
     /// Implementation of the std::exception::what method
     const char * what( ) const throw( )
@@ -57,10 +57,10 @@
       return m_what.c_str( );
     }
-    
+
   protected:
     /// The implementing class implements this method to customize the what output
     /// \param o The what stream is outputted to this parameter
     virtual void outputWhat( std::ostream & o ) const =0;
-  
+
   private:
     mutable bool m_firstWhat;  ///< True i.f.f. the what method has not yet been called
Index: trunk/source/App/utils/annexBbytecount.cpp
===================================================================
--- trunk/source/App/utils/annexBbytecount.cpp	(revision 872)
+++ trunk/source/App/utils/annexBbytecount.cpp	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
- *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * granted under this license.
+ *
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -43,5 +43,5 @@
 using namespace std;
 
-static struct {
+static const struct {
   AnnexBStats expected;
   unsigned data_len;
@@ -86,5 +86,7 @@
       cout << hex << (unsigned int)tests[i].data[j] << dec;
       if (j < tests[i].data_len-1)
+      {
         cout << ",";
+      }
     }
     cout << "} ";
@@ -103,5 +105,7 @@
 #undef VERIFY
     if (ok)
+    {
       cout << "OK";
+    }
     cout << endl;
   }
@@ -113,5 +117,7 @@
 
   if (argc != 2)
+  {
     return 0;
+  }
 
   ifstream in(argv[1], ifstream::in | ifstream::binary);
@@ -150,5 +156,7 @@
 
     if (!annexBStatsSingle.m_numBytesInNALUnit)
+    {
       continue;
+    }
 
     /* identify the NAL unit type and add stats to the correct
Index: trunk/source/App/utils/convert_NtoMbit_YCbCr.cpp
===================================================================
--- trunk/source/App/utils/convert_NtoMbit_YCbCr.cpp	(revision 872)
+++ trunk/source/App/utils/convert_NtoMbit_YCbCr.cpp	(revision 1313)
@@ -2,7 +2,7 @@
  * License, included below. This software may be subject to other third party
  * and contributor rights, including patent rights, and no such rights are
- * granted under this license.  
+ * granted under this license.
  *
- * Copyright (c) 2010-2014, ITU/ISO/IEC
+ * Copyright (c) 2010-2015, ITU/ISO/IEC
  * All rights reserved.
  *
@@ -41,12 +41,12 @@
 namespace po = df::program_options_lite;
 
-int main(int argc, const char** argv)
+Int main(Int argc, const char** argv)
 {
-  bool do_help;
+  Bool do_help;
   string filename_in, filename_out;
-  unsigned int width, height;
-  unsigned int bitdepth_in, bitdepth_out;
-  unsigned int num_frames;
-  unsigned int num_frames_skip;
+  UInt width, height;
+  UInt bitdepth_in, bitdepth_out, chromaFormatRaw;
+  UInt num_frames;
+  UInt num_frames_skip;
 
   po::Options opts;
@@ -59,4 +59,5 @@
   ("InputBitDepth", bitdepth_in, 8u, "bit-depth of input file")
   ("OutputBitDepth", bitdepth_out, 8u, "bit-depth of output file")
+  ("ChromaFormat", chromaFormatRaw, 420u, "chroma format. 400, 420, 422 or 444 only")
   ("NumFrames", num_frames, 0xffffffffu, "number of frames to process")
   ("FrameSkip,-fs", num_frames_skip, 0u, "Number of frames to skip at start of input YUV")
@@ -65,4 +66,5 @@
   po::setDefaults(opts);
   po::scanArgv(opts, argc, argv);
+
 
   if (argc == 1 || do_help)
@@ -73,44 +75,73 @@
   }
 
+  ChromaFormat chromaFormatIDC=CHROMA_420;
+  switch (chromaFormatRaw)
+  {
+    case 400: chromaFormatIDC=CHROMA_400; break;
+    case 420: chromaFormatIDC=CHROMA_420; break;
+    case 422: chromaFormatIDC=CHROMA_422; break;
+    case 444: chromaFormatIDC=CHROMA_444; break;
+    default:
+      fprintf(stderr, "Bad chroma format string\n");
+      return EXIT_FAILURE;
+  }
+
   TVideoIOYuv input;
   TVideoIOYuv output;
 
-  input.open((char*)filename_in.c_str(), false, bitdepth_in, bitdepth_in, bitdepth_out, bitdepth_out);
-  output.open((char*)filename_out.c_str(), true, bitdepth_out, bitdepth_out, bitdepth_out, bitdepth_out);
+  Int inputBitDepths [MAX_NUM_CHANNEL_TYPE];
+  Int outputBitDepths[MAX_NUM_CHANNEL_TYPE];
 
-  input.skipFrames(num_frames_skip, width, height);
+  for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)
+  {
+    inputBitDepths [channelTypeIndex] = bitdepth_in;
+    outputBitDepths[channelTypeIndex] = bitdepth_out;
+  }
+
+  input.open((char*)filename_in.c_str(), false, inputBitDepths, inputBitDepths, outputBitDepths);
+  output.open((char*)filename_out.c_str(), true, outputBitDepths, outputBitDepths, outputBitDepths);
+
+  input.skipFrames(num_frames_skip, width, height, chromaFormatIDC);
 
   TComPicYuv frame;
-  frame.create( width, height, 1, 1, 0 );
+  frame.create( width, height, chromaFormatIDC, width, height, 0, false);
 
-  int pad[2] = {0, 0};
+  Int pad[2] = {0, 0};
 
-  unsigned int num_frames_processed = 0;
-  while (!input.isEof()) 
+  TComPicYuv cPicYuvTrueOrg;
+  cPicYuvTrueOrg.create( width, height, chromaFormatIDC, width, height, 0, false );
+
+  UInt num_frames_processed = 0;
+  while (!input.isEof())
   {
-    if (! input.read(&frame, pad))
+    if (! input.read(&frame, &cPicYuvTrueOrg, IPCOLOURSPACE_UNCHANGED, pad))
     {
       break;
     }
 #if 0
-    Pel* img = frame.getLumaAddr();
-    for (int y = 0; y < height; y++) 
+    Pel* img = frame.getAddr(COMPONENT_Y);
+    for (Int y = 0; y < height; y++)
     {
-      for (int x = 0; x < height; x++)
+      for (Int x = 0; x < height; x++)
+      {
         img[x] = 0;
+      }
       img += frame.getStride();
     }
-    img = frame.getLumaAddr();
+    img = frame.getAddr(COMPONENT_Y);
     img[0] = 1;
 #endif
 
-    output.write(&frame);
+    output.write(&frame, IPCOLOURSPACE_UNCHANGED);
     num_frames_processed++;
     if (num_frames_processed == num_frames)
+    {
       break;
+    }
   }
 
   input.close();
   output.close();
+  cPicYuvTrueOrg.destroy();
 
   return EXIT_SUCCESS;
