]> granicus.if.org Git - libvpx/commitdiff
fix test builds
authorJames Zern <jzern@google.com>
Tue, 6 Nov 2012 02:13:04 +0000 (18:13 -0800)
committerJames Zern <jzern@google.com>
Tue, 6 Nov 2012 20:12:58 +0000 (12:12 -0800)
s/([vV][pP])8/$19/
additionally dct.h was removed; declare the _c functions that are used
in the tests. the TODO for conversion to parameterized tests still
remains.

Change-Id: I73db9425a57075bbb78a92693ba6b320578981cd

test/boolcoder_test.cc
test/dct16x16_test.cc
test/fdct4x4_test.cc
test/fdct8x8_test.cc
test/idct8x8_test.cc
vp9/common/blockd.h

index 119c77a790db6a1ea102c35b6889bf860bd75a7e..68a69d510c78665880f04ba636231cde81b2de4f 100644 (file)
@@ -28,7 +28,7 @@ namespace {
 const int num_tests = 10;
 }  // namespace
 
-TEST(VP8, TestBitIO) {
+TEST(VP9, TestBitIO) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   for (int n = 0; n < num_tests; ++n) {
     for (int method = 0; method <= 7; ++method) {   // we generate various proba
@@ -54,7 +54,7 @@ TEST(VP8, TestBitIO) {
         ACMRandom bit_rnd(random_seed);
         BOOL_CODER bw;
         uint8_t bw_buffer[buffer_size];
-        vp8_start_encode(&bw, bw_buffer);
+        vp9_start_encode(&bw, bw_buffer);
 
         int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
         for (int i = 0; i < bits_to_test; ++i) {
@@ -63,13 +63,13 @@ TEST(VP8, TestBitIO) {
           } else if (bit_method == 3) {
             bit = bit_rnd(2);
           }
-          vp8_encode_bool(&bw, bit, static_cast<int>(probas[i]));
+          encode_bool(&bw, bit, static_cast<int>(probas[i]));
         }
 
-        vp8_stop_encode(&bw);
+        vp9_stop_encode(&bw);
 
         BOOL_DECODER br;
-        vp8dx_start_decode(&br, bw_buffer, buffer_size);
+        vp9_start_decode(&br, bw_buffer, buffer_size);
         bit_rnd.Reset(random_seed);
         for (int i = 0; i < bits_to_test; ++i) {
           if (bit_method == 2) {
@@ -77,7 +77,7 @@ TEST(VP8, TestBitIO) {
           } else if (bit_method == 3) {
             bit = bit_rnd(2);
           }
-          GTEST_ASSERT_EQ(vp8dx_decode_bool(&br, probas[i]), bit)
+          GTEST_ASSERT_EQ(decode_bool(&br, probas[i]), bit)
               << "pos: " << i << " / " << bits_to_test
               << " bit_method: " << bit_method
               << " method: " << method;
index a0b91f3890f3e33c0105b7beff1ef972b72ee48c..d572ee6be0a40611f69d79b8339700b879f89046 100644 (file)
@@ -17,7 +17,7 @@
 extern "C" {
 #include "vp9/common/entropy.h"
 #include "vp9/common/idct.h"
-#include "vp9/encoder/dct.h"
+#include "vpx_rtcd.h"
 }
 
 #include "acm_random.h"
@@ -256,7 +256,7 @@ void reference_16x16_dct_2d(int16_t input[16*16], double output[16*16]) {
 }
 
 
-TEST(VP8Idct16x16Test, AccuracyCheck) {
+TEST(VP9Idct16x16Test, AccuracyCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   const int count_test_block = 1000;
   for (int i = 0; i < count_test_block; ++i) {
@@ -271,7 +271,7 @@ TEST(VP8Idct16x16Test, AccuracyCheck) {
     reference_16x16_dct_2d(in, out_r);
     for (int j = 0; j < 256; j++)
       coeff[j] = round(out_r[j]);
-    vp8_short_idct16x16_c(coeff, out_c, 32);
+    vp9_short_idct16x16_c(coeff, out_c, 32);
     for (int j = 0; j < 256; ++j) {
       const int diff = out_c[j] - in[j];
       const int error = diff * diff;
@@ -280,7 +280,7 @@ TEST(VP8Idct16x16Test, AccuracyCheck) {
           << " at index " << j;
     }
 
-    vp8_short_fdct16x16_c(in, out_c, 32);
+    vp9_short_fdct16x16_c(in, out_c, 32);
     for (int j = 0; j < 256; ++j) {
       const double diff = coeff[j] - out_c[j];
       const double error = diff * diff;
@@ -291,7 +291,7 @@ TEST(VP8Idct16x16Test, AccuracyCheck) {
   }
 }
 
-TEST(VP8Fdct16x16Test, AccuracyCheck) {
+TEST(VP9Fdct16x16Test, AccuracyCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int max_error = 0;
   double total_error = 0;
@@ -306,8 +306,8 @@ TEST(VP8Fdct16x16Test, AccuracyCheck) {
       test_input_block[j] = rnd.Rand8() - rnd.Rand8();
 
     const int pitch = 32;
-    vp8_short_fdct16x16_c(test_input_block, test_temp_block, pitch);
-    vp8_short_idct16x16_c(test_temp_block, test_output_block, pitch);
+    vp9_short_fdct16x16_c(test_input_block, test_temp_block, pitch);
+    vp9_short_idct16x16_c(test_temp_block, test_output_block, pitch);
 
     for (int j = 0; j < 256; ++j) {
       const int diff = test_input_block[j] - test_output_block[j];
@@ -325,7 +325,7 @@ TEST(VP8Fdct16x16Test, AccuracyCheck) {
       << "Error: 16x16 FDCT/IDCT has average roundtrip error > 1/10 per block";
 }
 
-TEST(VP8Fdct16x16Test, CoeffSizeCheck) {
+TEST(VP9Fdct16x16Test, CoeffSizeCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   const int count_test_block = 1000;
   for (int i = 0; i < count_test_block; ++i) {
@@ -342,8 +342,8 @@ TEST(VP8Fdct16x16Test, CoeffSizeCheck) {
         input_extreme_block[j] = 255;
 
     const int pitch = 32;
-    vp8_short_fdct16x16_c(input_block, output_block, pitch);
-    vp8_short_fdct16x16_c(input_extreme_block, output_extreme_block, pitch);
+    vp9_short_fdct16x16_c(input_block, output_block, pitch);
+    vp9_short_fdct16x16_c(input_extreme_block, output_extreme_block, pitch);
 
     // The minimum quant value is 4.
     for (int j = 0; j < 256; ++j) {
index d7066b3ff2c59b2931fcfe139042a8a15e6bb5c0..e2eb28e5a34ae8d9ab3320b9f4b5a3e566773ddd 100644 (file)
@@ -16,7 +16,7 @@
 
 extern "C" {
 #include "vp9/common/idct.h"
-#include "vp9/encoder/dct.h"
+#include "vpx_rtcd.h"
 }
 
 #include "acm_random.h"
@@ -26,7 +26,7 @@ using libvpx_test::ACMRandom;
 
 namespace {
 
-TEST(Vp8FdctTest, SignBiasCheck) {
+TEST(Vp9FdctTest, SignBiasCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int16_t test_input_block[16];
   int16_t test_output_block[16];
@@ -43,7 +43,7 @@ TEST(Vp8FdctTest, SignBiasCheck) {
 
     // TODO(Yaowu): this should be converted to a parameterized test
     // to test optimized versions of this function.
-    vp8_short_fdct4x4_c(test_input_block, test_output_block, pitch);
+    vp9_short_fdct4x4_c(test_input_block, test_output_block, pitch);
 
     for (int j = 0; j < 16; ++j) {
       if (test_output_block[j] < 0)
@@ -70,7 +70,7 @@ TEST(Vp8FdctTest, SignBiasCheck) {
 
     // TODO(Yaowu): this should be converted to a parameterized test
     // to test optimized versions of this function.
-    vp8_short_fdct4x4_c(test_input_block, test_output_block, pitch);
+    vp9_short_fdct4x4_c(test_input_block, test_output_block, pitch);
 
     for (int j = 0; j < 16; ++j) {
       if (test_output_block[j] < 0)
@@ -89,7 +89,7 @@ TEST(Vp8FdctTest, SignBiasCheck) {
   }
 };
 
-TEST(Vp8FdctTest, RoundTripErrorCheck) {
+TEST(Vp9FdctTest, RoundTripErrorCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int max_error = 0;
   double total_error = 0;
@@ -106,7 +106,7 @@ TEST(Vp8FdctTest, RoundTripErrorCheck) {
     // TODO(Yaowu): this should be converted to a parameterized test
     // to test optimized versions of this function.
     const int pitch = 8;
-    vp8_short_fdct4x4_c(test_input_block, test_temp_block, pitch);
+    vp9_short_fdct4x4_c(test_input_block, test_temp_block, pitch);
 
     for (int j = 0; j < 16; ++j) {
         if(test_temp_block[j] > 0) {
@@ -121,7 +121,7 @@ TEST(Vp8FdctTest, RoundTripErrorCheck) {
     }
 
     // Because the bitstream is not frozen yet, use the idct in the codebase.
-    vp8_short_idct4x4llm_c(test_temp_block, test_output_block, pitch);
+    vp9_short_idct4x4llm_c(test_temp_block, test_output_block, pitch);
 
     for (int j = 0; j < 16; ++j) {
       const int diff = test_input_block[j] - test_output_block[j];
index 97680fe081ad2a4f7edd87f793d307c15dd7094a..fc7084ed81ef413d7af149e583b57dfcad7fdcd1 100644 (file)
@@ -15,8 +15,8 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 extern "C" {
-#include "vp9/encoder/dct.h"
 #include "vp9/common/idct.h"
+#include "vpx_rtcd.h"
 }
 
 #include "acm_random.h"
@@ -26,7 +26,7 @@ using libvpx_test::ACMRandom;
 
 namespace {
 
-TEST(VP8Fdct8x8Test, SignBiasCheck) {
+TEST(VP9Fdct8x8Test, SignBiasCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int16_t test_input_block[64];
   int16_t test_output_block[64];
@@ -41,7 +41,7 @@ TEST(VP8Fdct8x8Test, SignBiasCheck) {
     for (int j = 0; j < 64; ++j)
       test_input_block[j] = rnd.Rand8() - rnd.Rand8();
 
-    vp8_short_fdct8x8_c(test_input_block, test_output_block, pitch);
+    vp9_short_fdct8x8_c(test_input_block, test_output_block, pitch);
 
     for (int j = 0; j < 64; ++j) {
       if (test_output_block[j] < 0)
@@ -66,7 +66,7 @@ TEST(VP8Fdct8x8Test, SignBiasCheck) {
     for (int j = 0; j < 64; ++j)
       test_input_block[j] = (rnd.Rand8() >> 4) - (rnd.Rand8() >> 4);
 
-    vp8_short_fdct8x8_c(test_input_block, test_output_block, pitch);
+    vp9_short_fdct8x8_c(test_input_block, test_output_block, pitch);
 
     for (int j = 0; j < 64; ++j) {
       if (test_output_block[j] < 0)
@@ -85,7 +85,7 @@ TEST(VP8Fdct8x8Test, SignBiasCheck) {
   }
 };
 
-TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
+TEST(VP9Fdct8x8Test, RoundTripErrorCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int max_error = 0;
   double total_error = 0;
@@ -100,7 +100,7 @@ TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
       test_input_block[j] = rnd.Rand8() - rnd.Rand8();
 
     const int pitch = 16;
-    vp8_short_fdct8x8_c(test_input_block, test_temp_block, pitch);
+    vp9_short_fdct8x8_c(test_input_block, test_temp_block, pitch);
     for (int j = 0; j < 64; ++j){
         if(test_temp_block[j] > 0) {
           test_temp_block[j] += 2;
@@ -112,7 +112,7 @@ TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
           test_temp_block[j] *= 4;
         }
     }
-    vp8_short_idct8x8_c(test_temp_block, test_output_block, pitch);
+    vp9_short_idct8x8_c(test_temp_block, test_output_block, pitch);
 
     for (int j = 0; j < 64; ++j) {
       const int diff = test_input_block[j] - test_output_block[j];
@@ -130,7 +130,7 @@ TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
       << "Error: 8x8 FDCT/IDCT has average roundtrip error > 1/5 per block";
 };
 
-TEST(VP8Fdct8x8Test, ExtremalCheck) {
+TEST(VP9Fdct8x8Test, ExtremalCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int max_error = 0;
   double total_error = 0;
@@ -145,8 +145,8 @@ TEST(VP8Fdct8x8Test, ExtremalCheck) {
       test_input_block[j] = rnd.Rand8() % 2 ? 255 : -255;
 
     const int pitch = 16;
-    vp8_short_fdct8x8_c(test_input_block, test_temp_block, pitch);
-    vp8_short_idct8x8_c(test_temp_block, test_output_block, pitch);
+    vp9_short_fdct8x8_c(test_input_block, test_temp_block, pitch);
+    vp9_short_idct8x8_c(test_temp_block, test_output_block, pitch);
 
     for (int j = 0; j < 64; ++j) {
       const int diff = test_input_block[j] - test_output_block[j];
index 6d3fe3d597cf004f2f119f812110af0a6b3cc594..0155716b5a724b5ae9dc8f6dd713b31141009f53 100644 (file)
@@ -15,8 +15,8 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 extern "C" {
-#include "vp9/encoder/dct.h"
 #include "vp9/common/idct.h"
+#include "vpx_rtcd.h"
 }
 
 #include "acm_random.h"
@@ -99,7 +99,7 @@ void reference_idct_2d(double input[64], int16_t output[64]) {
     output[i] = round(out2[i]/32);
 }
 
-TEST(VP8Idct8x8Test, AccuracyCheck) {
+TEST(VP9Idct8x8Test, AccuracyCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   const int count_test_block = 10000;
   for (int i = 0; i < count_test_block; ++i) {
@@ -112,7 +112,7 @@ TEST(VP8Idct8x8Test, AccuracyCheck) {
       input[j] = rnd.Rand8() - rnd.Rand8();
 
     const int pitch = 16;
-    vp8_short_fdct8x8_c(input, output_c, pitch);
+    vp9_short_fdct8x8_c(input, output_c, pitch);
     reference_dct_2d(input, output_r);
 
     for (int j = 0; j < 64; ++j) {
@@ -140,7 +140,7 @@ TEST(VP8Idct8x8Test, AccuracyCheck) {
     reference_dct_2d(input, output_r);
     for (int j = 0; j < 64; ++j)
       coeff[j] = round(output_r[j]);
-    vp8_short_idct8x8_c(coeff, output_c, pitch);
+    vp9_short_idct8x8_c(coeff, output_c, pitch);
     for (int j = 0; j < 64; ++j) {
       const int diff = output_c[j] -input[j];
       const int error = diff * diff;
index 65e1e99172e779504bb922b59c66a4e09e4b10ee..1014c803d67acf4c02e229e416b1829cf1800869 100644 (file)
@@ -467,7 +467,10 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, const BLOCKD *b) {
   TX_TYPE tx_type = DCT_DCT;
   if (xd->mode_info_context->mbmi.mode == I8X8_PRED &&
       xd->q_index < ACTIVE_HT8) {
-    tx_type = txfm_map(pred_mode_conv(b->bmi.as_mode.first));
+    // TODO(rbultje): MB_PREDICTION_MODE / B_PREDICTION_MODE should be merged
+    // or the relationship otherwise modified to address this type conversion.
+    tx_type = txfm_map(pred_mode_conv(
+                  (MB_PREDICTION_MODE)b->bmi.as_mode.first));
   }
   return tx_type;
 }