vp9->vpx in --enable-vp9-highbitdepth
Also changed all related macros and tests Change-Id: I5269578c0f716fd391111a43932f856778494d29
This commit is contained in:
parent
2334f51d5f
commit
3246fc04fb
6
configure
vendored
6
configure
vendored
@ -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)
|
||||
<< "Error: 16x16 IDCT Comparison has error " << error
|
||||
@ -646,7 +646,7 @@ class Trans16x16DCT
|
||||
fwd_txfm_ref = fdct16x16_ref;
|
||||
inv_txfm_ref = idct16x16_ref;
|
||||
mask_ = (1 << bit_depth_) - 1;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (bit_depth_) {
|
||||
case VPX_BITS_10:
|
||||
inv_txfm_ref = idct16x16_10_ref;
|
||||
@ -713,7 +713,7 @@ class Trans16x16HT
|
||||
fwd_txfm_ref = fht16x16_ref;
|
||||
inv_txfm_ref = iht16x16_ref;
|
||||
mask_ = (1 << bit_depth_) - 1;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (bit_depth_) {
|
||||
case VPX_BITS_10:
|
||||
inv_txfm_ref = iht16x16_10;
|
||||
@ -794,7 +794,7 @@ TEST_P(InvTrans16x16DCT, CompareReference) {
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
@ -806,9 +806,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans16x16HT,
|
||||
::testing::Values(
|
||||
@ -832,9 +832,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht16x16_c, &vp10_iht16x16_256_add_c, 1, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht16x16_c, &vp10_iht16x16_256_add_c, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht16x16_c, &vp10_iht16x16_256_add_c, 3, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_NEON_ASM && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
@ -842,7 +842,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct16x16_256_add_neon, 0, VPX_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
@ -859,9 +859,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
VPX_BITS_8),
|
||||
make_tuple(&vp10_fht16x16_sse2, &vp10_iht16x16_256_add_sse2, 3,
|
||||
VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
@ -899,9 +899,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&idct16x16_10_add_12_sse2, 3167, VPX_BITS_12),
|
||||
make_tuple(&idct16x16_12,
|
||||
&idct16x16_256_add_12_sse2, 3167, VPX_BITS_12)));
|
||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_SSE2 && CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
@ -918,5 +918,5 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vp10_iht16x16_256_add_msa, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht16x16_msa,
|
||||
&vp10_iht16x16_256_add_msa, 3, VPX_BITS_8)));
|
||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
} // namespace
|
||||
|
@ -80,7 +80,7 @@ typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride);
|
||||
typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmFunc, int, vpx_bit_depth_t>
|
||||
Trans32x32Param;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void idct32x32_8(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct32x32_1024_add_c(in, out, stride, 8);
|
||||
}
|
||||
@ -92,7 +92,7 @@ void idct32x32_10(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
void idct32x32_12(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct32x32_1024_add_c(in, out, stride, 12);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
class Trans32x32Test : public ::testing::TestWithParam<Trans32x32Param> {
|
||||
public:
|
||||
@ -125,7 +125,7 @@ TEST_P(Trans32x32Test, AccuracyCheck) {
|
||||
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
|
||||
@ -137,7 +137,7 @@ TEST_P(Trans32x32Test, AccuracyCheck) {
|
||||
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_;
|
||||
@ -149,7 +149,7 @@ TEST_P(Trans32x32Test, AccuracyCheck) {
|
||||
ASM_REGISTER_STATE_CHECK(fwd_txfm_(test_input_block, test_temp_block, 32));
|
||||
if (bit_depth_ == VPX_BITS_8) {
|
||||
ASM_REGISTER_STATE_CHECK(inv_txfm_(test_temp_block, dst, 32));
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
ASM_REGISTER_STATE_CHECK(inv_txfm_(test_temp_block,
|
||||
CONVERT_TO_BYTEPTR(dst16), 32));
|
||||
@ -157,7 +157,7 @@ TEST_P(Trans32x32Test, AccuracyCheck) {
|
||||
}
|
||||
|
||||
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
|
||||
@ -261,7 +261,7 @@ TEST_P(Trans32x32Test, InverseAccuracy) {
|
||||
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
|
||||
@ -275,7 +275,7 @@ TEST_P(Trans32x32Test, InverseAccuracy) {
|
||||
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_;
|
||||
@ -289,13 +289,13 @@ TEST_P(Trans32x32Test, InverseAccuracy) {
|
||||
coeff[j] = static_cast<tran_low_t>(round(out_r[j]));
|
||||
if (bit_depth_ == VPX_BITS_8) {
|
||||
ASM_REGISTER_STATE_CHECK(inv_txfm_(coeff, dst, 32));
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
ASM_REGISTER_STATE_CHECK(inv_txfm_(coeff, CONVERT_TO_BYTEPTR(dst16), 32));
|
||||
#endif
|
||||
}
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int diff =
|
||||
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
|
||||
#else
|
||||
@ -311,7 +311,7 @@ TEST_P(Trans32x32Test, InverseAccuracy) {
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans32x32Test,
|
||||
::testing::Values(
|
||||
@ -335,9 +335,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_c,
|
||||
&vpx_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_NEON_ASM && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans32x32Test,
|
||||
::testing::Values(
|
||||
@ -345,9 +345,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct32x32_1024_add_neon, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_c,
|
||||
&vpx_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans32x32Test,
|
||||
::testing::Values(
|
||||
@ -355,9 +355,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_sse2,
|
||||
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans32x32Test,
|
||||
::testing::Values(
|
||||
@ -371,9 +371,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_sse2, &vpx_idct32x32_1024_add_c, 1,
|
||||
VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_SSE2 && CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_AVX2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX2, Trans32x32Test,
|
||||
::testing::Values(
|
||||
@ -381,9 +381,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_avx2,
|
||||
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_AVX2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans32x32Test,
|
||||
::testing::Values(
|
||||
@ -391,5 +391,5 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct32x32_1024_add_msa, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_msa,
|
||||
&vpx_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
} // namespace
|
||||
|
@ -133,7 +133,7 @@ TEST(DecodeAPI, Vp9InvalidDecode) {
|
||||
vpx_codec_ctx_t dec;
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_dec_init(&dec, codec, NULL, 0));
|
||||
const uint32_t frame_size = static_cast<uint32_t>(video.frame_size());
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
EXPECT_EQ(VPX_CODEC_MEM_ERROR,
|
||||
vpx_codec_decode(&dec, video.cxdata(), frame_size, NULL, 0));
|
||||
#else
|
||||
|
@ -48,7 +48,7 @@ const TestVideoParam kTestVectors[] = {
|
||||
{"park_joy_90p_8_422.y4m", 8, VPX_IMG_FMT_I422, VPX_BITS_8, 1},
|
||||
{"park_joy_90p_8_444.y4m", 8, VPX_IMG_FMT_I444, VPX_BITS_8, 1},
|
||||
{"park_joy_90p_8_440.yuv", 8, VPX_IMG_FMT_I440, VPX_BITS_8, 1},
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
{"park_joy_90p_10_420.y4m", 10, VPX_IMG_FMT_I42016, VPX_BITS_10, 2},
|
||||
{"park_joy_90p_10_422.y4m", 10, VPX_IMG_FMT_I42216, VPX_BITS_10, 3},
|
||||
{"park_joy_90p_10_444.y4m", 10, VPX_IMG_FMT_I44416, VPX_BITS_10, 3},
|
||||
@ -57,7 +57,7 @@ const TestVideoParam kTestVectors[] = {
|
||||
{"park_joy_90p_12_422.y4m", 12, VPX_IMG_FMT_I42216, VPX_BITS_12, 3},
|
||||
{"park_joy_90p_12_444.y4m", 12, VPX_IMG_FMT_I44416, VPX_BITS_12, 3},
|
||||
{"park_joy_90p_12_440.yuv", 12, VPX_IMG_FMT_I44016, VPX_BITS_12, 3},
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
};
|
||||
|
||||
// Encoding modes tested
|
||||
@ -181,7 +181,7 @@ TEST_P(EndToEndTestLarge, EndtoEndPSNRTest) {
|
||||
delete(video);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
# if CONFIG_VP10_ENCODER
|
||||
// TODO(angiebird): many fail in high bitdepth mode.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
@ -199,5 +199,5 @@ VP10_INSTANTIATE_TEST_CASE(
|
||||
::testing::ValuesIn(kEncodingModeVectors),
|
||||
::testing::ValuesIn(kTestVectors),
|
||||
::testing::ValuesIn(kCpuUsedVectors));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
@ -27,7 +27,7 @@
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
namespace {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int kNumIterations = 1000;
|
||||
|
||||
typedef int64_t (*ErrorBlockFunc)(const tran_low_t *coeff,
|
||||
@ -160,52 +160,52 @@ TEST_P(ErrorBlockTest, ExtremeValues) {
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_USE_X86INC
|
||||
int64_t wrap_vp9_highbd_block_error_8bit_c(const tran_low_t *coeff,
|
||||
int64_t wrap_vp10_highbd_block_error_8bit_c(const tran_low_t *coeff,
|
||||
const tran_low_t *dqcoeff,
|
||||
intptr_t block_size,
|
||||
int64_t *ssz, int bps) {
|
||||
assert(bps == 8);
|
||||
return vp9_highbd_block_error_8bit_c(coeff, dqcoeff, block_size, ssz);
|
||||
return vp10_highbd_block_error_8bit_c(coeff, dqcoeff, block_size, ssz);
|
||||
}
|
||||
|
||||
#if HAVE_SSE2
|
||||
int64_t wrap_vp9_highbd_block_error_8bit_sse2(const tran_low_t *coeff,
|
||||
int64_t wrap_vp10_highbd_block_error_8bit_sse2(const tran_low_t *coeff,
|
||||
const tran_low_t *dqcoeff,
|
||||
intptr_t block_size,
|
||||
int64_t *ssz, int bps) {
|
||||
assert(bps == 8);
|
||||
return vp9_highbd_block_error_8bit_sse2(coeff, dqcoeff, block_size, ssz);
|
||||
return vp10_highbd_block_error_8bit_sse2(coeff, dqcoeff, block_size, ssz);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, ErrorBlockTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_highbd_block_error_sse2,
|
||||
&vp9_highbd_block_error_c, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_block_error_sse2,
|
||||
&vp9_highbd_block_error_c, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_block_error_sse2,
|
||||
&vp9_highbd_block_error_c, VPX_BITS_8),
|
||||
make_tuple(&wrap_vp9_highbd_block_error_8bit_sse2,
|
||||
&wrap_vp9_highbd_block_error_8bit_c, VPX_BITS_8)));
|
||||
make_tuple(&vp10_highbd_block_error_sse2,
|
||||
&vp10_highbd_block_error_c, VPX_BITS_10),
|
||||
make_tuple(&vp10_highbd_block_error_sse2,
|
||||
&vp10_highbd_block_error_c, VPX_BITS_12),
|
||||
make_tuple(&vp10_highbd_block_error_sse2,
|
||||
&vp10_highbd_block_error_c, VPX_BITS_8),
|
||||
make_tuple(&wrap_vp10_highbd_block_error_8bit_sse2,
|
||||
&wrap_vp10_highbd_block_error_8bit_c, VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_AVX
|
||||
int64_t wrap_vp9_highbd_block_error_8bit_avx(const tran_low_t *coeff,
|
||||
int64_t wrap_vp10_highbd_block_error_8bit_avx(const tran_low_t *coeff,
|
||||
const tran_low_t *dqcoeff,
|
||||
intptr_t block_size,
|
||||
int64_t *ssz, int bps) {
|
||||
assert(bps == 8);
|
||||
return vp9_highbd_block_error_8bit_avx(coeff, dqcoeff, block_size, ssz);
|
||||
return vp10_highbd_block_error_8bit_avx(coeff, dqcoeff, block_size, ssz);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX, ErrorBlockTest,
|
||||
::testing::Values(
|
||||
make_tuple(&wrap_vp9_highbd_block_error_8bit_avx,
|
||||
&wrap_vp9_highbd_block_error_8bit_c, VPX_BITS_8)));
|
||||
make_tuple(&wrap_vp10_highbd_block_error_8bit_avx,
|
||||
&wrap_vp10_highbd_block_error_8bit_c, VPX_BITS_8)));
|
||||
#endif // HAVE_AVX
|
||||
|
||||
#endif // CONFIG_USE_X86INC
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
@ -53,7 +53,7 @@ void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
vp10_fwht4x4_c(in, out, stride);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void idct4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct4x4_16_add_c(in, out, stride, 10);
|
||||
}
|
||||
@ -87,7 +87,7 @@ void idct4x4_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct4x4_16_add_sse2(in, out, stride, 12);
|
||||
}
|
||||
#endif // HAVE_SSE2
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
class Trans4x4TestBase {
|
||||
public:
|
||||
@ -108,7 +108,7 @@ class Trans4x4TestBase {
|
||||
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
|
||||
@ -119,7 +119,7 @@ class Trans4x4TestBase {
|
||||
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_;
|
||||
@ -132,7 +132,7 @@ class Trans4x4TestBase {
|
||||
test_temp_block, pitch_));
|
||||
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_));
|
||||
@ -140,7 +140,7 @@ class Trans4x4TestBase {
|
||||
}
|
||||
|
||||
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
|
||||
@ -224,7 +224,7 @@ class Trans4x4TestBase {
|
||||
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
|
||||
@ -236,7 +236,7 @@ class Trans4x4TestBase {
|
||||
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_;
|
||||
@ -249,7 +249,7 @@ class Trans4x4TestBase {
|
||||
|
||||
if (bit_depth_ == VPX_BITS_8) {
|
||||
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
|
||||
pitch_));
|
||||
@ -257,7 +257,7 @@ class Trans4x4TestBase {
|
||||
}
|
||||
|
||||
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
|
||||
@ -415,7 +415,7 @@ TEST_P(Trans4x4WHT, InvAccuracyCheck) {
|
||||
}
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
@ -427,9 +427,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4HT,
|
||||
::testing::Values(
|
||||
@ -453,9 +453,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht4x4_c, &vp10_iht4x4_16_add_c, 1, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_c, &vp10_iht4x4_16_add_c, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_c, &vp10_iht4x4_16_add_c, 3, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4WHT,
|
||||
::testing::Values(
|
||||
@ -467,17 +467,17 @@ INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4WHT,
|
||||
::testing::Values(
|
||||
make_tuple(&vp10_fwht4x4_c, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_NEON_ASM && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct4x4_c,
|
||||
&vpx_idct4x4_16_add_neon, 0, VPX_BITS_8)));
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_NEON && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans4x4HT,
|
||||
::testing::Values(
|
||||
@ -485,9 +485,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht4x4_c, &vp10_iht4x4_16_add_neon, 1, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_c, &vp10_iht4x4_16_add_neon, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_c, &vp10_iht4x4_16_add_neon, 3, VPX_BITS_8)));
|
||||
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_NEON && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if CONFIG_USE_X86INC && HAVE_MMX && !CONFIG_VP9_HIGHBITDEPTH && \
|
||||
#if CONFIG_USE_X86INC && HAVE_MMX && !CONFIG_VPX_HIGHBITDEPTH && \
|
||||
!CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MMX, Trans4x4WHT,
|
||||
@ -495,7 +495,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fwht4x4_mmx, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if CONFIG_USE_X86INC && HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && \
|
||||
#if CONFIG_USE_X86INC && HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && \
|
||||
!CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4WHT,
|
||||
@ -503,7 +503,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fwht4x4_c, &vpx_iwht4x4_16_add_sse2, 0, VPX_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
@ -517,9 +517,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht4x4_sse2, &vp10_iht4x4_16_add_sse2, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_sse2,
|
||||
&vp10_iht4x4_16_add_sse2, 3, VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
@ -537,9 +537,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht4x4_sse2, &vp10_iht4x4_16_add_c, 1, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_sse2, &vp10_iht4x4_16_add_c, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_sse2, &vp10_iht4x4_16_add_c, 3, VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_SSE2 && CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
@ -551,5 +551,5 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht4x4_msa, &vp10_iht4x4_16_add_msa, 1, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_msa, &vp10_iht4x4_16_add_msa, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht4x4_msa, &vp10_iht4x4_16_add_msa, 3, VPX_BITS_8)));
|
||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
} // namespace
|
||||
|
@ -90,7 +90,7 @@ void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||
vp10_fht8x8_c(in, out, stride, tx_type);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void idct8x8_10(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_64_add_c(in, out, stride, 10);
|
||||
}
|
||||
@ -132,7 +132,7 @@ void idct8x8_64_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_64_add_sse2(in, out, stride, 12);
|
||||
}
|
||||
#endif // HAVE_SSE2
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
class FwdTrans8x8TestBase {
|
||||
public:
|
||||
@ -219,7 +219,7 @@ class FwdTrans8x8TestBase {
|
||||
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]);
|
||||
DECLARE_ALIGNED(16, uint8_t, dst[64]);
|
||||
DECLARE_ALIGNED(16, uint8_t, src[64]);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, uint16_t, dst16[64]);
|
||||
DECLARE_ALIGNED(16, uint16_t, src16[64]);
|
||||
#endif
|
||||
@ -231,7 +231,7 @@ class FwdTrans8x8TestBase {
|
||||
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_;
|
||||
@ -256,7 +256,7 @@ class FwdTrans8x8TestBase {
|
||||
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_));
|
||||
@ -264,7 +264,7 @@ class FwdTrans8x8TestBase {
|
||||
}
|
||||
|
||||
for (int j = 0; j < 64; ++j) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int diff =
|
||||
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
|
||||
#else
|
||||
@ -297,7 +297,7 @@ class FwdTrans8x8TestBase {
|
||||
DECLARE_ALIGNED(16, tran_low_t, ref_temp_block[64]);
|
||||
DECLARE_ALIGNED(16, uint8_t, dst[64]);
|
||||
DECLARE_ALIGNED(16, uint8_t, src[64]);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, uint16_t, dst16[64]);
|
||||
DECLARE_ALIGNED(16, uint16_t, src16[64]);
|
||||
#endif
|
||||
@ -317,7 +317,7 @@ class FwdTrans8x8TestBase {
|
||||
dst[j] = rnd.Rand8() % 2 ? 255 : 0;
|
||||
}
|
||||
test_input_block[j] = src[j] - dst[j];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
if (i == 0) {
|
||||
src16[j] = mask_;
|
||||
@ -341,7 +341,7 @@ class FwdTrans8x8TestBase {
|
||||
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_));
|
||||
@ -349,7 +349,7 @@ class FwdTrans8x8TestBase {
|
||||
}
|
||||
|
||||
for (int j = 0; j < 64; ++j) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int diff =
|
||||
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
|
||||
#else
|
||||
@ -385,7 +385,7 @@ class FwdTrans8x8TestBase {
|
||||
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, src16[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
|
||||
#endif
|
||||
@ -399,7 +399,7 @@ class FwdTrans8x8TestBase {
|
||||
src[j] = rnd.Rand8() % 2 ? 255 : 0;
|
||||
dst[j] = src[j] > 0 ? 0 : 255;
|
||||
in[j] = src[j] - dst[j];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
src16[j] = rnd.Rand8() % 2 ? mask_ : 0;
|
||||
dst16[j] = src16[j] > 0 ? 0 : mask_;
|
||||
@ -414,7 +414,7 @@ class FwdTrans8x8TestBase {
|
||||
|
||||
if (bit_depth_ == VPX_BITS_8) {
|
||||
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
|
||||
pitch_));
|
||||
@ -422,7 +422,7 @@ class FwdTrans8x8TestBase {
|
||||
}
|
||||
|
||||
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
|
||||
@ -472,7 +472,7 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
|
||||
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
|
||||
@ -489,7 +489,7 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
|
||||
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;
|
||||
@ -499,7 +499,7 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
|
||||
if (bit_depth_ == VPX_BITS_8) {
|
||||
ref_txfm(coeff, ref, pitch_);
|
||||
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
|
||||
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
|
||||
@ -508,7 +508,7 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
|
||||
}
|
||||
|
||||
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
|
||||
@ -654,7 +654,7 @@ TEST_P(InvTrans8x8DCT, CompareReference) {
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
@ -666,9 +666,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
C, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c, 0, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
@ -692,17 +692,17 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht8x8_c, &vp10_iht8x8_64_add_c, 1, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht8x8_c, &vp10_iht8x8_64_add_c, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht8x8_c, &vp10_iht8x8_64_add_c, 3, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_NEON_ASM && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_neon, &vpx_idct8x8_64_add_neon, 0,
|
||||
VPX_BITS_8)));
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_NEON && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
@ -710,9 +710,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht8x8_c, &vp10_iht8x8_64_add_neon, 1, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht8x8_c, &vp10_iht8x8_64_add_neon, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht8x8_c, &vp10_iht8x8_64_add_neon, 3, VPX_BITS_8)));
|
||||
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_NEON && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
@ -726,9 +726,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht8x8_sse2, &vp10_iht8x8_64_add_sse2, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht8x8_sse2,
|
||||
&vp10_iht8x8_64_add_sse2, 3, VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
@ -763,10 +763,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&idct8x8_10_add_12_sse2, 6225, VPX_BITS_12),
|
||||
make_tuple(&idct8x8_12,
|
||||
&idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
|
||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_SSE2 && CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC && ARCH_X86_64 && \
|
||||
!CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
!CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
@ -774,7 +774,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
VPX_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
@ -786,5 +786,5 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp10_fht8x8_msa, &vp10_iht8x8_64_add_msa, 1, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht8x8_msa, &vp10_iht8x8_64_add_msa, 2, VPX_BITS_8),
|
||||
make_tuple(&vp10_fht8x8_msa, &vp10_iht8x8_64_add_msa, 3, VPX_BITS_8)));
|
||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
} // namespace
|
||||
|
@ -130,7 +130,7 @@ TEST_P(VP9IntraPredTest, IntraPredTests) {
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#if CONFIG_USE_X86INC
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_8, VP9IntraPredTest,
|
||||
::testing::Values(
|
||||
@ -226,6 +226,6 @@ INSTANTIATE_TEST_CASE_P(SSE2_TO_C_12, VP9IntraPredTest,
|
||||
&vpx_highbd_tm_predictor_8x8_c, 8, 12)));
|
||||
|
||||
#endif // CONFIG_USE_X86INC
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE2
|
||||
} // namespace
|
||||
|
@ -34,7 +34,7 @@ const int kNumCoeffs = 1024;
|
||||
|
||||
const int number_of_iterations = 10000;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
typedef void (*loop_op_t)(uint16_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count, int bd);
|
||||
@ -50,13 +50,13 @@ typedef void (*dual_loop_op_t)(uint8_t *s, int p, const uint8_t *blimit0,
|
||||
const uint8_t *limit0, const uint8_t *thresh0,
|
||||
const uint8_t *blimit1, const uint8_t *limit1,
|
||||
const uint8_t *thresh1);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
typedef std::tr1::tuple<loop_op_t, loop_op_t, int, int> loop8_param_t;
|
||||
typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void wrapper_vertical_16_sse2(uint16_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count, int bd) {
|
||||
@ -104,11 +104,11 @@ void wrapper_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
int count) {
|
||||
vpx_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_NEON_ASM
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
// No neon high bitdepth functions.
|
||||
#else
|
||||
void wrapper_vertical_16_neon(uint8_t *s, int p, const uint8_t *blimit,
|
||||
@ -134,10 +134,10 @@ void wrapper_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
int count) {
|
||||
vpx_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#endif // HAVE_NEON_ASM
|
||||
|
||||
#if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
#if HAVE_MSA && (!CONFIG_VPX_HIGHBITDEPTH)
|
||||
void wrapper_vertical_16_msa(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
@ -149,7 +149,7 @@ void wrapper_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
int count) {
|
||||
vpx_lpf_vertical_16_c(s, p, blimit, limit, thresh);
|
||||
}
|
||||
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
#endif // HAVE_MSA && (!CONFIG_VPX_HIGHBITDEPTH)
|
||||
|
||||
class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
|
||||
public:
|
||||
@ -194,14 +194,14 @@ class Loop8Test9Param : public ::testing::TestWithParam<dualloop8_param_t> {
|
||||
TEST_P(Loop8Test6Param, OperationCheck) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = number_of_iterations;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int32_t bd = bit_depth_;
|
||||
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]);
|
||||
#else
|
||||
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
int err_count_total = 0;
|
||||
int first_failure = -1;
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
@ -252,7 +252,7 @@ TEST_P(Loop8Test6Param, OperationCheck) {
|
||||
}
|
||||
ref_s[j] = s[j];
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, count_, bd);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_, bd));
|
||||
@ -260,7 +260,7 @@ TEST_P(Loop8Test6Param, OperationCheck) {
|
||||
ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh, count_);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
err_count += ref_s[j] != s[j];
|
||||
@ -279,14 +279,14 @@ TEST_P(Loop8Test6Param, OperationCheck) {
|
||||
TEST_P(Loop8Test6Param, ValueCheck) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = number_of_iterations;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int32_t bd = bit_depth_;
|
||||
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]);
|
||||
#else
|
||||
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
int err_count_total = 0;
|
||||
int first_failure = -1;
|
||||
|
||||
@ -324,7 +324,7 @@ TEST_P(Loop8Test6Param, ValueCheck) {
|
||||
s[j] = rnd.Rand16() & mask_;
|
||||
ref_s[j] = s[j];
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, count_, bd);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_, bd));
|
||||
@ -332,7 +332,7 @@ TEST_P(Loop8Test6Param, ValueCheck) {
|
||||
ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh, count_);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
err_count += ref_s[j] != s[j];
|
||||
}
|
||||
@ -350,14 +350,14 @@ TEST_P(Loop8Test6Param, ValueCheck) {
|
||||
TEST_P(Loop8Test9Param, OperationCheck) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = number_of_iterations;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int32_t bd = bit_depth_;
|
||||
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]);
|
||||
#else
|
||||
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
int err_count_total = 0;
|
||||
int first_failure = -1;
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
@ -423,7 +423,7 @@ TEST_P(Loop8Test9Param, OperationCheck) {
|
||||
}
|
||||
ref_s[j] = s[j];
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0,
|
||||
blimit1, limit1, thresh1, bd);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
@ -435,7 +435,7 @@ TEST_P(Loop8Test9Param, OperationCheck) {
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0,
|
||||
blimit1, limit1, thresh1));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
err_count += ref_s[j] != s[j];
|
||||
}
|
||||
@ -453,13 +453,13 @@ TEST_P(Loop8Test9Param, OperationCheck) {
|
||||
TEST_P(Loop8Test9Param, ValueCheck) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = number_of_iterations;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]);
|
||||
#else
|
||||
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
int err_count_total = 0;
|
||||
int first_failure = -1;
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
@ -499,7 +499,7 @@ TEST_P(Loop8Test9Param, ValueCheck) {
|
||||
s[j] = rnd.Rand16() & mask_;
|
||||
ref_s[j] = s[j];
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int32_t bd = bit_depth_;
|
||||
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0,
|
||||
blimit1, limit1, thresh1, bd);
|
||||
@ -512,7 +512,7 @@ TEST_P(Loop8Test9Param, ValueCheck) {
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0,
|
||||
blimit1, limit1, thresh1));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
err_count += ref_s[j] != s[j];
|
||||
}
|
||||
@ -530,7 +530,7 @@ TEST_P(Loop8Test9Param, ValueCheck) {
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
@ -593,10 +593,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&wrapper_vertical_16_sse2, &wrapper_vertical_16_c, 8, 1),
|
||||
make_tuple(&wrapper_vertical_16_dual_sse2,
|
||||
&wrapper_vertical_16_dual_c, 8, 1)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#endif
|
||||
|
||||
#if HAVE_AVX2 && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
#if HAVE_AVX2 && (!CONFIG_VPX_HIGHBITDEPTH)
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX2, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
@ -606,7 +606,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Loop8Test9Param,
|
||||
::testing::Values(
|
||||
@ -646,11 +646,11 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_dual_sse2,
|
||||
&vpx_lpf_vertical_8_dual_c, 8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#endif
|
||||
|
||||
#if HAVE_NEON
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
// No neon high bitdepth functions.
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
@ -689,10 +689,10 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_dual_neon,
|
||||
&vpx_lpf_vertical_4_dual_c, 8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#endif // HAVE_NEON
|
||||
|
||||
#if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
#if HAVE_MSA && (!CONFIG_VPX_HIGHBITDEPTH)
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
@ -713,6 +713,6 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_dual_msa,
|
||||
&vpx_lpf_vertical_8_dual_c, 8)));
|
||||
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
#endif // HAVE_MSA && (!CONFIG_VPX_HIGHBITDEPTH)
|
||||
|
||||
} // namespace
|
||||
|
@ -231,7 +231,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct4x4_1_add_c,
|
||||
TX_4X4, 1)));
|
||||
|
||||
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_NEON && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, PartialIDctTest,
|
||||
::testing::Values(
|
||||
@ -259,9 +259,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct4x4_16_add_c,
|
||||
&vpx_idct4x4_1_add_neon,
|
||||
TX_4X4, 1)));
|
||||
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_NEON && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSE2 && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, PartialIDctTest,
|
||||
::testing::Values(
|
||||
@ -296,7 +296,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
#endif
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC && ARCH_X86_64 && \
|
||||
!CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
!CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3_64, PartialIDctTest,
|
||||
::testing::Values(
|
||||
@ -306,7 +306,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
TX_8X8, 12)));
|
||||
#endif
|
||||
|
||||
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, PartialIDctTest,
|
||||
::testing::Values(
|
||||
@ -338,6 +338,6 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&vpx_idct4x4_16_add_c,
|
||||
&vpx_idct4x4_1_add_msa,
|
||||
TX_4X4, 1)));
|
||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#endif // HAVE_MSA && !CONFIG_VPX_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
} // namespace
|
||||
|
@ -28,7 +28,7 @@
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
namespace {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int number_of_iterations = 100;
|
||||
|
||||
typedef void (*QuantizeFunc)(const tran_low_t *coeff, intptr_t count,
|
||||
@ -100,7 +100,7 @@ TEST_P(VP9QuantizeTest, OperationCheck) {
|
||||
const int skip_block = i == 0;
|
||||
const TX_SIZE sz = (TX_SIZE)(i % 3); // TX_4X4, TX_8X8 TX_16X16
|
||||
const TX_TYPE tx_type = (TX_TYPE)((i >> 2) % 3);
|
||||
const scan_order *scan_order = &vp9_scan_orders[sz][tx_type];
|
||||
const scan_order *scan_order = &vp10_scan_orders[sz][tx_type];
|
||||
const int count = (4 << sz) * (4 << sz); // 16, 64, 256
|
||||
int err_count = 0;
|
||||
*eob_ptr = rnd.Rand16();
|
||||
@ -159,7 +159,7 @@ TEST_P(VP9Quantize32Test, OperationCheck) {
|
||||
const int skip_block = i == 0;
|
||||
const TX_SIZE sz = TX_32X32;
|
||||
const TX_TYPE tx_type = (TX_TYPE)(i % 4);
|
||||
const scan_order *scan_order = &vp9_scan_orders[sz][tx_type];
|
||||
const scan_order *scan_order = &vp10_scan_orders[sz][tx_type];
|
||||
const int count = (4 << sz) * (4 << sz); // 1024
|
||||
int err_count = 0;
|
||||
*eob_ptr = rnd.Rand16();
|
||||
@ -218,7 +218,7 @@ TEST_P(VP9QuantizeTest, EOBCheck) {
|
||||
int skip_block = i == 0;
|
||||
TX_SIZE sz = (TX_SIZE)(i % 3); // TX_4X4, TX_8X8 TX_16X16
|
||||
TX_TYPE tx_type = (TX_TYPE)((i >> 2) % 3);
|
||||
const scan_order *scan_order = &vp9_scan_orders[sz][tx_type];
|
||||
const scan_order *scan_order = &vp10_scan_orders[sz][tx_type];
|
||||
int count = (4 << sz) * (4 << sz); // 16, 64, 256
|
||||
int err_count = 0;
|
||||
*eob_ptr = rnd.Rand16();
|
||||
@ -282,7 +282,7 @@ TEST_P(VP9Quantize32Test, EOBCheck) {
|
||||
int skip_block = i == 0;
|
||||
TX_SIZE sz = TX_32X32;
|
||||
TX_TYPE tx_type = (TX_TYPE)(i % 4);
|
||||
const scan_order *scan_order = &vp9_scan_orders[sz][tx_type];
|
||||
const scan_order *scan_order = &vp10_scan_orders[sz][tx_type];
|
||||
int count = (4 << sz) * (4 << sz); // 1024
|
||||
int err_count = 0;
|
||||
*eob_ptr = rnd.Rand16();
|
||||
@ -347,5 +347,5 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
||||
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_12)));
|
||||
#endif // HAVE_SSE2
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
@ -100,14 +100,14 @@ class SADTestBase : public ::testing::Test {
|
||||
source_data_ = source_data8_;
|
||||
reference_data_ = reference_data8_;
|
||||
second_pred_ = second_pred8_;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
use_high_bit_depth_ = true;
|
||||
bit_depth_ = static_cast<vpx_bit_depth_t>(bd_);
|
||||
source_data_ = CONVERT_TO_BYTEPTR(source_data16_);
|
||||
reference_data_ = CONVERT_TO_BYTEPTR(reference_data16_);
|
||||
second_pred_ = CONVERT_TO_BYTEPTR(second_pred16_);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
mask_ = (1 << bit_depth_) - 1;
|
||||
source_stride_ = (width_ + 31) & ~31;
|
||||
@ -116,11 +116,11 @@ class SADTestBase : public ::testing::Test {
|
||||
}
|
||||
|
||||
virtual uint8_t *GetReference(int block_idx) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (use_high_bit_depth_)
|
||||
return CONVERT_TO_BYTEPTR(CONVERT_TO_SHORTPTR(reference_data_) +
|
||||
block_idx * kDataBlockSize);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
return reference_data_ + block_idx * kDataBlockSize;
|
||||
}
|
||||
|
||||
@ -130,21 +130,21 @@ class SADTestBase : public ::testing::Test {
|
||||
unsigned int sad = 0;
|
||||
const uint8_t *const reference8 = GetReference(block_idx);
|
||||
const uint8_t *const source8 = source_data_;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const uint16_t *const reference16 =
|
||||
CONVERT_TO_SHORTPTR(GetReference(block_idx));
|
||||
const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
for (int h = 0; h < height_; ++h) {
|
||||
for (int w = 0; w < width_; ++w) {
|
||||
if (!use_high_bit_depth_) {
|
||||
sad += abs(source8[h * source_stride_ + w] -
|
||||
reference8[h * reference_stride_ + w]);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
sad += abs(source16[h * source_stride_ + w] -
|
||||
reference16[h * reference_stride_ + w]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -159,12 +159,12 @@ class SADTestBase : public ::testing::Test {
|
||||
const uint8_t *const reference8 = GetReference(block_idx);
|
||||
const uint8_t *const source8 = source_data_;
|
||||
const uint8_t *const second_pred8 = second_pred_;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const uint16_t *const reference16 =
|
||||
CONVERT_TO_SHORTPTR(GetReference(block_idx));
|
||||
const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
|
||||
const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
for (int h = 0; h < height_; ++h) {
|
||||
for (int w = 0; w < width_; ++w) {
|
||||
if (!use_high_bit_depth_) {
|
||||
@ -172,13 +172,13 @@ class SADTestBase : public ::testing::Test {
|
||||
reference8[h * reference_stride_ + w];
|
||||
const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
|
||||
sad += abs(source8[h * source_stride_ + w] - comp_pred);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
const int tmp = second_pred16[h * width_ + w] +
|
||||
reference16[h * reference_stride_ + w];
|
||||
const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
|
||||
sad += abs(source16[h * source_stride_ + w] - comp_pred);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -187,17 +187,17 @@ class SADTestBase : public ::testing::Test {
|
||||
|
||||
void FillConstant(uint8_t *data, int stride, uint16_t fill_constant) {
|
||||
uint8_t *data8 = data;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
uint16_t *data16 = CONVERT_TO_SHORTPTR(data);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
for (int h = 0; h < height_; ++h) {
|
||||
for (int w = 0; w < width_; ++w) {
|
||||
if (!use_high_bit_depth_) {
|
||||
data8[h * stride + w] = static_cast<uint8_t>(fill_constant);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
data16[h * stride + w] = fill_constant;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -205,17 +205,17 @@ class SADTestBase : public ::testing::Test {
|
||||
|
||||
void FillRandom(uint8_t *data, int stride) {
|
||||
uint8_t *data8 = data;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
uint16_t *data16 = CONVERT_TO_SHORTPTR(data);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
for (int h = 0; h < height_; ++h) {
|
||||
for (int w = 0; w < width_; ++w) {
|
||||
if (!use_high_bit_depth_) {
|
||||
data8[h * stride + w] = rnd_.Rand8();
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
data16[h * stride + w] = rnd_.Rand16() & mask_;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -498,7 +498,7 @@ const SadMxNParam c_tests[] = {
|
||||
make_tuple(8, 4, &vpx_sad8x4_c, -1),
|
||||
make_tuple(4, 8, &vpx_sad4x8_c, -1),
|
||||
make_tuple(4, 4, &vpx_sad4x4_c, -1),
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
make_tuple(64, 64, &vpx_highbd_sad64x64_c, 8),
|
||||
make_tuple(64, 32, &vpx_highbd_sad64x32_c, 8),
|
||||
make_tuple(32, 64, &vpx_highbd_sad32x64_c, 8),
|
||||
@ -538,7 +538,7 @@ const SadMxNParam c_tests[] = {
|
||||
make_tuple(8, 4, &vpx_highbd_sad8x4_c, 12),
|
||||
make_tuple(4, 8, &vpx_highbd_sad4x8_c, 12),
|
||||
make_tuple(4, 4, &vpx_highbd_sad4x4_c, 12),
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests));
|
||||
|
||||
@ -556,7 +556,7 @@ const SadMxNAvgParam avg_c_tests[] = {
|
||||
make_tuple(8, 4, &vpx_sad8x4_avg_c, -1),
|
||||
make_tuple(4, 8, &vpx_sad4x8_avg_c, -1),
|
||||
make_tuple(4, 4, &vpx_sad4x4_avg_c, -1),
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
make_tuple(64, 64, &vpx_highbd_sad64x64_avg_c, 8),
|
||||
make_tuple(64, 32, &vpx_highbd_sad64x32_avg_c, 8),
|
||||
make_tuple(32, 64, &vpx_highbd_sad32x64_avg_c, 8),
|
||||
@ -596,7 +596,7 @@ const SadMxNAvgParam avg_c_tests[] = {
|
||||
make_tuple(8, 4, &vpx_highbd_sad8x4_avg_c, 12),
|
||||
make_tuple(4, 8, &vpx_highbd_sad4x8_avg_c, 12),
|
||||
make_tuple(4, 4, &vpx_highbd_sad4x4_avg_c, 12),
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, SADavgTest, ::testing::ValuesIn(avg_c_tests));
|
||||
|
||||
@ -614,7 +614,7 @@ const SadMxNx4Param x4d_c_tests[] = {
|
||||
make_tuple(8, 4, &vpx_sad8x4x4d_c, -1),
|
||||
make_tuple(4, 8, &vpx_sad4x8x4d_c, -1),
|
||||
make_tuple(4, 4, &vpx_sad4x4x4d_c, -1),
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
make_tuple(64, 64, &vpx_highbd_sad64x64x4d_c, 8),
|
||||
make_tuple(64, 32, &vpx_highbd_sad64x32x4d_c, 8),
|
||||
make_tuple(32, 64, &vpx_highbd_sad32x64x4d_c, 8),
|
||||
@ -654,7 +654,7 @@ const SadMxNx4Param x4d_c_tests[] = {
|
||||
make_tuple(8, 4, &vpx_highbd_sad8x4x4d_c, 12),
|
||||
make_tuple(4, 8, &vpx_highbd_sad4x8x4d_c, 12),
|
||||
make_tuple(4, 4, &vpx_highbd_sad4x4x4d_c, 12),
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::ValuesIn(x4d_c_tests));
|
||||
|
||||
@ -726,7 +726,7 @@ const SadMxNParam sse2_tests[] = {
|
||||
make_tuple(8, 4, &vpx_sad8x4_sse2, -1),
|
||||
make_tuple(4, 8, &vpx_sad4x8_sse2, -1),
|
||||
make_tuple(4, 4, &vpx_sad4x4_sse2, -1),
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
make_tuple(64, 64, &vpx_highbd_sad64x64_sse2, 8),
|
||||
make_tuple(64, 32, &vpx_highbd_sad64x32_sse2, 8),
|
||||
make_tuple(32, 64, &vpx_highbd_sad32x64_sse2, 8),
|
||||
@ -760,7 +760,7 @@ const SadMxNParam sse2_tests[] = {
|
||||
make_tuple(8, 16, &vpx_highbd_sad8x16_sse2, 12),
|
||||
make_tuple(8, 8, &vpx_highbd_sad8x8_sse2, 12),
|
||||
make_tuple(8, 4, &vpx_highbd_sad8x4_sse2, 12),
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests));
|
||||
|
||||
@ -778,7 +778,7 @@ const SadMxNAvgParam avg_sse2_tests[] = {
|
||||
make_tuple(8, 4, &vpx_sad8x4_avg_sse2, -1),
|
||||
make_tuple(4, 8, &vpx_sad4x8_avg_sse2, -1),
|
||||
make_tuple(4, 4, &vpx_sad4x4_avg_sse2, -1),
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
make_tuple(64, 64, &vpx_highbd_sad64x64_avg_sse2, 8),
|
||||
make_tuple(64, 32, &vpx_highbd_sad64x32_avg_sse2, 8),
|
||||
make_tuple(32, 64, &vpx_highbd_sad32x64_avg_sse2, 8),
|
||||
@ -812,7 +812,7 @@ const SadMxNAvgParam avg_sse2_tests[] = {
|
||||
make_tuple(8, 16, &vpx_highbd_sad8x16_avg_sse2, 12),
|
||||
make_tuple(8, 8, &vpx_highbd_sad8x8_avg_sse2, 12),
|
||||
make_tuple(8, 4, &vpx_highbd_sad8x4_avg_sse2, 12),
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, SADavgTest, ::testing::ValuesIn(avg_sse2_tests));
|
||||
|
||||
@ -828,7 +828,7 @@ const SadMxNx4Param x4d_sse2_tests[] = {
|
||||
make_tuple(8, 16, &vpx_sad8x16x4d_sse2, -1),
|
||||
make_tuple(8, 8, &vpx_sad8x8x4d_sse2, -1),
|
||||
make_tuple(8, 4, &vpx_sad8x4x4d_sse2, -1),
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
make_tuple(64, 64, &vpx_highbd_sad64x64x4d_sse2, 8),
|
||||
make_tuple(64, 32, &vpx_highbd_sad64x32x4d_sse2, 8),
|
||||
make_tuple(32, 64, &vpx_highbd_sad32x64x4d_sse2, 8),
|
||||
@ -868,7 +868,7 @@ const SadMxNx4Param x4d_sse2_tests[] = {
|
||||
make_tuple(8, 4, &vpx_highbd_sad8x4x4d_sse2, 12),
|
||||
make_tuple(4, 8, &vpx_highbd_sad4x8x4d_sse2, 12),
|
||||
make_tuple(4, 4, &vpx_highbd_sad4x4x4d_sse2, 12),
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::ValuesIn(x4d_sse2_tests));
|
||||
#endif // CONFIG_USE_X86INC
|
||||
|
@ -708,7 +708,7 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-20-big_superframe-01.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-20-big_superframe-01.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-20-big_superframe-02.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-20-big_superframe-02.webm.md5
|
||||
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp92-2-20-10bit-yuv420.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp92-2-20-10bit-yuv420.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp92-2-20-12bit-yuv420.webm
|
||||
@ -725,7 +725,7 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-10bit-yuv444.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-10bit-yuv444.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv444.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv444.webm.md5
|
||||
endif # CONFIG_VP9_HIGHBITDEPTH
|
||||
endif # CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
# Invalid files for testing libvpx error checking.
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-01-v3.webm
|
||||
|
@ -105,7 +105,6 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += dct32x32_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += fdct4x4_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += fdct8x8_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += variance_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += error_block_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += quantize_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += subtract_test.cc
|
||||
|
||||
|
@ -230,12 +230,12 @@ const char *const kVP9TestVectors[] = {
|
||||
"vp90-2-19-skip-01.webm", "vp90-2-19-skip-02.webm",
|
||||
"vp91-2-04-yuv444.webm",
|
||||
"vp91-2-04-yuv422.webm", "vp91-2-04-yuv440.webm",
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
"vp92-2-20-10bit-yuv420.webm", "vp92-2-20-12bit-yuv420.webm",
|
||||
"vp93-2-20-10bit-yuv422.webm", "vp93-2-20-12bit-yuv422.webm",
|
||||
"vp93-2-20-10bit-yuv440.webm", "vp93-2-20-12bit-yuv440.webm",
|
||||
"vp93-2-20-10bit-yuv444.webm", "vp93-2-20-12bit-yuv444.webm",
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
"vp90-2-20-big_superframe-01.webm", "vp90-2-20-big_superframe-02.webm",
|
||||
RESIZE_TEST_VECTORS
|
||||
};
|
||||
|
@ -91,13 +91,13 @@ static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref,
|
||||
src[w * y * src_stride_coeff + x];
|
||||
se += diff;
|
||||
sse += diff * diff;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
diff = CONVERT_TO_SHORTPTR(ref)[w * y * ref_stride_coeff + x] -
|
||||
CONVERT_TO_SHORTPTR(src)[w * y * src_stride_coeff + x];
|
||||
se += diff;
|
||||
sse += diff * diff;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,7 +141,7 @@ static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
|
||||
const int diff = r - src[w * y + x];
|
||||
se += diff;
|
||||
sse += diff * diff;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
|
||||
uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
|
||||
@ -155,7 +155,7 @@ static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
|
||||
const int diff = r - src16[w * y + x];
|
||||
se += diff;
|
||||
sse += diff * diff;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -234,12 +234,12 @@ class VarianceTest
|
||||
if (!use_high_bit_depth_) {
|
||||
src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_ * 2));
|
||||
ref_ = new uint8_t[block_size_ * 2];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
|
||||
vpx_memalign(16, block_size_ * 2 * sizeof(uint16_t))));
|
||||
ref_ = CONVERT_TO_BYTEPTR(new uint16_t[block_size_ * 2]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
ASSERT_TRUE(src_ != NULL);
|
||||
ASSERT_TRUE(ref_ != NULL);
|
||||
@ -249,11 +249,11 @@ class VarianceTest
|
||||
if (!use_high_bit_depth_) {
|
||||
vpx_free(src_);
|
||||
delete[] ref_;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
vpx_free(CONVERT_TO_SHORTPTR(src_));
|
||||
delete[] CONVERT_TO_SHORTPTR(ref_);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
libvpx_test::ClearSystemState();
|
||||
}
|
||||
@ -281,20 +281,20 @@ void VarianceTest<VarianceFunctionType>::ZeroTest() {
|
||||
for (int i = 0; i <= 255; ++i) {
|
||||
if (!use_high_bit_depth_) {
|
||||
memset(src_, i, block_size_);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(src_), i << (bit_depth_ - 8),
|
||||
block_size_);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
for (int j = 0; j <= 255; ++j) {
|
||||
if (!use_high_bit_depth_) {
|
||||
memset(ref_, j, block_size_);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(ref_), j << (bit_depth_ - 8),
|
||||
block_size_);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
unsigned int sse;
|
||||
unsigned int var;
|
||||
@ -312,11 +312,11 @@ void VarianceTest<VarianceFunctionType>::RefTest() {
|
||||
if (!use_high_bit_depth_) {
|
||||
src_[j] = rnd_.Rand8();
|
||||
ref_[j] = rnd_.Rand8();
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() && mask_;
|
||||
CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() && mask_;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
unsigned int sse1, sse2;
|
||||
@ -344,11 +344,11 @@ void VarianceTest<VarianceFunctionType>::RefStrideTest() {
|
||||
if (!use_high_bit_depth_) {
|
||||
src_[src_ind] = rnd_.Rand8();
|
||||
ref_[ref_ind] = rnd_.Rand8();
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() && mask_;
|
||||
CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() && mask_;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
unsigned int sse1, sse2;
|
||||
@ -373,13 +373,13 @@ void VarianceTest<VarianceFunctionType>::OneQuarterTest() {
|
||||
memset(src_, 255, block_size_);
|
||||
memset(ref_, 255, half);
|
||||
memset(ref_ + half, 0, half);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(src_), 255 << (bit_depth_ - 8),
|
||||
block_size_);
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << (bit_depth_ - 8), half);
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
unsigned int sse;
|
||||
unsigned int var;
|
||||
@ -512,7 +512,7 @@ static uint32_t subpel_avg_variance_ref(const uint8_t *ref,
|
||||
const int diff = ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x];
|
||||
se += diff;
|
||||
sse += diff * diff;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
|
||||
uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
|
||||
@ -527,7 +527,7 @@ static uint32_t subpel_avg_variance_ref(const uint8_t *ref,
|
||||
const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x];
|
||||
se += diff;
|
||||
sse += diff * diff;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -566,7 +566,7 @@ class SubpelVarianceTest
|
||||
src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_));
|
||||
sec_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size_));
|
||||
ref_ = new uint8_t[block_size_ + width_ + height_ + 1];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
src_ = CONVERT_TO_BYTEPTR(
|
||||
reinterpret_cast<uint16_t *>(
|
||||
@ -576,7 +576,7 @@ class SubpelVarianceTest
|
||||
vpx_memalign(16, block_size_*sizeof(uint16_t))));
|
||||
ref_ = CONVERT_TO_BYTEPTR(
|
||||
new uint16_t[block_size_ + width_ + height_ + 1]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
ASSERT_TRUE(src_ != NULL);
|
||||
ASSERT_TRUE(sec_ != NULL);
|
||||
@ -588,12 +588,12 @@ class SubpelVarianceTest
|
||||
vpx_free(src_);
|
||||
delete[] ref_;
|
||||
vpx_free(sec_);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
vpx_free(CONVERT_TO_SHORTPTR(src_));
|
||||
delete[] CONVERT_TO_SHORTPTR(ref_);
|
||||
vpx_free(CONVERT_TO_SHORTPTR(sec_));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
libvpx_test::ClearSystemState();
|
||||
}
|
||||
@ -625,7 +625,7 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
|
||||
for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
|
||||
ref_[j] = rnd_.Rand8();
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
for (int j = 0; j < block_size_; j++) {
|
||||
CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_;
|
||||
@ -633,7 +633,7 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
|
||||
for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
|
||||
CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
unsigned int sse1, sse2;
|
||||
unsigned int var1;
|
||||
@ -663,14 +663,14 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
|
||||
memset(src_ + half, 255, half);
|
||||
memset(ref_, 255, half);
|
||||
memset(ref_ + half, 0, half + width_ + height_ + 1);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(src_), mask_, half);
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half);
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half);
|
||||
vpx_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask_,
|
||||
half + width_ + height_ + 1);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
unsigned int sse1, sse2;
|
||||
unsigned int var1;
|
||||
@ -697,7 +697,7 @@ void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() {
|
||||
for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
|
||||
ref_[j] = rnd_.Rand8();
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
for (int j = 0; j < block_size_; j++) {
|
||||
CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask_;
|
||||
@ -706,7 +706,7 @@ void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() {
|
||||
for (int j = 0; j < block_size_ + width_ + height_ + 1; j++) {
|
||||
CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask_;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
unsigned int sse1, sse2;
|
||||
unsigned int var1;
|
||||
@ -805,7 +805,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(2, 3, &vpx_sub_pixel_avg_variance4x8_c, 0),
|
||||
make_tuple(2, 2, &vpx_sub_pixel_avg_variance4x4_c, 0)));
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
typedef MseTest<VarianceMxNFunc> VpxHBDMseTest;
|
||||
typedef VarianceTest<VarianceMxNFunc> VpxHBDVarianceTest;
|
||||
typedef SubpelVarianceTest<SubpixVarMxNFunc> VpxHBDSubpelVarianceTest;
|
||||
@ -966,7 +966,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(3, 2, &vpx_highbd_12_sub_pixel_avg_variance8x4_c, 12),
|
||||
make_tuple(2, 3, &vpx_highbd_12_sub_pixel_avg_variance4x8_c, 12),
|
||||
make_tuple(2, 2, &vpx_highbd_12_sub_pixel_avg_variance4x4_c, 12)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_MMX
|
||||
INSTANTIATE_TEST_CASE_P(MMX, VpxMseTest,
|
||||
@ -1053,7 +1053,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(2, 2, &vpx_sub_pixel_avg_variance4x4_sse, 0)));
|
||||
#endif // CONFIG_USE_X86INC
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
/* TODO(debargha): This test does not support the highbd version
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, VpxHBDMseTest,
|
||||
@ -1179,7 +1179,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(3, 3, &vpx_highbd_8_sub_pixel_avg_variance8x8_sse2, 8),
|
||||
make_tuple(3, 2, &vpx_highbd_8_sub_pixel_avg_variance8x4_sse2, 8)));
|
||||
#endif // CONFIG_USE_X86INC
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSSE3
|
||||
|
@ -270,7 +270,7 @@ double sse_to_psnr(double samples, double peak, double sse) {
|
||||
}
|
||||
|
||||
// TODO(debargha): Consolidate the functions below into a separate file.
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void highbd_img_upshift(vpx_image_t *dst, vpx_image_t *src,
|
||||
int input_shift) {
|
||||
// Note the offset is 1 less than half.
|
||||
@ -483,4 +483,4 @@ void vpx_img_downshift(vpx_image_t *dst, vpx_image_t *src,
|
||||
lowbd_img_downshift(dst, src, down_shift);
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -151,7 +151,7 @@ int vpx_img_read(vpx_image_t *img, FILE *file);
|
||||
|
||||
double sse_to_psnr(double samples, double peak, double mse);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_img_upshift(vpx_image_t *dst, vpx_image_t *src, int input_shift);
|
||||
void vpx_img_downshift(vpx_image_t *dst, vpx_image_t *src, int down_shift);
|
||||
void vpx_img_truncate_16_to_8(vpx_image_t *dst, vpx_image_t *src);
|
||||
|
@ -192,7 +192,7 @@ typedef struct macroblockd {
|
||||
PARTITION_CONTEXT *above_seg_context;
|
||||
PARTITION_CONTEXT left_seg_context[8];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
/* Bit depth: 8, 10, 12 */
|
||||
int bd;
|
||||
#endif
|
||||
|
@ -35,7 +35,7 @@ const vpx_prob vp10_cat5_prob[] = { 180, 157, 141, 134, 130 };
|
||||
const vpx_prob vp10_cat6_prob[] = {
|
||||
254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129
|
||||
};
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const vpx_prob vp10_cat1_prob_high10[] = { 159 };
|
||||
const vpx_prob vp10_cat2_prob_high10[] = { 165, 145 };
|
||||
const vpx_prob vp10_cat3_prob_high10[] = { 173, 148, 140 };
|
||||
|
@ -59,7 +59,7 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat4_prob[4]);
|
||||
DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat5_prob[5]);
|
||||
DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat6_prob[14]);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat1_prob_high10[1]);
|
||||
DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat2_prob_high10[2]);
|
||||
DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat3_prob_high10[3]);
|
||||
@ -72,7 +72,7 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat3_prob_high12[3]);
|
||||
DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat4_prob_high12[4]);
|
||||
DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat5_prob_high12[5]);
|
||||
DECLARE_ALIGNED(16, extern const uint8_t, vp10_cat6_prob_high12[18]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#define EOB_MODEL_TOKEN 3
|
||||
|
||||
@ -86,16 +86,16 @@ typedef struct {
|
||||
|
||||
// indexed by token value
|
||||
extern const vp10_extra_bit vp10_extra_bits[ENTROPY_TOKENS];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
extern const vp10_extra_bit vp10_extra_bits_high10[ENTROPY_TOKENS];
|
||||
extern const vp10_extra_bit vp10_extra_bits_high12[ENTROPY_TOKENS];
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#define DCT_MAX_VALUE 16384
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#define DCT_MAX_VALUE_HIGH10 65536
|
||||
#define DCT_MAX_VALUE_HIGH12 262144
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
/* Coefficients are predicted via a 3-dimensional probability table. */
|
||||
|
||||
|
@ -251,7 +251,7 @@ void vp10_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest8,
|
||||
int stride, int tx_type, int bd) {
|
||||
const highbd_transform_2d IHT_4[] = {
|
||||
@ -495,4 +495,4 @@ void vp10_highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -30,13 +30,13 @@ typedef struct {
|
||||
transform_1d cols, rows; // vertical and horizontal
|
||||
} transform_2d;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
typedef void (*highbd_transform_1d)(const tran_low_t*, tran_low_t*, int bd);
|
||||
|
||||
typedef struct {
|
||||
highbd_transform_1d cols, rows; // vertical and horizontal
|
||||
} highbd_transform_2d;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
|
||||
int eob);
|
||||
@ -52,7 +52,7 @@ void vp10_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
|
||||
void vp10_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest,
|
||||
int stride, int eob, TX_TYPE tx_type);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
|
||||
int eob, int bd);
|
||||
void vp10_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
|
||||
@ -74,7 +74,7 @@ void vp10_highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
|
||||
void vp10_highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest,
|
||||
int stride, int eob, int bd,
|
||||
TX_TYPE tx_type);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
@ -395,7 +395,7 @@ static void filter_selectively_vert_row2(int subsampling_factor,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void highbd_filter_selectively_vert_row2(int subsampling_factor,
|
||||
uint16_t *s, int pitch,
|
||||
unsigned int mask_16x16_l,
|
||||
@ -494,7 +494,7 @@ static void highbd_filter_selectively_vert_row2(int subsampling_factor,
|
||||
mask_4x4_int_1 >>= 1;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static void filter_selectively_horiz(uint8_t *s, int pitch,
|
||||
unsigned int mask_16x16,
|
||||
@ -592,7 +592,7 @@ static void filter_selectively_horiz(uint8_t *s, int pitch,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void highbd_filter_selectively_horiz(uint16_t *s, int pitch,
|
||||
unsigned int mask_16x16,
|
||||
unsigned int mask_8x8,
|
||||
@ -696,7 +696,7 @@ static void highbd_filter_selectively_horiz(uint16_t *s, int pitch,
|
||||
mask_4x4_int >>= count;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// This function ors into the current lfm structure, where to do loop
|
||||
// filters for the specific mi we are looking at. It uses information
|
||||
@ -1143,7 +1143,7 @@ static void filter_selectively_vert(uint8_t *s, int pitch,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void highbd_filter_selectively_vert(uint16_t *s, int pitch,
|
||||
unsigned int mask_16x16,
|
||||
unsigned int mask_8x8,
|
||||
@ -1180,7 +1180,7 @@ static void highbd_filter_selectively_vert(uint16_t *s, int pitch,
|
||||
mask_4x4_int >>= 1;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_filter_block_plane_non420(VP10_COMMON *cm,
|
||||
struct macroblockd_plane *plane,
|
||||
@ -1280,7 +1280,7 @@ void vp10_filter_block_plane_non420(VP10_COMMON *cm,
|
||||
|
||||
// Disable filtering on the leftmost column
|
||||
border_mask = ~(mi_col == 0);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
highbd_filter_selectively_vert(CONVERT_TO_SHORTPTR(dst->buf),
|
||||
dst->stride,
|
||||
@ -1305,7 +1305,7 @@ void vp10_filter_block_plane_non420(VP10_COMMON *cm,
|
||||
mask_4x4_c & border_mask,
|
||||
mask_4x4_int[r],
|
||||
&cm->lf_info, &lfl[r << 3]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
dst->buf += 8 * dst->stride;
|
||||
mi_8x8 += row_step_stride;
|
||||
}
|
||||
@ -1329,7 +1329,7 @@ void vp10_filter_block_plane_non420(VP10_COMMON *cm,
|
||||
mask_8x8_r = mask_8x8[r];
|
||||
mask_4x4_r = mask_4x4[r];
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
highbd_filter_selectively_horiz(CONVERT_TO_SHORTPTR(dst->buf),
|
||||
dst->stride,
|
||||
@ -1354,7 +1354,7 @@ void vp10_filter_block_plane_non420(VP10_COMMON *cm,
|
||||
mask_4x4_r,
|
||||
mask_4x4_int_r,
|
||||
&cm->lf_info, &lfl[r << 3]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
dst->buf += 8 * dst->stride;
|
||||
}
|
||||
}
|
||||
@ -1381,7 +1381,7 @@ void vp10_filter_block_plane_ss00(VP10_COMMON *const cm,
|
||||
unsigned int mask_4x4_int_l = mask_4x4_int & 0xffff;
|
||||
|
||||
// Disable filtering on the leftmost column.
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
highbd_filter_selectively_vert_row2(
|
||||
plane->subsampling_x, CONVERT_TO_SHORTPTR(dst->buf), dst->stride,
|
||||
@ -1396,7 +1396,7 @@ void vp10_filter_block_plane_ss00(VP10_COMMON *const cm,
|
||||
filter_selectively_vert_row2(
|
||||
plane->subsampling_x, dst->buf, dst->stride, mask_16x16_l, mask_8x8_l,
|
||||
mask_4x4_l, mask_4x4_int_l, &cm->lf_info, &lfm->lfl_y[r << 3]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
dst->buf += 16 * dst->stride;
|
||||
mask_16x16 >>= 16;
|
||||
mask_8x8 >>= 16;
|
||||
@ -1426,7 +1426,7 @@ void vp10_filter_block_plane_ss00(VP10_COMMON *const cm,
|
||||
mask_4x4_r = mask_4x4 & 0xff;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
highbd_filter_selectively_horiz(
|
||||
CONVERT_TO_SHORTPTR(dst->buf), dst->stride, mask_16x16_r, mask_8x8_r,
|
||||
@ -1441,7 +1441,7 @@ void vp10_filter_block_plane_ss00(VP10_COMMON *const cm,
|
||||
filter_selectively_horiz(dst->buf, dst->stride, mask_16x16_r, mask_8x8_r,
|
||||
mask_4x4_r, mask_4x4_int & 0xff, &cm->lf_info,
|
||||
&lfm->lfl_y[r << 3]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
dst->buf += 8 * dst->stride;
|
||||
mask_16x16 >>= 8;
|
||||
@ -1486,7 +1486,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
|
||||
unsigned int mask_4x4_int_l = mask_4x4_int & 0xff;
|
||||
|
||||
// Disable filtering on the leftmost column.
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
highbd_filter_selectively_vert_row2(
|
||||
plane->subsampling_x, CONVERT_TO_SHORTPTR(dst->buf), dst->stride,
|
||||
@ -1503,7 +1503,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
|
||||
plane->subsampling_x, dst->buf, dst->stride,
|
||||
mask_16x16_l, mask_8x8_l, mask_4x4_l, mask_4x4_int_l, &cm->lf_info,
|
||||
&lfm->lfl_uv[r << 1]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
dst->buf += 16 * dst->stride;
|
||||
mask_16x16 >>= 8;
|
||||
@ -1542,7 +1542,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
|
||||
mask_4x4_r = mask_4x4 & 0xf;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
highbd_filter_selectively_horiz(CONVERT_TO_SHORTPTR(dst->buf),
|
||||
dst->stride, mask_16x16_r, mask_8x8_r,
|
||||
@ -1557,7 +1557,7 @@ void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
|
||||
filter_selectively_horiz(dst->buf, dst->stride, mask_16x16_r, mask_8x8_r,
|
||||
mask_4x4_r, mask_4x4_int_r, &cm->lf_info,
|
||||
&lfm->lfl_uv[r << 1]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
dst->buf += 8 * dst->stride;
|
||||
mask_16x16 >>= 4;
|
||||
|
@ -143,7 +143,7 @@ typedef struct VP10Common {
|
||||
int subsampling_x;
|
||||
int subsampling_y;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth; // Marks if we need to use 16bit frame buffers.
|
||||
#endif
|
||||
|
||||
|
@ -154,7 +154,7 @@ void vp10_post_proc_down_and_across_c(const uint8_t *src_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr,
|
||||
uint16_t *dst_ptr,
|
||||
int src_pixels_per_line,
|
||||
@ -227,7 +227,7 @@ void vp10_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr,
|
||||
dst_ptr += dst_pixels_per_line;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static int q2mbl(int x) {
|
||||
if (x < 20) x = 20;
|
||||
@ -271,7 +271,7 @@ void vp10_mbpost_proc_across_ip_c(uint8_t *src, int pitch,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_mbpost_proc_across_ip_c(uint16_t *src, int pitch,
|
||||
int rows, int cols, int flimit) {
|
||||
int r, c, i;
|
||||
@ -309,7 +309,7 @@ void vp10_highbd_mbpost_proc_across_ip_c(uint16_t *src, int pitch,
|
||||
s += pitch;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_mbpost_proc_down_c(uint8_t *dst, int pitch,
|
||||
int rows, int cols, int flimit) {
|
||||
@ -343,7 +343,7 @@ void vp10_mbpost_proc_down_c(uint8_t *dst, int pitch,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_mbpost_proc_down_c(uint16_t *dst, int pitch,
|
||||
int rows, int cols, int flimit) {
|
||||
int r, c, i;
|
||||
@ -375,7 +375,7 @@ void vp10_highbd_mbpost_proc_down_c(uint16_t *dst, int pitch,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static void deblock_and_de_macro_block(YV12_BUFFER_CONFIG *source,
|
||||
YV12_BUFFER_CONFIG *post,
|
||||
@ -387,7 +387,7 @@ static void deblock_and_de_macro_block(YV12_BUFFER_CONFIG *source,
|
||||
(void) low_var_thresh;
|
||||
(void) flag;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (source->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vp10_highbd_post_proc_down_and_across(CONVERT_TO_SHORTPTR(source->y_buffer),
|
||||
CONVERT_TO_SHORTPTR(post->y_buffer),
|
||||
@ -448,7 +448,7 @@ static void deblock_and_de_macro_block(YV12_BUFFER_CONFIG *source,
|
||||
vp10_post_proc_down_and_across(source->v_buffer, post->v_buffer,
|
||||
source->uv_stride, post->uv_stride,
|
||||
source->uv_height, source->uv_width, ppl);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
void vp10_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
|
||||
@ -466,7 +466,7 @@ void vp10_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
|
||||
const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride};
|
||||
|
||||
for (i = 0; i < MAX_MB_PLANE; ++i) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
assert((src->flags & YV12_FLAG_HIGHBITDEPTH) ==
|
||||
(dst->flags & YV12_FLAG_HIGHBITDEPTH));
|
||||
if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
@ -483,7 +483,7 @@ void vp10_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
|
||||
vp10_post_proc_down_and_across(srcs[i], dsts[i],
|
||||
src_strides[i], dst_strides[i],
|
||||
src_heights[i], src_widths[i], ppl);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
|
||||
@ -507,7 +507,7 @@ void vp10_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
|
||||
const int src_height = src_heights[i] - 4;
|
||||
const int dst_stride = dst_strides[i];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
assert((src->flags & YV12_FLAG_HIGHBITDEPTH) ==
|
||||
(dst->flags & YV12_FLAG_HIGHBITDEPTH));
|
||||
if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
@ -662,9 +662,9 @@ int vp10_post_proc_frame(struct VP10Common *cm,
|
||||
|
||||
if (vpx_alloc_frame_buffer(&cm->post_proc_buffer_int, width, height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
VPX_ENC_BORDER_IN_PIXELS,
|
||||
cm->byte_alignment) < 0) {
|
||||
vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
|
||||
@ -680,7 +680,7 @@ int vp10_post_proc_frame(struct VP10Common *cm,
|
||||
|
||||
if (vpx_realloc_frame_buffer(&cm->post_proc_buffer, cm->width, cm->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_DEC_BORDER_IN_PIXELS, cm->byte_alignment,
|
||||
|
@ -47,7 +47,7 @@ static const int16_t dc_qlookup[QINDEX_RANGE] = {
|
||||
1022, 1058, 1098, 1139, 1184, 1232, 1282, 1336,
|
||||
};
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static const int16_t dc_qlookup_10[QINDEX_RANGE] = {
|
||||
4, 9, 10, 13, 15, 17, 20, 22,
|
||||
25, 28, 31, 34, 37, 40, 43, 47,
|
||||
@ -154,7 +154,7 @@ static const int16_t ac_qlookup[QINDEX_RANGE] = {
|
||||
1597, 1628, 1660, 1692, 1725, 1759, 1793, 1828,
|
||||
};
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static const int16_t ac_qlookup_10[QINDEX_RANGE] = {
|
||||
4, 9, 11, 13, 16, 18, 21, 24,
|
||||
27, 30, 33, 37, 40, 44, 48, 51,
|
||||
@ -227,7 +227,7 @@ static const int16_t ac_qlookup_12[QINDEX_RANGE] = {
|
||||
#endif
|
||||
|
||||
int16_t vp10_dc_quant(int qindex, int delta, vpx_bit_depth_t bit_depth) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
return dc_qlookup[clamp(qindex + delta, 0, MAXQ)];
|
||||
@ -246,7 +246,7 @@ int16_t vp10_dc_quant(int qindex, int delta, vpx_bit_depth_t bit_depth) {
|
||||
}
|
||||
|
||||
int16_t vp10_ac_quant(int qindex, int delta, vpx_bit_depth_t bit_depth) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
return ac_qlookup[clamp(qindex + delta, 0, MAXQ)];
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "vp10/common/reconinter.h"
|
||||
#include "vp10/common/reconintra.h"
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_build_inter_predictor(const uint8_t *src, int src_stride,
|
||||
uint8_t *dst, int dst_stride,
|
||||
const MV *src_mv,
|
||||
@ -40,7 +40,7 @@ void vp10_highbd_build_inter_predictor(const uint8_t *src, int src_stride,
|
||||
high_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y,
|
||||
sf, w, h, ref, kernel, sf->x_step_q4, sf->y_step_q4, bd);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_build_inter_predictor(const uint8_t *src, int src_stride,
|
||||
uint8_t *dst, int dst_stride,
|
||||
@ -112,7 +112,7 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
|
||||
pre += (scaled_mv.row >> SUBPEL_BITS) * pre_buf->stride
|
||||
+ (scaled_mv.col >> SUBPEL_BITS);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
high_inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride,
|
||||
subpel_x, subpel_y, sf, w, h, ref, kernel, xs, ys,
|
||||
@ -124,7 +124,7 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
|
||||
#else
|
||||
inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride,
|
||||
subpel_x, subpel_y, sf, w, h, ref, kernel, xs, ys);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ void vp10_build_inter_predictor_sub8x8(MACROBLOCKD *xd, int plane,
|
||||
for (ref = 0; ref < 1 + is_compound; ++ref) {
|
||||
const uint8_t *pre =
|
||||
&pd->pre[ref].buf[(ir * pd->pre[ref].stride + ic) << 2];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vp10_highbd_build_inter_predictor(pre, pd->pre[ref].stride,
|
||||
dst, pd->dst.stride,
|
||||
@ -171,7 +171,7 @@ void vp10_build_inter_predictor_sub8x8(MACROBLOCKD *xd, int plane,
|
||||
kernel, MV_PRECISION_Q3,
|
||||
mi_col * MI_SIZE + 4 * ic,
|
||||
mi_row * MI_SIZE + 4 * ir);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
|
||||
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE void high_inter_predictor(const uint8_t *src, int src_stride,
|
||||
uint8_t *dst, int dst_stride,
|
||||
const int subpel_x,
|
||||
@ -46,7 +46,7 @@ static INLINE void high_inter_predictor(const uint8_t *src, int src_stride,
|
||||
src, src_stride, dst, dst_stride,
|
||||
kernel[subpel_x], xs, kernel[subpel_y], ys, w, h, bd);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static INLINE int round_mv_comp_q4(int value) {
|
||||
return (value < 0 ? value - 2 : value + 2) / 4;
|
||||
@ -156,7 +156,7 @@ void vp10_build_inter_predictor(const uint8_t *src, int src_stride,
|
||||
enum mv_precision precision,
|
||||
int x, int y);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_build_inter_predictor(const uint8_t *src, int src_stride,
|
||||
uint8_t *dst, int dst_stride,
|
||||
const MV *mv_q3,
|
||||
|
@ -11,9 +11,9 @@
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#include "vpx_dsp/vpx_dsp_common.h"
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "vpx_ports/mem.h"
|
||||
#include "vpx_ports/vpx_once.h"
|
||||
@ -196,13 +196,13 @@ typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride,
|
||||
static intra_pred_fn pred[INTRA_MODES][TX_SIZES];
|
||||
static intra_pred_fn dc_pred[2][2][TX_SIZES];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
typedef void (*intra_high_pred_fn)(uint16_t *dst, ptrdiff_t stride,
|
||||
const uint16_t *above, const uint16_t *left,
|
||||
int bd);
|
||||
static intra_high_pred_fn pred_high[INTRA_MODES][4];
|
||||
static intra_high_pred_fn dc_pred_high[2][2][4];
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static void vp10_init_intra_predictors_internal(void) {
|
||||
#define INIT_NO_4X4(p, type) \
|
||||
@ -235,7 +235,7 @@ static void vp10_init_intra_predictors_internal(void) {
|
||||
INIT_ALL_SIZES(dc_pred[1][0], dc_left);
|
||||
INIT_ALL_SIZES(dc_pred[1][1], dc);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
INIT_ALL_SIZES(pred_high[V_PRED], highbd_v);
|
||||
INIT_ALL_SIZES(pred_high[H_PRED], highbd_h);
|
||||
#if CONFIG_MISC_FIXES
|
||||
@ -256,7 +256,7 @@ static void vp10_init_intra_predictors_internal(void) {
|
||||
INIT_ALL_SIZES(dc_pred_high[0][1], highbd_dc_top);
|
||||
INIT_ALL_SIZES(dc_pred_high[1][0], highbd_dc_left);
|
||||
INIT_ALL_SIZES(dc_pred_high[1][1], highbd_dc);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#undef intra_pred_allsizes
|
||||
}
|
||||
@ -268,7 +268,7 @@ static INLINE void memset16(uint16_t *dst, int val, int n) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void build_intra_predictors_high(const MACROBLOCKD *xd,
|
||||
const uint8_t *ref8,
|
||||
int ref_stride,
|
||||
@ -501,7 +501,7 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
|
||||
xd->bd);
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
|
||||
int ref_stride, uint8_t *dst, int dst_stride,
|
||||
@ -754,7 +754,7 @@ void vp10_predict_intra_block(const MACROBLOCKD *xd, int bwl_in, int bhl_in,
|
||||
#endif // CONFIG_MISC_FIXES
|
||||
|
||||
#if CONFIG_MISC_FIXES
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
build_intra_predictors_high(xd, ref, ref_stride, dst, dst_stride, mode,
|
||||
tx_size,
|
||||
@ -775,7 +775,7 @@ void vp10_predict_intra_block(const MACROBLOCKD *xd, int bwl_in, int bhl_in,
|
||||
x, y, plane);
|
||||
#else // CONFIG_MISC_FIXES
|
||||
(void) bhl_in;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
build_intra_predictors_high(xd, ref, ref_stride, dst, dst_stride, mode,
|
||||
tx_size, have_top, have_left, have_right,
|
||||
|
@ -44,7 +44,7 @@ MV32 vp10_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf) {
|
||||
return res;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_setup_scale_factors_for_frame(struct scale_factors *sf,
|
||||
int other_w, int other_h,
|
||||
int this_w, int this_h,
|
||||
@ -119,7 +119,7 @@ void vp10_setup_scale_factors_for_frame(struct scale_factors *sf,
|
||||
// 2D subpel motion always gets filtered in both directions
|
||||
sf->predict[1][1][0] = vpx_convolve8;
|
||||
sf->predict[1][1][1] = vpx_convolve8_avg;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (use_highbd) {
|
||||
if (sf->x_step_q4 == 16) {
|
||||
if (sf->y_step_q4 == 16) {
|
||||
|
@ -32,14 +32,14 @@ struct scale_factors {
|
||||
int (*scale_value_y)(int val, const struct scale_factors *sf);
|
||||
|
||||
convolve_fn_t predict[2][2][2]; // horiz, vert, avg
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
highbd_convolve_fn_t highbd_predict[2][2][2]; // horiz, vert, avg
|
||||
#endif
|
||||
};
|
||||
|
||||
MV32 vp10_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_setup_scale_factors_for_frame(struct scale_factors *sf,
|
||||
int other_w, int other_h,
|
||||
int this_w, int this_h,
|
||||
|
@ -781,7 +781,7 @@ void vp10_fdct32x32_1_c(const int16_t *input, tran_low_t *output, int stride) {
|
||||
output[1] = 0;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_fdct4x4_c(const int16_t *input, tran_low_t *output,
|
||||
int stride) {
|
||||
vp10_fdct4x4_c(input, output, stride);
|
||||
@ -821,4 +821,4 @@ void vp10_highbd_fdct32x32_1_c(const int16_t *input,
|
||||
tran_low_t *out, int stride) {
|
||||
vp10_fdct32x32_1_c(input, out, stride);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -1245,7 +1245,7 @@ void vp10_idct32x32_1_add_c(const tran_low_t *input,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest8,
|
||||
int stride, int bd) {
|
||||
/* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds,
|
||||
@ -2496,4 +2496,4 @@ void vp10_highbd_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest8,
|
||||
dest += stride;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -40,7 +40,7 @@ static INLINE tran_low_t dct_const_round_shift(tran_high_t input) {
|
||||
return check_range(rv);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE tran_low_t highbd_check_range(tran_high_t input,
|
||||
int bd) {
|
||||
#if CONFIG_COEFFICIENT_RANGE_CHECKING
|
||||
@ -64,7 +64,7 @@ static INLINE tran_low_t highbd_dct_const_round_shift(tran_high_t input,
|
||||
tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
|
||||
return highbd_check_range(rv, bd);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_EMULATE_HARDWARE
|
||||
// When CONFIG_EMULATE_HARDWARE is 1 the transform performs a
|
||||
@ -96,7 +96,7 @@ void vp10_iadst4_c(const tran_low_t *input, tran_low_t *output);
|
||||
void vp10_iadst8_c(const tran_low_t *input, tran_low_t *output);
|
||||
void vp10_iadst16_c(const tran_low_t *input, tran_low_t *output);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_idct4_c(const tran_low_t *input, tran_low_t *output, int bd);
|
||||
void vp10_highbd_idct8_c(const tran_low_t *input, tran_low_t *output, int bd);
|
||||
void vp10_highbd_idct16_c(const tran_low_t *input, tran_low_t *output, int bd);
|
||||
|
@ -84,7 +84,7 @@ specialize qw/vp10_filter_by_weight8x8 sse2 msa/;
|
||||
#
|
||||
# dct
|
||||
#
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
# Note as optimized versions of these functions are added we need to add a check to ensure
|
||||
# that when CONFIG_EMULATE_HARDWARE is on, it defaults to the C versions only.
|
||||
if (vpx_config("CONFIG_EMULATE_HARDWARE") eq "yes") {
|
||||
@ -286,7 +286,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
}
|
||||
|
||||
# High bitdepth functions
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
#
|
||||
# Sub Pixel Filters
|
||||
#
|
||||
@ -361,7 +361,7 @@ if (vpx_config("CONFIG_VP9_TEMPORAL_DENOISING") eq "yes") {
|
||||
specialize qw/vp10_denoiser_filter sse2/;
|
||||
}
|
||||
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
# the transform coefficients are held in 32-bit
|
||||
# values, so the assembler code for vp10_block_error can no longer be used.
|
||||
add_proto qw/int64_t vp10_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz";
|
||||
@ -394,7 +394,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
|
||||
# fdct functions
|
||||
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/void vp10_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
|
||||
specialize qw/vp10_fht4x4 sse2/;
|
||||
|
||||
@ -421,7 +421,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
}
|
||||
|
||||
# Inverse transform
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
# Note as optimized versions of these functions are added we need to add a check to ensure
|
||||
# that when CONFIG_EMULATE_HARDWARE is on, it defaults to the C versions only.
|
||||
add_proto qw/void vp10_idct4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
|
||||
@ -600,7 +600,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/void vp10_iwht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
|
||||
specialize qw/vp10_iwht4x4_16_add/;
|
||||
} # CONFIG_EMULATE_HARDWARE
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#
|
||||
# Motion search
|
||||
@ -619,7 +619,7 @@ specialize qw/vp10_full_range_search/;
|
||||
add_proto qw/void vp10_temporal_filter_apply/, "uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count";
|
||||
specialize qw/vp10_temporal_filter_apply sse2 msa/;
|
||||
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
|
||||
# ENCODEMB INVOKE
|
||||
|
||||
|
@ -246,7 +246,7 @@ void vp10_fdct32x32_1_sse2(const int16_t *input, tran_low_t *output,
|
||||
#undef FDCT32x32_HIGH_PRECISION
|
||||
#undef DCT_HIGH_BIT_DEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#define DCT_HIGH_BIT_DEPTH 1
|
||||
#define FDCT4x4_2D vp10_highbd_fdct4x4_sse2
|
||||
#define FDCT8x8_2D vp10_highbd_fdct8x8_sse2
|
||||
@ -268,4 +268,4 @@ void vp10_fdct32x32_1_sse2(const int16_t *input, tran_low_t *output,
|
||||
#undef FDCT32x32_2D
|
||||
#undef FDCT32x32_HIGH_PRECISION
|
||||
#undef DCT_HIGH_BIT_DEPTH
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -3488,7 +3488,7 @@ void vp10_idct32x32_1_add_sse2(const int16_t *input,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE __m128i clamp_high_sse2(__m128i value, int bd) {
|
||||
__m128i ubounded, retval;
|
||||
const __m128i zero = _mm_set1_epi16(0);
|
||||
@ -4055,4 +4055,4 @@ void vp10_highbd_idct16x16_10_add_sse2(const tran_low_t *input, uint8_t *dest8,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -218,7 +218,7 @@ static void inverse_transform_block_inter(MACROBLOCKD* xd, int plane,
|
||||
const int seg_id = xd->mi[0]->mbmi.segment_id;
|
||||
if (eob > 0) {
|
||||
tran_low_t *const dqcoeff = pd->dqcoeff;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
switch (tx_size) {
|
||||
case TX_4X4:
|
||||
@ -242,7 +242,7 @@ static void inverse_transform_block_inter(MACROBLOCKD* xd, int plane,
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (tx_size) {
|
||||
case TX_4X4:
|
||||
vp10_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, tx_type,
|
||||
@ -261,9 +261,9 @@ static void inverse_transform_block_inter(MACROBLOCKD* xd, int plane,
|
||||
assert(0 && "Invalid transform size");
|
||||
return;
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
if (eob == 1) {
|
||||
dqcoeff[0] = 0;
|
||||
@ -287,7 +287,7 @@ static void inverse_transform_block_intra(MACROBLOCKD* xd, int plane,
|
||||
const int seg_id = xd->mi[0]->mbmi.segment_id;
|
||||
if (eob > 0) {
|
||||
tran_low_t *const dqcoeff = pd->dqcoeff;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
switch (tx_size) {
|
||||
case TX_4X4:
|
||||
@ -311,7 +311,7 @@ static void inverse_transform_block_intra(MACROBLOCKD* xd, int plane,
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (tx_size) {
|
||||
case TX_4X4:
|
||||
vp10_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, tx_type,
|
||||
@ -330,9 +330,9 @@ static void inverse_transform_block_intra(MACROBLOCKD* xd, int plane,
|
||||
assert(0 && "Invalid transform size");
|
||||
return;
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
if (eob == 1) {
|
||||
dqcoeff[0] = 0;
|
||||
@ -438,7 +438,7 @@ static void build_mc_border(const uint8_t *src, int src_stride,
|
||||
} while (--b_h);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void high_build_mc_border(const uint8_t *src8, int src_stride,
|
||||
uint16_t *dst, int dst_stride,
|
||||
int x, int y, int b_w, int b_h,
|
||||
@ -483,9 +483,9 @@ static void high_build_mc_border(const uint8_t *src8, int src_stride,
|
||||
ref_row += src_stride;
|
||||
} while (--b_h);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void extend_and_predict(const uint8_t *buf_ptr1, int pre_buf_stride,
|
||||
int x0, int y0, int b_w, int b_h,
|
||||
int frame_width, int frame_height,
|
||||
@ -537,7 +537,7 @@ static void extend_and_predict(const uint8_t *buf_ptr1, int pre_buf_stride,
|
||||
inter_predictor(buf_ptr, b_w, dst, dst_buf_stride, subpel_x,
|
||||
subpel_y, sf, w, h, ref, kernel, xs, ys);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static void dec_build_inter_predictors(VP10Decoder *const pbi, MACROBLOCKD *xd,
|
||||
int plane, int bw, int bh, int x,
|
||||
@ -663,7 +663,7 @@ static void dec_build_inter_predictors(VP10Decoder *const pbi, MACROBLOCKD *xd,
|
||||
dst, dst_buf->stride,
|
||||
subpel_x, subpel_y,
|
||||
kernel, sf,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
xd,
|
||||
#endif
|
||||
w, h, ref, xs, ys);
|
||||
@ -678,7 +678,7 @@ static void dec_build_inter_predictors(VP10Decoder *const pbi, MACROBLOCKD *xd,
|
||||
VPXMAX(0, (y1 + 7)) << (plane == 0 ? 0 : 1));
|
||||
}
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
high_inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x,
|
||||
subpel_y, sf, w, h, ref, kernel, xs, ys, xd->bd);
|
||||
@ -689,7 +689,7 @@ static void dec_build_inter_predictors(VP10Decoder *const pbi, MACROBLOCKD *xd,
|
||||
#else
|
||||
inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x,
|
||||
subpel_y, sf, w, h, ref, kernel, xs, ys);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
static void dec_build_inter_predictors_sb(VP10Decoder *const pbi,
|
||||
@ -1242,7 +1242,7 @@ static void setup_frame_size(VP10_COMMON *cm, struct vpx_read_bit_buffer *rb) {
|
||||
if (vpx_realloc_frame_buffer(
|
||||
get_frame_new_buffer(cm), cm->width, cm->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_DEC_BORDER_IN_PIXELS,
|
||||
@ -1336,7 +1336,7 @@ static void setup_frame_size_with_refs(VP10_COMMON *cm,
|
||||
if (vpx_realloc_frame_buffer(
|
||||
get_frame_new_buffer(cm), cm->width, cm->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_DEC_BORDER_IN_PIXELS,
|
||||
@ -1816,12 +1816,12 @@ static void read_bitdepth_colorspace_sampling(
|
||||
VP10_COMMON *cm, struct vpx_read_bit_buffer *rb) {
|
||||
if (cm->profile >= PROFILE_2) {
|
||||
cm->bit_depth = vpx_rb_read_bit(rb) ? VPX_BITS_12 : VPX_BITS_10;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth = 1;
|
||||
#endif
|
||||
} else {
|
||||
cm->bit_depth = VPX_BITS_8;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth = 0;
|
||||
#endif
|
||||
}
|
||||
@ -1873,7 +1873,7 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
|
||||
"Invalid frame marker");
|
||||
|
||||
cm->profile = vp10_read_profile(rb);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->profile >= MAX_PROFILES)
|
||||
vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
|
||||
"Unsupported bitstream profile");
|
||||
@ -1979,7 +1979,7 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
|
||||
cm->color_range = 0;
|
||||
cm->subsampling_y = cm->subsampling_x = 1;
|
||||
cm->bit_depth = VPX_BITS_8;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth = 0;
|
||||
#endif
|
||||
}
|
||||
@ -2009,7 +2009,7 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
|
||||
|
||||
for (i = 0; i < REFS_PER_FRAME; ++i) {
|
||||
RefBuffer *const ref_buf = &cm->frame_refs[i];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
vp10_setup_scale_factors_for_frame(&ref_buf->sf,
|
||||
ref_buf->buf->y_crop_width,
|
||||
ref_buf->buf->y_crop_height,
|
||||
@ -2024,7 +2024,7 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
|
||||
}
|
||||
}
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
get_frame_new_buffer(cm)->bit_depth = cm->bit_depth;
|
||||
#endif
|
||||
get_frame_new_buffer(cm)->color_space = cm->color_space;
|
||||
@ -2088,7 +2088,7 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
|
||||
|
||||
setup_loopfilter(&cm->lf, rb);
|
||||
setup_quantization(cm, rb);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
xd->bd = (int)cm->bit_depth;
|
||||
#endif
|
||||
|
||||
|
@ -77,7 +77,7 @@ static int decode_coefs(const MACROBLOCKD *xd,
|
||||
eob_branch_count = counts->eob_branch[tx_size][type][ref];
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->bd > VPX_BITS_8) {
|
||||
if (xd->bd == VPX_BITS_10) {
|
||||
cat1_prob = vp10_cat1_prob_high10;
|
||||
@ -170,7 +170,7 @@ static int decode_coefs(const MACROBLOCKD *xd,
|
||||
const int skip_bits = 0;
|
||||
#endif
|
||||
const uint8_t *cat6p = cat6_prob + skip_bits;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (xd->bd) {
|
||||
case VPX_BITS_8:
|
||||
val = CAT6_MIN_VAL + read_coeff(cat6p, 14 - skip_bits, r);
|
||||
@ -194,12 +194,12 @@ static int decode_coefs(const MACROBLOCKD *xd,
|
||||
}
|
||||
v = (val * dqv) >> dq_shift;
|
||||
#if CONFIG_COEFFICIENT_RANGE_CHECKING
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
dqcoeff[scan[c]] = highbd_check_range((vpx_read_bit(r) ? -v : v),
|
||||
xd->bd);
|
||||
#else
|
||||
dqcoeff[scan[c]] = check_range(vpx_read_bit(r) ? -v : v);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#else
|
||||
dqcoeff[scan[c]] = vpx_read_bit(r) ? -v : v;
|
||||
#endif // CONFIG_COEFFICIENT_RANGE_CHECKING
|
||||
|
@ -156,7 +156,7 @@ void vp10_frameworker_copy_context(VPxWorker *const dst_worker,
|
||||
vp10_frameworker_unlock_stats(src_worker);
|
||||
|
||||
dst_cm->bit_depth = src_cm->bit_depth;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
dst_cm->use_highbitdepth = src_cm->use_highbitdepth;
|
||||
#endif
|
||||
dst_cm->prev_frame = src_cm->show_existing_frame ?
|
||||
|
@ -33,7 +33,7 @@ static const int segment_id[ENERGY_SPAN] = {0, 1, 1, 2, 3, 4};
|
||||
#define SEGMENT_ID(i) segment_id[(i) - ENERGY_MIN]
|
||||
|
||||
DECLARE_ALIGNED(16, static const uint8_t, vp10_64_zeros[64]) = {0};
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, static const uint16_t, vp10_highbd_64_zeros[64]) = {0};
|
||||
#endif
|
||||
|
||||
@ -104,7 +104,7 @@ static void aq_variance(const uint8_t *a, int a_stride,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void aq_highbd_variance64(const uint8_t *a8, int a_stride,
|
||||
const uint8_t *b8, int b_stride,
|
||||
int w, int h, uint64_t *sse, uint64_t *sum) {
|
||||
@ -135,7 +135,7 @@ static void aq_highbd_8_variance(const uint8_t *a8, int a_stride,
|
||||
*sse = (unsigned int)sse_long;
|
||||
*sum = (int)sum_long;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static unsigned int block_variance(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
BLOCK_SIZE bs) {
|
||||
@ -150,7 +150,7 @@ static unsigned int block_variance(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
const int bw = 8 * num_8x8_blocks_wide_lookup[bs] - right_overflow;
|
||||
const int bh = 8 * num_8x8_blocks_high_lookup[bs] - bottom_overflow;
|
||||
int avg;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
aq_highbd_8_variance(x->plane[0].src.buf, x->plane[0].src.stride,
|
||||
CONVERT_TO_BYTEPTR(vp10_highbd_64_zeros), 0, bw, bh,
|
||||
@ -164,11 +164,11 @@ static unsigned int block_variance(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
#else
|
||||
aq_variance(x->plane[0].src.buf, x->plane[0].src.stride,
|
||||
vp10_64_zeros, 0, bw, bh, &sse, &avg);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
var = sse - (((int64_t)avg * avg) / (bw * bh));
|
||||
return (256 * var) / (bw * bh);
|
||||
} else {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf,
|
||||
x->plane[0].src.stride,
|
||||
@ -183,7 +183,7 @@ static unsigned int block_variance(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf,
|
||||
x->plane[0].src.stride,
|
||||
vp10_64_zeros, 0, &sse);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
return (256 * var) >> num_pels_log2_lookup[bs];
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ static void pack_mb_tokens(vpx_writer *w,
|
||||
int i = 0;
|
||||
int v = a->value;
|
||||
int n = a->len;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const vp10_extra_bit *b;
|
||||
if (bit_depth == VPX_BITS_12)
|
||||
b = &vp10_extra_bits_high12[t];
|
||||
@ -225,7 +225,7 @@ static void pack_mb_tokens(vpx_writer *w,
|
||||
#else
|
||||
const vp10_extra_bit *const b = &vp10_extra_bits[t];
|
||||
(void) bit_depth;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
/* skip one or two nodes */
|
||||
if (p->skip_eob_node) {
|
||||
|
@ -1280,7 +1280,7 @@ void vp10_fht16x16_c(const int16_t *input, tran_low_t *output,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_fht4x4_c(const int16_t *input, tran_low_t *output,
|
||||
int stride, int tx_type) {
|
||||
vp10_fht4x4_c(input, output, stride, tx_type);
|
||||
@ -1300,4 +1300,4 @@ void vp10_highbd_fht16x16_c(const int16_t *input, tran_low_t *output,
|
||||
int stride, int tx_type) {
|
||||
vp10_fht16x16_c(input, output, stride, tx_type);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -427,7 +427,7 @@ void vp10_denoiser_update_frame_stats(MB_MODE_INFO *mbmi, unsigned int sse,
|
||||
|
||||
int vp10_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
|
||||
int ssx, int ssy,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth,
|
||||
#endif
|
||||
int border) {
|
||||
@ -438,7 +438,7 @@ int vp10_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
|
||||
for (i = 0; i < MAX_REF_FRAMES; ++i) {
|
||||
fail = vpx_alloc_frame_buffer(&denoiser->running_avg_y[i], width, height,
|
||||
ssx, ssy,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
use_highbitdepth,
|
||||
#endif
|
||||
border, legacy_byte_alignment);
|
||||
@ -453,7 +453,7 @@ int vp10_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
|
||||
|
||||
fail = vpx_alloc_frame_buffer(&denoiser->mc_running_avg_y, width, height,
|
||||
ssx, ssy,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
use_highbitdepth,
|
||||
#endif
|
||||
border, legacy_byte_alignment);
|
||||
|
@ -51,7 +51,7 @@ void vp10_denoiser_update_frame_stats(MB_MODE_INFO *mbmi,
|
||||
|
||||
int vp10_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
|
||||
int ssx, int ssy,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth,
|
||||
#endif
|
||||
int border);
|
||||
|
@ -66,7 +66,7 @@ static const uint8_t VP9_VAR_OFFS[64] = {
|
||||
128, 128, 128, 128, 128, 128, 128, 128
|
||||
};
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static const uint16_t VP9_HIGH_VAR_OFFS_8[64] = {
|
||||
128, 128, 128, 128, 128, 128, 128, 128,
|
||||
128, 128, 128, 128, 128, 128, 128, 128,
|
||||
@ -99,7 +99,7 @@ static const uint16_t VP9_HIGH_VAR_OFFS_12[64] = {
|
||||
128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16,
|
||||
128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16, 128*16
|
||||
};
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
unsigned int vp10_get_sby_perpixel_variance(VP10_COMP *cpi,
|
||||
const struct buf_2d *ref,
|
||||
@ -110,7 +110,7 @@ unsigned int vp10_get_sby_perpixel_variance(VP10_COMP *cpi,
|
||||
return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
unsigned int vp10_high_get_sby_perpixel_variance(
|
||||
VP10_COMP *cpi, const struct buf_2d *ref, BLOCK_SIZE bs, int bd) {
|
||||
unsigned int var, sse;
|
||||
@ -134,7 +134,7 @@ unsigned int vp10_high_get_sby_perpixel_variance(
|
||||
}
|
||||
return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static unsigned int get_sby_perpixel_diff_variance(VP10_COMP *cpi,
|
||||
const struct buf_2d *ref,
|
||||
@ -519,7 +519,7 @@ void vp10_set_variance_partition_thresholds(VP10_COMP *cpi, int q) {
|
||||
// Compute the minmax over the 8x8 subblocks.
|
||||
static int compute_minmax_8x8(const uint8_t *s, int sp, const uint8_t *d,
|
||||
int dp, int x16_idx, int y16_idx,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int highbd_flag,
|
||||
#endif
|
||||
int pixels_wide,
|
||||
@ -534,7 +534,7 @@ static int compute_minmax_8x8(const uint8_t *s, int sp, const uint8_t *d,
|
||||
int min = 0;
|
||||
int max = 0;
|
||||
if (x8_idx < pixels_wide && y8_idx < pixels_high) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (highbd_flag & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vpx_highbd_minmax_8x8(s + y8_idx * sp + x8_idx, sp,
|
||||
d + y8_idx * dp + x8_idx, dp,
|
||||
@ -560,7 +560,7 @@ static int compute_minmax_8x8(const uint8_t *s, int sp, const uint8_t *d,
|
||||
|
||||
static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d,
|
||||
int dp, int x8_idx, int y8_idx, v8x8 *vst,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int highbd_flag,
|
||||
#endif
|
||||
int pixels_wide,
|
||||
@ -575,7 +575,7 @@ static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d,
|
||||
if (x4_idx < pixels_wide && y4_idx < pixels_high) {
|
||||
int s_avg;
|
||||
int d_avg = 128;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (highbd_flag & YV12_FLAG_HIGHBITDEPTH) {
|
||||
s_avg = vpx_highbd_avg_4x4(s + y4_idx * sp + x4_idx, sp);
|
||||
if (!is_key_frame)
|
||||
@ -599,7 +599,7 @@ static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d,
|
||||
|
||||
static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d,
|
||||
int dp, int x16_idx, int y16_idx, v16x16 *vst,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int highbd_flag,
|
||||
#endif
|
||||
int pixels_wide,
|
||||
@ -614,7 +614,7 @@ static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d,
|
||||
if (x8_idx < pixels_wide && y8_idx < pixels_high) {
|
||||
int s_avg;
|
||||
int d_avg = 128;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (highbd_flag & YV12_FLAG_HIGHBITDEPTH) {
|
||||
s_avg = vpx_highbd_avg_8x8(s + y8_idx * sp + x8_idx, sp);
|
||||
if (!is_key_frame)
|
||||
@ -761,7 +761,7 @@ static int choose_partitioning(VP10_COMP *cpi,
|
||||
} else {
|
||||
d = VP9_VAR_OFFS;
|
||||
dp = 0;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
switch (xd->bd) {
|
||||
case 10:
|
||||
@ -776,7 +776,7 @@ static int choose_partitioning(VP10_COMP *cpi,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
// Index for force_split: 0 for 64x64, 1-4 for 32x32 blocks,
|
||||
@ -798,7 +798,7 @@ static int choose_partitioning(VP10_COMP *cpi,
|
||||
variance4x4downsample[i2 + j] = 0;
|
||||
if (!is_key_frame) {
|
||||
fill_variance_8x8avg(s, sp, d, dp, x16_idx, y16_idx, vst,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
xd->cur_buf->flags,
|
||||
#endif
|
||||
pixels_wide,
|
||||
@ -820,7 +820,7 @@ static int choose_partitioning(VP10_COMP *cpi,
|
||||
// compute the minmax over the 8x8 sub-blocks, and if above threshold,
|
||||
// force split to 8x8 block for this 16x16 block.
|
||||
int minmax = compute_minmax_8x8(s, sp, d, dp, x16_idx, y16_idx,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
xd->cur_buf->flags,
|
||||
#endif
|
||||
pixels_wide, pixels_high);
|
||||
@ -843,7 +843,7 @@ static int choose_partitioning(VP10_COMP *cpi,
|
||||
v8x8 *vst2 = is_key_frame ? &vst->split[k] :
|
||||
&vt2[i2 + j].split[k];
|
||||
fill_variance_4x4avg(s, sp, d, dp, x8_idx, y8_idx, vst2,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
xd->cur_buf->flags,
|
||||
#endif
|
||||
pixels_wide,
|
||||
@ -1151,7 +1151,7 @@ static void rd_pick_sb_modes(VP10_COMP *cpi,
|
||||
// Set to zero to make sure we do not use the previous encoded frame stats
|
||||
mbmi->skip = 0;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
x->source_variance =
|
||||
vp10_high_get_sby_perpixel_variance(cpi, &x->plane[0].src,
|
||||
@ -1163,7 +1163,7 @@ static void rd_pick_sb_modes(VP10_COMP *cpi,
|
||||
#else
|
||||
x->source_variance =
|
||||
vp10_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// Save rdmult before it might be changed, so it can be restored later.
|
||||
orig_rdmult = x->rdmult;
|
||||
|
@ -38,14 +38,14 @@ void vp10_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
|
||||
const int bw = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
|
||||
const int bh = 4 * num_4x4_blocks_high_lookup[plane_bsize];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (x->e_mbd.cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vpx_highbd_subtract_block(bh, bw, p->src_diff, bw, p->src.buf,
|
||||
p->src.stride, pd->dst.buf, pd->dst.stride,
|
||||
x->e_mbd.bd);
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
vpx_subtract_block(bh, bw, p->src_diff, bw, p->src.buf, p->src.stride,
|
||||
pd->dst.buf, pd->dst.stride);
|
||||
}
|
||||
@ -115,7 +115,7 @@ static int optimize_b(MACROBLOCK *mb, int plane, int block,
|
||||
int16_t t0, t1;
|
||||
EXTRABIT e0;
|
||||
int best, band, pt, i, final_eob;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int16_t *cat6_high_cost = vp10_get_high_cost_table(xd->bd);
|
||||
#else
|
||||
const int16_t *cat6_high_cost = vp10_get_high_cost_table(8);
|
||||
@ -167,11 +167,11 @@ static int optimize_b(MACROBLOCK *mb, int plane, int block,
|
||||
best = rd_cost1 < rd_cost0;
|
||||
base_bits = vp10_get_cost(t0, e0, cat6_high_cost);
|
||||
dx = mul * (dqcoeff[rc] - coeff[rc]);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
dx >>= xd->bd - 8;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
d2 = dx * dx;
|
||||
tokens[i][0].rate = base_bits + (best ? rate1 : rate0);
|
||||
tokens[i][0].error = d2 + (best ? error1 : error0);
|
||||
@ -228,7 +228,7 @@ static int optimize_b(MACROBLOCK *mb, int plane, int block,
|
||||
base_bits = vp10_get_cost(t0, e0, cat6_high_cost);
|
||||
|
||||
if (shortcut) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
dx -= ((dequant_ptr[rc != 0] >> (xd->bd - 8)) + sz) ^ sz;
|
||||
} else {
|
||||
@ -236,7 +236,7 @@ static int optimize_b(MACROBLOCK *mb, int plane, int block,
|
||||
}
|
||||
#else
|
||||
dx -= (dequant_ptr[rc != 0] + sz) ^ sz;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
d2 = dx * dx;
|
||||
}
|
||||
tokens[i][1].rate = base_bits + (best ? rate1 : rate0);
|
||||
@ -313,7 +313,7 @@ static INLINE void fdct32x32(int rd_transform,
|
||||
vpx_fdct32x32(src, dst, src_stride);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE void highbd_fdct32x32(int rd_transform, const int16_t *src,
|
||||
tran_low_t *dst, int src_stride) {
|
||||
if (rd_transform)
|
||||
@ -321,7 +321,7 @@ static INLINE void highbd_fdct32x32(int rd_transform, const int16_t *src,
|
||||
else
|
||||
vpx_highbd_fdct32x32(src, dst, src_stride);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
|
||||
int diff_stride, TX_TYPE tx_type, int lossless) {
|
||||
@ -392,7 +392,7 @@ static void fwd_txfm_32x32(int rd_transform, const int16_t *src_diff,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
|
||||
int diff_stride, TX_TYPE tx_type, int lossless) {
|
||||
if (lossless) {
|
||||
@ -466,7 +466,7 @@ static void highbd_fwd_txfm_32x32(int rd_transform, const int16_t *src_diff,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block,
|
||||
int blk_row, int blk_col,
|
||||
@ -485,7 +485,7 @@ void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block,
|
||||
const int16_t *src_diff;
|
||||
src_diff = &p->src_diff[4 * (blk_row * diff_stride + blk_col)];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -526,7 +526,7 @@ void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block,
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -581,7 +581,7 @@ void vp10_xform_quant_dc(MACROBLOCK *x, int plane, int block,
|
||||
const int16_t *src_diff;
|
||||
src_diff = &p->src_diff[4 * (blk_row * diff_stride + blk_col)];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -617,7 +617,7 @@ void vp10_xform_quant_dc(MACROBLOCK *x, int plane, int block,
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -673,7 +673,7 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block,
|
||||
const int16_t *src_diff;
|
||||
src_diff = &p->src_diff[4 * (blk_row * diff_stride + blk_col)];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -711,7 +711,7 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block,
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -822,7 +822,7 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
|
||||
|
||||
if (p->eobs[block] == 0)
|
||||
return;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -852,7 +852,7 @@ static void encode_block(int plane, int block, int blk_row, int blk_col,
|
||||
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -894,7 +894,7 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col,
|
||||
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size);
|
||||
|
||||
if (p->eobs[block] > 0) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
if (xd->lossless[0]) {
|
||||
vp10_highbd_iwht4x4_add(dqcoeff, dst, pd->dst.stride,
|
||||
@ -905,7 +905,7 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col,
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->lossless[0]) {
|
||||
vp10_iwht4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
|
||||
} else {
|
||||
@ -980,7 +980,7 @@ void vp10_encode_block_intra(int plane, int block, int blk_row, int blk_col,
|
||||
vp10_predict_intra_block(xd, bwl, bhl, tx_size, mode, dst, dst_stride,
|
||||
dst, dst_stride, blk_col, blk_row, plane);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
@ -1053,7 +1053,7 @@ void vp10_encode_block_intra(int plane, int block, int blk_row, int blk_col,
|
||||
*(args->skip) = 0;
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
switch (tx_size) {
|
||||
case TX_32X32:
|
||||
|
@ -46,10 +46,10 @@ void vp10_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
|
||||
void vp10_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
|
||||
int diff_stride, TX_TYPE tx_type, int lossless);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
|
||||
int diff_stride, TX_TYPE tx_type, int lossless);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
@ -605,7 +605,7 @@ static void alloc_raw_frame_buffers(VP10_COMP *cpi) {
|
||||
if (!cpi->lookahead)
|
||||
cpi->lookahead = vp10_lookahead_init(oxcf->width, oxcf->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
oxcf->lag_in_frames);
|
||||
@ -617,7 +617,7 @@ static void alloc_raw_frame_buffers(VP10_COMP *cpi) {
|
||||
if (vpx_realloc_frame_buffer(&cpi->alt_ref_buffer,
|
||||
oxcf->width, oxcf->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
|
||||
@ -631,7 +631,7 @@ static void alloc_util_frame_buffers(VP10_COMP *cpi) {
|
||||
if (vpx_realloc_frame_buffer(&cpi->last_frame_uf,
|
||||
cm->width, cm->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
|
||||
@ -642,7 +642,7 @@ static void alloc_util_frame_buffers(VP10_COMP *cpi) {
|
||||
if (vpx_realloc_frame_buffer(&cpi->scaled_source,
|
||||
cm->width, cm->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
|
||||
@ -653,7 +653,7 @@ static void alloc_util_frame_buffers(VP10_COMP *cpi) {
|
||||
if (vpx_realloc_frame_buffer(&cpi->scaled_last_source,
|
||||
cm->width, cm->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
|
||||
@ -735,7 +735,7 @@ static void init_config(struct VP10_COMP *cpi, VP10EncoderConfig *oxcf) {
|
||||
|
||||
cm->profile = oxcf->profile;
|
||||
cm->bit_depth = oxcf->bit_depth;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth = oxcf->use_highbitdepth;
|
||||
#endif
|
||||
cm->color_space = oxcf->color_space;
|
||||
@ -771,7 +771,7 @@ static void set_rc_buffer_sizes(RATE_CONTROL *rc,
|
||||
: maximum * bandwidth / 1000;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#define HIGHBD_BFP(BT, SDF, SDAF, VF, SVF, SVAF, SDX3F, SDX8F, SDX4DF) \
|
||||
cpi->fn_ptr[BT].sdf = SDF; \
|
||||
cpi->fn_ptr[BT].sdaf = SDAF; \
|
||||
@ -1375,7 +1375,7 @@ static void highbd_set_var_fns(VP10_COMP *const cpi) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static void realloc_segmentation_maps(VP10_COMP *cpi) {
|
||||
VP10_COMMON *const cm = &cpi->common;
|
||||
@ -1419,9 +1419,9 @@ void vp10_change_config(struct VP10_COMP *cpi, const VP10EncoderConfig *oxcf) {
|
||||
assert(cm->bit_depth > VPX_BITS_8);
|
||||
|
||||
cpi->oxcf = *oxcf;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cpi->td.mb.e_mbd.bd = (int)cm->bit_depth;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
if ((oxcf->pass == 0) && (oxcf->rc_mode == VPX_Q)) {
|
||||
rc->baseline_gf_interval = FIXED_GF_INTERVAL;
|
||||
@ -1498,7 +1498,7 @@ void vp10_change_config(struct VP10_COMP *cpi, const VP10EncoderConfig *oxcf) {
|
||||
cpi->ext_refresh_frame_flags_pending = 0;
|
||||
cpi->ext_refresh_frame_context_pending = 0;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
highbd_set_var_fns(cpi);
|
||||
#endif
|
||||
}
|
||||
@ -1810,7 +1810,7 @@ VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf,
|
||||
vpx_sub_pixel_avg_variance4x4,
|
||||
vpx_sad4x4x3, vpx_sad4x4x8, vpx_sad4x4x4d)
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
highbd_set_var_fns(cpi);
|
||||
#endif
|
||||
|
||||
@ -2023,7 +2023,7 @@ static void encoder_variance(const uint8_t *a, int a_stride,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void encoder_highbd_variance64(const uint8_t *a8, int a_stride,
|
||||
const uint8_t *b8, int b_stride,
|
||||
int w, int h, uint64_t *sse,
|
||||
@ -2057,7 +2057,7 @@ static void encoder_highbd_8_variance(const uint8_t *a8, int a_stride,
|
||||
*sse = (unsigned int)sse_long;
|
||||
*sum = (int)sum_long;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static int64_t get_sse(const uint8_t *a, int a_stride,
|
||||
const uint8_t *b, int b_stride,
|
||||
@ -2100,7 +2100,7 @@ static int64_t get_sse(const uint8_t *a, int a_stride,
|
||||
return total_sse;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static int64_t highbd_get_sse_shift(const uint8_t *a8, int a_stride,
|
||||
const uint8_t *b8, int b_stride,
|
||||
int width, int height,
|
||||
@ -2156,7 +2156,7 @@ static int64_t highbd_get_sse(const uint8_t *a, int a_stride,
|
||||
}
|
||||
return total_sse;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
typedef struct {
|
||||
double psnr[4]; // total/y/u/v
|
||||
@ -2164,7 +2164,7 @@ typedef struct {
|
||||
uint32_t samples[4]; // total/y/u/v
|
||||
} PSNR_STATS;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
|
||||
const YV12_BUFFER_CONFIG *b,
|
||||
PSNR_STATS *psnr,
|
||||
@ -2217,7 +2217,7 @@ static void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
|
||||
(double)total_sse);
|
||||
}
|
||||
|
||||
#else // !CONFIG_VP9_HIGHBITDEPTH
|
||||
#else // !CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
|
||||
PSNR_STATS *psnr) {
|
||||
@ -2254,13 +2254,13 @@ static void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
|
||||
psnr->psnr[0] = vpx_sse_to_psnr((double)total_samples, peak,
|
||||
(double)total_sse);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static void generate_psnr_packet(VP10_COMP *cpi) {
|
||||
struct vpx_codec_cx_pkt pkt;
|
||||
int i;
|
||||
PSNR_STATS psnr;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
calc_highbd_psnr(cpi->Source, cpi->common.frame_to_show, &psnr,
|
||||
cpi->td.mb.e_mbd.bd, cpi->oxcf.input_bit_depth);
|
||||
#else
|
||||
@ -2370,7 +2370,7 @@ void vp10_write_yuv_rec_frame(VP10_COMMON *cm) {
|
||||
uint8_t *src = s->y_buffer;
|
||||
int h = cm->height;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (s->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
uint16_t *src16 = CONVERT_TO_SHORTPTR(s->y_buffer);
|
||||
|
||||
@ -2398,7 +2398,7 @@ void vp10_write_yuv_rec_frame(VP10_COMMON *cm) {
|
||||
fflush(yuv_rec_file);
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
do {
|
||||
fwrite(src, s->y_width, 1, yuv_rec_file);
|
||||
@ -2425,14 +2425,14 @@ void vp10_write_yuv_rec_frame(VP10_COMMON *cm) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void scale_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src,
|
||||
YV12_BUFFER_CONFIG *dst,
|
||||
int bd) {
|
||||
#else
|
||||
static void scale_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src,
|
||||
YV12_BUFFER_CONFIG *dst) {
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
// TODO(dkovalev): replace YV12_BUFFER_CONFIG with vpx_image_t
|
||||
int i;
|
||||
const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
|
||||
@ -2449,7 +2449,7 @@ static void scale_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src,
|
||||
dst->uv_crop_height};
|
||||
|
||||
for (i = 0; i < MAX_MB_PLANE; ++i) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vp10_highbd_resize_plane(srcs[i], src_heights[i], src_widths[i],
|
||||
src_strides[i], dsts[i], dst_heights[i],
|
||||
@ -2461,18 +2461,18 @@ static void scale_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src,
|
||||
#else
|
||||
vp10_resize_plane(srcs[i], src_heights[i], src_widths[i], src_strides[i],
|
||||
dsts[i], dst_heights[i], dst_widths[i], dst_strides[i]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
vpx_extend_frame_borders(dst);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src,
|
||||
YV12_BUFFER_CONFIG *dst, int bd) {
|
||||
#else
|
||||
static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src,
|
||||
YV12_BUFFER_CONFIG *dst) {
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
const int src_w = src->y_crop_width;
|
||||
const int src_h = src->y_crop_height;
|
||||
const int dst_w = dst->y_crop_width;
|
||||
@ -2496,7 +2496,7 @@ static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src,
|
||||
src_stride + (x / factor) * src_w / dst_w;
|
||||
uint8_t *dst_ptr = dsts[i] + (y / factor) * dst_stride + (x / factor);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vpx_highbd_convolve8(src_ptr, src_stride, dst_ptr, dst_stride,
|
||||
kernel[x_q4 & 0xf], 16 * src_w / dst_w,
|
||||
@ -2513,7 +2513,7 @@ static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src,
|
||||
kernel[x_q4 & 0xf], 16 * src_w / dst_w,
|
||||
kernel[y_q4 & 0xf], 16 * src_h / dst_h,
|
||||
16 / factor, 16 / factor);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2714,7 +2714,7 @@ void vp10_scale_references(VP10_COMP *cpi) {
|
||||
continue;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height) {
|
||||
RefCntBuffer *new_fb_ptr = NULL;
|
||||
int force_scaling = 0;
|
||||
@ -2763,7 +2763,7 @@ void vp10_scale_references(VP10_COMP *cpi) {
|
||||
cpi->scaled_ref_idx[ref_frame - 1] = new_fb;
|
||||
alloc_frame_mvs(cm, new_fb);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
} else {
|
||||
const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame);
|
||||
RefCntBuffer *const buf = &pool->frame_bufs[buf_idx];
|
||||
@ -3050,7 +3050,7 @@ static void set_frame_size(VP10_COMP *cpi) {
|
||||
vpx_realloc_frame_buffer(get_frame_new_buffer(cm),
|
||||
cm->width, cm->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS, cm->byte_alignment,
|
||||
@ -3068,7 +3068,7 @@ static void set_frame_size(VP10_COMP *cpi) {
|
||||
if (buf_idx != INVALID_IDX) {
|
||||
YV12_BUFFER_CONFIG *const buf = &cm->buffer_pool->frame_bufs[buf_idx].buf;
|
||||
ref_buf->buf = buf;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
vp10_setup_scale_factors_for_frame(&ref_buf->sf,
|
||||
buf->y_crop_width, buf->y_crop_height,
|
||||
cm->width, cm->height,
|
||||
@ -3078,7 +3078,7 @@ static void set_frame_size(VP10_COMP *cpi) {
|
||||
vp10_setup_scale_factors_for_frame(&ref_buf->sf,
|
||||
buf->y_crop_width, buf->y_crop_height,
|
||||
cm->width, cm->height);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
if (vp10_is_scaled(&ref_buf->sf))
|
||||
vpx_extend_frame_borders(buf);
|
||||
} else {
|
||||
@ -3269,7 +3269,7 @@ static void encode_with_recode_loop(VP10_COMP *cpi,
|
||||
int64_t high_err_target = cpi->ambient_err;
|
||||
int64_t low_err_target = cpi->ambient_err >> 1;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
kf_err = vp10_highbd_get_y_sse(cpi->Source, get_frame_new_buffer(cm));
|
||||
} else {
|
||||
@ -3277,7 +3277,7 @@ static void encode_with_recode_loop(VP10_COMP *cpi,
|
||||
}
|
||||
#else
|
||||
kf_err = vp10_get_y_sse(cpi->Source, get_frame_new_buffer(cm));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// Prevent possible divide by zero error below for perfect KF
|
||||
kf_err += !kf_err;
|
||||
@ -3479,11 +3479,11 @@ YV12_BUFFER_CONFIG *vp10_scale_if_required(VP10_COMMON *cm,
|
||||
YV12_BUFFER_CONFIG *scaled) {
|
||||
if (cm->mi_cols * MI_SIZE != unscaled->y_width ||
|
||||
cm->mi_rows * MI_SIZE != unscaled->y_height) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
scale_and_extend_frame_nonnormative(unscaled, scaled, (int)cm->bit_depth);
|
||||
#else
|
||||
scale_and_extend_frame_nonnormative(unscaled, scaled);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
return scaled;
|
||||
} else {
|
||||
return unscaled;
|
||||
@ -3624,7 +3624,7 @@ static void encode_frame_to_data_rate(VP10_COMP *cpi,
|
||||
// fixed interval. Note the reconstruction error if it is the frame before
|
||||
// the force key frame
|
||||
if (cpi->rc.next_key_frame_forced && cpi->rc.frames_to_key == 1) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
cpi->ambient_err = vp10_highbd_get_y_sse(cpi->Source,
|
||||
get_frame_new_buffer(cm));
|
||||
@ -3633,7 +3633,7 @@ static void encode_frame_to_data_rate(VP10_COMP *cpi,
|
||||
}
|
||||
#else
|
||||
cpi->ambient_err = vp10_get_y_sse(cpi->Source, get_frame_new_buffer(cm));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
// If the encoder forced a KEY_FRAME decision
|
||||
@ -3760,21 +3760,21 @@ static void init_ref_frame_bufs(VP10_COMMON *cm) {
|
||||
}
|
||||
|
||||
static void check_initial_width(VP10_COMP *cpi,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth,
|
||||
#endif
|
||||
int subsampling_x, int subsampling_y) {
|
||||
VP10_COMMON *const cm = &cpi->common;
|
||||
|
||||
if (!cpi->initial_width ||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth != use_highbitdepth ||
|
||||
#endif
|
||||
cm->subsampling_x != subsampling_x ||
|
||||
cm->subsampling_y != subsampling_y) {
|
||||
cm->subsampling_x = subsampling_x;
|
||||
cm->subsampling_y = subsampling_y;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth = use_highbitdepth;
|
||||
#endif
|
||||
|
||||
@ -3797,7 +3797,7 @@ static void setup_denoiser_buffer(VP10_COMP *cpi) {
|
||||
!cpi->denoiser.frame_buffer_initialized) {
|
||||
vp10_denoiser_alloc(&(cpi->denoiser), cm->width, cm->height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS);
|
||||
@ -3813,12 +3813,12 @@ int vp10_receive_raw_frame(VP10_COMP *cpi, unsigned int frame_flags,
|
||||
int res = 0;
|
||||
const int subsampling_x = sd->subsampling_x;
|
||||
const int subsampling_y = sd->subsampling_y;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int use_highbitdepth = sd->flags & YV12_FLAG_HIGHBITDEPTH;
|
||||
check_initial_width(cpi, use_highbitdepth, subsampling_x, subsampling_y);
|
||||
#else
|
||||
check_initial_width(cpi, subsampling_x, subsampling_y);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_TEMPORAL_DENOISING
|
||||
setup_denoiser_buffer(cpi);
|
||||
@ -3826,9 +3826,9 @@ int vp10_receive_raw_frame(VP10_COMP *cpi, unsigned int frame_flags,
|
||||
vpx_usec_timer_start(&timer);
|
||||
|
||||
if (vp10_lookahead_push(cpi->lookahead, sd, time_stamp, end_time,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
use_highbitdepth,
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
frame_flags))
|
||||
res = -1;
|
||||
vpx_usec_timer_mark(&timer);
|
||||
@ -4153,12 +4153,12 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show;
|
||||
YV12_BUFFER_CONFIG *pp = &cm->post_proc_buffer;
|
||||
PSNR_STATS psnr;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
calc_highbd_psnr(orig, recon, &psnr, cpi->td.mb.e_mbd.bd,
|
||||
cpi->oxcf.input_bit_depth);
|
||||
#else
|
||||
calc_psnr(orig, recon, &psnr);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
adjust_image_stat(psnr.psnr[1], psnr.psnr[2], psnr.psnr[3],
|
||||
psnr.psnr[0], &cpi->psnr);
|
||||
@ -4173,7 +4173,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
if (vpx_alloc_frame_buffer(&cm->post_proc_buffer,
|
||||
recon->y_crop_width, recon->y_crop_height,
|
||||
cm->subsampling_x, cm->subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
cm->use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS,
|
||||
@ -4187,19 +4187,19 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
#endif
|
||||
vpx_clear_system_state();
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
calc_highbd_psnr(orig, pp, &psnr2, cpi->td.mb.e_mbd.bd,
|
||||
cpi->oxcf.input_bit_depth);
|
||||
#else
|
||||
calc_psnr(orig, pp, &psnr2);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
cpi->totalp_sq_error += psnr2.sse[0];
|
||||
cpi->totalp_samples += psnr2.samples[0];
|
||||
adjust_image_stat(psnr2.psnr[1], psnr2.psnr[2], psnr2.psnr[3],
|
||||
psnr2.psnr[0], &cpi->psnrp);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
frame_ssim2 = vpx_highbd_calc_ssim(orig, recon, &weight,
|
||||
(int)cm->bit_depth);
|
||||
@ -4208,13 +4208,13 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
}
|
||||
#else
|
||||
frame_ssim2 = vpx_calc_ssim(orig, recon, &weight);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
cpi->worst_ssim= VPXMIN(cpi->worst_ssim, frame_ssim2);
|
||||
cpi->summed_quality += frame_ssim2 * weight;
|
||||
cpi->summed_weights += weight;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
frame_ssim2 = vpx_highbd_calc_ssim(
|
||||
orig, &cm->post_proc_buffer, &weight, (int)cm->bit_depth);
|
||||
@ -4223,7 +4223,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
}
|
||||
#else
|
||||
frame_ssim2 = vpx_calc_ssim(orig, &cm->post_proc_buffer, &weight);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
cpi->summedp_quality += frame_ssim2 * weight;
|
||||
cpi->summedp_weights += weight;
|
||||
@ -4239,7 +4239,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
}
|
||||
}
|
||||
if (cpi->b_calculate_blockiness) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (!cm->use_highbitdepth)
|
||||
#endif
|
||||
{
|
||||
@ -4254,7 +4254,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
}
|
||||
|
||||
if (cpi->b_calculate_consistency) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (!cm->use_highbitdepth)
|
||||
#endif
|
||||
{
|
||||
@ -4276,7 +4276,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
|
||||
if (cpi->b_calculate_ssimg) {
|
||||
double y, u, v, frame_all;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
frame_all = vpx_highbd_calc_ssimg(cpi->Source, cm->frame_to_show, &y,
|
||||
&u, &v, (int)cm->bit_depth);
|
||||
@ -4286,10 +4286,10 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
}
|
||||
#else
|
||||
frame_all = vpx_calc_ssimg(cpi->Source, cm->frame_to_show, &y, &u, &v);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
adjust_image_stat(y, u, v, frame_all, &cpi->ssimg);
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (!cm->use_highbitdepth)
|
||||
#endif
|
||||
{
|
||||
@ -4299,7 +4299,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
||||
adjust_image_stat(y, u, v, frame_all, &cpi->fastssim);
|
||||
/* TODO(JBB): add 10/12 bit support */
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (!cm->use_highbitdepth)
|
||||
#endif
|
||||
{
|
||||
@ -4370,11 +4370,11 @@ int vp10_set_internal_size(VP10_COMP *cpi,
|
||||
int vp10_set_size_literal(VP10_COMP *cpi, unsigned int width,
|
||||
unsigned int height) {
|
||||
VP10_COMMON *cm = &cpi->common;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
check_initial_width(cpi, cm->use_highbitdepth, 1, 1);
|
||||
#else
|
||||
check_initial_width(cpi, 1, 1);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_TEMPORAL_DENOISING
|
||||
setup_denoiser_buffer(cpi);
|
||||
@ -4412,7 +4412,7 @@ int64_t vp10_get_y_sse(const YV12_BUFFER_CONFIG *a,
|
||||
a->y_crop_width, a->y_crop_height);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int64_t vp10_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a,
|
||||
const YV12_BUFFER_CONFIG *b) {
|
||||
assert(a->y_crop_width == b->y_crop_width);
|
||||
@ -4423,7 +4423,7 @@ int64_t vp10_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a,
|
||||
return highbd_get_sse(a->y_buffer, a->y_stride, b->y_buffer, b->y_stride,
|
||||
a->y_crop_width, a->y_crop_height);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
int vp10_get_quantizer(VP10_COMP *cpi) {
|
||||
return cpi->common.base_qindex;
|
||||
|
@ -226,7 +226,7 @@ typedef struct VP10EncoderConfig {
|
||||
|
||||
vp8e_tuning tuning;
|
||||
vp9e_tune_content content;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth;
|
||||
#endif
|
||||
vpx_color_space_t color_space;
|
||||
@ -592,10 +592,10 @@ static INLINE int allocated_tokens(TileInfo tile) {
|
||||
}
|
||||
|
||||
int64_t vp10_get_y_sse(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int64_t vp10_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a,
|
||||
const YV12_BUFFER_CONFIG *b);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_alloc_compressor_data(VP10_COMP *cpi);
|
||||
|
||||
|
@ -57,7 +57,7 @@ static void copy_and_extend_plane(const uint8_t *src, int src_pitch,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
|
||||
uint8_t *dst8, int dst_pitch,
|
||||
int w, int h,
|
||||
@ -101,7 +101,7 @@ static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
|
||||
dst_ptr2 += dst_pitch;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
|
||||
YV12_BUFFER_CONFIG *dst) {
|
||||
@ -125,7 +125,7 @@ void vp10_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
|
||||
const int eb_uv = eb_y >> uv_height_subsampling;
|
||||
const int er_uv = er_y >> uv_width_subsampling;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
highbd_copy_and_extend_plane(src->y_buffer, src->y_stride,
|
||||
dst->y_buffer, dst->y_stride,
|
||||
@ -143,7 +143,7 @@ void vp10_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
|
||||
et_uv, el_uv, eb_uv, er_uv);
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
copy_and_extend_plane(src->y_buffer, src->y_stride,
|
||||
dst->y_buffer, dst->y_stride,
|
||||
|
@ -315,7 +315,7 @@ static unsigned int get_prediction_error(BLOCK_SIZE bsize,
|
||||
return sse;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static vpx_variance_fn_t highbd_get_block_variance_fn(BLOCK_SIZE bsize,
|
||||
int bd) {
|
||||
switch (bd) {
|
||||
@ -367,7 +367,7 @@ static unsigned int highbd_get_prediction_error(BLOCK_SIZE bsize,
|
||||
fn(src->buf, src->stride, ref->buf, ref->stride, &sse);
|
||||
return sse;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// Refine the motion search range according to the frame dimension
|
||||
// for first pass test.
|
||||
@ -399,11 +399,11 @@ static void first_pass_motion_search(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
// Override the default variance function to use MSE.
|
||||
v_fn_ptr.vf = get_block_variance_fn(bsize);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
v_fn_ptr.vf = highbd_get_block_variance_fn(bsize, xd->bd);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// Center the initial step/diamond search on best mv.
|
||||
tmp_err = cpi->diamond_search_sad(x, &cpi->ss_cfg, &ref_mv_full, &tmp_mv,
|
||||
@ -632,7 +632,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
image_data_start_row = mb_row;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
switch (cm->bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
@ -649,7 +649,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
vpx_clear_system_state();
|
||||
log_intra = log(this_error + 1.0);
|
||||
@ -658,7 +658,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
else
|
||||
intra_factor += 1.0;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth)
|
||||
level_sample = CONVERT_TO_SHORTPTR(x->plane[0].src.buf)[0];
|
||||
else
|
||||
@ -703,7 +703,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
struct buf_2d unscaled_last_source_buf_2d;
|
||||
|
||||
xd->plane[0].pre[0].buf = first_ref_buf->y_buffer + recon_yoffset;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
motion_error = highbd_get_prediction_error(
|
||||
bsize, &x->plane[0].src, &xd->plane[0].pre[0], xd->bd);
|
||||
@ -714,7 +714,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
#else
|
||||
motion_error = get_prediction_error(
|
||||
bsize, &x->plane[0].src, &xd->plane[0].pre[0]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// Compute the motion error of the 0,0 motion using the last source
|
||||
// frame as the reference. Skip the further motion search on
|
||||
@ -723,7 +723,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
cpi->unscaled_last_source->y_buffer + recon_yoffset;
|
||||
unscaled_last_source_buf_2d.stride =
|
||||
cpi->unscaled_last_source->y_stride;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
raw_motion_error = highbd_get_prediction_error(
|
||||
bsize, &x->plane[0].src, &unscaled_last_source_buf_2d, xd->bd);
|
||||
@ -734,7 +734,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
#else
|
||||
raw_motion_error = get_prediction_error(
|
||||
bsize, &x->plane[0].src, &unscaled_last_source_buf_2d);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// TODO(pengchong): Replace the hard-coded threshold
|
||||
if (raw_motion_error > 25) {
|
||||
@ -760,7 +760,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
int gf_motion_error;
|
||||
|
||||
xd->plane[0].pre[0].buf = gld_yv12->y_buffer + recon_yoffset;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
gf_motion_error = highbd_get_prediction_error(
|
||||
bsize, &x->plane[0].src, &xd->plane[0].pre[0], xd->bd);
|
||||
@ -771,7 +771,7 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) {
|
||||
#else
|
||||
gf_motion_error = get_prediction_error(
|
||||
bsize, &x->plane[0].src, &xd->plane[0].pre[0]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
first_pass_motion_search(cpi, x, &zero_mv, &tmp_mv,
|
||||
&gf_motion_error);
|
||||
|
@ -50,7 +50,7 @@ struct lookahead_ctx *vp10_lookahead_init(unsigned int width,
|
||||
unsigned int height,
|
||||
unsigned int subsampling_x,
|
||||
unsigned int subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth,
|
||||
#endif
|
||||
unsigned int depth) {
|
||||
@ -74,7 +74,7 @@ struct lookahead_ctx *vp10_lookahead_init(unsigned int width,
|
||||
for (i = 0; i < depth; i++)
|
||||
if (vpx_alloc_frame_buffer(&ctx->buf[i].img,
|
||||
width, height, subsampling_x, subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS,
|
||||
@ -91,7 +91,7 @@ struct lookahead_ctx *vp10_lookahead_init(unsigned int width,
|
||||
|
||||
int vp10_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
|
||||
int64_t ts_start, int64_t ts_end,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth,
|
||||
#endif
|
||||
unsigned int flags) {
|
||||
@ -174,7 +174,7 @@ int vp10_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
|
||||
memset(&new_img, 0, sizeof(new_img));
|
||||
if (vpx_alloc_frame_buffer(&new_img,
|
||||
width, height, subsampling_x, subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
use_highbitdepth,
|
||||
#endif
|
||||
VPX_ENC_BORDER_IN_PIXELS,
|
||||
|
@ -47,7 +47,7 @@ struct lookahead_ctx *vp10_lookahead_init(unsigned int width,
|
||||
unsigned int height,
|
||||
unsigned int subsampling_x,
|
||||
unsigned int subsampling_y,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth,
|
||||
#endif
|
||||
unsigned int depth);
|
||||
@ -75,7 +75,7 @@ void vp10_lookahead_destroy(struct lookahead_ctx *ctx);
|
||||
*/
|
||||
int vp10_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
|
||||
int64_t ts_start, int64_t ts_end,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int use_highbitdepth,
|
||||
#endif
|
||||
unsigned int flags);
|
||||
|
@ -323,7 +323,7 @@ static unsigned int setup_center_error(const MACROBLOCKD *xd,
|
||||
unsigned int *sse1,
|
||||
int *distortion) {
|
||||
unsigned int besterr;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (second_pred != NULL) {
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
DECLARE_ALIGNED(16, uint16_t, comp_pred16[64 * 64]);
|
||||
@ -352,7 +352,7 @@ static unsigned int setup_center_error(const MACROBLOCKD *xd,
|
||||
}
|
||||
*distortion = besterr;
|
||||
besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
return besterr;
|
||||
}
|
||||
|
||||
@ -1860,7 +1860,7 @@ unsigned int vp10_int_pro_motion_estimation(const VP10_COMP *cpi, MACROBLOCK *x,
|
||||
vp10_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
{
|
||||
unsigned int this_sad;
|
||||
tmp_mv->row = 0;
|
||||
|
@ -49,7 +49,7 @@ static int64_t try_filter_frame(const YV12_BUFFER_CONFIG *sd,
|
||||
vp10_loop_filter_frame(cm->frame_to_show, cm, &cpi->td.mb.e_mbd, filt_level,
|
||||
1, partial_frame);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->use_highbitdepth) {
|
||||
filt_err = vp10_highbd_get_y_sse(sd, cm->frame_to_show);
|
||||
} else {
|
||||
@ -57,7 +57,7 @@ static int64_t try_filter_frame(const YV12_BUFFER_CONFIG *sd,
|
||||
}
|
||||
#else
|
||||
filt_err = vp10_get_y_sse(sd, cm->frame_to_show);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// Re-instate the unfiltered frame
|
||||
vpx_yv12_copy_y(&cpi->last_frame_uf, cm->frame_to_show);
|
||||
@ -163,7 +163,7 @@ void vp10_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP10_COMP *cpi,
|
||||
const int q = vp10_ac_quant(cm->base_qindex, 0, cm->bit_depth);
|
||||
// These values were determined by linear fitting the result of the
|
||||
// searched level, filt_guess = q * 0.316206 + 3.87252
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int filt_guess;
|
||||
switch (cm->bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
@ -182,7 +182,7 @@ void vp10_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP10_COMP *cpi,
|
||||
}
|
||||
#else
|
||||
int filt_guess = ROUND_POWER_OF_TWO(q * 20723 + 1015158, 18);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cm->frame_type == KEY_FRAME)
|
||||
filt_guess -= 4;
|
||||
lf->filter_level = clamp(filt_guess, min_filter_level, max_filter_level);
|
||||
|
@ -60,7 +60,7 @@ void vp10_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
|
||||
*eob_ptr = eob + 1;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_quantize_fp_c(const tran_low_t *coeff_ptr,
|
||||
intptr_t count,
|
||||
int skip_block,
|
||||
@ -147,7 +147,7 @@ void vp10_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
|
||||
*eob_ptr = eob + 1;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr,
|
||||
intptr_t n_coeffs, int skip_block,
|
||||
const int16_t *zbin_ptr,
|
||||
@ -197,7 +197,7 @@ void vp10_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
|
||||
struct macroblock_plane *p = &x->plane[plane];
|
||||
struct macroblockd_plane *pd = &xd->plane[plane];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vpx_highbd_quantize_b(BLOCK_OFFSET(p->coeff, block),
|
||||
16, x->skip_block,
|
||||
@ -230,7 +230,7 @@ static void invert_quant(int16_t *quant, int16_t *shift, int d) {
|
||||
|
||||
static int get_qzbin_factor(int q, vpx_bit_depth_t bit_depth) {
|
||||
const int quant = vp10_dc_quant(q, 0, bit_depth);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
return q == 0 ? 64 : (quant < 148 ? 84 : 80);
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
#define FRAME_OVERHEAD_BITS 200
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#define ASSIGN_MINQ_TABLE(bit_depth, name) \
|
||||
do { \
|
||||
switch (bit_depth) { \
|
||||
@ -80,7 +80,7 @@ static int arfgf_high_motion_minq_8[QINDEX_RANGE];
|
||||
static int inter_minq_8[QINDEX_RANGE];
|
||||
static int rtc_minq_8[QINDEX_RANGE];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static int kf_low_motion_minq_10[QINDEX_RANGE];
|
||||
static int kf_high_motion_minq_10[QINDEX_RANGE];
|
||||
static int arfgf_low_motion_minq_10[QINDEX_RANGE];
|
||||
@ -141,7 +141,7 @@ void vp10_rc_init_minq_luts(void) {
|
||||
init_minq_luts(kf_low_motion_minq_8, kf_high_motion_minq_8,
|
||||
arfgf_low_motion_minq_8, arfgf_high_motion_minq_8,
|
||||
inter_minq_8, rtc_minq_8, VPX_BITS_8);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
init_minq_luts(kf_low_motion_minq_10, kf_high_motion_minq_10,
|
||||
arfgf_low_motion_minq_10, arfgf_high_motion_minq_10,
|
||||
inter_minq_10, rtc_minq_10, VPX_BITS_10);
|
||||
@ -156,7 +156,7 @@ void vp10_rc_init_minq_luts(void) {
|
||||
// tables if and when things settle down in the experimental bitstream
|
||||
double vp10_convert_qindex_to_q(int qindex, vpx_bit_depth_t bit_depth) {
|
||||
// Convert the index to a real Q value (scaled down to match old Q values)
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
return vp10_ac_quant(qindex, 0, bit_depth) / 4.0;
|
||||
|
@ -121,7 +121,7 @@ static void fill_token_costs(vp10_coeff_cost *c,
|
||||
static int sad_per_bit16lut_8[QINDEX_RANGE];
|
||||
static int sad_per_bit4lut_8[QINDEX_RANGE];
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static int sad_per_bit16lut_10[QINDEX_RANGE];
|
||||
static int sad_per_bit4lut_10[QINDEX_RANGE];
|
||||
static int sad_per_bit16lut_12[QINDEX_RANGE];
|
||||
@ -144,7 +144,7 @@ static void init_me_luts_bd(int *bit16lut, int *bit4lut, int range,
|
||||
void vp10_init_me_luts(void) {
|
||||
init_me_luts_bd(sad_per_bit16lut_8, sad_per_bit4lut_8, QINDEX_RANGE,
|
||||
VPX_BITS_8);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
init_me_luts_bd(sad_per_bit16lut_10, sad_per_bit4lut_10, QINDEX_RANGE,
|
||||
VPX_BITS_10);
|
||||
init_me_luts_bd(sad_per_bit16lut_12, sad_per_bit4lut_12, QINDEX_RANGE,
|
||||
@ -162,7 +162,7 @@ static const int rd_frame_type_factor[FRAME_UPDATE_TYPES] = {
|
||||
|
||||
int vp10_compute_rd_mult(const VP10_COMP *cpi, int qindex) {
|
||||
const int64_t q = vp10_dc_quant(qindex, 0, cpi->common.bit_depth);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int64_t rdmult = 0;
|
||||
switch (cpi->common.bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
@ -180,7 +180,7 @@ int vp10_compute_rd_mult(const VP10_COMP *cpi, int qindex) {
|
||||
}
|
||||
#else
|
||||
int64_t rdmult = 88 * q * q / 24;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cpi->oxcf.pass == 2 && (cpi->common.frame_type != KEY_FRAME)) {
|
||||
const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
|
||||
const FRAME_UPDATE_TYPE frame_type = gf_group->update_type[gf_group->index];
|
||||
@ -196,7 +196,7 @@ int vp10_compute_rd_mult(const VP10_COMP *cpi, int qindex) {
|
||||
|
||||
static int compute_rd_thresh_factor(int qindex, vpx_bit_depth_t bit_depth) {
|
||||
double q;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
q = vp10_dc_quant(qindex, 0, VPX_BITS_8) / 4.0;
|
||||
@ -214,13 +214,13 @@ static int compute_rd_thresh_factor(int qindex, vpx_bit_depth_t bit_depth) {
|
||||
#else
|
||||
(void) bit_depth;
|
||||
q = vp10_dc_quant(qindex, 0, VPX_BITS_8) / 4.0;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
// TODO(debargha): Adjust the function below.
|
||||
return VPXMAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8);
|
||||
}
|
||||
|
||||
void vp10_initialize_me_consts(VP10_COMP *cpi, MACROBLOCK *x, int qindex) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (cpi->common.bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
x->sadperbit16 = sad_per_bit16lut_8[qindex];
|
||||
@ -241,7 +241,7 @@ void vp10_initialize_me_consts(VP10_COMP *cpi, MACROBLOCK *x, int qindex) {
|
||||
(void)cpi;
|
||||
x->sadperbit16 = sad_per_bit16lut_8[qindex];
|
||||
x->sadperbit4 = sad_per_bit4lut_8[qindex];
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
static void set_block_thresholds(const VP10_COMMON *cm, RD_OPT *rd) {
|
||||
@ -654,7 +654,7 @@ void vp10_update_rd_thresh_fact(int (*factor_buf)[MAX_MODES], int rd_thresh,
|
||||
int vp10_get_intra_cost_penalty(int qindex, int qdelta,
|
||||
vpx_bit_depth_t bit_depth) {
|
||||
const int q = vp10_dc_quant(qindex, qdelta, bit_depth);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
switch (bit_depth) {
|
||||
case VPX_BITS_8:
|
||||
return 20 * q;
|
||||
@ -668,6 +668,6 @@ int vp10_get_intra_cost_penalty(int qindex, int qdelta,
|
||||
}
|
||||
#else
|
||||
return 20 * q;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
|
@ -187,10 +187,10 @@ static void model_rd_for_sb(VP10_COMP *cpi, BLOCK_SIZE bsize,
|
||||
int rate;
|
||||
int64_t dist;
|
||||
const int dequant_shift =
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
(xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ?
|
||||
xd->bd - 5 :
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
3;
|
||||
|
||||
x->pred_sse[ref] = 0;
|
||||
@ -309,7 +309,7 @@ int64_t vp10_block_error_fp_c(const int16_t *coeff, const int16_t *dqcoeff,
|
||||
return error;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
int64_t vp10_highbd_block_error_c(const tran_low_t *coeff,
|
||||
const tran_low_t *dqcoeff,
|
||||
intptr_t block_size,
|
||||
@ -331,7 +331,7 @@ int64_t vp10_highbd_block_error_c(const tran_low_t *coeff,
|
||||
*ssz = sqcoeff;
|
||||
return error;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
/* The trailing '0' is a terminator which is used inside cost_coeffs() to
|
||||
* decide whether to include cost of a trailing EOB node or not (i.e. we
|
||||
@ -363,7 +363,7 @@ static int cost_coeffs(MACROBLOCK *x,
|
||||
uint8_t token_cache[32 * 32];
|
||||
int pt = combine_entropy_contexts(*A, *L);
|
||||
int c, cost;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int16_t *cat6_high_cost = vp10_get_high_cost_table(xd->bd);
|
||||
#else
|
||||
const int16_t *cat6_high_cost = vp10_get_high_cost_table(8);
|
||||
@ -441,14 +441,14 @@ static void dist_block(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size,
|
||||
int shift = tx_size == TX_32X32 ? 0 : 2;
|
||||
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
|
||||
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int bd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? xd->bd : 8;
|
||||
*out_dist = vp10_highbd_block_error(coeff, dqcoeff, 16 << ss_txfrm_size,
|
||||
&this_sse, bd) >> shift;
|
||||
#else
|
||||
*out_dist = vp10_block_error(coeff, dqcoeff, 16 << ss_txfrm_size,
|
||||
&this_sse) >> shift;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
*out_sse = this_sse >> shift;
|
||||
}
|
||||
|
||||
@ -500,7 +500,7 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
|
||||
const int64_t orig_sse = (int64_t)coeff[0] * coeff[0];
|
||||
const int64_t resd_sse = coeff[0] - dqcoeff[0];
|
||||
int64_t dc_correct = orig_sse - resd_sse * resd_sse;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
dc_correct >>= ((xd->bd - 8) * 2);
|
||||
#endif
|
||||
if (tx_size != TX_32X32)
|
||||
@ -857,7 +857,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
|
||||
int idx, idy;
|
||||
uint8_t best_dst[8 * 8];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
uint16_t best_dst16[8 * 8];
|
||||
#endif
|
||||
|
||||
@ -865,7 +865,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
memcpy(tl, l, sizeof(tl));
|
||||
xd->mi[0]->mbmi.tx_size = TX_4X4;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
for (mode = DC_PRED; mode <= TM_PRED; ++mode) {
|
||||
int64_t this_rd;
|
||||
@ -966,7 +966,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
return best_rd;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
for (mode = DC_PRED; mode <= TM_PRED; ++mode) {
|
||||
int64_t this_rd;
|
||||
@ -1407,7 +1407,7 @@ static int64_t encode_inter_mb_segment(VP10_COMP *cpi,
|
||||
|
||||
vp10_build_inter_predictor_sub8x8(xd, 0, i, ir, ic, mi_row, mi_col);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
fwd_txm4x4 = xd->lossless[mi->mbmi.segment_id] ? vp10_highbd_fwht4x4
|
||||
: vpx_highbd_fdct4x4;
|
||||
@ -1416,9 +1416,9 @@ static int64_t encode_inter_mb_segment(VP10_COMP *cpi,
|
||||
}
|
||||
#else
|
||||
fwd_txm4x4 = xd->lossless[mi->mbmi.segment_id] ? vp10_fwht4x4 : vpx_fdct4x4;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vpx_highbd_subtract_block(
|
||||
height, width, vp10_raster_block_offset_int16(BLOCK_8X8, i, p->src_diff),
|
||||
@ -1432,7 +1432,7 @@ static int64_t encode_inter_mb_segment(VP10_COMP *cpi,
|
||||
vpx_subtract_block(height, width,
|
||||
vp10_raster_block_offset_int16(BLOCK_8X8, i, p->src_diff),
|
||||
8, src, p->src.stride, dst, pd->dst.stride);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
k = i;
|
||||
for (idy = 0; idy < height / 4; ++idy) {
|
||||
@ -1445,7 +1445,7 @@ static int64_t encode_inter_mb_segment(VP10_COMP *cpi,
|
||||
fwd_txm4x4(vp10_raster_block_offset_int16(BLOCK_8X8, k, p->src_diff),
|
||||
coeff, 8);
|
||||
vp10_regular_quantize_b_4x4(x, 0, k, so->scan, so->iscan);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
thisdistortion += vp10_highbd_block_error(coeff,
|
||||
BLOCK_OFFSET(pd->dqcoeff, k),
|
||||
@ -1457,7 +1457,7 @@ static int64_t encode_inter_mb_segment(VP10_COMP *cpi,
|
||||
#else
|
||||
thisdistortion += vp10_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, k),
|
||||
16, &ssz);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
thissse += ssz;
|
||||
thisrate += cost_coeffs(x, 0, k, ta + (k & 1), tl + (k >> 1), TX_4X4,
|
||||
so->scan, so->neighbors,
|
||||
@ -1602,12 +1602,12 @@ static void joint_motion_search(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
};
|
||||
|
||||
// Prediction buffer from second frame.
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, uint16_t, second_pred_alloc_16[64 * 64]);
|
||||
uint8_t *second_pred;
|
||||
#else
|
||||
DECLARE_ALIGNED(16, uint8_t, second_pred[64 * 64]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
for (ref = 0; ref < 2; ++ref) {
|
||||
ref_mv[ref] = x->mbmi_ext->ref_mvs[refs[ref]][0];
|
||||
@ -1628,14 +1628,14 @@ static void joint_motion_search(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
// Since we have scaled the reference frames to match the size of the current
|
||||
// frame we must use a unit scaling factor during mode selection.
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
vp10_setup_scale_factors_for_frame(&sf, cm->width, cm->height,
|
||||
cm->width, cm->height,
|
||||
cm->use_highbitdepth);
|
||||
#else
|
||||
vp10_setup_scale_factors_for_frame(&sf, cm->width, cm->height,
|
||||
cm->width, cm->height);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// Allow joint search multiple times iteratively for each reference frame
|
||||
// and break out of the search loop if it couldn't find a better mv.
|
||||
@ -1659,7 +1659,7 @@ static void joint_motion_search(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
ref_yv12[1] = xd->plane[0].pre[1];
|
||||
|
||||
// Get the prediction block from the 'other' reference frame.
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
second_pred = CONVERT_TO_BYTEPTR(second_pred_alloc_16);
|
||||
vp10_highbd_build_inter_predictor(ref_yv12[!id].buf,
|
||||
@ -1688,7 +1688,7 @@ static void joint_motion_search(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
&sf, pw, ph, 0,
|
||||
kernel, MV_PRECISION_Q3,
|
||||
mi_col * MI_SIZE, mi_row * MI_SIZE);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// Do compound motion search on the current reference frame.
|
||||
if (id)
|
||||
@ -2443,12 +2443,12 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
int refs[2] = { mbmi->ref_frame[0],
|
||||
(mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1]) };
|
||||
int_mv cur_mv[2];
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, uint16_t, tmp_buf16[MAX_MB_PLANE * 64 * 64]);
|
||||
uint8_t *tmp_buf;
|
||||
#else
|
||||
DECLARE_ALIGNED(16, uint8_t, tmp_buf[MAX_MB_PLANE * 64 * 64]);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
int pred_exists = 0;
|
||||
int intpel_mv;
|
||||
int64_t rd, tmp_rd, best_rd = INT64_MAX;
|
||||
@ -2469,13 +2469,13 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x,
|
||||
int64_t skip_sse_sb = INT64_MAX;
|
||||
int64_t distortion_y = 0, distortion_uv = 0;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
tmp_buf = CONVERT_TO_BYTEPTR(tmp_buf16);
|
||||
} else {
|
||||
tmp_buf = (uint8_t *)tmp_buf16;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
if (pred_filter_search) {
|
||||
INTERP_FILTER af = SWITCHABLE, lf = SWITCHABLE;
|
||||
@ -2866,7 +2866,7 @@ static void rd_variance_adjustment(VP10_COMP *cpi,
|
||||
if (*this_rd == INT64_MAX)
|
||||
return;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
recon_variance =
|
||||
vp10_high_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize, xd->bd);
|
||||
@ -2877,7 +2877,7 @@ static void rd_variance_adjustment(VP10_COMP *cpi,
|
||||
#else
|
||||
recon_variance =
|
||||
vp10_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
if ((source_variance + recon_variance) > LOW_VAR_THRESH) {
|
||||
absvar_diff = (source_variance > recon_variance)
|
||||
@ -3427,11 +3427,11 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
|
||||
int qstep = xd->plane[0].dequant[1];
|
||||
// TODO(debargha): Enhance this by specializing for each mode_index
|
||||
int scale = 4;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
qstep >>= (xd->bd - 8);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
if (x->source_variance < UINT_MAX) {
|
||||
const int var_adjust = (x->source_variance < 16);
|
||||
scale -= var_adjust;
|
||||
@ -4167,11 +4167,11 @@ void vp10_rd_pick_inter_mode_sub8x8(VP10_COMP *cpi,
|
||||
int qstep = xd->plane[0].dequant[1];
|
||||
// TODO(debargha): Enhance this by specializing for each mode_index
|
||||
int scale = 4;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
qstep >>= (xd->bd - 8);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
if (x->source_variance < UINT_MAX) {
|
||||
const int var_adjust = (x->source_variance < 16);
|
||||
scale -= var_adjust;
|
||||
|
@ -32,7 +32,7 @@ void vp10_rd_pick_intra_mode_sb(struct VP10_COMP *cpi, struct macroblock *x,
|
||||
unsigned int vp10_get_sby_perpixel_variance(VP10_COMP *cpi,
|
||||
const struct buf_2d *ref,
|
||||
BLOCK_SIZE bs);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
unsigned int vp10_high_get_sby_perpixel_variance(VP10_COMP *cpi,
|
||||
const struct buf_2d *ref,
|
||||
BLOCK_SIZE bs, int bd);
|
||||
|
@ -15,9 +15,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#include "vpx_dsp/vpx_dsp_common.h"
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
#include "vpx_ports/mem.h"
|
||||
#include "vp10/common/common.h"
|
||||
#include "vp10/encoder/resize.h"
|
||||
@ -537,7 +537,7 @@ void vp10_resize_plane(const uint8_t *const input,
|
||||
free(arrbuf);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void highbd_interpolate(const uint16_t *const input, int inlength,
|
||||
uint16_t *output, int outlength, int bd) {
|
||||
const int64_t delta =
|
||||
@ -831,7 +831,7 @@ void vp10_highbd_resize_plane(const uint8_t *const input,
|
||||
free(tmpbuf);
|
||||
free(arrbuf);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
void vp10_resize_frame420(const uint8_t *const y,
|
||||
int y_stride,
|
||||
@ -879,7 +879,7 @@ void vp10_resize_frame444(const uint8_t *const y, int y_stride,
|
||||
ov, oheight, owidth, ouv_stride);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_resize_frame420(const uint8_t *const y,
|
||||
int y_stride,
|
||||
const uint8_t *const u, const uint8_t *const v,
|
||||
@ -925,4 +925,4 @@ void vp10_highbd_resize_frame444(const uint8_t *const y, int y_stride,
|
||||
vp10_highbd_resize_plane(v, height, width, uv_stride,
|
||||
ov, oheight, owidth, ouv_stride, bd);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -69,7 +69,7 @@ void vp10_resize_frame444(const uint8_t *const y,
|
||||
int oheight,
|
||||
int owidth);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_resize_plane(const uint8_t *const input,
|
||||
int height,
|
||||
int width,
|
||||
@ -124,7 +124,7 @@ void vp10_highbd_resize_frame444(const uint8_t *const y,
|
||||
int oheight,
|
||||
int owidth,
|
||||
int bd);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
@ -58,7 +58,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
|
||||
mv_precision_uv = MV_PRECISION_Q3;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
vp10_highbd_build_inter_predictor(y_mb_ptr, stride,
|
||||
&pred[0], 16,
|
||||
@ -85,7 +85,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
|
||||
kernel, mv_precision_uv, x, y, xd->bd);
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
vp10_build_inter_predictor(y_mb_ptr, stride,
|
||||
&pred[0], 16,
|
||||
&mv,
|
||||
@ -163,7 +163,7 @@ void vp10_temporal_filter_apply_c(uint8_t *frame1,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vp10_highbd_temporal_filter_apply_c(uint8_t *frame1_8,
|
||||
unsigned int stride,
|
||||
uint8_t *frame2_8,
|
||||
@ -209,7 +209,7 @@ void vp10_highbd_temporal_filter_apply_c(uint8_t *frame1_8,
|
||||
byte += stride - block_width;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static int temporal_filter_find_matching_mb_c(VP10_COMP *cpi,
|
||||
uint8_t *arf_frame_buf,
|
||||
@ -287,7 +287,7 @@ static void temporal_filter_iterate_c(VP10_COMP *cpi,
|
||||
MACROBLOCKD *mbd = &cpi->td.mb.e_mbd;
|
||||
YV12_BUFFER_CONFIG *f = frames[alt_ref_index];
|
||||
uint8_t *dst1, *dst2;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
DECLARE_ALIGNED(16, uint16_t, predictor16[16 * 16 * 3]);
|
||||
DECLARE_ALIGNED(16, uint8_t, predictor8[16 * 16 * 3]);
|
||||
uint8_t *predictor;
|
||||
@ -300,7 +300,7 @@ static void temporal_filter_iterate_c(VP10_COMP *cpi,
|
||||
// Save input state
|
||||
uint8_t* input_buffer[MAX_MB_PLANE];
|
||||
int i;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
predictor = CONVERT_TO_BYTEPTR(predictor16);
|
||||
} else {
|
||||
@ -377,7 +377,7 @@ static void temporal_filter_iterate_c(VP10_COMP *cpi,
|
||||
predictor, scale,
|
||||
mb_col * 16, mb_row * 16);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
int adj_strength = strength + 2 * (mbd->bd - 8);
|
||||
// Apply the filter (YUV)
|
||||
@ -430,11 +430,11 @@ static void temporal_filter_iterate_c(VP10_COMP *cpi,
|
||||
mb_uv_width, mb_uv_height, strength,
|
||||
filter_weight, accumulator + 512,
|
||||
count + 512);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
uint16_t *dst1_16;
|
||||
uint16_t *dst2_16;
|
||||
@ -575,7 +575,7 @@ static void temporal_filter_iterate_c(VP10_COMP *cpi,
|
||||
}
|
||||
byte += stride - mb_uv_width;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
mb_y_offset += 16;
|
||||
mb_uv_offset += mb_uv_width;
|
||||
}
|
||||
@ -681,7 +681,7 @@ void vp10_temporal_filter(VP10_COMP *cpi, int distance) {
|
||||
// Setup scaling factors. Scaling on each of the arnr frames is not
|
||||
// supported.
|
||||
// ARF is produced at the native frame size and resized when coded.
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
vp10_setup_scale_factors_for_frame(&sf,
|
||||
frames[0]->y_crop_width,
|
||||
frames[0]->y_crop_height,
|
||||
@ -694,7 +694,7 @@ void vp10_temporal_filter(VP10_COMP *cpi, int distance) {
|
||||
frames[0]->y_crop_height,
|
||||
frames[0]->y_crop_width,
|
||||
frames[0]->y_crop_height);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
temporal_filter_iterate_c(cpi, frames, frames_to_blur,
|
||||
|
@ -133,7 +133,7 @@ const int16_t vp10_cat6_high_cost[128] = {
|
||||
7586, 8406, 8697, 9517, 7847, 8667, 8958, 9778, 9223, 10043, 10334, 11154
|
||||
};
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const int16_t vp10_cat6_high10_high_cost[512] = {
|
||||
74, 894, 1185, 2005, 1450, 2270, 2561,
|
||||
3381, 1711, 2531, 2822, 3642, 3087, 3907, 4198, 5018, 2120, 2940, 3231,
|
||||
@ -363,7 +363,7 @@ const int16_t vp10_cat6_high12_high_cost[2048] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static const vpx_tree_index cat1_high10[2] = {0, 0};
|
||||
static const vpx_tree_index cat2_high10[4] = {2, 2, 0, 0};
|
||||
static const vpx_tree_index cat3_high10[6] = {2, 2, 4, 4, 0, 0};
|
||||
@ -397,7 +397,7 @@ const vp10_extra_bit vp10_extra_bits[ENTROPY_TOKENS] = {
|
||||
{0, 0, 0, 0, zero_cost} // EOB_TOKEN
|
||||
};
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const vp10_extra_bit vp10_extra_bits_high10[ENTROPY_TOKENS] = {
|
||||
{0, 0, 0, 0, zero_cost}, // ZERO
|
||||
{0, 0, 0, 1, sign_cost}, // ONE
|
||||
|
@ -22,7 +22,7 @@ extern "C" {
|
||||
|
||||
#define EOSB_TOKEN 127 // Not signalled, encoder only
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
typedef int32_t EXTRABIT;
|
||||
#else
|
||||
typedef int16_t EXTRABIT;
|
||||
@ -73,7 +73,7 @@ static INLINE int16_t vp10_get_cost(int16_t token, EXTRABIT extrabits,
|
||||
+ cat6_high_table[extrabits >> 8];
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE const int16_t* vp10_get_high_cost_table(int bit_depth) {
|
||||
return bit_depth == 8 ? vp10_cat6_high_cost
|
||||
: (bit_depth == 10 ? vp10_cat6_high10_high_cost :
|
||||
@ -84,7 +84,7 @@ static INLINE const int16_t* vp10_get_high_cost_table(int bit_depth) {
|
||||
(void) bit_depth;
|
||||
return vp10_cat6_high_cost;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static INLINE void vp10_get_token_extra(int v, int16_t *token, EXTRABIT *extra) {
|
||||
if (v >= CAT6_MIN_VAL || v <= -CAT6_MIN_VAL) {
|
||||
|
@ -65,7 +65,7 @@ cglobal fwht4x4, 3, 4, 8, input, output, stride
|
||||
psllw m2, 2
|
||||
psllw m3, 2
|
||||
|
||||
%if CONFIG_VP9_HIGHBITDEPTH
|
||||
%if CONFIG_VPX_HIGHBITDEPTH
|
||||
pxor m4, m4
|
||||
pxor m5, m5
|
||||
pcmpgtw m4, m0
|
||||
|
@ -73,7 +73,7 @@ VP10_COMMON_SRCS-$(HAVE_SSE2) += common/x86/mfqe_sse2.asm
|
||||
VP10_COMMON_SRCS-$(HAVE_SSE2) += common/x86/postproc_sse2.asm
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifneq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
VP10_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/itrans4_dspr2.c
|
||||
VP10_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/itrans8_dspr2.c
|
||||
VP10_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/itrans16_dspr2.c
|
||||
@ -93,7 +93,7 @@ VP10_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp10_fwd_txfm_sse2.c
|
||||
VP10_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp10_fwd_dct32x32_impl_sse2.h
|
||||
VP10_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp10_fwd_txfm_impl_sse2.h
|
||||
|
||||
ifneq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifneq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
VP10_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/iht4x4_add_neon.c
|
||||
VP10_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/iht8x8_add_neon.c
|
||||
endif
|
||||
|
@ -245,7 +245,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
|
||||
ERROR("rc_twopass_stats_in missing EOS stats packet");
|
||||
}
|
||||
|
||||
#if !CONFIG_VP9_HIGHBITDEPTH
|
||||
#if !CONFIG_VPX_HIGHBITDEPTH
|
||||
if (cfg->g_profile > (unsigned int)PROFILE_1) {
|
||||
ERROR("Profile > 1 not supported in this build configuration");
|
||||
}
|
||||
@ -717,7 +717,7 @@ static vpx_codec_err_t encoder_init(vpx_codec_ctx_t *ctx,
|
||||
|
||||
if (res == VPX_CODEC_OK) {
|
||||
set_encoder_config(&priv->oxcf, &priv->cfg, &priv->extra_cfg);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
priv->oxcf.use_highbitdepth =
|
||||
(ctx->init_flags & VPX_CODEC_USE_HIGHBITDEPTH) ? 1 : 0;
|
||||
#endif
|
||||
@ -1368,7 +1368,7 @@ static vpx_codec_enc_cfg_map_t encoder_usage_cfg_map[] = {
|
||||
CODEC_INTERFACE(vpx_codec_vp10_cx) = {
|
||||
"WebM Project VP10 Encoder" VERSION_STRING,
|
||||
VPX_CODEC_INTERNAL_ABI_VERSION,
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
VPX_CODEC_CAP_HIGHBITDEPTH |
|
||||
#endif
|
||||
VPX_CODEC_CAP_ENCODER | VPX_CODEC_CAP_PSNR, // vpx_codec_caps_t
|
||||
|
@ -55,7 +55,7 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
|
||||
img->stride[VPX_PLANE_U] = yv12->uv_stride;
|
||||
img->stride[VPX_PLANE_V] = yv12->uv_stride;
|
||||
img->stride[VPX_PLANE_ALPHA] = yv12->y_stride;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (yv12->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||
// vpx_image_t uses byte strides and a pointer to the first byte
|
||||
// of the image.
|
||||
@ -70,7 +70,7 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
|
||||
img->stride[VPX_PLANE_V] = 2 * yv12->uv_stride;
|
||||
img->stride[VPX_PLANE_ALPHA] = 2 * yv12->y_stride;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
img->bps = bps;
|
||||
img->user_priv = user_priv;
|
||||
img->img_data = yv12->buffer_alloc;
|
||||
@ -103,7 +103,7 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
|
||||
yv12->color_space = img->cs;
|
||||
yv12->color_range = img->range;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
if (img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) {
|
||||
// In vpx_image_t
|
||||
// planes point to uint8 address of start of data
|
||||
@ -127,7 +127,7 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
|
||||
yv12->border = (yv12->y_stride - img->w) / 2;
|
||||
#else
|
||||
yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
yv12->subsampling_x = img->x_chroma_shift;
|
||||
yv12->subsampling_y = img->y_chroma_shift;
|
||||
return VPX_CODEC_OK;
|
||||
|
@ -88,7 +88,7 @@ VP10_CX_SRCS-yes += encoder/mbgraph.h
|
||||
|
||||
VP10_CX_SRCS-$(HAVE_SSE2) += encoder/x86/temporal_filter_apply_sse2.asm
|
||||
VP10_CX_SRCS-$(HAVE_SSE2) += encoder/x86/quantize_sse2.c
|
||||
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
VP10_CX_SRCS-$(HAVE_SSE2) += encoder/x86/highbd_block_error_intrin_sse2.c
|
||||
endif
|
||||
|
||||
@ -112,7 +112,7 @@ endif
|
||||
|
||||
VP10_CX_SRCS-$(HAVE_AVX2) += encoder/x86/error_intrin_avx2.c
|
||||
|
||||
ifneq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifneq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
VP10_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/dct_neon.c
|
||||
VP10_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/error_neon.c
|
||||
endif
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "vpx/vp8cx.h"
|
||||
#include "vpx/vpx_encoder.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "vp9/common/vp9_onyxc_int.h"
|
||||
#include "vp10/common/onyxc_int.h"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define strtok_r strtok_s
|
||||
|
@ -190,7 +190,7 @@ void vpx_minmax_8x8_c(const uint8_t *s, int p, const uint8_t *d, int dp,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
unsigned int vpx_highbd_avg_8x8_c(const uint8_t *s8, int p) {
|
||||
int i, j;
|
||||
int sum = 0;
|
||||
@ -226,6 +226,6 @@ void vpx_highbd_minmax_8x8_c(const uint8_t *s8, int p, const uint8_t *d8,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
|
||||
|
@ -780,7 +780,7 @@ void vpx_fdct32x32_1_c(const int16_t *input, tran_low_t *output, int stride) {
|
||||
output[1] = 0;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_fdct4x4_c(const int16_t *input, tran_low_t *output,
|
||||
int stride) {
|
||||
vpx_fdct4x4_c(input, output, stride);
|
||||
@ -819,4 +819,4 @@ void vpx_highbd_fdct32x32_1_c(const int16_t *input, tran_low_t *out,
|
||||
int stride) {
|
||||
vpx_fdct32x32_1_c(input, out, stride);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -495,7 +495,7 @@ void vpx_d153_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
|
||||
DST(1, 3) = AVG3(L, K, J);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE void highbd_d207_predictor(uint16_t *dst, ptrdiff_t stride,
|
||||
int bs, const uint16_t *above,
|
||||
const uint16_t *left, int bd) {
|
||||
@ -776,7 +776,7 @@ static INLINE void highbd_dc_predictor(uint16_t *dst, ptrdiff_t stride,
|
||||
dst += stride;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// This serves as a wrapper function, so that all the prediction functions
|
||||
// can be unified and accessed as a pointer array. Note that the boundary
|
||||
@ -789,7 +789,7 @@ static INLINE void highbd_dc_predictor(uint16_t *dst, ptrdiff_t stride,
|
||||
type##_predictor(dst, stride, size, above, left); \
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#define intra_pred_highbd_sized(type, size) \
|
||||
void vpx_highbd_##type##_predictor_##size##x##size##_c( \
|
||||
uint16_t *dst, ptrdiff_t stride, const uint16_t *above, \
|
||||
@ -827,7 +827,7 @@ static INLINE void highbd_dc_predictor(uint16_t *dst, ptrdiff_t stride,
|
||||
intra_pred_sized(type, 8) \
|
||||
intra_pred_sized(type, 16) \
|
||||
intra_pred_sized(type, 32)
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
intra_pred_no_4x4(d207)
|
||||
intra_pred_no_4x4(d63)
|
||||
|
@ -1263,7 +1263,7 @@ void vpx_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int stride) {
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest8,
|
||||
int stride, int bd) {
|
||||
/* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds,
|
||||
@ -2510,4 +2510,4 @@ void vpx_highbd_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest8,
|
||||
dest += stride;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -40,7 +40,7 @@ static INLINE tran_low_t dct_const_round_shift(tran_high_t input) {
|
||||
return check_range(rv);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE tran_low_t highbd_check_range(tran_high_t input,
|
||||
int bd) {
|
||||
#if CONFIG_COEFFICIENT_RANGE_CHECKING
|
||||
@ -64,7 +64,7 @@ static INLINE tran_low_t highbd_dct_const_round_shift(tran_high_t input,
|
||||
tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
|
||||
return highbd_check_range(rv, bd);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_EMULATE_HARDWARE
|
||||
// When CONFIG_EMULATE_HARDWARE is 1 the transform performs a
|
||||
@ -96,7 +96,7 @@ void iadst4_c(const tran_low_t *input, tran_low_t *output);
|
||||
void iadst8_c(const tran_low_t *input, tran_low_t *output);
|
||||
void iadst16_c(const tran_low_t *input, tran_low_t *output);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_idct4_c(const tran_low_t *input, tran_low_t *output, int bd);
|
||||
void vpx_highbd_idct8_c(const tran_low_t *input, tran_low_t *output, int bd);
|
||||
void vpx_highbd_idct16_c(const tran_low_t *input, tran_low_t *output, int bd);
|
||||
|
@ -18,7 +18,7 @@ static INLINE int8_t signed_char_clamp(int t) {
|
||||
return (int8_t)clamp(t, -128, 127);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE int16_t signed_char_clamp_high(int t, int bd) {
|
||||
switch (bd) {
|
||||
case 10:
|
||||
@ -353,7 +353,7 @@ void vpx_lpf_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 16);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
// Should we apply any filter at all: 11111111 yes, 00000000 no ?
|
||||
static INLINE int8_t highbd_filter_mask(uint8_t limit, uint8_t blimit,
|
||||
uint16_t p3, uint16_t p2,
|
||||
@ -742,4 +742,4 @@ void vpx_highbd_lpf_vertical_16_dual_c(uint16_t *s, int p,
|
||||
int bd) {
|
||||
highbd_mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 16, bd);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -36,7 +36,7 @@ void vpx_quantize_dc(const tran_low_t *coeff_ptr,
|
||||
*eob_ptr = eob + 1;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_quantize_dc(const tran_low_t *coeff_ptr,
|
||||
int n_coeffs, int skip_block,
|
||||
const int16_t *round_ptr, const int16_t quant,
|
||||
@ -88,7 +88,7 @@ void vpx_quantize_dc_32x32(const tran_low_t *coeff_ptr, int skip_block,
|
||||
*eob_ptr = eob + 1;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_quantize_dc_32x32(const tran_low_t *coeff_ptr,
|
||||
int skip_block,
|
||||
const int16_t *round_ptr,
|
||||
@ -169,7 +169,7 @@ void vpx_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
|
||||
*eob_ptr = eob + 1;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
|
||||
int skip_block, const int16_t *zbin_ptr,
|
||||
const int16_t *round_ptr, const int16_t *quant_ptr,
|
||||
@ -278,7 +278,7 @@ void vpx_quantize_b_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
|
||||
*eob_ptr = eob + 1;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_quantize_b_32x32_c(const tran_low_t *coeff_ptr,
|
||||
intptr_t n_coeffs, int skip_block,
|
||||
const int16_t *zbin_ptr,
|
||||
|
@ -28,7 +28,7 @@ void vpx_quantize_dc_32x32(const tran_low_t *coeff_ptr, int skip_block,
|
||||
tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
|
||||
const int16_t dequant_ptr, uint16_t *eob_ptr);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_quantize_dc(const tran_low_t *coeff_ptr,
|
||||
int n_coeffs, int skip_block,
|
||||
const int16_t *round_ptr, const int16_t quant_ptr,
|
||||
|
@ -55,7 +55,7 @@ static INLINE void avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE void highbd_avg_pred(uint16_t *comp_pred, const uint8_t *pred8,
|
||||
int width, int height, const uint8_t *ref8,
|
||||
int ref_stride) {
|
||||
@ -72,7 +72,7 @@ static INLINE void highbd_avg_pred(uint16_t *comp_pred, const uint8_t *pred8,
|
||||
ref += ref_stride;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#define sadMxN(m, n) \
|
||||
unsigned int vpx_sad##m##x##n##_c(const uint8_t *src, int src_stride, \
|
||||
@ -176,7 +176,7 @@ sadMxNxK(4, 4, 3)
|
||||
sadMxNxK(4, 4, 8)
|
||||
sadMxNx4D(4, 4)
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE unsigned int highbd_sad(const uint8_t *a8, int a_stride,
|
||||
const uint8_t *b8, int b_stride,
|
||||
int width, int height) {
|
||||
@ -315,4 +315,4 @@ highbd_sadMxNxK(4, 4, 3)
|
||||
highbd_sadMxNxK(4, 4, 8)
|
||||
highbd_sadMxNx4D(4, 4)
|
||||
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -45,7 +45,7 @@ void vpx_ssim_parms_8x8_c(const uint8_t *s, int sp, const uint8_t *r, int rp,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_ssim_parms_8x8_c(const uint16_t *s, int sp,
|
||||
const uint16_t *r, int rp,
|
||||
uint32_t *sum_s, uint32_t *sum_r,
|
||||
@ -62,7 +62,7 @@ void vpx_highbd_ssim_parms_8x8_c(const uint16_t *s, int sp,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static const int64_t cc1 = 26634; // (64^2*(.01*255)^2
|
||||
static const int64_t cc2 = 239708; // (64^2*(.03*255)^2
|
||||
@ -94,7 +94,7 @@ static double ssim_8x8(const uint8_t *s, int sp, const uint8_t *r, int rp) {
|
||||
return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 64);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static double highbd_ssim_8x8(const uint16_t *s, int sp, const uint16_t *r,
|
||||
int rp, unsigned int bd) {
|
||||
uint32_t sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0;
|
||||
@ -108,7 +108,7 @@ static double highbd_ssim_8x8(const uint16_t *s, int sp, const uint16_t *r,
|
||||
sum_sxr >> (2 * oshift),
|
||||
64);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
// We are using a 8x8 moving window with starting location of each 8x8 window
|
||||
// on the 4x4 pixel grid. Such arrangement allows the windows to overlap
|
||||
@ -133,7 +133,7 @@ static double vpx_ssim2(const uint8_t *img1, const uint8_t *img2,
|
||||
return ssim_total;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static double vpx_highbd_ssim2(const uint8_t *img1, const uint8_t *img2,
|
||||
int stride_img1, int stride_img2, int width,
|
||||
int height, unsigned int bd) {
|
||||
@ -155,7 +155,7 @@ static double vpx_highbd_ssim2(const uint8_t *img1, const uint8_t *img2,
|
||||
ssim_total /= samples;
|
||||
return ssim_total;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
double vpx_calc_ssim(const YV12_BUFFER_CONFIG *source,
|
||||
const YV12_BUFFER_CONFIG *dest,
|
||||
@ -452,7 +452,7 @@ double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch,
|
||||
}
|
||||
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
double vpx_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
|
||||
const YV12_BUFFER_CONFIG *dest,
|
||||
double *weight, unsigned int bd) {
|
||||
@ -502,4 +502,4 @@ double vpx_highbd_calc_ssimg(const YV12_BUFFER_CONFIG *source,
|
||||
|
||||
return ssim_all;
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -80,7 +80,7 @@ double vpx_psnrhvs(const YV12_BUFFER_CONFIG *source,
|
||||
const YV12_BUFFER_CONFIG *dest,
|
||||
double *ssim_y, double *ssim_u, double *ssim_v);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
double vpx_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
|
||||
const YV12_BUFFER_CONFIG *dest,
|
||||
double *weight,
|
||||
@ -92,7 +92,7 @@ double vpx_highbd_calc_ssimg(const YV12_BUFFER_CONFIG *source,
|
||||
double *ssim_u,
|
||||
double *ssim_v,
|
||||
unsigned int bd);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
@ -32,7 +32,7 @@ void vpx_subtract_block_c(int rows, int cols,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_subtract_block_c(int rows, int cols,
|
||||
int16_t *diff, ptrdiff_t diff_stride,
|
||||
const uint8_t *src8, ptrdiff_t src_stride,
|
||||
@ -53,4 +53,4 @@ void vpx_highbd_subtract_block_c(int rows, int cols,
|
||||
src += src_stride;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -272,7 +272,7 @@ void vpx_comp_avg_pred_c(uint8_t *comp_pred, const uint8_t *pred,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void highbd_variance64(const uint8_t *a8, int a_stride,
|
||||
const uint8_t *b8, int b_stride,
|
||||
int w, int h, uint64_t *sse, uint64_t *sum) {
|
||||
@ -618,4 +618,4 @@ void vpx_highbd_comp_avg_pred(uint16_t *comp_pred, const uint8_t *pred8,
|
||||
ref += ref_stride;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -336,7 +336,7 @@ void vpx_scaled_avg_2d_c(const uint8_t *src, ptrdiff_t src_stride,
|
||||
filter_y, y_step_q4, w, h);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static void highbd_convolve_horiz(const uint8_t *src8, ptrdiff_t src_stride,
|
||||
uint8_t *dst8, ptrdiff_t dst_stride,
|
||||
const InterpKernel *x_filters,
|
||||
|
@ -23,7 +23,7 @@ typedef void (*convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride,
|
||||
const int16_t *filter_y, int y_step_q4,
|
||||
int w, int h);
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
typedef void (*highbd_convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride,
|
||||
uint8_t *dst, ptrdiff_t dst_stride,
|
||||
const int16_t *filter_x, int x_step_q4,
|
||||
|
@ -45,12 +45,12 @@ DSP_SRCS-$(HAVE_SSSE3) += x86/intrapred_ssse3.asm
|
||||
DSP_SRCS-$(HAVE_SSSE3) += x86/vpx_subpixel_8t_ssse3.asm
|
||||
endif # CONFIG_USE_X86INC
|
||||
|
||||
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_USE_X86INC),yes)
|
||||
DSP_SRCS-$(HAVE_SSE) += x86/highbd_intrapred_sse2.asm
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_intrapred_sse2.asm
|
||||
endif # CONFIG_USE_X86INC
|
||||
endif # CONFIG_VP9_HIGHBITDEPTH
|
||||
endif # CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
DSP_SRCS-$(HAVE_NEON_ASM) += arm/intrapred_neon_asm$(ASM)
|
||||
DSP_SRCS-$(HAVE_NEON) += arm/intrapred_neon.c
|
||||
@ -75,7 +75,7 @@ DSP_SRCS-$(HAVE_SSSE3) += x86/vpx_subpixel_8t_ssse3.asm
|
||||
DSP_SRCS-$(HAVE_SSSE3) += x86/vpx_subpixel_bilinear_ssse3.asm
|
||||
DSP_SRCS-$(HAVE_AVX2) += x86/vpx_subpixel_8t_intrin_avx2.c
|
||||
DSP_SRCS-$(HAVE_SSSE3) += x86/vpx_subpixel_8t_intrin_ssse3.c
|
||||
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/vpx_high_subpixel_8t_sse2.asm
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/vpx_high_subpixel_bilinear_sse2.asm
|
||||
endif
|
||||
@ -156,9 +156,9 @@ DSP_SRCS-$(HAVE_DSPR2) += mips/loopfilter_mb_dspr2.c
|
||||
DSP_SRCS-$(HAVE_DSPR2) += mips/loopfilter_mb_horiz_dspr2.c
|
||||
DSP_SRCS-$(HAVE_DSPR2) += mips/loopfilter_mb_vert_dspr2.c
|
||||
|
||||
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_loopfilter_sse2.c
|
||||
endif # CONFIG_VP9_HIGHBITDEPTH
|
||||
endif # CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
DSP_SRCS-yes += txfm_common.h
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/txfm_common_sse2.h
|
||||
@ -227,14 +227,14 @@ DSP_SRCS-$(HAVE_MSA) += mips/idct8x8_msa.c
|
||||
DSP_SRCS-$(HAVE_MSA) += mips/idct16x16_msa.c
|
||||
DSP_SRCS-$(HAVE_MSA) += mips/idct32x32_msa.c
|
||||
|
||||
ifneq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifneq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
DSP_SRCS-$(HAVE_DSPR2) += mips/inv_txfm_dspr2.h
|
||||
DSP_SRCS-$(HAVE_DSPR2) += mips/itrans4_dspr2.c
|
||||
DSP_SRCS-$(HAVE_DSPR2) += mips/itrans8_dspr2.c
|
||||
DSP_SRCS-$(HAVE_DSPR2) += mips/itrans16_dspr2.c
|
||||
DSP_SRCS-$(HAVE_DSPR2) += mips/itrans32_dspr2.c
|
||||
DSP_SRCS-$(HAVE_DSPR2) += mips/itrans32_cols_dspr2.c
|
||||
endif # CONFIG_VP9_HIGHBITDEPTH
|
||||
endif # CONFIG_VPX_HIGHBITDEPTH
|
||||
endif # CONFIG_VP9 || CONFIG_VP10
|
||||
|
||||
# quantization
|
||||
@ -243,7 +243,7 @@ DSP_SRCS-yes += quantize.c
|
||||
DSP_SRCS-yes += quantize.h
|
||||
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/quantize_sse2.c
|
||||
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_quantize_intrin_sse2.c
|
||||
endif
|
||||
ifeq ($(ARCH_X86_64),yes)
|
||||
@ -292,10 +292,10 @@ DSP_SRCS-$(HAVE_SSE2) += x86/sad4d_sse2.asm
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/sad_sse2.asm
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/subtract_sse2.asm
|
||||
|
||||
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_sad4d_sse2.asm
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_sad_sse2.asm
|
||||
endif # CONFIG_VP9_HIGHBITDEPTH
|
||||
endif # CONFIG_VPX_HIGHBITDEPTH
|
||||
endif # CONFIG_USE_X86INC
|
||||
|
||||
endif # CONFIG_ENCODERS
|
||||
@ -334,13 +334,13 @@ DSP_SRCS-$(HAVE_SSE) += x86/subpel_variance_sse2.asm
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/subpel_variance_sse2.asm # Contains SSE2 and SSSE3
|
||||
endif # CONFIG_USE_X86INC
|
||||
|
||||
ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
|
||||
ifeq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_variance_sse2.c
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_variance_impl_sse2.asm
|
||||
ifeq ($(CONFIG_USE_X86INC),yes)
|
||||
DSP_SRCS-$(HAVE_SSE2) += x86/highbd_subpel_variance_impl_sse2.asm
|
||||
endif # CONFIG_USE_X86INC
|
||||
endif # CONFIG_VP9_HIGHBITDEPTH
|
||||
endif # CONFIG_VPX_HIGHBITDEPTH
|
||||
endif # CONFIG_ENCODERS || CONFIG_POSTPROC || CONFIG_VP9_POSTPROC
|
||||
|
||||
DSP_SRCS-no += $(DSP_SRCS_REMOVE-yes)
|
||||
|
@ -23,7 +23,7 @@ extern "C" {
|
||||
#define VPXMIN(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#define VPXMAX(x, y) (((x) > (y)) ? (x) : (y))
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
// Note:
|
||||
// tran_low_t is the datatype used for final transform coefficients.
|
||||
// tran_high_t is the datatype used for intermediate transform stages.
|
||||
@ -35,7 +35,7 @@ typedef int32_t tran_low_t;
|
||||
// tran_high_t is the datatype used for intermediate transform stages.
|
||||
typedef int32_t tran_high_t;
|
||||
typedef int16_t tran_low_t;
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
static INLINE uint8_t clip_pixel(int val) {
|
||||
return (val > 255) ? 255 : (val < 0) ? 0 : val;
|
||||
@ -49,7 +49,7 @@ static INLINE double fclamp(double value, double low, double high) {
|
||||
return value < low ? low : (value > high ? high : value);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
static INLINE uint16_t clip_pixel_highbd(int val, int bd) {
|
||||
switch (bd) {
|
||||
case 8:
|
||||
@ -61,7 +61,7 @@ static INLINE uint16_t clip_pixel_highbd(int val, int bd) {
|
||||
return (uint16_t)clamp(val, 0, 4095);
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
@ -256,7 +256,7 @@ add_proto qw/void vpx_dc_128_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride
|
||||
specialize qw/vpx_dc_128_predictor_32x32 msa neon/, "$sse2_x86inc";
|
||||
|
||||
# High bitdepth functions
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/void vpx_highbd_d207_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
|
||||
specialize qw/vpx_highbd_d207_predictor_4x4/;
|
||||
|
||||
@ -448,7 +448,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
|
||||
add_proto qw/void vpx_highbd_dc_128_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
|
||||
specialize qw/vpx_highbd_dc_128_predictor_32x32/;
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#
|
||||
# Sub Pixel Filters
|
||||
@ -495,7 +495,7 @@ specialize qw/vpx_scaled_avg_horiz/;
|
||||
add_proto qw/void vpx_scaled_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
|
||||
specialize qw/vpx_scaled_avg_vert/;
|
||||
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
#
|
||||
# Sub Pixel Filters
|
||||
#
|
||||
@ -522,7 +522,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
|
||||
add_proto qw/void vpx_highbd_convolve8_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
|
||||
specialize qw/vpx_highbd_convolve8_avg_vert/, "$sse2_x86_64";
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#
|
||||
# Loopfilter
|
||||
@ -565,7 +565,7 @@ specialize qw/vpx_lpf_horizontal_4 mmx neon dspr2 msa/;
|
||||
add_proto qw/void vpx_lpf_horizontal_4_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1";
|
||||
specialize qw/vpx_lpf_horizontal_4_dual sse2 neon dspr2 msa/;
|
||||
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/void vpx_highbd_lpf_vertical_16/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd";
|
||||
specialize qw/vpx_highbd_lpf_vertical_16 sse2/;
|
||||
|
||||
@ -598,7 +598,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
|
||||
add_proto qw/void vpx_highbd_lpf_horizontal_4_dual/, "uint16_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd";
|
||||
specialize qw/vpx_highbd_lpf_horizontal_4_dual sse2/;
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#
|
||||
# Encoder functions.
|
||||
@ -608,7 +608,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
# Forward transform
|
||||
#
|
||||
if ((vpx_config("CONFIG_VP9_ENCODER") eq "yes") || (vpx_config("CONFIG_VP10_ENCODER") eq "yes")) {
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/void vpx_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
|
||||
specialize qw/vpx_fdct4x4 sse2/;
|
||||
|
||||
@ -686,13 +686,13 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
|
||||
add_proto qw/void vpx_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride";
|
||||
specialize qw/vpx_fdct32x32_1 sse2 msa/;
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
} # CONFIG_VP9_ENCODER || CONFIG_VP10_ENCODER
|
||||
|
||||
#
|
||||
# Inverse transform
|
||||
if ((vpx_config("CONFIG_VP9") eq "yes") || (vpx_config("CONFIG_VP10") eq "yes")) {
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
# Note as optimized versions of these functions are added we need to add a check to ensure
|
||||
# that when CONFIG_EMULATE_HARDWARE is on, it defaults to the C versions only.
|
||||
add_proto qw/void vpx_iwht4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
|
||||
@ -924,7 +924,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/void vpx_iwht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
|
||||
specialize qw/vpx_iwht4x4_16_add msa/, "$sse2_x86inc";
|
||||
} # CONFIG_EMULATE_HARDWARE
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
} # CONFIG_VP9 || CONFIG_VP10
|
||||
|
||||
#
|
||||
@ -937,13 +937,13 @@ if ((vpx_config("CONFIG_VP9_ENCODER") eq "yes") || (vpx_config("CONFIG_VP10_ENCO
|
||||
add_proto qw/void vpx_quantize_b_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
|
||||
specialize qw/vpx_quantize_b_32x32/, "$ssse3_x86_64_x86inc", "$avx_x86_64_x86inc";
|
||||
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/void vpx_highbd_quantize_b/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
|
||||
specialize qw/vpx_highbd_quantize_b sse2/;
|
||||
|
||||
add_proto qw/void vpx_highbd_quantize_b_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
|
||||
specialize qw/vpx_highbd_quantize_b_32x32 sse2/;
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
} # CONFIG_VP9_ENCODER || CONFIG_VP10_ENCODER
|
||||
|
||||
if (vpx_config("CONFIG_ENCODERS") eq "yes") {
|
||||
@ -1172,7 +1172,7 @@ if (vpx_config("CONFIG_INTERNAL_STATS") eq "yes") {
|
||||
specialize qw/vpx_ssim_parms_16x16/, "$sse2_x86_64";
|
||||
}
|
||||
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
#
|
||||
# Block subtraction
|
||||
#
|
||||
@ -1372,7 +1372,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/void vpx_highbd_ssim_parms_8x8/, "const uint16_t *s, int sp, const uint16_t *r, int rp, uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s, uint32_t *sum_sq_r, uint32_t *sum_sxr";
|
||||
specialize qw/vpx_highbd_ssim_parms_8x8/;
|
||||
}
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
} # CONFIG_ENCODERS
|
||||
|
||||
if (vpx_config("CONFIG_ENCODERS") eq "yes" || vpx_config("CONFIG_POSTPROC") eq "yes" || vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
|
||||
@ -1541,7 +1541,7 @@ add_proto qw/uint32_t vpx_variance_halfpixvar16x16_v/, "const unsigned char *src
|
||||
add_proto qw/uint32_t vpx_variance_halfpixvar16x16_hv/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_variance_halfpixvar16x16_hv mmx sse2 media/;
|
||||
|
||||
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/unsigned int vpx_highbd_12_variance64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
|
||||
specialize qw/vpx_highbd_12_variance64x64 sse2/;
|
||||
|
||||
@ -1898,7 +1898,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
|
||||
add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred";
|
||||
add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred";
|
||||
|
||||
} # CONFIG_VP9_HIGHBITDEPTH
|
||||
} # CONFIG_VPX_HIGHBITDEPTH
|
||||
} # CONFIG_ENCODERS || CONFIG_POSTPROC || CONFIG_VP9_POSTPROC
|
||||
|
||||
1;
|
||||
|
@ -136,7 +136,7 @@ void vpx_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \
|
||||
} \
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
typedef void highbd_filter8_1dfunction (
|
||||
const uint16_t *src_ptr,
|
||||
@ -285,6 +285,6 @@ void vpx_highbd_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \
|
||||
h, bd); \
|
||||
} \
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
||||
#endif // VPX_DSP_X86_CONVOLVE_H_
|
||||
|
@ -246,7 +246,7 @@ void vpx_fdct32x32_1_sse2(const int16_t *input, tran_low_t *output,
|
||||
#undef FDCT32x32_HIGH_PRECISION
|
||||
#undef DCT_HIGH_BIT_DEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
#define DCT_HIGH_BIT_DEPTH 1
|
||||
#define FDCT4x4_2D vpx_highbd_fdct4x4_sse2
|
||||
#define FDCT8x8_2D vpx_highbd_fdct8x8_sse2
|
||||
@ -268,4 +268,4 @@ void vpx_fdct32x32_1_sse2(const int16_t *input, tran_low_t *output,
|
||||
#undef FDCT32x32_2D
|
||||
#undef FDCT32x32_HIGH_PRECISION
|
||||
#undef DCT_HIGH_BIT_DEPTH
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
|
@ -323,7 +323,7 @@ static INLINE int k_check_epi32_overflow_32(const __m128i *preg0,
|
||||
}
|
||||
|
||||
static INLINE void store_output(const __m128i *poutput, tran_low_t* dst_ptr) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const __m128i zero = _mm_setzero_si128();
|
||||
const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero);
|
||||
__m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits);
|
||||
@ -332,11 +332,11 @@ static INLINE void store_output(const __m128i *poutput, tran_low_t* dst_ptr) {
|
||||
_mm_store_si128((__m128i *)(dst_ptr + 4), out1);
|
||||
#else
|
||||
_mm_store_si128((__m128i *)(dst_ptr), *poutput);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
static INLINE void storeu_output(const __m128i *poutput, tran_low_t* dst_ptr) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
const __m128i zero = _mm_setzero_si128();
|
||||
const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero);
|
||||
__m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits);
|
||||
@ -345,7 +345,7 @@ static INLINE void storeu_output(const __m128i *poutput, tran_low_t* dst_ptr) {
|
||||
_mm_storeu_si128((__m128i *)(dst_ptr + 4), out1);
|
||||
#else
|
||||
_mm_storeu_si128((__m128i *)(dst_ptr), *poutput);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VPX_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "vpx_ports/mem.h"
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_VPX_HIGHBITDEPTH
|
||||
void vpx_highbd_quantize_b_sse2(const tran_low_t *coeff_ptr,
|
||||
intptr_t count,
|
||||
int skip_block,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user