Merge "Revert "Remove Wextra warnings from vp9_sad.c""
This commit is contained in:
commit
c40a968e13
374
test/sad_test.cc
374
test/sad_test.cc
@ -29,22 +29,12 @@
|
|||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_VP8_ENCODER
|
|
||||||
typedef unsigned int (*sad_m_by_n_fn_t)(const unsigned char *source_ptr,
|
typedef unsigned int (*sad_m_by_n_fn_t)(const unsigned char *source_ptr,
|
||||||
int source_stride,
|
int source_stride,
|
||||||
const unsigned char *reference_ptr,
|
const unsigned char *reference_ptr,
|
||||||
int reference_stride,
|
int reference_stride,
|
||||||
unsigned int max_sad);
|
unsigned int max_sad);
|
||||||
typedef std::tr1::tuple<int, int, sad_m_by_n_fn_t> sad_m_by_n_test_param_t;
|
typedef std::tr1::tuple<int, int, sad_m_by_n_fn_t> sad_m_by_n_test_param_t;
|
||||||
#endif
|
|
||||||
#if CONFIG_VP9_ENCODER
|
|
||||||
typedef unsigned int (*sad_m_by_n_fn_vp9_t)(const unsigned char *source_ptr,
|
|
||||||
int source_stride,
|
|
||||||
const unsigned char *reference_ptr,
|
|
||||||
int reference_stride);
|
|
||||||
typedef std::tr1::tuple<int, int, sad_m_by_n_fn_vp9_t>
|
|
||||||
sad_m_by_n_test_param_vp9_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef void (*sad_n_by_n_by_4_fn_t)(const uint8_t *src_ptr,
|
typedef void (*sad_n_by_n_by_4_fn_t)(const uint8_t *src_ptr,
|
||||||
int src_stride,
|
int src_stride,
|
||||||
@ -97,7 +87,7 @@ class SADTestBase : public ::testing::Test {
|
|||||||
|
|
||||||
// Sum of Absolute Differences. Given two blocks, calculate the absolute
|
// Sum of Absolute Differences. Given two blocks, calculate the absolute
|
||||||
// difference between two pixels in the same relative location; accumulate.
|
// difference between two pixels in the same relative location; accumulate.
|
||||||
unsigned int ReferenceSAD(unsigned int max_sad, int block_idx) {
|
unsigned int ReferenceSAD(unsigned int max_sad, int block_idx = 0) {
|
||||||
unsigned int sad = 0;
|
unsigned int sad = 0;
|
||||||
const uint8_t* const reference = GetReference(block_idx);
|
const uint8_t* const reference = GetReference(block_idx);
|
||||||
|
|
||||||
@ -138,8 +128,38 @@ class SADTestBase : public ::testing::Test {
|
|||||||
ACMRandom rnd_;
|
ACMRandom rnd_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SADx4Test
|
class SADTest : public SADTestBase,
|
||||||
: public SADTestBase,
|
public ::testing::WithParamInterface<sad_m_by_n_test_param_t> {
|
||||||
|
public:
|
||||||
|
SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
unsigned int SAD(unsigned int max_sad, int block_idx = 0) {
|
||||||
|
unsigned int ret;
|
||||||
|
const uint8_t* const reference = GetReference(block_idx);
|
||||||
|
|
||||||
|
REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
|
||||||
|
reference, reference_stride_,
|
||||||
|
max_sad));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CheckSad(unsigned int max_sad) {
|
||||||
|
unsigned int reference_sad, exp_sad;
|
||||||
|
|
||||||
|
reference_sad = ReferenceSAD(max_sad);
|
||||||
|
exp_sad = SAD(max_sad);
|
||||||
|
|
||||||
|
if (reference_sad <= max_sad) {
|
||||||
|
ASSERT_EQ(exp_sad, reference_sad);
|
||||||
|
} else {
|
||||||
|
// Alternative implementations are not required to check max_sad
|
||||||
|
ASSERT_GE(exp_sad, reference_sad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class SADx4Test : public SADTestBase,
|
||||||
public ::testing::WithParamInterface<sad_n_by_n_by_4_test_param_t> {
|
public ::testing::WithParamInterface<sad_n_by_n_by_4_test_param_t> {
|
||||||
public:
|
public:
|
||||||
SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {}
|
SADx4Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {}
|
||||||
@ -158,173 +178,23 @@ class SADx4Test
|
|||||||
unsigned int reference_sad, exp_sad[4];
|
unsigned int reference_sad, exp_sad[4];
|
||||||
|
|
||||||
SADs(exp_sad);
|
SADs(exp_sad);
|
||||||
for (int block = 0; block < 4; ++block) {
|
for (int block = 0; block < 4; block++) {
|
||||||
reference_sad = ReferenceSAD(UINT_MAX, block);
|
reference_sad = ReferenceSAD(UINT_MAX, block);
|
||||||
|
|
||||||
EXPECT_EQ(reference_sad, exp_sad[block]) << "block " << block;
|
EXPECT_EQ(exp_sad[block], reference_sad) << "block " << block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if CONFIG_VP8_ENCODER
|
|
||||||
class SADTest
|
|
||||||
: public SADTestBase,
|
|
||||||
public ::testing::WithParamInterface<sad_m_by_n_test_param_t> {
|
|
||||||
public:
|
|
||||||
SADTest() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
unsigned int SAD(unsigned int max_sad, int block_idx) {
|
|
||||||
unsigned int ret;
|
|
||||||
const uint8_t* const reference = GetReference(block_idx);
|
|
||||||
|
|
||||||
REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
|
|
||||||
reference, reference_stride_,
|
|
||||||
max_sad));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CheckSAD(unsigned int max_sad) {
|
|
||||||
unsigned int reference_sad, exp_sad;
|
|
||||||
|
|
||||||
reference_sad = ReferenceSAD(max_sad, 0);
|
|
||||||
exp_sad = SAD(max_sad, 0);
|
|
||||||
|
|
||||||
if (reference_sad <= max_sad) {
|
|
||||||
ASSERT_EQ(exp_sad, reference_sad);
|
|
||||||
} else {
|
|
||||||
// Alternative implementations are not required to check max_sad
|
|
||||||
ASSERT_GE(exp_sad, reference_sad);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#endif // CONFIG_VP8_ENCODER
|
|
||||||
|
|
||||||
#if CONFIG_VP9_ENCODER
|
|
||||||
class SADVP9Test
|
|
||||||
: public SADTestBase,
|
|
||||||
public ::testing::WithParamInterface<sad_m_by_n_test_param_vp9_t> {
|
|
||||||
public:
|
|
||||||
SADVP9Test() : SADTestBase(GET_PARAM(0), GET_PARAM(1)) {}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
unsigned int SAD(int block_idx) {
|
|
||||||
unsigned int ret;
|
|
||||||
const uint8_t* const reference = GetReference(block_idx);
|
|
||||||
|
|
||||||
REGISTER_STATE_CHECK(ret = GET_PARAM(2)(source_data_, source_stride_,
|
|
||||||
reference, reference_stride_));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CheckSAD() {
|
|
||||||
unsigned int reference_sad, exp_sad;
|
|
||||||
|
|
||||||
reference_sad = ReferenceSAD(UINT_MAX, 0);
|
|
||||||
exp_sad = SAD(0);
|
|
||||||
|
|
||||||
ASSERT_EQ(reference_sad, exp_sad);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#endif // CONFIG_VP9_ENCODER
|
|
||||||
|
|
||||||
uint8_t* SADTestBase::source_data_ = NULL;
|
uint8_t* SADTestBase::source_data_ = NULL;
|
||||||
uint8_t* SADTestBase::reference_data_ = NULL;
|
uint8_t* SADTestBase::reference_data_ = NULL;
|
||||||
|
|
||||||
#if CONFIG_VP8_ENCODER
|
|
||||||
TEST_P(SADTest, MaxRef) {
|
TEST_P(SADTest, MaxRef) {
|
||||||
FillConstant(source_data_, source_stride_, 0);
|
FillConstant(source_data_, source_stride_, 0);
|
||||||
FillConstant(reference_data_, reference_stride_, 255);
|
FillConstant(reference_data_, reference_stride_, 255);
|
||||||
CheckSAD(UINT_MAX);
|
CheckSad(UINT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(SADTest, MaxSrc) {
|
|
||||||
FillConstant(source_data_, source_stride_, 255);
|
|
||||||
FillConstant(reference_data_, reference_stride_, 0);
|
|
||||||
CheckSAD(UINT_MAX);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(SADTest, ShortRef) {
|
|
||||||
int tmp_stride = reference_stride_;
|
|
||||||
reference_stride_ >>= 1;
|
|
||||||
FillRandom(source_data_, source_stride_);
|
|
||||||
FillRandom(reference_data_, reference_stride_);
|
|
||||||
CheckSAD(UINT_MAX);
|
|
||||||
reference_stride_ = tmp_stride;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(SADTest, UnalignedRef) {
|
|
||||||
// The reference frame, but not the source frame, may be unaligned for
|
|
||||||
// certain types of searches.
|
|
||||||
const int tmp_stride = reference_stride_;
|
|
||||||
reference_stride_ -= 1;
|
|
||||||
FillRandom(source_data_, source_stride_);
|
|
||||||
FillRandom(reference_data_, reference_stride_);
|
|
||||||
CheckSAD(UINT_MAX);
|
|
||||||
reference_stride_ = tmp_stride;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(SADTest, ShortSrc) {
|
|
||||||
const int tmp_stride = source_stride_;
|
|
||||||
source_stride_ >>= 1;
|
|
||||||
FillRandom(source_data_, source_stride_);
|
|
||||||
FillRandom(reference_data_, reference_stride_);
|
|
||||||
CheckSAD(UINT_MAX);
|
|
||||||
source_stride_ = tmp_stride;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(SADTest, MaxSAD) {
|
|
||||||
// Verify that, when max_sad is set, the implementation does not return a
|
|
||||||
// value lower than the reference.
|
|
||||||
FillConstant(source_data_, source_stride_, 255);
|
|
||||||
FillConstant(reference_data_, reference_stride_, 0);
|
|
||||||
CheckSAD(128);
|
|
||||||
}
|
|
||||||
#endif // CONFIG_VP8_ENCODER
|
|
||||||
|
|
||||||
#if CONFIG_VP9_ENCODER
|
|
||||||
TEST_P(SADVP9Test, MaxRef) {
|
|
||||||
FillConstant(source_data_, source_stride_, 0);
|
|
||||||
FillConstant(reference_data_, reference_stride_, 255);
|
|
||||||
CheckSAD();
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(SADVP9Test, MaxSrc) {
|
|
||||||
FillConstant(source_data_, source_stride_, 255);
|
|
||||||
FillConstant(reference_data_, reference_stride_, 0);
|
|
||||||
CheckSAD();
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(SADVP9Test, ShortRef) {
|
|
||||||
const int tmp_stride = reference_stride_;
|
|
||||||
reference_stride_ >>= 1;
|
|
||||||
FillRandom(source_data_, source_stride_);
|
|
||||||
FillRandom(reference_data_, reference_stride_);
|
|
||||||
CheckSAD();
|
|
||||||
reference_stride_ = tmp_stride;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(SADVP9Test, UnalignedRef) {
|
|
||||||
// The reference frame, but not the source frame, may be unaligned for
|
|
||||||
// certain types of searches.
|
|
||||||
const int tmp_stride = reference_stride_;
|
|
||||||
reference_stride_ -= 1;
|
|
||||||
FillRandom(source_data_, source_stride_);
|
|
||||||
FillRandom(reference_data_, reference_stride_);
|
|
||||||
CheckSAD();
|
|
||||||
reference_stride_ = tmp_stride;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(SADVP9Test, ShortSrc) {
|
|
||||||
const int tmp_stride = source_stride_;
|
|
||||||
source_stride_ >>= 1;
|
|
||||||
FillRandom(source_data_, source_stride_);
|
|
||||||
FillRandom(reference_data_, reference_stride_);
|
|
||||||
CheckSAD();
|
|
||||||
source_stride_ = tmp_stride;
|
|
||||||
}
|
|
||||||
#endif // CONFIG_VP9_ENCODER
|
|
||||||
|
|
||||||
TEST_P(SADx4Test, MaxRef) {
|
TEST_P(SADx4Test, MaxRef) {
|
||||||
FillConstant(source_data_, source_stride_, 0);
|
FillConstant(source_data_, source_stride_, 0);
|
||||||
FillConstant(GetReference(0), reference_stride_, 255);
|
FillConstant(GetReference(0), reference_stride_, 255);
|
||||||
@ -334,6 +204,12 @@ TEST_P(SADx4Test, MaxRef) {
|
|||||||
CheckSADs();
|
CheckSADs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(SADTest, MaxSrc) {
|
||||||
|
FillConstant(source_data_, source_stride_, 255);
|
||||||
|
FillConstant(reference_data_, reference_stride_, 0);
|
||||||
|
CheckSad(UINT_MAX);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_P(SADx4Test, MaxSrc) {
|
TEST_P(SADx4Test, MaxSrc) {
|
||||||
FillConstant(source_data_, source_stride_, 255);
|
FillConstant(source_data_, source_stride_, 255);
|
||||||
FillConstant(GetReference(0), reference_stride_, 0);
|
FillConstant(GetReference(0), reference_stride_, 0);
|
||||||
@ -343,6 +219,15 @@ TEST_P(SADx4Test, MaxSrc) {
|
|||||||
CheckSADs();
|
CheckSADs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(SADTest, ShortRef) {
|
||||||
|
int tmp_stride = reference_stride_;
|
||||||
|
reference_stride_ >>= 1;
|
||||||
|
FillRandom(source_data_, source_stride_);
|
||||||
|
FillRandom(reference_data_, reference_stride_);
|
||||||
|
CheckSad(UINT_MAX);
|
||||||
|
reference_stride_ = tmp_stride;
|
||||||
|
}
|
||||||
|
|
||||||
TEST_P(SADx4Test, ShortRef) {
|
TEST_P(SADx4Test, ShortRef) {
|
||||||
int tmp_stride = reference_stride_;
|
int tmp_stride = reference_stride_;
|
||||||
reference_stride_ >>= 1;
|
reference_stride_ >>= 1;
|
||||||
@ -355,6 +240,17 @@ TEST_P(SADx4Test, ShortRef) {
|
|||||||
reference_stride_ = tmp_stride;
|
reference_stride_ = tmp_stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(SADTest, UnalignedRef) {
|
||||||
|
// The reference frame, but not the source frame, may be unaligned for
|
||||||
|
// certain types of searches.
|
||||||
|
int tmp_stride = reference_stride_;
|
||||||
|
reference_stride_ -= 1;
|
||||||
|
FillRandom(source_data_, source_stride_);
|
||||||
|
FillRandom(reference_data_, reference_stride_);
|
||||||
|
CheckSad(UINT_MAX);
|
||||||
|
reference_stride_ = tmp_stride;
|
||||||
|
}
|
||||||
|
|
||||||
TEST_P(SADx4Test, UnalignedRef) {
|
TEST_P(SADx4Test, UnalignedRef) {
|
||||||
// The reference frame, but not the source frame, may be unaligned for
|
// The reference frame, but not the source frame, may be unaligned for
|
||||||
// certain types of searches.
|
// certain types of searches.
|
||||||
@ -369,6 +265,15 @@ TEST_P(SADx4Test, UnalignedRef) {
|
|||||||
reference_stride_ = tmp_stride;
|
reference_stride_ = tmp_stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(SADTest, ShortSrc) {
|
||||||
|
int tmp_stride = source_stride_;
|
||||||
|
source_stride_ >>= 1;
|
||||||
|
FillRandom(source_data_, source_stride_);
|
||||||
|
FillRandom(reference_data_, reference_stride_);
|
||||||
|
CheckSad(UINT_MAX);
|
||||||
|
source_stride_ = tmp_stride;
|
||||||
|
}
|
||||||
|
|
||||||
TEST_P(SADx4Test, ShortSrc) {
|
TEST_P(SADx4Test, ShortSrc) {
|
||||||
int tmp_stride = source_stride_;
|
int tmp_stride = source_stride_;
|
||||||
source_stride_ >>= 1;
|
source_stride_ >>= 1;
|
||||||
@ -381,6 +286,14 @@ TEST_P(SADx4Test, ShortSrc) {
|
|||||||
source_stride_ = tmp_stride;
|
source_stride_ = tmp_stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(SADTest, MaxSAD) {
|
||||||
|
// Verify that, when max_sad is set, the implementation does not return a
|
||||||
|
// value lower than the reference.
|
||||||
|
FillConstant(source_data_, source_stride_, 255);
|
||||||
|
FillConstant(reference_data_, reference_stride_, 0);
|
||||||
|
CheckSad(128);
|
||||||
|
}
|
||||||
|
|
||||||
using std::tr1::make_tuple;
|
using std::tr1::make_tuple;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -391,27 +304,27 @@ const sad_m_by_n_fn_t sad_8x16_c = vp8_sad8x16_c;
|
|||||||
const sad_m_by_n_fn_t sad_16x8_c = vp8_sad16x8_c;
|
const sad_m_by_n_fn_t sad_16x8_c = vp8_sad16x8_c;
|
||||||
const sad_m_by_n_fn_t sad_8x8_c = vp8_sad8x8_c;
|
const sad_m_by_n_fn_t sad_8x8_c = vp8_sad8x8_c;
|
||||||
const sad_m_by_n_fn_t sad_4x4_c = vp8_sad4x4_c;
|
const sad_m_by_n_fn_t sad_4x4_c = vp8_sad4x4_c;
|
||||||
|
#endif
|
||||||
|
#if CONFIG_VP9_ENCODER
|
||||||
|
const sad_m_by_n_fn_t sad_64x64_c_vp9 = vp9_sad64x64_c;
|
||||||
|
const sad_m_by_n_fn_t sad_32x32_c_vp9 = vp9_sad32x32_c;
|
||||||
|
const sad_m_by_n_fn_t sad_16x16_c_vp9 = vp9_sad16x16_c;
|
||||||
|
const sad_m_by_n_fn_t sad_8x16_c_vp9 = vp9_sad8x16_c;
|
||||||
|
const sad_m_by_n_fn_t sad_16x8_c_vp9 = vp9_sad16x8_c;
|
||||||
|
const sad_m_by_n_fn_t sad_8x8_c_vp9 = vp9_sad8x8_c;
|
||||||
|
const sad_m_by_n_fn_t sad_8x4_c_vp9 = vp9_sad8x4_c;
|
||||||
|
const sad_m_by_n_fn_t sad_4x8_c_vp9 = vp9_sad4x8_c;
|
||||||
|
const sad_m_by_n_fn_t sad_4x4_c_vp9 = vp9_sad4x4_c;
|
||||||
|
#endif
|
||||||
const sad_m_by_n_test_param_t c_tests[] = {
|
const sad_m_by_n_test_param_t c_tests[] = {
|
||||||
|
#if CONFIG_VP8_ENCODER
|
||||||
make_tuple(16, 16, sad_16x16_c),
|
make_tuple(16, 16, sad_16x16_c),
|
||||||
make_tuple(8, 16, sad_8x16_c),
|
make_tuple(8, 16, sad_8x16_c),
|
||||||
make_tuple(16, 8, sad_16x8_c),
|
make_tuple(16, 8, sad_16x8_c),
|
||||||
make_tuple(8, 8, sad_8x8_c),
|
make_tuple(8, 8, sad_8x8_c),
|
||||||
make_tuple(4, 4, sad_4x4_c),
|
make_tuple(4, 4, sad_4x4_c),
|
||||||
};
|
#endif
|
||||||
INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests));
|
|
||||||
#endif // CONFIG_VP8_ENCODER
|
|
||||||
|
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
const sad_m_by_n_fn_vp9_t sad_64x64_c_vp9 = vp9_sad64x64_c;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_32x32_c_vp9 = vp9_sad32x32_c;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_16x16_c_vp9 = vp9_sad16x16_c;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_8x16_c_vp9 = vp9_sad8x16_c;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_16x8_c_vp9 = vp9_sad16x8_c;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_8x8_c_vp9 = vp9_sad8x8_c;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_8x4_c_vp9 = vp9_sad8x4_c;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_4x8_c_vp9 = vp9_sad4x8_c;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_4x4_c_vp9 = vp9_sad4x4_c;
|
|
||||||
const sad_m_by_n_test_param_vp9_t c_vp9_tests[] = {
|
|
||||||
make_tuple(64, 64, sad_64x64_c_vp9),
|
make_tuple(64, 64, sad_64x64_c_vp9),
|
||||||
make_tuple(32, 32, sad_32x32_c_vp9),
|
make_tuple(32, 32, sad_32x32_c_vp9),
|
||||||
make_tuple(16, 16, sad_16x16_c_vp9),
|
make_tuple(16, 16, sad_16x16_c_vp9),
|
||||||
@ -421,9 +334,11 @@ const sad_m_by_n_test_param_vp9_t c_vp9_tests[] = {
|
|||||||
make_tuple(8, 4, sad_8x4_c_vp9),
|
make_tuple(8, 4, sad_8x4_c_vp9),
|
||||||
make_tuple(4, 8, sad_4x8_c_vp9),
|
make_tuple(4, 8, sad_4x8_c_vp9),
|
||||||
make_tuple(4, 4, sad_4x4_c_vp9),
|
make_tuple(4, 4, sad_4x4_c_vp9),
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
INSTANTIATE_TEST_CASE_P(C, SADVP9Test, ::testing::ValuesIn(c_vp9_tests));
|
INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests));
|
||||||
|
|
||||||
|
#if CONFIG_VP9_ENCODER
|
||||||
const sad_n_by_n_by_4_fn_t sad_64x64x4d_c = vp9_sad64x64x4d_c;
|
const sad_n_by_n_by_4_fn_t sad_64x64x4d_c = vp9_sad64x64x4d_c;
|
||||||
const sad_n_by_n_by_4_fn_t sad_64x32x4d_c = vp9_sad64x32x4d_c;
|
const sad_n_by_n_by_4_fn_t sad_64x32x4d_c = vp9_sad64x32x4d_c;
|
||||||
const sad_n_by_n_by_4_fn_t sad_32x64x4d_c = vp9_sad32x64x4d_c;
|
const sad_n_by_n_by_4_fn_t sad_32x64x4d_c = vp9_sad32x64x4d_c;
|
||||||
@ -460,8 +375,8 @@ INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::Values(
|
|||||||
const sad_m_by_n_fn_t sad_16x16_armv6 = vp8_sad16x16_armv6;
|
const sad_m_by_n_fn_t sad_16x16_armv6 = vp8_sad16x16_armv6;
|
||||||
INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values(
|
INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values(
|
||||||
make_tuple(16, 16, sad_16x16_armv6)));
|
make_tuple(16, 16, sad_16x16_armv6)));
|
||||||
#endif // CONFIG_VP8_ENCODER
|
#endif
|
||||||
#endif // HAVE_MEDIA
|
#endif
|
||||||
|
|
||||||
#if HAVE_NEON
|
#if HAVE_NEON
|
||||||
#if CONFIG_VP8_ENCODER
|
#if CONFIG_VP8_ENCODER
|
||||||
@ -476,8 +391,8 @@ INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values(
|
|||||||
make_tuple(16, 8, sad_16x8_neon),
|
make_tuple(16, 8, sad_16x8_neon),
|
||||||
make_tuple(8, 8, sad_8x8_neon),
|
make_tuple(8, 8, sad_8x8_neon),
|
||||||
make_tuple(4, 4, sad_4x4_neon)));
|
make_tuple(4, 4, sad_4x4_neon)));
|
||||||
#endif // CONFIG_VP8_ENCODER
|
#endif
|
||||||
#endif // HAVE_NEON
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// x86 functions
|
// x86 functions
|
||||||
@ -488,39 +403,40 @@ const sad_m_by_n_fn_t sad_8x16_mmx = vp8_sad8x16_mmx;
|
|||||||
const sad_m_by_n_fn_t sad_16x8_mmx = vp8_sad16x8_mmx;
|
const sad_m_by_n_fn_t sad_16x8_mmx = vp8_sad16x8_mmx;
|
||||||
const sad_m_by_n_fn_t sad_8x8_mmx = vp8_sad8x8_mmx;
|
const sad_m_by_n_fn_t sad_8x8_mmx = vp8_sad8x8_mmx;
|
||||||
const sad_m_by_n_fn_t sad_4x4_mmx = vp8_sad4x4_mmx;
|
const sad_m_by_n_fn_t sad_4x4_mmx = vp8_sad4x4_mmx;
|
||||||
|
#endif
|
||||||
|
#if CONFIG_VP9_ENCODER
|
||||||
|
const sad_m_by_n_fn_t sad_16x16_mmx_vp9 = vp9_sad16x16_mmx;
|
||||||
|
const sad_m_by_n_fn_t sad_8x16_mmx_vp9 = vp9_sad8x16_mmx;
|
||||||
|
const sad_m_by_n_fn_t sad_16x8_mmx_vp9 = vp9_sad16x8_mmx;
|
||||||
|
const sad_m_by_n_fn_t sad_8x8_mmx_vp9 = vp9_sad8x8_mmx;
|
||||||
|
const sad_m_by_n_fn_t sad_4x4_mmx_vp9 = vp9_sad4x4_mmx;
|
||||||
|
#endif
|
||||||
|
|
||||||
const sad_m_by_n_test_param_t mmx_tests[] = {
|
const sad_m_by_n_test_param_t mmx_tests[] = {
|
||||||
|
#if CONFIG_VP8_ENCODER
|
||||||
make_tuple(16, 16, sad_16x16_mmx),
|
make_tuple(16, 16, sad_16x16_mmx),
|
||||||
make_tuple(8, 16, sad_8x16_mmx),
|
make_tuple(8, 16, sad_8x16_mmx),
|
||||||
make_tuple(16, 8, sad_16x8_mmx),
|
make_tuple(16, 8, sad_16x8_mmx),
|
||||||
make_tuple(8, 8, sad_8x8_mmx),
|
make_tuple(8, 8, sad_8x8_mmx),
|
||||||
make_tuple(4, 4, sad_4x4_mmx),
|
make_tuple(4, 4, sad_4x4_mmx),
|
||||||
};
|
#endif
|
||||||
INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests));
|
|
||||||
#endif // CONFIG_VP8_ENCODER
|
|
||||||
|
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
const sad_m_by_n_fn_vp9_t sad_16x16_mmx_vp9 = vp9_sad16x16_mmx;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_8x16_mmx_vp9 = vp9_sad8x16_mmx;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_16x8_mmx_vp9 = vp9_sad16x8_mmx;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_8x8_mmx_vp9 = vp9_sad8x8_mmx;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_4x4_mmx_vp9 = vp9_sad4x4_mmx;
|
|
||||||
const sad_m_by_n_test_param_vp9_t mmx_vp9_tests[] = {
|
|
||||||
make_tuple(16, 16, sad_16x16_mmx_vp9),
|
make_tuple(16, 16, sad_16x16_mmx_vp9),
|
||||||
make_tuple(8, 16, sad_8x16_mmx_vp9),
|
make_tuple(8, 16, sad_8x16_mmx_vp9),
|
||||||
make_tuple(16, 8, sad_16x8_mmx_vp9),
|
make_tuple(16, 8, sad_16x8_mmx_vp9),
|
||||||
make_tuple(8, 8, sad_8x8_mmx_vp9),
|
make_tuple(8, 8, sad_8x8_mmx_vp9),
|
||||||
make_tuple(4, 4, sad_4x4_mmx_vp9),
|
make_tuple(4, 4, sad_4x4_mmx_vp9),
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
INSTANTIATE_TEST_CASE_P(MMX, SADVP9Test, ::testing::ValuesIn(mmx_vp9_tests));
|
INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::ValuesIn(mmx_tests));
|
||||||
#endif // CONFIG_VP9_ENCODER
|
#endif
|
||||||
#endif // HAVE_MMX
|
|
||||||
|
|
||||||
#if HAVE_SSE
|
#if HAVE_SSE
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
#if CONFIG_USE_X86INC
|
#if CONFIG_USE_X86INC
|
||||||
const sad_m_by_n_fn_vp9_t sad_4x4_sse_vp9 = vp9_sad4x4_sse;
|
const sad_m_by_n_fn_t sad_4x4_sse_vp9 = vp9_sad4x4_sse;
|
||||||
const sad_m_by_n_fn_vp9_t sad_4x8_sse_vp9 = vp9_sad4x8_sse;
|
const sad_m_by_n_fn_t sad_4x8_sse_vp9 = vp9_sad4x8_sse;
|
||||||
INSTANTIATE_TEST_CASE_P(SSE, SADVP9Test, ::testing::Values(
|
INSTANTIATE_TEST_CASE_P(SSE, SADTest, ::testing::Values(
|
||||||
make_tuple(4, 4, sad_4x4_sse_vp9),
|
make_tuple(4, 4, sad_4x4_sse_vp9),
|
||||||
make_tuple(4, 8, sad_4x8_sse_vp9)));
|
make_tuple(4, 8, sad_4x8_sse_vp9)));
|
||||||
|
|
||||||
@ -540,30 +456,32 @@ const sad_m_by_n_fn_t sad_8x16_wmt = vp8_sad8x16_wmt;
|
|||||||
const sad_m_by_n_fn_t sad_16x8_wmt = vp8_sad16x8_wmt;
|
const sad_m_by_n_fn_t sad_16x8_wmt = vp8_sad16x8_wmt;
|
||||||
const sad_m_by_n_fn_t sad_8x8_wmt = vp8_sad8x8_wmt;
|
const sad_m_by_n_fn_t sad_8x8_wmt = vp8_sad8x8_wmt;
|
||||||
const sad_m_by_n_fn_t sad_4x4_wmt = vp8_sad4x4_wmt;
|
const sad_m_by_n_fn_t sad_4x4_wmt = vp8_sad4x4_wmt;
|
||||||
|
#endif
|
||||||
|
#if CONFIG_VP9_ENCODER
|
||||||
|
#if CONFIG_USE_X86INC
|
||||||
|
const sad_m_by_n_fn_t sad_64x64_sse2_vp9 = vp9_sad64x64_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_64x32_sse2_vp9 = vp9_sad64x32_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_32x64_sse2_vp9 = vp9_sad32x64_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_32x32_sse2_vp9 = vp9_sad32x32_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_32x16_sse2_vp9 = vp9_sad32x16_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_16x32_sse2_vp9 = vp9_sad16x32_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_16x16_sse2_vp9 = vp9_sad16x16_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_16x8_sse2_vp9 = vp9_sad16x8_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_8x16_sse2_vp9 = vp9_sad8x16_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_8x8_sse2_vp9 = vp9_sad8x8_sse2;
|
||||||
|
const sad_m_by_n_fn_t sad_8x4_sse2_vp9 = vp9_sad8x4_sse2;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
const sad_m_by_n_test_param_t sse2_tests[] = {
|
const sad_m_by_n_test_param_t sse2_tests[] = {
|
||||||
|
#if CONFIG_VP8_ENCODER
|
||||||
make_tuple(16, 16, sad_16x16_wmt),
|
make_tuple(16, 16, sad_16x16_wmt),
|
||||||
make_tuple(8, 16, sad_8x16_wmt),
|
make_tuple(8, 16, sad_8x16_wmt),
|
||||||
make_tuple(16, 8, sad_16x8_wmt),
|
make_tuple(16, 8, sad_16x8_wmt),
|
||||||
make_tuple(8, 8, sad_8x8_wmt),
|
make_tuple(8, 8, sad_8x8_wmt),
|
||||||
make_tuple(4, 4, sad_4x4_wmt),
|
make_tuple(4, 4, sad_4x4_wmt),
|
||||||
};
|
#endif
|
||||||
INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests));
|
|
||||||
#endif // CONFIG_VP8_ENCODER
|
|
||||||
|
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
#if CONFIG_USE_X86INC
|
#if CONFIG_USE_X86INC
|
||||||
const sad_m_by_n_fn_vp9_t sad_64x64_sse2_vp9 = vp9_sad64x64_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_64x32_sse2_vp9 = vp9_sad64x32_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_32x64_sse2_vp9 = vp9_sad32x64_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_32x32_sse2_vp9 = vp9_sad32x32_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_32x16_sse2_vp9 = vp9_sad32x16_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_16x32_sse2_vp9 = vp9_sad16x32_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_16x16_sse2_vp9 = vp9_sad16x16_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_16x8_sse2_vp9 = vp9_sad16x8_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_8x16_sse2_vp9 = vp9_sad8x16_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_8x8_sse2_vp9 = vp9_sad8x8_sse2;
|
|
||||||
const sad_m_by_n_fn_vp9_t sad_8x4_sse2_vp9 = vp9_sad8x4_sse2;
|
|
||||||
const sad_m_by_n_test_param_vp9_t sse2_vp9_tests[] = {
|
|
||||||
make_tuple(64, 64, sad_64x64_sse2_vp9),
|
make_tuple(64, 64, sad_64x64_sse2_vp9),
|
||||||
make_tuple(64, 32, sad_64x32_sse2_vp9),
|
make_tuple(64, 32, sad_64x32_sse2_vp9),
|
||||||
make_tuple(32, 64, sad_32x64_sse2_vp9),
|
make_tuple(32, 64, sad_32x64_sse2_vp9),
|
||||||
@ -575,9 +493,13 @@ const sad_m_by_n_test_param_vp9_t sse2_vp9_tests[] = {
|
|||||||
make_tuple(8, 16, sad_8x16_sse2_vp9),
|
make_tuple(8, 16, sad_8x16_sse2_vp9),
|
||||||
make_tuple(8, 8, sad_8x8_sse2_vp9),
|
make_tuple(8, 8, sad_8x8_sse2_vp9),
|
||||||
make_tuple(8, 4, sad_8x4_sse2_vp9),
|
make_tuple(8, 4, sad_8x4_sse2_vp9),
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
INSTANTIATE_TEST_CASE_P(SSE2, SADVP9Test, ::testing::ValuesIn(sse2_vp9_tests));
|
INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests));
|
||||||
|
|
||||||
|
#if CONFIG_VP9_ENCODER
|
||||||
|
#if CONFIG_USE_X86INC
|
||||||
const sad_n_by_n_by_4_fn_t sad_64x64x4d_sse2 = vp9_sad64x64x4d_sse2;
|
const sad_n_by_n_by_4_fn_t sad_64x64x4d_sse2 = vp9_sad64x64x4d_sse2;
|
||||||
const sad_n_by_n_by_4_fn_t sad_64x32x4d_sse2 = vp9_sad64x32x4d_sse2;
|
const sad_n_by_n_by_4_fn_t sad_64x32x4d_sse2 = vp9_sad64x32x4d_sse2;
|
||||||
const sad_n_by_n_by_4_fn_t sad_32x64x4d_sse2 = vp9_sad32x64x4d_sse2;
|
const sad_n_by_n_by_4_fn_t sad_32x64x4d_sse2 = vp9_sad32x64x4d_sse2;
|
||||||
@ -601,9 +523,9 @@ INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::Values(
|
|||||||
make_tuple(8, 16, sad_8x16x4d_sse2),
|
make_tuple(8, 16, sad_8x16x4d_sse2),
|
||||||
make_tuple(8, 8, sad_8x8x4d_sse2),
|
make_tuple(8, 8, sad_8x8x4d_sse2),
|
||||||
make_tuple(8, 4, sad_8x4x4d_sse2)));
|
make_tuple(8, 4, sad_8x4x4d_sse2)));
|
||||||
#endif // CONFIG_USE_X86INC
|
#endif
|
||||||
#endif // CONFIG_VP9_ENCODER
|
#endif
|
||||||
#endif // HAVE_SSE2
|
#endif
|
||||||
|
|
||||||
#if HAVE_SSE3
|
#if HAVE_SSE3
|
||||||
#if CONFIG_VP8_ENCODER
|
#if CONFIG_VP8_ENCODER
|
||||||
@ -618,8 +540,8 @@ INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values(
|
|||||||
make_tuple(8, 16, sad_8x16x4d_sse3),
|
make_tuple(8, 16, sad_8x16x4d_sse3),
|
||||||
make_tuple(8, 8, sad_8x8x4d_sse3),
|
make_tuple(8, 8, sad_8x8x4d_sse3),
|
||||||
make_tuple(4, 4, sad_4x4x4d_sse3)));
|
make_tuple(4, 4, sad_4x4x4d_sse3)));
|
||||||
#endif // CONFIG_VP8_ENCODER
|
#endif
|
||||||
#endif // HAVE_SSE3
|
#endif
|
||||||
|
|
||||||
#if HAVE_SSSE3
|
#if HAVE_SSSE3
|
||||||
#if CONFIG_USE_X86INC
|
#if CONFIG_USE_X86INC
|
||||||
@ -627,8 +549,8 @@ INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values(
|
|||||||
const sad_m_by_n_fn_t sad_16x16_sse3 = vp8_sad16x16_sse3;
|
const sad_m_by_n_fn_t sad_16x16_sse3 = vp8_sad16x16_sse3;
|
||||||
INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values(
|
INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values(
|
||||||
make_tuple(16, 16, sad_16x16_sse3)));
|
make_tuple(16, 16, sad_16x16_sse3)));
|
||||||
#endif // CONFIG_VP8_ENCODER
|
#endif
|
||||||
#endif // CONFIG_USE_X86INC
|
#endif
|
||||||
#endif // HAVE_SSSE3
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -528,82 +528,82 @@ specialize qw/vp9_sub_pixel_variance4x4/, "$sse_x86inc", "$ssse3_x86inc";
|
|||||||
add_proto qw/unsigned int vp9_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
|
||||||
specialize qw/vp9_sub_pixel_avg_variance4x4/, "$sse_x86inc", "$ssse3_x86inc";
|
specialize qw/vp9_sub_pixel_avg_variance4x4/, "$sse_x86inc", "$ssse3_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad64x64/, "$sse2_x86inc";
|
specialize qw/vp9_sad64x64/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad32x64/, "$sse2_x86inc";
|
specialize qw/vp9_sad32x64/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad64x32/, "$sse2_x86inc";
|
specialize qw/vp9_sad64x32/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad32x16/, "$sse2_x86inc";
|
specialize qw/vp9_sad32x16/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad16x32/, "$sse2_x86inc";
|
specialize qw/vp9_sad16x32/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad32x32/, "$sse2_x86inc";
|
specialize qw/vp9_sad32x32/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad16x16 mmx/, "$sse2_x86inc";
|
specialize qw/vp9_sad16x16 mmx/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad16x8 mmx/, "$sse2_x86inc";
|
specialize qw/vp9_sad16x8 mmx/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad8x16 mmx/, "$sse2_x86inc";
|
specialize qw/vp9_sad8x16 mmx/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad8x8 mmx/, "$sse2_x86inc";
|
specialize qw/vp9_sad8x8 mmx/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad8x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad8x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad8x4/, "$sse2_x86inc";
|
specialize qw/vp9_sad8x4/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad4x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad4x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad4x8/, "$sse_x86inc";
|
specialize qw/vp9_sad4x8/, "$sse_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad4x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride";
|
add_proto qw/unsigned int vp9_sad4x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad4x4 mmx/, "$sse_x86inc";
|
specialize qw/vp9_sad4x4 mmx/, "$sse_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad64x64_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad64x64_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad64x64_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad64x64_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad32x64_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad32x64_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad32x64_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad32x64_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad64x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad64x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad64x32_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad64x32_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad32x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad32x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad32x16_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad32x16_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad16x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad16x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad16x32_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad16x32_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad32x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad32x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad32x32_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad32x32_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad16x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad16x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad16x16_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad16x16_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad16x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad16x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad16x8_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad16x8_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad8x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad8x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad8x16_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad8x16_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad8x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad8x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad8x8_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad8x8_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad8x4_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad8x4_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad8x4_avg/, "$sse2_x86inc";
|
specialize qw/vp9_sad8x4_avg/, "$sse2_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad4x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad4x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad4x8_avg/, "$sse_x86inc";
|
specialize qw/vp9_sad4x8_avg/, "$sse_x86inc";
|
||||||
|
|
||||||
add_proto qw/unsigned int vp9_sad4x4_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred";
|
add_proto qw/unsigned int vp9_sad4x4_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
|
||||||
specialize qw/vp9_sad4x4_avg/, "$sse_x86inc";
|
specialize qw/vp9_sad4x4_avg/, "$sse_x86inc";
|
||||||
|
|
||||||
add_proto qw/void vp9_sad64x64x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
|
add_proto qw/void vp9_sad64x64x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
|
||||||
|
@ -1291,14 +1291,14 @@ static int is_background(VP9_COMP *cpi, const TileInfo *const tile,
|
|||||||
if (row8x8_remaining >= MI_BLOCK_SIZE &&
|
if (row8x8_remaining >= MI_BLOCK_SIZE &&
|
||||||
col8x8_remaining >= MI_BLOCK_SIZE) {
|
col8x8_remaining >= MI_BLOCK_SIZE) {
|
||||||
this_sad = cpi->fn_ptr[BLOCK_64X64].sdf(src, src_stride,
|
this_sad = cpi->fn_ptr[BLOCK_64X64].sdf(src, src_stride,
|
||||||
pre, pre_stride);
|
pre, pre_stride, 0x7fffffff);
|
||||||
threshold = (1 << 12);
|
threshold = (1 << 12);
|
||||||
} else {
|
} else {
|
||||||
int r, c;
|
int r, c;
|
||||||
for (r = 0; r < row8x8_remaining; r += 2)
|
for (r = 0; r < row8x8_remaining; r += 2)
|
||||||
for (c = 0; c < col8x8_remaining; c += 2)
|
for (c = 0; c < col8x8_remaining; c += 2)
|
||||||
this_sad += cpi->fn_ptr[BLOCK_16X16].sdf(src, src_stride,
|
this_sad += cpi->fn_ptr[BLOCK_16X16].sdf(src, src_stride, pre,
|
||||||
pre, pre_stride);
|
pre_stride, 0x7fffffff);
|
||||||
threshold = (row8x8_remaining * col8x8_remaining) << 6;
|
threshold = (row8x8_remaining * col8x8_remaining) << 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,8 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
|
|||||||
x->mv_row_max = tmp_row_max;
|
x->mv_row_max = tmp_row_max;
|
||||||
|
|
||||||
return vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
|
return vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
|
||||||
xd->plane[0].dst.buf, xd->plane[0].dst.stride);
|
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
|
||||||
|
INT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_16x16_motion_search(VP9_COMP *cpi, const MV *ref_mv,
|
static int do_16x16_motion_search(VP9_COMP *cpi, const MV *ref_mv,
|
||||||
@ -85,7 +86,8 @@ static int do_16x16_motion_search(VP9_COMP *cpi, const MV *ref_mv,
|
|||||||
// Try zero MV first
|
// Try zero MV first
|
||||||
// FIXME should really use something like near/nearest MV and/or MV prediction
|
// FIXME should really use something like near/nearest MV and/or MV prediction
|
||||||
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
|
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
|
||||||
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride);
|
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
|
||||||
|
INT_MAX);
|
||||||
dst_mv->as_int = 0;
|
dst_mv->as_int = 0;
|
||||||
|
|
||||||
// Test last reference frame using the previous best mv as the
|
// Test last reference frame using the previous best mv as the
|
||||||
@ -121,7 +123,8 @@ static int do_16x16_zerozero_search(VP9_COMP *cpi, int_mv *dst_mv) {
|
|||||||
// Try zero MV first
|
// Try zero MV first
|
||||||
// FIXME should really use something like near/nearest MV and/or MV prediction
|
// FIXME should really use something like near/nearest MV and/or MV prediction
|
||||||
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
|
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
|
||||||
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride);
|
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
|
||||||
|
INT_MAX);
|
||||||
|
|
||||||
dst_mv->as_int = 0;
|
dst_mv->as_int = 0;
|
||||||
|
|
||||||
@ -144,7 +147,7 @@ static int find_best_16x16_intra(VP9_COMP *cpi, PREDICTION_MODE *pbest_mode) {
|
|||||||
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
|
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
|
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
|
||||||
xd->plane[0].dst.buf, xd->plane[0].dst.stride);
|
xd->plane[0].dst.buf, xd->plane[0].dst.stride, best_err);
|
||||||
|
|
||||||
// find best
|
// find best
|
||||||
if (err < best_err) {
|
if (err < best_err) {
|
||||||
|
@ -524,7 +524,9 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
|
|
||||||
// Work out the start point for the search
|
// Work out the start point for the search
|
||||||
bestsad = vfp->sdf(what->buf, what->stride,
|
bestsad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, ref_mv), in_what->stride);
|
get_buf_from_mv(in_what, ref_mv), in_what->stride,
|
||||||
|
0x7fffffff) + mvsad_err_cost(x, ref_mv, &fcenter_mv,
|
||||||
|
sad_per_bit);
|
||||||
|
|
||||||
// Search all possible scales upto the search param around the center point
|
// Search all possible scales upto the search param around the center point
|
||||||
// pick the scale of the point that is best as the starting scale of
|
// pick the scale of the point that is best as the starting scale of
|
||||||
@ -540,7 +542,7 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
bc + candidates[t][i].col};
|
bc + candidates[t][i].col};
|
||||||
thissad = vfp->sdf(what->buf, what->stride,
|
thissad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &this_mv),
|
get_buf_from_mv(in_what, &this_mv),
|
||||||
in_what->stride);
|
in_what->stride, bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -551,7 +553,7 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
continue;
|
continue;
|
||||||
thissad = vfp->sdf(what->buf, what->stride,
|
thissad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &this_mv),
|
get_buf_from_mv(in_what, &this_mv),
|
||||||
in_what->stride);
|
in_what->stride, bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -583,7 +585,7 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
bc + candidates[s][i].col};
|
bc + candidates[s][i].col};
|
||||||
thissad = vfp->sdf(what->buf, what->stride,
|
thissad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &this_mv),
|
get_buf_from_mv(in_what, &this_mv),
|
||||||
in_what->stride);
|
in_what->stride, bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -594,7 +596,7 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
continue;
|
continue;
|
||||||
thissad = vfp->sdf(what->buf, what->stride,
|
thissad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &this_mv),
|
get_buf_from_mv(in_what, &this_mv),
|
||||||
in_what->stride);
|
in_what->stride, bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -621,7 +623,7 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
bc + candidates[s][next_chkpts_indices[i]].col};
|
bc + candidates[s][next_chkpts_indices[i]].col};
|
||||||
thissad = vfp->sdf(what->buf, what->stride,
|
thissad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &this_mv),
|
get_buf_from_mv(in_what, &this_mv),
|
||||||
in_what->stride);
|
in_what->stride, bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -632,7 +634,7 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
continue;
|
continue;
|
||||||
thissad = vfp->sdf(what->buf, what->stride,
|
thissad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &this_mv),
|
get_buf_from_mv(in_what, &this_mv),
|
||||||
in_what->stride);
|
in_what->stride, bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -659,7 +661,7 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
bc + neighbors[i].col};
|
bc + neighbors[i].col};
|
||||||
thissad = vfp->sdf(what->buf, what->stride,
|
thissad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &this_mv),
|
get_buf_from_mv(in_what, &this_mv),
|
||||||
in_what->stride);
|
in_what->stride, bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -670,7 +672,7 @@ static int vp9_pattern_search(const MACROBLOCK *x,
|
|||||||
continue;
|
continue;
|
||||||
thissad = vfp->sdf(what->buf, what->stride,
|
thissad = vfp->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &this_mv),
|
get_buf_from_mv(in_what, &this_mv),
|
||||||
in_what->stride);
|
in_what->stride, bestsad);
|
||||||
CHECK_BETTER
|
CHECK_BETTER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -892,7 +894,8 @@ int vp9_full_range_search_c(const MACROBLOCK *x,
|
|||||||
*best_mv = *ref_mv;
|
*best_mv = *ref_mv;
|
||||||
*num00 = 11;
|
*num00 = 11;
|
||||||
best_sad = fn_ptr->sdf(what->buf, what->stride,
|
best_sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, ref_mv), in_what->stride) +
|
get_buf_from_mv(in_what, ref_mv), in_what->stride,
|
||||||
|
0x7fffffff) +
|
||||||
mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit);
|
mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit);
|
||||||
start_row = MAX(-range, x->mv_row_min - ref_mv->row);
|
start_row = MAX(-range, x->mv_row_min - ref_mv->row);
|
||||||
start_col = MAX(-range, x->mv_col_min - ref_mv->col);
|
start_col = MAX(-range, x->mv_col_min - ref_mv->col);
|
||||||
@ -926,7 +929,7 @@ int vp9_full_range_search_c(const MACROBLOCK *x,
|
|||||||
for (i = 0; i < end_col - c; ++i) {
|
for (i = 0; i < end_col - c; ++i) {
|
||||||
const MV mv = {ref_mv->row + r, ref_mv->col + c + i};
|
const MV mv = {ref_mv->row + r, ref_mv->col + c + i};
|
||||||
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &mv), in_what->stride);
|
get_buf_from_mv(in_what, &mv), in_what->stride, best_sad);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
@ -972,7 +975,7 @@ int vp9_diamond_search_sad_c(const MACROBLOCK *x,
|
|||||||
|
|
||||||
// Check the starting position
|
// Check the starting position
|
||||||
best_sad = fn_ptr->sdf(what->buf, what->stride,
|
best_sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
best_address, in_what->stride) +
|
best_address, in_what->stride, 0x7fffffff) +
|
||||||
mvsad_err_cost(x, best_mv, &fcenter_mv, sad_per_bit);
|
mvsad_err_cost(x, best_mv, &fcenter_mv, sad_per_bit);
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
@ -983,7 +986,8 @@ int vp9_diamond_search_sad_c(const MACROBLOCK *x,
|
|||||||
best_mv->col + ss[i].mv.col};
|
best_mv->col + ss[i].mv.col};
|
||||||
if (is_mv_in(x, &mv)) {
|
if (is_mv_in(x, &mv)) {
|
||||||
int sad = fn_ptr->sdf(what->buf, what->stride,
|
int sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
best_address + ss[i].offset, in_what->stride);
|
best_address + ss[i].offset, in_what->stride,
|
||||||
|
best_sad);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
@ -1008,7 +1012,7 @@ int vp9_diamond_search_sad_c(const MACROBLOCK *x,
|
|||||||
if (is_mv_in(x, &this_mv)) {
|
if (is_mv_in(x, &this_mv)) {
|
||||||
int sad = fn_ptr->sdf(what->buf, what->stride,
|
int sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
best_address + ss[best_site].offset,
|
best_address + ss[best_site].offset,
|
||||||
in_what->stride);
|
in_what->stride, best_sad);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
sad += mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit);
|
sad += mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
@ -1073,7 +1077,7 @@ int vp9_diamond_search_sadx4(const MACROBLOCK *x,
|
|||||||
best_address = in_what;
|
best_address = in_what;
|
||||||
|
|
||||||
// Check the starting position
|
// Check the starting position
|
||||||
bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride)
|
bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride, 0x7fffffff)
|
||||||
+ mvsad_err_cost(x, best_mv, &fcenter_mv, sad_per_bit);
|
+ mvsad_err_cost(x, best_mv, &fcenter_mv, sad_per_bit);
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
@ -1125,7 +1129,7 @@ int vp9_diamond_search_sadx4(const MACROBLOCK *x,
|
|||||||
if (is_mv_in(x, &this_mv)) {
|
if (is_mv_in(x, &this_mv)) {
|
||||||
const uint8_t *const check_here = ss[i].offset + best_address;
|
const uint8_t *const check_here = ss[i].offset + best_address;
|
||||||
unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
|
unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
|
||||||
in_what_stride);
|
in_what_stride, bestsad);
|
||||||
|
|
||||||
if (thissad < bestsad) {
|
if (thissad < bestsad) {
|
||||||
thissad += mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit);
|
thissad += mvsad_err_cost(x, &this_mv, &fcenter_mv, sad_per_bit);
|
||||||
@ -1150,7 +1154,7 @@ int vp9_diamond_search_sadx4(const MACROBLOCK *x,
|
|||||||
if (is_mv_in(x, &this_mv)) {
|
if (is_mv_in(x, &this_mv)) {
|
||||||
const uint8_t *const check_here = ss[best_site].offset + best_address;
|
const uint8_t *const check_here = ss[best_site].offset + best_address;
|
||||||
unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
|
unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
|
||||||
in_what_stride);
|
in_what_stride, bestsad);
|
||||||
if (thissad < bestsad) {
|
if (thissad < bestsad) {
|
||||||
thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
|
thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
|
||||||
mvjsadcost, mvsadcost, sad_per_bit);
|
mvjsadcost, mvsadcost, sad_per_bit);
|
||||||
@ -1249,7 +1253,7 @@ int vp9_full_search_sad_c(const MACROBLOCK *x, const MV *ref_mv,
|
|||||||
const int col_max = MIN(ref_mv->col + distance, x->mv_col_max);
|
const int col_max = MIN(ref_mv->col + distance, x->mv_col_max);
|
||||||
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
||||||
int best_sad = fn_ptr->sdf(what->buf, what->stride,
|
int best_sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, ref_mv), in_what->stride) +
|
get_buf_from_mv(in_what, ref_mv), in_what->stride, 0x7fffffff) +
|
||||||
mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit);
|
mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit);
|
||||||
*best_mv = *ref_mv;
|
*best_mv = *ref_mv;
|
||||||
|
|
||||||
@ -1257,7 +1261,7 @@ int vp9_full_search_sad_c(const MACROBLOCK *x, const MV *ref_mv,
|
|||||||
for (c = col_min; c < col_max; ++c) {
|
for (c = col_min; c < col_max; ++c) {
|
||||||
const MV mv = {r, c};
|
const MV mv = {r, c};
|
||||||
const int sad = fn_ptr->sdf(what->buf, what->stride,
|
const int sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &mv), in_what->stride) +
|
get_buf_from_mv(in_what, &mv), in_what->stride, best_sad) +
|
||||||
mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
best_sad = sad;
|
best_sad = sad;
|
||||||
@ -1282,7 +1286,7 @@ int vp9_full_search_sadx3(const MACROBLOCK *x, const MV *ref_mv,
|
|||||||
const int col_max = MIN(ref_mv->col + distance, x->mv_col_max);
|
const int col_max = MIN(ref_mv->col + distance, x->mv_col_max);
|
||||||
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
||||||
unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride,
|
unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, ref_mv), in_what->stride) +
|
get_buf_from_mv(in_what, ref_mv), in_what->stride, 0x7fffffff) +
|
||||||
mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit);
|
mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit);
|
||||||
*best_mv = *ref_mv;
|
*best_mv = *ref_mv;
|
||||||
|
|
||||||
@ -1316,7 +1320,7 @@ int vp9_full_search_sadx3(const MACROBLOCK *x, const MV *ref_mv,
|
|||||||
|
|
||||||
while (c < col_max) {
|
while (c < col_max) {
|
||||||
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
check_here, in_what->stride);
|
check_here, in_what->stride, best_sad);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
const MV mv = {r, c};
|
const MV mv = {r, c};
|
||||||
sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
||||||
@ -1347,7 +1351,7 @@ int vp9_full_search_sadx8(const MACROBLOCK *x, const MV *ref_mv,
|
|||||||
const int col_max = MIN(ref_mv->col + distance, x->mv_col_max);
|
const int col_max = MIN(ref_mv->col + distance, x->mv_col_max);
|
||||||
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
||||||
unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride,
|
unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, ref_mv), in_what->stride) +
|
get_buf_from_mv(in_what, ref_mv), in_what->stride, 0x7fffffff) +
|
||||||
mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit);
|
mvsad_err_cost(x, ref_mv, &fcenter_mv, sad_per_bit);
|
||||||
*best_mv = *ref_mv;
|
*best_mv = *ref_mv;
|
||||||
|
|
||||||
@ -1405,7 +1409,7 @@ int vp9_full_search_sadx8(const MACROBLOCK *x, const MV *ref_mv,
|
|||||||
|
|
||||||
while (c < col_max) {
|
while (c < col_max) {
|
||||||
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
check_here, in_what->stride);
|
check_here, in_what->stride, best_sad);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
const MV mv = {r, c};
|
const MV mv = {r, c};
|
||||||
sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
sad += mvsad_err_cost(x, &mv, &fcenter_mv, sad_per_bit);
|
||||||
@ -1434,7 +1438,7 @@ int vp9_refining_search_sad_c(const MACROBLOCK *x,
|
|||||||
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
||||||
unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride,
|
unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, ref_mv),
|
get_buf_from_mv(in_what, ref_mv),
|
||||||
in_what->stride) +
|
in_what->stride, 0x7fffffff) +
|
||||||
mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit);
|
mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit);
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -1446,7 +1450,7 @@ int vp9_refining_search_sad_c(const MACROBLOCK *x,
|
|||||||
ref_mv->col + neighbors[j].col};
|
ref_mv->col + neighbors[j].col};
|
||||||
if (is_mv_in(x, &mv)) {
|
if (is_mv_in(x, &mv)) {
|
||||||
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &mv), in_what->stride);
|
get_buf_from_mv(in_what, &mv), in_what->stride, best_sad);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit);
|
sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
@ -1479,7 +1483,7 @@ int vp9_refining_search_sadx4(const MACROBLOCK *x,
|
|||||||
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
||||||
const uint8_t *best_address = get_buf_from_mv(in_what, ref_mv);
|
const uint8_t *best_address = get_buf_from_mv(in_what, ref_mv);
|
||||||
unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride, best_address,
|
unsigned int best_sad = fn_ptr->sdf(what->buf, what->stride, best_address,
|
||||||
in_what->stride) +
|
in_what->stride, 0x7fffffff) +
|
||||||
mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit);
|
mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit);
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -1520,7 +1524,7 @@ int vp9_refining_search_sadx4(const MACROBLOCK *x,
|
|||||||
if (is_mv_in(x, &mv)) {
|
if (is_mv_in(x, &mv)) {
|
||||||
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
unsigned int sad = fn_ptr->sdf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &mv),
|
get_buf_from_mv(in_what, &mv),
|
||||||
in_what->stride);
|
in_what->stride, best_sad);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit);
|
sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
@ -1559,7 +1563,8 @@ int vp9_refining_search_8p_c(const MACROBLOCK *x,
|
|||||||
const struct buf_2d *const in_what = &xd->plane[0].pre[0];
|
const struct buf_2d *const in_what = &xd->plane[0].pre[0];
|
||||||
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
|
||||||
unsigned int best_sad = fn_ptr->sdaf(what->buf, what->stride,
|
unsigned int best_sad = fn_ptr->sdaf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, ref_mv), in_what->stride, second_pred) +
|
get_buf_from_mv(in_what, ref_mv), in_what->stride,
|
||||||
|
second_pred, 0x7fffffff) +
|
||||||
mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit);
|
mvsad_err_cost(x, ref_mv, &fcenter_mv, error_per_bit);
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -1572,7 +1577,8 @@ int vp9_refining_search_8p_c(const MACROBLOCK *x,
|
|||||||
|
|
||||||
if (is_mv_in(x, &mv)) {
|
if (is_mv_in(x, &mv)) {
|
||||||
unsigned int sad = fn_ptr->sdaf(what->buf, what->stride,
|
unsigned int sad = fn_ptr->sdaf(what->buf, what->stride,
|
||||||
get_buf_from_mv(in_what, &mv), in_what->stride, second_pred);
|
get_buf_from_mv(in_what, &mv), in_what->stride,
|
||||||
|
second_pred, best_sad);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit);
|
sad += mvsad_err_cost(x, &mv, &fcenter_mv, error_per_bit);
|
||||||
if (sad < best_sad) {
|
if (sad < best_sad) {
|
||||||
|
@ -2129,7 +2129,8 @@ static void mv_pred(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
|
|
||||||
// Find sad for current vector.
|
// Find sad for current vector.
|
||||||
this_sad = cpi->fn_ptr[block_size].sdf(src_y_ptr, x->plane[0].src.stride,
|
this_sad = cpi->fn_ptr[block_size].sdf(src_y_ptr, x->plane[0].src.stride,
|
||||||
ref_y_ptr, ref_y_stride);
|
ref_y_ptr, ref_y_stride,
|
||||||
|
0x7fffffff);
|
||||||
|
|
||||||
// Note if it is the best so far.
|
// Note if it is the best so far.
|
||||||
if (this_sad < best_sad) {
|
if (this_sad < best_sad) {
|
||||||
|
@ -35,12 +35,14 @@ static INLINE unsigned int sad(const uint8_t *a, int a_stride,
|
|||||||
|
|
||||||
#define sadMxN(m, n) \
|
#define sadMxN(m, n) \
|
||||||
unsigned int vp9_sad##m##x##n##_c(const uint8_t *src, int src_stride, \
|
unsigned int vp9_sad##m##x##n##_c(const uint8_t *src, int src_stride, \
|
||||||
const uint8_t *ref, int ref_stride) { \
|
const uint8_t *ref, int ref_stride, \
|
||||||
|
unsigned int max_sad) { \
|
||||||
return sad(src, src_stride, ref, ref_stride, m, n); \
|
return sad(src, src_stride, ref, ref_stride, m, n); \
|
||||||
} \
|
} \
|
||||||
unsigned int vp9_sad##m##x##n##_avg_c(const uint8_t *src, int src_stride, \
|
unsigned int vp9_sad##m##x##n##_avg_c(const uint8_t *src, int src_stride, \
|
||||||
const uint8_t *ref, int ref_stride, \
|
const uint8_t *ref, int ref_stride, \
|
||||||
const uint8_t *second_pred) { \
|
const uint8_t *second_pred, \
|
||||||
|
unsigned int max_sad) { \
|
||||||
uint8_t comp_pred[m * n]; \
|
uint8_t comp_pred[m * n]; \
|
||||||
vp9_comp_avg_pred(comp_pred, second_pred, m, n, ref, ref_stride); \
|
vp9_comp_avg_pred(comp_pred, second_pred, m, n, ref, ref_stride); \
|
||||||
return sad(src, src_stride, comp_pred, m, m, n); \
|
return sad(src, src_stride, comp_pred, m, m, n); \
|
||||||
@ -52,7 +54,8 @@ void vp9_sad##m##x##n##x##k##_c(const uint8_t *src, int src_stride, \
|
|||||||
unsigned int *sads) { \
|
unsigned int *sads) { \
|
||||||
int i; \
|
int i; \
|
||||||
for (i = 0; i < k; ++i) \
|
for (i = 0; i < k; ++i) \
|
||||||
sads[i] = vp9_sad##m##x##n##_c(src, src_stride, &ref[i], ref_stride); \
|
sads[i] = vp9_sad##m##x##n##_c(src, src_stride, &ref[i], ref_stride, \
|
||||||
|
0x7fffffff); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define sadMxNx4D(m, n) \
|
#define sadMxNx4D(m, n) \
|
||||||
@ -61,7 +64,8 @@ void vp9_sad##m##x##n##x4d_c(const uint8_t *src, int src_stride, \
|
|||||||
unsigned int *sads) { \
|
unsigned int *sads) { \
|
||||||
int i; \
|
int i; \
|
||||||
for (i = 0; i < 4; ++i) \
|
for (i = 0; i < 4; ++i) \
|
||||||
sads[i] = vp9_sad##m##x##n##_c(src, src_stride, refs[i], ref_stride); \
|
sads[i] = vp9_sad##m##x##n##_c(src, src_stride, refs[i], ref_stride, \
|
||||||
|
0x7fffffff); \
|
||||||
}
|
}
|
||||||
|
|
||||||
// 64x64
|
// 64x64
|
||||||
|
@ -25,13 +25,15 @@ void variance(const uint8_t *a, int a_stride,
|
|||||||
typedef unsigned int(*vp9_sad_fn_t)(const uint8_t *src_ptr,
|
typedef unsigned int(*vp9_sad_fn_t)(const uint8_t *src_ptr,
|
||||||
int source_stride,
|
int source_stride,
|
||||||
const uint8_t *ref_ptr,
|
const uint8_t *ref_ptr,
|
||||||
int ref_stride);
|
int ref_stride,
|
||||||
|
unsigned int max_sad);
|
||||||
|
|
||||||
typedef unsigned int(*vp9_sad_avg_fn_t)(const uint8_t *src_ptr,
|
typedef unsigned int(*vp9_sad_avg_fn_t)(const uint8_t *src_ptr,
|
||||||
int source_stride,
|
int source_stride,
|
||||||
const uint8_t *ref_ptr,
|
const uint8_t *ref_ptr,
|
||||||
int ref_stride,
|
int ref_stride,
|
||||||
const uint8_t *second_pred);
|
const uint8_t *second_pred,
|
||||||
|
unsigned int max_sad);
|
||||||
|
|
||||||
typedef void (*vp9_sad_multi_fn_t)(const uint8_t *src_ptr,
|
typedef void (*vp9_sad_multi_fn_t)(const uint8_t *src_ptr,
|
||||||
int source_stride,
|
int source_stride,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user