From: James Zern Date: Tue, 6 Nov 2012 02:13:04 +0000 (-0800) Subject: fix test builds X-Git-Tag: v1.3.0~1217^2~123^2~3^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e3e6857995073d7023fb15949124e7dc585cee0;p=libvpx fix test builds 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 --- diff --git a/test/boolcoder_test.cc b/test/boolcoder_test.cc index 119c77a79..68a69d510 100644 --- a/test/boolcoder_test.cc +++ b/test/boolcoder_test.cc @@ -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(probas[i])); + encode_bool(&bw, bit, static_cast(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; diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc index a0b91f389..d572ee6be 100644 --- 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 @@ 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) { diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc index d7066b3ff..e2eb28e5a 100644 --- 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 @@ 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]; diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index 97680fe08..fc7084ed8 100644 --- 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 @@ 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]; diff --git a/test/idct8x8_test.cc b/test/idct8x8_test.cc index 6d3fe3d59..0155716b5 100644 --- 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 @@ 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; diff --git a/vp9/common/blockd.h b/vp9/common/blockd.h index 65e1e9917..1014c803d 100644 --- a/vp9/common/blockd.h +++ b/vp9/common/blockd.h @@ -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; }