Commit 3246fc04 authored by Yaowu Xu's avatar Yaowu Xu

vp9->vpx in --enable-vp9-highbitdepth

Also changed all related macros and tests

Change-Id: I5269578c0f716fd391111a43932f856778494d29
parent 2334f51d
......@@ -34,7 +34,7 @@ Advanced options:
${toggle_codec_srcs} in/exclude codec library source code
${toggle_debug_libs} in/exclude debug version of libraries
${toggle_static_msvcrt} use static MSVCRT (VS builds only)
${toggle_vp9_highbitdepth} use VP9 high bit depth (10/12) profiles
${toggle_vpx_highbitdepth} use VP9 high bit depth (10/12) profiles
${toggle_better_hw_compatibility}
enable encoder to produce streams with better
hardware decoder compatibility
......@@ -309,7 +309,7 @@ CONFIG_LIST="
temporal_denoising
vp9_temporal_denoising
coefficient_range_checking
vp9_highbitdepth
vpx_highbitdepth
better_hw_compatibility
experimental
size_limit
......@@ -370,7 +370,7 @@ CMDLINE_SELECT="
vp9_temporal_denoising
coefficient_range_checking
better_hw_compatibility
vp9_highbitdepth
vpx_highbitdepth
experimental
"
......
......@@ -83,7 +83,7 @@ static const arg_def_t speed_arg =
static const arg_def_t aqmode_arg =
ARG_DEF("aq", "aqmode", 1, "aq-mode off/on");
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
static const struct arg_enum_list bitdepth_enum[] = {
{"8", VPX_BITS_8},
{"10", VPX_BITS_10},
......@@ -94,7 +94,7 @@ static const struct arg_enum_list bitdepth_enum[] = {
static const arg_def_t bitdepth_arg =
ARG_DEF_ENUM("d", "bit-depth", 1, "Bit depth for codec 8, 10 or 12. ",
bitdepth_enum);
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
static const arg_def_t *svc_args[] = {
......@@ -108,7 +108,7 @@ static const arg_def_t *svc_args[] = {
&output_rc_stats_arg,
#endif
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
&bitdepth_arg,
#endif
&speed_arg,
......@@ -265,7 +265,7 @@ static void parse_command_line(int argc, const char **argv_,
enc_cfg->g_lag_in_frames = arg_parse_uint(&arg);
} else if (arg_match(&arg, &rc_end_usage_arg, argi)) {
enc_cfg->rc_end_usage = arg_parse_uint(&arg);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
} else if (arg_match(&arg, &bitdepth_arg, argi)) {
enc_cfg->g_bit_depth = arg_parse_enum_or_int(&arg);
switch (enc_cfg->g_bit_depth) {
......@@ -285,7 +285,7 @@ static void parse_command_line(int argc, const char **argv_,
die("Error: Invalid bit depth selected (%d)\n", enc_cfg->g_bit_depth);
break;
}
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
} else {
++argj;
}
......@@ -634,7 +634,7 @@ int main(int argc, const char **argv) {
parse_command_line(argc, argv, &app_input, &svc_ctx, &enc_cfg);
// Allocate image buffer
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (!vpx_img_alloc(&raw, enc_cfg.g_input_bit_depth == 8 ?
VPX_IMG_FMT_I420 : VPX_IMG_FMT_I42016,
enc_cfg.g_w, enc_cfg.g_h, 32)) {
......@@ -644,7 +644,7 @@ int main(int argc, const char **argv) {
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, enc_cfg.g_w, enc_cfg.g_h, 32)) {
die("Failed to allocate image %dx%d\n", enc_cfg.g_w, enc_cfg.g_h);
}
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
if (!(infile = fopen(app_input.input_filename, "rb")))
die("Failed to open %s for reading\n", app_input.input_filename);
......
......@@ -492,13 +492,13 @@ int main(int argc, char **argv) {
struct RateControlMetrics rc;
int64_t cx_time = 0;
const int min_args_base = 11;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
vpx_bit_depth_t bit_depth = VPX_BITS_8;
int input_bit_depth = 8;
const int min_args = min_args_base + 1;
#else
const int min_args = min_args_base;
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
double sum_bitrate = 0.0;
double sum_bitrate2 = 0.0;
double framerate = 30.0;
......@@ -506,7 +506,7 @@ int main(int argc, char **argv) {
exec_name = argv[0];
// Check usage and arguments.
if (argc < min_args) {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
"<rate_num> <rate_den> <speed> <frame_drop_threshold> <mode> "
"<Rate_0> ... <Rate_nlayers-1> <bit-depth> \n", argv[0]);
......@@ -514,7 +514,7 @@ int main(int argc, char **argv) {
die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
"<rate_num> <rate_den> <speed> <frame_drop_threshold> <mode> "
"<Rate_0> ... <Rate_nlayers-1> \n", argv[0]);
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
}
encoder = get_vpx_encoder_by_name(argv[3]);
......@@ -538,7 +538,7 @@ int main(int argc, char **argv) {
die("Invalid number of arguments");
}
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
switch (strtol(argv[argc-1], NULL, 0)) {
case 8:
bit_depth = VPX_BITS_8;
......@@ -565,7 +565,7 @@ int main(int argc, char **argv) {
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, width, height, 32)) {
die("Failed to allocate image", width, height);
}
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
// Populate encoder configuration.
res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
......@@ -578,13 +578,13 @@ int main(int argc, char **argv) {
cfg.g_w = width;
cfg.g_h = height;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (bit_depth != VPX_BITS_8) {
cfg.g_bit_depth = bit_depth;
cfg.g_input_bit_depth = input_bit_depth;
cfg.g_profile = 2;
}
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
// Timebase format e.g. 30fps: numerator=1, demoninator = 30.
cfg.g_timebase.num = strtol(argv[6], NULL, 0);
......@@ -672,13 +672,13 @@ int main(int argc, char **argv) {
cfg.ss_number_layers = 1;
// Initialize codec.
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (vpx_codec_enc_init(
&codec, encoder->codec_interface(), &cfg,
bit_depth == VPX_BITS_8 ? 0 : VPX_CODEC_USE_HIGHBITDEPTH))
#else
if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
die_codec(&codec, "Failed to initialize encoder");
if (strncmp(encoder->name, "vp8", 3) == 0) {
......
......@@ -50,9 +50,9 @@ const TestVideoParam kTestVectors[] = {
8, VPX_IMG_FMT_I420, VPX_BITS_8, 0},
{"rush_hour_444.y4m", 352, 288, 30, 1,
8, VPX_IMG_FMT_I444, VPX_BITS_8, 1},
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
// Add list of profile 2/3 test videos here ...
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
};
const TestEncodeParam kEncodeVectors[] = {
......@@ -224,7 +224,7 @@ TEST_P(ArfFreqTest, MinArfFreqTest) {
delete(video);
}
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
# if CONFIG_VP10_ENCODER
// TODO(angiebird): 25-29 fail in high bitdepth mode.
INSTANTIATE_TEST_CASE_P(
......@@ -242,5 +242,5 @@ VP10_INSTANTIATE_TEST_CASE(
::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors));
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
} // namespace
......@@ -189,7 +189,7 @@ void filter_average_block2d_8_c(const uint8_t *src_ptr,
output_width, output_height);
}
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
void highbd_filter_block2d_8_c(const uint16_t *src_ptr,
const unsigned int src_stride,
const int16_t *HFilter,
......@@ -308,7 +308,7 @@ void highbd_filter_average_block2d_8_c(const uint16_t *src_ptr,
highbd_block2d_average_c(tmp, 64, dst_ptr, dst_stride,
output_width, output_height, bd);
}
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
public:
......@@ -320,7 +320,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
vpx_memalign(kDataAlignment, kOutputBufferSize));
output_ref_ = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kOutputBufferSize));
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
input16_ = reinterpret_cast<uint16_t*>(
vpx_memalign(kDataAlignment,
(kInputBufferSize + 1) * sizeof(uint16_t))) + 1;
......@@ -340,7 +340,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
output_ = NULL;
vpx_free(output_ref_);
output_ref_ = NULL;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
vpx_free(input16_ - 1);
input16_ = NULL;
vpx_free(output16_);
......@@ -375,7 +375,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
virtual void SetUp() {
UUT_ = GET_PARAM(2);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ != 0)
mask_ = (1 << UUT_->use_highbd_) - 1;
else
......@@ -393,12 +393,12 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
for (int i = 0; i < kInputBufferSize; ++i) {
if (i & 1) {
input_[i] = 255;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
input16_[i] = mask_;
#endif
} else {
input_[i] = prng.Rand8Extremes();
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
input16_[i] = prng.Rand16() & mask_;
#endif
}
......@@ -407,14 +407,14 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
void SetConstantInput(int value) {
memset(input_, value, kInputBufferSize);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
vpx_memset16(input16_, value, kInputBufferSize);
#endif
}
void CopyOutputToRef() {
memcpy(output_ref_, output_, kOutputBufferSize);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
memcpy(output16_ref_, output16_, kOutputBufferSize);
#endif
}
......@@ -427,7 +427,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
}
uint8_t *input() const {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0) {
return input_ + BorderTop() * kOuterBlockSize + BorderLeft();
} else {
......@@ -440,7 +440,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
}
uint8_t *output() const {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0) {
return output_ + BorderTop() * kOuterBlockSize + BorderLeft();
} else {
......@@ -453,7 +453,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
}
uint8_t *output_ref() const {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0) {
return output_ref_ + BorderTop() * kOuterBlockSize + BorderLeft();
} else {
......@@ -466,7 +466,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
}
uint16_t lookup(uint8_t *list, int index) const {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0) {
return list[index];
} else {
......@@ -478,7 +478,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
}
void assign_val(uint8_t *list, int index, uint16_t val) const {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0) {
list[index] = (uint8_t) val;
} else {
......@@ -497,7 +497,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
unsigned int dst_stride,
unsigned int output_width,
unsigned int output_height) {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0) {
filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
dst_ptr, dst_stride, output_width,
......@@ -524,7 +524,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
unsigned int dst_stride,
unsigned int output_width,
unsigned int output_height) {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0) {
filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
dst_ptr, dst_stride, output_width, output_height);
......@@ -544,7 +544,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
static uint8_t* input_;
static uint8_t* output_;
static uint8_t* output_ref_;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
static uint16_t* input16_;
static uint16_t* output16_;
static uint16_t* output16_ref_;
......@@ -555,7 +555,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
uint8_t* ConvolveTest::input_ = NULL;
uint8_t* ConvolveTest::output_ = NULL;
uint8_t* ConvolveTest::output_ref_ = NULL;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
uint16_t* ConvolveTest::input16_ = NULL;
uint16_t* ConvolveTest::output16_ = NULL;
uint16_t* ConvolveTest::output16_ref_ = NULL;
......@@ -685,7 +685,7 @@ const int16_t kInvalidFilter[8] = { 0 };
TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
uint8_t* const in = input();
uint8_t* const out = output();
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
uint8_t ref8[kOutputStride * kMaxDimension];
uint16_t ref16[kOutputStride * kMaxDimension];
uint8_t* ref;
......@@ -747,7 +747,7 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
uint8_t* const in = input();
uint8_t* const out = output();
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
uint8_t ref8[kOutputStride * kMaxDimension];
uint16_t ref16[kOutputStride * kMaxDimension];
uint8_t* ref;
......@@ -765,7 +765,7 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
for (int y = 0; y < Height(); ++y) {
for (int x = 0; x < Width(); ++x) {
uint16_t r;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
r = prng.Rand8Extremes();
} else {
......@@ -829,7 +829,7 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
TEST_P(ConvolveTest, FilterExtremes) {
uint8_t *const in = input();
uint8_t *const out = output();
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
uint8_t ref8[kOutputStride * kMaxDimension];
uint16_t ref16[kOutputStride * kMaxDimension];
uint8_t *ref;
......@@ -847,7 +847,7 @@ TEST_P(ConvolveTest, FilterExtremes) {
for (int y = 0; y < Height(); ++y) {
for (int x = 0; x < Width(); ++x) {
uint16_t r;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
r = prng.Rand8Extremes();
} else {
......@@ -866,7 +866,7 @@ TEST_P(ConvolveTest, FilterExtremes) {
while (seed_val < 256) {
for (int y = 0; y < 8; ++y) {
for (int x = 0; x < 8; ++x) {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
((seed_val >> (axis ? y : x)) & 1) * mask_);
#else
......@@ -959,7 +959,7 @@ TEST_P(ConvolveTest, CheckScalingFiltering) {
using std::tr1::make_tuple;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
#define WRAP(func, bd) \
void wrap_ ## func ## _ ## bd(const uint8_t *src, ptrdiff_t src_stride, \
uint8_t *dst, ptrdiff_t dst_stride, \
......@@ -1122,7 +1122,7 @@ INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values(
#endif
#if HAVE_SSE2 && ARCH_X86_64
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
const ConvolveFunctions convolve8_sse2(
#if CONFIG_USE_X86INC
wrap_convolve_copy_sse2_8, wrap_convolve_avg_sse2_8,
......@@ -1227,7 +1227,7 @@ INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
make_tuple(64, 32, &convolve8_sse2),
make_tuple(32, 64, &convolve8_sse2),
make_tuple(64, 64, &convolve8_sse2)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
#endif
#if HAVE_SSSE3
......
......@@ -266,7 +266,7 @@ void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
vp10_iht16x16_256_add_c(in, dest, stride, tx_type);
}
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct16x16_256_add_c(in, out, stride, 10);
}
......@@ -318,7 +318,7 @@ void idct16x16_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct16x16_10_add_sse2(in, out, stride, 12);
}
#endif // HAVE_SSE2
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
class Trans16x16TestBase {
public:
......@@ -339,7 +339,7 @@ class Trans16x16TestBase {
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
#endif
......@@ -350,7 +350,7 @@ class Trans16x16TestBase {
src[j] = rnd.Rand8();
dst[j] = rnd.Rand8();
test_input_block[j] = src[j] - dst[j];
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
} else {
src16[j] = rnd.Rand16() & mask_;
dst16[j] = rnd.Rand16() & mask_;
......@@ -364,7 +364,7 @@ class Trans16x16TestBase {
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(test_temp_block, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
......@@ -372,7 +372,7 @@ class Trans16x16TestBase {
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
const uint32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
......@@ -454,7 +454,7 @@ class Trans16x16TestBase {
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
#endif
......@@ -476,7 +476,7 @@ class Trans16x16TestBase {
// clear reconstructed pixel buffers
memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
memset(ref, 0, kNumCoeffs * sizeof(uint8_t));
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
memset(dst16, 0, kNumCoeffs * sizeof(uint16_t));
memset(ref16, 0, kNumCoeffs * sizeof(uint16_t));
#endif
......@@ -488,7 +488,7 @@ class Trans16x16TestBase {
if (bit_depth_ == VPX_BITS_8) {
inv_txfm_ref(output_ref_block, ref, pitch_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
} else {
inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_,
tx_type_);
......@@ -499,7 +499,7 @@ class Trans16x16TestBase {
if (bit_depth_ == VPX_BITS_8) {
for (int j = 0; j < kNumCoeffs; ++j)
EXPECT_EQ(ref[j], dst[j]);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
} else {
for (int j = 0; j < kNumCoeffs; ++j)
EXPECT_EQ(ref16[j], dst16[j]);
......@@ -515,10 +515,10 @@ class Trans16x16TestBase {
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
for (int i = 0; i < count_test_block; ++i) {
double out_r[kNumCoeffs];
......@@ -529,12 +529,12 @@ class Trans16x16TestBase {
src[j] = rnd.Rand8();
dst[j] = rnd.Rand8();
in[j] = src[j] - dst[j];
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
} else {
src16[j] = rnd.Rand16() & mask_;
dst16[j] = rnd.Rand16() & mask_;
in[j] = src16[j] - dst16[j];
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
}
}
......@@ -544,20 +544,20 @@ class Trans16x16TestBase {
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16));
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
16));
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
const uint32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
const uint32_t diff = dst[j] - src[j];
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
const uint32_t error = diff * diff;
EXPECT_GE(1u, error)
<< "Error: 16x16 IDCT has error " << error
......@@ -574,10 +574,10 @@ class Trans16x16TestBase {
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
for (int i = 0; i < count_test_block; ++i) {
for (int j = 0; j < kNumCoeffs; ++j) {
......@@ -590,31 +590,31 @@ class Trans16x16TestBase {
if (bit_depth_ == VPX_BITS_8) {
dst[j] = 0;
ref[j] = 0;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
} else {
dst16[j] = 0;
ref16[j] = 0;
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
}
}
if (bit_depth_ == VPX_BITS_8) {
ref_txfm(coeff, ref, pitch_);
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
} else {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
pitch_));
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VPX_HIGHBITDEPTH
const uint32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j];
#else
const uint32_t diff = dst[j] - ref[j];
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VPX_HIGHBITDEPTH
const uint32_t error = diff * diff;
EXPECT_EQ(0u, error)