[Liblas-commits] laszip: forgot to uncomment a line. got rid of tabs.

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Jan 31 14:28:49 EST 2011


details:   http://hg.liblas.orglaszip/rev/8f4361c46238
changeset: 171:8f4361c46238
user:      isenburg
date:      Mon Jan 31 11:28:38 2011 -0800
description:
forgot to uncomment a line. got rid of tabs.

diffstat:

 src/lasreaditemcompressed_v1.cpp  |  132 +++++++++++++++++++-------------------
 src/laswriteitemcompressed_v1.cpp |   65 +++++++++---------
 2 files changed, 98 insertions(+), 99 deletions(-)

diffs (truncated from 320 to 300 lines):

diff -r 272e64fc7bea -r 8f4361c46238 src/lasreaditemcompressed_v1.cpp
--- a/src/lasreaditemcompressed_v1.cpp	Mon Jan 31 11:15:44 2011 -0800
+++ b/src/lasreaditemcompressed_v1.cpp	Mon Jan 31 11:28:38 2011 -0800
@@ -67,12 +67,12 @@
 
   /* create models and integer compressors */
   ic_dx = new IntegerCompressor(dec, 32);  // 32 bits, 1 context
-	ic_dy = new IntegerCompressor(dec, 32, 20); // 32 bits, 20 contexts
-	ic_z = new IntegerCompressor(dec, 32, 20);  // 32 bits, 20 contexts
-	ic_intensity = new IntegerCompressor(dec, 16);
-	ic_scan_angle_rank = new IntegerCompressor(dec, 8, 2);
-	ic_point_source_ID = new IntegerCompressor(dec, 16);
-	m_changed_values = dec->createSymbolModel(64);
+  ic_dy = new IntegerCompressor(dec, 32, 20); // 32 bits, 20 contexts
+  ic_z = new IntegerCompressor(dec, 32, 20);  // 32 bits, 20 contexts
+  ic_intensity = new IntegerCompressor(dec, 16);
+  ic_scan_angle_rank = new IntegerCompressor(dec, 8, 2);
+  ic_point_source_ID = new IntegerCompressor(dec, 16);
+  m_changed_values = dec->createSymbolModel(64);
   for (i = 0; i < 256; i++)
   {
     m_bit_byte[i] = 0;
@@ -105,8 +105,8 @@
   U32 i;
 
   /* init state */
-	last_x_diff[0] = last_x_diff[1] = last_x_diff[2] = 0;
-	last_y_diff[0] = last_y_diff[1] = last_y_diff[2] = 0;
+  last_x_diff[0] = last_x_diff[1] = last_x_diff[2] = 0;
+  last_y_diff[0] = last_y_diff[1] = last_y_diff[2] = 0;
   last_incr = 0;
 
   /* init models and integer compressors */
@@ -186,61 +186,61 @@
   k_bits = (k_bits + ic_dy->getK())/2;
   ((LASpoint10*)item)->z = ic_z->decompress(((LASpoint10*)last_item)->z, (k_bits < 19 ? k_bits : 19));
 
-	// decompress which other values have changed
-	I32 changed_values = dec->decodeSymbol(m_changed_values);
+  // decompress which other values have changed
+  I32 changed_values = dec->decodeSymbol(m_changed_values);
 
   if (changed_values)
   {
-		// decompress the intensity if it has changed
-		if (changed_values & 32)
-		{
-			((LASpoint10*)item)->intensity = (U16)ic_intensity->decompress(((LASpoint10*)last_item)->intensity);
-		}
+    // decompress the intensity if it has changed
+    if (changed_values & 32)
+    {
+      ((LASpoint10*)item)->intensity = (U16)ic_intensity->decompress(((LASpoint10*)last_item)->intensity);
+    }
 
-		// decompress the edge_of_flight_line, scan_direction_flag, ... if it has changed
-		if (changed_values & 16)
-		{
+    // decompress the edge_of_flight_line, scan_direction_flag, ... if it has changed
+    if (changed_values & 16)
+    {
       if (m_bit_byte[last_item[14]] == 0)
       {
         m_bit_byte[last_item[14]] = dec->createSymbolModel(256);
         dec->initSymbolModel(m_bit_byte[last_item[14]]);
       }
-			item[14] = (U8)dec->decodeSymbol(m_bit_byte[last_item[14]]);
-		}
+      item[14] = (U8)dec->decodeSymbol(m_bit_byte[last_item[14]]);
+    }
 
-		// decompress the classification ... if it has changed
-		if (changed_values & 8)
-		{
+    // decompress the classification ... if it has changed
+    if (changed_values & 8)
+    {
       if (m_classification[last_item[15]] == 0)
       {
         m_classification[last_item[15]] = dec->createSymbolModel(256);
         dec->initSymbolModel(m_classification[last_item[15]]);
       }
-			item[15] = (U8)dec->decodeSymbol(m_classification[last_item[15]]);
-		}
-		
-		// decompress the scan_angle_rank ... if it has changed
-		if (changed_values & 4)
-		{
-			item[16] = (U8)ic_scan_angle_rank->decompress(last_item[16], k_bits < 3);
+      item[15] = (U8)dec->decodeSymbol(m_classification[last_item[15]]);
+    }
+    
+    // decompress the scan_angle_rank ... if it has changed
+    if (changed_values & 4)
+    {
+      item[16] = (U8)ic_scan_angle_rank->decompress(last_item[16], k_bits < 3);
     }
 
-		// decompress the user_data ... if it has changed
-		if (changed_values & 2)
-		{
+    // decompress the user_data ... if it has changed
+    if (changed_values & 2)
+    {
       if (m_user_data[last_item[17]] == 0)
       {
         m_user_data[last_item[17]] = dec->createSymbolModel(256);
         dec->initSymbolModel(m_user_data[last_item[17]]);
       }
-			item[17] = (U8)dec->decodeSymbol(m_user_data[last_item[17]]);
-		}
+      item[17] = (U8)dec->decodeSymbol(m_user_data[last_item[17]]);
+    }
 
-		// decompress the point_source_ID ... if it has changed
-		if (changed_values & 1)
-		{
-			((LASpoint10*)item)->point_source_ID = (U16)ic_point_source_ID->decompress(((LASpoint10*)last_item)->point_source_ID);
-		}
+    // decompress the point_source_ID ... if it has changed
+    if (changed_values & 1)
+    {
+      ((LASpoint10*)item)->point_source_ID = (U16)ic_point_source_ID->decompress(((LASpoint10*)last_item)->point_source_ID);
+    }
   }
 
   // record the difference
@@ -325,38 +325,38 @@
         last_gpstime_diff = gpstime_diff;
         multi_extreme_counter = 0;
       }
-	    else if (multi == 0)
-	    {
+      else if (multi == 0)
+      {
         gpstime_diff = ic_gpstime->decompress(last_gpstime_diff/4, 2);
         multi_extreme_counter++;
-	      if (multi_extreme_counter > 3)
-	      {
-	        last_gpstime_diff = gpstime_diff;
-	        multi_extreme_counter = 0;
-	      }
-	    }
-	    else if (multi < 10)
-	    {
-	      gpstime_diff = ic_gpstime->decompress(multi*last_gpstime_diff, 3);
-	    }
+        if (multi_extreme_counter > 3)
+        {
+          last_gpstime_diff = gpstime_diff;
+          multi_extreme_counter = 0;
+        }
+      }
+      else if (multi < 10)
+      {
+        gpstime_diff = ic_gpstime->decompress(multi*last_gpstime_diff, 3);
+      }
       else if (multi < 50)
       {
-	      gpstime_diff = ic_gpstime->decompress(multi*last_gpstime_diff, 4);
-	    }
+        gpstime_diff = ic_gpstime->decompress(multi*last_gpstime_diff, 4);
+      }
       else
       {
-	      gpstime_diff = ic_gpstime->decompress(multi*last_gpstime_diff, 5);
-	      if (multi == LASZIP_GPSTIME_MULTIMAX-3)
-	      {
-	        multi_extreme_counter++;
-	        if (multi_extreme_counter > 3)
-	        {
-	          last_gpstime_diff = gpstime_diff;
-	          multi_extreme_counter = 0;
-	        }
-	      }
+        gpstime_diff = ic_gpstime->decompress(multi*last_gpstime_diff, 5);
+        if (multi == LASZIP_GPSTIME_MULTIMAX-3)
+        {
+          multi_extreme_counter++;
+          if (multi_extreme_counter > 3)
+          {
+            last_gpstime_diff = gpstime_diff;
+            multi_extreme_counter = 0;
+          }
+        }
       }
-	    last_gpstime.i64 += gpstime_diff;
+      last_gpstime.i64 += gpstime_diff;
     }
     else if (multi <  LASZIP_GPSTIME_MULTIMAX-1)
     {
@@ -577,7 +577,7 @@
   U32 i;
   for (i = 0; i < number; i++)
   {
-  	item[i] = (U8)(ic_byte->decompress(last_item[i], i));
+    item[i] = (U8)(ic_byte->decompress(last_item[i], i));
   }
   memcpy(last_item, item, number);
   return TRUE;
diff -r 272e64fc7bea -r 8f4361c46238 src/laswriteitemcompressed_v1.cpp
--- a/src/laswriteitemcompressed_v1.cpp	Mon Jan 31 11:15:44 2011 -0800
+++ b/src/laswriteitemcompressed_v1.cpp	Mon Jan 31 11:28:38 2011 -0800
@@ -66,12 +66,12 @@
 
   /* create models and integer compressors */
   ic_dx = new IntegerCompressor(enc, 32);  // 32 bits, 1 context
-	ic_dy = new IntegerCompressor(enc, 32, 20); // 32 bits, 20 contexts
-	ic_z = new IntegerCompressor(enc, 32, 20);  // 32 bits, 20 contexts
-	ic_intensity = new IntegerCompressor(enc, 16);
-	ic_scan_angle_rank = new IntegerCompressor(enc, 8, 2);
-	ic_point_source_ID = new IntegerCompressor(enc, 16);
-	m_changed_values = enc->createSymbolModel(64);
+  ic_dy = new IntegerCompressor(enc, 32, 20); // 32 bits, 20 contexts
+  ic_z = new IntegerCompressor(enc, 32, 20);  // 32 bits, 20 contexts
+  ic_intensity = new IntegerCompressor(enc, 16);
+  ic_scan_angle_rank = new IntegerCompressor(enc, 8, 2);
+  ic_point_source_ID = new IntegerCompressor(enc, 16);
+  m_changed_values = enc->createSymbolModel(64);
   for (i = 0; i < 256; i++)
   {
     m_bit_byte[i] = 0;
@@ -104,8 +104,8 @@
   U32 i;
 
   /* init state */
-	last_x_diff[0] = last_x_diff[1] = last_x_diff[2] = 0;
-	last_y_diff[0] = last_y_diff[1] = last_y_diff[2] = 0;
+  last_x_diff[0] = last_x_diff[1] = last_x_diff[2] = 0;
+  last_y_diff[0] = last_y_diff[1] = last_y_diff[2] = 0;
   last_incr = 0;
 
   /* init models and integer compressors */
@@ -224,8 +224,7 @@
   // compress the scan_angle_rank ... if it has changed
   if (changed_values & 4)
   {
-    ic_scan_angle_rank->compress(((I8*)last_item)[16], ((I8*)item)[16], k_bits < 3);
-//    ic_scan_angle_rank->compress(last_item[16], item[16], k_bits < 3);
+    ic_scan_angle_rank->compress(last_item[16], item[16], k_bits < 3);
   }
 
   // compress the user_data ... if it has changed
@@ -357,45 +356,45 @@
         // compress this multiplier
         enc->encodeSymbol(m_gpstime_multi, multi);
         // compress the residual curr_gpstime_diff in dependance on the multiplier
-	      if (multi == 1)
+        if (multi == 1)
         {
           // this is the case we assume we get most often
-	        ic_gpstime->compress(last_gpstime_diff, curr_gpstime_diff, 1);
+          ic_gpstime->compress(last_gpstime_diff, curr_gpstime_diff, 1);
           last_gpstime_diff = curr_gpstime_diff;
-          multi_extreme_counter = 0;	  
-	      }
-	      else
+          multi_extreme_counter = 0;    
+        }
+        else
         {
           if (multi == 0)
           {
             ic_gpstime->compress(last_gpstime_diff/4, curr_gpstime_diff, 2);
-        	  multi_extreme_counter++;
-	          if (multi_extreme_counter > 3)
-	          {
-	            last_gpstime_diff = curr_gpstime_diff;
-	            multi_extreme_counter = 0;
-	          }
+            multi_extreme_counter++;
+            if (multi_extreme_counter > 3)
+            {
+              last_gpstime_diff = curr_gpstime_diff;
+              multi_extreme_counter = 0;
+            }
           }
-	        else if (multi < 10)
+          else if (multi < 10)
           {
             ic_gpstime->compress(multi*last_gpstime_diff, curr_gpstime_diff, 3);
           }
           else if (multi < 50)
           {
             ic_gpstime->compress(multi*last_gpstime_diff, curr_gpstime_diff, 4);
-	        }
+          }
           else
           {
             ic_gpstime->compress(multi*last_gpstime_diff, curr_gpstime_diff, 5);
-	          if (multi == LASZIP_GPSTIME_MULTIMAX-3)
-	          {
-	            multi_extreme_counter++;
-	            if (multi_extreme_counter > 3)
-	            {
-	              last_gpstime_diff = curr_gpstime_diff;
-	              multi_extreme_counter = 0;
-	            }
-	          }
+            if (multi == LASZIP_GPSTIME_MULTIMAX-3)


More information about the Liblas-commits mailing list