r4070 - in trunk: . tests



Author: stw
Date: 2006-11-08 16:23:13 -0500 (Wed, 08 Nov 2006)
New Revision: 4070

Modified:
   trunk/ChangeLog
   trunk/tests/testresampler.cc
Log:
Wed Nov  8 22:09:36 2006  Stefan Westerfeld  <stefan space twc de>

	* tests/testresampler.cc: Ensure that accuracy tests use the same
	amount of samples regardless of the block size. Make testresampler
	work with very small blocksizes (such as 2). Use impl_name() feature
	of bses blockutils. Small speedup by using shorter test signals.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-11-08 21:08:28 UTC (rev 4069)
+++ trunk/ChangeLog	2006-11-08 21:23:13 UTC (rev 4070)
@@ -1,3 +1,10 @@
+Wed Nov  8 22:09:36 2006  Stefan Westerfeld  <stefan space twc de>
+
+	* tests/testresampler.cc: Ensure that accuracy tests use the same
+	amount of samples regardless of the block size. Make testresampler
+	work with very small blocksizes (such as 2). Use impl_name() feature
+	of bses blockutils. Small speedup by using shorter test signals.
+
 Wed Nov  8 22:00:55 2006  Stefan Westerfeld  <stefan space twc de>
 
 	* tests/testresampler.cc: Introduce phase wrapping for sine

Modified: trunk/tests/testresampler.cc
===================================================================
--- trunk/tests/testresampler.cc	2006-11-08 21:08:28 UTC (rev 4069)
+++ trunk/tests/testresampler.cc	2006-11-08 21:23:13 UTC (rev 4070)
@@ -343,7 +343,7 @@
   Resampler2 *ups = Resampler2::create (BSE_RESAMPLER2_MODE_UPSAMPLE, options.precision);
   Resampler2 *downs = Resampler2::create (BSE_RESAMPLER2_MODE_DOWNSAMPLE, options.precision);
 
-  F4Vector in_v[block_size / 2 + 1], out_v[block_size / 2 + 1], out2_v[block_size / 2 + 1];
+  F4Vector in_v[block_size / 2 + 3], out_v[block_size / 2 + 3], out2_v[block_size / 2 + 3];
   float *input = &in_v[0].f[0], *output = &out_v[0].f[0], *output2 = &out2_v[0].f[0]; /* ensure aligned data */
 
   if (TEST == TEST_PERFORMANCE)
@@ -417,11 +417,16 @@
 	  double phase = 0, output_phase = 0;
 	  double test_frequency_max_diff = 0; /* for monitoring frequency scanning */
 
-	  for (int b = 0; b < 1000; b++)
+	  while (k < 10000)
 	    {
-	      int misalign = rand() % 4;
-	      int bs = rand() % (block_size - misalign);
+	      guint misalign = rand() % 4;
+              if (block_size <= misalign)
+                continue;
 
+	      int bs = rand() % (block_size + 1 - misalign);
+              if (bs < 2)
+                continue;
+
 	      if (RESAMPLE == RES_DOWNSAMPLE || RESAMPLE == RES_SUBSAMPLE)
 		bs -= bs & 1;
 
@@ -612,7 +617,7 @@
 template <int TEST> int
 perform_test ()
 {
-  const char *instruction_set = (Bse::Block::default_singleton() == Bse::Block::current_singleton()) ? "FPU" : "SSE";
+  const char *instruction_set = Bse::Block::impl_name();
 
   switch (resample_type)
     {




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]