Commit 33e40cb5 authored by clang-format's avatar clang-format Committed by James Zern

test: apply clang-format

Change-Id: I0d9ab85855eb723f653a7bb09b3d0d31dd6cfd2f
parent e4290800
......@@ -23,9 +23,7 @@ class ACMRandom {
explicit ACMRandom(int seed) : random_(seed) {}
void Reset(int seed) {
random_.Reseed(seed);
}
void Reset(int seed) { random_.Reseed(seed); }
uint16_t Rand16(void) {
const uint32_t value =
random_.Generate(testing::internal::Random::kMaxRange);
......@@ -52,17 +50,11 @@ class ACMRandom {
return r < 128 ? r << 4 : r >> 4;
}
int PseudoUniform(int range) {
return random_.Generate(range);
}
int PseudoUniform(int range) { return random_.Generate(range); }
int operator()(int n) {
return PseudoUniform(n);
}
int operator()(int n) { return PseudoUniform(n); }
static int DeterministicSeed(void) {
return 0xbaba;
}
static int DeterministicSeed(void) { return 0xbaba; }
private:
testing::internal::Random random_;
......
......@@ -17,8 +17,8 @@
namespace {
// Check if any pixel in a 16x16 macroblock varies between frames.
int CheckMb(const vpx_image_t &current, const vpx_image_t &previous,
int mb_r, int mb_c) {
int CheckMb(const vpx_image_t &current, const vpx_image_t &previous, int mb_r,
int mb_c) {
for (int plane = 0; plane < 3; plane++) {
int r = 16 * mb_r;
int c0 = 16 * mb_c;
......
......@@ -39,6 +39,7 @@ class ActiveMapTest
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
} else if (video->frame() == 3) {
vpx_active_map_t map = vpx_active_map_t();
/* clang-format off */
uint8_t active_map[9 * 13] = {
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
......@@ -50,6 +51,7 @@ class ActiveMapTest
0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0,
};
/* clang-format on */
map.cols = (kWidth + 15) / 16;
map.rows = (kHeight + 15) / 16;
ASSERT_EQ(map.cols, 13u);
......@@ -77,8 +79,8 @@ TEST_P(ActiveMapTest, Test) {
cfg_.rc_end_usage = VPX_CBR;
cfg_.kf_max_dist = 90000;
::libvpx_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30,
1, 0, 20);
::libvpx_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30, 1,
0, 20);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
......
......@@ -22,15 +22,12 @@ static const int kNoiseSize = 3072;
// TODO(jimbankoski): make width and height integers not unsigned.
typedef void (*AddNoiseFunc)(uint8_t *start, const int8_t *noise,
int blackclamp, int whiteclamp,
int width, int height, int pitch);
int blackclamp, int whiteclamp, int width,
int height, int pitch);
class AddNoiseTest
: public ::testing::TestWithParam<AddNoiseFunc> {
class AddNoiseTest : public ::testing::TestWithParam<AddNoiseFunc> {
public:
virtual void TearDown() {
libvpx_test::ClearSystemState();
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
virtual ~AddNoiseTest() {}
};
......@@ -43,18 +40,18 @@ double stddev6(char a, char b, char c, char d, char e, char f) {
}
TEST_P(AddNoiseTest, CheckNoiseAdded) {
const int width = 64;
const int width = 64;
const int height = 64;
const int image_size = width * height;
int8_t noise[kNoiseSize];
const int clamp = vpx_setup_noise(4.4, noise, kNoiseSize);
uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size,
sizeof(*s)));
uint8_t *const s =
reinterpret_cast<uint8_t *>(vpx_calloc(image_size, sizeof(*s)));
ASSERT_TRUE(s != NULL);
memset(s, 99, image_size * sizeof(*s));
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
width, height, width));
ASM_REGISTER_STATE_CHECK(
GetParam()(s, noise, clamp, clamp, width, height, width));
// Check to make sure we don't end up having either the same or no added
// noise either vertically or horizontally.
......@@ -72,8 +69,8 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) {
// Initialize pixels in the image to 255 and check for roll over.
memset(s, 255, image_size);
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
width, height, width));
ASM_REGISTER_STATE_CHECK(
GetParam()(s, noise, clamp, clamp, width, height, width));
// Check to make sure don't roll over.
for (int i = 0; i < image_size; ++i) {
......@@ -83,8 +80,8 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) {
// Initialize pixels in the image to 0 and check for roll under.
memset(s, 0, image_size);
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
width, height, width));
ASM_REGISTER_STATE_CHECK(
GetParam()(s, noise, clamp, clamp, width, height, width));
// Check to make sure don't roll under.
for (int i = 0; i < image_size; ++i) {
......@@ -95,7 +92,7 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) {
}
TEST_P(AddNoiseTest, CheckCvsAssembly) {
const int width = 64;
const int width = 64;
const int height = 64;
const int image_size = width * height;
int8_t noise[kNoiseSize];
......
......@@ -21,7 +21,7 @@ const int kLookAheadMin = 5;
const int kLookAheadMax = 26;
class AltRefTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<int> {
public ::libvpx_test::CodecTestWithParam<int> {
protected:
AltRefTest() : EncoderTest(GET_PARAM(0)), altref_count_(0) {}
virtual ~AltRefTest() {}
......@@ -31,9 +31,7 @@ class AltRefTest : public ::libvpx_test::EncoderTest,
SetMode(libvpx_test::kTwoPassGood);
}
virtual void BeginPassHook(unsigned int pass) {
altref_count_ = 0;
}
virtual void BeginPassHook(unsigned int pass) { altref_count_ = 0; }
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) {
......@@ -75,11 +73,8 @@ class AltRefForcedKeyTestLarge
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
AltRefForcedKeyTestLarge()
: EncoderTest(GET_PARAM(0)),
encoding_mode_(GET_PARAM(1)),
cpu_used_(GET_PARAM(2)),
forced_kf_frame_num_(1),
frame_num_(0) {}
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
cpu_used_(GET_PARAM(2)), forced_kf_frame_num_(1), frame_num_(0) {}
virtual ~AltRefForcedKeyTestLarge() {}
virtual void SetUp() {
......@@ -94,8 +89,8 @@ class AltRefForcedKeyTestLarge
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
// override test default for tile columns if necessary.
#if CONFIG_VP9_ENCODER
// override test default for tile columns if necessary.
if (GET_PARAM(0) == &libvpx_test::kVP9) {
encoder->Control(VP9E_SET_TILE_COLUMNS, 6);
}
......@@ -147,13 +142,11 @@ TEST_P(AltRefForcedKeyTestLarge, ForcedFrameIsKey) {
}
}
VP8_INSTANTIATE_TEST_CASE(
AltRefForcedKeyTestLarge,
::testing::Values(::libvpx_test::kOnePassGood),
::testing::Range(0, 9));
VP8_INSTANTIATE_TEST_CASE(AltRefForcedKeyTestLarge,
::testing::Values(::libvpx_test::kOnePassGood),
::testing::Range(0, 9));
VP9_INSTANTIATE_TEST_CASE(
AltRefForcedKeyTestLarge,
::testing::Values(::libvpx_test::kOnePassGood),
::testing::Range(0, 9));
VP9_INSTANTIATE_TEST_CASE(AltRefForcedKeyTestLarge,
::testing::Values(::libvpx_test::kOnePassGood),
::testing::Range(0, 9));
} // namespace
......@@ -57,7 +57,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ1) {
aq_mode_ = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
......@@ -77,7 +77,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ2) {
aq_mode_ = 2;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
......@@ -97,7 +97,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ3) {
aq_mode_ = 3;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
......
This diff is collapsed.
......@@ -26,11 +26,9 @@
#include "vpx_mem/vpx_mem.h"
extern "C"
double vp9_get_blockiness(const unsigned char *img1, int img1_pitch,
const unsigned char *img2, int img2_pitch,
int width, int height);
extern "C" double vp9_get_blockiness(const unsigned char *img1, int img1_pitch,
const unsigned char *img2, int img2_pitch,
int width, int height);
using libvpx_test::ACMRandom;
......@@ -40,9 +38,9 @@ class BlockinessTestBase : public ::testing::Test {
BlockinessTestBase(int width, int height) : width_(width), height_(height) {}
static void SetUpTestCase() {
source_data_ = reinterpret_cast<uint8_t*>(
source_data_ = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBufferSize));
reference_data_ = reinterpret_cast<uint8_t*>(
reference_data_ = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBufferSize));
}
......@@ -53,14 +51,12 @@ class BlockinessTestBase : public ::testing::Test {
reference_data_ = NULL;
}
virtual void TearDown() {
libvpx_test::ClearSystemState();
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
// Handle frames up to 640x480
static const int kDataAlignment = 16;
static const int kDataBufferSize = 640*480;
static const int kDataBufferSize = 640 * 480;
virtual void SetUp() {
source_stride_ = (width_ + 31) & ~31;
......@@ -68,8 +64,8 @@ class BlockinessTestBase : public ::testing::Test {
rnd_.Reset(ACMRandom::DeterministicSeed());
}
void FillConstant(uint8_t *data, int stride, uint8_t fill_constant,
int width, int height) {
void FillConstant(uint8_t *data, int stride, uint8_t fill_constant, int width,
int height) {
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
data[h * stride + w] = fill_constant;
......@@ -104,7 +100,7 @@ class BlockinessTestBase : public ::testing::Test {
void FillCheckerboard(uint8_t *data, int stride) {
for (int h = 0; h < height_; h += 4) {
for (int w = 0; w < width_; w += 4) {
if (((h/4) ^ (w/4)) & 1)
if (((h / 4) ^ (w / 4)) & 1)
FillConstant(data + h * stride + w, stride, 255, 4, 4);
else
FillConstant(data + h * stride + w, stride, 0, 4, 4);
......@@ -135,9 +131,9 @@ class BlockinessTestBase : public ::testing::Test {
}
}
int width_, height_;
static uint8_t* source_data_;
static uint8_t *source_data_;
int source_stride_;
static uint8_t* reference_data_;
static uint8_t *reference_data_;
int reference_stride_;
ACMRandom rnd_;
......@@ -153,15 +149,14 @@ class BlockinessVP9Test
protected:
double GetBlockiness() const {
return vp9_get_blockiness(source_data_, source_stride_,
reference_data_, reference_stride_,
width_, height_);
return vp9_get_blockiness(source_data_, source_stride_, reference_data_,
reference_stride_, width_, height_);
}
};
#endif // CONFIG_VP9_ENCODER
uint8_t* BlockinessTestBase::source_data_ = NULL;
uint8_t* BlockinessTestBase::reference_data_ = NULL;
uint8_t *BlockinessTestBase::source_data_ = NULL;
uint8_t *BlockinessTestBase::reference_data_ = NULL;
#if CONFIG_VP9_ENCODER
TEST_P(BlockinessVP9Test, SourceBlockierThanReference) {
......@@ -212,7 +207,6 @@ TEST_P(BlockinessVP9Test, WorstCaseBlockiness) {
}
#endif // CONFIG_VP9_ENCODER
using std::tr1::make_tuple;
//------------------------------------------------------------------------------
......@@ -220,9 +214,7 @@ using std::tr1::make_tuple;
#if CONFIG_VP9_ENCODER
const BlockinessParam c_vp9_tests[] = {
make_tuple(320, 240),
make_tuple(318, 242),
make_tuple(318, 238),
make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238),
};
INSTANTIATE_TEST_CASE_P(C, BlockinessVP9Test, ::testing::ValuesIn(c_vp9_tests));
#endif
......
......@@ -17,8 +17,9 @@
namespace {
class BordersTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
class BordersTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
BordersTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~BordersTest() {}
......@@ -78,6 +79,6 @@ TEST_P(BordersTest, TestLowBitrate) {
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
VP9_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
::libvpx_test::kTwoPassGood));
VP9_INSTANTIATE_TEST_CASE(BordersTest,
::testing::Values(::libvpx_test::kTwoPassGood));
} // namespace
......@@ -36,29 +36,26 @@ struct ByteAlignmentTestParam {
};
const ByteAlignmentTestParam kBaTestParams[] = {
{kLegacyByteAlignment, VPX_CODEC_OK, true},
{32, VPX_CODEC_OK, true},
{64, VPX_CODEC_OK, true},
{128, VPX_CODEC_OK, true},
{256, VPX_CODEC_OK, true},
{512, VPX_CODEC_OK, true},
{1024, VPX_CODEC_OK, true},
{1, VPX_CODEC_INVALID_PARAM, false},
{-2, VPX_CODEC_INVALID_PARAM, false},
{4, VPX_CODEC_INVALID_PARAM, false},
{16, VPX_CODEC_INVALID_PARAM, false},
{255, VPX_CODEC_INVALID_PARAM, false},
{2048, VPX_CODEC_INVALID_PARAM, false},
{ kLegacyByteAlignment, VPX_CODEC_OK, true },
{ 32, VPX_CODEC_OK, true },
{ 64, VPX_CODEC_OK, true },
{ 128, VPX_CODEC_OK, true },
{ 256, VPX_CODEC_OK, true },
{ 512, VPX_CODEC_OK, true },
{ 1024, VPX_CODEC_OK, true },
{ 1, VPX_CODEC_INVALID_PARAM, false },
{ -2, VPX_CODEC_INVALID_PARAM, false },
{ 4, VPX_CODEC_INVALID_PARAM, false },
{ 16, VPX_CODEC_INVALID_PARAM, false },
{ 255, VPX_CODEC_INVALID_PARAM, false },
{ 2048, VPX_CODEC_INVALID_PARAM, false },
};
// Class for testing byte alignment of reference buffers.
class ByteAlignmentTest
: public ::testing::TestWithParam<ByteAlignmentTestParam> {
protected:
ByteAlignmentTest()
: video_(NULL),
decoder_(NULL),
md5_file_(NULL) {}
ByteAlignmentTest() : video_(NULL), decoder_(NULL), md5_file_(NULL) {}
virtual void SetUp() {
video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
......@@ -74,8 +71,7 @@ class ByteAlignmentTest
}
virtual void TearDown() {
if (md5_file_ != NULL)
fclose(md5_file_);
if (md5_file_ != NULL) fclose(md5_file_);
delete decoder_;
delete video_;
......@@ -89,8 +85,7 @@ class ByteAlignmentTest
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
CheckDecodedFrames(byte_alignment_to_check);
if (res == VPX_CODEC_OK)
video_->Next();
if (res == VPX_CODEC_OK) video_->Next();
return res;
}
......@@ -98,8 +93,7 @@ class ByteAlignmentTest
for (; video_->cxdata() != NULL; video_->Next()) {
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
if (res != VPX_CODEC_OK)
return res;
if (res != VPX_CODEC_OK) return res;
CheckDecodedFrames(byte_alignment_to_check);
}
return VPX_CODEC_OK;
......@@ -135,7 +129,7 @@ class ByteAlignmentTest
void OpenMd5File(const std::string &md5_file_name_) {
md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
ASSERT_TRUE(md5_file_ != NULL) << "MD5 file open failed. Filename: "
<< md5_file_name_;
<< md5_file_name_;
}
void CheckMd5(const vpx_image_t &img) {
......@@ -163,8 +157,8 @@ class ByteAlignmentTest
TEST_F(ByteAlignmentTest, SwitchByteAlignment) {
const int num_elements = 14;
const int byte_alignments[] = { 0, 32, 64, 128, 256, 512, 1024,
0, 1024, 32, 512, 64, 256, 128 };
const int byte_alignments[] = { 0, 32, 64, 128, 256, 512, 1024,
0, 1024, 32, 512, 64, 256, 128 };
for (int i = 0; i < num_elements; ++i) {
SetByteAlignment(byte_alignments[i], VPX_CODEC_OK);
......
......@@ -12,7 +12,7 @@
#include "./vpx_config.h"
#if ARCH_X86 || ARCH_X86_64
# include "vpx_ports/x86.h"
#include "vpx_ports/x86.h"
#endif
namespace libvpx_test {
......
......@@ -32,15 +32,15 @@ class CodecFactory {
virtual ~CodecFactory() {}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
unsigned long deadline) const = 0;
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags,
unsigned long deadline) // NOLINT(runtime/int)
const = 0;
const = 0;
virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const = 0;
......@@ -53,20 +53,20 @@ class CodecFactory {
* to avoid having to include a pointer to the CodecFactory in every test
* definition.
*/
template<class T1>
class CodecTestWithParam : public ::testing::TestWithParam<
std::tr1::tuple< const libvpx_test::CodecFactory*, T1 > > {
};
template <class T1>
class CodecTestWithParam
: public ::testing::TestWithParam<
std::tr1::tuple<const libvpx_test::CodecFactory *, T1> > {};
template<class T1, class T2>
class CodecTestWith2Params : public ::testing::TestWithParam<
std::tr1::tuple< const libvpx_test::CodecFactory*, T1, T2 > > {
};
template <class T1, class T2>
class CodecTestWith2Params
: public ::testing::TestWithParam<
std::tr1::tuple<const libvpx_test::CodecFactory *, T1, T2> > {};
template<class T1, class T2, class T3>
class CodecTestWith3Params : public ::testing::TestWithParam<
std::tr1::tuple< const libvpx_test::CodecFactory*, T1, T2, T3 > > {
};
template <class T1, class T2, class T3>
class CodecTestWith3Params
: public ::testing::TestWithParam<
std::tr1::tuple<const libvpx_test::CodecFactory *, T1, T2, T3> > {};
/*
* VP8 Codec Definitions
......@@ -82,7 +82,7 @@ class VP8Decoder : public Decoder {
: Decoder(cfg, flag, deadline) {}
protected:
virtual vpx_codec_iface_t* CodecInterface() const {
virtual vpx_codec_iface_t *CodecInterface() const {
#if CONFIG_VP8_DECODER
return &vpx_codec_vp8_dx_algo;
#else
......@@ -98,7 +98,7 @@ class VP8Encoder : public Encoder {
: Encoder(cfg, deadline, init_flags, stats) {}
protected:
virtual vpx_codec_iface_t* CodecInterface() const {
virtual vpx_codec_iface_t *CodecInterface() const {
#if CONFIG_VP8_ENCODER
return &vpx_codec_vp8_cx_algo;
#else
......@@ -111,12 +111,12 @@ class VP8CodecFactory : public CodecFactory {
public:
VP8CodecFactory() : CodecFactory() {}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
unsigned long deadline) const {
return CreateDecoder(cfg, 0, deadline);
}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags,
unsigned long deadline) const { // NOLINT
#if CONFIG_VP8_DECODER
......@@ -126,7 +126,7 @@ class VP8CodecFactory : public CodecFactory {
#endif
}
virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const {
......@@ -149,17 +149,17 @@ class VP8CodecFactory : public CodecFactory {
const libvpx_test::VP8CodecFactory kVP8;
#define VP8_INSTANTIATE_TEST_CASE(test, ...)\
INSTANTIATE_TEST_CASE_P(VP8, test, \
::testing::Combine( \
::testing::Values(static_cast<const libvpx_test::CodecFactory*>( \
&libvpx_test::kVP8)), \
#define VP8_INSTANTIATE_TEST_CASE(test, ...) \
INSTANTIATE_TEST_CASE_P( \
VP8, test, \
::testing::Combine( \
::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
&libvpx_test::kVP8)), \
__VA_ARGS__))
#else
#define VP8_INSTANTIATE_TEST_CASE(test, ...)
#endif // CONFIG_VP8
/*
* VP9 Codec Definitions
*/
......@@ -174,7 +174,7 @@ class VP9Decoder : public Decoder {
: Decoder(cfg, flag, deadline) {}
protected:
virtual vpx_codec_iface_t* CodecInterface() const {
virtual vpx_codec_iface_t *CodecInterface() const {
#if CONFIG_VP9_DECODER
return &vpx_codec_vp9_dx_algo;
#else
......@@ -190,7 +190,7 @@ class VP9Encoder : public Encoder {
: Encoder(cfg, deadline, init_flags, stats) {}
protected:
virtual vpx_codec_iface_t* CodecInterface() const {
virtual vpx_codec_iface_t *CodecInterface() const {
#if CONFIG_VP9_ENCODER
return &vpx_codec_vp9_cx_algo;
#else
......@@ -203,12 +203,12 @@ class VP9CodecFactory : public CodecFactory {
public:
VP9CodecFactory() : CodecFactory() {}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
unsigned long deadline) const {
return CreateDecoder(cfg, 0, deadline);
}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags,
unsigned long deadline) const { // NOLINT
#if CONFIG_VP9_DECODER
......@@ -218,7 +218,7 @@ class VP9CodecFactory : public CodecFactory {
#endif
}
virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const {
......@@ -241,11 +241,12 @@ class VP9CodecFactory : public CodecFactory {
const libvpx_test::VP9CodecFactory kVP9;
#define VP9_INSTANTIATE_TEST_CASE(test, ...)\
INSTANTIATE_TEST_CASE_P(VP9, test, \
::testing::Combine( \
::testing::Values(static_cast<const libvpx_test::CodecFactory*>( \
&libvpx_test::kVP9)), \
#define VP9_INSTANTIATE_TEST_CASE(test, ...) \
INSTANTIATE_TEST_CASE_P( \
VP9, test, \
::testing::Combine( \
::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
&libvpx_test::kVP9)), \
__VA_ARGS__))
#else
#define VP9_INSTANTIATE_TEST_CASE(test, ...)
......
......@@ -15,11 +15,13 @@
namespace {
class ConfigTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
class ConfigTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
ConfigTest() : EncoderTest(GET_PARAM(0)),
frame_count_in_(0), frame_count_out_(0), frame_count_max_(0) {}
ConfigTest()
: EncoderTest(GET_PARAM(0)), frame_count_in_(0), frame_count_out_(0),
frame_count_max_(0) {}
virtual ~ConfigTest() {}
virtual void SetUp() {
......@@ -32,12 +34,12 @@ class ConfigTest : public ::libvpx_test::EncoderTest,
frame_count_out_ = 0;
}
virtual void PreEncodeFrameHook(libvpx_test::VideoSource* /*video*/) {
virtual void PreEncodeFrameHook(libvpx_test::VideoSource * /*video*/) {
++frame_count_in_;
abort_ |= (frame_count_in_ >= frame_count_max_);
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {
virtual void FramePktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {
++frame_count_out_;
}
......
......@@ -26,12 +26,10 @@
#include "vpx_dsp/ssim.h"
#include "vpx_mem/vpx_mem.h"
extern "C"
double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch,
uint8_t *img2, int img2_pitch,
int width, int height,
Ssimv *sv2, Metrics *m,
int do_inconsistency);
extern "C" double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch,
uint8_t *img2, int img2_pitch, int width,