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
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) {
} 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) {
} 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;
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"
}
-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) {
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;
<< " 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;
}
}
-TEST(VP8Fdct16x16Test, AccuracyCheck) {
+TEST(VP9Fdct16x16Test, AccuracyCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
int max_error = 0;
double total_error = 0;
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];
<< "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) {
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) {
extern "C" {
#include "vp9/common/idct.h"
-#include "vp9/encoder/dct.h"
+#include "vpx_rtcd.h"
}
#include "acm_random.h"
namespace {
-TEST(Vp8FdctTest, SignBiasCheck) {
+TEST(Vp9FdctTest, SignBiasCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
int16_t test_input_block[16];
int16_t test_output_block[16];
// 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)
// 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)
}
};
-TEST(Vp8FdctTest, RoundTripErrorCheck) {
+TEST(Vp9FdctTest, RoundTripErrorCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
int max_error = 0;
double total_error = 0;
// 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) {
}
// 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];
#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"
namespace {
-TEST(VP8Fdct8x8Test, SignBiasCheck) {
+TEST(VP9Fdct8x8Test, SignBiasCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
int16_t test_input_block[64];
int16_t test_output_block[64];
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)
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)
}
};
-TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
+TEST(VP9Fdct8x8Test, RoundTripErrorCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
int max_error = 0;
double total_error = 0;
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;
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];
<< "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;
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];
#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"
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) {
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) {
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;
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;
}