Commit 62cca969 authored by Jingning Han's avatar Jingning Han

Fix high bit-depth unit test failure

Fix the 16-bit copy in convolve test to avoid the use of
uninitialized values. This fixes unit tests
C_8/ConvolveTest.Avg/*

bug=aom:19

The issue was discovered by a proper fix to CONVERT_TO_BYTEPTR()
in f16387bc.

Change-Id: Ibf0acdf4fce2ca2cd5ab5e581d72eca173d8500d
parent 00315085
......@@ -375,7 +375,8 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
void CopyOutputToRef() {
memcpy(output_ref_, output_, kOutputBufferSize);
#if CONFIG_AOM_HIGHBITDEPTH
memcpy(output16_ref_, output16_, kOutputBufferSize);
// Copy 16-bit pixels values. The effective number of bytes is double.
memcpy(output16_ref_, output16_, 2 * kOutputBufferSize);
#endif
}
......@@ -390,8 +391,8 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
if (UUT_->use_highbd_ == 0) {
return input_ + BorderTop() * kOuterBlockSize + BorderLeft();
} else {
return CONVERT_TO_BYTEPTR(input16_ + BorderTop() * kOuterBlockSize +
BorderLeft());
return CONVERT_TO_BYTEPTR(input16_) + BorderTop() * kOuterBlockSize +
BorderLeft();
}
#else
return input_ + BorderTop() * kOuterBlockSize + BorderLeft();
......@@ -403,8 +404,8 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
if (UUT_->use_highbd_ == 0) {
return output_ + BorderTop() * kOuterBlockSize + BorderLeft();
} else {
return CONVERT_TO_BYTEPTR(output16_ + BorderTop() * kOuterBlockSize +
BorderLeft());
return CONVERT_TO_BYTEPTR(output16_) + BorderTop() * kOuterBlockSize +
BorderLeft();
}
#else
return output_ + BorderTop() * kOuterBlockSize + BorderLeft();
......@@ -416,8 +417,8 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
if (UUT_->use_highbd_ == 0) {
return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft();
} else {
return CONVERT_TO_BYTEPTR(output16_ref_ + BorderTop() * kOuterBlockSize +
BorderLeft());
return CONVERT_TO_BYTEPTR(output16_ref_) + BorderTop() * kOuterBlockSize +
BorderLeft();
}
#else
return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment