shithub: libvpx

Download patch

ref: 182f99f0c60eeb6c93a5ae40af835c0e16a83e52
parent: 4626faf1e75ab229552d626db07c18e122971096
parent: 2e3e6857995073d7023fb15949124e7dc585cee0
author: James Zern <jzern@google.com>
date: Tue Nov 6 07:18:01 EST 2012

Merge "fix test builds" into experimental

--- a/test/boolcoder_test.cc
+++ b/test/boolcoder_test.cc
@@ -28,7 +28,7 @@
 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 @@
         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 @@
           } 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 @@
           } 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;
--- a/test/dct16x16_test.cc
+++ b/test/dct16x16_test.cc
@@ -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 @@
 }
 
 
-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 @@
     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 @@
           << " 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(VP8Fdct16x16Test, AccuracyCheck) {
+TEST(VP9Fdct16x16Test, AccuracyCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int max_error = 0;
   double total_error = 0;
@@ -306,8 +306,8 @@
       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 @@
       << "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 @@
         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) {
--- a/test/fdct4x4_test.cc
+++ b/test/fdct4x4_test.cc
@@ -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 @@
 
 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 @@
 
     // 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 @@
 
     // 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, RoundTripErrorCheck) {
+TEST(Vp9FdctTest, RoundTripErrorCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int max_error = 0;
   double total_error = 0;
@@ -106,7 +106,7 @@
     // 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 @@
     }
 
     // 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];
--- a/test/fdct8x8_test.cc
+++ b/test/fdct8x8_test.cc
@@ -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 @@
 
 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 @@
     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 @@
     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, RoundTripErrorCheck) {
+TEST(VP9Fdct8x8Test, RoundTripErrorCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   int max_error = 0;
   double total_error = 0;
@@ -100,7 +100,7 @@
       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_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 @@
       << "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_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];
--- a/test/idct8x8_test.cc
+++ b/test/idct8x8_test.cc
@@ -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 @@
     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 @@
       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 @@
     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;
--- a/vp9/common/blockd.h
+++ b/vp9/common/blockd.h
@@ -467,7 +467,10 @@
   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;
 }