]> granicus.if.org Git - libvpx/commitdiff
Fix TEST_P(SADx4Test, DISABLED_Speed)
authorScott LaVarnway <slavarnway@google.com>
Thu, 18 Aug 2022 19:19:08 +0000 (12:19 -0700)
committerScott LaVarnway <slavarnway@google.com>
Thu, 18 Aug 2022 19:19:08 +0000 (12:19 -0700)
The reference code was being timed instead of the optimized code.

Change-Id: I67eb08dcda80e20eaa075dc2c91b7e8ef5c0cdfb

test/sad_test.cc

index 2506f1adbcd0040c435ad95b55deb36017c9643f..960bd499ba1ffd39b286d91b94783f0935d5031d 100644 (file)
@@ -517,14 +517,12 @@ TEST_P(SADx4Test, DISABLED_Speed) {
   uint32_t reference_sad[4];
   DECLARE_ALIGNED(kDataAlignment, uint32_t, exp_sad[4]);
   vpx_usec_timer timer;
-
-  memset(reference_sad, 0, sizeof(reference_sad));
-  SADs(exp_sad);
+  for (int block = 0; block < 4; ++block) {
+    reference_sad[block] = ReferenceSAD(GetBlockRefOffset(block));
+  }
   vpx_usec_timer_start(&timer);
   for (int i = 0; i < kCountSpeedTestBlock; ++i) {
-    for (int block = 0; block < 4; ++block) {
-      reference_sad[block] = ReferenceSAD(GetBlockRefOffset(block));
-    }
+    SADs(exp_sad);
   }
   vpx_usec_timer_mark(&timer);
   for (int block = 0; block < 4; ++block) {