Commit c0057929 authored by Johann Koenig's avatar Johann Koenig Committed by Gerrit Code Review
Browse files

Merge "Make vp9 subpixel match vp8"

parents fd891a96 eb88b172
......@@ -21,6 +21,9 @@
#include "vpx/vpx_integer.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
#if CONFIG_VP8_ENCODER
# include "./vp8_rtcd.h"
#endif // CONFIG_VP8_ENCODER
#if CONFIG_VP9_ENCODER
# include "./vp9_rtcd.h"
# include "vp9/encoder/vp9_variance.h"
......@@ -32,10 +35,13 @@ namespace {
typedef unsigned int (*VarianceMxNFunc)(const uint8_t *a, int a_stride,
const uint8_t *b, int b_stride,
unsigned int *sse);
typedef unsigned int (*SubpixVarMxNFunc)(const uint8_t *a, int a_stride,
int xoffset, int yoffset,
const uint8_t *b, int b_stride,
unsigned int *sse);
typedef unsigned int (*Get4x4SseFunc)(const uint8_t *a, int a_stride,
const uint8_t *b, int b_stride);
using ::std::tr1::get;
using ::std::tr1::make_tuple;
using ::std::tr1::tuple;
......@@ -102,6 +108,12 @@ static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref,
(l2w + l2h)));
}
/* The subpel reference functions differ from the codec version in one aspect:
* they calculate the bilinear factors directly instead of using a lookup table
* and therefore upshift xoff and yoff by 1. Only every other calculated value
* is used so the codec version shrinks the table to save space and maintain
* compatibility with vp8.
*/
static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
int l2w, int l2h, int xoff, int yoff,
uint32_t *sse_ptr,
......@@ -111,6 +123,10 @@ static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
uint64_t sse = 0;
const int w = 1 << l2w;
const int h = 1 << l2h;
xoff <<= 1;
yoff <<= 1;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
// Bilinear interpolation at a 16th pel step.
......@@ -480,6 +496,10 @@ static uint32_t subpel_avg_variance_ref(const uint8_t *ref,
uint64_t sse = 0;
const int w = 1 << l2w;
const int h = 1 << l2h;
xoff <<= 1;
yoff <<= 1;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
// bilinear interpolation at a 16th pel step
......@@ -598,8 +618,8 @@ class SubpelVarianceTest
template<typename SubpelVarianceFunctionType>
void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
for (int x = 0; x < 16; ++x) {
for (int y = 0; y < 16; ++y) {
for (int x = 0; x < 8; ++x) {
for (int y = 0; y < 8; ++y) {
if (!use_high_bit_depth_) {
for (int j = 0; j < block_size_; j++) {
src_[j] = rnd_.Rand8();
......@@ -621,8 +641,9 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
unsigned int var1;
ASM_REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y,
src_, width_, &sse1));
const unsigned int var2 = subpel_variance_ref(ref_, src_, log2width_,
log2height_, x, y, &sse2,
const unsigned int var2 = subpel_variance_ref(ref_, src_,
log2width_, log2height_,
x, y, &sse2,
use_high_bit_depth_,
bit_depth_);
EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
......@@ -636,8 +657,8 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
// Compare against reference.
// Src: Set the first half of values to 0, the second half to the maximum.
// Ref: Set the first half of values to the maximum, the second half to 0.
for (int x = 0; x < 16; ++x) {
for (int y = 0; y < 16; ++y) {
for (int x = 0; x < 8; ++x) {
for (int y = 0; y < 8; ++y) {
const int half = block_size_ / 2;
if (!use_high_bit_depth_) {
memset(src_, 0, half);
......@@ -658,10 +679,10 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
ASM_REGISTER_STATE_CHECK(
var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1));
const unsigned int var2 =
subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2,
use_high_bit_depth_, bit_depth_);
EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
subpel_variance_ref(ref_, src_, log2width_, log2height_,
x, y, &sse2, use_high_bit_depth_, bit_depth_);
EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y;
EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y;
}
}
}
......@@ -669,8 +690,8 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
#if CONFIG_VP9_ENCODER
template<>
void SubpelVarianceTest<vp9_subp_avg_variance_fn_t>::RefTest() {
for (int x = 0; x < 16; ++x) {
for (int y = 0; y < 16; ++y) {
for (int x = 0; x < 8; ++x) {
for (int y = 0; y < 8; ++y) {
if (!use_high_bit_depth_) {
for (int j = 0; j < block_size_; j++) {
src_[j] = rnd_.Rand8();
......@@ -795,7 +816,6 @@ const VarianceMxNFunc highbd_8_mse16x16_c = vpx_highbd_8_mse16x16_c;
const VarianceMxNFunc highbd_8_mse16x8_c = vpx_highbd_8_mse16x8_c;
const VarianceMxNFunc highbd_8_mse8x16_c = vpx_highbd_8_mse8x16_c;
const VarianceMxNFunc highbd_8_mse8x8_c = vpx_highbd_8_mse8x8_c;
INSTANTIATE_TEST_CASE_P(
C, VpxHBDMseTest, ::testing::Values(make_tuple(4, 4, highbd_12_mse16x16_c),
make_tuple(4, 4, highbd_12_mse16x8_c),
......@@ -811,7 +831,6 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(4, 4, highbd_8_mse8x8_c)));
*/
const VarianceMxNFunc highbd_12_variance64x64_c = vpx_highbd_12_variance64x64_c;
const VarianceMxNFunc highbd_12_variance64x32_c = vpx_highbd_12_variance64x32_c;
const VarianceMxNFunc highbd_12_variance32x64_c = vpx_highbd_12_variance32x64_c;
......@@ -976,7 +995,6 @@ const VarianceMxNFunc highbd_8_mse16x16_sse2 = vpx_highbd_8_mse16x16_sse2;
const VarianceMxNFunc highbd_8_mse16x8_sse2 = vpx_highbd_8_mse16x8_sse2;
const VarianceMxNFunc highbd_8_mse8x16_sse2 = vpx_highbd_8_mse8x16_sse2;
const VarianceMxNFunc highbd_8_mse8x8_sse2 = vpx_highbd_8_mse8x8_sse2;
INSTANTIATE_TEST_CASE_P(
SSE2, VpxHBDMseTest, ::testing::Values(make_tuple(4, 4, highbd_12_mse16x16_sse2),
make_tuple(4, 3, highbd_12_mse16x8_sse2),
......@@ -1088,8 +1106,15 @@ INSTANTIATE_TEST_CASE_P(
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_SSE2
#if CONFIG_VP8
typedef SubpelVarianceTest<SubpixVarMxNFunc> VP8SubpelVarianceTest;
TEST_P(VP8SubpelVarianceTest, Ref) { RefTest(); }
TEST_P(VP8SubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
#endif // CONFIG_VP8
#if CONFIG_VP9_ENCODER
typedef SubpelVarianceTest<vp9_subpixvariance_fn_t> VP9SubpelVarianceTest;
typedef SubpelVarianceTest<SubpixVarMxNFunc> VP9SubpelVarianceTest;
typedef SubpelVarianceTest<vp9_subp_avg_variance_fn_t> VP9SubpelAvgVarianceTest;
TEST_P(VP9SubpelVarianceTest, Ref) { RefTest(); }
......@@ -1097,7 +1122,7 @@ TEST_P(VP9SubpelVarianceTest, ExtremeRef) { ExtremeRefTest(); }
TEST_P(VP9SubpelAvgVarianceTest, Ref) { RefTest(); }
#if CONFIG_VP9_HIGHBITDEPTH
typedef SubpelVarianceTest<vp9_subpixvariance_fn_t> VP9SubpelVarianceHighTest;
typedef SubpelVarianceTest<SubpixVarMxNFunc> VP9SubpelVarianceHighTest;
typedef SubpelVarianceTest<vp9_subp_avg_variance_fn_t>
VP9SubpelAvgVarianceHighTest;
......@@ -1106,32 +1131,19 @@ TEST_P(VP9SubpelVarianceHighTest, ExtremeRef) { ExtremeRefTest(); }
TEST_P(VP9SubpelAvgVarianceHighTest, Ref) { RefTest(); }
#endif // CONFIG_VP9_HIGHBITDEPTH
const vp9_subpixvariance_fn_t subpel_variance4x4_c =
vp9_sub_pixel_variance4x4_c;
const vp9_subpixvariance_fn_t subpel_variance4x8_c =
vp9_sub_pixel_variance4x8_c;
const vp9_subpixvariance_fn_t subpel_variance8x4_c =
vp9_sub_pixel_variance8x4_c;
const vp9_subpixvariance_fn_t subpel_variance8x8_c =
vp9_sub_pixel_variance8x8_c;
const vp9_subpixvariance_fn_t subpel_variance8x16_c =
vp9_sub_pixel_variance8x16_c;
const vp9_subpixvariance_fn_t subpel_variance16x8_c =
vp9_sub_pixel_variance16x8_c;
const vp9_subpixvariance_fn_t subpel_variance16x16_c =
vp9_sub_pixel_variance16x16_c;
const vp9_subpixvariance_fn_t subpel_variance16x32_c =
vp9_sub_pixel_variance16x32_c;
const vp9_subpixvariance_fn_t subpel_variance32x16_c =
vp9_sub_pixel_variance32x16_c;
const vp9_subpixvariance_fn_t subpel_variance32x32_c =
vp9_sub_pixel_variance32x32_c;
const vp9_subpixvariance_fn_t subpel_variance32x64_c =
vp9_sub_pixel_variance32x64_c;
const vp9_subpixvariance_fn_t subpel_variance64x32_c =
vp9_sub_pixel_variance64x32_c;
const vp9_subpixvariance_fn_t subpel_variance64x64_c =
vp9_sub_pixel_variance64x64_c;
const SubpixVarMxNFunc subpel_variance4x4_c = vp9_sub_pixel_variance4x4_c;
const SubpixVarMxNFunc subpel_variance4x8_c = vp9_sub_pixel_variance4x8_c;
const SubpixVarMxNFunc subpel_variance8x4_c = vp9_sub_pixel_variance8x4_c;
const SubpixVarMxNFunc subpel_variance8x8_c = vp9_sub_pixel_variance8x8_c;
const SubpixVarMxNFunc subpel_variance8x16_c = vp9_sub_pixel_variance8x16_c;
const SubpixVarMxNFunc subpel_variance16x8_c = vp9_sub_pixel_variance16x8_c;
const SubpixVarMxNFunc subpel_variance16x16_c = vp9_sub_pixel_variance16x16_c;
const SubpixVarMxNFunc subpel_variance16x32_c = vp9_sub_pixel_variance16x32_c;
const SubpixVarMxNFunc subpel_variance32x16_c = vp9_sub_pixel_variance32x16_c;
const SubpixVarMxNFunc subpel_variance32x32_c = vp9_sub_pixel_variance32x32_c;
const SubpixVarMxNFunc subpel_variance32x64_c = vp9_sub_pixel_variance32x64_c;
const SubpixVarMxNFunc subpel_variance64x32_c = vp9_sub_pixel_variance64x32_c;
const SubpixVarMxNFunc subpel_variance64x64_c = vp9_sub_pixel_variance64x64_c;
INSTANTIATE_TEST_CASE_P(
C, VP9SubpelVarianceTest,
::testing::Values(make_tuple(2, 2, subpel_variance4x4_c, 0),
......@@ -1147,6 +1159,23 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(5, 6, subpel_variance32x64_c, 0),
make_tuple(6, 5, subpel_variance64x32_c, 0),
make_tuple(6, 6, subpel_variance64x64_c, 0)));
#if CONFIG_VP8
const SubpixVarMxNFunc vp8_subpel_variance16x16_c =
vp8_sub_pixel_variance16x16_c;
const SubpixVarMxNFunc vp8_subpel_variance16x8_c = vp8_sub_pixel_variance16x8_c;
const SubpixVarMxNFunc vp8_subpel_variance8x16_c = vp8_sub_pixel_variance8x16_c;
const SubpixVarMxNFunc vp8_subpel_variance8x8_c = vp8_sub_pixel_variance8x8_c;
const SubpixVarMxNFunc vp8_subpel_variance4x4_c = vp8_sub_pixel_variance4x4_c;
INSTANTIATE_TEST_CASE_P(
C, VP8SubpelVarianceTest,
::testing::Values(make_tuple(2, 2, vp8_subpel_variance4x4_c, 0),
make_tuple(3, 3, vp8_subpel_variance8x8_c, 0),
make_tuple(3, 4, vp8_subpel_variance8x16_c, 0),
make_tuple(4, 3, vp8_subpel_variance16x8_c, 0),
make_tuple(4, 4, vp8_subpel_variance16x16_c, 0)));
#endif // CONFIG_VP8
const vp9_subp_avg_variance_fn_t subpel_avg_variance4x4_c =
vp9_sub_pixel_avg_variance4x4_c;
const vp9_subp_avg_variance_fn_t subpel_avg_variance4x8_c =
......@@ -1189,83 +1218,83 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(6, 5, subpel_avg_variance64x32_c, 0),
make_tuple(6, 6, subpel_avg_variance64x64_c, 0)));
#if CONFIG_VP9_HIGHBITDEPTH
const vp9_subpixvariance_fn_t highbd_10_subpel_variance4x4_c =
const SubpixVarMxNFunc highbd_10_subpel_variance4x4_c =
vp9_highbd_10_sub_pixel_variance4x4_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance4x8_c =
const SubpixVarMxNFunc highbd_10_subpel_variance4x8_c =
vp9_highbd_10_sub_pixel_variance4x8_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x4_c =
const SubpixVarMxNFunc highbd_10_subpel_variance8x4_c =
vp9_highbd_10_sub_pixel_variance8x4_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x8_c =
const SubpixVarMxNFunc highbd_10_subpel_variance8x8_c =
vp9_highbd_10_sub_pixel_variance8x8_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x16_c =
const SubpixVarMxNFunc highbd_10_subpel_variance8x16_c =
vp9_highbd_10_sub_pixel_variance8x16_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x8_c =
const SubpixVarMxNFunc highbd_10_subpel_variance16x8_c =
vp9_highbd_10_sub_pixel_variance16x8_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x16_c =
const SubpixVarMxNFunc highbd_10_subpel_variance16x16_c =
vp9_highbd_10_sub_pixel_variance16x16_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x32_c =
const SubpixVarMxNFunc highbd_10_subpel_variance16x32_c =
vp9_highbd_10_sub_pixel_variance16x32_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x16_c =
const SubpixVarMxNFunc highbd_10_subpel_variance32x16_c =
vp9_highbd_10_sub_pixel_variance32x16_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x32_c =
const SubpixVarMxNFunc highbd_10_subpel_variance32x32_c =
vp9_highbd_10_sub_pixel_variance32x32_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x64_c =
const SubpixVarMxNFunc highbd_10_subpel_variance32x64_c =
vp9_highbd_10_sub_pixel_variance32x64_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance64x32_c =
const SubpixVarMxNFunc highbd_10_subpel_variance64x32_c =
vp9_highbd_10_sub_pixel_variance64x32_c;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance64x64_c =
const SubpixVarMxNFunc highbd_10_subpel_variance64x64_c =
vp9_highbd_10_sub_pixel_variance64x64_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance4x4_c =
const SubpixVarMxNFunc highbd_12_subpel_variance4x4_c =
vp9_highbd_12_sub_pixel_variance4x4_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance4x8_c =
const SubpixVarMxNFunc highbd_12_subpel_variance4x8_c =
vp9_highbd_12_sub_pixel_variance4x8_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x4_c =
const SubpixVarMxNFunc highbd_12_subpel_variance8x4_c =
vp9_highbd_12_sub_pixel_variance8x4_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x8_c =
const SubpixVarMxNFunc highbd_12_subpel_variance8x8_c =
vp9_highbd_12_sub_pixel_variance8x8_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x16_c =
const SubpixVarMxNFunc highbd_12_subpel_variance8x16_c =
vp9_highbd_12_sub_pixel_variance8x16_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x8_c =
const SubpixVarMxNFunc highbd_12_subpel_variance16x8_c =
vp9_highbd_12_sub_pixel_variance16x8_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x16_c =
const SubpixVarMxNFunc highbd_12_subpel_variance16x16_c =
vp9_highbd_12_sub_pixel_variance16x16_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x32_c =
const SubpixVarMxNFunc highbd_12_subpel_variance16x32_c =
vp9_highbd_12_sub_pixel_variance16x32_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x16_c =
const SubpixVarMxNFunc highbd_12_subpel_variance32x16_c =
vp9_highbd_12_sub_pixel_variance32x16_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x32_c =
const SubpixVarMxNFunc highbd_12_subpel_variance32x32_c =
vp9_highbd_12_sub_pixel_variance32x32_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x64_c =
const SubpixVarMxNFunc highbd_12_subpel_variance32x64_c =
vp9_highbd_12_sub_pixel_variance32x64_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance64x32_c =
const SubpixVarMxNFunc highbd_12_subpel_variance64x32_c =
vp9_highbd_12_sub_pixel_variance64x32_c;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance64x64_c =
const SubpixVarMxNFunc highbd_12_subpel_variance64x64_c =
vp9_highbd_12_sub_pixel_variance64x64_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance4x4_c =
const SubpixVarMxNFunc highbd_subpel_variance4x4_c =
vp9_highbd_sub_pixel_variance4x4_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance4x8_c =
const SubpixVarMxNFunc highbd_subpel_variance4x8_c =
vp9_highbd_sub_pixel_variance4x8_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance8x4_c =
const SubpixVarMxNFunc highbd_subpel_variance8x4_c =
vp9_highbd_sub_pixel_variance8x4_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance8x8_c =
const SubpixVarMxNFunc highbd_subpel_variance8x8_c =
vp9_highbd_sub_pixel_variance8x8_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance8x16_c =
const SubpixVarMxNFunc highbd_subpel_variance8x16_c =
vp9_highbd_sub_pixel_variance8x16_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance16x8_c =
const SubpixVarMxNFunc highbd_subpel_variance16x8_c =
vp9_highbd_sub_pixel_variance16x8_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance16x16_c =
const SubpixVarMxNFunc highbd_subpel_variance16x16_c =
vp9_highbd_sub_pixel_variance16x16_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance16x32_c =
const SubpixVarMxNFunc highbd_subpel_variance16x32_c =
vp9_highbd_sub_pixel_variance16x32_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance32x16_c =
const SubpixVarMxNFunc highbd_subpel_variance32x16_c =
vp9_highbd_sub_pixel_variance32x16_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance32x32_c =
const SubpixVarMxNFunc highbd_subpel_variance32x32_c =
vp9_highbd_sub_pixel_variance32x32_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance32x64_c =
const SubpixVarMxNFunc highbd_subpel_variance32x64_c =
vp9_highbd_sub_pixel_variance32x64_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance64x32_c =
const SubpixVarMxNFunc highbd_subpel_variance64x32_c =
vp9_highbd_sub_pixel_variance64x32_c;
const vp9_subpixvariance_fn_t highbd_subpel_variance64x64_c =
const SubpixVarMxNFunc highbd_subpel_variance64x64_c =
vp9_highbd_sub_pixel_variance64x64_c;
INSTANTIATE_TEST_CASE_P(
C, VP9SubpelVarianceHighTest,
......@@ -1431,34 +1460,48 @@ INSTANTIATE_TEST_CASE_P(
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VP9_ENCODER
#if CONFIG_VP8
#if HAVE_MMX
const SubpixVarMxNFunc subpel_variance16x16_mmx =
vp8_sub_pixel_variance16x16_mmx;
const SubpixVarMxNFunc subpel_variance16x8_mmx = vp8_sub_pixel_variance16x8_mmx;
const SubpixVarMxNFunc subpel_variance8x16_mmx = vp8_sub_pixel_variance8x16_mmx;
const SubpixVarMxNFunc subpel_variance8x8_mmx = vp8_sub_pixel_variance8x8_mmx;
const SubpixVarMxNFunc subpel_variance4x4_mmx = vp8_sub_pixel_variance4x4_mmx;
INSTANTIATE_TEST_CASE_P(
MMX, VP8SubpelVarianceTest,
::testing::Values(make_tuple(4, 4, subpel_variance16x16_mmx, 0),
make_tuple(4, 3, subpel_variance16x8_mmx, 0),
make_tuple(3, 4, subpel_variance8x16_mmx, 0),
make_tuple(3, 3, subpel_variance8x8_mmx, 0),
make_tuple(2, 2, subpel_variance4x4_mmx, 0)));
#endif // HAVE_MMX
#endif // CONFIG_VP8
#if CONFIG_VP9_ENCODER
#if HAVE_SSE2
#if CONFIG_USE_X86INC
const vp9_subpixvariance_fn_t subpel_variance4x4_sse =
vp9_sub_pixel_variance4x4_sse;
const vp9_subpixvariance_fn_t subpel_variance4x8_sse =
vp9_sub_pixel_variance4x8_sse;
const vp9_subpixvariance_fn_t subpel_variance8x4_sse2 =
vp9_sub_pixel_variance8x4_sse2;
const vp9_subpixvariance_fn_t subpel_variance8x8_sse2 =
vp9_sub_pixel_variance8x8_sse2;
const vp9_subpixvariance_fn_t subpel_variance8x16_sse2 =
const SubpixVarMxNFunc subpel_variance4x4_sse = vp9_sub_pixel_variance4x4_sse;
const SubpixVarMxNFunc subpel_variance4x8_sse = vp9_sub_pixel_variance4x8_sse;
const SubpixVarMxNFunc subpel_variance8x4_sse2 = vp9_sub_pixel_variance8x4_sse2;
const SubpixVarMxNFunc subpel_variance8x8_sse2 = vp9_sub_pixel_variance8x8_sse2;
const SubpixVarMxNFunc subpel_variance8x16_sse2 =
vp9_sub_pixel_variance8x16_sse2;
const vp9_subpixvariance_fn_t subpel_variance16x8_sse2 =
const SubpixVarMxNFunc subpel_variance16x8_sse2 =
vp9_sub_pixel_variance16x8_sse2;
const vp9_subpixvariance_fn_t subpel_variance16x16_sse2 =
const SubpixVarMxNFunc subpel_variance16x16_sse2 =
vp9_sub_pixel_variance16x16_sse2;
const vp9_subpixvariance_fn_t subpel_variance16x32_sse2 =
const SubpixVarMxNFunc subpel_variance16x32_sse2 =
vp9_sub_pixel_variance16x32_sse2;
const vp9_subpixvariance_fn_t subpel_variance32x16_sse2 =
const SubpixVarMxNFunc subpel_variance32x16_sse2 =
vp9_sub_pixel_variance32x16_sse2;
const vp9_subpixvariance_fn_t subpel_variance32x32_sse2 =
const SubpixVarMxNFunc subpel_variance32x32_sse2 =
vp9_sub_pixel_variance32x32_sse2;
const vp9_subpixvariance_fn_t subpel_variance32x64_sse2 =
const SubpixVarMxNFunc subpel_variance32x64_sse2 =
vp9_sub_pixel_variance32x64_sse2;
const vp9_subpixvariance_fn_t subpel_variance64x32_sse2 =
const SubpixVarMxNFunc subpel_variance64x32_sse2 =
vp9_sub_pixel_variance64x32_sse2;
const vp9_subpixvariance_fn_t subpel_variance64x64_sse2 =
const SubpixVarMxNFunc subpel_variance64x64_sse2 =
vp9_sub_pixel_variance64x64_sse2;
INSTANTIATE_TEST_CASE_P(
SSE2, VP9SubpelVarianceTest,
......@@ -1517,71 +1560,71 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(6, 5, subpel_avg_variance64x32_sse2, 0),
make_tuple(6, 6, subpel_avg_variance64x64_sse2, 0)));
#if CONFIG_VP9_HIGHBITDEPTH
const vp9_subpixvariance_fn_t highbd_subpel_variance8x4_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance8x4_sse2 =
vp9_highbd_sub_pixel_variance8x4_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance8x8_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance8x8_sse2 =
vp9_highbd_sub_pixel_variance8x8_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance8x16_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance8x16_sse2 =
vp9_highbd_sub_pixel_variance8x16_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance16x8_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance16x8_sse2 =
vp9_highbd_sub_pixel_variance16x8_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance16x16_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance16x16_sse2 =
vp9_highbd_sub_pixel_variance16x16_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance16x32_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance16x32_sse2 =
vp9_highbd_sub_pixel_variance16x32_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance32x16_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance32x16_sse2 =
vp9_highbd_sub_pixel_variance32x16_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance32x32_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance32x32_sse2 =
vp9_highbd_sub_pixel_variance32x32_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance32x64_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance32x64_sse2 =
vp9_highbd_sub_pixel_variance32x64_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance64x32_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance64x32_sse2 =
vp9_highbd_sub_pixel_variance64x32_sse2;
const vp9_subpixvariance_fn_t highbd_subpel_variance64x64_sse2 =
const SubpixVarMxNFunc highbd_subpel_variance64x64_sse2 =
vp9_highbd_sub_pixel_variance64x64_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x4_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance8x4_sse2 =
vp9_highbd_10_sub_pixel_variance8x4_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x8_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance8x8_sse2 =
vp9_highbd_10_sub_pixel_variance8x8_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance8x16_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance8x16_sse2 =
vp9_highbd_10_sub_pixel_variance8x16_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x8_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance16x8_sse2 =
vp9_highbd_10_sub_pixel_variance16x8_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x16_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance16x16_sse2 =
vp9_highbd_10_sub_pixel_variance16x16_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance16x32_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance16x32_sse2 =
vp9_highbd_10_sub_pixel_variance16x32_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x16_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance32x16_sse2 =
vp9_highbd_10_sub_pixel_variance32x16_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x32_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance32x32_sse2 =
vp9_highbd_10_sub_pixel_variance32x32_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance32x64_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance32x64_sse2 =
vp9_highbd_10_sub_pixel_variance32x64_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance64x32_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance64x32_sse2 =
vp9_highbd_10_sub_pixel_variance64x32_sse2;
const vp9_subpixvariance_fn_t highbd_10_subpel_variance64x64_sse2 =
const SubpixVarMxNFunc highbd_10_subpel_variance64x64_sse2 =
vp9_highbd_10_sub_pixel_variance64x64_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x4_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance8x4_sse2 =
vp9_highbd_12_sub_pixel_variance8x4_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x8_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance8x8_sse2 =
vp9_highbd_12_sub_pixel_variance8x8_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance8x16_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance8x16_sse2 =
vp9_highbd_12_sub_pixel_variance8x16_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x8_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance16x8_sse2 =
vp9_highbd_12_sub_pixel_variance16x8_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x16_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance16x16_sse2 =
vp9_highbd_12_sub_pixel_variance16x16_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance16x32_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance16x32_sse2 =
vp9_highbd_12_sub_pixel_variance16x32_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x16_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance32x16_sse2 =
vp9_highbd_12_sub_pixel_variance32x16_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x32_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance32x32_sse2 =
vp9_highbd_12_sub_pixel_variance32x32_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance32x64_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance32x64_sse2 =
vp9_highbd_12_sub_pixel_variance32x64_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance64x32_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance64x32_sse2 =
vp9_highbd_12_sub_pixel_variance64x32_sse2;
const vp9_subpixvariance_fn_t highbd_12_subpel_variance64x64_sse2 =
const SubpixVarMxNFunc highbd_12_subpel_variance64x64_sse2 =
vp9_highbd_12_sub_pixel_variance64x64_sse2;
INSTANTIATE_TEST_CASE_P(
SSE2, VP9SubpelVarianceHighTest,
......@@ -1725,35 +1768,56 @@ INSTANTIATE_TEST_CASE_P(
#endif // HAVE_SSE2
#endif // CONFIG_VP9_ENCODER
#if CONFIG_VP8
#if HAVE_SSE2
const SubpixVarMxNFunc vp8_subpel_variance16x16_sse2 =
vp8_sub_pixel_variance16x16_wmt;
const SubpixVarMxNFunc vp8_subpel_variance16x8_sse2 =
vp8_sub_pixel_variance16x8_wmt;
const SubpixVarMxNFunc vp8_subpel_variance8x16_sse2 =
vp8_sub_pixel_variance8x16_wmt;
const SubpixVarMxNFunc vp8_subpel_variance8x8_sse2 =
vp8_sub_pixel_variance8x8_wmt;
const SubpixVarMxNFunc vp8_subpel_variance4x4_sse2 =
vp8_sub_pixel_variance4x4_wmt;
INSTANTIATE_TEST_CASE_P(
SSE2, VP8SubpelVarianceTest,
::testing::Values(make_tuple(2, 2, vp8_subpel_variance4x4_sse2, 0),
make_tuple(3, 3, vp8_subpel_variance8x8_sse2, 0),
make_tuple(3, 4, vp8_subpel_variance8x16_sse2, 0),
make_tuple(4, 3, vp8_subpel_variance16x8_sse2, 0),
make_tuple(4, 4, vp8_subpel_variance16x16_sse2, 0)));
#endif // HAVE_SSE2
#endif // CONFIG_VP8
#if CONFIG_VP9_ENCODER
#if HAVE_SSSE3
#if CONFIG_USE_X86INC
const vp9_subpixvariance_fn_t subpel_variance4x4_ssse3 =
const SubpixVarMxNFunc subpel_variance4x4_ssse3 =
vp9_sub_pixel_variance4x4_ssse3;
const vp9_subpixvariance_fn_t subpel_variance4x8_ssse3 =
const SubpixVarMxNFunc subpel_variance4x8_ssse3 =
vp9_sub_pixel_variance4x8_ssse3;
const vp9_subpixvariance_fn_t subpel_variance8x4_ssse3 =
const SubpixVarMxNFunc subpel_variance8x4_ssse3 =
vp9_sub_pixel_variance8x4_ssse3;
const vp9_subpixvariance_fn_t subpel_variance8x8_ssse3 =
const SubpixVarMxNFunc subpel_variance8x8_ssse3 =
vp9_sub_pixel_variance8x8_ssse3;
const vp9_subpixvariance_fn_t subpel_variance8x16_ssse3 =
const SubpixVarMxNFunc subpel_variance8x16_ssse3 =
vp9_sub_pixel_variance8x16_ssse3;
const vp9_subpixvariance_fn_t subpel_variance16x8_ssse3 =
const SubpixVarMxNFunc subpel_variance16x8_ssse3 =
vp9_sub_pixel_variance16x8_ssse3;
const vp9_subpixvariance_fn_t subpel_variance16x16_ssse3 =
const SubpixVarMxNFunc subpel_variance16x16_ssse3 =
vp9_sub_pixel_variance16x16_ssse3;
const vp9_subpixvariance_fn_t subpel_variance16x32_ssse3 =
const SubpixVarMxNFunc subpel_variance16x32_ssse3 =
vp9_sub_pixel_variance16x32_ssse3;
const vp9_subpixvariance_fn_t subpel_variance32x16_ssse3 =
const SubpixVarMxNFunc subpel_variance32x16_ssse3 =
vp9_sub_pixel_variance32x16_ssse3;
const vp9_subpixvariance_fn_t subpel_variance32x32_ssse3 =
const SubpixVarMxNFunc subpel_variance32x32_ssse3 =
vp9_sub_pixel_variance32x32_ssse3;
const vp9_subpixvariance_fn_t subpel_variance32x64_ssse3 =
const SubpixVarMxNFunc subpel_variance32x64_ssse3 =
vp9_sub_pixel_variance32x64_ssse3;
const vp9_subpixvariance_fn_t subpel_variance64x32_ssse3 =
const SubpixVarMxNFunc subpel_variance64x32_ssse3 =
vp9_sub_pixel_variance64x32_ssse3;
const vp9_subpixvariance_fn_t subpel_variance64x64_ssse3 =
const SubpixVarMxNFunc subpel_variance64x64_ssse3 =
vp9_sub_pixel_variance64x64_ssse3;
INSTANTIATE_TEST_CASE_P(
SSSE3, VP9SubpelVarianceTest,
......@@ -1815,6 +1879,19 @@ INSTANTIATE_TEST_CASE_P(
#endif // HAVE_SSSE3
#endif // CONFIG_VP9_ENCODER
#if CONFIG_VP8
#if HAVE_SSSE3
const SubpixVarMxNFunc vp8_subpel_variance16x16_ssse3 =
vp8_sub_pixel_variance16x16_ssse3;
const SubpixVarMxNFunc vp8_subpel_variance16x8_ssse3 =