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;
 }
