summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2012-08-24 12:10:04 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-08-24 12:10:04 -0700
commit6db4d93a27a48b48759fb98538bded3cf616a25f (patch)
tree608a828997a1b09fd59662bee89a10b9e4153338
parent2d60bee1fbfb7e5b6862e4e636151effabae98e3 (diff)
parent95ee7f1131cf4a12f6dfbb8e3576e7637fe29fcf (diff)
downloadlibvpx-6db4d93a27a48b48759fb98538bded3cf616a25f.tar
libvpx-6db4d93a27a48b48759fb98538bded3cf616a25f.tar.gz
libvpx-6db4d93a27a48b48759fb98538bded3cf616a25f.tar.bz2
libvpx-6db4d93a27a48b48759fb98538bded3cf616a25f.zip
Merge "change to properly account for coef scaling in unit tests" into experimental
-rw-r--r--test/fdct4x4_test.cc14
-rw-r--r--test/fdct8x8_test.cc11
2 files changed, 24 insertions, 1 deletions
diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc
index d88ed8df6..3bce41a41 100644
--- a/test/fdct4x4_test.cc
+++ b/test/fdct4x4_test.cc
@@ -107,6 +107,19 @@ TEST(Vp8FdctTest, RoundTripErrorCheck) {
// to test optimized versions of this function.
const int pitch = 8;
vp8_short_fdct4x4_c(test_input_block, test_temp_block, pitch);
+
+ for (int j = 0; j < 16; ++j) {
+ if(test_temp_block[j] > 0) {
+ test_temp_block[j] += 2;
+ test_temp_block[j] /= 4;
+ test_temp_block[j] *= 4;
+ } else {
+ test_temp_block[j] -= 2;
+ test_temp_block[j] /= 4;
+ test_temp_block[j] *= 4;
+ }
+ }
+
// Because the bitstream is not frozen yet, use the idct in the codebase.
vp8_short_idct4x4llm_c(test_temp_block, test_output_block, pitch);
@@ -118,7 +131,6 @@ TEST(Vp8FdctTest, RoundTripErrorCheck) {
total_error += error;
}
}
-
EXPECT_GE(1, max_error)
<< "Error: FDCT/IDCT has an individual roundtrip error > 1";
diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc
index 28b6afb0c..068d98e10 100644
--- a/test/fdct8x8_test.cc
+++ b/test/fdct8x8_test.cc
@@ -101,6 +101,17 @@ TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
const int pitch = 16;
vp8_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;
+ test_temp_block[j] *= 4;
+ } else {
+ test_temp_block[j] -= 2;
+ test_temp_block[j] /= 4;
+ test_temp_block[j] *= 4;
+ }
+ }
vp8_short_idct8x8_c(test_temp_block, test_output_block, pitch);
for (int j = 0; j < 64; ++j) {