History

test: apply clang-format

clang-format committed 10 years ago

Commit 33e40cb1 parent e42908088 files · +2933 −3658Browse files

Unified · Split

88 files
  1. test/acm_random.h +4 −12
  2. test/active_map_refresh_test.cc +2 −2
  3. test/active_map_test.cc +4 −2
  4. test/add_noise_test.cc +14 −17
  5. test/altref_test.cc +11 −18
  6. test/aq_segment_test.cc +3 −3
  7. test/avg_test.cc +89 −106
  8. test/blockiness_test.cc +17 −25
  9. test/borders_test.cc +5 −4
  10. test/byte_alignment_test.cc +20 −26
  11. test/clear_system_state.h +1 −1
  12. test/codec_factory.h +38 −37
  13. test/config_test.cc +8 −6
  14. test/consistency_test.cc +21 −31
  15. test/convolve_test.cc +271 −369
  16. test/cpu_speed_test.cc +9 −14
  17. test/cq_test.cc +4 −7
  18. test/datarate_test.cc +83 −91
  19. test/dct16x16_test.cc +131 −183
  20. test/dct32x32_test.cc +41 −60
  21. test/decode_api_test.cc +12 −19
  22. test/decode_perf_test.cc +13 −26
  23. test/decode_test_driver.cc +11 −17
  24. test/decode_test_driver.h +30 −42
  25. test/encode_api_test.cc +1 −1
  26. test/encode_perf_test.cc +13 −28
  27. test/encode_test_driver.cc +34 −51
  28. test/encode_test_driver.h +41 −55
  29. test/error_resilience_test.cc +95 −115
  30. test/external_frame_buffer_test.cc +47 −62
  31. test/fdct4x4_test.cc +60 −95
  32. test/fdct8x8_test.cc +94 −133
  33. test/frame_size_tests.cc +12 −13
  34. test/hadamard_test.cc +2 −2
  35. test/i420_video_source.h +4 −7
  36. test/idct8x8_test.cc +10 −18
  37. test/invalid_file_test.cc +32 −35
  38. test/ivf_video_source.h +9 −14
  39. test/keyframe_test.cc +6 −7
  40. test/level_test.cc +3 −6
  41. test/lpf_8_test.cc +221 −271
  42. test/md5_helper.h +10 −9
  43. test/minmax_test.cc +6 −8
  44. test/partial_idct_test.cc +77 −164
  45. test/pp_filter_test.cc +18 −22
  46. test/realtime_test.cc +1 −2
  47. test/register_state_check.h +23 −20
  48. test/resize_test.cc +43 −60
  49. test/sad_test.cc +18 −20
  50. test/set_roi.cc +43 −53
  51. test/sixtap_predict_test.cc +97 −101
  52. test/sum_squares_test.cc +10 −12
  53. test/superframe_test.cc +19 −23
  54. test/svc_test.cc +45 −53
  55. test/test_intra_pred_speed.cc +55 −82
  56. test/test_libvpx.cc +6 −12
  57. test/test_vector_test.cc +15 −22
  58. test/test_vectors.cc +323 −192
  59. test/tile_independence_test.cc +2 −4
  60. test/user_priv_test.cc +2 −2
  61. test/util.h +3 −4
  62. test/variance_test.cc +131 −145
  63. test/video_source.h +14 −29
  64. test/vp8_boolcoder_test.cc +9 −10
  65. test/vp8_decrypt_test.cc +4 −6
  66. test/vp8_denoiser_sse2_test.cc +3 −5
  67. test/vp8_fdct4x4_test.cc +12 −11
  68. test/vp8_fragments_test.cc +2 −3
  69. test/vp9_arf_freq_test.cc +31 −47
  70. test/vp9_boolcoder_test.cc +4 −3
  71. test/vp9_decrypt_test.cc +4 −6
  72. test/vp9_denoiser_sse2_test.cc +13 −15
  73. test/vp9_encoder_parms_get_to_decoder.cc +5 −5
  74. test/vp9_end_to_end_test.cc +34 −47
  75. test/vp9_error_block_test.cc +26 −28
  76. test/vp9_ethread_test.cc +8 −11
  77. test/vp9_frame_parallel_test.cc +14 −17
  78. test/vp9_intrapred_test.cc +92 −93
  79. test/vp9_lossless_test.cc +7 −12
  80. test/vp9_quantize_test.cc +60 −67
  81. test/vp9_skip_loopfilter_test.cc +5 −11
  82. test/vp9_subtract_test.cc +16 −21
  83. test/vp9_thread_test.cc +16 −22
  84. test/vpx_scale_test.cc +20 −39
  85. test/webm_video_source.h +7 −16
  86. test/y4m_test.cc +33 −37
  87. test/y4m_video_source.h +4 −12
  88. test/yuv_video_source.h +17 −44
test/acm_random.h+4−12
@@ -23,9 +23,7 @@ class ACMRandom { · 22 unmodified lines
2323
2424 explicit ACMRandom(int seed) : random_(seed) {}
2525
26− void Reset(int seed) {
27− random_.Reseed(seed);
28− }
26+ void Reset(int seed) { random_.Reseed(seed); }
2927 uint16_t Rand16(void) {
3028 const uint32_t value =
3129 random_.Generate(testing::internal::Random::kMaxRange);
@@ -52,17 +50,11 @@ class ACMRandom { · 20 unmodified lines
5250 return r < 128 ? r << 4 : r >> 4;
5351 }
5452
55− int PseudoUniform(int range) {
56− return random_.Generate(range);
57− }
53+ int PseudoUniform(int range) { return random_.Generate(range); }
5854
59− int operator()(int n) {
60− return PseudoUniform(n);
61− }
55+ int operator()(int n) { return PseudoUniform(n); }
6256
63− static int DeterministicSeed(void) {
64− return 0xbaba;
65− }
57+ static int DeterministicSeed(void) { return 0xbaba; }
6658
6759 private:
6860 testing::internal::Random random_;
test/active_map_refresh_test.cc+2−2
@@ -17,8 +17,8 @@ · 16 unmodified lines
1717 namespace {
1818
1919 // Check if any pixel in a 16x16 macroblock varies between frames.
20−int CheckMb(const vpx_image_t &current, const vpx_image_t &previous,
21− int mb_r, int mb_c) {
20+int CheckMb(const vpx_image_t &current, const vpx_image_t &previous, int mb_r,
21+ int mb_c) {
2222 for (int plane = 0; plane < 3; plane++) {
2323 int r = 16 * mb_r;
2424 int c0 = 16 * mb_c;
test/active_map_test.cc+4−2
@@ -39,6 +39,7 @@ class ActiveMapTest · 38 unmodified lines
3939 encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
4040 } else if (video->frame() == 3) {
4141 vpx_active_map_t map = vpx_active_map_t();
42+ /* clang-format off */
4243 uint8_t active_map[9 * 13] = {
4344 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
4445 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
@@ -50,6 +51,7 @@ class ActiveMapTest · 5 unmodified lines
5051 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1,
5152 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0,
5253 };
54+ /* clang-format on */
5355 map.cols = (kWidth + 15) / 16;
5456 map.rows = (kHeight + 15) / 16;
5557 ASSERT_EQ(map.cols, 13u);
@@ -77,8 +79,8 @@ TEST_P(ActiveMapTest, Test) { · 21 unmodified lines
7779 cfg_.rc_end_usage = VPX_CBR;
7880 cfg_.kf_max_dist = 90000;
7981
80− ::libvpx_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30,
81− 1, 0, 20);
82+ ::libvpx_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30, 1,
83+ 0, 20);
8284
8385 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
8486 }
test/add_noise_test.cc+14−17
@@ -22,15 +22,12 @@ static const int kNoiseSize = 3072; · 21 unmodified lines
2222
2323 // TODO(jimbankoski): make width and height integers not unsigned.
2424 typedef void (*AddNoiseFunc)(uint8_t *start, const int8_t *noise,
25− int blackclamp, int whiteclamp,
26− int width, int height, int pitch);
25+ int blackclamp, int whiteclamp, int width,
26+ int height, int pitch);
2727
28−class AddNoiseTest
29− : public ::testing::TestWithParam<AddNoiseFunc> {
28+class AddNoiseTest : public ::testing::TestWithParam<AddNoiseFunc> {
3029 public:
31− virtual void TearDown() {
32− libvpx_test::ClearSystemState();
33− }
30+ virtual void TearDown() { libvpx_test::ClearSystemState(); }
3431 virtual ~AddNoiseTest() {}
3532 };
3633
@@ -43,18 +40,18 @@ double stddev6(char a, char b, char c, char d, char e, char f) { · 6 unmodified lines
4340 }
4441
4542 TEST_P(AddNoiseTest, CheckNoiseAdded) {
46− const int width = 64;
43+ const int width = 64;
4744 const int height = 64;
4845 const int image_size = width * height;
4946 int8_t noise[kNoiseSize];
5047 const int clamp = vpx_setup_noise(4.4, noise, kNoiseSize);
51− uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size,
52− sizeof(*s)));
48+ uint8_t *const s =
49+ reinterpret_cast<uint8_t *>(vpx_calloc(image_size, sizeof(*s)));
5350 ASSERT_TRUE(s != NULL);
5451 memset(s, 99, image_size * sizeof(*s));
5552
56− ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
57− width, height, width));
53+ ASM_REGISTER_STATE_CHECK(
54+ GetParam()(s, noise, clamp, clamp, width, height, width));
5855
5956 // Check to make sure we don't end up having either the same or no added
6057 // noise either vertically or horizontally.
@@ -72,8 +69,8 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) { · 11 unmodified lines
7269 // Initialize pixels in the image to 255 and check for roll over.
7370 memset(s, 255, image_size);
7471
75− ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
76− width, height, width));
72+ ASM_REGISTER_STATE_CHECK(
73+ GetParam()(s, noise, clamp, clamp, width, height, width));
7774
7875 // Check to make sure don't roll over.
7976 for (int i = 0; i < image_size; ++i) {
@@ -83,8 +80,8 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) { · 3 unmodified lines
8380 // Initialize pixels in the image to 0 and check for roll under.
8481 memset(s, 0, image_size);
8582
86− ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, clamp, clamp,
87− width, height, width));
83+ ASM_REGISTER_STATE_CHECK(
84+ GetParam()(s, noise, clamp, clamp, width, height, width));
8885
8986 // Check to make sure don't roll under.
9087 for (int i = 0; i < image_size; ++i) {
@@ -95,7 +92,7 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) { · 4 unmodified lines
9592 }
9693
9794 TEST_P(AddNoiseTest, CheckCvsAssembly) {
98− const int width = 64;
95+ const int width = 64;
9996 const int height = 64;
10097 const int image_size = width * height;
10198 int8_t noise[kNoiseSize];
test/altref_test.cc+11−18
@@ -21,7 +21,7 @@ const int kLookAheadMin = 5; · 20 unmodified lines
2121 const int kLookAheadMax = 26;
2222
2323 class AltRefTest : public ::libvpx_test::EncoderTest,
24− public ::libvpx_test::CodecTestWithParam<int> {
24+ public ::libvpx_test::CodecTestWithParam<int> {
2525 protected:
2626 AltRefTest() : EncoderTest(GET_PARAM(0)), altref_count_(0) {}
2727 virtual ~AltRefTest() {}
@@ -31,9 +31,7 @@ class AltRefTest : public ::libvpx_test::EncoderTest, · 3 unmodified lines
3131 SetMode(libvpx_test::kTwoPassGood);
3232 }
3333
34− virtual void BeginPassHook(unsigned int pass) {
35− altref_count_ = 0;
36− }
34+ virtual void BeginPassHook(unsigned int pass) { altref_count_ = 0; }
3735
3836 virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
3937 libvpx_test::Encoder *encoder) {
@@ -75,11 +73,8 @@ class AltRefForcedKeyTestLarge · 35 unmodified lines
7573 public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
7674 protected:
7775 AltRefForcedKeyTestLarge()
78− : EncoderTest(GET_PARAM(0)),
79− encoding_mode_(GET_PARAM(1)),
80− cpu_used_(GET_PARAM(2)),
81− forced_kf_frame_num_(1),
82− frame_num_(0) {}
76+ : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
77+ cpu_used_(GET_PARAM(2)), forced_kf_frame_num_(1), frame_num_(0) {}
8378 virtual ~AltRefForcedKeyTestLarge() {}
8479
8580 virtual void SetUp() {
@@ -94,8 +89,8 @@ class AltRefForcedKeyTestLarge · 8 unmodified lines
9489 if (video->frame() == 0) {
9590 encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
9691 encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
97− // override test default for tile columns if necessary.
9892 #if CONFIG_VP9_ENCODER
93+ // override test default for tile columns if necessary.
9994 if (GET_PARAM(0) == &libvpx_test::kVP9) {
10095 encoder->Control(VP9E_SET_TILE_COLUMNS, 6);
10196 }
@@ -147,13 +142,11 @@ TEST_P(AltRefForcedKeyTestLarge, ForcedFrameIsKey) { · 45 unmodified lines
147142 }
148143 }
149144
150−VP8_INSTANTIATE_TEST_CASE(
151− AltRefForcedKeyTestLarge,
152− ::testing::Values(::libvpx_test::kOnePassGood),
153− ::testing::Range(0, 9));
145+VP8_INSTANTIATE_TEST_CASE(AltRefForcedKeyTestLarge,
146+ ::testing::Values(::libvpx_test::kOnePassGood),
147+ ::testing::Range(0, 9));
154148
155−VP9_INSTANTIATE_TEST_CASE(
156− AltRefForcedKeyTestLarge,
157− ::testing::Values(::libvpx_test::kOnePassGood),
158− ::testing::Range(0, 9));
149+VP9_INSTANTIATE_TEST_CASE(AltRefForcedKeyTestLarge,
150+ ::testing::Values(::libvpx_test::kOnePassGood),
151+ ::testing::Range(0, 9));
159152 } // namespace
test/aq_segment_test.cc+3−3
@@ -57,7 +57,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ1) { · 56 unmodified lines
5757 aq_mode_ = 1;
5858
5959 ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
60− 30, 1, 0, 100);
60+ 30, 1, 0, 100);
6161
6262 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
6363 }
@@ -77,7 +77,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ2) { · 13 unmodified lines
7777 aq_mode_ = 2;
7878
7979 ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
80− 30, 1, 0, 100);
80+ 30, 1, 0, 100);
8181
8282 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
8383 }
@@ -97,7 +97,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ3) { · 13 unmodified lines
9797 aq_mode_ = 3;
9898
9999 ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
100− 30, 1, 0, 100);
100+ 30, 1, 0, 100);
101101
102102 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
103103 }
test/avg_test.cc+89−106
@@ -31,7 +31,7 @@ class AverageTestBase : public ::testing::Test { · 30 unmodified lines
3131 AverageTestBase(int width, int height) : width_(width), height_(height) {}
3232
3333 static void SetUpTestCase() {
34− source_data_ = reinterpret_cast<uint8_t*>(
34+ source_data_ = reinterpret_cast<uint8_t *>(
3535 vpx_memalign(kDataAlignment, kDataBlockSize));
3636 }
3737
@@ -40,9 +40,7 @@ class AverageTestBase : public ::testing::Test { · 2 unmodified lines
4040 source_data_ = NULL;
4141 }
4242
43− virtual void TearDown() {
44− libvpx_test::ClearSystemState();
45− }
43+ virtual void TearDown() { libvpx_test::ClearSystemState(); }
4644
4745 protected:
4846 // Handle blocks up to 4 blocks 64x64 with stride up to 128
@@ -55,47 +53,44 @@ class AverageTestBase : public ::testing::Test { · 6 unmodified lines
5553 }
5654
5755 // Sum Pixels
58− unsigned int ReferenceAverage8x8(const uint8_t* source, int pitch) {
56+ unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) {
5957 unsigned int average = 0;
6058 for (int h = 0; h < 8; ++h)
61− for (int w = 0; w < 8; ++w)
62− average += source[h * pitch + w];
59+ for (int w = 0; w < 8; ++w) average += source[h * pitch + w];
6360 return ((average + 32) >> 6);
6461 }
6562
66− unsigned int ReferenceAverage4x4(const uint8_t* source, int pitch) {
63+ unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) {
6764 unsigned int average = 0;
6865 for (int h = 0; h < 4; ++h)
69− for (int w = 0; w < 4; ++w)
70− average += source[h * pitch + w];
66+ for (int w = 0; w < 4; ++w) average += source[h * pitch + w];
7167 return ((average + 8) >> 4);
7268 }
7369
7470 void FillConstant(uint8_t fill_constant) {
7571 for (int i = 0; i < width_ * height_; ++i) {
76− source_data_[i] = fill_constant;
72+ source_data_[i] = fill_constant;
7773 }
7874 }
7975
8076 void FillRandom() {
8177 for (int i = 0; i < width_ * height_; ++i) {
82− source_data_[i] = rnd_.Rand8();
78+ source_data_[i] = rnd_.Rand8();
8379 }
8480 }
8581
8682 int width_, height_;
87− static uint8_t* source_data_;
83+ static uint8_t *source_data_;
8884 int source_stride_;
8985
9086 ACMRandom rnd_;
9187 };
92−typedef unsigned int (*AverageFunction)(const uint8_t* s, int pitch);
88+typedef unsigned int (*AverageFunction)(const uint8_t *s, int pitch);
9389
9490 typedef std::tr1::tuple<int, int, int, int, AverageFunction> AvgFunc;
9591
96−class AverageTest
97− : public AverageTestBase,
98− public ::testing::WithParamInterface<AvgFunc>{
92+class AverageTest : public AverageTestBase,
93+ public ::testing::WithParamInterface<AvgFunc> {
9994 public:
10095 AverageTest() : AverageTestBase(GET_PARAM(0), GET_PARAM(1)) {}
10196
@@ -103,17 +98,17 @@ class AverageTest · 1 unmodified line
10398 void CheckAverages() {
10499 unsigned int expected = 0;
105100 if (GET_PARAM(3) == 8) {
106− expected = ReferenceAverage8x8(source_data_+ GET_PARAM(2),
107− source_stride_);
108− } else if (GET_PARAM(3) == 4) {
109− expected = ReferenceAverage4x4(source_data_+ GET_PARAM(2),
110− source_stride_);
101+ expected =
102+ ReferenceAverage8x8(source_data_ + GET_PARAM(2), source_stride_);
103+ } else if (GET_PARAM(3) == 4) {
104+ expected =
105+ ReferenceAverage4x4(source_data_ + GET_PARAM(2), source_stride_);
111106 }
112107
113− ASM_REGISTER_STATE_CHECK(GET_PARAM(4)(source_data_+ GET_PARAM(2),
114− source_stride_));
115− unsigned int actual = GET_PARAM(4)(source_data_+ GET_PARAM(2),
116− source_stride_);
108+ ASM_REGISTER_STATE_CHECK(
109+ GET_PARAM(4)(source_data_ + GET_PARAM(2), source_stride_));
110+ unsigned int actual =
111+ GET_PARAM(4)(source_data_ + GET_PARAM(2), source_stride_);
117112
118113 EXPECT_EQ(expected, actual);
119114 }
@@ -124,23 +119,20 @@ typedef void (*IntProRowFunc)(int16_t hbuf[16], uint8_t const *ref, · 4 unmodified lines
124119
125120 typedef std::tr1::tuple<int, IntProRowFunc, IntProRowFunc> IntProRowParam;
126121
127−class IntProRowTest
128− : public AverageTestBase,
129− public ::testing::WithParamInterface<IntProRowParam> {
122+class IntProRowTest : public AverageTestBase,
123+ public ::testing::WithParamInterface<IntProRowParam> {
130124 public:
131125 IntProRowTest()
132− : AverageTestBase(16, GET_PARAM(0)),
133− hbuf_asm_(NULL),
134− hbuf_c_(NULL) {
126+ : AverageTestBase(16, GET_PARAM(0)), hbuf_asm_(NULL), hbuf_c_(NULL) {
135127 asm_func_ = GET_PARAM(1);
136128 c_func_ = GET_PARAM(2);
137129 }
138130
139131 protected:
140132 virtual void SetUp() {
141− hbuf_asm_ = reinterpret_cast<int16_t*>(
133+ hbuf_asm_ = reinterpret_cast<int16_t *>(
142134 vpx_memalign(kDataAlignment, sizeof(*hbuf_asm_) * 16));
143− hbuf_c_ = reinterpret_cast<int16_t*>(
135+ hbuf_c_ = reinterpret_cast<int16_t *>(
144136 vpx_memalign(kDataAlignment, sizeof(*hbuf_c_) * 16));
145137 }
146138
@@ -169,9 +161,8 @@ typedef int16_t (*IntProColFunc)(uint8_t const *ref, const int width); · 22 unmodified lines
169161
170162 typedef std::tr1::tuple<int, IntProColFunc, IntProColFunc> IntProColParam;
171163
172−class IntProColTest
173− : public AverageTestBase,
174− public ::testing::WithParamInterface<IntProColParam> {
164+class IntProColTest : public AverageTestBase,
165+ public ::testing::WithParamInterface<IntProColParam> {
175166 public:
176167 IntProColTest() : AverageTestBase(GET_PARAM(0), 1), sum_asm_(0), sum_c_(0) {
177168 asm_func_ = GET_PARAM(1);
@@ -195,15 +186,14 @@ class IntProColTest · 17 unmodified lines
195186 typedef int (*SatdFunc)(const int16_t *coeffs, int length);
196187 typedef std::tr1::tuple<int, SatdFunc> SatdTestParam;
197188
198−class SatdTest
199− : public ::testing::Test,
200− public ::testing::WithParamInterface<SatdTestParam> {
189+class SatdTest : public ::testing::Test,
190+ public ::testing::WithParamInterface<SatdTestParam> {
201191 protected:
202192 virtual void SetUp() {
203193 satd_size_ = GET_PARAM(0);
204194 satd_func_ = GET_PARAM(1);
205195 rnd_.Reset(ACMRandom::DeterministicSeed());
206− src_ = reinterpret_cast<int16_t*>(
196+ src_ = reinterpret_cast<int16_t *>(
207197 vpx_memalign(16, sizeof(*src_) * satd_size_));
208198 ASSERT_TRUE(src_ != NULL);
209199 }
@@ -235,7 +225,7 @@ class SatdTest · 25 unmodified lines
235225 ACMRandom rnd_;
236226 };
237227
238−uint8_t* AverageTestBase::source_data_ = NULL;
228+uint8_t *AverageTestBase::source_data_ = NULL;
239229
240230 TEST_P(AverageTest, MinValue) {
241231 FillConstant(0);
@@ -286,7 +276,6 @@ TEST_P(IntProColTest, Random) { · 44 unmodified lines
286276 RunComparison();
287277 }
288278
289−
290279 TEST_P(SatdTest, MinValue) {
291280 const int kMin = -32640;
292281 const int expected = -kMin * satd_size_;
@@ -320,92 +309,86 @@ using std::tr1::make_tuple; · 27 unmodified lines
320309
321310 INSTANTIATE_TEST_CASE_P(
322311 C, AverageTest,
323− ::testing::Values(
324− make_tuple(16, 16, 1, 8, &vpx_avg_8x8_c),
325− make_tuple(16, 16, 1, 4, &vpx_avg_4x4_c)));
312+ ::testing::Values(make_tuple(16, 16, 1, 8, &vpx_avg_8x8_c),
313+ make_tuple(16, 16, 1, 4, &vpx_avg_4x4_c)));
326314
327−INSTANTIATE_TEST_CASE_P(
328− C, SatdTest,
329− ::testing::Values(
330− make_tuple(16, &vpx_satd_c),
331− make_tuple(64, &vpx_satd_c),
332− make_tuple(256, &vpx_satd_c),
333− make_tuple(1024, &vpx_satd_c)));
315+INSTANTIATE_TEST_CASE_P(C, SatdTest,
316+ ::testing::Values(make_tuple(16, &vpx_satd_c),
317+ make_tuple(64, &vpx_satd_c),
318+ make_tuple(256, &vpx_satd_c),
319+ make_tuple(1024, &vpx_satd_c)));
334320
335321 #if HAVE_SSE2
336322 INSTANTIATE_TEST_CASE_P(
337323 SSE2, AverageTest,
338− ::testing::Values(
339− make_tuple(16, 16, 0, 8, &vpx_avg_8x8_sse2),
340− make_tuple(16, 16, 5, 8, &vpx_avg_8x8_sse2),
341− make_tuple(32, 32, 15, 8, &vpx_avg_8x8_sse2),
342− make_tuple(16, 16, 0, 4, &vpx_avg_4x4_sse2),
343− make_tuple(16, 16, 5, 4, &vpx_avg_4x4_sse2),
344− make_tuple(32, 32, 15, 4, &vpx_avg_4x4_sse2)));
324+ ::testing::Values(make_tuple(16, 16, 0, 8, &vpx_avg_8x8_sse2),
325+ make_tuple(16, 16, 5, 8, &vpx_avg_8x8_sse2),
326+ make_tuple(32, 32, 15, 8, &vpx_avg_8x8_sse2),
327+ make_tuple(16, 16, 0, 4, &vpx_avg_4x4_sse2),
328+ make_tuple(16, 16, 5, 4, &vpx_avg_4x4_sse2),
329+ make_tuple(32, 32, 15, 4, &vpx_avg_4x4_sse2)));
345330
346331 INSTANTIATE_TEST_CASE_P(
347− SSE2, IntProRowTest, ::testing::Values(
348− make_tuple(16, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
349− make_tuple(32, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
350− make_tuple(64, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c)));
332+ SSE2, IntProRowTest,
333+ ::testing::Values(make_tuple(16, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
334+ make_tuple(32, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
335+ make_tuple(64, &vpx_int_pro_row_sse2,
336+ &vpx_int_pro_row_c)));
351337
352338 INSTANTIATE_TEST_CASE_P(
353− SSE2, IntProColTest, ::testing::Values(
354− make_tuple(16, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
355− make_tuple(32, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
356− make_tuple(64, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c)));
357−
358−INSTANTIATE_TEST_CASE_P(
359− SSE2, SatdTest,
360− ::testing::Values(
361− make_tuple(16, &vpx_satd_sse2),
362− make_tuple(64, &vpx_satd_sse2),
363− make_tuple(256, &vpx_satd_sse2),
364− make_tuple(1024, &vpx_satd_sse2)));
339+ SSE2, IntProColTest,
340+ ::testing::Values(make_tuple(16, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
341+ make_tuple(32, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
342+ make_tuple(64, &vpx_int_pro_col_sse2,
343+ &vpx_int_pro_col_c)));
344+
345+INSTANTIATE_TEST_CASE_P(SSE2, SatdTest,
346+ ::testing::Values(make_tuple(16, &vpx_satd_sse2),
347+ make_tuple(64, &vpx_satd_sse2),
348+ make_tuple(256, &vpx_satd_sse2),
349+ make_tuple(1024, &vpx_satd_sse2)));
365350 #endif
366351
367352 #if HAVE_NEON
368353 INSTANTIATE_TEST_CASE_P(
369354 NEON, AverageTest,
370− ::testing::Values(
371− make_tuple(16, 16, 0, 8, &vpx_avg_8x8_neon),
372− make_tuple(16, 16, 5, 8, &vpx_avg_8x8_neon),
373− make_tuple(32, 32, 15, 8, &vpx_avg_8x8_neon),
374− make_tuple(16, 16, 0, 4, &vpx_avg_4x4_neon),
375− make_tuple(16, 16, 5, 4, &vpx_avg_4x4_neon),
376− make_tuple(32, 32, 15, 4, &vpx_avg_4x4_neon)));
377−
378−INSTANTIATE_TEST_CASE_P(
379− NEON, IntProRowTest, ::testing::Values(
380− make_tuple(16, &vpx_int_pro_row_neon, &vpx_int_pro_row_c),
381− make_tuple(32, &vpx_int_pro_row_neon, &vpx_int_pro_row_c),
382− make_tuple(64, &vpx_int_pro_row_neon, &vpx_int_pro_row_c)));
355+ ::testing::Values(make_tuple(16, 16, 0, 8, &vpx_avg_8x8_neon),
356+ make_tuple(16, 16, 5, 8, &vpx_avg_8x8_neon),
357+ make_tuple(32, 32, 15, 8, &vpx_avg_8x8_neon),
358+ make_tuple(16, 16, 0, 4, &vpx_avg_4x4_neon),
359+ make_tuple(16, 16, 5, 4, &vpx_avg_4x4_neon),
360+ make_tuple(32, 32, 15, 4, &vpx_avg_4x4_neon)));
383361
384362 INSTANTIATE_TEST_CASE_P(
385− NEON, IntProColTest, ::testing::Values(
386− make_tuple(16, &vpx_int_pro_col_neon, &vpx_int_pro_col_c),
387− make_tuple(32, &vpx_int_pro_col_neon, &vpx_int_pro_col_c),
388− make_tuple(64, &vpx_int_pro_col_neon, &vpx_int_pro_col_c)));
363+ NEON, IntProRowTest,
364+ ::testing::Values(make_tuple(16, &vpx_int_pro_row_neon, &vpx_int_pro_row_c),
365+ make_tuple(32, &vpx_int_pro_row_neon, &vpx_int_pro_row_c),
366+ make_tuple(64, &vpx_int_pro_row_neon,
367+ &vpx_int_pro_row_c)));
389368
390369 INSTANTIATE_TEST_CASE_P(
391− NEON, SatdTest,
392− ::testing::Values(
393− make_tuple(16, &vpx_satd_neon),
394− make_tuple(64, &vpx_satd_neon),
395− make_tuple(256, &vpx_satd_neon),
396− make_tuple(1024, &vpx_satd_neon)));
370+ NEON, IntProColTest,
371+ ::testing::Values(make_tuple(16, &vpx_int_pro_col_neon, &vpx_int_pro_col_c),
372+ make_tuple(32, &vpx_int_pro_col_neon, &vpx_int_pro_col_c),
373+ make_tuple(64, &vpx_int_pro_col_neon,
374+ &vpx_int_pro_col_c)));
375+
376+INSTANTIATE_TEST_CASE_P(NEON, SatdTest,
377+ ::testing::Values(make_tuple(16, &vpx_satd_neon),
378+ make_tuple(64, &vpx_satd_neon),
379+ make_tuple(256, &vpx_satd_neon),
380+ make_tuple(1024, &vpx_satd_neon)));
397381 #endif
398382
399383 #if HAVE_MSA
400384 INSTANTIATE_TEST_CASE_P(
401385 MSA, AverageTest,
402− ::testing::Values(
403− make_tuple(16, 16, 0, 8, &vpx_avg_8x8_msa),
404− make_tuple(16, 16, 5, 8, &vpx_avg_8x8_msa),
405− make_tuple(32, 32, 15, 8, &vpx_avg_8x8_msa),
406− make_tuple(16, 16, 0, 4, &vpx_avg_4x4_msa),
407− make_tuple(16, 16, 5, 4, &vpx_avg_4x4_msa),
408− make_tuple(32, 32, 15, 4, &vpx_avg_4x4_msa)));
386+ ::testing::Values(make_tuple(16, 16, 0, 8, &vpx_avg_8x8_msa),
387+ make_tuple(16, 16, 5, 8, &vpx_avg_8x8_msa),
388+ make_tuple(32, 32, 15, 8, &vpx_avg_8x8_msa),
389+ make_tuple(16, 16, 0, 4, &vpx_avg_4x4_msa),
390+ make_tuple(16, 16, 5, 4, &vpx_avg_4x4_msa),
391+ make_tuple(32, 32, 15, 4, &vpx_avg_4x4_msa)));
409392 #endif
410393
411394 } // namespace
test/blockiness_test.cc+17−25
@@ -26,11 +26,9 @@ · 25 unmodified lines
2626
2727 #include "vpx_mem/vpx_mem.h"
2828
29−
30−extern "C"
31−double vp9_get_blockiness(const unsigned char *img1, int img1_pitch,
32− const unsigned char *img2, int img2_pitch,
33− int width, int height);
29+extern "C" double vp9_get_blockiness(const unsigned char *img1, int img1_pitch,
30+ const unsigned char *img2, int img2_pitch,
31+ int width, int height);
3432
3533 using libvpx_test::ACMRandom;
3634
@@ -40,9 +38,9 @@ class BlockinessTestBase : public ::testing::Test { · 3 unmodified lines
4038 BlockinessTestBase(int width, int height) : width_(width), height_(height) {}
4139
4240 static void SetUpTestCase() {
43− source_data_ = reinterpret_cast<uint8_t*>(
41+ source_data_ = reinterpret_cast<uint8_t *>(
4442 vpx_memalign(kDataAlignment, kDataBufferSize));
45− reference_data_ = reinterpret_cast<uint8_t*>(
43+ reference_data_ = reinterpret_cast<uint8_t *>(
4644 vpx_memalign(kDataAlignment, kDataBufferSize));
4745 }
4846
@@ -53,14 +51,12 @@ class BlockinessTestBase : public ::testing::Test { · 4 unmodified lines
5351 reference_data_ = NULL;
5452 }
5553
56− virtual void TearDown() {
57− libvpx_test::ClearSystemState();
58− }
54+ virtual void TearDown() { libvpx_test::ClearSystemState(); }
5955
6056 protected:
6157 // Handle frames up to 640x480
6258 static const int kDataAlignment = 16;
63− static const int kDataBufferSize = 640*480;
59+ static const int kDataBufferSize = 640 * 480;
6460
6561 virtual void SetUp() {
6662 source_stride_ = (width_ + 31) & ~31;
@@ -68,8 +64,8 @@ class BlockinessTestBase : public ::testing::Test { · 1 unmodified line
6864 rnd_.Reset(ACMRandom::DeterministicSeed());
6965 }
7066
71− void FillConstant(uint8_t *data, int stride, uint8_t fill_constant,
72− int width, int height) {
67+ void FillConstant(uint8_t *data, int stride, uint8_t fill_constant, int width,
68+ int height) {
7369 for (int h = 0; h < height; ++h) {
7470 for (int w = 0; w < width; ++w) {
7571 data[h * stride + w] = fill_constant;
@@ -104,7 +100,7 @@ class BlockinessTestBase : public ::testing::Test { · 28 unmodified lines
104100 void FillCheckerboard(uint8_t *data, int stride) {
105101 for (int h = 0; h < height_; h += 4) {
106102 for (int w = 0; w < width_; w += 4) {
107− if (((h/4) ^ (w/4)) & 1)
103+ if (((h / 4) ^ (w / 4)) & 1)
108104 FillConstant(data + h * stride + w, stride, 255, 4, 4);
109105 else
110106 FillConstant(data + h * stride + w, stride, 0, 4, 4);
@@ -135,9 +131,9 @@ class BlockinessTestBase : public ::testing::Test { · 24 unmodified lines
135131 }
136132 }
137133 int width_, height_;
138− static uint8_t* source_data_;
134+ static uint8_t *source_data_;
139135 int source_stride_;
140− static uint8_t* reference_data_;
136+ static uint8_t *reference_data_;
141137 int reference_stride_;
142138
143139 ACMRandom rnd_;
@@ -153,15 +149,14 @@ class BlockinessVP9Test · 9 unmodified lines
153149
154150 protected:
155151 double GetBlockiness() const {
156− return vp9_get_blockiness(source_data_, source_stride_,
157− reference_data_, reference_stride_,
158− width_, height_);
152+ return vp9_get_blockiness(source_data_, source_stride_, reference_data_,
153+ reference_stride_, width_, height_);
159154 }
160155 };
161156 #endif // CONFIG_VP9_ENCODER
162157
163−uint8_t* BlockinessTestBase::source_data_ = NULL;
164−uint8_t* BlockinessTestBase::reference_data_ = NULL;
158+uint8_t *BlockinessTestBase::source_data_ = NULL;
159+uint8_t *BlockinessTestBase::reference_data_ = NULL;
165160
166161 #if CONFIG_VP9_ENCODER
167162 TEST_P(BlockinessVP9Test, SourceBlockierThanReference) {
@@ -212,7 +207,6 @@ TEST_P(BlockinessVP9Test, WorstCaseBlockiness) { · 44 unmodified lines
212207 }
213208 #endif // CONFIG_VP9_ENCODER
214209
215−
216210 using std::tr1::make_tuple;
217211
218212 //------------------------------------------------------------------------------
@@ -220,9 +214,7 @@ using std::tr1::make_tuple; · 1 unmodified line
220214
221215 #if CONFIG_VP9_ENCODER
222216 const BlockinessParam c_vp9_tests[] = {
223− make_tuple(320, 240),
224− make_tuple(318, 242),
225− make_tuple(318, 238),
217+ make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238),
226218 };
227219 INSTANTIATE_TEST_CASE_P(C, BlockinessVP9Test, ::testing::ValuesIn(c_vp9_tests));
228220 #endif
test/borders_test.cc+5−4
@@ -17,8 +17,9 @@ · 16 unmodified lines
1717
1818 namespace {
1919
20−class BordersTest : public ::libvpx_test::EncoderTest,
21− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
20+class BordersTest
21+ : public ::libvpx_test::EncoderTest,
22+ public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
2223 protected:
2324 BordersTest() : EncoderTest(GET_PARAM(0)) {}
2425 virtual ~BordersTest() {}
@@ -78,6 +79,6 @@ TEST_P(BordersTest, TestLowBitrate) { · 53 unmodified lines
7879 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
7980 }
8081
81−VP9_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
82− ::libvpx_test::kTwoPassGood));
82+VP9_INSTANTIATE_TEST_CASE(BordersTest,
83+ ::testing::Values(::libvpx_test::kTwoPassGood));
8384 } // namespace
test/byte_alignment_test.cc+20−26
@@ -36,29 +36,26 @@ struct ByteAlignmentTestParam { · 35 unmodified lines
3636 };
3737
3838 const ByteAlignmentTestParam kBaTestParams[] = {
39− {kLegacyByteAlignment, VPX_CODEC_OK, true},
40− {32, VPX_CODEC_OK, true},
41− {64, VPX_CODEC_OK, true},
42− {128, VPX_CODEC_OK, true},
43− {256, VPX_CODEC_OK, true},
44− {512, VPX_CODEC_OK, true},
45− {1024, VPX_CODEC_OK, true},
46− {1, VPX_CODEC_INVALID_PARAM, false},
47− {-2, VPX_CODEC_INVALID_PARAM, false},
48− {4, VPX_CODEC_INVALID_PARAM, false},
49− {16, VPX_CODEC_INVALID_PARAM, false},
50− {255, VPX_CODEC_INVALID_PARAM, false},
51− {2048, VPX_CODEC_INVALID_PARAM, false},
39+ { kLegacyByteAlignment, VPX_CODEC_OK, true },
40+ { 32, VPX_CODEC_OK, true },
41+ { 64, VPX_CODEC_OK, true },
42+ { 128, VPX_CODEC_OK, true },
43+ { 256, VPX_CODEC_OK, true },
44+ { 512, VPX_CODEC_OK, true },
45+ { 1024, VPX_CODEC_OK, true },
46+ { 1, VPX_CODEC_INVALID_PARAM, false },
47+ { -2, VPX_CODEC_INVALID_PARAM, false },
48+ { 4, VPX_CODEC_INVALID_PARAM, false },
49+ { 16, VPX_CODEC_INVALID_PARAM, false },
50+ { 255, VPX_CODEC_INVALID_PARAM, false },
51+ { 2048, VPX_CODEC_INVALID_PARAM, false },
5252 };
5353
5454 // Class for testing byte alignment of reference buffers.
5555 class ByteAlignmentTest
5656 : public ::testing::TestWithParam<ByteAlignmentTestParam> {
5757 protected:
58− ByteAlignmentTest()
59− : video_(NULL),
60− decoder_(NULL),
61− md5_file_(NULL) {}
58+ ByteAlignmentTest() : video_(NULL), decoder_(NULL), md5_file_(NULL) {}
6259
6360 virtual void SetUp() {
6461 video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
@@ -74,8 +71,7 @@ class ByteAlignmentTest · 9 unmodified lines
7471 }
7572
7673 virtual void TearDown() {
77− if (md5_file_ != NULL)
78− fclose(md5_file_);
74+ if (md5_file_ != NULL) fclose(md5_file_);
7975
8076 delete decoder_;
8177 delete video_;
@@ -89,8 +85,7 @@ class ByteAlignmentTest · 7 unmodified lines
8985 const vpx_codec_err_t res =
9086 decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
9187 CheckDecodedFrames(byte_alignment_to_check);
92− if (res == VPX_CODEC_OK)
93− video_->Next();
88+ if (res == VPX_CODEC_OK) video_->Next();
9489 return res;
9590 }
9691
@@ -98,8 +93,7 @@ class ByteAlignmentTest · 1 unmodified line
9893 for (; video_->cxdata() != NULL; video_->Next()) {
9994 const vpx_codec_err_t res =
10095 decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
101− if (res != VPX_CODEC_OK)
102− return res;
96+ if (res != VPX_CODEC_OK) return res;
10397 CheckDecodedFrames(byte_alignment_to_check);
10498 }
10599 return VPX_CODEC_OK;
@@ -135,7 +129,7 @@ class ByteAlignmentTest · 29 unmodified lines
135129 void OpenMd5File(const std::string &md5_file_name_) {
136130 md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
137131 ASSERT_TRUE(md5_file_ != NULL) << "MD5 file open failed. Filename: "
138− << md5_file_name_;
132+ << md5_file_name_;
139133 }
140134
141135 void CheckMd5(const vpx_image_t &img) {
@@ -163,8 +157,8 @@ class ByteAlignmentTest · 21 unmodified lines
163157
164158 TEST_F(ByteAlignmentTest, SwitchByteAlignment) {
165159 const int num_elements = 14;
166− const int byte_alignments[] = { 0, 32, 64, 128, 256, 512, 1024,
167− 0, 1024, 32, 512, 64, 256, 128 };
160+ const int byte_alignments[] = { 0, 32, 64, 128, 256, 512, 1024,
161+ 0, 1024, 32, 512, 64, 256, 128 };
168162
169163 for (int i = 0; i < num_elements; ++i) {
170164 SetByteAlignment(byte_alignments[i], VPX_CODEC_OK);
test/clear_system_state.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212
1313 #include "./vpx_config.h"
1414 #if ARCH_X86 || ARCH_X86_64
15−# include "vpx_ports/x86.h"
15+#include "vpx_ports/x86.h"
1616 #endif
1717
1818 namespace libvpx_test {
test/codec_factory.h+38−37
@@ -32,15 +32,15 @@ class CodecFactory { · 31 unmodified lines
3232
3333 virtual ~CodecFactory() {}
3434
35− virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
35+ virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
3636 unsigned long deadline) const = 0;
3737
38− virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
38+ virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
3939 const vpx_codec_flags_t flags,
4040 unsigned long deadline) // NOLINT(runtime/int)
41− const = 0;
41+ const = 0;
4242
43− virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
43+ virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
4444 unsigned long deadline,
4545 const unsigned long init_flags,
4646 TwopassStatsStore *stats) const = 0;
@@ -53,20 +53,20 @@ class CodecFactory { · 6 unmodified lines
5353 * to avoid having to include a pointer to the CodecFactory in every test
5454 * definition.
5555 */
56−template<class T1>
57−class CodecTestWithParam : public ::testing::TestWithParam<
58− std::tr1::tuple< const libvpx_test::CodecFactory*, T1 > > {
59−};
56+template <class T1>
57+class CodecTestWithParam
58+ : public ::testing::TestWithParam<
59+ std::tr1::tuple<const libvpx_test::CodecFactory *, T1> > {};
6060
61−template<class T1, class T2>
62−class CodecTestWith2Params : public ::testing::TestWithParam<
63− std::tr1::tuple< const libvpx_test::CodecFactory*, T1, T2 > > {
64−};
61+template <class T1, class T2>
62+class CodecTestWith2Params
63+ : public ::testing::TestWithParam<
64+ std::tr1::tuple<const libvpx_test::CodecFactory *, T1, T2> > {};
6565
66−template<class T1, class T2, class T3>
67−class CodecTestWith3Params : public ::testing::TestWithParam<
68− std::tr1::tuple< const libvpx_test::CodecFactory*, T1, T2, T3 > > {
69−};
66+template <class T1, class T2, class T3>
67+class CodecTestWith3Params
68+ : public ::testing::TestWithParam<
69+ std::tr1::tuple<const libvpx_test::CodecFactory *, T1, T2, T3> > {};
7070
7171 /*
7272 * VP8 Codec Definitions
@@ -82,7 +82,7 @@ class VP8Decoder : public Decoder { · 9 unmodified lines
8282 : Decoder(cfg, flag, deadline) {}
8383
8484 protected:
85− virtual vpx_codec_iface_t* CodecInterface() const {
85+ virtual vpx_codec_iface_t *CodecInterface() const {
8686 #if CONFIG_VP8_DECODER
8787 return &vpx_codec_vp8_dx_algo;
8888 #else
@@ -98,7 +98,7 @@ class VP8Encoder : public Encoder { · 9 unmodified lines
9898 : Encoder(cfg, deadline, init_flags, stats) {}
9999
100100 protected:
101− virtual vpx_codec_iface_t* CodecInterface() const {
101+ virtual vpx_codec_iface_t *CodecInterface() const {
102102 #if CONFIG_VP8_ENCODER
103103 return &vpx_codec_vp8_cx_algo;
104104 #else
@@ -111,12 +111,12 @@ class VP8CodecFactory : public CodecFactory { · 6 unmodified lines
111111 public:
112112 VP8CodecFactory() : CodecFactory() {}
113113
114− virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
114+ virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
115115 unsigned long deadline) const {
116116 return CreateDecoder(cfg, 0, deadline);
117117 }
118118
119− virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
119+ virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
120120 const vpx_codec_flags_t flags,
121121 unsigned long deadline) const { // NOLINT
122122 #if CONFIG_VP8_DECODER
@@ -126,7 +126,7 @@ class VP8CodecFactory : public CodecFactory { · 3 unmodified lines
126126 #endif
127127 }
128128
129− virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
129+ virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
130130 unsigned long deadline,
131131 const unsigned long init_flags,
132132 TwopassStatsStore *stats) const {
@@ -149,17 +149,17 @@ class VP8CodecFactory : public CodecFactory { · 16 unmodified lines
149149
150150 const libvpx_test::VP8CodecFactory kVP8;
151151
152−#define VP8_INSTANTIATE_TEST_CASE(test, ...)\
153− INSTANTIATE_TEST_CASE_P(VP8, test, \
154− ::testing::Combine( \
155− ::testing::Values(static_cast<const libvpx_test::CodecFactory*>( \
156− &libvpx_test::kVP8)), \
152+#define VP8_INSTANTIATE_TEST_CASE(test, ...) \
153+ INSTANTIATE_TEST_CASE_P( \
154+ VP8, test, \
155+ ::testing::Combine( \
156+ ::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
157+ &libvpx_test::kVP8)), \
157158 __VA_ARGS__))
158159 #else
159160 #define VP8_INSTANTIATE_TEST_CASE(test, ...)
160161 #endif // CONFIG_VP8
161162
162−
163163 /*
164164 * VP9 Codec Definitions
165165 */
@@ -174,7 +174,7 @@ class VP9Decoder : public Decoder { · 8 unmodified lines
174174 : Decoder(cfg, flag, deadline) {}
175175
176176 protected:
177− virtual vpx_codec_iface_t* CodecInterface() const {
177+ virtual vpx_codec_iface_t *CodecInterface() const {
178178 #if CONFIG_VP9_DECODER
179179 return &vpx_codec_vp9_dx_algo;
180180 #else
@@ -190,7 +190,7 @@ class VP9Encoder : public Encoder { · 9 unmodified lines
190190 : Encoder(cfg, deadline, init_flags, stats) {}
191191
192192 protected:
193− virtual vpx_codec_iface_t* CodecInterface() const {
193+ virtual vpx_codec_iface_t *CodecInterface() const {
194194 #if CONFIG_VP9_ENCODER
195195 return &vpx_codec_vp9_cx_algo;
196196 #else
@@ -203,12 +203,12 @@ class VP9CodecFactory : public CodecFactory { · 6 unmodified lines
203203 public:
204204 VP9CodecFactory() : CodecFactory() {}
205205
206− virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
206+ virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
207207 unsigned long deadline) const {
208208 return CreateDecoder(cfg, 0, deadline);
209209 }
210210
211− virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
211+ virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
212212 const vpx_codec_flags_t flags,
213213 unsigned long deadline) const { // NOLINT
214214 #if CONFIG_VP9_DECODER
@@ -218,7 +218,7 @@ class VP9CodecFactory : public CodecFactory { · 3 unmodified lines
218218 #endif
219219 }
220220
221− virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
221+ virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
222222 unsigned long deadline,
223223 const unsigned long init_flags,
224224 TwopassStatsStore *stats) const {
@@ -241,11 +241,12 @@ class VP9CodecFactory : public CodecFactory { · 16 unmodified lines
241241
242242 const libvpx_test::VP9CodecFactory kVP9;
243243
244−#define VP9_INSTANTIATE_TEST_CASE(test, ...)\
245− INSTANTIATE_TEST_CASE_P(VP9, test, \
246− ::testing::Combine( \
247− ::testing::Values(static_cast<const libvpx_test::CodecFactory*>( \
248− &libvpx_test::kVP9)), \
244+#define VP9_INSTANTIATE_TEST_CASE(test, ...) \
245+ INSTANTIATE_TEST_CASE_P( \
246+ VP9, test, \
247+ ::testing::Combine( \
248+ ::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
249+ &libvpx_test::kVP9)), \
249250 __VA_ARGS__))
250251 #else
251252 #define VP9_INSTANTIATE_TEST_CASE(test, ...)
test/config_test.cc+8−6
@@ -15,11 +15,13 @@ · 14 unmodified lines
1515
1616 namespace {
1717
18−class ConfigTest : public ::libvpx_test::EncoderTest,
19− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
18+class ConfigTest
19+ : public ::libvpx_test::EncoderTest,
20+ public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
2021 protected:
21− ConfigTest() : EncoderTest(GET_PARAM(0)),
22− frame_count_in_(0), frame_count_out_(0), frame_count_max_(0) {}
22+ ConfigTest()
23+ : EncoderTest(GET_PARAM(0)), frame_count_in_(0), frame_count_out_(0),
24+ frame_count_max_(0) {}
2325 virtual ~ConfigTest() {}
2426
2527 virtual void SetUp() {
@@ -32,12 +34,12 @@ class ConfigTest : public ::libvpx_test::EncoderTest, · 6 unmodified lines
3234 frame_count_out_ = 0;
3335 }
3436
35− virtual void PreEncodeFrameHook(libvpx_test::VideoSource* /*video*/) {
37+ virtual void PreEncodeFrameHook(libvpx_test::VideoSource * /*video*/) {
3638 ++frame_count_in_;
3739 abort_ |= (frame_count_in_ >= frame_count_max_);
3840 }
3941
40− virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {
42+ virtual void FramePktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {
4143 ++frame_count_out_;
4244 }
4345
test/consistency_test.cc+21−31
@@ -26,12 +26,10 @@ · 25 unmodified lines
2626 #include "vpx_dsp/ssim.h"
2727 #include "vpx_mem/vpx_mem.h"
2828
29−extern "C"
30−double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch,
31− uint8_t *img2, int img2_pitch,
32− int width, int height,
33− Ssimv *sv2, Metrics *m,
34− int do_inconsistency);
29+extern "C" double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch,
30+ uint8_t *img2, int img2_pitch, int width,
31+ int height, Ssimv *sv2, Metrics *m,
32+ int do_inconsistency);
3533
3634 using libvpx_test::ACMRandom;
3735
@@ -41,20 +39,18 @@ class ConsistencyTestBase : public ::testing::Test { · 3 unmodified lines
4139 ConsistencyTestBase(int width, int height) : width_(width), height_(height) {}
4240
4341 static void SetUpTestCase() {
44− source_data_[0] = reinterpret_cast<uint8_t*>(
42+ source_data_[0] = reinterpret_cast<uint8_t *>(
4543 vpx_memalign(kDataAlignment, kDataBufferSize));
46− reference_data_[0] = reinterpret_cast<uint8_t*>(
44+ reference_data_[0] = reinterpret_cast<uint8_t *>(
4745 vpx_memalign(kDataAlignment, kDataBufferSize));
48− source_data_[1] = reinterpret_cast<uint8_t*>(
46+ source_data_[1] = reinterpret_cast<uint8_t *>(
4947 vpx_memalign(kDataAlignment, kDataBufferSize));
50− reference_data_[1] = reinterpret_cast<uint8_t*>(
48+ reference_data_[1] = reinterpret_cast<uint8_t *>(
5149 vpx_memalign(kDataAlignment, kDataBufferSize));
5250 ssim_array_ = new Ssimv[kDataBufferSize / 16];
5351 }
5452
55− static void ClearSsim() {
56− memset(ssim_array_, 0, kDataBufferSize / 16);
57− }
53+ static void ClearSsim() { memset(ssim_array_, 0, kDataBufferSize / 16); }
5854 static void TearDownTestCase() {
5955 vpx_free(source_data_[0]);
6056 source_data_[0] = NULL;
@@ -68,14 +64,12 @@ class ConsistencyTestBase : public ::testing::Test { · 7 unmodified lines
6864 delete[] ssim_array_;
6965 }
7066
71− virtual void TearDown() {
72− libvpx_test::ClearSystemState();
73− }
67+ virtual void TearDown() { libvpx_test::ClearSystemState(); }
7468
7569 protected:
7670 // Handle frames up to 640x480
7771 static const int kDataAlignment = 16;
78− static const int kDataBufferSize = 640*480;
72+ static const int kDataBufferSize = 640 * 480;
7973
8074 virtual void SetUp() {
8175 source_stride_ = (width_ + 31) & ~31;
@@ -122,9 +116,9 @@ class ConsistencyTestBase : public ::testing::Test { · 40 unmodified lines
122116 }
123117 }
124118 int width_, height_;
125− static uint8_t* source_data_[2];
119+ static uint8_t *source_data_[2];
126120 int source_stride_;
127− static uint8_t* reference_data_[2];
121+ static uint8_t *reference_data_[2];
128122 int reference_stride_;
129123 static Ssimv *ssim_array_;
130124 Metrics metrics_;
@@ -142,18 +136,17 @@ class ConsistencyVP9Test · 11 unmodified lines
142136
143137 protected:
144138 double CheckConsistency(int frame) {
145− EXPECT_LT(frame, 2)<< "Frame to check has to be less than 2.";
146− return
147− vpx_get_ssim_metrics(source_data_[frame], source_stride_,
148− reference_data_[frame], reference_stride_,
149− width_, height_, ssim_array_, &metrics_, 1);
139+ EXPECT_LT(frame, 2) << "Frame to check has to be less than 2.";
140+ return vpx_get_ssim_metrics(source_data_[frame], source_stride_,
141+ reference_data_[frame], reference_stride_,
142+ width_, height_, ssim_array_, &metrics_, 1);
150143 }
151144 };
152145 #endif // CONFIG_VP9_ENCODER
153146
154−uint8_t* ConsistencyTestBase::source_data_[2] = {NULL, NULL};
155−uint8_t* ConsistencyTestBase::reference_data_[2] = {NULL, NULL};
156−Ssimv* ConsistencyTestBase::ssim_array_ = NULL;
147+uint8_t *ConsistencyTestBase::source_data_[2] = { NULL, NULL };
148+uint8_t *ConsistencyTestBase::reference_data_[2] = { NULL, NULL };
149+Ssimv *ConsistencyTestBase::ssim_array_ = NULL;
157150
158151 #if CONFIG_VP9_ENCODER
159152 TEST_P(ConsistencyVP9Test, ConsistencyIsZero) {
@@ -205,7 +198,6 @@ TEST_P(ConsistencyVP9Test, ConsistencyIsZero) { · 45 unmodified lines
205198 }
206199 #endif // CONFIG_VP9_ENCODER
207200
208−
209201 using std::tr1::make_tuple;
210202
211203 //------------------------------------------------------------------------------
@@ -213,9 +205,7 @@ using std::tr1::make_tuple; · 1 unmodified line
213205
214206 #if CONFIG_VP9_ENCODER
215207 const ConsistencyParam c_vp9_tests[] = {
216− make_tuple(320, 240),
217− make_tuple(318, 242),
218− make_tuple(318, 238),
208+ make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238),
219209 };
220210 INSTANTIATE_TEST_CASE_P(C, ConsistencyVP9Test,
221211 ::testing::ValuesIn(c_vp9_tests));
test/convolve_test.cc+271−369
@@ -37,14 +37,12 @@ typedef void (*ConvolveFunc)(const uint8_t *src, ptrdiff_t src_stride, · 36 unmodified lines
3737 int w, int h);
3838
3939 struct ConvolveFunctions {
40− ConvolveFunctions(ConvolveFunc copy, ConvolveFunc avg,
41− ConvolveFunc h8, ConvolveFunc h8_avg,
42− ConvolveFunc v8, ConvolveFunc v8_avg,
43− ConvolveFunc hv8, ConvolveFunc hv8_avg,
44− ConvolveFunc sh8, ConvolveFunc sh8_avg,
45− ConvolveFunc sv8, ConvolveFunc sv8_avg,
46− ConvolveFunc shv8, ConvolveFunc shv8_avg,
47− int bd)
40+ ConvolveFunctions(ConvolveFunc copy, ConvolveFunc avg, ConvolveFunc h8,
41+ ConvolveFunc h8_avg, ConvolveFunc v8, ConvolveFunc v8_avg,
42+ ConvolveFunc hv8, ConvolveFunc hv8_avg, ConvolveFunc sh8,
43+ ConvolveFunc sh8_avg, ConvolveFunc sv8,
44+ ConvolveFunc sv8_avg, ConvolveFunc shv8,
45+ ConvolveFunc shv8_avg, int bd)
4846 : copy_(copy), avg_(avg), h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg),
4947 v8_avg_(v8_avg), hv8_avg_(hv8_avg), sh8_(sh8), sv8_(sv8), shv8_(shv8),
5048 sh8_avg_(sh8_avg), sv8_avg_(sv8_avg), shv8_avg_(shv8_avg),
@@ -58,49 +56,35 @@ struct ConvolveFunctions { · 7 unmodified lines
5856 ConvolveFunc h8_avg_;
5957 ConvolveFunc v8_avg_;
6058 ConvolveFunc hv8_avg_;
61− ConvolveFunc sh8_; // scaled horiz
62− ConvolveFunc sv8_; // scaled vert
63− ConvolveFunc shv8_; // scaled horiz/vert
64− ConvolveFunc sh8_avg_; // scaled avg horiz
65− ConvolveFunc sv8_avg_; // scaled avg vert
66− ConvolveFunc shv8_avg_; // scaled avg horiz/vert
59+ ConvolveFunc sh8_; // scaled horiz
60+ ConvolveFunc sv8_; // scaled vert
61+ ConvolveFunc shv8_; // scaled horiz/vert
62+ ConvolveFunc sh8_avg_; // scaled avg horiz
63+ ConvolveFunc sv8_avg_; // scaled avg vert
64+ ConvolveFunc shv8_avg_; // scaled avg horiz/vert
6765 int use_highbd_; // 0 if high bitdepth not used, else the actual bit depth.
6866 };
6967
7068 typedef std::tr1::tuple<int, int, const ConvolveFunctions *> ConvolveParam;
7169
72−#define ALL_SIZES(convolve_fn) \
73− make_tuple(4, 4, &convolve_fn), \
74− make_tuple(8, 4, &convolve_fn), \
75− make_tuple(4, 8, &convolve_fn), \
76− make_tuple(8, 8, &convolve_fn), \
77− make_tuple(16, 8, &convolve_fn), \
78− make_tuple(8, 16, &convolve_fn), \
79− make_tuple(16, 16, &convolve_fn), \
80− make_tuple(32, 16, &convolve_fn), \
81− make_tuple(16, 32, &convolve_fn), \
82− make_tuple(32, 32, &convolve_fn), \
83− make_tuple(64, 32, &convolve_fn), \
84− make_tuple(32, 64, &convolve_fn), \
85− make_tuple(64, 64, &convolve_fn)
70+#define ALL_SIZES(convolve_fn) \
71+ make_tuple(4, 4, &convolve_fn), make_tuple(8, 4, &convolve_fn), \
72+ make_tuple(4, 8, &convolve_fn), make_tuple(8, 8, &convolve_fn), \
73+ make_tuple(16, 8, &convolve_fn), make_tuple(8, 16, &convolve_fn), \
74+ make_tuple(16, 16, &convolve_fn), make_tuple(32, 16, &convolve_fn), \
75+ make_tuple(16, 32, &convolve_fn), make_tuple(32, 32, &convolve_fn), \
76+ make_tuple(64, 32, &convolve_fn), make_tuple(32, 64, &convolve_fn), \
77+ make_tuple(64, 64, &convolve_fn)
8678
8779 // Reference 8-tap subpixel filter, slightly modified to fit into this test.
8880 #define VP9_FILTER_WEIGHT 128
8981 #define VP9_FILTER_SHIFT 7
90−uint8_t clip_pixel(int x) {
91− return x < 0 ? 0 :
92− x > 255 ? 255 :
93− x;
94−}
82+uint8_t clip_pixel(int x) { return x < 0 ? 0 : x > 255 ? 255 : x; }
9583
96−void filter_block2d_8_c(const uint8_t *src_ptr,
97− const unsigned int src_stride,
98− const int16_t *HFilter,
99− const int16_t *VFilter,
100− uint8_t *dst_ptr,
101− unsigned int dst_stride,
102− unsigned int output_width,
103− unsigned int output_height) {
84+void filter_block2d_8_c(const uint8_t *src_ptr, const unsigned int src_stride,
85+ const int16_t *HFilter, const int16_t *VFilter,
86+ uint8_t *dst_ptr, unsigned int dst_stride,
87+ unsigned int output_width, unsigned int output_height) {
10488 // Between passes, we use an intermediate buffer whose height is extended to
10589 // have enough horizontally filtered values as input for the vertical pass.
10690 // This buffer is allocated to be big enough for the largest block type we
@@ -128,15 +112,11 @@ void filter_block2d_8_c(const uint8_t *src_ptr, · 21 unmodified lines
128112 for (i = 0; i < intermediate_height; ++i) {
129113 for (j = 0; j < output_width; ++j) {
130114 // Apply filter...
131− const int temp = (src_ptr[0] * HFilter[0]) +
132− (src_ptr[1] * HFilter[1]) +
133− (src_ptr[2] * HFilter[2]) +
134− (src_ptr[3] * HFilter[3]) +
135− (src_ptr[4] * HFilter[4]) +
136− (src_ptr[5] * HFilter[5]) +
137− (src_ptr[6] * HFilter[6]) +
138− (src_ptr[7] * HFilter[7]) +
139− (VP9_FILTER_WEIGHT >> 1); // Rounding
115+ const int temp = (src_ptr[0] * HFilter[0]) + (src_ptr[1] * HFilter[1]) +
116+ (src_ptr[2] * HFilter[2]) + (src_ptr[3] * HFilter[3]) +
117+ (src_ptr[4] * HFilter[4]) + (src_ptr[5] * HFilter[5]) +
118+ (src_ptr[6] * HFilter[6]) + (src_ptr[7] * HFilter[7]) +
119+ (VP9_FILTER_WEIGHT >> 1); // Rounding
140120
141121 // Normalize back to 0-255...
142122 *output_ptr = clip_pixel(temp >> VP9_FILTER_SHIFT);
@@ -153,15 +133,11 @@ void filter_block2d_8_c(const uint8_t *src_ptr, · 10 unmodified lines
153133 for (i = 0; i < output_height; ++i) {
154134 for (j = 0; j < output_width; ++j) {
155135 // Apply filter...
156− const int temp = (src_ptr[0] * VFilter[0]) +
157− (src_ptr[1] * VFilter[1]) +
158− (src_ptr[2] * VFilter[2]) +
159− (src_ptr[3] * VFilter[3]) +
160− (src_ptr[4] * VFilter[4]) +
161− (src_ptr[5] * VFilter[5]) +
162− (src_ptr[6] * VFilter[6]) +
163− (src_ptr[7] * VFilter[7]) +
164− (VP9_FILTER_WEIGHT >> 1); // Rounding
136+ const int temp = (src_ptr[0] * VFilter[0]) + (src_ptr[1] * VFilter[1]) +
137+ (src_ptr[2] * VFilter[2]) + (src_ptr[3] * VFilter[3]) +
138+ (src_ptr[4] * VFilter[4]) + (src_ptr[5] * VFilter[5]) +
139+ (src_ptr[6] * VFilter[6]) + (src_ptr[7] * VFilter[7]) +
140+ (VP9_FILTER_WEIGHT >> 1); // Rounding
165141
166142 // Normalize back to 0-255...
167143 *dst_ptr++ = clip_pixel(temp >> VP9_FILTER_SHIFT);
@@ -172,12 +148,9 @@ void filter_block2d_8_c(const uint8_t *src_ptr, · 4 unmodified lines
172148 }
173149 }
174150
175−void block2d_average_c(uint8_t *src,
176− unsigned int src_stride,
177− uint8_t *output_ptr,
178− unsigned int output_stride,
179− unsigned int output_width,
180− unsigned int output_height) {
151+void block2d_average_c(uint8_t *src, unsigned int src_stride,
152+ uint8_t *output_ptr, unsigned int output_stride,
153+ unsigned int output_width, unsigned int output_height) {
181154 unsigned int i, j;
182155 for (i = 0; i < output_height; ++i) {
183156 for (j = 0; j < output_width; ++j) {
@@ -189,10 +162,8 @@ void block2d_average_c(uint8_t *src, · 5 unmodified lines
189162
190163 void filter_average_block2d_8_c(const uint8_t *src_ptr,
191164 const unsigned int src_stride,
192− const int16_t *HFilter,
193− const int16_t *VFilter,
194− uint8_t *dst_ptr,
195− unsigned int dst_stride,
165+ const int16_t *HFilter, const int16_t *VFilter,
166+ uint8_t *dst_ptr, unsigned int dst_stride,
196167 unsigned int output_width,
197168 unsigned int output_height) {
198169 uint8_t tmp[kMaxDimension * kMaxDimension];
@@ -201,20 +172,16 @@ void filter_average_block2d_8_c(const uint8_t *src_ptr, · 2 unmodified lines
201172 assert(output_height <= kMaxDimension);
202173 filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64,
203174 output_width, output_height);
204− block2d_average_c(tmp, 64, dst_ptr, dst_stride,
205− output_width, output_height);
175+ block2d_average_c(tmp, 64, dst_ptr, dst_stride, output_width, output_height);
206176 }
207177
208178 #if CONFIG_VP9_HIGHBITDEPTH
209179 void highbd_filter_block2d_8_c(const uint16_t *src_ptr,
210180 const unsigned int src_stride,
211− const int16_t *HFilter,
212− const int16_t *VFilter,
213− uint16_t *dst_ptr,
214− unsigned int dst_stride,
181+ const int16_t *HFilter, const int16_t *VFilter,
182+ uint16_t *dst_ptr, unsigned int dst_stride,
215183 unsigned int output_width,
216− unsigned int output_height,
217− int bd) {
184+ unsigned int output_height, int bd) {
218185 // Between passes, we use an intermediate buffer whose height is extended to
219186 // have enough horizontally filtered values as input for the vertical pass.
220187 // This buffer is allocated to be big enough for the largest block type we
@@ -243,14 +210,10 @@ void highbd_filter_block2d_8_c(const uint16_t *src_ptr, · 22 unmodified lines
243210 for (i = 0; i < intermediate_height; ++i) {
244211 for (j = 0; j < output_width; ++j) {
245212 // Apply filter...
246− const int temp = (src_ptr[0] * HFilter[0]) +
247− (src_ptr[1] * HFilter[1]) +
248− (src_ptr[2] * HFilter[2]) +
249− (src_ptr[3] * HFilter[3]) +
250− (src_ptr[4] * HFilter[4]) +
251− (src_ptr[5] * HFilter[5]) +
252− (src_ptr[6] * HFilter[6]) +
253− (src_ptr[7] * HFilter[7]) +
213+ const int temp = (src_ptr[0] * HFilter[0]) + (src_ptr[1] * HFilter[1]) +
214+ (src_ptr[2] * HFilter[2]) + (src_ptr[3] * HFilter[3]) +
215+ (src_ptr[4] * HFilter[4]) + (src_ptr[5] * HFilter[5]) +
216+ (src_ptr[6] * HFilter[6]) + (src_ptr[7] * HFilter[7]) +
254217 (VP9_FILTER_WEIGHT >> 1); // Rounding
255218
256219 // Normalize back to 0-255...
@@ -271,14 +234,10 @@ void highbd_filter_block2d_8_c(const uint16_t *src_ptr, · 14 unmodified lines
271234 for (i = 0; i < output_height; ++i) {
272235 for (j = 0; j < output_width; ++j) {
273236 // Apply filter...
274− const int temp = (src_ptr[0] * VFilter[0]) +
275− (src_ptr[1] * VFilter[1]) +
276− (src_ptr[2] * VFilter[2]) +
277− (src_ptr[3] * VFilter[3]) +
278− (src_ptr[4] * VFilter[4]) +
279− (src_ptr[5] * VFilter[5]) +
280− (src_ptr[6] * VFilter[6]) +
281− (src_ptr[7] * VFilter[7]) +
237+ const int temp = (src_ptr[0] * VFilter[0]) + (src_ptr[1] * VFilter[1]) +
238+ (src_ptr[2] * VFilter[2]) + (src_ptr[3] * VFilter[3]) +
239+ (src_ptr[4] * VFilter[4]) + (src_ptr[5] * VFilter[5]) +
240+ (src_ptr[6] * VFilter[6]) + (src_ptr[7] * VFilter[7]) +
282241 (VP9_FILTER_WEIGHT >> 1); // Rounding
283242
284243 // Normalize back to 0-255...
@@ -291,10 +250,8 @@ void highbd_filter_block2d_8_c(const uint16_t *src_ptr, · 6 unmodified lines
291250 }
292251 }
293252
294−void highbd_block2d_average_c(uint16_t *src,
295− unsigned int src_stride,
296− uint16_t *output_ptr,
297− unsigned int output_stride,
253+void highbd_block2d_average_c(uint16_t *src, unsigned int src_stride,
254+ uint16_t *output_ptr, unsigned int output_stride,
298255 unsigned int output_width,
299256 unsigned int output_height) {
300257 unsigned int i, j;
@@ -306,23 +263,19 @@ void highbd_block2d_average_c(uint16_t *src, · 5 unmodified lines
306263 }
307264 }
308265
309−void highbd_filter_average_block2d_8_c(const uint16_t *src_ptr,
310− const unsigned int src_stride,
311− const int16_t *HFilter,
312− const int16_t *VFilter,
313− uint16_t *dst_ptr,
314− unsigned int dst_stride,
315− unsigned int output_width,
316− unsigned int output_height,
317− int bd) {
266+void highbd_filter_average_block2d_8_c(
267+ const uint16_t *src_ptr, const unsigned int src_stride,
268+ const int16_t *HFilter, const int16_t *VFilter, uint16_t *dst_ptr,
269+ unsigned int dst_stride, unsigned int output_width,
270+ unsigned int output_height, int bd) {
318271 uint16_t tmp[kMaxDimension * kMaxDimension];
319272
320273 assert(output_width <= kMaxDimension);
321274 assert(output_height <= kMaxDimension);
322275 highbd_filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64,
323276 output_width, output_height, bd);
324− highbd_block2d_average_c(tmp, 64, dst_ptr, dst_stride,
325− output_width, output_height);
277+ highbd_block2d_average_c(tmp, 64, dst_ptr, dst_stride, output_width,
278+ output_height);
326279 }
327280 #endif // CONFIG_VP9_HIGHBITDEPTH
328281
@@ -330,19 +283,20 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { · 1 unmodified line
330283 public:
331284 static void SetUpTestCase() {
332285 // Force input_ to be unaligned, output to be 16 byte aligned.
333− input_ = reinterpret_cast<uint8_t*>(
334− vpx_memalign(kDataAlignment, kInputBufferSize + 1)) + 1;
335− output_ = reinterpret_cast<uint8_t*>(
286+ input_ = reinterpret_cast<uint8_t *>(
287+ vpx_memalign(kDataAlignment, kInputBufferSize + 1)) +
288+ 1;
289+ output_ = reinterpret_cast<uint8_t *>(
336290 vpx_memalign(kDataAlignment, kOutputBufferSize));
337− output_ref_ = reinterpret_cast<uint8_t*>(
291+ output_ref_ = reinterpret_cast<uint8_t *>(
338292 vpx_memalign(kDataAlignment, kOutputBufferSize));
339293 #if CONFIG_VP9_HIGHBITDEPTH
340− input16_ = reinterpret_cast<uint16_t*>(
341− vpx_memalign(kDataAlignment,
342− (kInputBufferSize + 1) * sizeof(uint16_t))) + 1;
343− output16_ = reinterpret_cast<uint16_t*>(
294+ input16_ = reinterpret_cast<uint16_t *>(vpx_memalign(
295+ kDataAlignment, (kInputBufferSize + 1) * sizeof(uint16_t))) +
296+ 1;
297+ output16_ = reinterpret_cast<uint16_t *>(
344298 vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t)));
345− output16_ref_ = reinterpret_cast<uint16_t*>(
299+ output16_ref_ = reinterpret_cast<uint16_t *>(
346300 vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t)));
347301 #endif
348302 }
@@ -438,8 +392,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { · 89 unmodified lines
438392
439393 void CheckGuardBlocks() {
440394 for (int i = 0; i < kOutputBufferSize; ++i) {
441− if (IsIndexInBorder(i))
442− EXPECT_EQ(255, output_[i]);
395+ if (IsIndexInBorder(i)) EXPECT_EQ(255, output_[i]);
443396 }
444397 }
445398
@@ -497,98 +450,88 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { · 51 unmodified lines
497450 void assign_val(uint8_t *list, int index, uint16_t val) const {
498451 #if CONFIG_VP9_HIGHBITDEPTH
499452 if (UUT_->use_highbd_ == 0) {
500− list[index] = (uint8_t) val;
453+ list[index] = (uint8_t)val;
501454 } else {
502455 CONVERT_TO_SHORTPTR(list)[index] = val;
503456 }
504457 #else
505− list[index] = (uint8_t) val;
458+ list[index] = (uint8_t)val;
506459 #endif
507460 }
508461
509− void wrapper_filter_average_block2d_8_c(const uint8_t *src_ptr,
510− const unsigned int src_stride,
511− const int16_t *HFilter,
512− const int16_t *VFilter,
513− uint8_t *dst_ptr,
514− unsigned int dst_stride,
515− unsigned int output_width,
516− unsigned int output_height) {
462+ void wrapper_filter_average_block2d_8_c(
463+ const uint8_t *src_ptr, const unsigned int src_stride,
464+ const int16_t *HFilter, const int16_t *VFilter, uint8_t *dst_ptr,
465+ unsigned int dst_stride, unsigned int output_width,
466+ unsigned int output_height) {
517467 #if CONFIG_VP9_HIGHBITDEPTH
518468 if (UUT_->use_highbd_ == 0) {
519− filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
520− dst_ptr, dst_stride, output_width,
521− output_height);
469+ filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, dst_ptr,
470+ dst_stride, output_width, output_height);
522471 } else {
523− highbd_filter_average_block2d_8_c(CONVERT_TO_SHORTPTR(src_ptr),
524− src_stride, HFilter, VFilter,
525− CONVERT_TO_SHORTPTR(dst_ptr),
526− dst_stride, output_width, output_height,
527− UUT_->use_highbd_);
472+ highbd_filter_average_block2d_8_c(
473+ CONVERT_TO_SHORTPTR(src_ptr), src_stride, HFilter, VFilter,
474+ CONVERT_TO_SHORTPTR(dst_ptr), dst_stride, output_width, output_height,
475+ UUT_->use_highbd_);
528476 }
529477 #else
530− filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
531− dst_ptr, dst_stride, output_width,
532− output_height);
478+ filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, dst_ptr,
479+ dst_stride, output_width, output_height);
533480 #endif
534481 }
535482
536483 void wrapper_filter_block2d_8_c(const uint8_t *src_ptr,
537484 const unsigned int src_stride,
538485 const int16_t *HFilter,
539− const int16_t *VFilter,
540− uint8_t *dst_ptr,
486+ const int16_t *VFilter, uint8_t *dst_ptr,
541487 unsigned int dst_stride,
542488 unsigned int output_width,
543489 unsigned int output_height) {
544490 #if CONFIG_VP9_HIGHBITDEPTH
545491 if (UUT_->use_highbd_ == 0) {
546− filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
547− dst_ptr, dst_stride, output_width, output_height);
492+ filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, dst_ptr,
493+ dst_stride, output_width, output_height);
548494 } else {
549495 highbd_filter_block2d_8_c(CONVERT_TO_SHORTPTR(src_ptr), src_stride,
550− HFilter, VFilter,
551− CONVERT_TO_SHORTPTR(dst_ptr), dst_stride,
552− output_width, output_height, UUT_->use_highbd_);
496+ HFilter, VFilter, CONVERT_TO_SHORTPTR(dst_ptr),
497+ dst_stride, output_width, output_height,
498+ UUT_->use_highbd_);
553499 }
554500 #else
555− filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter,
556− dst_ptr, dst_stride, output_width, output_height);
501+ filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, dst_ptr,
502+ dst_stride, output_width, output_height);
557503 #endif
558504 }
559505
560− const ConvolveFunctions* UUT_;
561− static uint8_t* input_;
562− static uint8_t* output_;
563− static uint8_t* output_ref_;
506+ const ConvolveFunctions *UUT_;
507+ static uint8_t *input_;
508+ static uint8_t *output_;
509+ static uint8_t *output_ref_;
564510 #if CONFIG_VP9_HIGHBITDEPTH
565− static uint16_t* input16_;
566− static uint16_t* output16_;
567− static uint16_t* output16_ref_;
511+ static uint16_t *input16_;
512+ static uint16_t *output16_;
513+ static uint16_t *output16_ref_;
568514 int mask_;
569515 #endif
570516 };
571517
572−uint8_t* ConvolveTest::input_ = NULL;
573−uint8_t* ConvolveTest::output_ = NULL;
574−uint8_t* ConvolveTest::output_ref_ = NULL;
518+uint8_t *ConvolveTest::input_ = NULL;
519+uint8_t *ConvolveTest::output_ = NULL;
520+uint8_t *ConvolveTest::output_ref_ = NULL;
575521 #if CONFIG_VP9_HIGHBITDEPTH
576−uint16_t* ConvolveTest::input16_ = NULL;
577−uint16_t* ConvolveTest::output16_ = NULL;
578−uint16_t* ConvolveTest::output16_ref_ = NULL;
522+uint16_t *ConvolveTest::input16_ = NULL;
523+uint16_t *ConvolveTest::output16_ = NULL;
524+uint16_t *ConvolveTest::output16_ref_ = NULL;
579525 #endif
580526
581−TEST_P(ConvolveTest, GuardBlocks) {
582− CheckGuardBlocks();
583−}
527+TEST_P(ConvolveTest, GuardBlocks) { CheckGuardBlocks(); }
584528
585529 TEST_P(ConvolveTest, Copy) {
586− uint8_t* const in = input();
587− uint8_t* const out = output();
530+ uint8_t *const in = input();
531+ uint8_t *const out = output();
588532
589− ASM_REGISTER_STATE_CHECK(
590− UUT_->copy_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0,
591− Width(), Height()));
533+ ASM_REGISTER_STATE_CHECK(UUT_->copy_(in, kInputStride, out, kOutputStride,
534+ NULL, 0, NULL, 0, Width(), Height()));
592535
593536 CheckGuardBlocks();
594537
@@ -600,14 +543,13 @@ TEST_P(ConvolveTest, Copy) { · 5 unmodified lines
600543 }
601544
602545 TEST_P(ConvolveTest, Avg) {
603− uint8_t* const in = input();
604− uint8_t* const out = output();
605− uint8_t* const out_ref = output_ref();
546+ uint8_t *const in = input();
547+ uint8_t *const out = output();
548+ uint8_t *const out_ref = output_ref();
606549 CopyOutputToRef();
607550
608− ASM_REGISTER_STATE_CHECK(
609− UUT_->avg_(in, kInputStride, out, kOutputStride, NULL, 0, NULL, 0,
610− Width(), Height()));
551+ ASM_REGISTER_STATE_CHECK(UUT_->avg_(in, kInputStride, out, kOutputStride,
552+ NULL, 0, NULL, 0, Width(), Height()));
611553
612554 CheckGuardBlocks();
613555
@@ -615,18 +557,20 @@ TEST_P(ConvolveTest, Avg) { · 1 unmodified line
615557 for (int x = 0; x < Width(); ++x)
616558 ASSERT_EQ(lookup(out, y * kOutputStride + x),
617559 ROUND_POWER_OF_TWO(lookup(in, y * kInputStride + x) +
618− lookup(out_ref, y * kOutputStride + x), 1))
560+ lookup(out_ref, y * kOutputStride + x),
561+ 1))
619562 << "(" << x << "," << y << ")";
620563 }
621564
622565 TEST_P(ConvolveTest, CopyHoriz) {
623− uint8_t* const in = input();
624− uint8_t* const out = output();
625− DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
566+ uint8_t *const in = input();
567+ uint8_t *const out = output();
568+ DECLARE_ALIGNED(256, const int16_t,
569+ filter8[8]) = { 0, 0, 0, 128, 0, 0, 0, 0 };
626570
627− ASM_REGISTER_STATE_CHECK(
628− UUT_->sh8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
629− Width(), Height()));
571+ ASM_REGISTER_STATE_CHECK(UUT_->sh8_(in, kInputStride, out, kOutputStride,
572+ filter8, 16, filter8, 16, Width(),
573+ Height()));
630574
631575 CheckGuardBlocks();
632576
@@ -638,13 +582,14 @@ TEST_P(ConvolveTest, CopyHoriz) { · 5 unmodified lines
638582 }
639583
640584 TEST_P(ConvolveTest, CopyVert) {
641− uint8_t* const in = input();
642− uint8_t* const out = output();
643− DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
585+ uint8_t *const in = input();
586+ uint8_t *const out = output();
587+ DECLARE_ALIGNED(256, const int16_t,
588+ filter8[8]) = { 0, 0, 0, 128, 0, 0, 0, 0 };
644589
645− ASM_REGISTER_STATE_CHECK(
646− UUT_->sv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
647− Width(), Height()));
590+ ASM_REGISTER_STATE_CHECK(UUT_->sv8_(in, kInputStride, out, kOutputStride,
591+ filter8, 16, filter8, 16, Width(),
592+ Height()));
648593
649594 CheckGuardBlocks();
650595
@@ -656,13 +601,14 @@ TEST_P(ConvolveTest, CopyVert) { · 5 unmodified lines
656601 }
657602
658603 TEST_P(ConvolveTest, Copy2D) {
659− uint8_t* const in = input();
660− uint8_t* const out = output();
661− DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
604+ uint8_t *const in = input();
605+ uint8_t *const out = output();
606+ DECLARE_ALIGNED(256, const int16_t,
607+ filter8[8]) = { 0, 0, 0, 128, 0, 0, 0, 0 };
662608
663− ASM_REGISTER_STATE_CHECK(
664− UUT_->shv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8,
665− 16, Width(), Height()));
609+ ASM_REGISTER_STATE_CHECK(UUT_->shv8_(in, kInputStride, out, kOutputStride,
610+ filter8, 16, filter8, 16, Width(),
611+ Height()));
666612
667613 CheckGuardBlocks();
668614
@@ -700,12 +646,12 @@ TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) { · 31 unmodified lines
700646 const int16_t kInvalidFilter[8] = { 0 };
701647
702648 TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
703− uint8_t* const in = input();
704− uint8_t* const out = output();
649+ uint8_t *const in = input();
650+ uint8_t *const out = output();
705651 #if CONFIG_VP9_HIGHBITDEPTH
706652 uint8_t ref8[kOutputStride * kMaxDimension];
707653 uint16_t ref16[kOutputStride * kMaxDimension];
708− uint8_t* ref;
654+ uint8_t *ref;
709655 if (UUT_->use_highbd_ == 0) {
710656 ref = ref8;
711657 } else {
@@ -721,31 +667,26 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) { · 9 unmodified lines
721667
722668 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
723669 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
724− wrapper_filter_block2d_8_c(in, kInputStride,
725− filters[filter_x], filters[filter_y],
726− ref, kOutputStride,
670+ wrapper_filter_block2d_8_c(in, kInputStride, filters[filter_x],
671+ filters[filter_y], ref, kOutputStride,
727672 Width(), Height());
728673
729674 if (filter_x && filter_y)
730− ASM_REGISTER_STATE_CHECK(
731− UUT_->hv8_(in, kInputStride, out, kOutputStride,
732− filters[filter_x], 16, filters[filter_y], 16,
733− Width(), Height()));
675+ ASM_REGISTER_STATE_CHECK(UUT_->hv8_(
676+ in, kInputStride, out, kOutputStride, filters[filter_x], 16,
677+ filters[filter_y], 16, Width(), Height()));
734678 else if (filter_y)
735679 ASM_REGISTER_STATE_CHECK(
736− UUT_->v8_(in, kInputStride, out, kOutputStride,
737− kInvalidFilter, 16, filters[filter_y], 16,
738− Width(), Height()));
680+ UUT_->v8_(in, kInputStride, out, kOutputStride, kInvalidFilter,
681+ 16, filters[filter_y], 16, Width(), Height()));
739682 else if (filter_x)
740683 ASM_REGISTER_STATE_CHECK(
741− UUT_->h8_(in, kInputStride, out, kOutputStride,
742− filters[filter_x], 16, kInvalidFilter, 16,
743− Width(), Height()));
684+ UUT_->h8_(in, kInputStride, out, kOutputStride, filters[filter_x],
685+ 16, kInvalidFilter, 16, Width(), Height()));
744686 else
745687 ASM_REGISTER_STATE_CHECK(
746− UUT_->copy_(in, kInputStride, out, kOutputStride,
747− kInvalidFilter, 0, kInvalidFilter, 0,
748− Width(), Height()));
688+ UUT_->copy_(in, kInputStride, out, kOutputStride, kInvalidFilter,
689+ 0, kInvalidFilter, 0, Width(), Height()));
749690
750691 CheckGuardBlocks();
751692
@@ -754,20 +695,20 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) { · 2 unmodified lines
754695 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
755696 lookup(out, y * kOutputStride + x))
756697 << "mismatch at (" << x << "," << y << "), "
757− << "filters (" << filter_bank << ","
758− << filter_x << "," << filter_y << ")";
698+ << "filters (" << filter_bank << "," << filter_x << ","
699+ << filter_y << ")";
759700 }
760701 }
761702 }
762703 }
763704
764705 TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
765− uint8_t* const in = input();
766− uint8_t* const out = output();
706+ uint8_t *const in = input();
707+ uint8_t *const out = output();
767708 #if CONFIG_VP9_HIGHBITDEPTH
768709 uint8_t ref8[kOutputStride * kMaxDimension];
769710 uint16_t ref16[kOutputStride * kMaxDimension];
770− uint8_t* ref;
711+ uint8_t *ref;
771712 if (UUT_->use_highbd_ == 0) {
772713 ref = ref8;
773714 } else {
@@ -803,31 +744,26 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) { · 29 unmodified lines
803744
804745 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
805746 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
806− wrapper_filter_average_block2d_8_c(in, kInputStride,
807− filters[filter_x], filters[filter_y],
808− ref, kOutputStride,
809− Width(), Height());
747+ wrapper_filter_average_block2d_8_c(in, kInputStride, filters[filter_x],
748+ filters[filter_y], ref,
749+ kOutputStride, Width(), Height());
810750
811751 if (filter_x && filter_y)
812− ASM_REGISTER_STATE_CHECK(
813− UUT_->hv8_avg_(in, kInputStride, out, kOutputStride,
814− filters[filter_x], 16, filters[filter_y], 16,
815− Width(), Height()));
752+ ASM_REGISTER_STATE_CHECK(UUT_->hv8_avg_(
753+ in, kInputStride, out, kOutputStride, filters[filter_x], 16,
754+ filters[filter_y], 16, Width(), Height()));
816755 else if (filter_y)
817− ASM_REGISTER_STATE_CHECK(
818− UUT_->v8_avg_(in, kInputStride, out, kOutputStride,
819− kInvalidFilter, 16, filters[filter_y], 16,
820− Width(), Height()));
756+ ASM_REGISTER_STATE_CHECK(UUT_->v8_avg_(
757+ in, kInputStride, out, kOutputStride, kInvalidFilter, 16,
758+ filters[filter_y], 16, Width(), Height()));
821759 else if (filter_x)
822− ASM_REGISTER_STATE_CHECK(
823− UUT_->h8_avg_(in, kInputStride, out, kOutputStride,
824− filters[filter_x], 16, kInvalidFilter, 16,
825− Width(), Height()));
760+ ASM_REGISTER_STATE_CHECK(UUT_->h8_avg_(
761+ in, kInputStride, out, kOutputStride, filters[filter_x], 16,
762+ kInvalidFilter, 16, Width(), Height()));
826763 else
827764 ASM_REGISTER_STATE_CHECK(
828− UUT_->avg_(in, kInputStride, out, kOutputStride,
829− kInvalidFilter, 0, kInvalidFilter, 0,
830− Width(), Height()));
765+ UUT_->avg_(in, kInputStride, out, kOutputStride, kInvalidFilter,
766+ 0, kInvalidFilter, 0, Width(), Height()));
831767
832768 CheckGuardBlocks();
833769
@@ -836,8 +772,8 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) { · 2 unmodified lines
836772 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
837773 lookup(out, y * kOutputStride + x))
838774 << "mismatch at (" << x << "," << y << "), "
839− << "filters (" << filter_bank << ","
840− << filter_x << "," << filter_y << ")";
775+ << "filters (" << filter_bank << "," << filter_x << ","
776+ << filter_y << ")";
841777 }
842778 }
843779 }
@@ -884,16 +820,16 @@ TEST_P(ConvolveTest, FilterExtremes) { · 40 unmodified lines
884820 for (int y = 0; y < 8; ++y) {
885821 for (int x = 0; x < 8; ++x) {
886822 #if CONFIG_VP9_HIGHBITDEPTH
887− assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
888− ((seed_val >> (axis ? y : x)) & 1) * mask_);
823+ assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
824+ ((seed_val >> (axis ? y : x)) & 1) * mask_);
889825 #else
890− assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
891− ((seed_val >> (axis ? y : x)) & 1) * 255);
826+ assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
827+ ((seed_val >> (axis ? y : x)) & 1) * 255);
892828 #endif
893829 if (axis) seed_val++;
894830 }
895831 if (axis)
896− seed_val-= 8;
832+ seed_val -= 8;
897833 else
898834 seed_val++;
899835 }
@@ -904,38 +840,33 @@ TEST_P(ConvolveTest, FilterExtremes) { · 4 unmodified lines
904840 vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
905841 for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
906842 for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
907− wrapper_filter_block2d_8_c(in, kInputStride,
908− filters[filter_x], filters[filter_y],
909− ref, kOutputStride,
843+ wrapper_filter_block2d_8_c(in, kInputStride, filters[filter_x],
844+ filters[filter_y], ref, kOutputStride,
910845 Width(), Height());
911846 if (filter_x && filter_y)
912− ASM_REGISTER_STATE_CHECK(
913− UUT_->hv8_(in, kInputStride, out, kOutputStride,
914− filters[filter_x], 16, filters[filter_y], 16,
915− Width(), Height()));
847+ ASM_REGISTER_STATE_CHECK(UUT_->hv8_(
848+ in, kInputStride, out, kOutputStride, filters[filter_x], 16,
849+ filters[filter_y], 16, Width(), Height()));
916850 else if (filter_y)
917− ASM_REGISTER_STATE_CHECK(
918− UUT_->v8_(in, kInputStride, out, kOutputStride,
919− kInvalidFilter, 16, filters[filter_y], 16,
920− Width(), Height()));
851+ ASM_REGISTER_STATE_CHECK(UUT_->v8_(
852+ in, kInputStride, out, kOutputStride, kInvalidFilter, 16,
853+ filters[filter_y], 16, Width(), Height()));
921854 else if (filter_x)
922− ASM_REGISTER_STATE_CHECK(
923− UUT_->h8_(in, kInputStride, out, kOutputStride,
924− filters[filter_x], 16, kInvalidFilter, 16,
925− Width(), Height()));
855+ ASM_REGISTER_STATE_CHECK(UUT_->h8_(
856+ in, kInputStride, out, kOutputStride, filters[filter_x], 16,
857+ kInvalidFilter, 16, Width(), Height()));
926858 else
927− ASM_REGISTER_STATE_CHECK(
928− UUT_->copy_(in, kInputStride, out, kOutputStride,
929− kInvalidFilter, 0, kInvalidFilter, 0,
930− Width(), Height()));
859+ ASM_REGISTER_STATE_CHECK(UUT_->copy_(
860+ in, kInputStride, out, kOutputStride, kInvalidFilter, 0,
861+ kInvalidFilter, 0, Width(), Height()));
931862
932863 for (int y = 0; y < Height(); ++y)
933864 for (int x = 0; x < Width(); ++x)
934865 ASSERT_EQ(lookup(ref, y * kOutputStride + x),
935866 lookup(out, y * kOutputStride + x))
936867 << "mismatch at (" << x << "," << y << "), "
937− << "filters (" << filter_bank << ","
938− << filter_x << "," << filter_y << ")";
868+ << "filters (" << filter_bank << "," << filter_x << ","
869+ << filter_y << ")";
939870 }
940871 }
941872 }
@@ -946,8 +877,8 @@ TEST_P(ConvolveTest, FilterExtremes) { · 4 unmodified lines
946877 /* This test exercises that enough rows and columns are filtered with every
947878 possible initial fractional positions and scaling steps. */
948879 TEST_P(ConvolveTest, CheckScalingFiltering) {
949− uint8_t* const in = input();
950− uint8_t* const out = output();
880+ uint8_t *const in = input();
881+ uint8_t *const out = output();
951882 const InterpKernel *const eighttap = vp9_filter_kernels[EIGHTTAP];
952883
953884 SetConstantInput(127);
@@ -956,9 +887,8 @@ TEST_P(ConvolveTest, CheckScalingFiltering) { · 2 unmodified lines
956887 for (int step = 1; step <= 32; ++step) {
957888 /* Test the horizontal and vertical filters in combination. */
958889 ASM_REGISTER_STATE_CHECK(UUT_->shv8_(in, kInputStride, out, kOutputStride,
959− eighttap[frac], step,
960− eighttap[frac], step,
961− Width(), Height()));
890+ eighttap[frac], step, eighttap[frac],
891+ step, Width(), Height()));
962892
963893 CheckGuardBlocks();
964894
@@ -966,8 +896,8 @@ TEST_P(ConvolveTest, CheckScalingFiltering) { · 1 unmodified line
966896 for (int x = 0; x < Width(); ++x) {
967897 ASSERT_EQ(lookup(in, y * kInputStride + x),
968898 lookup(out, y * kOutputStride + x))
969− << "x == " << x << ", y == " << y
970− << ", frac == " << frac << ", step == " << step;
899+ << "x == " << x << ", y == " << y << ", frac == " << frac
900+ << ", step == " << step;
971901 }
972902 }
973903 }
@@ -977,18 +907,14 @@ TEST_P(ConvolveTest, CheckScalingFiltering) { · 3 unmodified lines
977907 using std::tr1::make_tuple;
978908
979909 #if CONFIG_VP9_HIGHBITDEPTH
980−#define WRAP(func, bd) \
981−void wrap_ ## func ## _ ## bd(const uint8_t *src, ptrdiff_t src_stride, \
982− uint8_t *dst, ptrdiff_t dst_stride, \
983− const int16_t *filter_x, \
984− int filter_x_stride, \
985− const int16_t *filter_y, \
986− int filter_y_stride, \
987− int w, int h) { \
988− vpx_highbd_ ## func(src, src_stride, dst, dst_stride, filter_x, \
989− filter_x_stride, filter_y, filter_y_stride, \
990− w, h, bd); \
991−}
910+#define WRAP(func, bd) \
911+ void wrap_##func##_##bd( \
912+ const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, \
913+ ptrdiff_t dst_stride, const int16_t *filter_x, int filter_x_stride, \
914+ const int16_t *filter_y, int filter_y_stride, int w, int h) { \
915+ vpx_highbd_##func(src, src_stride, dst, dst_stride, filter_x, \
916+ filter_x_stride, filter_y, filter_y_stride, w, h, bd); \
917+ }
992918 #if HAVE_SSE2 && ARCH_X86_64
993919 WRAP(convolve_copy_sse2, 8)
994920 WRAP(convolve_avg_sse2, 8)
@@ -1043,48 +969,40 @@ WRAP(convolve8_avg_c, 12) · 48 unmodified lines
1043969 #undef WRAP
1044970
1045971 const ConvolveFunctions convolve8_c(
1046− wrap_convolve_copy_c_8, wrap_convolve_avg_c_8,
1047− wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
1048− wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
1049− wrap_convolve8_c_8, wrap_convolve8_avg_c_8,
972+ wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, wrap_convolve8_horiz_c_8,
973+ wrap_convolve8_avg_horiz_c_8, wrap_convolve8_vert_c_8,
974+ wrap_convolve8_avg_vert_c_8, wrap_convolve8_c_8, wrap_convolve8_avg_c_8,
1050975 wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
1051− wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
1052− wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8);
976+ wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8, wrap_convolve8_c_8,
977+ wrap_convolve8_avg_c_8, 8);
1053978 const ConvolveFunctions convolve10_c(
1054− wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
979+ wrap_convolve_copy_c_10, wrap_convolve_avg_c_10, wrap_convolve8_horiz_c_10,
980+ wrap_convolve8_avg_horiz_c_10, wrap_convolve8_vert_c_10,
981+ wrap_convolve8_avg_vert_c_10, wrap_convolve8_c_10, wrap_convolve8_avg_c_10,
1055982 wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
1056− wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
1057− wrap_convolve8_c_10, wrap_convolve8_avg_c_10,
1058− wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
1059− wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
1060− wrap_convolve8_c_10, wrap_convolve8_avg_c_10, 10);
983+ wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10, wrap_convolve8_c_10,
984+ wrap_convolve8_avg_c_10, 10);
1061985 const ConvolveFunctions convolve12_c(
1062− wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
1063− wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
1064− wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
1065− wrap_convolve8_c_12, wrap_convolve8_avg_c_12,
986+ wrap_convolve_copy_c_12, wrap_convolve_avg_c_12, wrap_convolve8_horiz_c_12,
987+ wrap_convolve8_avg_horiz_c_12, wrap_convolve8_vert_c_12,
988+ wrap_convolve8_avg_vert_c_12, wrap_convolve8_c_12, wrap_convolve8_avg_c_12,
1066989 wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
1067− wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
1068− wrap_convolve8_c_12, wrap_convolve8_avg_c_12, 12);
990+ wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12, wrap_convolve8_c_12,
991+ wrap_convolve8_avg_c_12, 12);
1069992 const ConvolveParam kArrayConvolve_c[] = {
1070− ALL_SIZES(convolve8_c),
1071− ALL_SIZES(convolve10_c),
1072− ALL_SIZES(convolve12_c)
993+ ALL_SIZES(convolve8_c), ALL_SIZES(convolve10_c), ALL_SIZES(convolve12_c)
1073994 };
1074995
1075996 #else
1076997 const ConvolveFunctions convolve8_c(
1077− vpx_convolve_copy_c, vpx_convolve_avg_c,
1078− vpx_convolve8_horiz_c, vpx_convolve8_avg_horiz_c,
1079− vpx_convolve8_vert_c, vpx_convolve8_avg_vert_c,
1080− vpx_convolve8_c, vpx_convolve8_avg_c,
1081− vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1082− vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
998+ vpx_convolve_copy_c, vpx_convolve_avg_c, vpx_convolve8_horiz_c,
999+ vpx_convolve8_avg_horiz_c, vpx_convolve8_vert_c, vpx_convolve8_avg_vert_c,
1000+ vpx_convolve8_c, vpx_convolve8_avg_c, vpx_scaled_horiz_c,
1001+ vpx_scaled_avg_horiz_c, vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
10831002 vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
10841003 const ConvolveParam kArrayConvolve_c[] = { ALL_SIZES(convolve8_c) };
10851004 #endif
1086−INSTANTIATE_TEST_CASE_P(C, ConvolveTest,
1087− ::testing::ValuesIn(kArrayConvolve_c));
1005+INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::ValuesIn(kArrayConvolve_c));
10881006
10891007 #if HAVE_SSE2 && ARCH_X86_64
10901008 #if CONFIG_VP9_HIGHBITDEPTH
@@ -1112,20 +1030,16 @@ const ConvolveFunctions convolve12_sse2( · 21 unmodified lines
11121030 wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12,
11131031 wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12,
11141032 wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12, 12);
1115−const ConvolveParam kArrayConvolve_sse2[] = {
1116− ALL_SIZES(convolve8_sse2),
1117− ALL_SIZES(convolve10_sse2),
1118− ALL_SIZES(convolve12_sse2)
1119−};
1033+const ConvolveParam kArrayConvolve_sse2[] = { ALL_SIZES(convolve8_sse2),
1034+ ALL_SIZES(convolve10_sse2),
1035+ ALL_SIZES(convolve12_sse2) };
11201036 #else
11211037 const ConvolveFunctions convolve8_sse2(
1122− vpx_convolve_copy_sse2, vpx_convolve_avg_sse2,
1123− vpx_convolve8_horiz_sse2, vpx_convolve8_avg_horiz_sse2,
1124− vpx_convolve8_vert_sse2, vpx_convolve8_avg_vert_sse2,
1125− vpx_convolve8_sse2, vpx_convolve8_avg_sse2,
1126− vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1127− vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1128− vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1038+ vpx_convolve_copy_sse2, vpx_convolve_avg_sse2, vpx_convolve8_horiz_sse2,
1039+ vpx_convolve8_avg_horiz_sse2, vpx_convolve8_vert_sse2,
1040+ vpx_convolve8_avg_vert_sse2, vpx_convolve8_sse2, vpx_convolve8_avg_sse2,
1041+ vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c,
1042+ vpx_scaled_avg_vert_c, vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
11291043
11301044 const ConvolveParam kArrayConvolve_sse2[] = { ALL_SIZES(convolve8_sse2) };
11311045 #endif // CONFIG_VP9_HIGHBITDEPTH
@@ -1135,13 +1049,11 @@ INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, · 3 unmodified lines
11351049
11361050 #if HAVE_SSSE3
11371051 const ConvolveFunctions convolve8_ssse3(
1138− vpx_convolve_copy_c, vpx_convolve_avg_c,
1139− vpx_convolve8_horiz_ssse3, vpx_convolve8_avg_horiz_ssse3,
1140− vpx_convolve8_vert_ssse3, vpx_convolve8_avg_vert_ssse3,
1141− vpx_convolve8_ssse3, vpx_convolve8_avg_ssse3,
1142− vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1143− vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1144− vpx_scaled_2d_ssse3, vpx_scaled_avg_2d_c, 0);
1052+ vpx_convolve_copy_c, vpx_convolve_avg_c, vpx_convolve8_horiz_ssse3,
1053+ vpx_convolve8_avg_horiz_ssse3, vpx_convolve8_vert_ssse3,
1054+ vpx_convolve8_avg_vert_ssse3, vpx_convolve8_ssse3, vpx_convolve8_avg_ssse3,
1055+ vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c,
1056+ vpx_scaled_avg_vert_c, vpx_scaled_2d_ssse3, vpx_scaled_avg_2d_c, 0);
11451057
11461058 const ConvolveParam kArrayConvolve8_ssse3[] = { ALL_SIZES(convolve8_ssse3) };
11471059 INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest,
@@ -1150,13 +1062,11 @@ INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, · 2 unmodified lines
11501062
11511063 #if HAVE_AVX2 && HAVE_SSSE3
11521064 const ConvolveFunctions convolve8_avx2(
1153− vpx_convolve_copy_c, vpx_convolve_avg_c,
1154− vpx_convolve8_horiz_avx2, vpx_convolve8_avg_horiz_ssse3,
1155− vpx_convolve8_vert_avx2, vpx_convolve8_avg_vert_ssse3,
1156− vpx_convolve8_avx2, vpx_convolve8_avg_ssse3,
1157− vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1158− vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1159− vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1065+ vpx_convolve_copy_c, vpx_convolve_avg_c, vpx_convolve8_horiz_avx2,
1066+ vpx_convolve8_avg_horiz_ssse3, vpx_convolve8_vert_avx2,
1067+ vpx_convolve8_avg_vert_ssse3, vpx_convolve8_avx2, vpx_convolve8_avg_ssse3,
1068+ vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c,
1069+ vpx_scaled_avg_vert_c, vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
11601070
11611071 const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES(convolve8_avx2) };
11621072 INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest,
@@ -1166,22 +1076,18 @@ INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, · 3 unmodified lines
11661076 #if HAVE_NEON
11671077 #if HAVE_NEON_ASM
11681078 const ConvolveFunctions convolve8_neon(
1169− vpx_convolve_copy_neon, vpx_convolve_avg_neon,
1170− vpx_convolve8_horiz_neon, vpx_convolve8_avg_horiz_neon,
1171− vpx_convolve8_vert_neon, vpx_convolve8_avg_vert_neon,
1172− vpx_convolve8_neon, vpx_convolve8_avg_neon,
1173− vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1174− vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1175− vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1176−#else // HAVE_NEON
1079+ vpx_convolve_copy_neon, vpx_convolve_avg_neon, vpx_convolve8_horiz_neon,
1080+ vpx_convolve8_avg_horiz_neon, vpx_convolve8_vert_neon,
1081+ vpx_convolve8_avg_vert_neon, vpx_convolve8_neon, vpx_convolve8_avg_neon,
1082+ vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c,
1083+ vpx_scaled_avg_vert_c, vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1084+#else // HAVE_NEON
11771085 const ConvolveFunctions convolve8_neon(
1178− vpx_convolve_copy_neon, vpx_convolve_avg_neon,
1179− vpx_convolve8_horiz_neon, vpx_convolve8_avg_horiz_neon,
1180− vpx_convolve8_vert_neon, vpx_convolve8_avg_vert_neon,
1181− vpx_convolve8_neon, vpx_convolve8_avg_neon,
1182− vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1183− vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1184− vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1086+ vpx_convolve_copy_neon, vpx_convolve_avg_neon, vpx_convolve8_horiz_neon,
1087+ vpx_convolve8_avg_horiz_neon, vpx_convolve8_vert_neon,
1088+ vpx_convolve8_avg_vert_neon, vpx_convolve8_neon, vpx_convolve8_avg_neon,
1089+ vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c,
1090+ vpx_scaled_avg_vert_c, vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
11851091 #endif // HAVE_NEON_ASM
11861092
11871093 const ConvolveParam kArrayConvolve8_neon[] = { ALL_SIZES(convolve8_neon) };
@@ -1191,13 +1097,11 @@ INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, · 3 unmodified lines
11911097
11921098 #if HAVE_DSPR2
11931099 const ConvolveFunctions convolve8_dspr2(
1194− vpx_convolve_copy_dspr2, vpx_convolve_avg_dspr2,
1195− vpx_convolve8_horiz_dspr2, vpx_convolve8_avg_horiz_dspr2,
1196− vpx_convolve8_vert_dspr2, vpx_convolve8_avg_vert_dspr2,
1197− vpx_convolve8_dspr2, vpx_convolve8_avg_dspr2,
1198− vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1199− vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1200− vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1100+ vpx_convolve_copy_dspr2, vpx_convolve_avg_dspr2, vpx_convolve8_horiz_dspr2,
1101+ vpx_convolve8_avg_horiz_dspr2, vpx_convolve8_vert_dspr2,
1102+ vpx_convolve8_avg_vert_dspr2, vpx_convolve8_dspr2, vpx_convolve8_avg_dspr2,
1103+ vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c,
1104+ vpx_scaled_avg_vert_c, vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
12011105
12021106 const ConvolveParam kArrayConvolve8_dspr2[] = { ALL_SIZES(convolve8_dspr2) };
12031107 INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest,
@@ -1206,13 +1110,11 @@ INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, · 2 unmodified lines
12061110
12071111 #if HAVE_MSA
12081112 const ConvolveFunctions convolve8_msa(
1209− vpx_convolve_copy_msa, vpx_convolve_avg_msa,
1210− vpx_convolve8_horiz_msa, vpx_convolve8_avg_horiz_msa,
1211− vpx_convolve8_vert_msa, vpx_convolve8_avg_vert_msa,
1212− vpx_convolve8_msa, vpx_convolve8_avg_msa,
1213− vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
1214− vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
1215− vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
1113+ vpx_convolve_copy_msa, vpx_convolve_avg_msa, vpx_convolve8_horiz_msa,
1114+ vpx_convolve8_avg_horiz_msa, vpx_convolve8_vert_msa,
1115+ vpx_convolve8_avg_vert_msa, vpx_convolve8_msa, vpx_convolve8_avg_msa,
1116+ vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c,
1117+ vpx_scaled_avg_vert_c, vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
12161118
12171119 const ConvolveParam kArrayConvolve8_msa[] = { ALL_SIZES(convolve8_msa) };
12181120 INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest,
test/cpu_speed_test.cc+9−14
@@ -23,10 +23,8 @@ class CpuSpeedTest · 22 unmodified lines
2323 public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
2424 protected:
2525 CpuSpeedTest()
26− : EncoderTest(GET_PARAM(0)),
27− encoding_mode_(GET_PARAM(1)),
28− set_cpu_used_(GET_PARAM(2)),
29− min_psnr_(kMaxPSNR),
26+ : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
27+ set_cpu_used_(GET_PARAM(2)), min_psnr_(kMaxPSNR),
3028 tune_content_(VP9E_CONTENT_DEFAULT) {}
3129 virtual ~CpuSpeedTest() {}
3230
@@ -42,9 +40,7 @@ class CpuSpeedTest · 9 unmodified lines
4240 }
4341 }
4442
45− virtual void BeginPassHook(unsigned int /*pass*/) {
46− min_psnr_ = kMaxPSNR;
47− }
43+ virtual void BeginPassHook(unsigned int /*pass*/) { min_psnr_ = kMaxPSNR; }
4844
4945 virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
5046 ::libvpx_test::Encoder *encoder) {
@@ -61,8 +57,7 @@ class CpuSpeedTest · 10 unmodified lines
6157 }
6258
6359 virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
64− if (pkt->data.psnr.psnr[0] < min_psnr_)
65− min_psnr_ = pkt->data.psnr.psnr[0];
60+ if (pkt->data.psnr.psnr[0] < min_psnr_) min_psnr_ = pkt->data.psnr.psnr[0];
6661 }
6762
6863 ::libvpx_test::TestMode encoding_mode_;
@@ -153,9 +148,9 @@ TEST_P(CpuSpeedTest, TestLowBitrate) { · 84 unmodified lines
153148 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
154149 }
155150
156−VP9_INSTANTIATE_TEST_CASE(
157− CpuSpeedTest,
158− ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
159− ::libvpx_test::kRealTime),
160− ::testing::Range(0, 9));
151+VP9_INSTANTIATE_TEST_CASE(CpuSpeedTest,
152+ ::testing::Values(::libvpx_test::kTwoPassGood,
153+ ::libvpx_test::kOnePassGood,
154+ ::libvpx_test::kRealTime),
155+ ::testing::Range(0, 9));
161156 } // namespace
test/cq_test.cc+4−7
@@ -24,14 +24,12 @@ const int kCQLevelStep = 8; · 23 unmodified lines
2424 const unsigned int kCQTargetBitrate = 2000;
2525
2626 class CQTest : public ::libvpx_test::EncoderTest,
27− public ::libvpx_test::CodecTestWithParam<int> {
27+ public ::libvpx_test::CodecTestWithParam<int> {
2828 public:
2929 // maps the cqlevel to the bitrate produced.
3030 typedef std::map<int, uint32_t> BitrateMap;
3131
32− static void SetUpTestCase() {
33− bitrates_.clear();
34− }
32+ static void SetUpTestCase() { bitrates_.clear(); }
3533
3634 static void TearDownTestCase() {
3735 ASSERT_TRUE(!HasFailure())
@@ -128,7 +126,6 @@ TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) { · 90 unmodified lines
128126 EXPECT_GE(cq_psnr_lin, vbr_psnr_lin);
129127 }
130128
131−VP8_INSTANTIATE_TEST_CASE(CQTest,
132− ::testing::Range(kCQLevelMin, kCQLevelMax,
133− kCQLevelStep));
129+VP8_INSTANTIATE_TEST_CASE(CQTest, ::testing::Range(kCQLevelMin, kCQLevelMax,
130+ kCQLevelStep));
134131 } // namespace
test/datarate_test.cc+83−91
@@ -18,8 +18,9 @@ · 17 unmodified lines
1818
1919 namespace {
2020
21−class DatarateTestLarge : public ::libvpx_test::EncoderTest,
22− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
21+class DatarateTestLarge
22+ : public ::libvpx_test::EncoderTest,
23+ public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
2324 public:
2425 DatarateTestLarge() : EncoderTest(GET_PARAM(0)) {}
2526
@@ -71,8 +72,7 @@ class DatarateTestLarge : public ::libvpx_test::EncoderTest, · 45 unmodified lines
7172 // http://code.google.com/p/webm/issues/detail?id=496 is fixed.
7273 // For now the codec assumes buffer starts at starting buffer rate
7374 // plus one frame's time.
74− if (last_pts_ == 0)
75− duration = 1;
75+ if (last_pts_ == 0) duration = 1;
7676
7777 // Add to the buffer the bits we'd expect from a constant bitrate server.
7878 bits_in_buffer_model_ += static_cast<int64_t>(
@@ -83,11 +83,11 @@ class DatarateTestLarge : public ::libvpx_test::EncoderTest, · 4 unmodified lines
8383 * empty - and then stop showing frames until we've got enough bits to
8484 * show one. As noted in comment below (issue 495), this does not currently
8585 * apply to key frames. For now exclude key frames in condition below. */
86− const bool key_frame = (pkt->data.frame.flags & VPX_FRAME_IS_KEY)
87− ? true: false;
86+ const bool key_frame =
87+ (pkt->data.frame.flags & VPX_FRAME_IS_KEY) ? true : false;
8888 if (!key_frame) {
8989 ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
90− << pkt->data.frame.pts;
90+ << pkt->data.frame.pts;
9191 }
9292
9393 const int64_t frame_size_in_bits = pkt->data.frame.sz * 8;
@@ -99,8 +99,7 @@ class DatarateTestLarge : public ::libvpx_test::EncoderTest, · 5 unmodified lines
9999 bits_total_ += frame_size_in_bits;
100100
101101 // If first drop not set and we have a drop set it to this time.
102− if (!first_drop_ && duration > 1)
103− first_drop_ = last_pts_ + 1;
102+ if (!first_drop_ && duration > 1) first_drop_ = last_pts_ + 1;
104103
105104 // Update the most recent pts.
106105 last_pts_ = pkt->data.frame.pts;
@@ -119,8 +118,8 @@ class DatarateTestLarge : public ::libvpx_test::EncoderTest, · 12 unmodified lines
119118 duration_ = (last_pts_ + 1) * timebase_;
120119
121120 // Effective file datarate includes the time spent prebuffering.
122− effective_datarate_ = (bits_total_ - bits_in_last_frame_) / 1000.0
123− / (cfg_.rc_buf_initial_sz / 1000.0 + duration_);
121+ effective_datarate_ = (bits_total_ - bits_in_last_frame_) / 1000.0 /
122+ (cfg_.rc_buf_initial_sz / 1000.0 + duration_);
124123
125124 file_datarate_ = file_size_in_kb / duration_;
126125 }
@@ -256,8 +255,9 @@ TEST_P(DatarateTestLarge, ChangingDropFrameThresh) { · 129 unmodified lines
256255 }
257256 }
258257
259−class DatarateTestVP9Large : public ::libvpx_test::EncoderTest,
260− public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
258+class DatarateTestVP9Large
259+ : public ::libvpx_test::EncoderTest,
260+ public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
261261 public:
262262 DatarateTestVP9Large() : EncoderTest(GET_PARAM(0)) {}
263263
@@ -307,8 +307,8 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 43 unmodified lines
307307 if (num_temp_layers == 2) {
308308 if (frame_num % 2 == 0) {
309309 // Layer 0: predict from L and ARF, update L.
310− frame_flags = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
311− VP8_EFLAG_NO_UPD_ARF;
310+ frame_flags =
311+ VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
312312 } else {
313313 // Layer 1: predict from L, G and ARF, and update G.
314314 frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
@@ -317,15 +317,15 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 2 unmodified lines
317317 } else if (num_temp_layers == 3) {
318318 if (frame_num % 4 == 0) {
319319 // Layer 0: predict from L and ARF; update L.
320− frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
321− VP8_EFLAG_NO_REF_GF;
320+ frame_flags =
321+ VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF;
322322 } else if ((frame_num - 2) % 4 == 0) {
323323 // Layer 1: predict from L, G, ARF; update G.
324324 frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
325− } else if ((frame_num - 1) % 2 == 0) {
325+ } else if ((frame_num - 1) % 2 == 0) {
326326 // Layer 2: predict from L, G, ARF; update none.
327− frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
328− VP8_EFLAG_NO_UPD_LAST;
327+ frame_flags =
328+ VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
329329 }
330330 }
331331 return frame_flags;
@@ -353,8 +353,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 21 unmodified lines
353353
354354 virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
355355 ::libvpx_test::Encoder *encoder) {
356− if (video->frame() == 0)
357− encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
356+ if (video->frame() == 0) encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
358357
359358 if (denoiser_offon_test_) {
360359 ASSERT_GT(denoiser_offon_period_, 0)
@@ -374,8 +373,8 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 13 unmodified lines
374373 vpx_svc_layer_id_t layer_id;
375374 layer_id.spatial_layer_id = 0;
376375 frame_flags_ = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
377− layer_id.temporal_layer_id = SetLayerId(video->frame(),
378− cfg_.ts_number_layers);
376+ layer_id.temporal_layer_id =
377+ SetLayerId(video->frame(), cfg_.ts_number_layers);
379378 encoder->Control(VP9E_SET_SVC_LAYER_ID, &layer_id);
380379 }
381380 const vpx_rational_t tb = video->timebase();
@@ -383,15 +382,13 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 1 unmodified line
383382 duration_ = 0;
384383 }
385384
386−
387385 virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
388386 // Time since last timestamp = duration.
389387 vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
390388
391389 if (duration > 1) {
392390 // If first drop not set and we have a drop set it to this time.
393− if (!first_drop_)
394− first_drop_ = last_pts_ + 1;
391+ if (!first_drop_) first_drop_ = last_pts_ + 1;
395392 // Update the number of frame drops.
396393 num_drops_ += static_cast<int>(duration - 1);
397394 // Update counter for total number of frames (#frames input to encoder).
@@ -407,7 +404,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 9 unmodified lines
407404
408405 // Buffer should not go negative.
409406 ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
410− << pkt->data.frame.pts;
407+ << pkt->data.frame.pts;
411408
412409 const size_t frame_size_in_bits = pkt->data.frame.sz * 8;
413410
@@ -425,7 +422,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 11 unmodified lines
425422
426423 virtual void EndPassHook(void) {
427424 for (int layer = 0; layer < static_cast<int>(cfg_.ts_number_layers);
428− ++layer) {
425+ ++layer) {
429426 duration_ = (last_pts_ + 1) * timebase_;
430427 if (bits_total_[layer]) {
431428 // Effective file datarate:
@@ -546,7 +543,7 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting444) { · 114 unmodified lines
546543 ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate),
547544 effective_datarate_[0] * 1.15)
548545 << " The datarate for the file missed the target!"
549− << cfg_.rc_target_bitrate << " "<< effective_datarate_;
546+ << cfg_.rc_target_bitrate << " " << effective_datarate_;
550547 }
551548 }
552549
@@ -616,8 +613,7 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting2TemporalLayers) { · 63 unmodified lines
616613
617614 cfg_.temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS;
618615
619− if (deadline_ == VPX_DL_REALTIME)
620− cfg_.g_error_resilient = 1;
616+ if (deadline_ == VPX_DL_REALTIME) cfg_.g_error_resilient = 1;
621617
622618 ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
623619 30, 1, 0, 200);
@@ -631,10 +627,12 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting2TemporalLayers) { · 7 unmodified lines
631627 for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
632628 ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.85)
633629 << " The datarate for the file is lower than target by too much, "
634− "for layer: " << j;
630+ "for layer: "
631+ << j;
635632 ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.15)
636633 << " The datarate for the file is greater than target by too much, "
637− "for layer: " << j;
634+ "for layer: "
635+ << j;
638636 }
639637 }
640638 }
@@ -674,12 +672,14 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayers) { · 33 unmodified lines
674672 // Adjust the thresholds to be tighter than .75.
675673 ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.75)
676674 << " The datarate for the file is lower than target by too much, "
677− "for layer: " << j;
675+ "for layer: "
676+ << j;
678677 // TODO(yaowu): Work out more stable rc control strategy and
679678 // Adjust the thresholds to be tighter than 1.25.
680679 ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.25)
681680 << " The datarate for the file is greater than target by too much, "
682− "for layer: " << j;
681+ "for layer: "
682+ << j;
683683 }
684684 }
685685 }
@@ -719,10 +719,12 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayersFrameDropping) { · 33 unmodified lines
719719 for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
720720 ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.85)
721721 << " The datarate for the file is lower than target by too much, "
722− "for layer: " << j;
722+ "for layer: "
723+ << j;
723724 ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.15)
724725 << " The datarate for the file is greater than target by too much, "
725− "for layer: " << j;
726+ "for layer: "
727+ << j;
726728 // Expect some frame drops in this test: for this 200 frames test,
727729 // expect at least 10% and not more than 60% drops.
728730 ASSERT_GE(num_drops_, 20);
@@ -792,11 +794,13 @@ TEST_P(DatarateTestVP9Large, DenoiserOffOn) { · 63 unmodified lines
792794 }
793795 #endif // CONFIG_VP9_TEMPORAL_DENOISING
794796
795−class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
796− public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
797+class DatarateOnePassCbrSvc
798+ : public ::libvpx_test::EncoderTest,
799+ public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
797800 public:
798801 DatarateOnePassCbrSvc() : EncoderTest(GET_PARAM(0)) {}
799802 virtual ~DatarateOnePassCbrSvc() {}
803+
800804 protected:
801805 virtual void SetUp() {
802806 InitializeConfig();
@@ -814,8 +818,7 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest, · 11 unmodified lines
814818 mismatch_psnr_ = 0.0;
815819 mismatch_nframes_ = 0;
816820 }
817− virtual void BeginPassHook(unsigned int /*pass*/) {
818− }
821+ virtual void BeginPassHook(unsigned int /*pass*/) {}
819822 virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
820823 ::libvpx_test::Encoder *encoder) {
821824 if (video->frame() == 0) {
@@ -837,21 +840,19 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest, · 15 unmodified lines
837840 }
838841 virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
839842 vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
840− if (last_pts_ == 0)
841− duration = 1;
843+ if (last_pts_ == 0) duration = 1;
842844 bits_in_buffer_model_ += static_cast<int64_t>(
843845 duration * timebase_ * cfg_.rc_target_bitrate * 1000);
844− const bool key_frame = (pkt->data.frame.flags & VPX_FRAME_IS_KEY)
845− ? true: false;
846+ const bool key_frame =
847+ (pkt->data.frame.flags & VPX_FRAME_IS_KEY) ? true : false;
846848 if (!key_frame) {
847849 ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
848− << pkt->data.frame.pts;
850+ << pkt->data.frame.pts;
849851 }
850852 const size_t frame_size_in_bits = pkt->data.frame.sz * 8;
851853 bits_in_buffer_model_ -= frame_size_in_bits;
852854 bits_total_ += frame_size_in_bits;
853− if (!first_drop_ && duration > 1)
854− first_drop_ = last_pts_ + 1;
855+ if (!first_drop_ && duration > 1) first_drop_ = last_pts_ + 1;
855856 last_pts_ = pkt->data.frame.pts;
856857 bits_in_last_frame_ = frame_size_in_bits;
857858 ++frame_number_;
@@ -864,16 +865,13 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest, · 6 unmodified lines
864865 }
865866 }
866867
867− virtual void MismatchHook(const vpx_image_t *img1,
868− const vpx_image_t *img2) {
868+ virtual void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2) {
869869 double mismatch_psnr = compute_psnr(img1, img2);
870870 mismatch_psnr_ += mismatch_psnr;
871871 ++mismatch_nframes_;
872872 }
873873
874− unsigned int GetMismatchFrames() {
875− return mismatch_nframes_;
876− }
874+ unsigned int GetMismatchFrames() { return mismatch_nframes_; }
877875
878876 vpx_codec_pts_t last_pts_;
879877 int64_t bits_in_buffer_model_;
@@ -890,37 +888,31 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest, · 10 unmodified lines
890888 int mismatch_nframes_;
891889 };
892890 static void assign_layer_bitrates(vpx_codec_enc_cfg_t *const enc_cfg,
893− const vpx_svc_extra_cfg_t *svc_params,
894− int spatial_layers,
895− int temporal_layers,
896− int temporal_layering_mode) {
891+ const vpx_svc_extra_cfg_t *svc_params,
892+ int spatial_layers, int temporal_layers,
893+ int temporal_layering_mode) {
897894 int sl, spatial_layer_target;
898895 float total = 0;
899− float alloc_ratio[VPX_MAX_LAYERS] = {0};
896+ float alloc_ratio[VPX_MAX_LAYERS] = { 0 };
900897 for (sl = 0; sl < spatial_layers; ++sl) {
901898 if (svc_params->scaling_factor_den[sl] > 0) {
902− alloc_ratio[sl] = (float)(svc_params->scaling_factor_num[sl] *
903− 1.0 / svc_params->scaling_factor_den[sl]);
899+ alloc_ratio[sl] = (float)(svc_params->scaling_factor_num[sl] * 1.0 /
900+ svc_params->scaling_factor_den[sl]);
904901 total += alloc_ratio[sl];
905902 }
906903 }
907904 for (sl = 0; sl < spatial_layers; ++sl) {
908905 enc_cfg->ss_target_bitrate[sl] = spatial_layer_target =
909− (unsigned int)(enc_cfg->rc_target_bitrate *
910− alloc_ratio[sl] / total);
906+ (unsigned int)(enc_cfg->rc_target_bitrate * alloc_ratio[sl] / total);
911907 const int index = sl * temporal_layers;
912908 if (temporal_layering_mode == 3) {
913− enc_cfg->layer_target_bitrate[index] =
914− spatial_layer_target >> 1;
909+ enc_cfg->layer_target_bitrate[index] = spatial_layer_target >> 1;
915910 enc_cfg->layer_target_bitrate[index + 1] =
916911 (spatial_layer_target >> 1) + (spatial_layer_target >> 2);
917− enc_cfg->layer_target_bitrate[index + 2] =
918− spatial_layer_target;
912+ enc_cfg->layer_target_bitrate[index + 2] = spatial_layer_target;
919913 } else if (temporal_layering_mode == 2) {
920− enc_cfg->layer_target_bitrate[index] =
921− spatial_layer_target * 2 / 3;
922− enc_cfg->layer_target_bitrate[index + 1] =
923− spatial_layer_target;
914+ enc_cfg->layer_target_bitrate[index] = spatial_layer_target * 2 / 3;
915+ enc_cfg->layer_target_bitrate[index + 1] = spatial_layer_target;
924916 }
925917 }
926918 }
@@ -957,10 +949,10 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers) { · 30 unmodified lines
957949 cfg_.rc_target_bitrate = i;
958950 ResetModel();
959951 assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
960− cfg_.ts_number_layers, cfg_.temporal_layering_mode);
952+ cfg_.ts_number_layers, cfg_.temporal_layering_mode);
961953 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
962954 ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
963− << " The datarate for the file exceeds the target by too much!";
955+ << " The datarate for the file exceeds the target by too much!";
964956 ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15)
965957 << " The datarate for the file is lower than the target by too much!";
966958 EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
@@ -999,10 +991,10 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayersSmallKf) { · 32 unmodified lines
999991 cfg_.kf_max_dist = j;
1000992 ResetModel();
1001993 assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
1002− cfg_.ts_number_layers, cfg_.temporal_layering_mode);
994+ cfg_.ts_number_layers, cfg_.temporal_layering_mode);
1003995 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
1004996 ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
1005− << " The datarate for the file exceeds the target by too much!";
997+ << " The datarate for the file exceeds the target by too much!";
1006998 ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15)
1007999 << " The datarate for the file is lower than the target by too much!";
10081000 EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
@@ -1033,15 +1025,15 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers4threads) { · 24 unmodified lines
10331025 svc_params_.scaling_factor_den[1] = 288;
10341026 cfg_.rc_dropframe_thresh = 10;
10351027 cfg_.kf_max_dist = 9999;
1036− ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
1037− 30, 1, 0, 300);
1028+ ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30,
1029+ 1, 0, 300);
10381030 cfg_.rc_target_bitrate = 800;
10391031 ResetModel();
10401032 assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
1041− cfg_.ts_number_layers, cfg_.temporal_layering_mode);
1033+ cfg_.ts_number_layers, cfg_.temporal_layering_mode);
10421034 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
10431035 ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
1044− << " The datarate for the file exceeds the target by too much!";
1036+ << " The datarate for the file exceeds the target by too much!";
10451037 ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15)
10461038 << " The datarate for the file is lower than the target by too much!";
10471039 EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
@@ -1073,15 +1065,15 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers) { · 25 unmodified lines
10731065 svc_params_.scaling_factor_den[2] = 288;
10741066 cfg_.rc_dropframe_thresh = 10;
10751067 cfg_.kf_max_dist = 9999;
1076− ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
1077− 30, 1, 0, 300);
1068+ ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30,
1069+ 1, 0, 300);
10781070 cfg_.rc_target_bitrate = 800;
10791071 ResetModel();
10801072 assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
1081− cfg_.ts_number_layers, cfg_.temporal_layering_mode);
1073+ cfg_.ts_number_layers, cfg_.temporal_layering_mode);
10821074 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
10831075 ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
1084− << " The datarate for the file exceeds the target by too much!";
1076+ << " The datarate for the file exceeds the target by too much!";
10851077 ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.22)
10861078 << " The datarate for the file is lower than the target by too much!";
10871079 EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
@@ -1112,8 +1104,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) { · 24 unmodified lines
11121104 svc_params_.scaling_factor_num[2] = 288;
11131105 svc_params_.scaling_factor_den[2] = 288;
11141106 cfg_.rc_dropframe_thresh = 10;
1115− ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
1116− 30, 1, 0, 300);
1107+ ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30,
1108+ 1, 0, 300);
11171109 cfg_.rc_target_bitrate = 800;
11181110 // For this 3 temporal layer case, pattern repeats every 4 frames, so choose
11191111 // 4 key neighboring key frame periods (so key frame will land on 0-2-1-2).
@@ -1121,10 +1113,10 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) { · 1 unmodified line
11211113 cfg_.kf_max_dist = j;
11221114 ResetModel();
11231115 assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
1124− cfg_.ts_number_layers, cfg_.temporal_layering_mode);
1116+ cfg_.ts_number_layers, cfg_.temporal_layering_mode);
11251117 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
11261118 ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
1127− << " The datarate for the file exceeds the target by too much!";
1119+ << " The datarate for the file exceeds the target by too much!";
11281120 ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.30)
11291121 << " The datarate for the file is lower than the target by too much!";
11301122 EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
@@ -1157,15 +1149,15 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers4threads) { · 26 unmodified lines
11571149 svc_params_.scaling_factor_den[2] = 288;
11581150 cfg_.rc_dropframe_thresh = 10;
11591151 cfg_.kf_max_dist = 9999;
1160− ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
1161− 30, 1, 0, 300);
1152+ ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30,
1153+ 1, 0, 300);
11621154 cfg_.rc_target_bitrate = 800;
11631155 ResetModel();
11641156 assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
1165− cfg_.ts_number_layers, cfg_.temporal_layering_mode);
1157+ cfg_.ts_number_layers, cfg_.temporal_layering_mode);
11661158 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
11671159 ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
1168− << " The datarate for the file exceeds the target by too much!";
1160+ << " The datarate for the file exceeds the target by too much!";
11691161 ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.22)
11701162 << " The datarate for the file is lower than the target by too much!";
11711163 EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
test/dct16x16_test.cc+131−183
@@ -54,16 +54,16 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 53 unmodified lines
5454 double temp1, temp2;
5555
5656 // step 1
57− step[ 0] = input[0] + input[15];
58− step[ 1] = input[1] + input[14];
59− step[ 2] = input[2] + input[13];
60− step[ 3] = input[3] + input[12];
61− step[ 4] = input[4] + input[11];
62− step[ 5] = input[5] + input[10];
63− step[ 6] = input[6] + input[ 9];
64− step[ 7] = input[7] + input[ 8];
65− step[ 8] = input[7] - input[ 8];
66− step[ 9] = input[6] - input[ 9];
57+ step[0] = input[0] + input[15];
58+ step[1] = input[1] + input[14];
59+ step[2] = input[2] + input[13];
60+ step[3] = input[3] + input[12];
61+ step[4] = input[4] + input[11];
62+ step[5] = input[5] + input[10];
63+ step[6] = input[6] + input[9];
64+ step[7] = input[7] + input[8];
65+ step[8] = input[7] - input[8];
66+ step[9] = input[6] - input[9];
6767 step[10] = input[5] - input[10];
6868 step[11] = input[4] - input[11];
6969 step[12] = input[3] - input[12];
@@ -81,13 +81,13 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 11 unmodified lines
8181 output[6] = step[1] - step[6];
8282 output[7] = step[0] - step[7];
8383
84− temp1 = step[ 8] * C7;
84+ temp1 = step[8] * C7;
8585 temp2 = step[15] * C9;
86− output[ 8] = temp1 + temp2;
86+ output[8] = temp1 + temp2;
8787
88− temp1 = step[ 9] * C11;
88+ temp1 = step[9] * C11;
8989 temp2 = step[14] * C5;
90− output[ 9] = temp1 - temp2;
90+ output[9] = temp1 - temp2;
9191
9292 temp1 = step[10] * C3;
9393 temp2 = step[13] * C13;
@@ -105,40 +105,40 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 11 unmodified lines
105105 temp2 = step[13] * C3;
106106 output[13] = temp2 - temp1;
107107
108− temp1 = step[ 9] * C5;
108+ temp1 = step[9] * C5;
109109 temp2 = step[14] * C11;
110110 output[14] = temp2 + temp1;
111111
112− temp1 = step[ 8] * C9;
112+ temp1 = step[8] * C9;
113113 temp2 = step[15] * C7;
114114 output[15] = temp2 - temp1;
115115
116116 // step 3
117− step[ 0] = output[0] + output[3];
118− step[ 1] = output[1] + output[2];
119− step[ 2] = output[1] - output[2];
120− step[ 3] = output[0] - output[3];
117+ step[0] = output[0] + output[3];
118+ step[1] = output[1] + output[2];
119+ step[2] = output[1] - output[2];
120+ step[3] = output[0] - output[3];
121121
122122 temp1 = output[4] * C14;
123123 temp2 = output[7] * C2;
124− step[ 4] = temp1 + temp2;
124+ step[4] = temp1 + temp2;
125125
126126 temp1 = output[5] * C10;
127127 temp2 = output[6] * C6;
128− step[ 5] = temp1 + temp2;
128+ step[5] = temp1 + temp2;
129129
130130 temp1 = output[5] * C6;
131131 temp2 = output[6] * C10;
132− step[ 6] = temp2 - temp1;
132+ step[6] = temp2 - temp1;
133133
134134 temp1 = output[4] * C2;
135135 temp2 = output[7] * C14;
136− step[ 7] = temp2 - temp1;
136+ step[7] = temp2 - temp1;
137137
138− step[ 8] = output[ 8] + output[11];
139− step[ 9] = output[ 9] + output[10];
140− step[10] = output[ 9] - output[10];
141− step[11] = output[ 8] - output[11];
138+ step[8] = output[8] + output[11];
139+ step[9] = output[9] + output[10];
140+ step[10] = output[9] - output[10];
141+ step[11] = output[8] - output[11];
142142
143143 step[12] = output[12] + output[15];
144144 step[13] = output[13] + output[14];
@@ -146,25 +146,25 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 1 unmodified line
146146 step[15] = output[12] - output[15];
147147
148148 // step 4
149− output[ 0] = (step[ 0] + step[ 1]);
150− output[ 8] = (step[ 0] - step[ 1]);
149+ output[0] = (step[0] + step[1]);
150+ output[8] = (step[0] - step[1]);
151151
152152 temp1 = step[2] * C12;
153153 temp2 = step[3] * C4;
154154 temp1 = temp1 + temp2;
155− output[ 4] = 2*(temp1 * C8);
155+ output[4] = 2 * (temp1 * C8);
156156
157157 temp1 = step[2] * C4;
158158 temp2 = step[3] * C12;
159159 temp1 = temp2 - temp1;
160160 output[12] = 2 * (temp1 * C8);
161161
162− output[ 2] = 2 * ((step[4] + step[ 5]) * C8);
163− output[14] = 2 * ((step[7] - step[ 6]) * C8);
162+ output[2] = 2 * ((step[4] + step[5]) * C8);
163+ output[14] = 2 * ((step[7] - step[6]) * C8);
164164
165165 temp1 = step[4] - step[5];
166166 temp2 = step[6] + step[7];
167− output[ 6] = (temp1 + temp2);
167+ output[6] = (temp1 + temp2);
168168 output[10] = (temp1 - temp2);
169169
170170 intermediate[8] = step[8] + step[14];
@@ -180,18 +180,18 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 9 unmodified lines
180180 temp1 = temp2 + temp1;
181181 output[13] = 2 * (temp1 * C8);
182182
183− output[ 9] = 2 * ((step[10] + step[11]) * C8);
183+ output[9] = 2 * ((step[10] + step[11]) * C8);
184184
185185 intermediate[11] = step[10] - step[11];
186186 intermediate[12] = step[12] + step[13];
187187 intermediate[13] = step[12] - step[13];
188− intermediate[14] = step[ 8] - step[14];
189− intermediate[15] = step[ 9] - step[15];
188+ intermediate[14] = step[8] - step[14];
189+ intermediate[15] = step[9] - step[15];
190190
191191 output[15] = (intermediate[11] + intermediate[12]);
192− output[ 1] = -(intermediate[11] - intermediate[12]);
192+ output[1] = -(intermediate[11] - intermediate[12]);
193193
194− output[ 7] = 2 * (intermediate[13] * C8);
194+ output[7] = 2 * (intermediate[13] * C8);
195195
196196 temp1 = intermediate[14] * C12;
197197 temp2 = intermediate[15] * C4;
@@ -201,28 +201,24 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 3 unmodified lines
201201 temp1 = intermediate[14] * C4;
202202 temp2 = intermediate[15] * C12;
203203 temp1 = temp2 + temp1;
204− output[ 5] = 2 * (temp1 * C8);
204+ output[5] = 2 * (temp1 * C8);
205205 }
206206
207207 void reference_16x16_dct_2d(int16_t input[256], double output[256]) {
208208 // First transform columns
209209 for (int i = 0; i < 16; ++i) {
210210 double temp_in[16], temp_out[16];
211− for (int j = 0; j < 16; ++j)
212− temp_in[j] = input[j * 16 + i];
211+ for (int j = 0; j < 16; ++j) temp_in[j] = input[j * 16 + i];
213212 butterfly_16x16_dct_1d(temp_in, temp_out);
214− for (int j = 0; j < 16; ++j)
215− output[j * 16 + i] = temp_out[j];
213+ for (int j = 0; j < 16; ++j) output[j * 16 + i] = temp_out[j];
216214 }
217215 // Then transform rows
218216 for (int i = 0; i < 16; ++i) {
219217 double temp_in[16], temp_out[16];
220− for (int j = 0; j < 16; ++j)
221− temp_in[j] = output[j + i * 16];
218+ for (int j = 0; j < 16; ++j) temp_in[j] = output[j + i * 16];
222219 butterfly_16x16_dct_1d(temp_in, temp_out);
223220 // Scale by some magic number
224− for (int j = 0; j < 16; ++j)
225− output[j + i * 16] = temp_out[j]/2;
221+ for (int j = 0; j < 16; ++j) output[j + i * 16] = temp_out[j] / 2;
226222 }
227223 }
228224
@@ -248,8 +244,7 @@ void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, · 19 unmodified lines
248244 vpx_idct16x16_256_add_c(in, dest, stride);
249245 }
250246
251−void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
252− int tx_type) {
247+void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
253248 vp9_fht16x16_c(in, out, stride, tx_type);
254249 }
255250
@@ -351,11 +346,10 @@ class Trans16x16TestBase { · 95 unmodified lines
351346 }
352347 }
353348
354− ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
355− test_temp_block, pitch_));
349+ ASM_REGISTER_STATE_CHECK(
350+ RunFwdTxfm(test_input_block, test_temp_block, pitch_));
356351 if (bit_depth_ == VPX_BITS_8) {
357− ASM_REGISTER_STATE_CHECK(
358− RunInvTxfm(test_temp_block, dst, pitch_));
352+ ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
359353 #if CONFIG_VP9_HIGHBITDEPTH
360354 } else {
361355 ASM_REGISTER_STATE_CHECK(
@@ -366,18 +360,17 @@ class Trans16x16TestBase { · 4 unmodified lines
366360 for (int j = 0; j < kNumCoeffs; ++j) {
367361 #if CONFIG_VP9_HIGHBITDEPTH
368362 const int32_t diff =
369− bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
363+ bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
370364 #else
371365 const int32_t diff = dst[j] - src[j];
372366 #endif
373367 const uint32_t error = diff * diff;
374− if (max_error < error)
375− max_error = error;
368+ if (max_error < error) max_error = error;
376369 total_error += error;
377370 }
378371 }
379372
380− EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error)
373+ EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error)
381374 << "Error: 16x16 FHT/IHT has an individual round trip error > 1";
382375
383376 EXPECT_GE(count_test_block << 2 * (bit_depth_ - 8), total_error)
@@ -418,16 +411,14 @@ class Trans16x16TestBase { · 34 unmodified lines
418411 input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
419412 }
420413 if (i == 0) {
421− for (int j = 0; j < kNumCoeffs; ++j)
422− input_extreme_block[j] = mask_;
414+ for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
423415 } else if (i == 1) {
424− for (int j = 0; j < kNumCoeffs; ++j)
425− input_extreme_block[j] = -mask_;
416+ for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
426417 }
427418
428419 fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
429− ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
430− output_block, pitch_));
420+ ASM_REGISTER_STATE_CHECK(
421+ RunFwdTxfm(input_extreme_block, output_block, pitch_));
431422
432423 // The minimum quant value is 4.
433424 for (int j = 0; j < kNumCoeffs; ++j) {
@@ -457,11 +448,9 @@ class Trans16x16TestBase { · 23 unmodified lines
457448 input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
458449 }
459450 if (i == 0)
460− for (int j = 0; j < kNumCoeffs; ++j)
461− input_extreme_block[j] = mask_;
451+ for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
462452 if (i == 1)
463− for (int j = 0; j < kNumCoeffs; ++j)
464− input_extreme_block[j] = -mask_;
453+ for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
465454
466455 fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
467456
@@ -484,17 +473,15 @@ class Trans16x16TestBase { · 16 unmodified lines
484473 } else {
485474 inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_,
486475 tx_type_);
487− ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block,
488− CONVERT_TO_BYTEPTR(dst16), pitch_));
476+ ASM_REGISTER_STATE_CHECK(
477+ RunInvTxfm(output_ref_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
489478 #endif
490479 }
491480 if (bit_depth_ == VPX_BITS_8) {
492− for (int j = 0; j < kNumCoeffs; ++j)
493− EXPECT_EQ(ref[j], dst[j]);
481+ for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref[j], dst[j]);
494482 #if CONFIG_VP9_HIGHBITDEPTH
495483 } else {
496− for (int j = 0; j < kNumCoeffs; ++j)
497− EXPECT_EQ(ref16[j], dst16[j]);
484+ for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref16[j], dst16[j]);
498485 #endif
499486 }
500487 }
@@ -538,8 +525,8 @@ class Trans16x16TestBase { · 37 unmodified lines
538525 ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16));
539526 #if CONFIG_VP9_HIGHBITDEPTH
540527 } else {
541− ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
542− 16));
528+ ASM_REGISTER_STATE_CHECK(
529+ RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), 16));
543530 #endif // CONFIG_VP9_HIGHBITDEPTH
544531 }
545532
@@ -551,9 +538,8 @@ class Trans16x16TestBase { · 5 unmodified lines
551538 const uint32_t diff = dst[j] - src[j];
552539 #endif // CONFIG_VP9_HIGHBITDEPTH
553540 const uint32_t error = diff * diff;
554− EXPECT_GE(1u, error)
555− << "Error: 16x16 IDCT has error " << error
556− << " at index " << j;
541+ EXPECT_GE(1u, error) << "Error: 16x16 IDCT has error " << error
542+ << " at index " << j;
557543 }
558544 }
559545 }
@@ -595,8 +581,8 @@ class Trans16x16TestBase { · 35 unmodified lines
595581 } else {
596582 #if CONFIG_VP9_HIGHBITDEPTH
597583 ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
598− ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
599− pitch_));
584+ ASM_REGISTER_STATE_CHECK(
585+ RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
600586 #endif // CONFIG_VP9_HIGHBITDEPTH
601587 }
602588
@@ -608,9 +594,8 @@ class Trans16x16TestBase { · 5 unmodified lines
608594 const uint32_t diff = dst[j] - ref[j];
609595 #endif // CONFIG_VP9_HIGHBITDEPTH
610596 const uint32_t error = diff * diff;
611− EXPECT_EQ(0u, error)
612− << "Error: 16x16 IDCT Comparison has error " << error
613− << " at index " << j;
597+ EXPECT_EQ(0u, error) << "Error: 16x16 IDCT Comparison has error "
598+ << error << " at index " << j;
614599 }
615600 }
616601 }
@@ -623,32 +608,25 @@ class Trans16x16TestBase { · 6 unmodified lines
623608 IhtFunc inv_txfm_ref;
624609 };
625610
626−class Trans16x16DCT
627− : public Trans16x16TestBase,
628− public ::testing::TestWithParam<Dct16x16Param> {
611+class Trans16x16DCT : public Trans16x16TestBase,
612+ public ::testing::TestWithParam<Dct16x16Param> {
629613 public:
630614 virtual ~Trans16x16DCT() {}
631615
632616 virtual void SetUp() {
633617 fwd_txfm_ = GET_PARAM(0);
634618 inv_txfm_ = GET_PARAM(1);
635− tx_type_ = GET_PARAM(2);
619+ tx_type_ = GET_PARAM(2);
636620 bit_depth_ = GET_PARAM(3);
637− pitch_ = 16;
621+ pitch_ = 16;
638622 fwd_txfm_ref = fdct16x16_ref;
639623 inv_txfm_ref = idct16x16_ref;
640624 mask_ = (1 << bit_depth_) - 1;
641625 #if CONFIG_VP9_HIGHBITDEPTH
642626 switch (bit_depth_) {
643− case VPX_BITS_10:
644− inv_txfm_ref = idct16x16_10_ref;
645− break;
646− case VPX_BITS_12:
647− inv_txfm_ref = idct16x16_12_ref;
648− break;
649− default:
650− inv_txfm_ref = idct16x16_ref;
651− break;
627+ case VPX_BITS_10: inv_txfm_ref = idct16x16_10_ref; break;
628+ case VPX_BITS_12: inv_txfm_ref = idct16x16_12_ref; break;
629+ default: inv_txfm_ref = idct16x16_ref; break;
652630 }
653631 #else
654632 inv_txfm_ref = idct16x16_ref;
@@ -668,17 +646,11 @@ class Trans16x16DCT · 13 unmodified lines
668646 IdctFunc inv_txfm_;
669647 };
670648
671−TEST_P(Trans16x16DCT, AccuracyCheck) {
672− RunAccuracyCheck();
673−}
649+TEST_P(Trans16x16DCT, AccuracyCheck) { RunAccuracyCheck(); }
674650
675−TEST_P(Trans16x16DCT, CoeffCheck) {
676− RunCoeffCheck();
677−}
651+TEST_P(Trans16x16DCT, CoeffCheck) { RunCoeffCheck(); }
678652
679−TEST_P(Trans16x16DCT, MemCheck) {
680− RunMemCheck();
681−}
653+TEST_P(Trans16x16DCT, MemCheck) { RunMemCheck(); }
682654
683655 TEST_P(Trans16x16DCT, QuantCheck) {
684656 // Use maximally allowed quantization step sizes for DC and AC
@@ -686,36 +658,27 @@ TEST_P(Trans16x16DCT, QuantCheck) { · 1 unmodified line
686658 RunQuantCheck(1336, 1828);
687659 }
688660
689−TEST_P(Trans16x16DCT, InvAccuracyCheck) {
690− RunInvAccuracyCheck();
691−}
661+TEST_P(Trans16x16DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); }
692662
693−class Trans16x16HT
694− : public Trans16x16TestBase,
695− public ::testing::TestWithParam<Ht16x16Param> {
663+class Trans16x16HT : public Trans16x16TestBase,
664+ public ::testing::TestWithParam<Ht16x16Param> {
696665 public:
697666 virtual ~Trans16x16HT() {}
698667
699668 virtual void SetUp() {
700669 fwd_txfm_ = GET_PARAM(0);
701670 inv_txfm_ = GET_PARAM(1);
702− tx_type_ = GET_PARAM(2);
671+ tx_type_ = GET_PARAM(2);
703672 bit_depth_ = GET_PARAM(3);
704− pitch_ = 16;
673+ pitch_ = 16;
705674 fwd_txfm_ref = fht16x16_ref;
706675 inv_txfm_ref = iht16x16_ref;
707676 mask_ = (1 << bit_depth_) - 1;
708677 #if CONFIG_VP9_HIGHBITDEPTH
709678 switch (bit_depth_) {
710− case VPX_BITS_10:
711− inv_txfm_ref = iht16x16_10;
712− break;
713− case VPX_BITS_12:
714− inv_txfm_ref = iht16x16_12;
715− break;
716− default:
717− inv_txfm_ref = iht16x16_ref;
718− break;
679+ case VPX_BITS_10: inv_txfm_ref = iht16x16_10; break;
680+ case VPX_BITS_12: inv_txfm_ref = iht16x16_12; break;
681+ default: inv_txfm_ref = iht16x16_ref; break;
719682 }
720683 #else
721684 inv_txfm_ref = iht16x16_ref;
@@ -735,17 +698,11 @@ class Trans16x16HT · 13 unmodified lines
735698 IhtFunc inv_txfm_;
736699 };
737700
738−TEST_P(Trans16x16HT, AccuracyCheck) {
739− RunAccuracyCheck();
740−}
701+TEST_P(Trans16x16HT, AccuracyCheck) { RunAccuracyCheck(); }
741702
742−TEST_P(Trans16x16HT, CoeffCheck) {
743− RunCoeffCheck();
744−}
703+TEST_P(Trans16x16HT, CoeffCheck) { RunCoeffCheck(); }
745704
746−TEST_P(Trans16x16HT, MemCheck) {
747− RunMemCheck();
748−}
705+TEST_P(Trans16x16HT, MemCheck) { RunMemCheck(); }
749706
750707 TEST_P(Trans16x16HT, QuantCheck) {
751708 // The encoder skips any non-DC intra prediction modes,
@@ -753,9 +710,8 @@ TEST_P(Trans16x16HT, QuantCheck) { · 1 unmodified line
753710 RunQuantCheck(429, 729);
754711 }
755712
756−class InvTrans16x16DCT
757− : public Trans16x16TestBase,
758− public ::testing::TestWithParam<Idct16x16Param> {
713+class InvTrans16x16DCT : public Trans16x16TestBase,
714+ public ::testing::TestWithParam<Idct16x16Param> {
759715 public:
760716 virtual ~InvTrans16x16DCT() {}
761717
@@ -766,7 +722,7 @@ class InvTrans16x16DCT · 4 unmodified lines
766722 bit_depth_ = GET_PARAM(3);
767723 pitch_ = 16;
768724 mask_ = (1 << bit_depth_) - 1;
769−}
725+ }
770726 virtual void TearDown() { libvpx_test::ClearSystemState(); }
771727
772728 protected:
@@ -784,9 +740,8 @@ TEST_P(InvTrans16x16DCT, CompareReference) { · 11 unmodified lines
784740 CompareInvReference(ref_txfm_, thresh_);
785741 }
786742
787−class PartialTrans16x16Test
788− : public ::testing::TestWithParam<
789− std::tr1::tuple<FdctFunc, vpx_bit_depth_t> > {
743+class PartialTrans16x16Test : public ::testing::TestWithParam<
744+ std::tr1::tuple<FdctFunc, vpx_bit_depth_t> > {
790745 public:
791746 virtual ~PartialTrans16x16Test() {}
792747 virtual void SetUp() {
@@ -855,10 +810,10 @@ INSTANTIATE_TEST_CASE_P( · 62 unmodified lines
855810 make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12),
856811 make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
857812 #else
858−INSTANTIATE_TEST_CASE_P(
859− C, Trans16x16DCT,
860− ::testing::Values(
861− make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
813+INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT,
814+ ::testing::Values(make_tuple(&vpx_fdct16x16_c,
815+ &vpx_idct16x16_256_add_c,
816+ 0, VPX_BITS_8)));
862817 #endif // CONFIG_VP9_HIGHBITDEPTH
863818
864819 #if CONFIG_VP9_HIGHBITDEPTH
@@ -898,28 +853,25 @@ INSTANTIATE_TEST_CASE_P(C, PartialTrans16x16Test, · 33 unmodified lines
898853 #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
899854 INSTANTIATE_TEST_CASE_P(
900855 NEON, Trans16x16DCT,
901− ::testing::Values(
902− make_tuple(&vpx_fdct16x16_c,
903− &vpx_idct16x16_256_add_neon, 0, VPX_BITS_8)));
856+ ::testing::Values(make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_neon,
857+ 0, VPX_BITS_8)));
904858 #endif
905859
906860 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
907861 INSTANTIATE_TEST_CASE_P(
908862 SSE2, Trans16x16DCT,
909− ::testing::Values(
910− make_tuple(&vpx_fdct16x16_sse2,
911− &vpx_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
863+ ::testing::Values(make_tuple(&vpx_fdct16x16_sse2,
864+ &vpx_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
912865 INSTANTIATE_TEST_CASE_P(
913866 SSE2, Trans16x16HT,
914− ::testing::Values(
915− make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0,
916− VPX_BITS_8),
917− make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1,
918− VPX_BITS_8),
919− make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2,
920− VPX_BITS_8),
921− make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3,
922− VPX_BITS_8)));
867+ ::testing::Values(make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
868+ 0, VPX_BITS_8),
869+ make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
870+ 1, VPX_BITS_8),
871+ make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
872+ 2, VPX_BITS_8),
873+ make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
874+ 3, VPX_BITS_8)));
923875 INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test,
924876 ::testing::Values(make_tuple(&vpx_fdct16x16_1_sse2,
925877 VPX_BITS_8)));
@@ -929,16 +881,14 @@ INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test, · 3 unmodified lines
929881 INSTANTIATE_TEST_CASE_P(
930882 SSE2, Trans16x16DCT,
931883 ::testing::Values(
932− make_tuple(&vpx_highbd_fdct16x16_sse2,
933− &idct16x16_10, 0, VPX_BITS_10),
934− make_tuple(&vpx_highbd_fdct16x16_c,
935− &idct16x16_256_add_10_sse2, 0, VPX_BITS_10),
936− make_tuple(&vpx_highbd_fdct16x16_sse2,
937− &idct16x16_12, 0, VPX_BITS_12),
938− make_tuple(&vpx_highbd_fdct16x16_c,
939− &idct16x16_256_add_12_sse2, 0, VPX_BITS_12),
940− make_tuple(&vpx_fdct16x16_sse2,
941− &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
884+ make_tuple(&vpx_highbd_fdct16x16_sse2, &idct16x16_10, 0, VPX_BITS_10),
885+ make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_256_add_10_sse2, 0,
886+ VPX_BITS_10),
887+ make_tuple(&vpx_highbd_fdct16x16_sse2, &idct16x16_12, 0, VPX_BITS_12),
888+ make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_256_add_12_sse2, 0,
889+ VPX_BITS_12),
890+ make_tuple(&vpx_fdct16x16_sse2, &vpx_idct16x16_256_add_c, 0,
891+ VPX_BITS_8)));
942892 INSTANTIATE_TEST_CASE_P(
943893 SSE2, Trans16x16HT,
944894 ::testing::Values(
@@ -951,26 +901,24 @@ INSTANTIATE_TEST_CASE_P( · 6 unmodified lines
951901 // that to test both branches.
952902 INSTANTIATE_TEST_CASE_P(
953903 SSE2, InvTrans16x16DCT,
954− ::testing::Values(
955− make_tuple(&idct16x16_10_add_10_c,
956− &idct16x16_10_add_10_sse2, 3167, VPX_BITS_10),
957− make_tuple(&idct16x16_10,
958− &idct16x16_256_add_10_sse2, 3167, VPX_BITS_10),
959− make_tuple(&idct16x16_10_add_12_c,
960− &idct16x16_10_add_12_sse2, 3167, VPX_BITS_12),
961− make_tuple(&idct16x16_12,
962− &idct16x16_256_add_12_sse2, 3167, VPX_BITS_12)));
904+ ::testing::Values(make_tuple(&idct16x16_10_add_10_c,
905+ &idct16x16_10_add_10_sse2, 3167, VPX_BITS_10),
906+ make_tuple(&idct16x16_10, &idct16x16_256_add_10_sse2,
907+ 3167, VPX_BITS_10),
908+ make_tuple(&idct16x16_10_add_12_c,
909+ &idct16x16_10_add_12_sse2, 3167, VPX_BITS_12),
910+ make_tuple(&idct16x16_12, &idct16x16_256_add_12_sse2,
911+ 3167, VPX_BITS_12)));
963912 INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test,
964913 ::testing::Values(make_tuple(&vpx_fdct16x16_1_sse2,
965914 VPX_BITS_8)));
966915 #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
967916
968917 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
969−INSTANTIATE_TEST_CASE_P(
970− MSA, Trans16x16DCT,
971− ::testing::Values(
972− make_tuple(&vpx_fdct16x16_msa,
973− &vpx_idct16x16_256_add_msa, 0, VPX_BITS_8)));
918+INSTANTIATE_TEST_CASE_P(MSA, Trans16x16DCT,
919+ ::testing::Values(make_tuple(&vpx_fdct16x16_msa,
920+ &vpx_idct16x16_256_add_msa,
921+ 0, VPX_BITS_8)));
974922 INSTANTIATE_TEST_CASE_P(
975923 MSA, Trans16x16HT,
976924 ::testing::Values(
test/dct32x32_test.cc+41−60
@@ -39,8 +39,7 @@ void reference_32x32_dct_1d(const double in[32], double out[32]) { · 38 unmodified lines
3939 out[k] = 0.0;
4040 for (int n = 0; n < 32; n++)
4141 out[k] += in[n] * cos(kPi * (2 * n + 1) * k / 64.0);
42− if (k == 0)
43− out[k] = out[k] * kInvSqrt2;
42+ if (k == 0) out[k] = out[k] * kInvSqrt2;
4443 }
4544 }
4645
@@ -49,21 +48,17 @@ void reference_32x32_dct_2d(const int16_t input[kNumCoeffs], · 2 unmodified lines
4948 // First transform columns
5049 for (int i = 0; i < 32; ++i) {
5150 double temp_in[32], temp_out[32];
52− for (int j = 0; j < 32; ++j)
53− temp_in[j] = input[j*32 + i];
51+ for (int j = 0; j < 32; ++j) temp_in[j] = input[j * 32 + i];
5452 reference_32x32_dct_1d(temp_in, temp_out);
55− for (int j = 0; j < 32; ++j)
56− output[j * 32 + i] = temp_out[j];
53+ for (int j = 0; j < 32; ++j) output[j * 32 + i] = temp_out[j];
5754 }
5855 // Then transform rows
5956 for (int i = 0; i < 32; ++i) {
6057 double temp_in[32], temp_out[32];
61− for (int j = 0; j < 32; ++j)
62− temp_in[j] = output[j + i*32];
58+ for (int j = 0; j < 32; ++j) temp_in[j] = output[j + i * 32];
6359 reference_32x32_dct_1d(temp_in, temp_out);
6460 // Scale by some magic number
65− for (int j = 0; j < 32; ++j)
66− output[j + i * 32] = temp_out[j] / 4;
61+ for (int j = 0; j < 32; ++j) output[j + i * 32] = temp_out[j] / 4;
6762 }
6863 }
6964
@@ -89,8 +84,8 @@ class Trans32x32Test : public ::testing::TestWithParam<Trans32x32Param> { · 19 unmodified lines
8984 virtual void SetUp() {
9085 fwd_txfm_ = GET_PARAM(0);
9186 inv_txfm_ = GET_PARAM(1);
92− version_ = GET_PARAM(2); // 0: high precision forward transform
93− // 1: low precision version for rd loop
87+ version_ = GET_PARAM(2); // 0: high precision forward transform
88+ // 1: low precision version for rd loop
9489 bit_depth_ = GET_PARAM(3);
9590 mask_ = (1 << bit_depth_) - 1;
9691 }
@@ -140,8 +135,8 @@ TEST_P(Trans32x32Test, AccuracyCheck) { · 43 unmodified lines
140135 ASM_REGISTER_STATE_CHECK(inv_txfm_(test_temp_block, dst, 32));
141136 #if CONFIG_VP9_HIGHBITDEPTH
142137 } else {
143− ASM_REGISTER_STATE_CHECK(inv_txfm_(test_temp_block,
144− CONVERT_TO_BYTEPTR(dst16), 32));
138+ ASM_REGISTER_STATE_CHECK(
139+ inv_txfm_(test_temp_block, CONVERT_TO_BYTEPTR(dst16), 32));
145140 #endif
146141 }
147142
@@ -153,8 +148,7 @@ TEST_P(Trans32x32Test, AccuracyCheck) { · 5 unmodified lines
153148 const int32_t diff = dst[j] - src[j];
154149 #endif
155150 const uint32_t error = diff * diff;
156− if (max_error < error)
157− max_error = error;
151+ if (max_error < error) max_error = error;
158152 total_error += error;
159153 }
160154 }
@@ -213,11 +207,9 @@ TEST_P(Trans32x32Test, MemCheck) { · 52 unmodified lines
213207 input_extreme_block[j] = rnd.Rand8() & 1 ? mask_ : -mask_;
214208 }
215209 if (i == 0) {
216− for (int j = 0; j < kNumCoeffs; ++j)
217− input_extreme_block[j] = mask_;
210+ for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
218211 } else if (i == 1) {
219− for (int j = 0; j < kNumCoeffs; ++j)
220− input_extreme_block[j] = -mask_;
212+ for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
221213 }
222214
223215 const int stride = 32;
@@ -291,9 +283,8 @@ TEST_P(Trans32x32Test, InverseAccuracy) { · 67 unmodified lines
291283 const int diff = dst[j] - src[j];
292284 #endif
293285 const int error = diff * diff;
294− EXPECT_GE(1, error)
295− << "Error: 32x32 IDCT has error " << error
296− << " at index " << j;
286+ EXPECT_GE(1, error) << "Error: 32x32 IDCT has error " << error
287+ << " at index " << j;
297288 }
298289 }
299290 }
@@ -365,18 +356,13 @@ using std::tr1::make_tuple; · 65 unmodified lines
365356 INSTANTIATE_TEST_CASE_P(
366357 C, Trans32x32Test,
367358 ::testing::Values(
368− make_tuple(&vpx_highbd_fdct32x32_c,
369− &idct32x32_10, 0, VPX_BITS_10),
370− make_tuple(&vpx_highbd_fdct32x32_rd_c,
371− &idct32x32_10, 1, VPX_BITS_10),
372− make_tuple(&vpx_highbd_fdct32x32_c,
373− &idct32x32_12, 0, VPX_BITS_12),
374− make_tuple(&vpx_highbd_fdct32x32_rd_c,
375− &idct32x32_12, 1, VPX_BITS_12),
376− make_tuple(&vpx_fdct32x32_c,
377− &vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
378− make_tuple(&vpx_fdct32x32_rd_c,
379− &vpx_idct32x32_1024_add_c, 1, VPX_BITS_8)));
359+ make_tuple(&vpx_highbd_fdct32x32_c, &idct32x32_10, 0, VPX_BITS_10),
360+ make_tuple(&vpx_highbd_fdct32x32_rd_c, &idct32x32_10, 1, VPX_BITS_10),
361+ make_tuple(&vpx_highbd_fdct32x32_c, &idct32x32_12, 0, VPX_BITS_12),
362+ make_tuple(&vpx_highbd_fdct32x32_rd_c, &idct32x32_12, 1, VPX_BITS_12),
363+ make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
364+ make_tuple(&vpx_fdct32x32_rd_c, &vpx_idct32x32_1024_add_c, 1,
365+ VPX_BITS_8)));
380366 INSTANTIATE_TEST_CASE_P(
381367 C, PartialTrans32x32Test,
382368 ::testing::Values(make_tuple(&vpx_highbd_fdct32x32_1_c, VPX_BITS_8),
@@ -385,11 +371,10 @@ INSTANTIATE_TEST_CASE_P( · 2 unmodified lines
385371 #else
386372 INSTANTIATE_TEST_CASE_P(
387373 C, Trans32x32Test,
388− ::testing::Values(
389− make_tuple(&vpx_fdct32x32_c,
390− &vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
391− make_tuple(&vpx_fdct32x32_rd_c,
392− &vpx_idct32x32_1024_add_c, 1, VPX_BITS_8)));
374+ ::testing::Values(make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c, 0,
375+ VPX_BITS_8),
376+ make_tuple(&vpx_fdct32x32_rd_c, &vpx_idct32x32_1024_add_c,
377+ 1, VPX_BITS_8)));
393378 INSTANTIATE_TEST_CASE_P(C, PartialTrans32x32Test,
394379 ::testing::Values(make_tuple(&vpx_fdct32x32_1_c,
395380 VPX_BITS_8)));
@@ -398,21 +383,19 @@ INSTANTIATE_TEST_CASE_P(C, PartialTrans32x32Test, · 2 unmodified lines
398383 #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
399384 INSTANTIATE_TEST_CASE_P(
400385 NEON, Trans32x32Test,
401− ::testing::Values(
402− make_tuple(&vpx_fdct32x32_c,
403− &vpx_idct32x32_1024_add_neon, 0, VPX_BITS_8),
404− make_tuple(&vpx_fdct32x32_rd_c,
405− &vpx_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
386+ ::testing::Values(make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_neon,
387+ 0, VPX_BITS_8),
388+ make_tuple(&vpx_fdct32x32_rd_c,
389+ &vpx_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
406390 #endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
407391
408392 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
409393 INSTANTIATE_TEST_CASE_P(
410394 SSE2, Trans32x32Test,
411− ::testing::Values(
412− make_tuple(&vpx_fdct32x32_sse2,
413− &vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
414− make_tuple(&vpx_fdct32x32_rd_sse2,
415− &vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
395+ ::testing::Values(make_tuple(&vpx_fdct32x32_sse2,
396+ &vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
397+ make_tuple(&vpx_fdct32x32_rd_sse2,
398+ &vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
416399 INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans32x32Test,
417400 ::testing::Values(make_tuple(&vpx_fdct32x32_1_sse2,
418401 VPX_BITS_8)));
@@ -440,21 +423,19 @@ INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans32x32Test, · 21 unmodified lines
440423 #if HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
441424 INSTANTIATE_TEST_CASE_P(
442425 AVX2, Trans32x32Test,
443− ::testing::Values(
444− make_tuple(&vpx_fdct32x32_avx2,
445− &vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
446− make_tuple(&vpx_fdct32x32_rd_avx2,
447− &vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
426+ ::testing::Values(make_tuple(&vpx_fdct32x32_avx2,
427+ &vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
428+ make_tuple(&vpx_fdct32x32_rd_avx2,
429+ &vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
448430 #endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
449431
450432 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
451433 INSTANTIATE_TEST_CASE_P(
452434 MSA, Trans32x32Test,
453− ::testing::Values(
454− make_tuple(&vpx_fdct32x32_msa,
455− &vpx_idct32x32_1024_add_msa, 0, VPX_BITS_8),
456− make_tuple(&vpx_fdct32x32_rd_msa,
457− &vpx_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
435+ ::testing::Values(make_tuple(&vpx_fdct32x32_msa,
436+ &vpx_idct32x32_1024_add_msa, 0, VPX_BITS_8),
437+ make_tuple(&vpx_fdct32x32_rd_msa,
438+ &vpx_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
458439 INSTANTIATE_TEST_CASE_P(MSA, PartialTrans32x32Test,
459440 ::testing::Values(make_tuple(&vpx_fdct32x32_1_msa,
460441 VPX_BITS_8)));
test/decode_api_test.cc+12−19
@@ -28,7 +28,7 @@ TEST(DecodeAPI, InvalidParams) { · 27 unmodified lines
2828 &vpx_codec_vp9_dx_algo,
2929 #endif
3030 };
31− uint8_t buf[1] = {0};
31+ uint8_t buf[1] = { 0 };
3232 vpx_codec_ctx_t dec;
3333
3434 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_dec_init(NULL, NULL, NULL, 0));
@@ -51,8 +51,7 @@ TEST(DecodeAPI, InvalidParams) { · 16 unmodified lines
5151 vpx_codec_decode(&dec, buf, NELEMENTS(buf), NULL, 0));
5252 EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
5353 vpx_codec_decode(&dec, NULL, NELEMENTS(buf), NULL, 0));
54− EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
55− vpx_codec_decode(&dec, buf, 0, NULL, 0));
54+ EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_decode(&dec, buf, 0, NULL, 0));
5655
5756 EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec));
5857 }
@@ -77,12 +76,9 @@ TEST(DecodeAPI, OptionalParams) { · 18 unmodified lines
7776 // Test VP9 codec controls after a decode error to ensure the code doesn't
7877 // misbehave.
7978 void TestVp9Controls(vpx_codec_ctx_t *dec) {
80− static const int kControls[] = {
81− VP8D_GET_LAST_REF_UPDATES,
82− VP8D_GET_FRAME_CORRUPTED,
83− VP9D_GET_DISPLAY_SIZE,
84− VP9D_GET_FRAME_SIZE
85− };
79+ static const int kControls[] = { VP8D_GET_LAST_REF_UPDATES,
80+ VP8D_GET_FRAME_CORRUPTED,
81+ VP9D_GET_DISPLAY_SIZE, VP9D_GET_FRAME_SIZE };
8682 int val[2];
8783
8884 for (int i = 0; i < NELEMENTS(kControls); ++i) {
@@ -91,9 +87,7 @@ void TestVp9Controls(vpx_codec_ctx_t *dec) { · 2 unmodified lines
9187 case VP8D_GET_FRAME_CORRUPTED:
9288 EXPECT_EQ(VPX_CODEC_ERROR, res) << kControls[i];
9389 break;
94− default:
95− EXPECT_EQ(VPX_CODEC_OK, res) << kControls[i];
96− break;
90+ default: EXPECT_EQ(VPX_CODEC_OK, res) << kControls[i]; break;
9791 }
9892 EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
9993 vpx_codec_control_(dec, kControls[i], NULL));
@@ -150,10 +144,9 @@ TEST(DecodeAPI, Vp9PeekSI) { · 50 unmodified lines
150144 // size 10, this should return VPX_CODEC_UNSUP_BITSTREAM and after that it
151145 // should return VPX_CODEC_CORRUPT_FRAME.
152146 const uint8_t data[32] = {
153− 0x85, 0xa4, 0xc1, 0xa1, 0x38, 0x81, 0xa3, 0x49,
154− 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
155− 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
156− 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
147+ 0x85, 0xa4, 0xc1, 0xa1, 0x38, 0x81, 0xa3, 0x49, 0x83, 0xff, 0xff,
148+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
149+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
157150 };
158151
159152 for (uint32_t data_sz = 1; data_sz <= 32; ++data_sz) {
@@ -162,9 +155,9 @@ TEST(DecodeAPI, Vp9PeekSI) { · 2 unmodified lines
162155 if (data_sz >= 8) {
163156 vpx_codec_ctx_t dec;
164157 EXPECT_EQ(VPX_CODEC_OK, vpx_codec_dec_init(&dec, codec, NULL, 0));
165− EXPECT_EQ((data_sz < 10) ?
166− VPX_CODEC_UNSUP_BITSTREAM : VPX_CODEC_CORRUPT_FRAME,
167− vpx_codec_decode(&dec, data, data_sz, NULL, 0));
158+ EXPECT_EQ(
159+ (data_sz < 10) ? VPX_CODEC_UNSUP_BITSTREAM : VPX_CODEC_CORRUPT_FRAME,
160+ vpx_codec_decode(&dec, data, data_sz, NULL, 0));
168161 vpx_codec_iter_t iter = NULL;
169162 EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter));
170163 EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec));
test/decode_perf_test.cc+13−26
@@ -70,8 +70,7 @@ const DecodePerfParam kVP9DecodePerfVectors[] = { · 69 unmodified lines
7070 power/temp/min max frame decode times/etc
7171 */
7272
73−class DecodePerfTest : public ::testing::TestWithParam<DecodePerfParam> {
74−};
73+class DecodePerfTest : public ::testing::TestWithParam<DecodePerfParam> {};
7574
7675 TEST_P(DecodePerfTest, PerfTest) {
7776 const char *const video_name = GET_PARAM(VIDEO_NAME);
@@ -92,8 +91,7 @@ TEST_P(DecodePerfTest, PerfTest) { · 14 unmodified lines
9291 }
9392
9493 vpx_usec_timer_mark(&t);
95− const double elapsed_secs = double(vpx_usec_timer_elapsed(&t))
96− / kUsecsInSec;
94+ const double elapsed_secs = double(vpx_usec_timer_elapsed(&t)) / kUsecsInSec;
9795 const unsigned frames = video.frame_number();
9896 const double fps = double(frames) / elapsed_secs;
9997
@@ -111,17 +109,13 @@ TEST_P(DecodePerfTest, PerfTest) { · 11 unmodified lines
111109 INSTANTIATE_TEST_CASE_P(VP9, DecodePerfTest,
112110 ::testing::ValuesIn(kVP9DecodePerfVectors));
113111
114−class VP9NewEncodeDecodePerfTest :
115− public ::libvpx_test::EncoderTest,
116− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
112+class VP9NewEncodeDecodePerfTest
113+ : public ::libvpx_test::EncoderTest,
114+ public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
117115 protected:
118116 VP9NewEncodeDecodePerfTest()
119− : EncoderTest(GET_PARAM(0)),
120− encoding_mode_(GET_PARAM(1)),
121− speed_(0),
122− outfile_(0),
123− out_frames_(0) {
124− }
117+ : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), speed_(0),
118+ outfile_(0), out_frames_(0) {}
125119
126120 virtual ~VP9NewEncodeDecodePerfTest() {}
127121
@@ -182,9 +176,7 @@ class VP9NewEncodeDecodePerfTest : · 54 unmodified lines
182176
183177 virtual bool DoDecode() { return false; }
184178
185− void set_speed(unsigned int speed) {
186− speed_ = speed;
187− }
179+ void set_speed(unsigned int speed) { speed_ = speed; }
188180
189181 private:
190182 libvpx_test::TestMode encoding_mode_;
@@ -196,10 +188,7 @@ class VP9NewEncodeDecodePerfTest : · 5 unmodified lines
196188 struct EncodePerfTestVideo {
197189 EncodePerfTestVideo(const char *name_, uint32_t width_, uint32_t height_,
198190 uint32_t bitrate_, int frames_)
199− : name(name_),
200− width(width_),
201− height(height_),
202− bitrate(bitrate_),
191+ : name(name_), width(width_), height(height_), bitrate(bitrate_),
203192 frames(frames_) {}
204193 const char *name;
205194 uint32_t width;
@@ -225,10 +214,8 @@ TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) { · 19 unmodified lines
225214
226215 const char *video_name = kVP9EncodePerfTestVectors[i].name;
227216 libvpx_test::I420VideoSource video(
228− video_name,
229− kVP9EncodePerfTestVectors[i].width,
230− kVP9EncodePerfTestVectors[i].height,
231− timebase.den, timebase.num, 0,
217+ video_name, kVP9EncodePerfTestVectors[i].width,
218+ kVP9EncodePerfTestVectors[i].height, timebase.den, timebase.num, 0,
232219 kVP9EncodePerfTestVectors[i].frames);
233220 set_speed(2);
234221
@@ -268,6 +255,6 @@ TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) { · 33 unmodified lines
268255 printf("}\n");
269256 }
270257
271−VP9_INSTANTIATE_TEST_CASE(
272− VP9NewEncodeDecodePerfTest, ::testing::Values(::libvpx_test::kTwoPassGood));
258+VP9_INSTANTIATE_TEST_CASE(VP9NewEncodeDecodePerfTest,
259+ ::testing::Values(::libvpx_test::kTwoPassGood));
273260 } // namespace
test/decode_test_driver.cc+11−17
@@ -21,9 +21,8 @@ const char kVP8Name[] = "WebM Project VP8"; · 20 unmodified lines
2121
2222 vpx_codec_err_t Decoder::PeekStream(const uint8_t *cxdata, size_t size,
2323 vpx_codec_stream_info_t *stream_info) {
24− return vpx_codec_peek_stream_info(CodecInterface(),
25− cxdata, static_cast<unsigned int>(size),
26− stream_info);
24+ return vpx_codec_peek_stream_info(
25+ CodecInterface(), cxdata, static_cast<unsigned int>(size), stream_info);
2726 }
2827
2928 vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, size_t size) {
@@ -35,9 +34,8 @@ vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, size_t size, · 5 unmodified lines
3534 vpx_codec_err_t res_dec;
3635 InitOnce();
3736 API_REGISTER_STATE_CHECK(
38− res_dec = vpx_codec_decode(&decoder_,
39− cxdata, static_cast<unsigned int>(size),
40− user_priv, 0));
37+ res_dec = vpx_codec_decode(
38+ &decoder_, cxdata, static_cast<unsigned int>(size), user_priv, 0));
4139 return res_dec;
4240 }
4341
@@ -67,7 +65,7 @@ void DecoderTest::HandlePeekResult(Decoder *const decoder, · 23 unmodified lines
6765
6866 void DecoderTest::RunLoop(CompressedVideoSource *video,
6967 const vpx_codec_dec_cfg_t &dec_cfg) {
70− Decoder* const decoder = codec_->CreateDecoder(dec_cfg, flags_, 0);
68+ Decoder *const decoder = codec_->CreateDecoder(dec_cfg, flags_, 0);
7169 ASSERT_TRUE(decoder != NULL);
7270 bool end_of_file = false;
7371
@@ -80,16 +78,14 @@ void DecoderTest::RunLoop(CompressedVideoSource *video, · 6 unmodified lines
8078 stream_info.sz = sizeof(stream_info);
8179
8280 if (video->cxdata() != NULL) {
83− const vpx_codec_err_t res_peek = decoder->PeekStream(video->cxdata(),
84− video->frame_size(),
85− &stream_info);
81+ const vpx_codec_err_t res_peek = decoder->PeekStream(
82+ video->cxdata(), video->frame_size(), &stream_info);
8683 HandlePeekResult(decoder, video, res_peek);
8784 ASSERT_FALSE(::testing::Test::HasFailure());
8885
89− vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(),
90− video->frame_size());
91− if (!HandleDecodeResult(res_dec, *video, decoder))
92− break;
86+ vpx_codec_err_t res_dec =
87+ decoder->DecodeFrame(video->cxdata(), video->frame_size());
88+ if (!HandleDecodeResult(res_dec, *video, decoder)) break;
9389 } else {
9490 // Signal end of the file to the decoder.
9591 const vpx_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0);
@@ -116,8 +112,6 @@ void DecoderTest::set_cfg(const vpx_codec_dec_cfg_t &dec_cfg) { · 20 unmodified lines
116112 memcpy(&cfg_, &dec_cfg, sizeof(cfg_));
117113 }
118114
119−void DecoderTest::set_flags(const vpx_codec_flags_t flags) {
120− flags_ = flags;
121−}
115+void DecoderTest::set_flags(const vpx_codec_flags_t flags) { flags_ = flags; }
122116
123117 } // namespace libvpx_test
test/decode_test_driver.h+30−42
@@ -26,13 +26,11 @@ class DxDataIterator { · 25 unmodified lines
2626 explicit DxDataIterator(vpx_codec_ctx_t *decoder)
2727 : decoder_(decoder), iter_(NULL) {}
2828
29− const vpx_image_t *Next() {
30− return vpx_codec_get_frame(decoder_, &iter_);
31− }
29+ const vpx_image_t *Next() { return vpx_codec_get_frame(decoder_, &iter_); }
3230
3331 private:
34− vpx_codec_ctx_t *decoder_;
35− vpx_codec_iter_t iter_;
32+ vpx_codec_ctx_t *decoder_;
33+ vpx_codec_iter_t iter_;
3634 };
3735
3836 // Provides a simplified interface to manage one video decoding.
@@ -47,13 +45,14 @@ class Decoder { · 8 unmodified lines
4745
4846 Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag,
4947 unsigned long deadline) // NOLINT
50− : cfg_(cfg), flags_(flag), deadline_(deadline), init_done_(false) {
48+ : cfg_(cfg),
49+ flags_(flag),
50+ deadline_(deadline),
51+ init_done_(false) {
5152 memset(&decoder_, 0, sizeof(decoder_));
5253 }
5354
54− virtual ~Decoder() {
55− vpx_codec_destroy(&decoder_);
56− }
55+ virtual ~Decoder() { vpx_codec_destroy(&decoder_); }
5756
5857 vpx_codec_err_t PeekStream(const uint8_t *cxdata, size_t size,
5958 vpx_codec_stream_info_t *stream_info);
@@ -63,17 +62,11 @@ class Decoder { · 3 unmodified lines
6362 vpx_codec_err_t DecodeFrame(const uint8_t *cxdata, size_t size,
6463 void *user_priv);
6564
66− DxDataIterator GetDxData() {
67− return DxDataIterator(&decoder_);
68− }
65+ DxDataIterator GetDxData() { return DxDataIterator(&decoder_); }
6966
70− void set_deadline(unsigned long deadline) {
71− deadline_ = deadline;
72− }
67+ void set_deadline(unsigned long deadline) { deadline_ = deadline; }
7368
74− void Control(int ctrl_id, int arg) {
75− Control(ctrl_id, arg, VPX_CODEC_OK);
76− }
69+ void Control(int ctrl_id, int arg) { Control(ctrl_id, arg, VPX_CODEC_OK); }
7770
7871 void Control(int ctrl_id, const void *arg) {
7972 InitOnce();
@@ -87,7 +80,7 @@ class Decoder { · 7 unmodified lines
8780 ASSERT_EQ(expected_value, res) << DecodeError();
8881 }
8982
90− const char* DecodeError() {
83+ const char *DecodeError() {
9184 const char *detail = vpx_codec_error_detail(&decoder_);
9285 return detail ? detail : vpx_codec_error(&decoder_);
9386 }
@@ -97,38 +90,35 @@ class Decoder { · 3 unmodified lines
9790 vpx_get_frame_buffer_cb_fn_t cb_get,
9891 vpx_release_frame_buffer_cb_fn_t cb_release, void *user_priv) {
9992 InitOnce();
100− return vpx_codec_set_frame_buffer_functions(
101− &decoder_, cb_get, cb_release, user_priv);
93+ return vpx_codec_set_frame_buffer_functions(&decoder_, cb_get, cb_release,
94+ user_priv);
10295 }
10396
104− const char* GetDecoderName() const {
97+ const char *GetDecoderName() const {
10598 return vpx_codec_iface_name(CodecInterface());
10699 }
107100
108101 bool IsVP8() const;
109102
110− vpx_codec_ctx_t * GetDecoder() {
111− return &decoder_;
112− }
103+ vpx_codec_ctx_t *GetDecoder() { return &decoder_; }
113104
114105 protected:
115− virtual vpx_codec_iface_t* CodecInterface() const = 0;
106+ virtual vpx_codec_iface_t *CodecInterface() const = 0;
116107
117108 void InitOnce() {
118109 if (!init_done_) {
119− const vpx_codec_err_t res = vpx_codec_dec_init(&decoder_,
120− CodecInterface(),
121− &cfg_, flags_);
110+ const vpx_codec_err_t res =
111+ vpx_codec_dec_init(&decoder_, CodecInterface(), &cfg_, flags_);
122112 ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError();
123113 init_done_ = true;
124114 }
125115 }
126116
127− vpx_codec_ctx_t decoder_;
117+ vpx_codec_ctx_t decoder_;
128118 vpx_codec_dec_cfg_t cfg_;
129− vpx_codec_flags_t flags_;
130− unsigned int deadline_;
131− bool init_done_;
119+ vpx_codec_flags_t flags_;
120+ unsigned int deadline_;
121+ bool init_done_;
132122 };
133123
134124 // Common test functionality for all Decoder tests.
@@ -143,37 +133,35 @@ class DecoderTest { · 8 unmodified lines
143133 virtual void set_flags(const vpx_codec_flags_t flags);
144134
145135 // Hook to be called before decompressing every frame.
146− virtual void PreDecodeFrameHook(const CompressedVideoSource& /*video*/,
147− Decoder* /*decoder*/) {}
136+ virtual void PreDecodeFrameHook(const CompressedVideoSource & /*video*/,
137+ Decoder * /*decoder*/) {}
148138
149139 // Hook to be called to handle decode result. Return true to continue.
150140 virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
151− const CompressedVideoSource& /*video*/,
141+ const CompressedVideoSource & /*video*/,
152142 Decoder *decoder) {
153143 EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
154144 return VPX_CODEC_OK == res_dec;
155145 }
156146
157147 // Hook to be called on every decompressed frame.
158− virtual void DecompressedFrameHook(const vpx_image_t& /*img*/,
148+ virtual void DecompressedFrameHook(const vpx_image_t & /*img*/,
159149 const unsigned int /*frame_number*/) {}
160150
161151 // Hook to be called on peek result
162− virtual void HandlePeekResult(Decoder* const decoder,
152+ virtual void HandlePeekResult(Decoder *const decoder,
163153 CompressedVideoSource *video,
164154 const vpx_codec_err_t res_peek);
165155
166156 protected:
167157 explicit DecoderTest(const CodecFactory *codec)
168− : codec_(codec),
169− cfg_(),
170− flags_(0) {}
158+ : codec_(codec), cfg_(), flags_(0) {}
171159
172160 virtual ~DecoderTest() {}
173161
174162 const CodecFactory *codec_;
175163 vpx_codec_dec_cfg_t cfg_;
176− vpx_codec_flags_t flags_;
164+ vpx_codec_flags_t flags_;
177165 };
178166
179167 } // namespace libvpx_test
test/encode_api_test.cc+1−1
@@ -27,7 +27,7 @@ TEST(EncodeAPI, InvalidParams) { · 26 unmodified lines
2727 &vpx_codec_vp9_cx_algo,
2828 #endif
2929 };
30− uint8_t buf[1] = {0};
30+ uint8_t buf[1] = { 0 };
3131 vpx_image_t img;
3232 vpx_codec_ctx_t enc;
3333 vpx_codec_enc_cfg_t cfg;
test/encode_perf_test.cc+13−28
@@ -26,10 +26,7 @@ const double kUsecsInSec = 1000000.0; · 25 unmodified lines
2626 struct EncodePerfTestVideo {
2727 EncodePerfTestVideo(const char *name_, uint32_t width_, uint32_t height_,
2828 uint32_t bitrate_, int frames_)
29− : name(name_),
30− width(width_),
31− height(height_),
32− bitrate(bitrate_),
29+ : name(name_), width(width_), height(height_), bitrate(bitrate_),
3330 frames(frames_) {}
3431 const char *name;
3532 uint32_t width;
@@ -45,8 +42,8 @@ const EncodePerfTestVideo kVP9EncodePerfTestVectors[] = { · 9 unmodified lines
4542 EncodePerfTestVideo("macmarcostationary_640_480_30.yuv", 640, 480, 200, 718),
4643 EncodePerfTestVideo("niklas_640_480_30.yuv", 640, 480, 200, 471),
4744 EncodePerfTestVideo("tacomanarrows_640_480_30.yuv", 640, 480, 200, 300),
48− EncodePerfTestVideo("tacomasmallcameramovement_640_480_30.yuv",
49− 640, 480, 200, 300),
45+ EncodePerfTestVideo("tacomasmallcameramovement_640_480_30.yuv", 640, 480, 200,
46+ 300),
5047 EncodePerfTestVideo("thaloundeskmtg_640_480_30.yuv", 640, 480, 200, 300),
5148 EncodePerfTestVideo("niklas_1280_720_30.yuv", 1280, 720, 600, 470),
5249 };
@@ -61,12 +58,8 @@ class VP9EncodePerfTest · 8 unmodified lines
6158 public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
6259 protected:
6360 VP9EncodePerfTest()
64− : EncoderTest(GET_PARAM(0)),
65− min_psnr_(kMaxPsnr),
66− nframes_(0),
67− encoding_mode_(GET_PARAM(1)),
68− speed_(0),
69− threads_(1) {}
61+ : EncoderTest(GET_PARAM(0)), min_psnr_(kMaxPsnr), nframes_(0),
62+ encoding_mode_(GET_PARAM(1)), speed_(0), threads_(1) {}
7063
7164 virtual ~VP9EncodePerfTest() {}
7265
@@ -107,24 +100,18 @@ class VP9EncodePerfTest · 34 unmodified lines
107100
108101 virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
109102 if (pkt->data.psnr.psnr[0] < min_psnr_) {
110− min_psnr_= pkt->data.psnr.psnr[0];
103+ min_psnr_ = pkt->data.psnr.psnr[0];
111104 }
112105 }
113106
114107 // for performance reasons don't decode
115108 virtual bool DoDecode() { return 0; }
116109
117− double min_psnr() const {
118− return min_psnr_;
119− }
110+ double min_psnr() const { return min_psnr_; }
120111
121− void set_speed(unsigned int speed) {
122− speed_ = speed;
123− }
112+ void set_speed(unsigned int speed) { speed_ = speed; }
124113
125− void set_threads(unsigned int threads) {
126− threads_ = threads;
127− }
114+ void set_threads(unsigned int threads) { threads_ = threads; }
128115
129116 private:
130117 double min_psnr_;
@@ -157,10 +144,8 @@ TEST_P(VP9EncodePerfTest, PerfTest) { · 26 unmodified lines
157144 const unsigned frames = kVP9EncodePerfTestVectors[i].frames;
158145 const char *video_name = kVP9EncodePerfTestVectors[i].name;
159146 libvpx_test::I420VideoSource video(
160− video_name,
161− kVP9EncodePerfTestVectors[i].width,
162− kVP9EncodePerfTestVectors[i].height,
163− timebase.den, timebase.num, 0,
147+ video_name, kVP9EncodePerfTestVectors[i].width,
148+ kVP9EncodePerfTestVectors[i].height, timebase.den, timebase.num, 0,
164149 kVP9EncodePerfTestVectors[i].frames);
165150 set_speed(kEncodePerfTestSpeeds[j]);
166151
@@ -197,6 +182,6 @@ TEST_P(VP9EncodePerfTest, PerfTest) { · 30 unmodified lines
197182 }
198183 }
199184
200−VP9_INSTANTIATE_TEST_CASE(
201− VP9EncodePerfTest, ::testing::Values(::libvpx_test::kRealTime));
185+VP9_INSTANTIATE_TEST_CASE(VP9EncodePerfTest,
186+ ::testing::Values(::libvpx_test::kRealTime));
202187 } // namespace
test/encode_test_driver.cc+34−51
@@ -30,8 +30,7 @@ void Encoder::InitEncoder(VideoSource *video) { · 29 unmodified lines
3030 cfg_.g_timebase = video->timebase();
3131 cfg_.rc_twopass_stats_in = stats_->buf();
3232
33− res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_,
34− init_flags_);
33+ res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_, init_flags_);
3534 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
3635
3736 #if CONFIG_VP9_ENCODER
@@ -62,8 +61,7 @@ void Encoder::EncodeFrame(VideoSource *video, const unsigned long frame_flags) { · 24 unmodified lines
6261 CxDataIterator iter = GetCxData();
6362
6463 while (const vpx_codec_cx_pkt_t *pkt = iter.Next()) {
65− if (pkt->kind != VPX_CODEC_STATS_PKT)
66− continue;
64+ if (pkt->kind != VPX_CODEC_STATS_PKT) continue;
6765
6866 stats_->Append(*pkt);
6967 }
@@ -83,15 +81,15 @@ void Encoder::EncodeFrameInternal(const VideoSource &video, · 13 unmodified lines
8381 }
8482
8583 // Encode the frame
86− API_REGISTER_STATE_CHECK(
87− res = vpx_codec_encode(&encoder_, img, video.pts(), video.duration(),
88− frame_flags, deadline_));
84+ API_REGISTER_STATE_CHECK(res = vpx_codec_encode(&encoder_, img, video.pts(),
85+ video.duration(), frame_flags,
86+ deadline_));
8987 ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
9088 }
9189
9290 void Encoder::Flush() {
93− const vpx_codec_err_t res = vpx_codec_encode(&encoder_, NULL, 0, 0, 0,
94− deadline_);
91+ const vpx_codec_err_t res =
92+ vpx_codec_encode(&encoder_, NULL, 0, 0, 0, deadline_);
9593 if (!encoder_.priv)
9694 ASSERT_EQ(VPX_CODEC_ERROR, res) << EncoderError();
9795 else
@@ -106,22 +104,15 @@ void EncoderTest::InitializeConfig() { · 8 unmodified lines
106104
107105 void EncoderTest::SetMode(TestMode mode) {
108106 switch (mode) {
109− case kRealTime:
110− deadline_ = VPX_DL_REALTIME;
111− break;
107+ case kRealTime: deadline_ = VPX_DL_REALTIME; break;
112108
113109 case kOnePassGood:
114− case kTwoPassGood:
115− deadline_ = VPX_DL_GOOD_QUALITY;
116− break;
110+ case kTwoPassGood: deadline_ = VPX_DL_GOOD_QUALITY; break;
117111
118112 case kOnePassBest:
119− case kTwoPassBest:
120− deadline_ = VPX_DL_BEST_QUALITY;
121− break;
113+ case kTwoPassBest: deadline_ = VPX_DL_BEST_QUALITY; break;
122114
123− default:
124− ASSERT_TRUE(false) << "Unexpected mode " << mode;
115+ default: ASSERT_TRUE(false) << "Unexpected mode " << mode;
125116 }
126117
127118 if (mode == kTwoPassGood || mode == kTwoPassBest)
@@ -131,35 +122,35 @@ void EncoderTest::SetMode(TestMode mode) { · 3 unmodified lines
131122 }
132123 // The function should return "true" most of the time, therefore no early
133124 // break-out is implemented within the match checking process.
134−static bool compare_img(const vpx_image_t *img1,
135− const vpx_image_t *img2) {
136− bool match = (img1->fmt == img2->fmt) &&
137− (img1->cs == img2->cs) &&
138− (img1->d_w == img2->d_w) &&
139− (img1->d_h == img2->d_h);
140−
141− const unsigned int width_y = img1->d_w;
125+static bool compare_img(const vpx_image_t *img1, const vpx_image_t *img2) {
126+ bool match = (img1->fmt == img2->fmt) && (img1->cs == img2->cs) &&
127+ (img1->d_w == img2->d_w) && (img1->d_h == img2->d_h);
128+
129+ const unsigned int width_y = img1->d_w;
142130 const unsigned int height_y = img1->d_h;
143131 unsigned int i;
144132 for (i = 0; i < height_y; ++i)
145133 match = (memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y],
146134 img2->planes[VPX_PLANE_Y] + i * img2->stride[VPX_PLANE_Y],
147− width_y) == 0) && match;
148− const unsigned int width_uv = (img1->d_w + 1) >> 1;
135+ width_y) == 0) &&
136+ match;
137+ const unsigned int width_uv = (img1->d_w + 1) >> 1;
149138 const unsigned int height_uv = (img1->d_h + 1) >> 1;
150− for (i = 0; i < height_uv; ++i)
139+ for (i = 0; i < height_uv; ++i)
151140 match = (memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U],
152141 img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U],
153− width_uv) == 0) && match;
142+ width_uv) == 0) &&
143+ match;
154144 for (i = 0; i < height_uv; ++i)
155145 match = (memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V],
156146 img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V],
157− width_uv) == 0) && match;
147+ width_uv) == 0) &&
148+ match;
158149 return match;
159150 }
160151
161−void EncoderTest::MismatchHook(const vpx_image_t* /*img1*/,
162− const vpx_image_t* /*img2*/) {
152+void EncoderTest::MismatchHook(const vpx_image_t * /*img1*/,
153+ const vpx_image_t * /*img2*/) {
163154 ASSERT_TRUE(0) << "Encode/Decode mismatch found";
164155 }
165156
@@ -215,10 +206,9 @@ void EncoderTest::RunLoop(VideoSource *video) { · 49 unmodified lines
215206 has_cxdata = true;
216207 if (decoder.get() != NULL && DoDecode()) {
217208 vpx_codec_err_t res_dec = decoder->DecodeFrame(
218− (const uint8_t*)pkt->data.frame.buf, pkt->data.frame.sz);
209+ (const uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz);
219210
220− if (!HandleDecodeResult(res_dec, *video, decoder.get()))
221− break;
211+ if (!HandleDecodeResult(res_dec, *video, decoder.get())) break;
222212
223213 has_dxdata = true;
224214 }
@@ -227,20 +217,16 @@ void EncoderTest::RunLoop(VideoSource *video) { · 2 unmodified lines
227217 FramePktHook(pkt);
228218 break;
229219
230− case VPX_CODEC_PSNR_PKT:
231− PSNRPktHook(pkt);
232− break;
220+ case VPX_CODEC_PSNR_PKT: PSNRPktHook(pkt); break;
233221
234− default:
235− break;
222+ default: break;
236223 }
237224 }
238225
239226 // Flush the decoder when there are no more fragments.
240227 if ((init_flags_ & VPX_CODEC_USE_OUTPUT_PARTITION) && has_dxdata) {
241228 const vpx_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0);
242− if (!HandleDecodeResult(res_dec, *video, decoder.get()))
243− break;
229+ if (!HandleDecodeResult(res_dec, *video, decoder.get())) break;
244230 }
245231
246232 if (has_dxdata && has_cxdata) {
@@ -253,17 +239,14 @@ void EncoderTest::RunLoop(VideoSource *video) { · 6 unmodified lines
253239 MismatchHook(img_enc, img_dec);
254240 }
255241 }
256− if (img_dec)
257− DecompressedFrameHook(*img_dec, video->pts());
242+ if (img_dec) DecompressedFrameHook(*img_dec, video->pts());
258243 }
259− if (!Continue())
260− break;
244+ if (!Continue()) break;
261245 }
262246
263247 EndPassHook();
264248
265− if (!Continue())
266− break;
249+ if (!Continue()) break;
267250 }
268251 }
269252
test/encode_test_driver.h+41−55
@@ -33,19 +33,17 @@ enum TestMode { · 32 unmodified lines
3333 kTwoPassGood,
3434 kTwoPassBest
3535 };
36−#define ALL_TEST_MODES ::testing::Values(::libvpx_test::kRealTime, \
37− ::libvpx_test::kOnePassGood, \
38− ::libvpx_test::kOnePassBest, \
39− ::libvpx_test::kTwoPassGood, \
40− ::libvpx_test::kTwoPassBest)
36+#define ALL_TEST_MODES \
37+ ::testing::Values(::libvpx_test::kRealTime, ::libvpx_test::kOnePassGood, \
38+ ::libvpx_test::kOnePassBest, ::libvpx_test::kTwoPassGood, \
39+ ::libvpx_test::kTwoPassBest)
4140
42−#define ONE_PASS_TEST_MODES ::testing::Values(::libvpx_test::kRealTime, \
43− ::libvpx_test::kOnePassGood, \
44− ::libvpx_test::kOnePassBest)
45−
46−#define TWO_PASS_TEST_MODES ::testing::Values(::libvpx_test::kTwoPassGood, \
47− ::libvpx_test::kTwoPassBest)
41+#define ONE_PASS_TEST_MODES \
42+ ::testing::Values(::libvpx_test::kRealTime, ::libvpx_test::kOnePassGood, \
43+ ::libvpx_test::kOnePassBest)
4844
45+#define TWO_PASS_TEST_MODES \
46+ ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kTwoPassBest)
4947
5048 // Provides an object to handle the libvpx get_cx_data() iteration pattern
5149 class CxDataIterator {
@@ -58,8 +56,8 @@ class CxDataIterator { · 6 unmodified lines
5856 }
5957
6058 private:
61− vpx_codec_ctx_t *encoder_;
62− vpx_codec_iter_t iter_;
59+ vpx_codec_ctx_t *encoder_;
60+ vpx_codec_iter_t iter_;
6361 };
6462
6563 // Implements an in-memory store for libvpx twopass statistics
@@ -75,15 +73,12 @@ class TwopassStatsStore { · 9 unmodified lines
7573 return buf;
7674 }
7775
78− void Reset() {
79− buffer_.clear();
80− }
76+ void Reset() { buffer_.clear(); }
8177
8278 protected:
83− std::string buffer_;
79+ std::string buffer_;
8480 };
8581
86−
8782 // Provides a simplified interface to manage one video encoding pass, given
8883 // a configuration and video source.
8984 //
@@ -97,13 +92,9 @@ class Encoder { · 7 unmodified lines
9792 memset(&encoder_, 0, sizeof(encoder_));
9893 }
9994
100− virtual ~Encoder() {
101− vpx_codec_destroy(&encoder_);
102− }
95+ virtual ~Encoder() { vpx_codec_destroy(&encoder_); }
10396
104− CxDataIterator GetCxData() {
105− return CxDataIterator(&encoder_);
106− }
97+ CxDataIterator GetCxData() { return CxDataIterator(&encoder_); }
10798
10899 void InitEncoder(VideoSource *video);
109100
@@ -115,9 +106,7 @@ class Encoder { · 5 unmodified lines
115106 void EncodeFrame(VideoSource *video, const unsigned long frame_flags);
116107
117108 // Convenience wrapper for EncodeFrame()
118− void EncodeFrame(VideoSource *video) {
119− EncodeFrame(video, 0);
120− }
109+ void EncodeFrame(VideoSource *video) { EncodeFrame(video, 0); }
121110
122111 void Control(int ctrl_id, int arg) {
123112 const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
@@ -156,12 +145,10 @@ class Encoder { · 32 unmodified lines
156145 cfg_ = *cfg;
157146 }
158147
159− void set_deadline(unsigned long deadline) {
160− deadline_ = deadline;
161− }
148+ void set_deadline(unsigned long deadline) { deadline_ = deadline; }
162149
163150 protected:
164− virtual vpx_codec_iface_t* CodecInterface() const = 0;
151+ virtual vpx_codec_iface_t *CodecInterface() const = 0;
165152
166153 const char *EncoderError() {
167154 const char *detail = vpx_codec_error_detail(&encoder_);
@@ -175,11 +162,11 @@ class Encoder { · 7 unmodified lines
175162 // Flush the encoder on EOS
176163 void Flush();
177164
178− vpx_codec_ctx_t encoder_;
179− vpx_codec_enc_cfg_t cfg_;
180− unsigned long deadline_;
181− unsigned long init_flags_;
182− TwopassStatsStore *stats_;
165+ vpx_codec_ctx_t encoder_;
166+ vpx_codec_enc_cfg_t cfg_;
167+ unsigned long deadline_;
168+ unsigned long init_flags_;
169+ TwopassStatsStore *stats_;
183170 };
184171
185172 // Common test functionality for all Encoder tests.
@@ -221,36 +208,35 @@ class EncoderTest { · 35 unmodified lines
221208 virtual void EndPassHook() {}
222209
223210 // Hook to be called before encoding a frame.
224− virtual void PreEncodeFrameHook(VideoSource* /*video*/) {}
225− virtual void PreEncodeFrameHook(VideoSource* /*video*/,
226− Encoder* /*encoder*/) {}
211+ virtual void PreEncodeFrameHook(VideoSource * /*video*/) {}
212+ virtual void PreEncodeFrameHook(VideoSource * /*video*/,
213+ Encoder * /*encoder*/) {}
227214
228215 // Hook to be called on every compressed data packet.
229− virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {}
216+ virtual void FramePktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {}
230217
231218 // Hook to be called on every PSNR packet.
232− virtual void PSNRPktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {}
219+ virtual void PSNRPktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {}
233220
234221 // Hook to determine whether the encode loop should continue.
235222 virtual bool Continue() const {
236223 return !(::testing::Test::HasFatalFailure() || abort_);
237224 }
238225
239− const CodecFactory *codec_;
226+ const CodecFactory *codec_;
240227 // Hook to determine whether to decode frame after encoding
241228 virtual bool DoDecode() const { return 1; }
242229
243230 // Hook to handle encode/decode mismatch
244− virtual void MismatchHook(const vpx_image_t *img1,
245− const vpx_image_t *img2);
231+ virtual void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2);
246232
247233 // Hook to be called on every decompressed frame.
248− virtual void DecompressedFrameHook(const vpx_image_t& /*img*/,
234+ virtual void DecompressedFrameHook(const vpx_image_t & /*img*/,
249235 vpx_codec_pts_t /*pts*/) {}
250236
251237 // Hook to be called to handle decode result. Return true to continue.
252238 virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
253− const VideoSource& /*video*/,
239+ const VideoSource & /*video*/,
254240 Decoder *decoder) {
255241 EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
256242 return VPX_CODEC_OK == res_dec;
@@ -262,15 +248,15 @@ class EncoderTest { · 5 unmodified lines
262248 return pkt;
263249 }
264250
265− bool abort_;
266− vpx_codec_enc_cfg_t cfg_;
267− vpx_codec_dec_cfg_t dec_cfg_;
268− unsigned int passes_;
269− unsigned long deadline_;
270− TwopassStatsStore stats_;
271− unsigned long init_flags_;
272− unsigned long frame_flags_;
273− vpx_codec_pts_t last_pts_;
251+ bool abort_;
252+ vpx_codec_enc_cfg_t cfg_;
253+ vpx_codec_dec_cfg_t dec_cfg_;
254+ unsigned int passes_;
255+ unsigned long deadline_;
256+ TwopassStatsStore stats_;
257+ unsigned long init_flags_;
258+ unsigned long frame_flags_;
259+ vpx_codec_pts_t last_pts_;
274260 };
275261
276262 } // namespace libvpx_test
test/error_resilience_test.cc+95−115
@@ -19,16 +19,13 @@ namespace { · 18 unmodified lines
1919 const int kMaxErrorFrames = 12;
2020 const int kMaxDroppableFrames = 12;
2121
22−class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
23− public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, bool> {
22+class ErrorResilienceTestLarge
23+ : public ::libvpx_test::EncoderTest,
24+ public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, bool> {
2425 protected:
2526 ErrorResilienceTestLarge()
26− : EncoderTest(GET_PARAM(0)),
27− svc_support_(GET_PARAM(2)),
28− psnr_(0.0),
29− nframes_(0),
30− mismatch_psnr_(0.0),
31− mismatch_nframes_(0),
27+ : EncoderTest(GET_PARAM(0)), svc_support_(GET_PARAM(2)), psnr_(0.0),
28+ nframes_(0), mismatch_psnr_(0.0), mismatch_nframes_(0),
3229 encoding_mode_(GET_PARAM(1)) {
3330 Reset();
3431 }
@@ -66,81 +63,70 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest, · 31 unmodified lines
6663 // LAST is updated on base/layer 0, GOLDEN updated on layer 1.
6764 // Non-zero pattern_switch parameter means pattern will switch to
6865 // not using LAST for frame_num >= pattern_switch.
69− int SetFrameFlags(int frame_num,
70− int num_temp_layers,
71− int pattern_switch) {
66+ int SetFrameFlags(int frame_num, int num_temp_layers, int pattern_switch) {
7267 int frame_flags = 0;
7368 if (num_temp_layers == 2) {
74− if (frame_num % 2 == 0) {
75− if (frame_num < pattern_switch || pattern_switch == 0) {
76− // Layer 0: predict from LAST and ARF, update LAST.
77− frame_flags = VP8_EFLAG_NO_REF_GF |
78− VP8_EFLAG_NO_UPD_GF |
79− VP8_EFLAG_NO_UPD_ARF;
80− } else {
81− // Layer 0: predict from GF and ARF, update GF.
82− frame_flags = VP8_EFLAG_NO_REF_LAST |
83− VP8_EFLAG_NO_UPD_LAST |
84− VP8_EFLAG_NO_UPD_ARF;
85− }
69+ if (frame_num % 2 == 0) {
70+ if (frame_num < pattern_switch || pattern_switch == 0) {
71+ // Layer 0: predict from LAST and ARF, update LAST.
72+ frame_flags =
73+ VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
8674 } else {
87− if (frame_num < pattern_switch || pattern_switch == 0) {
88− // Layer 1: predict from L, GF, and ARF, update GF.
89− frame_flags = VP8_EFLAG_NO_UPD_ARF |
90− VP8_EFLAG_NO_UPD_LAST;
91− } else {
92− // Layer 1: predict from GF and ARF, update GF.
93− frame_flags = VP8_EFLAG_NO_REF_LAST |
94− VP8_EFLAG_NO_UPD_LAST |
95− VP8_EFLAG_NO_UPD_ARF;
96− }
75+ // Layer 0: predict from GF and ARF, update GF.
76+ frame_flags = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_UPD_LAST |
77+ VP8_EFLAG_NO_UPD_ARF;
78+ }
79+ } else {
80+ if (frame_num < pattern_switch || pattern_switch == 0) {
81+ // Layer 1: predict from L, GF, and ARF, update GF.
82+ frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
83+ } else {
84+ // Layer 1: predict from GF and ARF, update GF.
85+ frame_flags = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_UPD_LAST |
86+ VP8_EFLAG_NO_UPD_ARF;
9787 }
88+ }
9889 }
9990 return frame_flags;
10091 }
10192
10293 virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
10394 ::libvpx_test::Encoder * /*encoder*/) {
104− frame_flags_ &= ~(VP8_EFLAG_NO_UPD_LAST |
105− VP8_EFLAG_NO_UPD_GF |
106− VP8_EFLAG_NO_UPD_ARF);
95+ frame_flags_ &=
96+ ~(VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF);
10797 // For temporal layer case.
10898 if (cfg_.ts_number_layers > 1) {
109− frame_flags_ = SetFrameFlags(video->frame(),
110− cfg_.ts_number_layers,
111− pattern_switch_);
99+ frame_flags_ =
100+ SetFrameFlags(video->frame(), cfg_.ts_number_layers, pattern_switch_);
112101 for (unsigned int i = 0; i < droppable_nframes_; ++i) {
113102 if (droppable_frames_[i] == video->frame()) {
114− std::cout << "Encoding droppable frame: "
115− << droppable_frames_[i] << "\n";
103+ std::cout << "Encoding droppable frame: " << droppable_frames_[i]
104+ << "\n";
116105 }
117106 }
118107 } else {
119− if (droppable_nframes_ > 0 &&
120− (cfg_.g_pass == VPX_RC_LAST_PASS || cfg_.g_pass == VPX_RC_ONE_PASS)) {
121− for (unsigned int i = 0; i < droppable_nframes_; ++i) {
122− if (droppable_frames_[i] == video->frame()) {
123− std::cout << "Encoding droppable frame: "
124− << droppable_frames_[i] << "\n";
125− frame_flags_ |= (VP8_EFLAG_NO_UPD_LAST |
126− VP8_EFLAG_NO_UPD_GF |
127− VP8_EFLAG_NO_UPD_ARF);
128− return;
129− }
130− }
131− }
108+ if (droppable_nframes_ > 0 &&
109+ (cfg_.g_pass == VPX_RC_LAST_PASS || cfg_.g_pass == VPX_RC_ONE_PASS)) {
110+ for (unsigned int i = 0; i < droppable_nframes_; ++i) {
111+ if (droppable_frames_[i] == video->frame()) {
112+ std::cout << "Encoding droppable frame: " << droppable_frames_[i]
113+ << "\n";
114+ frame_flags_ |= (VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
115+ VP8_EFLAG_NO_UPD_ARF);
116+ return;
117+ }
118+ }
119+ }
132120 }
133121 }
134122
135123 double GetAveragePsnr() const {
136− if (nframes_)
137− return psnr_ / nframes_;
124+ if (nframes_) return psnr_ / nframes_;
138125 return 0.0;
139126 }
140127
141128 double GetAverageMismatchPsnr() const {
142− if (mismatch_nframes_)
143− return mismatch_psnr_ / mismatch_nframes_;
129+ if (mismatch_nframes_) return mismatch_psnr_ / mismatch_nframes_;
144130 return 0.0;
145131 }
146132
@@ -158,8 +144,7 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest, · 11 unmodified lines
158144 return 1;
159145 }
160146
161− virtual void MismatchHook(const vpx_image_t *img1,
162− const vpx_image_t *img2) {
147+ virtual void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2) {
163148 double mismatch_psnr = compute_psnr(img1, img2);
164149 mismatch_psnr_ += mismatch_psnr;
165150 ++mismatch_nframes_;
@@ -186,13 +171,9 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest, · 20 unmodified lines
186171 droppable_frames_[i] = list[i];
187172 }
188173
189− unsigned int GetMismatchFrames() {
190− return mismatch_nframes_;
191− }
174+ unsigned int GetMismatchFrames() { return mismatch_nframes_; }
192175
193− void SetPatternSwitch(int frame_switch) {
194− pattern_switch_ = frame_switch;
195− }
176+ void SetPatternSwitch(int frame_switch) { pattern_switch_ = frame_switch; }
196177
197178 bool svc_support_;
198179
@@ -265,15 +246,14 @@ TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) { · 66 unmodified lines
265246 // In addition to isolated loss/drop, add a long consecutive series
266247 // (of size 9) of dropped frames.
267248 unsigned int num_droppable_frames = 11;
268− unsigned int droppable_frame_list[] = {5, 16, 22, 23, 24, 25, 26, 27, 28,
269− 29, 30};
249+ unsigned int droppable_frame_list[] = { 5, 16, 22, 23, 24, 25,
250+ 26, 27, 28, 29, 30 };
270251 SetDroppableFrames(num_droppable_frames, droppable_frame_list);
271252 SetErrorFrames(num_droppable_frames, droppable_frame_list);
272253 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
273254 // Test that no mismatches have been found
274− std::cout << " Mismatch frames: "
275− << GetMismatchFrames() << "\n";
276− EXPECT_EQ(GetMismatchFrames(), (unsigned int) 0);
255+ std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
256+ EXPECT_EQ(GetMismatchFrames(), (unsigned int)0);
277257
278258 // Reset previously set of error/droppable frames.
279259 Reset();
@@ -306,8 +286,7 @@ TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) { · 26 unmodified lines
306286 // layer, so successful decoding is expected.
307287 TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) {
308288 // This test doesn't run if SVC is not supported.
309− if (!svc_support_)
310− return;
289+ if (!svc_support_) return;
311290
312291 const vpx_rational timebase = { 33333333, 1000000000 };
313292 cfg_.g_timebase = timebase;
@@ -337,14 +316,13 @@ TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) { · 23 unmodified lines
337316 // The odd frames are the enhancement layer for 2 layer pattern, so set
338317 // those frames as droppable. Drop the last 7 frames.
339318 unsigned int num_droppable_frames = 7;
340− unsigned int droppable_frame_list[] = {27, 29, 31, 33, 35, 37, 39};
319+ unsigned int droppable_frame_list[] = { 27, 29, 31, 33, 35, 37, 39 };
341320 SetDroppableFrames(num_droppable_frames, droppable_frame_list);
342321 SetErrorFrames(num_droppable_frames, droppable_frame_list);
343322 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
344323 // Test that no mismatches have been found
345− std::cout << " Mismatch frames: "
346− << GetMismatchFrames() << "\n";
347− EXPECT_EQ(GetMismatchFrames(), (unsigned int) 0);
324+ std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
325+ EXPECT_EQ(GetMismatchFrames(), (unsigned int)0);
348326
349327 // Reset previously set of error/droppable frames.
350328 Reset();
@@ -355,8 +333,7 @@ TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) { · 4 unmodified lines
355333 // sequence, the LAST ref is not used anymore.
356334 TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) {
357335 // This test doesn't run if SVC is not supported.
358− if (!svc_support_)
359− return;
336+ if (!svc_support_) return;
360337
361338 const vpx_rational timebase = { 33333333, 1000000000 };
362339 cfg_.g_timebase = timebase;
@@ -385,20 +362,19 @@ TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) { · 22 unmodified lines
385362
386363 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
387364 // Test that no mismatches have been found
388− std::cout << " Mismatch frames: "
389− << GetMismatchFrames() << "\n";
390− EXPECT_EQ(GetMismatchFrames(), (unsigned int) 0);
365+ std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
366+ EXPECT_EQ(GetMismatchFrames(), (unsigned int)0);
391367
392368 // Reset previously set of error/droppable frames.
393369 Reset();
394370 }
395371
396−class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest,
397− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
372+class ErrorResilienceTestLargeCodecControls
373+ : public ::libvpx_test::EncoderTest,
374+ public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
398375 protected:
399376 ErrorResilienceTestLargeCodecControls()
400− : EncoderTest(GET_PARAM(0)),
401− encoding_mode_(GET_PARAM(1)) {
377+ : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)) {
402378 Reset();
403379 }
404380
@@ -437,8 +413,8 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 32 unmodified lines
437413 if (num_temp_layers == 2) {
438414 if (frame_num % 2 == 0) {
439415 // Layer 0: predict from L and ARF, update L.
440− frame_flags = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
441− VP8_EFLAG_NO_UPD_ARF;
416+ frame_flags =
417+ VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
442418 } else {
443419 // Layer 1: predict from L, G and ARF, and update G.
444420 frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
@@ -451,9 +427,9 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 6 unmodified lines
451427 VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF;
452428 } else if ((frame_num - 2) % 4 == 0) {
453429 // Layer 1: predict from L, G, update G.
454− frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
455− VP8_EFLAG_NO_REF_ARF;
456− } else if ((frame_num - 1) % 2 == 0) {
430+ frame_flags =
431+ VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_REF_ARF;
432+ } else if ((frame_num - 1) % 2 == 0) {
457433 // Layer 2: predict from L, G, ARF; update ARG.
458434 frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_LAST;
459435 }
@@ -467,7 +443,7 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 7 unmodified lines
467443 if (frame_num % 2 == 0) {
468444 layer_id = 0;
469445 } else {
470− layer_id = 1;
446+ layer_id = 1;
471447 }
472448 } else if (num_temp_layers == 3) {
473449 if (frame_num % 4 == 0) {
@@ -484,16 +460,16 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 10 unmodified lines
484460 virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
485461 libvpx_test::Encoder *encoder) {
486462 if (cfg_.ts_number_layers > 1) {
487− int layer_id = SetLayerId(video->frame(), cfg_.ts_number_layers);
488− int frame_flags = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
489− if (video->frame() > 0) {
490− encoder->Control(VP8E_SET_TEMPORAL_LAYER_ID, layer_id);
491− encoder->Control(VP8E_SET_FRAME_FLAGS, frame_flags);
492− }
493− const vpx_rational_t tb = video->timebase();
494− timebase_ = static_cast<double>(tb.num) / tb.den;
495− duration_ = 0;
496− return;
463+ int layer_id = SetLayerId(video->frame(), cfg_.ts_number_layers);
464+ int frame_flags = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
465+ if (video->frame() > 0) {
466+ encoder->Control(VP8E_SET_TEMPORAL_LAYER_ID, layer_id);
467+ encoder->Control(VP8E_SET_FRAME_FLAGS, frame_flags);
468+ }
469+ const vpx_rational_t tb = video->timebase();
470+ timebase_ = static_cast<double>(tb.num) / tb.den;
471+ duration_ = 0;
472+ return;
497473 }
498474 }
499475
@@ -519,26 +495,28 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 19 unmodified lines
519495
520496 virtual void EndPassHook(void) {
521497 duration_ = (last_pts_ + 1) * timebase_;
522− if (cfg_.ts_number_layers > 1) {
498+ if (cfg_.ts_number_layers > 1) {
523499 for (int layer = 0; layer < static_cast<int>(cfg_.ts_number_layers);
524− ++layer) {
500+ ++layer) {
525501 if (bits_total_[layer]) {
526502 // Effective file datarate:
527− effective_datarate_[layer] = (bits_total_[layer] / 1000.0) / duration_;
503+ effective_datarate_[layer] =
504+ (bits_total_[layer] / 1000.0) / duration_;
528505 }
529506 }
530507 }
531508 }
532509
533510 double effective_datarate_[3];
534− private:
535− libvpx_test::TestMode encoding_mode_;
536− vpx_codec_pts_t last_pts_;
537− double timebase_;
538− int64_t bits_total_[3];
539− double duration_;
540− int tot_frame_number_;
541− };
511+
512+ private:
513+ libvpx_test::TestMode encoding_mode_;
514+ vpx_codec_pts_t last_pts_;
515+ double timebase_;
516+ int64_t bits_total_[3];
517+ double duration_;
518+ int tot_frame_number_;
519+};
542520
543521 // Check two codec controls used for:
544522 // (1) for setting temporal layer id, and (2) for settings encoder flags.
@@ -582,10 +560,12 @@ TEST_P(ErrorResilienceTestLargeCodecControls, CodecControl3TemporalLayers) { · 37 unmodified lines
582560 for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
583561 ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.75)
584562 << " The datarate for the file is lower than target by too much, "
585− "for layer: " << j;
563+ "for layer: "
564+ << j;
586565 ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.25)
587566 << " The datarate for the file is greater than target by too much, "
588− "for layer: " << j;
567+ "for layer: "
568+ << j;
589569 }
590570 }
591571 }
test/external_frame_buffer_test.cc+47−62
@@ -34,21 +34,18 @@ struct ExternalFrameBuffer { · 33 unmodified lines
3434 // Class to manipulate a list of external frame buffers.
3535 class ExternalFrameBufferList {
3636 public:
37− ExternalFrameBufferList()
38− : num_buffers_(0),
39− ext_fb_list_(NULL) {}
37+ ExternalFrameBufferList() : num_buffers_(0), ext_fb_list_(NULL) {}
4038
4139 virtual ~ExternalFrameBufferList() {
4240 for (int i = 0; i < num_buffers_; ++i) {
43− delete [] ext_fb_list_[i].data;
41+ delete[] ext_fb_list_[i].data;
4442 }
45− delete [] ext_fb_list_;
43+ delete[] ext_fb_list_;
4644 }
4745
4846 // Creates the list to hold the external buffers. Returns true on success.
4947 bool CreateBufferList(int num_buffers) {
50− if (num_buffers < 0)
51− return false;
48+ if (num_buffers < 0) return false;
5249
5350 num_buffers_ = num_buffers;
5451 ext_fb_list_ = new ExternalFrameBuffer[num_buffers_];
@@ -64,11 +61,10 @@ class ExternalFrameBufferList { · 9 unmodified lines
6461 int GetFreeFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
6562 EXPECT_TRUE(fb != NULL);
6663 const int idx = FindFreeBufferIndex();
67− if (idx == num_buffers_)
68− return -1;
64+ if (idx == num_buffers_) return -1;
6965
7066 if (ext_fb_list_[idx].size < min_size) {
71− delete [] ext_fb_list_[idx].data;
67+ delete[] ext_fb_list_[idx].data;
7268 ext_fb_list_[idx].data = new uint8_t[min_size];
7369 memset(ext_fb_list_[idx].data, 0, min_size);
7470 ext_fb_list_[idx].size = min_size;
@@ -83,11 +79,10 @@ class ExternalFrameBufferList { · 8 unmodified lines
8379 int GetZeroFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
8480 EXPECT_TRUE(fb != NULL);
8581 const int idx = FindFreeBufferIndex();
86− if (idx == num_buffers_)
87− return -1;
82+ if (idx == num_buffers_) return -1;
8883
8984 if (ext_fb_list_[idx].size < min_size) {
90− delete [] ext_fb_list_[idx].data;
85+ delete[] ext_fb_list_[idx].data;
9186 ext_fb_list_[idx].data = NULL;
9287 ext_fb_list_[idx].size = min_size;
9388 }
@@ -104,7 +99,7 @@ class ExternalFrameBufferList { · 10 unmodified lines
10499 return -1;
105100 }
106101 ExternalFrameBuffer *const ext_fb =
107− reinterpret_cast<ExternalFrameBuffer*>(fb->priv);
102+ reinterpret_cast<ExternalFrameBuffer *>(fb->priv);
108103 if (ext_fb == NULL) {
109104 EXPECT_TRUE(ext_fb != NULL);
110105 return -1;
@@ -119,7 +114,7 @@ class ExternalFrameBufferList { · 8 unmodified lines
119114 void CheckXImageFrameBuffer(const vpx_image_t *img) {
120115 if (img->fb_priv != NULL) {
121116 const struct ExternalFrameBuffer *const ext_fb =
122− reinterpret_cast<ExternalFrameBuffer*>(img->fb_priv);
117+ reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv);
123118
124119 ASSERT_TRUE(img->planes[0] >= ext_fb->data &&
125120 img->planes[0] < (ext_fb->data + ext_fb->size));
@@ -133,8 +128,7 @@ class ExternalFrameBufferList { · 7 unmodified lines
133128 int i;
134129 // Find a free frame buffer.
135130 for (i = 0; i < num_buffers_; ++i) {
136− if (!ext_fb_list_[i].in_use)
137− break;
131+ if (!ext_fb_list_[i].in_use) break;
138132 }
139133 return i;
140134 }
@@ -161,16 +155,15 @@ class ExternalFrameBufferList { · 20 unmodified lines
161155 int get_vp9_frame_buffer(void *user_priv, size_t min_size,
162156 vpx_codec_frame_buffer_t *fb) {
163157 ExternalFrameBufferList *const fb_list =
164− reinterpret_cast<ExternalFrameBufferList*>(user_priv);
158+ reinterpret_cast<ExternalFrameBufferList *>(user_priv);
165159 return fb_list->GetFreeFrameBuffer(min_size, fb);
166160 }
167161
168162 // Callback used by libvpx to tell the application that |fb| is not needed
169163 // anymore.
170−int release_vp9_frame_buffer(void *user_priv,
171− vpx_codec_frame_buffer_t *fb) {
164+int release_vp9_frame_buffer(void *user_priv, vpx_codec_frame_buffer_t *fb) {
172165 ExternalFrameBufferList *const fb_list =
173− reinterpret_cast<ExternalFrameBufferList*>(user_priv);
166+ reinterpret_cast<ExternalFrameBufferList *>(user_priv);
174167 return fb_list->ReturnFrameBuffer(fb);
175168 }
176169
@@ -178,7 +171,7 @@ int release_vp9_frame_buffer(void *user_priv, · 1 unmodified line
178171 int get_vp9_zero_frame_buffer(void *user_priv, size_t min_size,
179172 vpx_codec_frame_buffer_t *fb) {
180173 ExternalFrameBufferList *const fb_list =
181− reinterpret_cast<ExternalFrameBufferList*>(user_priv);
174+ reinterpret_cast<ExternalFrameBufferList *>(user_priv);
182175 return fb_list->GetZeroFrameBuffer(min_size, fb);
183176 }
184177
@@ -186,7 +179,7 @@ int get_vp9_zero_frame_buffer(void *user_priv, size_t min_size, · 1 unmodified line
186179 int get_vp9_one_less_byte_frame_buffer(void *user_priv, size_t min_size,
187180 vpx_codec_frame_buffer_t *fb) {
188181 ExternalFrameBufferList *const fb_list =
189− reinterpret_cast<ExternalFrameBufferList*>(user_priv);
182+ reinterpret_cast<ExternalFrameBufferList *>(user_priv);
190183 return fb_list->GetFreeFrameBuffer(min_size - 1, fb);
191184 }
192185
@@ -203,16 +196,14 @@ int do_not_release_vp9_frame_buffer(void *user_priv, · 10 unmodified lines
203196 // Class for testing passing in external frame buffers to libvpx.
204197 class ExternalFrameBufferMD5Test
205198 : public ::libvpx_test::DecoderTest,
206− public ::libvpx_test::CodecTestWithParam<const char*> {
199+ public ::libvpx_test::CodecTestWithParam<const char *> {
207200 protected:
208201 ExternalFrameBufferMD5Test()
209202 : DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)),
210− md5_file_(NULL),
211− num_buffers_(0) {}
203+ md5_file_(NULL), num_buffers_(0) {}
212204
213205 virtual ~ExternalFrameBufferMD5Test() {
214− if (md5_file_ != NULL)
215− fclose(md5_file_);
206+ if (md5_file_ != NULL) fclose(md5_file_);
216207 }
217208
218209 virtual void PreDecodeFrameHook(
@@ -222,15 +213,15 @@ class ExternalFrameBufferMD5Test · 3 unmodified lines
222213 // Have libvpx use frame buffers we create.
223214 ASSERT_TRUE(fb_list_.CreateBufferList(num_buffers_));
224215 ASSERT_EQ(VPX_CODEC_OK,
225− decoder->SetFrameBufferFunctions(
226− GetVP9FrameBuffer, ReleaseVP9FrameBuffer, this));
216+ decoder->SetFrameBufferFunctions(GetVP9FrameBuffer,
217+ ReleaseVP9FrameBuffer, this));
227218 }
228219 }
229220
230221 void OpenMD5File(const std::string &md5_file_name_) {
231222 md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
232223 ASSERT_TRUE(md5_file_ != NULL) << "Md5 file open failed. Filename: "
233− << md5_file_name_;
224+ << md5_file_name_;
234225 }
235226
236227 virtual void DecompressedFrameHook(const vpx_image_t &img,
@@ -258,7 +249,7 @@ class ExternalFrameBufferMD5Test · 21 unmodified lines
258249 static int GetVP9FrameBuffer(void *user_priv, size_t min_size,
259250 vpx_codec_frame_buffer_t *fb) {
260251 ExternalFrameBufferMD5Test *const md5Test =
261− reinterpret_cast<ExternalFrameBufferMD5Test*>(user_priv);
252+ reinterpret_cast<ExternalFrameBufferMD5Test *>(user_priv);
262253 return md5Test->fb_list_.GetFreeFrameBuffer(min_size, fb);
263254 }
264255
@@ -267,7 +258,7 @@ class ExternalFrameBufferMD5Test · 2 unmodified lines
267258 static int ReleaseVP9FrameBuffer(void *user_priv,
268259 vpx_codec_frame_buffer_t *fb) {
269260 ExternalFrameBufferMD5Test *const md5Test =
270− reinterpret_cast<ExternalFrameBufferMD5Test*>(user_priv);
261+ reinterpret_cast<ExternalFrameBufferMD5Test *>(user_priv);
271262 return md5Test->fb_list_.ReturnFrameBuffer(fb);
272263 }
273264
@@ -286,10 +277,7 @@ const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm"; · 12 unmodified lines
286277 // Class for testing passing in external frame buffers to libvpx.
287278 class ExternalFrameBufferTest : public ::testing::Test {
288279 protected:
289− ExternalFrameBufferTest()
290− : video_(NULL),
291− decoder_(NULL),
292− num_buffers_(0) {}
280+ ExternalFrameBufferTest() : video_(NULL), decoder_(NULL), num_buffers_(0) {}
293281
294282 virtual void SetUp() {
295283 video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
@@ -309,8 +297,7 @@ class ExternalFrameBufferTest : public ::testing::Test { · 13 unmodified lines
309297
310298 // Passes the external frame buffer information to libvpx.
311299 vpx_codec_err_t SetFrameBufferFunctions(
312− int num_buffers,
313− vpx_get_frame_buffer_cb_fn_t cb_get,
300+ int num_buffers, vpx_get_frame_buffer_cb_fn_t cb_get,
314301 vpx_release_frame_buffer_cb_fn_t cb_release) {
315302 if (num_buffers > 0) {
316303 num_buffers_ = num_buffers;
@@ -324,8 +311,7 @@ class ExternalFrameBufferTest : public ::testing::Test { · 7 unmodified lines
324311 const vpx_codec_err_t res =
325312 decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
326313 CheckDecodedFrames();
327− if (res == VPX_CODEC_OK)
328− video_->Next();
314+ if (res == VPX_CODEC_OK) video_->Next();
329315 return res;
330316 }
331317
@@ -333,8 +319,7 @@ class ExternalFrameBufferTest : public ::testing::Test { · 1 unmodified line
333319 for (; video_->cxdata() != NULL; video_->Next()) {
334320 const vpx_codec_err_t res =
335321 decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
336− if (res != VPX_CODEC_OK)
337− return res;
322+ if (res != VPX_CODEC_OK) return res;
338323 CheckDecodedFrames();
339324 }
340325 return VPX_CODEC_OK;
@@ -409,8 +394,8 @@ TEST_F(ExternalFrameBufferTest, MinFrameBuffers) { · 68 unmodified lines
409394 // #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS.
410395 const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
411396 ASSERT_EQ(VPX_CODEC_OK,
412− SetFrameBufferFunctions(
413− num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
397+ SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
398+ release_vp9_frame_buffer));
414399 ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
415400 }
416401
@@ -421,8 +406,8 @@ TEST_F(ExternalFrameBufferTest, EightJitterBuffers) { · 4 unmodified lines
421406 const int num_buffers =
422407 VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers;
423408 ASSERT_EQ(VPX_CODEC_OK,
424− SetFrameBufferFunctions(
425− num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
409+ SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
410+ release_vp9_frame_buffer));
426411 ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
427412 }
428413
@@ -432,8 +417,8 @@ TEST_F(ExternalFrameBufferTest, NotEnoughBuffers) { · 3 unmodified lines
432417 // only use 5 frame buffers at one time.
433418 const int num_buffers = 2;
434419 ASSERT_EQ(VPX_CODEC_OK,
435− SetFrameBufferFunctions(
436− num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
420+ SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
421+ release_vp9_frame_buffer));
437422 ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame());
438423 ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeRemainingFrames());
439424 }
@@ -457,18 +442,17 @@ TEST_F(ExternalFrameBufferTest, NullRealloc) { · 17 unmodified lines
457442
458443 TEST_F(ExternalFrameBufferTest, ReallocOneLessByte) {
459444 const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
460− ASSERT_EQ(VPX_CODEC_OK,
461− SetFrameBufferFunctions(
462− num_buffers, get_vp9_one_less_byte_frame_buffer,
463− release_vp9_frame_buffer));
445+ ASSERT_EQ(VPX_CODEC_OK, SetFrameBufferFunctions(
446+ num_buffers, get_vp9_one_less_byte_frame_buffer,
447+ release_vp9_frame_buffer));
464448 ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeOneFrame());
465449 }
466450
467451 TEST_F(ExternalFrameBufferTest, NullGetFunction) {
468452 const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
469− ASSERT_EQ(VPX_CODEC_INVALID_PARAM,
470− SetFrameBufferFunctions(num_buffers, NULL,
471− release_vp9_frame_buffer));
453+ ASSERT_EQ(
454+ VPX_CODEC_INVALID_PARAM,
455+ SetFrameBufferFunctions(num_buffers, NULL, release_vp9_frame_buffer));
472456 }
473457
474458 TEST_F(ExternalFrameBufferTest, NullReleaseFunction) {
@@ -481,13 +465,14 @@ TEST_F(ExternalFrameBufferTest, SetAfterDecode) { · 6 unmodified lines
481465 const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
482466 ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame());
483467 ASSERT_EQ(VPX_CODEC_ERROR,
484− SetFrameBufferFunctions(
485− num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
468+ SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
469+ release_vp9_frame_buffer));
486470 }
487471 #endif // CONFIG_WEBM_IO
488472
489−VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test,
490− ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
491− libvpx_test::kVP9TestVectors +
492− libvpx_test::kNumVP9TestVectors));
473+VP9_INSTANTIATE_TEST_CASE(
474+ ExternalFrameBufferMD5Test,
475+ ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
476+ libvpx_test::kVP9TestVectors +
477+ libvpx_test::kNumVP9TestVectors));
493478 } // namespace
test/fdct4x4_test.cc+60−95
@@ -128,14 +128,14 @@ class Trans4x4TestBase { · 127 unmodified lines
128128 }
129129 }
130130
131− ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
132− test_temp_block, pitch_));
131+ ASM_REGISTER_STATE_CHECK(
132+ RunFwdTxfm(test_input_block, test_temp_block, pitch_));
133133 if (bit_depth_ == VPX_BITS_8) {
134134 ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
135135 #if CONFIG_VP9_HIGHBITDEPTH
136136 } else {
137− ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block,
138− CONVERT_TO_BYTEPTR(dst16), pitch_));
137+ ASM_REGISTER_STATE_CHECK(
138+ RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
139139 #endif
140140 }
141141
@@ -148,15 +148,13 @@ class Trans4x4TestBase { · 6 unmodified lines
148148 const int diff = dst[j] - src[j];
149149 #endif
150150 const uint32_t error = diff * diff;
151− if (max_error < error)
152− max_error = error;
151+ if (max_error < error) max_error = error;
153152 total_error += error;
154153 }
155154 }
156155
157156 EXPECT_GE(static_cast<uint32_t>(limit), max_error)
158− << "Error: 4x4 FHT/IHT has an individual round trip error > "
159− << limit;
157+ << "Error: 4x4 FHT/IHT has an individual round trip error > " << limit;
160158
161159 EXPECT_GE(count_test_block * limit, total_error)
162160 << "Error: 4x4 FHT/IHT has average round trip error > " << limit
@@ -197,16 +195,14 @@ class Trans4x4TestBase { · 34 unmodified lines
197195 input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
198196 }
199197 if (i == 0) {
200− for (int j = 0; j < kNumCoeffs; ++j)
201− input_extreme_block[j] = mask_;
198+ for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
202199 } else if (i == 1) {
203− for (int j = 0; j < kNumCoeffs; ++j)
204− input_extreme_block[j] = -mask_;
200+ for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
205201 }
206202
207203 fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
208− ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
209− output_block, pitch_));
204+ ASM_REGISTER_STATE_CHECK(
205+ RunFwdTxfm(input_extreme_block, output_block, pitch_));
210206
211207 // The minimum quant value is 4.
212208 for (int j = 0; j < kNumCoeffs; ++j) {
@@ -251,8 +247,8 @@ class Trans4x4TestBase { · 38 unmodified lines
251247 ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
252248 #if CONFIG_VP9_HIGHBITDEPTH
253249 } else {
254− ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
255− pitch_));
250+ ASM_REGISTER_STATE_CHECK(
251+ RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
256252 #endif
257253 }
258254
@@ -265,8 +261,7 @@ class Trans4x4TestBase { · 6 unmodified lines
265261 #endif
266262 const uint32_t error = diff * diff;
267263 EXPECT_GE(static_cast<uint32_t>(limit), error)
268− << "Error: 4x4 IDCT has error " << error
269− << " at index " << j;
264+ << "Error: 4x4 IDCT has error " << error << " at index " << j;
270265 }
271266 }
272267 }
@@ -278,17 +273,16 @@ class Trans4x4TestBase { · 5 unmodified lines
278273 int mask_;
279274 };
280275
281−class Trans4x4DCT
282− : public Trans4x4TestBase,
283− public ::testing::TestWithParam<Dct4x4Param> {
276+class Trans4x4DCT : public Trans4x4TestBase,
277+ public ::testing::TestWithParam<Dct4x4Param> {
284278 public:
285279 virtual ~Trans4x4DCT() {}
286280
287281 virtual void SetUp() {
288282 fwd_txfm_ = GET_PARAM(0);
289283 inv_txfm_ = GET_PARAM(1);
290− tx_type_ = GET_PARAM(2);
291− pitch_ = 4;
284+ tx_type_ = GET_PARAM(2);
285+ pitch_ = 4;
292286 fwd_txfm_ref = fdct4x4_ref;
293287 bit_depth_ = GET_PARAM(3);
294288 mask_ = (1 << bit_depth_) - 1;
@@ -307,33 +301,24 @@ class Trans4x4DCT · 12 unmodified lines
307301 IdctFunc inv_txfm_;
308302 };
309303
310−TEST_P(Trans4x4DCT, AccuracyCheck) {
311− RunAccuracyCheck(1);
312−}
304+TEST_P(Trans4x4DCT, AccuracyCheck) { RunAccuracyCheck(1); }
313305
314−TEST_P(Trans4x4DCT, CoeffCheck) {
315− RunCoeffCheck();
316−}
306+TEST_P(Trans4x4DCT, CoeffCheck) { RunCoeffCheck(); }
317307
318−TEST_P(Trans4x4DCT, MemCheck) {
319− RunMemCheck();
320−}
308+TEST_P(Trans4x4DCT, MemCheck) { RunMemCheck(); }
321309
322−TEST_P(Trans4x4DCT, InvAccuracyCheck) {
323− RunInvAccuracyCheck(1);
324−}
310+TEST_P(Trans4x4DCT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
325311
326−class Trans4x4HT
327− : public Trans4x4TestBase,
328− public ::testing::TestWithParam<Ht4x4Param> {
312+class Trans4x4HT : public Trans4x4TestBase,
313+ public ::testing::TestWithParam<Ht4x4Param> {
329314 public:
330315 virtual ~Trans4x4HT() {}
331316
332317 virtual void SetUp() {
333318 fwd_txfm_ = GET_PARAM(0);
334319 inv_txfm_ = GET_PARAM(1);
335− tx_type_ = GET_PARAM(2);
336− pitch_ = 4;
320+ tx_type_ = GET_PARAM(2);
321+ pitch_ = 4;
337322 fwd_txfm_ref = fht4x4_ref;
338323 bit_depth_ = GET_PARAM(3);
339324 mask_ = (1 << bit_depth_) - 1;
@@ -353,33 +338,24 @@ class Trans4x4HT · 13 unmodified lines
353338 IhtFunc inv_txfm_;
354339 };
355340
356−TEST_P(Trans4x4HT, AccuracyCheck) {
357− RunAccuracyCheck(1);
358−}
341+TEST_P(Trans4x4HT, AccuracyCheck) { RunAccuracyCheck(1); }
359342
360−TEST_P(Trans4x4HT, CoeffCheck) {
361− RunCoeffCheck();
362−}
343+TEST_P(Trans4x4HT, CoeffCheck) { RunCoeffCheck(); }
363344
364−TEST_P(Trans4x4HT, MemCheck) {
365− RunMemCheck();
366−}
345+TEST_P(Trans4x4HT, MemCheck) { RunMemCheck(); }
367346
368−TEST_P(Trans4x4HT, InvAccuracyCheck) {
369− RunInvAccuracyCheck(1);
370−}
347+TEST_P(Trans4x4HT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
371348
372−class Trans4x4WHT
373− : public Trans4x4TestBase,
374− public ::testing::TestWithParam<Dct4x4Param> {
349+class Trans4x4WHT : public Trans4x4TestBase,
350+ public ::testing::TestWithParam<Dct4x4Param> {
375351 public:
376352 virtual ~Trans4x4WHT() {}
377353
378354 virtual void SetUp() {
379355 fwd_txfm_ = GET_PARAM(0);
380356 inv_txfm_ = GET_PARAM(1);
381− tx_type_ = GET_PARAM(2);
382− pitch_ = 4;
357+ tx_type_ = GET_PARAM(2);
358+ pitch_ = 4;
383359 fwd_txfm_ref = fwht4x4_ref;
384360 bit_depth_ = GET_PARAM(3);
385361 mask_ = (1 << bit_depth_) - 1;
@@ -398,21 +374,13 @@ class Trans4x4WHT · 12 unmodified lines
398374 IdctFunc inv_txfm_;
399375 };
400376
401−TEST_P(Trans4x4WHT, AccuracyCheck) {
402− RunAccuracyCheck(0);
403−}
377+TEST_P(Trans4x4WHT, AccuracyCheck) { RunAccuracyCheck(0); }
404378
405−TEST_P(Trans4x4WHT, CoeffCheck) {
406− RunCoeffCheck();
407−}
379+TEST_P(Trans4x4WHT, CoeffCheck) { RunCoeffCheck(); }
408380
409−TEST_P(Trans4x4WHT, MemCheck) {
410− RunMemCheck();
411−}
381+TEST_P(Trans4x4WHT, MemCheck) { RunMemCheck(); }
412382
413−TEST_P(Trans4x4WHT, InvAccuracyCheck) {
414− RunInvAccuracyCheck(0);
415−}
383+TEST_P(Trans4x4WHT, InvAccuracyCheck) { RunInvAccuracyCheck(0); }
416384 using std::tr1::make_tuple;
417385
418386 #if CONFIG_VP9_HIGHBITDEPTH
@@ -423,10 +391,10 @@ INSTANTIATE_TEST_CASE_P( · 4 unmodified lines
423391 make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12),
424392 make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8)));
425393 #else
426−INSTANTIATE_TEST_CASE_P(
427− C, Trans4x4DCT,
428− ::testing::Values(
429− make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8)));
394+INSTANTIATE_TEST_CASE_P(C, Trans4x4DCT,
395+ ::testing::Values(make_tuple(&vpx_fdct4x4_c,
396+ &vpx_idct4x4_16_add_c, 0,
397+ VPX_BITS_8)));
430398 #endif // CONFIG_VP9_HIGHBITDEPTH
431399
432400 #if CONFIG_VP9_HIGHBITDEPTH
@@ -463,18 +431,17 @@ INSTANTIATE_TEST_CASE_P( · 30 unmodified lines
463431 make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_12, 0, VPX_BITS_12),
464432 make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8)));
465433 #else
466−INSTANTIATE_TEST_CASE_P(
467− C, Trans4x4WHT,
468− ::testing::Values(
469− make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8)));
434+INSTANTIATE_TEST_CASE_P(C, Trans4x4WHT,
435+ ::testing::Values(make_tuple(&vp9_fwht4x4_c,
436+ &vpx_iwht4x4_16_add_c, 0,
437+ VPX_BITS_8)));
470438 #endif // CONFIG_VP9_HIGHBITDEPTH
471439
472440 #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
473−INSTANTIATE_TEST_CASE_P(
474− NEON, Trans4x4DCT,
475− ::testing::Values(
476− make_tuple(&vpx_fdct4x4_c,
477− &vpx_idct4x4_16_add_neon, 0, VPX_BITS_8)));
441+INSTANTIATE_TEST_CASE_P(NEON, Trans4x4DCT,
442+ ::testing::Values(make_tuple(&vpx_fdct4x4_c,
443+ &vpx_idct4x4_16_add_neon,
444+ 0, VPX_BITS_8)));
478445 #endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
479446
480447 #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
@@ -496,11 +463,10 @@ INSTANTIATE_TEST_CASE_P( · 15 unmodified lines
496463 #endif
497464
498465 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
499−INSTANTIATE_TEST_CASE_P(
500− SSE2, Trans4x4DCT,
501− ::testing::Values(
502− make_tuple(&vpx_fdct4x4_sse2,
503− &vpx_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
466+INSTANTIATE_TEST_CASE_P(SSE2, Trans4x4DCT,
467+ ::testing::Values(make_tuple(&vpx_fdct4x4_sse2,
468+ &vpx_idct4x4_16_add_sse2,
469+ 0, VPX_BITS_8)));
504470 INSTANTIATE_TEST_CASE_P(
505471 SSE2, Trans4x4HT,
506472 ::testing::Values(
@@ -514,12 +480,11 @@ INSTANTIATE_TEST_CASE_P( · 7 unmodified lines
514480 INSTANTIATE_TEST_CASE_P(
515481 SSE2, Trans4x4DCT,
516482 ::testing::Values(
517− make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, VPX_BITS_10),
483+ make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, VPX_BITS_10),
518484 make_tuple(&vpx_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, VPX_BITS_10),
519− make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12_sse2, 0, VPX_BITS_12),
485+ make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12_sse2, 0, VPX_BITS_12),
520486 make_tuple(&vpx_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, VPX_BITS_12),
521− make_tuple(&vpx_fdct4x4_sse2, &vpx_idct4x4_16_add_c, 0,
522− VPX_BITS_8)));
487+ make_tuple(&vpx_fdct4x4_sse2, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8)));
523488
524489 INSTANTIATE_TEST_CASE_P(
525490 SSE2, Trans4x4HT,
@@ -531,10 +496,10 @@ INSTANTIATE_TEST_CASE_P( · 5 unmodified lines
531496 #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
532497
533498 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
534−INSTANTIATE_TEST_CASE_P(
535− MSA, Trans4x4DCT,
536− ::testing::Values(
537− make_tuple(&vpx_fdct4x4_msa, &vpx_idct4x4_16_add_msa, 0, VPX_BITS_8)));
499+INSTANTIATE_TEST_CASE_P(MSA, Trans4x4DCT,
500+ ::testing::Values(make_tuple(&vpx_fdct4x4_msa,
501+ &vpx_idct4x4_16_add_msa, 0,
502+ VPX_BITS_8)));
538503 INSTANTIATE_TEST_CASE_P(
539504 MSA, Trans4x4HT,
540505 ::testing::Values(
test/fdct8x8_test.cc+94−133
@@ -53,8 +53,7 @@ void reference_8x8_dct_1d(const double in[8], double out[8]) { · 52 unmodified lines
5353 out[k] = 0.0;
5454 for (int n = 0; n < 8; n++)
5555 out[k] += in[n] * cos(kPi * (2 * n + 1) * k / 16.0);
56− if (k == 0)
57− out[k] = out[k] * kInvSqrt2;
56+ if (k == 0) out[k] = out[k] * kInvSqrt2;
5857 }
5958 }
6059
@@ -63,25 +62,20 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs], · 2 unmodified lines
6362 // First transform columns
6463 for (int i = 0; i < 8; ++i) {
6564 double temp_in[8], temp_out[8];
66− for (int j = 0; j < 8; ++j)
67− temp_in[j] = input[j*8 + i];
65+ for (int j = 0; j < 8; ++j) temp_in[j] = input[j * 8 + i];
6866 reference_8x8_dct_1d(temp_in, temp_out);
69− for (int j = 0; j < 8; ++j)
70− output[j * 8 + i] = temp_out[j];
67+ for (int j = 0; j < 8; ++j) output[j * 8 + i] = temp_out[j];
7168 }
7269 // Then transform rows
7370 for (int i = 0; i < 8; ++i) {
7471 double temp_in[8], temp_out[8];
75− for (int j = 0; j < 8; ++j)
76− temp_in[j] = output[j + i*8];
72+ for (int j = 0; j < 8; ++j) temp_in[j] = output[j + i * 8];
7773 reference_8x8_dct_1d(temp_in, temp_out);
7874 // Scale by some magic number
79− for (int j = 0; j < 8; ++j)
80− output[j + i * 8] = temp_out[j] * 2;
75+ for (int j = 0; j < 8; ++j) output[j + i * 8] = temp_out[j] * 2;
8176 }
8277 }
8378
84−
8579 void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride,
8680 int /*tx_type*/) {
8781 vpx_fdct8x8_c(in, out, stride);
@@ -177,8 +171,7 @@ class FwdTrans8x8TestBase { · 89 unmodified lines
177171 << 1. * max_diff / count_test_block * 100 << "%"
178172 << " for input range [-255, 255] at index " << j
179173 << " count0: " << count_sign_block[j][0]
180− << " count1: " << count_sign_block[j][1]
181− << " diff: " << diff;
174+ << " count1: " << count_sign_block[j][1] << " diff: " << diff;
182175 }
183176
184177 memset(count_sign_block, 0, sizeof(count_sign_block));
@@ -186,8 +179,8 @@ class FwdTrans8x8TestBase { · 1 unmodified line
186179 for (int i = 0; i < count_test_block; ++i) {
187180 // Initialize a test block with input range [-mask_ / 16, mask_ / 16].
188181 for (int j = 0; j < 64; ++j)
189− test_input_block[j] = ((rnd.Rand16() & mask_) >> 4) -
190− ((rnd.Rand16() & mask_) >> 4);
182+ test_input_block[j] =
183+ ((rnd.Rand16() & mask_) >> 4) - ((rnd.Rand16() & mask_) >> 4);
191184 ASM_REGISTER_STATE_CHECK(
192185 RunFwdTxfm(test_input_block, test_output_block, pitch_));
193186
@@ -207,8 +200,7 @@ class FwdTrans8x8TestBase { · 13 unmodified lines
207200 << 1. * max_diff / count_test_block * 100 << "%"
208201 << " for input range [-15, 15] at index " << j
209202 << " count0: " << count_sign_block[j][0]
210− << " count1: " << count_sign_block[j][1]
211− << " diff: " << diff;
203+ << " count1: " << count_sign_block[j][1] << " diff: " << diff;
212204 }
213205 }
214206
@@ -245,19 +237,18 @@ class FwdTrans8x8TestBase { · 30 unmodified lines
245237 ASM_REGISTER_STATE_CHECK(
246238 RunFwdTxfm(test_input_block, test_temp_block, pitch_));
247239 for (int j = 0; j < 64; ++j) {
248− if (test_temp_block[j] > 0) {
249− test_temp_block[j] += 2;
250− test_temp_block[j] /= 4;
251− test_temp_block[j] *= 4;
252− } else {
253− test_temp_block[j] -= 2;
254− test_temp_block[j] /= 4;
255− test_temp_block[j] *= 4;
256− }
240+ if (test_temp_block[j] > 0) {
241+ test_temp_block[j] += 2;
242+ test_temp_block[j] /= 4;
243+ test_temp_block[j] *= 4;
244+ } else {
245+ test_temp_block[j] -= 2;
246+ test_temp_block[j] /= 4;
247+ test_temp_block[j] *= 4;
248+ }
257249 }
258250 if (bit_depth_ == VPX_BITS_8) {
259− ASM_REGISTER_STATE_CHECK(
260− RunInvTxfm(test_temp_block, dst, pitch_));
251+ ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
261252 #if CONFIG_VP9_HIGHBITDEPTH
262253 } else {
263254 ASM_REGISTER_STATE_CHECK(
@@ -273,19 +264,18 @@ class FwdTrans8x8TestBase { · 9 unmodified lines
273264 const int diff = dst[j] - src[j];
274265 #endif
275266 const int error = diff * diff;
276− if (max_error < error)
277− max_error = error;
267+ if (max_error < error) max_error = error;
278268 total_error += error;
279269 }
280270 }
281271
282272 EXPECT_GE(1 << 2 * (bit_depth_ - 8), max_error)
283− << "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual"
284− << " roundtrip error > 1";
273+ << "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual"
274+ << " roundtrip error > 1";
285275
286− EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8))/5, total_error)
287− << "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip "
288− << "error > 1/5 per block";
276+ EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8)) / 5, total_error)
277+ << "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip "
278+ << "error > 1/5 per block";
289279 }
290280
291281 void RunExtremalCheck() {
@@ -341,8 +331,7 @@ class FwdTrans8x8TestBase { · 49 unmodified lines
341331 ASM_REGISTER_STATE_CHECK(
342332 fwd_txfm_ref(test_input_block, ref_temp_block, pitch_, tx_type_));
343333 if (bit_depth_ == VPX_BITS_8) {
344− ASM_REGISTER_STATE_CHECK(
345− RunInvTxfm(test_temp_block, dst, pitch_));
334+ ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
346335 #if CONFIG_VP9_HIGHBITDEPTH
347336 } else {
348337 ASM_REGISTER_STATE_CHECK(
@@ -358,8 +347,7 @@ class FwdTrans8x8TestBase { · 9 unmodified lines
358347 const int diff = dst[j] - src[j];
359348 #endif
360349 const int error = diff * diff;
361− if (max_error < error)
362− max_error = error;
350+ if (max_error < error) max_error = error;
363351 total_error += error;
364352
365353 const int coeff_diff = test_temp_block[j] - ref_temp_block[j];
@@ -370,7 +358,7 @@ class FwdTrans8x8TestBase { · 4 unmodified lines
370358 << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has"
371359 << "an individual roundtrip error > 1";
372360
373− EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8))/5, total_error)
361+ EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8)) / 5, total_error)
374362 << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average"
375363 << " roundtrip error > 1/5 per block";
376364
@@ -418,8 +406,8 @@ class FwdTrans8x8TestBase { · 41 unmodified lines
418406 ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
419407 #if CONFIG_VP9_HIGHBITDEPTH
420408 } else {
421− ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
422− pitch_));
409+ ASM_REGISTER_STATE_CHECK(
410+ RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
423411 #endif
424412 }
425413
@@ -432,8 +420,7 @@ class FwdTrans8x8TestBase { · 6 unmodified lines
432420 #endif
433421 const uint32_t error = diff * diff;
434422 EXPECT_GE(1u << 2 * (bit_depth_ - 8), error)
435− << "Error: 8x8 IDCT has error " << error
436− << " at index " << j;
423+ << "Error: 8x8 IDCT has error " << error << " at index " << j;
437424 }
438425 }
439426 }
@@ -461,13 +448,12 @@ class FwdTrans8x8TestBase { · 21 unmodified lines
461448 const int32_t diff = coeff[j] - coeff_r[j];
462449 const uint32_t error = diff * diff;
463450 EXPECT_GE(9u << 2 * (bit_depth_ - 8), error)
464− << "Error: 8x8 DCT has error " << error
465− << " at index " << j;
451+ << "Error: 8x8 DCT has error " << error << " at index " << j;
466452 }
467453 }
468454 }
469455
470−void CompareInvReference(IdctFunc ref_txfm, int thresh) {
456+ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
471457 ACMRandom rnd(ACMRandom::DeterministicSeed());
472458 const int count_test_block = 10000;
473459 const int eob = 12;
@@ -484,7 +470,7 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { · 10 unmodified lines
484470 for (int j = 0; j < kNumCoeffs; ++j) {
485471 if (j < eob) {
486472 // Random values less than the threshold, either positive or negative
487− coeff[scan[j]] = rnd(thresh) * (1-2*(i%2));
473+ coeff[scan[j]] = rnd(thresh) * (1 - 2 * (i % 2));
488474 } else {
489475 coeff[scan[j]] = 0;
490476 }
@@ -504,8 +490,8 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { · 13 unmodified lines
504490 #if CONFIG_VP9_HIGHBITDEPTH
505491 } else {
506492 ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
507− ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
508− pitch_));
493+ ASM_REGISTER_STATE_CHECK(
494+ RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
509495 #endif
510496 }
511497
@@ -517,9 +503,8 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { · 5 unmodified lines
517503 const int diff = dst[j] - ref[j];
518504 #endif
519505 const uint32_t error = diff * diff;
520− EXPECT_EQ(0u, error)
521− << "Error: 8x8 IDCT has error " << error
522− << " at index " << j;
506+ EXPECT_EQ(0u, error) << "Error: 8x8 IDCT has error " << error
507+ << " at index " << j;
523508 }
524509 }
525510 }
@@ -530,17 +515,16 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { · 4 unmodified lines
530515 int mask_;
531516 };
532517
533−class FwdTrans8x8DCT
534− : public FwdTrans8x8TestBase,
535− public ::testing::TestWithParam<Dct8x8Param> {
518+class FwdTrans8x8DCT : public FwdTrans8x8TestBase,
519+ public ::testing::TestWithParam<Dct8x8Param> {
536520 public:
537521 virtual ~FwdTrans8x8DCT() {}
538522
539523 virtual void SetUp() {
540524 fwd_txfm_ = GET_PARAM(0);
541525 inv_txfm_ = GET_PARAM(1);
542− tx_type_ = GET_PARAM(2);
543− pitch_ = 8;
526+ tx_type_ = GET_PARAM(2);
527+ pitch_ = 8;
544528 fwd_txfm_ref = fdct8x8_ref;
545529 bit_depth_ = GET_PARAM(3);
546530 mask_ = (1 << bit_depth_) - 1;
@@ -560,37 +544,26 @@ class FwdTrans8x8DCT · 13 unmodified lines
560544 IdctFunc inv_txfm_;
561545 };
562546
563−TEST_P(FwdTrans8x8DCT, SignBiasCheck) {
564− RunSignBiasCheck();
565−}
547+TEST_P(FwdTrans8x8DCT, SignBiasCheck) { RunSignBiasCheck(); }
566548
567−TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) {
568− RunRoundTripErrorCheck();
569−}
549+TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) { RunRoundTripErrorCheck(); }
570550
571−TEST_P(FwdTrans8x8DCT, ExtremalCheck) {
572− RunExtremalCheck();
573−}
551+TEST_P(FwdTrans8x8DCT, ExtremalCheck) { RunExtremalCheck(); }
574552
575−TEST_P(FwdTrans8x8DCT, FwdAccuracyCheck) {
576− RunFwdAccuracyCheck();
577−}
553+TEST_P(FwdTrans8x8DCT, FwdAccuracyCheck) { RunFwdAccuracyCheck(); }
578554
579−TEST_P(FwdTrans8x8DCT, InvAccuracyCheck) {
580− RunInvAccuracyCheck();
581−}
555+TEST_P(FwdTrans8x8DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); }
582556
583−class FwdTrans8x8HT
584− : public FwdTrans8x8TestBase,
585− public ::testing::TestWithParam<Ht8x8Param> {
557+class FwdTrans8x8HT : public FwdTrans8x8TestBase,
558+ public ::testing::TestWithParam<Ht8x8Param> {
586559 public:
587560 virtual ~FwdTrans8x8HT() {}
588561
589562 virtual void SetUp() {
590563 fwd_txfm_ = GET_PARAM(0);
591564 inv_txfm_ = GET_PARAM(1);
592− tx_type_ = GET_PARAM(2);
593− pitch_ = 8;
565+ tx_type_ = GET_PARAM(2);
566+ pitch_ = 8;
594567 fwd_txfm_ref = fht8x8_ref;
595568 bit_depth_ = GET_PARAM(3);
596569 mask_ = (1 << bit_depth_) - 1;
@@ -610,21 +583,14 @@ class FwdTrans8x8HT · 13 unmodified lines
610583 IhtFunc inv_txfm_;
611584 };
612585
613−TEST_P(FwdTrans8x8HT, SignBiasCheck) {
614− RunSignBiasCheck();
615−}
586+TEST_P(FwdTrans8x8HT, SignBiasCheck) { RunSignBiasCheck(); }
616587
617−TEST_P(FwdTrans8x8HT, RoundTripErrorCheck) {
618− RunRoundTripErrorCheck();
619−}
588+TEST_P(FwdTrans8x8HT, RoundTripErrorCheck) { RunRoundTripErrorCheck(); }
620589
621−TEST_P(FwdTrans8x8HT, ExtremalCheck) {
622− RunExtremalCheck();
623−}
590+TEST_P(FwdTrans8x8HT, ExtremalCheck) { RunExtremalCheck(); }
624591
625−class InvTrans8x8DCT
626− : public FwdTrans8x8TestBase,
627− public ::testing::TestWithParam<Idct8x8Param> {
592+class InvTrans8x8DCT : public FwdTrans8x8TestBase,
593+ public ::testing::TestWithParam<Idct8x8Param> {
628594 public:
629595 virtual ~InvTrans8x8DCT() {}
630596
@@ -664,10 +630,10 @@ INSTANTIATE_TEST_CASE_P( · 33 unmodified lines
664630 make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10),
665631 make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12)));
666632 #else
667−INSTANTIATE_TEST_CASE_P(
668− C, FwdTrans8x8DCT,
669− ::testing::Values(
670− make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c, 0, VPX_BITS_8)));
633+INSTANTIATE_TEST_CASE_P(C, FwdTrans8x8DCT,
634+ ::testing::Values(make_tuple(&vpx_fdct8x8_c,
635+ &vpx_idct8x8_64_add_c, 0,
636+ VPX_BITS_8)));
671637 #endif // CONFIG_VP9_HIGHBITDEPTH
672638
673639 #if CONFIG_VP9_HIGHBITDEPTH
@@ -697,11 +663,10 @@ INSTANTIATE_TEST_CASE_P( · 23 unmodified lines
697663 #endif // CONFIG_VP9_HIGHBITDEPTH
698664
699665 #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
700−INSTANTIATE_TEST_CASE_P(
701− NEON, FwdTrans8x8DCT,
702− ::testing::Values(
703− make_tuple(&vpx_fdct8x8_neon, &vpx_idct8x8_64_add_neon, 0,
704− VPX_BITS_8)));
666+INSTANTIATE_TEST_CASE_P(NEON, FwdTrans8x8DCT,
667+ ::testing::Values(make_tuple(&vpx_fdct8x8_neon,
668+ &vpx_idct8x8_64_add_neon,
669+ 0, VPX_BITS_8)));
705670 #endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
706671
707672 #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
@@ -715,11 +680,10 @@ INSTANTIATE_TEST_CASE_P( · 7 unmodified lines
715680 #endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
716681
717682 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
718−INSTANTIATE_TEST_CASE_P(
719− SSE2, FwdTrans8x8DCT,
720− ::testing::Values(
721− make_tuple(&vpx_fdct8x8_sse2, &vpx_idct8x8_64_add_sse2, 0,
722− VPX_BITS_8)));
683+INSTANTIATE_TEST_CASE_P(SSE2, FwdTrans8x8DCT,
684+ ::testing::Values(make_tuple(&vpx_fdct8x8_sse2,
685+ &vpx_idct8x8_64_add_sse2,
686+ 0, VPX_BITS_8)));
723687 INSTANTIATE_TEST_CASE_P(
724688 SSE2, FwdTrans8x8HT,
725689 ::testing::Values(
@@ -732,16 +696,16 @@ INSTANTIATE_TEST_CASE_P( · 6 unmodified lines
732696 #if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
733697 INSTANTIATE_TEST_CASE_P(
734698 SSE2, FwdTrans8x8DCT,
735− ::testing::Values(
736− make_tuple(&vpx_fdct8x8_sse2, &vpx_idct8x8_64_add_c, 0, VPX_BITS_8),
737− make_tuple(&vpx_highbd_fdct8x8_c,
738− &idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
739− make_tuple(&vpx_highbd_fdct8x8_sse2,
740− &idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
741− make_tuple(&vpx_highbd_fdct8x8_c,
742− &idct8x8_64_add_12_sse2, 12, VPX_BITS_12),
743− make_tuple(&vpx_highbd_fdct8x8_sse2,
744− &idct8x8_64_add_12_sse2, 12, VPX_BITS_12)));
699+ ::testing::Values(make_tuple(&vpx_fdct8x8_sse2, &vpx_idct8x8_64_add_c, 0,
700+ VPX_BITS_8),
701+ make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_64_add_10_sse2,
702+ 12, VPX_BITS_10),
703+ make_tuple(&vpx_highbd_fdct8x8_sse2,
704+ &idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
705+ make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_64_add_12_sse2,
706+ 12, VPX_BITS_12),
707+ make_tuple(&vpx_highbd_fdct8x8_sse2,
708+ &idct8x8_64_add_12_sse2, 12, VPX_BITS_12)));
745709
746710 INSTANTIATE_TEST_CASE_P(
747711 SSE2, FwdTrans8x8HT,
@@ -756,30 +720,27 @@ INSTANTIATE_TEST_CASE_P( · 8 unmodified lines
756720 INSTANTIATE_TEST_CASE_P(
757721 SSE2, InvTrans8x8DCT,
758722 ::testing::Values(
759− make_tuple(&idct8x8_10_add_10_c,
760− &idct8x8_10_add_10_sse2, 6225, VPX_BITS_10),
761− make_tuple(&idct8x8_10,
762− &idct8x8_64_add_10_sse2, 6225, VPX_BITS_10),
763− make_tuple(&idct8x8_10_add_12_c,
764− &idct8x8_10_add_12_sse2, 6225, VPX_BITS_12),
765− make_tuple(&idct8x8_12,
766− &idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
723+ make_tuple(&idct8x8_10_add_10_c, &idct8x8_10_add_10_sse2, 6225,
724+ VPX_BITS_10),
725+ make_tuple(&idct8x8_10, &idct8x8_64_add_10_sse2, 6225, VPX_BITS_10),
726+ make_tuple(&idct8x8_10_add_12_c, &idct8x8_10_add_12_sse2, 6225,
727+ VPX_BITS_12),
728+ make_tuple(&idct8x8_12, &idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
767729 #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
768730
769−#if HAVE_SSSE3 && ARCH_X86_64 && \
770− !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
771−INSTANTIATE_TEST_CASE_P(
772− SSSE3, FwdTrans8x8DCT,
773− ::testing::Values(
774− make_tuple(&vpx_fdct8x8_ssse3, &vpx_idct8x8_64_add_ssse3, 0,
775− VPX_BITS_8)));
731+#if HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
732+ !CONFIG_EMULATE_HARDWARE
733+INSTANTIATE_TEST_CASE_P(SSSE3, FwdTrans8x8DCT,
734+ ::testing::Values(make_tuple(&vpx_fdct8x8_ssse3,
735+ &vpx_idct8x8_64_add_ssse3,
736+ 0, VPX_BITS_8)));
776737 #endif
777738
778739 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
779−INSTANTIATE_TEST_CASE_P(
780− MSA, FwdTrans8x8DCT,
781− ::testing::Values(
782− make_tuple(&vpx_fdct8x8_msa, &vpx_idct8x8_64_add_msa, 0, VPX_BITS_8)));
740+INSTANTIATE_TEST_CASE_P(MSA, FwdTrans8x8DCT,
741+ ::testing::Values(make_tuple(&vpx_fdct8x8_msa,
742+ &vpx_idct8x8_64_add_msa, 0,
743+ VPX_BITS_8)));
783744 INSTANTIATE_TEST_CASE_P(
784745 MSA, FwdTrans8x8HT,
785746 ::testing::Values(
test/frame_size_tests.cc+12−13
@@ -13,12 +13,11 @@ · 12 unmodified lines
1313
1414 namespace {
1515
16−class VP9FrameSizeTestsLarge
17− : public ::libvpx_test::EncoderTest,
18− public ::testing::Test {
16+class VP9FrameSizeTestsLarge : public ::libvpx_test::EncoderTest,
17+ public ::testing::Test {
1918 protected:
20− VP9FrameSizeTestsLarge() : EncoderTest(&::libvpx_test::kVP9),
21− expected_res_(VPX_CODEC_OK) {}
19+ VP9FrameSizeTestsLarge()
20+ : EncoderTest(&::libvpx_test::kVP9), expected_res_(VPX_CODEC_OK) {}
2221 virtual ~VP9FrameSizeTestsLarge() {}
2322
2423 virtual void SetUp() {
@@ -27,7 +26,7 @@ class VP9FrameSizeTestsLarge · 2 unmodified lines
2726 }
2827
2928 virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
30− const libvpx_test::VideoSource& /*video*/,
29+ const libvpx_test::VideoSource & /*video*/,
3130 libvpx_test::Decoder *decoder) {
3231 EXPECT_EQ(expected_res_, res_dec) << decoder->DecodeError();
3332 return !::testing::Test::HasFailure();
@@ -67,13 +66,13 @@ TEST_F(VP9FrameSizeTestsLarge, ValidSizes) { · 33 unmodified lines
6766 expected_res_ = VPX_CODEC_OK;
6867 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
6968 #else
70− // This test produces a pretty large single frame allocation, (roughly
71− // 25 megabits). The encoder allocates a good number of these frames
72− // one for each lag in frames (for 2 pass), and then one for each possible
73− // reference buffer (8) - we can end up with up to 30 buffers of roughly this
74− // size or almost 1 gig of memory.
75− // In total the allocations will exceed 2GiB which may cause a failure with
76− // mingw + wine, use a smaller size in that case.
69+// This test produces a pretty large single frame allocation, (roughly
70+// 25 megabits). The encoder allocates a good number of these frames
71+// one for each lag in frames (for 2 pass), and then one for each possible
72+// reference buffer (8) - we can end up with up to 30 buffers of roughly this
73+// size or almost 1 gig of memory.
74+// In total the allocations will exceed 2GiB which may cause a failure with
75+// mingw + wine, use a smaller size in that case.
7776 #if defined(_WIN32) && !defined(_WIN64) || defined(__OS2__)
7877 video.SetSize(4096, 3072);
7978 #else
test/hadamard_test.cc+2−2
@@ -80,8 +80,8 @@ void reference_hadamard16x16(const int16_t *a, int a_stride, int16_t *b) { · 79 unmodified lines
8080 const int16_t b3 = (a2 - a3) >> 1;
8181
8282 /* Store a 16 bit value. */
83− b[ 0] = b0 + b2;
84− b[ 64] = b1 + b3;
83+ b[0] = b0 + b2;
84+ b[64] = b1 + b3;
8585 b[128] = b0 - b2;
8686 b[192] = b1 - b3;
8787
test/i420_video_source.h+4−7
@@ -21,14 +21,11 @@ namespace libvpx_test { · 20 unmodified lines
2121 // so that we can do actual file encodes.
2222 class I420VideoSource : public YUVVideoSource {
2323 public:
24− I420VideoSource(const std::string &file_name,
25− unsigned int width, unsigned int height,
26− int rate_numerator, int rate_denominator,
24+ I420VideoSource(const std::string &file_name, unsigned int width,
25+ unsigned int height, int rate_numerator, int rate_denominator,
2726 unsigned int start, int limit)
28− : YUVVideoSource(file_name, VPX_IMG_FMT_I420,
29− width, height,
30− rate_numerator, rate_denominator,
31− start, limit) {}
27+ : YUVVideoSource(file_name, VPX_IMG_FMT_I420, width, height,
28+ rate_numerator, rate_denominator, start, limit) {}
3229 };
3330
3431 } // namespace libvpx_test
test/idct8x8_test.cc+10−18
@@ -29,9 +29,8 @@ void reference_dct_1d(double input[8], double output[8]) { · 28 unmodified lines
2929 for (int k = 0; k < 8; k++) {
3030 output[k] = 0.0;
3131 for (int n = 0; n < 8; n++)
32− output[k] += input[n]*cos(kPi*(2*n+1)*k/16.0);
33− if (k == 0)
34− output[k] = output[k]*kInvSqrt2;
32+ output[k] += input[n] * cos(kPi * (2 * n + 1) * k / 16.0);
33+ if (k == 0) output[k] = output[k] * kInvSqrt2;
3534 }
3635 }
3736
@@ -39,24 +38,19 @@ void reference_dct_2d(int16_t input[64], double output[64]) { · 1 unmodified line
3938 // First transform columns
4039 for (int i = 0; i < 8; ++i) {
4140 double temp_in[8], temp_out[8];
42− for (int j = 0; j < 8; ++j)
43− temp_in[j] = input[j*8 + i];
41+ for (int j = 0; j < 8; ++j) temp_in[j] = input[j * 8 + i];
4442 reference_dct_1d(temp_in, temp_out);
45− for (int j = 0; j < 8; ++j)
46− output[j*8 + i] = temp_out[j];
43+ for (int j = 0; j < 8; ++j) output[j * 8 + i] = temp_out[j];
4744 }
4845 // Then transform rows
4946 for (int i = 0; i < 8; ++i) {
5047 double temp_in[8], temp_out[8];
51− for (int j = 0; j < 8; ++j)
52− temp_in[j] = output[j + i*8];
48+ for (int j = 0; j < 8; ++j) temp_in[j] = output[j + i * 8];
5349 reference_dct_1d(temp_in, temp_out);
54− for (int j = 0; j < 8; ++j)
55− output[j + i*8] = temp_out[j];
50+ for (int j = 0; j < 8; ++j) output[j + i * 8] = temp_out[j];
5651 }
5752 // Scale by some magic number
58− for (int i = 0; i < 64; ++i)
59− output[i] *= 2;
53+ for (int i = 0; i < 64; ++i) output[i] *= 2;
6054 }
6155
6256 TEST(VP9Idct8x8Test, AccuracyCheck) {
@@ -73,8 +67,7 @@ TEST(VP9Idct8x8Test, AccuracyCheck) { · 10 unmodified lines
7367 dst[j] = rnd.Rand8();
7468 }
7569 // Initialize a test block with input range [-255, 255].
76− for (int j = 0; j < 64; ++j)
77− input[j] = src[j] - dst[j];
70+ for (int j = 0; j < 64; ++j) input[j] = src[j] - dst[j];
7871
7972 reference_dct_2d(input, output_r);
8073 for (int j = 0; j < 64; ++j)
@@ -83,9 +76,8 @@ TEST(VP9Idct8x8Test, AccuracyCheck) { · 2 unmodified lines
8376 for (int j = 0; j < 64; ++j) {
8477 const int diff = dst[j] - src[j];
8578 const int error = diff * diff;
86− EXPECT_GE(1, error)
87− << "Error: 8x8 FDCT/IDCT has error " << error
88− << " at index " << j;
79+ EXPECT_GE(1, error) << "Error: 8x8 FDCT/IDCT has error " << error
80+ << " at index " << j;
8981 }
9082 }
9183 }
test/invalid_file_test.cc+32−35
@@ -34,21 +34,19 @@ std::ostream &operator<<(std::ostream &os, const DecodeParam &dp) { · 33 unmodified lines
3434 return os << "threads: " << dp.threads << " file: " << dp.filename;
3535 }
3636
37−class InvalidFileTest
38− : public ::libvpx_test::DecoderTest,
39− public ::libvpx_test::CodecTestWithParam<DecodeParam> {
37+class InvalidFileTest : public ::libvpx_test::DecoderTest,
38+ public ::libvpx_test::CodecTestWithParam<DecodeParam> {
4039 protected:
4140 InvalidFileTest() : DecoderTest(GET_PARAM(0)), res_file_(NULL) {}
4241
4342 virtual ~InvalidFileTest() {
44− if (res_file_ != NULL)
45− fclose(res_file_);
43+ if (res_file_ != NULL) fclose(res_file_);
4644 }
4745
4846 void OpenResFile(const std::string &res_file_name_) {
4947 res_file_ = libvpx_test::OpenTestDataFile(res_file_name_);
5048 ASSERT_TRUE(res_file_ != NULL) << "Result file open failed. Filename: "
51− << res_file_name_;
49+ << res_file_name_;
5250 }
5351
5452 virtual bool HandleDecodeResult(
@@ -72,8 +70,9 @@ class InvalidFileTest · 17 unmodified lines
7270 EXPECT_TRUE(res_dec == expected_res_dec ||
7371 res_dec == VPX_CODEC_CORRUPT_FRAME)
7472 << "Results don't match: frame number = " << video.frame_number()
75− << ". (" << decoder->DecodeError() << "). Expected: "
76− << expected_res_dec << " or " << VPX_CODEC_CORRUPT_FRAME;
73+ << ". (" << decoder->DecodeError()
74+ << "). Expected: " << expected_res_dec << " or "
75+ << VPX_CODEC_CORRUPT_FRAME;
7776 } else {
7877 EXPECT_EQ(expected_res_dec, res_dec)
7978 << "Results don't match: frame number = " << video.frame_number()
@@ -119,25 +118,23 @@ class InvalidFileTest · 39 unmodified lines
119118 FILE *res_file_;
120119 };
121120
122−TEST_P(InvalidFileTest, ReturnCode) {
123− RunTest();
124−}
121+TEST_P(InvalidFileTest, ReturnCode) { RunTest(); }
125122
126123 const DecodeParam kVP9InvalidFileTests[] = {
127− {1, "invalid-vp90-02-v2.webm"},
124+ { 1, "invalid-vp90-02-v2.webm" },
128125 #if CONFIG_VP9_HIGHBITDEPTH
129− {1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf"},
126+ { 1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf" },
130127 #endif
131− {1, "invalid-vp90-03-v3.webm"},
132− {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"},
133− {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"},
134− {1, "invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf"},
135− {1, "invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf"},
136− {1, "invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.v2.ivf"},
137− {1, "invalid-vp91-2-mixedrefcsp-444to420.ivf"},
138− {1, "invalid-vp90-2-12-droppable_1.ivf.s73804_r01-05_b6-.ivf"},
139− {1, "invalid-vp90-2-03-size-224x196.webm.ivf.s44156_r01-05_b6-.ivf"},
140− {1, "invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf"},
128+ { 1, "invalid-vp90-03-v3.webm" },
129+ { 1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf" },
130+ { 1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf" },
131+ { 1, "invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf" },
132+ { 1, "invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf" },
133+ { 1, "invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.v2.ivf" },
134+ { 1, "invalid-vp91-2-mixedrefcsp-444to420.ivf" },
135+ { 1, "invalid-vp90-2-12-droppable_1.ivf.s73804_r01-05_b6-.ivf" },
136+ { 1, "invalid-vp90-2-03-size-224x196.webm.ivf.s44156_r01-05_b6-.ivf" },
137+ { 1, "invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf" },
141138 };
142139
143140 VP9_INSTANTIATE_TEST_CASE(InvalidFileTest,
@@ -149,34 +146,34 @@ class InvalidFileInvalidPeekTest : public InvalidFileTest { · 5 unmodified lines
149146 protected:
150147 InvalidFileInvalidPeekTest() : InvalidFileTest() {}
151148 virtual void HandlePeekResult(libvpx_test::Decoder *const /*decoder*/,
152− libvpx_test::CompressedVideoSource* /*video*/,
149+ libvpx_test::CompressedVideoSource * /*video*/,
153150 const vpx_codec_err_t /*res_peek*/) {}
154151 };
155152
156−TEST_P(InvalidFileInvalidPeekTest, ReturnCode) {
157− RunTest();
158−}
153+TEST_P(InvalidFileInvalidPeekTest, ReturnCode) { RunTest(); }
159154
160155 const DecodeParam kVP9InvalidFileInvalidPeekTests[] = {
161− {1, "invalid-vp90-01-v3.webm"},
156+ { 1, "invalid-vp90-01-v3.webm" },
162157 };
163158
164159 VP9_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest,
165160 ::testing::ValuesIn(kVP9InvalidFileInvalidPeekTests));
166161
167162 const DecodeParam kMultiThreadedVP9InvalidFileTests[] = {
168− {4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"},
169− {4, "invalid-"
170− "vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf"},
171− {4, "invalid-vp90-2-08-tile_1x8_frame_parallel.webm.ivf.s288_r01-05_b6-.ivf"},
172− {2, "invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.v2.ivf"},
173− {4, "invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.v2.ivf"},
163+ { 4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm" },
164+ { 4,
165+ "invalid-"
166+ "vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf" },
167+ { 4,
168+ "invalid-vp90-2-08-tile_1x8_frame_parallel.webm.ivf.s288_r01-05_b6-.ivf" },
169+ { 2, "invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.v2.ivf" },
170+ { 4, "invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.v2.ivf" },
174171 };
175172
176173 INSTANTIATE_TEST_CASE_P(
177174 VP9MultiThreaded, InvalidFileTest,
178175 ::testing::Combine(
179176 ::testing::Values(
180− static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)),
177+ static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)),
181178 ::testing::ValuesIn(kMultiThreadedVP9InvalidFileTests)));
182179 } // namespace
test/ivf_video_source.h+9−14
@@ -29,19 +29,13 @@ static unsigned int MemGetLe32(const uint8_t *mem) { · 28 unmodified lines
2929 class IVFVideoSource : public CompressedVideoSource {
3030 public:
3131 explicit IVFVideoSource(const std::string &file_name)
32− : file_name_(file_name),
33− input_file_(NULL),
34− compressed_frame_buf_(NULL),
35− frame_sz_(0),
36− frame_(0),
37− end_of_file_(false) {
38− }
32+ : file_name_(file_name), input_file_(NULL), compressed_frame_buf_(NULL),
33+ frame_sz_(0), frame_(0), end_of_file_(false) {}
3934
4035 virtual ~IVFVideoSource() {
4136 delete[] compressed_frame_buf_;
4237
43− if (input_file_)
44− fclose(input_file_);
38+ if (input_file_) fclose(input_file_);
4539 }
4640
4741 virtual void Init() {
@@ -54,15 +48,16 @@ class IVFVideoSource : public CompressedVideoSource { · 6 unmodified lines
5448 virtual void Begin() {
5549 input_file_ = OpenTestDataFile(file_name_);
5650 ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
57− << file_name_;
51+ << file_name_;
5852
5953 // Read file header
6054 uint8_t file_hdr[kIvfFileHdrSize];
6155 ASSERT_EQ(kIvfFileHdrSize, fread(file_hdr, 1, kIvfFileHdrSize, input_file_))
6256 << "File header read failed.";
6357 // Check file header
64− ASSERT_TRUE(file_hdr[0] == 'D' && file_hdr[1] == 'K' && file_hdr[2] == 'I'
65− && file_hdr[3] == 'F') << "Input is not an IVF file.";
58+ ASSERT_TRUE(file_hdr[0] == 'D' && file_hdr[1] == 'K' &&
59+ file_hdr[2] == 'I' && file_hdr[3] == 'F')
60+ << "Input is not an IVF file.";
6661
6762 FillFrame();
6863 }
@@ -76,8 +71,8 @@ class IVFVideoSource : public CompressedVideoSource { · 7 unmodified lines
7671 ASSERT_TRUE(input_file_ != NULL);
7772 uint8_t frame_hdr[kIvfFrameHdrSize];
7873 // Check frame header and read a frame from input_file.
79− if (fread(frame_hdr, 1, kIvfFrameHdrSize, input_file_)
80− != kIvfFrameHdrSize) {
74+ if (fread(frame_hdr, 1, kIvfFrameHdrSize, input_file_) !=
75+ kIvfFrameHdrSize) {
8176 end_of_file_ = true;
8277 } else {
8378 end_of_file_ = false;
test/keyframe_test.cc+6−7
@@ -17,8 +17,9 @@ · 16 unmodified lines
1717
1818 namespace {
1919
20−class KeyframeTest : public ::libvpx_test::EncoderTest,
21− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
20+class KeyframeTest
21+ : public ::libvpx_test::EncoderTest,
22+ public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
2223 protected:
2324 KeyframeTest() : EncoderTest(GET_PARAM(0)) {}
2425 virtual ~KeyframeTest() {}
@@ -65,8 +66,7 @@ TEST_P(KeyframeTest, TestRandomVideoSource) { · 40 unmodified lines
6566
6667 // In realtime mode - auto placed keyframes are exceedingly rare, don't
6768 // bother with this check if(GetParam() > 0)
68− if (GET_PARAM(1) > 0)
69− EXPECT_GT(kf_count_, 1);
69+ if (GET_PARAM(1) > 0) EXPECT_GT(kf_count_, 1);
7070 }
7171
7272 TEST_P(KeyframeTest, TestDisableKeyframes) {
@@ -114,8 +114,7 @@ TEST_P(KeyframeTest, TestAutoKeyframe) { · 41 unmodified lines
114114 // may not produce a keyframe like we expect. This is necessary when running
115115 // on very slow environments (like Valgrind). The step -11 was determined
116116 // experimentally as the fastest mode that still throws the keyframe.
117− if (deadline_ == VPX_DL_REALTIME)
118− set_cpu_used_ = -11;
117+ if (deadline_ == VPX_DL_REALTIME) set_cpu_used_ = -11;
119118
120119 // This clip has a cut scene every 30 frames -> Frame 0, 30, 60, 90, 120.
121120 // I check only the first 40 frames to make sure there's a keyframe at frame
@@ -135,7 +134,7 @@ TEST_P(KeyframeTest, TestAutoKeyframe) { · 13 unmodified lines
135134 iter != kf_pts_list_.end(); ++iter) {
136135 if (deadline_ == VPX_DL_REALTIME && *iter > 0)
137136 EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame "
138− << *iter;
137+ << *iter;
139138 else
140139 EXPECT_EQ(0, *iter % 30) << "Unexpected keyframe at frame " << *iter;
141140 }
test/level_test.cc+3−6
@@ -19,12 +19,9 @@ class LevelTest · 18 unmodified lines
1919 public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
2020 protected:
2121 LevelTest()
22− : EncoderTest(GET_PARAM(0)),
23− encoding_mode_(GET_PARAM(1)),
24− cpu_used_(GET_PARAM(2)),
25− min_gf_internal_(24),
26− target_level_(0),
27− level_(0) {}
22+ : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
23+ cpu_used_(GET_PARAM(2)), min_gf_internal_(24), target_level_(0),
24+ level_(0) {}
2825 virtual ~LevelTest() {}
2926
3027 virtual void SetUp() {
test/lpf_8_test.cc+221−271
@@ -36,8 +36,7 @@ const int number_of_iterations = 10000; · 35 unmodified lines
3636
3737 #if CONFIG_VP9_HIGHBITDEPTH
3838 typedef void (*loop_op_t)(uint16_t *s, int p, const uint8_t *blimit,
39− const uint8_t *limit, const uint8_t *thresh,
40− int bd);
39+ const uint8_t *limit, const uint8_t *thresh, int bd);
4140 typedef void (*dual_loop_op_t)(uint16_t *s, int p, const uint8_t *blimit0,
4241 const uint8_t *limit0, const uint8_t *thresh0,
4342 const uint8_t *blimit1, const uint8_t *limit1,
@@ -108,21 +107,18 @@ TEST_P(Loop8Test6Param, OperationCheck) { · 64 unmodified lines
108107 for (int i = 0; i < count_test_block; ++i) {
109108 int err_count = 0;
110109 uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
111− DECLARE_ALIGNED(16, const uint8_t, blimit[16]) = {
112− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
113− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
114− };
110+ DECLARE_ALIGNED(16, const uint8_t,
111+ blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
112+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
115113 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
116− DECLARE_ALIGNED(16, const uint8_t, limit[16]) = {
117− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
118− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
119− };
114+ DECLARE_ALIGNED(16, const uint8_t,
115+ limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
116+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
120117 tmp = rnd.Rand8();
121− DECLARE_ALIGNED(16, const uint8_t, thresh[16]) = {
122− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
123− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
124− };
125− int32_t p = kNumCoeffs/32;
118+ DECLARE_ALIGNED(16, const uint8_t,
119+ thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
120+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
121+ int32_t p = kNumCoeffs / 32;
126122
127123 uint16_t tmp_s[kNumCoeffs];
128124 int j = 0;
@@ -158,7 +154,7 @@ TEST_P(Loop8Test6Param, OperationCheck) { · 29 unmodified lines
158154 ASM_REGISTER_STATE_CHECK(
159155 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd));
160156 #else
161− ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh);
157+ ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh);
162158 ASM_REGISTER_STATE_CHECK(
163159 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
164160 #endif // CONFIG_VP9_HIGHBITDEPTH
@@ -206,20 +202,17 @@ TEST_P(Loop8Test6Param, ValueCheck) { · 41 unmodified lines
206202 for (int i = 0; i < count_test_block; ++i) {
207203 int err_count = 0;
208204 uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
209− DECLARE_ALIGNED(16, const uint8_t, blimit[16]) = {
210− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
211− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
212− };
205+ DECLARE_ALIGNED(16, const uint8_t,
206+ blimit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
207+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
213208 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
214− DECLARE_ALIGNED(16, const uint8_t, limit[16]) = {
215− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
216− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
217− };
209+ DECLARE_ALIGNED(16, const uint8_t,
210+ limit[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
211+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
218212 tmp = rnd.Rand8();
219− DECLARE_ALIGNED(16, const uint8_t, thresh[16]) = {
220− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
221− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
222− };
213+ DECLARE_ALIGNED(16, const uint8_t,
214+ thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
215+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
223216 int32_t p = kNumCoeffs / 32;
224217 for (int j = 0; j < kNumCoeffs; ++j) {
225218 s[j] = rnd.Rand16() & mask_;
@@ -230,7 +223,7 @@ TEST_P(Loop8Test6Param, ValueCheck) { · 4 unmodified lines
230223 ASM_REGISTER_STATE_CHECK(
231224 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd));
232225 #else
233− ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh);
226+ ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh);
234227 ASM_REGISTER_STATE_CHECK(
235228 loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
236229 #endif // CONFIG_VP9_HIGHBITDEPTH
@@ -256,43 +249,37 @@ TEST_P(Loop8Test9Param, OperationCheck) { · 19 unmodified lines
256249 DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
257250 DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]);
258251 #else
259− DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
260− DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]);
252+ DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
253+ DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]);
261254 #endif // CONFIG_VP9_HIGHBITDEPTH
262255 int err_count_total = 0;
263256 int first_failure = -1;
264257 for (int i = 0; i < count_test_block; ++i) {
265258 int err_count = 0;
266259 uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
267− DECLARE_ALIGNED(16, const uint8_t, blimit0[16]) = {
268− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
269− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
270− };
260+ DECLARE_ALIGNED(16, const uint8_t,
261+ blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
262+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
271263 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
272− DECLARE_ALIGNED(16, const uint8_t, limit0[16]) = {
273− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
274− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
275− };
264+ DECLARE_ALIGNED(16, const uint8_t,
265+ limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
266+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
276267 tmp = rnd.Rand8();
277− DECLARE_ALIGNED(16, const uint8_t, thresh0[16]) = {
278− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
279− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
280− };
268+ DECLARE_ALIGNED(16, const uint8_t,
269+ thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
270+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
281271 tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
282− DECLARE_ALIGNED(16, const uint8_t, blimit1[16]) = {
283− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
284− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
285− };
272+ DECLARE_ALIGNED(16, const uint8_t,
273+ blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
274+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
286275 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
287− DECLARE_ALIGNED(16, const uint8_t, limit1[16]) = {
288− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
289− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
290− };
276+ DECLARE_ALIGNED(16, const uint8_t,
277+ limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
278+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
291279 tmp = rnd.Rand8();
292− DECLARE_ALIGNED(16, const uint8_t, thresh1[16]) = {
293− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
294− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
295− };
280+ DECLARE_ALIGNED(16, const uint8_t,
281+ thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
282+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
296283 int32_t p = kNumCoeffs / 32;
297284 uint16_t tmp_s[kNumCoeffs];
298285 int j = 0;
@@ -325,17 +312,16 @@ TEST_P(Loop8Test9Param, OperationCheck) { · 26 unmodified lines
325312 ref_s[j] = s[j];
326313 }
327314 #if CONFIG_VP9_HIGHBITDEPTH
328− ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0,
329− blimit1, limit1, thresh1, bd);
330− ASM_REGISTER_STATE_CHECK(
331− loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0,
332− blimit1, limit1, thresh1, bd));
315+ ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
316+ limit1, thresh1, bd);
317+ ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
318+ thresh0, blimit1, limit1, thresh1,
319+ bd));
333320 #else
334− ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0,
335− blimit1, limit1, thresh1);
336− ASM_REGISTER_STATE_CHECK(
337− loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0,
338− blimit1, limit1, thresh1));
321+ ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
322+ limit1, thresh1);
323+ ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
324+ thresh0, blimit1, limit1, thresh1));
339325 #endif // CONFIG_VP9_HIGHBITDEPTH
340326 for (int j = 0; j < kNumCoeffs; ++j) {
341327 err_count += ref_s[j] != s[j];
@@ -358,43 +344,37 @@ TEST_P(Loop8Test9Param, ValueCheck) { · 16 unmodified lines
358344 DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
359345 DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]);
360346 #else
361− DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
362− DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]);
347+ DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
348+ DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]);
363349 #endif // CONFIG_VP9_HIGHBITDEPTH
364350 int err_count_total = 0;
365351 int first_failure = -1;
366352 for (int i = 0; i < count_test_block; ++i) {
367353 int err_count = 0;
368354 uint8_t tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
369− DECLARE_ALIGNED(16, const uint8_t, blimit0[16]) = {
370− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
371− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
372− };
355+ DECLARE_ALIGNED(16, const uint8_t,
356+ blimit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
357+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
373358 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
374− DECLARE_ALIGNED(16, const uint8_t, limit0[16]) = {
375− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
376− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
377− };
359+ DECLARE_ALIGNED(16, const uint8_t,
360+ limit0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
361+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
378362 tmp = rnd.Rand8();
379− DECLARE_ALIGNED(16, const uint8_t, thresh0[16]) = {
380− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
381− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
382− };
363+ DECLARE_ALIGNED(16, const uint8_t,
364+ thresh0[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
365+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
383366 tmp = static_cast<uint8_t>(rnd(3 * MAX_LOOP_FILTER + 4));
384− DECLARE_ALIGNED(16, const uint8_t, blimit1[16]) = {
385− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
386− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
387− };
367+ DECLARE_ALIGNED(16, const uint8_t,
368+ blimit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
369+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
388370 tmp = static_cast<uint8_t>(rnd(MAX_LOOP_FILTER));
389− DECLARE_ALIGNED(16, const uint8_t, limit1[16]) = {
390− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
391− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
392− };
371+ DECLARE_ALIGNED(16, const uint8_t,
372+ limit1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
373+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
393374 tmp = rnd.Rand8();
394− DECLARE_ALIGNED(16, const uint8_t, thresh1[16]) = {
395− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
396− tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
397− };
375+ DECLARE_ALIGNED(16, const uint8_t,
376+ thresh1[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
377+ tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
398378 int32_t p = kNumCoeffs / 32; // TODO(pdlf) can we have non-square here?
399379 for (int j = 0; j < kNumCoeffs; ++j) {
400380 s[j] = rnd.Rand16() & mask_;
@@ -402,17 +382,16 @@ TEST_P(Loop8Test9Param, ValueCheck) { · 1 unmodified line
402382 }
403383 #if CONFIG_VP9_HIGHBITDEPTH
404384 const int32_t bd = bit_depth_;
405− ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0,
406− blimit1, limit1, thresh1, bd);
407− ASM_REGISTER_STATE_CHECK(
408− loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
409− thresh0, blimit1, limit1, thresh1, bd));
385+ ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
386+ limit1, thresh1, bd);
387+ ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
388+ thresh0, blimit1, limit1, thresh1,
389+ bd));
410390 #else
411− ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0,
412− blimit1, limit1, thresh1);
413− ASM_REGISTER_STATE_CHECK(
414− loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0,
415− blimit1, limit1, thresh1));
391+ ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
392+ limit1, thresh1);
393+ ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
394+ thresh0, blimit1, limit1, thresh1));
416395 #endif // CONFIG_VP9_HIGHBITDEPTH
417396 for (int j = 0; j < kNumCoeffs; ++j) {
418397 err_count += ref_s[j] != s[j];
@@ -434,129 +413,120 @@ using std::tr1::make_tuple; · 15 unmodified lines
434413 #if CONFIG_VP9_HIGHBITDEPTH
435414 INSTANTIATE_TEST_CASE_P(
436415 SSE2, Loop8Test6Param,
437− ::testing::Values(
438− make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
439− &vpx_highbd_lpf_horizontal_4_c, 8),
440− make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
441− &vpx_highbd_lpf_vertical_4_c, 8),
442− make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
443− &vpx_highbd_lpf_horizontal_8_c, 8),
444− make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
445− &vpx_highbd_lpf_horizontal_edge_8_c, 8),
446− make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
447− &vpx_highbd_lpf_horizontal_edge_16_c, 8),
448− make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
449− &vpx_highbd_lpf_vertical_8_c, 8),
450− make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
451− &vpx_highbd_lpf_vertical_16_c, 8),
452− make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
453− &vpx_highbd_lpf_horizontal_4_c, 10),
454− make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
455− &vpx_highbd_lpf_vertical_4_c, 10),
456− make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
457− &vpx_highbd_lpf_horizontal_8_c, 10),
458− make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
459− &vpx_highbd_lpf_horizontal_edge_8_c, 10),
460− make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
461− &vpx_highbd_lpf_horizontal_edge_16_c, 10),
462− make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
463− &vpx_highbd_lpf_vertical_8_c, 10),
464− make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
465− &vpx_highbd_lpf_vertical_16_c, 10),
466− make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
467− &vpx_highbd_lpf_horizontal_4_c, 12),
468− make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
469− &vpx_highbd_lpf_vertical_4_c, 12),
470− make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
471− &vpx_highbd_lpf_horizontal_8_c, 12),
472− make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
473− &vpx_highbd_lpf_horizontal_edge_8_c, 12),
474− make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
475− &vpx_highbd_lpf_horizontal_edge_16_c, 12),
476− make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
477− &vpx_highbd_lpf_vertical_8_c, 12),
478− make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
479− &vpx_highbd_lpf_vertical_16_c, 12),
480− make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
481− &vpx_highbd_lpf_vertical_16_dual_c, 8),
482− make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
483− &vpx_highbd_lpf_vertical_16_dual_c, 10),
484− make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
485− &vpx_highbd_lpf_vertical_16_dual_c, 12)));
416+ ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
417+ &vpx_highbd_lpf_horizontal_4_c, 8),
418+ make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
419+ &vpx_highbd_lpf_vertical_4_c, 8),
420+ make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
421+ &vpx_highbd_lpf_horizontal_8_c, 8),
422+ make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
423+ &vpx_highbd_lpf_horizontal_edge_8_c, 8),
424+ make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
425+ &vpx_highbd_lpf_horizontal_edge_16_c, 8),
426+ make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
427+ &vpx_highbd_lpf_vertical_8_c, 8),
428+ make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
429+ &vpx_highbd_lpf_vertical_16_c, 8),
430+ make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
431+ &vpx_highbd_lpf_horizontal_4_c, 10),
432+ make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
433+ &vpx_highbd_lpf_vertical_4_c, 10),
434+ make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
435+ &vpx_highbd_lpf_horizontal_8_c, 10),
436+ make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
437+ &vpx_highbd_lpf_horizontal_edge_8_c, 10),
438+ make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
439+ &vpx_highbd_lpf_horizontal_edge_16_c, 10),
440+ make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
441+ &vpx_highbd_lpf_vertical_8_c, 10),
442+ make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
443+ &vpx_highbd_lpf_vertical_16_c, 10),
444+ make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
445+ &vpx_highbd_lpf_horizontal_4_c, 12),
446+ make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
447+ &vpx_highbd_lpf_vertical_4_c, 12),
448+ make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
449+ &vpx_highbd_lpf_horizontal_8_c, 12),
450+ make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
451+ &vpx_highbd_lpf_horizontal_edge_8_c, 12),
452+ make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
453+ &vpx_highbd_lpf_horizontal_edge_16_c, 12),
454+ make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
455+ &vpx_highbd_lpf_vertical_8_c, 12),
456+ make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
457+ &vpx_highbd_lpf_vertical_16_c, 12),
458+ make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
459+ &vpx_highbd_lpf_vertical_16_dual_c, 8),
460+ make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
461+ &vpx_highbd_lpf_vertical_16_dual_c, 10),
462+ make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
463+ &vpx_highbd_lpf_vertical_16_dual_c, 12)));
486464 #else
487465 INSTANTIATE_TEST_CASE_P(
488466 SSE2, Loop8Test6Param,
489467 ::testing::Values(
490− make_tuple(&vpx_lpf_horizontal_4_sse2,
491− &vpx_lpf_horizontal_4_c, 8),
492− make_tuple(&vpx_lpf_horizontal_8_sse2,
493− &vpx_lpf_horizontal_8_c, 8),
468+ make_tuple(&vpx_lpf_horizontal_4_sse2, &vpx_lpf_horizontal_4_c, 8),
469+ make_tuple(&vpx_lpf_horizontal_8_sse2, &vpx_lpf_horizontal_8_c, 8),
494470 make_tuple(&vpx_lpf_horizontal_edge_8_sse2,
495471 &vpx_lpf_horizontal_edge_8_c, 8),
496472 make_tuple(&vpx_lpf_horizontal_edge_16_sse2,
497473 &vpx_lpf_horizontal_edge_16_c, 8),
498− make_tuple(&vpx_lpf_vertical_4_sse2,
499− &vpx_lpf_vertical_4_c, 8),
500− make_tuple(&vpx_lpf_vertical_8_sse2,
501− &vpx_lpf_vertical_8_c, 8),
502− make_tuple(&vpx_lpf_vertical_16_sse2,
503− &vpx_lpf_vertical_16_c, 8),
504− make_tuple(&vpx_lpf_vertical_16_dual_sse2,
505− &vpx_lpf_vertical_16_dual_c, 8)));
474+ make_tuple(&vpx_lpf_vertical_4_sse2, &vpx_lpf_vertical_4_c, 8),
475+ make_tuple(&vpx_lpf_vertical_8_sse2, &vpx_lpf_vertical_8_c, 8),
476+ make_tuple(&vpx_lpf_vertical_16_sse2, &vpx_lpf_vertical_16_c, 8),
477+ make_tuple(&vpx_lpf_vertical_16_dual_sse2, &vpx_lpf_vertical_16_dual_c,
478+ 8)));
506479 #endif // CONFIG_VP9_HIGHBITDEPTH
507480 #endif
508481
509482 #if HAVE_AVX2 && (!CONFIG_VP9_HIGHBITDEPTH)
510483 INSTANTIATE_TEST_CASE_P(
511484 AVX2, Loop8Test6Param,
512− ::testing::Values(
513− make_tuple(&vpx_lpf_horizontal_edge_8_avx2,
514− &vpx_lpf_horizontal_edge_8_c, 8),
515− make_tuple(&vpx_lpf_horizontal_edge_16_avx2,
516− &vpx_lpf_horizontal_edge_16_c, 8)));
485+ ::testing::Values(make_tuple(&vpx_lpf_horizontal_edge_8_avx2,
486+ &vpx_lpf_horizontal_edge_8_c, 8),
487+ make_tuple(&vpx_lpf_horizontal_edge_16_avx2,
488+ &vpx_lpf_horizontal_edge_16_c, 8)));
517489 #endif
518490
519491 #if HAVE_SSE2
520492 #if CONFIG_VP9_HIGHBITDEPTH
521493 INSTANTIATE_TEST_CASE_P(
522494 SSE2, Loop8Test9Param,
523− ::testing::Values(
524− make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
525− &vpx_highbd_lpf_horizontal_4_dual_c, 8),
526− make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
527− &vpx_highbd_lpf_horizontal_8_dual_c, 8),
528− make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
529− &vpx_highbd_lpf_vertical_4_dual_c, 8),
530− make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
531− &vpx_highbd_lpf_vertical_8_dual_c, 8),
532− make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
533− &vpx_highbd_lpf_horizontal_4_dual_c, 10),
534− make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
535− &vpx_highbd_lpf_horizontal_8_dual_c, 10),
536− make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
537− &vpx_highbd_lpf_vertical_4_dual_c, 10),
538− make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
539− &vpx_highbd_lpf_vertical_8_dual_c, 10),
540− make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
541− &vpx_highbd_lpf_horizontal_4_dual_c, 12),
542− make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
543− &vpx_highbd_lpf_horizontal_8_dual_c, 12),
544− make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
545− &vpx_highbd_lpf_vertical_4_dual_c, 12),
546− make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
547− &vpx_highbd_lpf_vertical_8_dual_c, 12)));
495+ ::testing::Values(make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
496+ &vpx_highbd_lpf_horizontal_4_dual_c, 8),
497+ make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
498+ &vpx_highbd_lpf_horizontal_8_dual_c, 8),
499+ make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
500+ &vpx_highbd_lpf_vertical_4_dual_c, 8),
501+ make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
502+ &vpx_highbd_lpf_vertical_8_dual_c, 8),
503+ make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
504+ &vpx_highbd_lpf_horizontal_4_dual_c, 10),
505+ make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
506+ &vpx_highbd_lpf_horizontal_8_dual_c, 10),
507+ make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
508+ &vpx_highbd_lpf_vertical_4_dual_c, 10),
509+ make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
510+ &vpx_highbd_lpf_vertical_8_dual_c, 10),
511+ make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
512+ &vpx_highbd_lpf_horizontal_4_dual_c, 12),
513+ make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
514+ &vpx_highbd_lpf_horizontal_8_dual_c, 12),
515+ make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
516+ &vpx_highbd_lpf_vertical_4_dual_c, 12),
517+ make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
518+ &vpx_highbd_lpf_vertical_8_dual_c, 12)));
548519 #else
549520 INSTANTIATE_TEST_CASE_P(
550521 SSE2, Loop8Test9Param,
551− ::testing::Values(
552− make_tuple(&vpx_lpf_horizontal_4_dual_sse2,
553− &vpx_lpf_horizontal_4_dual_c, 8),
554− make_tuple(&vpx_lpf_horizontal_8_dual_sse2,
555− &vpx_lpf_horizontal_8_dual_c, 8),
556− make_tuple(&vpx_lpf_vertical_4_dual_sse2,
557− &vpx_lpf_vertical_4_dual_c, 8),
558− make_tuple(&vpx_lpf_vertical_8_dual_sse2,
559− &vpx_lpf_vertical_8_dual_c, 8)));
522+ ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_sse2,
523+ &vpx_lpf_horizontal_4_dual_c, 8),
524+ make_tuple(&vpx_lpf_horizontal_8_dual_sse2,
525+ &vpx_lpf_horizontal_8_dual_c, 8),
526+ make_tuple(&vpx_lpf_vertical_4_dual_sse2,
527+ &vpx_lpf_vertical_4_dual_c, 8),
528+ make_tuple(&vpx_lpf_vertical_8_dual_sse2,
529+ &vpx_lpf_vertical_8_dual_c, 8)));
560530 #endif // CONFIG_VP9_HIGHBITDEPTH
561531 #endif
562532
@@ -567,39 +537,33 @@ INSTANTIATE_TEST_CASE_P( · 4 unmodified lines
567537 INSTANTIATE_TEST_CASE_P(
568538 NEON, Loop8Test6Param,
569539 ::testing::Values(
570−#if HAVE_NEON_ASM
571540 // Using #if inside the macro is unsupported on MSVS but the tests are not
572541 // currently built for MSVS with ARM and NEON.
542+#if HAVE_NEON_ASM
573543 make_tuple(&vpx_lpf_horizontal_edge_8_neon,
574544 &vpx_lpf_horizontal_edge_8_c, 8),
575545 make_tuple(&vpx_lpf_horizontal_edge_16_neon,
576546 &vpx_lpf_horizontal_edge_16_c, 8),
577− make_tuple(&vpx_lpf_vertical_16_neon,
578− &vpx_lpf_vertical_16_c, 8),
579− make_tuple(&vpx_lpf_vertical_16_dual_neon,
580− &vpx_lpf_vertical_16_dual_c, 8),
547+ make_tuple(&vpx_lpf_vertical_16_neon, &vpx_lpf_vertical_16_c, 8),
548+ make_tuple(&vpx_lpf_vertical_16_dual_neon, &vpx_lpf_vertical_16_dual_c,
549+ 8),
581550 #endif // HAVE_NEON_ASM
582− make_tuple(&vpx_lpf_horizontal_8_neon,
583− &vpx_lpf_horizontal_8_c, 8),
584− make_tuple(&vpx_lpf_vertical_8_neon,
585− &vpx_lpf_vertical_8_c, 8),
586− make_tuple(&vpx_lpf_horizontal_4_neon,
587− &vpx_lpf_horizontal_4_c, 8),
588− make_tuple(&vpx_lpf_vertical_4_neon,
589− &vpx_lpf_vertical_4_c, 8)));
590−INSTANTIATE_TEST_CASE_P(
591− NEON, Loop8Test9Param,
592− ::testing::Values(
551+ make_tuple(&vpx_lpf_horizontal_8_neon, &vpx_lpf_horizontal_8_c, 8),
552+ make_tuple(&vpx_lpf_vertical_8_neon, &vpx_lpf_vertical_8_c, 8),
553+ make_tuple(&vpx_lpf_horizontal_4_neon, &vpx_lpf_horizontal_4_c, 8),
554+ make_tuple(&vpx_lpf_vertical_4_neon, &vpx_lpf_vertical_4_c, 8)));
555+INSTANTIATE_TEST_CASE_P(NEON, Loop8Test9Param,
556+ ::testing::Values(
593557 #if HAVE_NEON_ASM
594− make_tuple(&vpx_lpf_horizontal_8_dual_neon,
595− &vpx_lpf_horizontal_8_dual_c, 8),
596− make_tuple(&vpx_lpf_vertical_8_dual_neon,
597− &vpx_lpf_vertical_8_dual_c, 8),
558+ make_tuple(&vpx_lpf_horizontal_8_dual_neon,
559+ &vpx_lpf_horizontal_8_dual_c, 8),
560+ make_tuple(&vpx_lpf_vertical_8_dual_neon,
561+ &vpx_lpf_vertical_8_dual_c, 8),
598562 #endif // HAVE_NEON_ASM
599− make_tuple(&vpx_lpf_horizontal_4_dual_neon,
600− &vpx_lpf_horizontal_4_dual_c, 8),
601− make_tuple(&vpx_lpf_vertical_4_dual_neon,
602− &vpx_lpf_vertical_4_dual_c, 8)));
563+ make_tuple(&vpx_lpf_horizontal_4_dual_neon,
564+ &vpx_lpf_horizontal_4_dual_c, 8),
565+ make_tuple(&vpx_lpf_vertical_4_dual_neon,
566+ &vpx_lpf_vertical_4_dual_c, 8)));
603567 #endif // CONFIG_VP9_HIGHBITDEPTH
604568 #endif // HAVE_NEON
605569
@@ -607,66 +571,52 @@ INSTANTIATE_TEST_CASE_P( · 1 unmodified line
607571 INSTANTIATE_TEST_CASE_P(
608572 DSPR2, Loop8Test6Param,
609573 ::testing::Values(
610− make_tuple(&vpx_lpf_horizontal_4_dspr2,
611− &vpx_lpf_horizontal_4_c, 8),
612− make_tuple(&vpx_lpf_horizontal_8_dspr2,
613− &vpx_lpf_horizontal_8_c, 8),
614− make_tuple(&vpx_lpf_horizontal_edge_8,
615− &vpx_lpf_horizontal_edge_8, 8),
616− make_tuple(&vpx_lpf_horizontal_edge_16,
617− &vpx_lpf_horizontal_edge_16, 8),
618− make_tuple(&vpx_lpf_vertical_4_dspr2,
619− &vpx_lpf_vertical_4_c, 8),
620− make_tuple(&vpx_lpf_vertical_8_dspr2,
621− &vpx_lpf_vertical_8_c, 8),
622− make_tuple(&vpx_lpf_vertical_16_dspr2,
623− &vpx_lpf_vertical_16_c, 8),
624− make_tuple(&vpx_lpf_vertical_16_dual_dspr2,
625− &vpx_lpf_vertical_16_dual_c, 8)));
574+ make_tuple(&vpx_lpf_horizontal_4_dspr2, &vpx_lpf_horizontal_4_c, 8),
575+ make_tuple(&vpx_lpf_horizontal_8_dspr2, &vpx_lpf_horizontal_8_c, 8),
576+ make_tuple(&vpx_lpf_horizontal_edge_8, &vpx_lpf_horizontal_edge_8, 8),
577+ make_tuple(&vpx_lpf_horizontal_edge_16, &vpx_lpf_horizontal_edge_16, 8),
578+ make_tuple(&vpx_lpf_vertical_4_dspr2, &vpx_lpf_vertical_4_c, 8),
579+ make_tuple(&vpx_lpf_vertical_8_dspr2, &vpx_lpf_vertical_8_c, 8),
580+ make_tuple(&vpx_lpf_vertical_16_dspr2, &vpx_lpf_vertical_16_c, 8),
581+ make_tuple(&vpx_lpf_vertical_16_dual_dspr2, &vpx_lpf_vertical_16_dual_c,
582+ 8)));
626583
627584 INSTANTIATE_TEST_CASE_P(
628585 DSPR2, Loop8Test9Param,
629− ::testing::Values(
630− make_tuple(&vpx_lpf_horizontal_4_dual_dspr2,
631− &vpx_lpf_horizontal_4_dual_c, 8),
632− make_tuple(&vpx_lpf_horizontal_8_dual_dspr2,
633− &vpx_lpf_horizontal_8_dual_c, 8),
634− make_tuple(&vpx_lpf_vertical_4_dual_dspr2,
635− &vpx_lpf_vertical_4_dual_c, 8),
636− make_tuple(&vpx_lpf_vertical_8_dual_dspr2,
637− &vpx_lpf_vertical_8_dual_c, 8)));
586+ ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_dspr2,
587+ &vpx_lpf_horizontal_4_dual_c, 8),
588+ make_tuple(&vpx_lpf_horizontal_8_dual_dspr2,
589+ &vpx_lpf_horizontal_8_dual_c, 8),
590+ make_tuple(&vpx_lpf_vertical_4_dual_dspr2,
591+ &vpx_lpf_vertical_4_dual_c, 8),
592+ make_tuple(&vpx_lpf_vertical_8_dual_dspr2,
593+ &vpx_lpf_vertical_8_dual_c, 8)));
638594 #endif // HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH
639595
640596 #if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
641597 INSTANTIATE_TEST_CASE_P(
642598 MSA, Loop8Test6Param,
643599 ::testing::Values(
644− make_tuple(&vpx_lpf_horizontal_4_msa,
645− &vpx_lpf_horizontal_4_c, 8),
646− make_tuple(&vpx_lpf_horizontal_8_msa,
647− &vpx_lpf_horizontal_8_c, 8),
648− make_tuple(&vpx_lpf_horizontal_edge_8_msa,
649− &vpx_lpf_horizontal_edge_8_c, 8),
600+ make_tuple(&vpx_lpf_horizontal_4_msa, &vpx_lpf_horizontal_4_c, 8),
601+ make_tuple(&vpx_lpf_horizontal_8_msa, &vpx_lpf_horizontal_8_c, 8),
602+ make_tuple(&vpx_lpf_horizontal_edge_8_msa, &vpx_lpf_horizontal_edge_8_c,
603+ 8),
650604 make_tuple(&vpx_lpf_horizontal_edge_16_msa,
651605 &vpx_lpf_horizontal_edge_16_c, 8),
652− make_tuple(&vpx_lpf_vertical_4_msa,
653− &vpx_lpf_vertical_4_c, 8),
654− make_tuple(&vpx_lpf_vertical_8_msa,
655− &vpx_lpf_vertical_8_c, 8),
656− make_tuple(&vpx_lpf_vertical_16_msa,
657− &vpx_lpf_vertical_16_c, 8)));
606+ make_tuple(&vpx_lpf_vertical_4_msa, &vpx_lpf_vertical_4_c, 8),
607+ make_tuple(&vpx_lpf_vertical_8_msa, &vpx_lpf_vertical_8_c, 8),
608+ make_tuple(&vpx_lpf_vertical_16_msa, &vpx_lpf_vertical_16_c, 8)));
658609
659610 INSTANTIATE_TEST_CASE_P(
660611 MSA, Loop8Test9Param,
661− ::testing::Values(
662− make_tuple(&vpx_lpf_horizontal_4_dual_msa,
663− &vpx_lpf_horizontal_4_dual_c, 8),
664− make_tuple(&vpx_lpf_horizontal_8_dual_msa,
665− &vpx_lpf_horizontal_8_dual_c, 8),
666− make_tuple(&vpx_lpf_vertical_4_dual_msa,
667− &vpx_lpf_vertical_4_dual_c, 8),
668− make_tuple(&vpx_lpf_vertical_8_dual_msa,
669− &vpx_lpf_vertical_8_dual_c, 8)));
612+ ::testing::Values(make_tuple(&vpx_lpf_horizontal_4_dual_msa,
613+ &vpx_lpf_horizontal_4_dual_c, 8),
614+ make_tuple(&vpx_lpf_horizontal_8_dual_msa,
615+ &vpx_lpf_horizontal_8_dual_c, 8),
616+ make_tuple(&vpx_lpf_vertical_4_dual_msa,
617+ &vpx_lpf_vertical_4_dual_c, 8),
618+ make_tuple(&vpx_lpf_vertical_8_dual_msa,
619+ &vpx_lpf_vertical_8_dual_c, 8)));
670620 #endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
671621
672622 } // namespace
test/md5_helper.h+10−9
@@ -17,9 +17,7 @@ · 16 unmodified lines
1717 namespace libvpx_test {
1818 class MD5 {
1919 public:
20− MD5() {
21− MD5Init(&md5_);
22− }
20+ MD5() { MD5Init(&md5_); }
2321
2422 void Add(const vpx_image_t *img) {
2523 for (int plane = 0; plane < 3; ++plane) {
@@ -30,10 +28,13 @@ class MD5 { · 4 unmodified lines
3028 // This works only for chroma_shift of 0 and 1.
3129 const int bytes_per_sample =
3230 (img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1;
33− const int h = plane ? (img->d_h + img->y_chroma_shift) >>
34− img->y_chroma_shift : img->d_h;
35− const int w = (plane ? (img->d_w + img->x_chroma_shift) >>
36− img->x_chroma_shift : img->d_w) * bytes_per_sample;
31+ const int h =
32+ plane ? (img->d_h + img->y_chroma_shift) >> img->y_chroma_shift
33+ : img->d_h;
34+ const int w =
35+ (plane ? (img->d_w + img->x_chroma_shift) >> img->x_chroma_shift
36+ : img->d_w) *
37+ bytes_per_sample;
3738
3839 for (int y = 0; y < h; ++y) {
3940 MD5Update(&md5_, buf, w);
@@ -56,8 +57,8 @@ class MD5 { · 16 unmodified lines
5657
5758 MD5Final(tmp, &ctx_tmp);
5859 for (int i = 0; i < 16; i++) {
59− res_[i * 2 + 0] = hex[tmp[i] >> 4];
60− res_[i * 2 + 1] = hex[tmp[i] & 0xf];
60+ res_[i * 2 + 0] = hex[tmp[i] >> 4];
61+ res_[i * 2 + 1] = hex[tmp[i] & 0xf];
6162 }
6263 res_[32] = 0;
6364
test/minmax_test.cc+6−8
@@ -23,9 +23,8 @@ namespace { · 22 unmodified lines
2323
2424 using ::libvpx_test::ACMRandom;
2525
26−typedef void (*MinMaxFunc)(const uint8_t *a, int a_stride,
27− const uint8_t *b, int b_stride,
28− int *min, int *max);
26+typedef void (*MinMaxFunc)(const uint8_t *a, int a_stride, const uint8_t *b,
27+ int b_stride, int *min, int *max);
2928
3029 class MinMaxTest : public ::testing::TestWithParam<MinMaxFunc> {
3130 public:
@@ -39,9 +38,8 @@ class MinMaxTest : public ::testing::TestWithParam<MinMaxFunc> { · 7 unmodified lines
3938 ACMRandom rnd_;
4039 };
4140
42−void reference_minmax(const uint8_t *a, int a_stride,
43− const uint8_t *b, int b_stride,
44− int *min_ret, int *max_ret) {
41+void reference_minmax(const uint8_t *a, int a_stride, const uint8_t *b,
42+ int b_stride, int *min_ret, int *max_ret) {
4543 int min = 255;
4644 int max = 0;
4745 for (int i = 0; i < 8; i++) {
@@ -110,9 +108,9 @@ TEST_P(MinMaxTest, CompareReferenceAndVaryStride) { · 62 unmodified lines
110108 reference_minmax(a, a_stride, b, b_stride, &min_ref, &max_ref);
111109 ASM_REGISTER_STATE_CHECK(mm_func_(a, a_stride, b, b_stride, &min, &max));
112110 EXPECT_EQ(max_ref, max) << "when a_stride = " << a_stride
113− << " and b_stride = " << b_stride;;
111+ << " and b_stride = " << b_stride;
114112 EXPECT_EQ(min_ref, min) << "when a_stride = " << a_stride
115− << " and b_stride = " << b_stride;;
113+ << " and b_stride = " << b_stride;
116114 }
117115 }
118116 }
test/partial_idct_test.cc+77−164
@@ -29,10 +29,8 @@ using libvpx_test::ACMRandom; · 28 unmodified lines
2929 namespace {
3030 typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride);
3131 typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride);
32−typedef std::tr1::tuple<FwdTxfmFunc,
33− InvTxfmFunc,
34− InvTxfmFunc,
35− TX_SIZE, int> PartialInvTxfmParam;
32+typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmFunc, InvTxfmFunc, TX_SIZE, int>
33+ PartialInvTxfmParam;
3634 const int kMaxNumCoeffs = 1024;
3735 class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> {
3836 public:
@@ -41,7 +39,7 @@ class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> { · 2 unmodified lines
4139 ftxfm_ = GET_PARAM(0);
4240 full_itxfm_ = GET_PARAM(1);
4341 partial_itxfm_ = GET_PARAM(2);
44− tx_size_ = GET_PARAM(3);
42+ tx_size_ = GET_PARAM(3);
4543 last_nonzero_ = GET_PARAM(4);
4644 }
4745
@@ -59,21 +57,11 @@ TEST_P(PartialIDctTest, RunQuantCheck) { · 11 unmodified lines
5957 ACMRandom rnd(ACMRandom::DeterministicSeed());
6058 int size;
6159 switch (tx_size_) {
62− case TX_4X4:
63− size = 4;
64− break;
65− case TX_8X8:
66− size = 8;
67− break;
68− case TX_16X16:
69− size = 16;
70− break;
71− case TX_32X32:
72− size = 32;
73− break;
74− default:
75− FAIL() << "Wrong Size!";
76− break;
60+ case TX_4X4: size = 4; break;
61+ case TX_8X8: size = 8; break;
62+ case TX_16X16: size = 16; break;
63+ case TX_32X32: size = 32; break;
64+ default: FAIL() << "Wrong Size!"; break;
7765 }
7866 DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]);
7967 DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]);
@@ -99,11 +87,9 @@ TEST_P(PartialIDctTest, RunQuantCheck) { · 19 unmodified lines
9987 for (int i = 0; i < count_test_block; ++i) {
10088 // Initialize a test block with input range [-255, 255].
10189 if (i == 0) {
102− for (int j = 0; j < block_size; ++j)
103− input_extreme_block[j] = 255;
90+ for (int j = 0; j < block_size; ++j) input_extreme_block[j] = 255;
10491 } else if (i == 1) {
105− for (int j = 0; j < block_size; ++j)
106− input_extreme_block[j] = -255;
92+ for (int j = 0; j < block_size; ++j) input_extreme_block[j] = -255;
10793 } else {
10894 for (int j = 0; j < block_size; ++j) {
10995 input_extreme_block[j] = rnd.Rand8() % 2 ? 255 : -255;
@@ -115,8 +101,8 @@ TEST_P(PartialIDctTest, RunQuantCheck) { · 5 unmodified lines
115101 // quantization with maximum allowed step sizes
116102 test_coef_block1[0] = (output_ref_block[0] / 1336) * 1336;
117103 for (int j = 1; j < last_nonzero_; ++j)
118− test_coef_block1[vp9_default_scan_orders[tx_size_].scan[j]]
119− = (output_ref_block[j] / 1828) * 1828;
104+ test_coef_block1[vp9_default_scan_orders[tx_size_].scan[j]] =
105+ (output_ref_block[j] / 1828) * 1828;
120106 }
121107
122108 ASM_REGISTER_STATE_CHECK(full_itxfm_(test_coef_block1, dst1, size));
@@ -125,8 +111,7 @@ TEST_P(PartialIDctTest, RunQuantCheck) { · 2 unmodified lines
125111 for (int j = 0; j < block_size; ++j) {
126112 const int diff = dst1[j] - dst2[j];
127113 const int error = diff * diff;
128− if (max_error < error)
129− max_error = error;
114+ if (max_error < error) max_error = error;
130115 }
131116 }
132117
@@ -138,21 +123,11 @@ TEST_P(PartialIDctTest, ResultsMatch) { · 5 unmodified lines
138123 ACMRandom rnd(ACMRandom::DeterministicSeed());
139124 int size;
140125 switch (tx_size_) {
141− case TX_4X4:
142− size = 4;
143− break;
144− case TX_8X8:
145− size = 8;
146− break;
147− case TX_16X16:
148− size = 16;
149− break;
150− case TX_32X32:
151− size = 32;
152− break;
153− default:
154− FAIL() << "Wrong Size!";
155− break;
126+ case TX_4X4: size = 4; break;
127+ case TX_8X8: size = 8; break;
128+ case TX_16X16: size = 16; break;
129+ case TX_32X32: size = 32; break;
130+ default: FAIL() << "Wrong Size!"; break;
156131 }
157132 DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]);
158133 DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]);
@@ -189,8 +164,7 @@ TEST_P(PartialIDctTest, ResultsMatch) { · 30 unmodified lines
189164 for (int j = 0; j < block_size; ++j) {
190165 const int diff = dst1[j] - dst2[j];
191166 const int error = diff * diff;
192− if (max_error < error)
193− max_error = error;
167+ if (max_error < error) max_error = error;
194168 }
195169 }
196170
@@ -201,143 +175,82 @@ using std::tr1::make_tuple; · 4 unmodified lines
201175
202176 INSTANTIATE_TEST_CASE_P(
203177 C, PartialIDctTest,
204− ::testing::Values(
205− make_tuple(&vpx_fdct32x32_c,
206− &vpx_idct32x32_1024_add_c,
207− &vpx_idct32x32_34_add_c,
208− TX_32X32, 34),
209− make_tuple(&vpx_fdct32x32_c,
210− &vpx_idct32x32_1024_add_c,
211− &vpx_idct32x32_1_add_c,
212− TX_32X32, 1),
213− make_tuple(&vpx_fdct16x16_c,
214− &vpx_idct16x16_256_add_c,
215− &vpx_idct16x16_10_add_c,
216− TX_16X16, 10),
217− make_tuple(&vpx_fdct16x16_c,
218− &vpx_idct16x16_256_add_c,
219− &vpx_idct16x16_1_add_c,
220− TX_16X16, 1),
221− make_tuple(&vpx_fdct8x8_c,
222− &vpx_idct8x8_64_add_c,
223− &vpx_idct8x8_12_add_c,
224− TX_8X8, 12),
225− make_tuple(&vpx_fdct8x8_c,
226− &vpx_idct8x8_64_add_c,
227− &vpx_idct8x8_1_add_c,
228− TX_8X8, 1),
229− make_tuple(&vpx_fdct4x4_c,
230− &vpx_idct4x4_16_add_c,
231− &vpx_idct4x4_1_add_c,
232− TX_4X4, 1)));
178+ ::testing::Values(make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c,
179+ &vpx_idct32x32_34_add_c, TX_32X32, 34),
180+ make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c,
181+ &vpx_idct32x32_1_add_c, TX_32X32, 1),
182+ make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c,
183+ &vpx_idct16x16_10_add_c, TX_16X16, 10),
184+ make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c,
185+ &vpx_idct16x16_1_add_c, TX_16X16, 1),
186+ make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
187+ &vpx_idct8x8_12_add_c, TX_8X8, 12),
188+ make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
189+ &vpx_idct8x8_1_add_c, TX_8X8, 1),
190+ make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c,
191+ &vpx_idct4x4_1_add_c, TX_4X4, 1)));
233192
234193 #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
235194 INSTANTIATE_TEST_CASE_P(
236195 NEON, PartialIDctTest,
237− ::testing::Values(
238− make_tuple(&vpx_fdct32x32_c,
239− &vpx_idct32x32_1024_add_c,
240− &vpx_idct32x32_1_add_neon,
241− TX_32X32, 1),
242− make_tuple(&vpx_fdct16x16_c,
243− &vpx_idct16x16_256_add_c,
244− &vpx_idct16x16_10_add_neon,
245− TX_16X16, 10),
246− make_tuple(&vpx_fdct16x16_c,
247− &vpx_idct16x16_256_add_c,
248− &vpx_idct16x16_1_add_neon,
249− TX_16X16, 1),
250− make_tuple(&vpx_fdct8x8_c,
251− &vpx_idct8x8_64_add_c,
252− &vpx_idct8x8_12_add_neon,
253− TX_8X8, 12),
254− make_tuple(&vpx_fdct8x8_c,
255− &vpx_idct8x8_64_add_c,
256− &vpx_idct8x8_1_add_neon,
257− TX_8X8, 1),
258− make_tuple(&vpx_fdct4x4_c,
259− &vpx_idct4x4_16_add_c,
260− &vpx_idct4x4_1_add_neon,
261− TX_4X4, 1)));
196+ ::testing::Values(make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c,
197+ &vpx_idct32x32_1_add_neon, TX_32X32, 1),
198+ make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c,
199+ &vpx_idct16x16_10_add_neon, TX_16X16, 10),
200+ make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c,
201+ &vpx_idct16x16_1_add_neon, TX_16X16, 1),
202+ make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
203+ &vpx_idct8x8_12_add_neon, TX_8X8, 12),
204+ make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
205+ &vpx_idct8x8_1_add_neon, TX_8X8, 1),
206+ make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c,
207+ &vpx_idct4x4_1_add_neon, TX_4X4, 1)));
262208 #endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
263209
264210 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
265211 INSTANTIATE_TEST_CASE_P(
266212 SSE2, PartialIDctTest,
267− ::testing::Values(
268− make_tuple(&vpx_fdct32x32_c,
269− &vpx_idct32x32_1024_add_c,
270− &vpx_idct32x32_34_add_sse2,
271− TX_32X32, 34),
272− make_tuple(&vpx_fdct32x32_c,
273− &vpx_idct32x32_1024_add_c,
274− &vpx_idct32x32_1_add_sse2,
275− TX_32X32, 1),
276− make_tuple(&vpx_fdct16x16_c,
277− &vpx_idct16x16_256_add_c,
278− &vpx_idct16x16_10_add_sse2,
279− TX_16X16, 10),
280− make_tuple(&vpx_fdct16x16_c,
281− &vpx_idct16x16_256_add_c,
282− &vpx_idct16x16_1_add_sse2,
283− TX_16X16, 1),
284− make_tuple(&vpx_fdct8x8_c,
285− &vpx_idct8x8_64_add_c,
286− &vpx_idct8x8_12_add_sse2,
287− TX_8X8, 12),
288− make_tuple(&vpx_fdct8x8_c,
289− &vpx_idct8x8_64_add_c,
290− &vpx_idct8x8_1_add_sse2,
291− TX_8X8, 1),
292− make_tuple(&vpx_fdct4x4_c,
293− &vpx_idct4x4_16_add_c,
294− &vpx_idct4x4_1_add_sse2,
295− TX_4X4, 1)));
213+ ::testing::Values(make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c,
214+ &vpx_idct32x32_34_add_sse2, TX_32X32, 34),
215+ make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c,
216+ &vpx_idct32x32_1_add_sse2, TX_32X32, 1),
217+ make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c,
218+ &vpx_idct16x16_10_add_sse2, TX_16X16, 10),
219+ make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c,
220+ &vpx_idct16x16_1_add_sse2, TX_16X16, 1),
221+ make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
222+ &vpx_idct8x8_12_add_sse2, TX_8X8, 12),
223+ make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
224+ &vpx_idct8x8_1_add_sse2, TX_8X8, 1),
225+ make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c,
226+ &vpx_idct4x4_1_add_sse2, TX_4X4, 1)));
296227 #endif
297228
298−#if HAVE_SSSE3 && ARCH_X86_64 && \
299− !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
229+#if HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
230+ !CONFIG_EMULATE_HARDWARE
300231 INSTANTIATE_TEST_CASE_P(
301232 SSSE3_64, PartialIDctTest,
302− ::testing::Values(
303− make_tuple(&vpx_fdct8x8_c,
304− &vpx_idct8x8_64_add_c,
305− &vpx_idct8x8_12_add_ssse3,
306− TX_8X8, 12)));
233+ ::testing::Values(make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
234+ &vpx_idct8x8_12_add_ssse3, TX_8X8, 12)));
307235 #endif
308236
309237 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
310238 INSTANTIATE_TEST_CASE_P(
311239 MSA, PartialIDctTest,
312− ::testing::Values(
313− make_tuple(&vpx_fdct32x32_c,
314− &vpx_idct32x32_1024_add_c,
315− &vpx_idct32x32_34_add_msa,
316− TX_32X32, 34),
317− make_tuple(&vpx_fdct32x32_c,
318− &vpx_idct32x32_1024_add_c,
319− &vpx_idct32x32_1_add_msa,
320− TX_32X32, 1),
321− make_tuple(&vpx_fdct16x16_c,
322− &vpx_idct16x16_256_add_c,
323− &vpx_idct16x16_10_add_msa,
324− TX_16X16, 10),
325− make_tuple(&vpx_fdct16x16_c,
326− &vpx_idct16x16_256_add_c,
327− &vpx_idct16x16_1_add_msa,
328− TX_16X16, 1),
329− make_tuple(&vpx_fdct8x8_c,
330− &vpx_idct8x8_64_add_c,
331− &vpx_idct8x8_12_add_msa,
332− TX_8X8, 10),
333− make_tuple(&vpx_fdct8x8_c,
334− &vpx_idct8x8_64_add_c,
335− &vpx_idct8x8_1_add_msa,
336− TX_8X8, 1),
337− make_tuple(&vpx_fdct4x4_c,
338− &vpx_idct4x4_16_add_c,
339− &vpx_idct4x4_1_add_msa,
340− TX_4X4, 1)));
240+ ::testing::Values(make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c,
241+ &vpx_idct32x32_34_add_msa, TX_32X32, 34),
242+ make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c,
243+ &vpx_idct32x32_1_add_msa, TX_32X32, 1),
244+ make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c,
245+ &vpx_idct16x16_10_add_msa, TX_16X16, 10),
246+ make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c,
247+ &vpx_idct16x16_1_add_msa, TX_16X16, 1),
248+ make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
249+ &vpx_idct8x8_12_add_msa, TX_8X8, 10),
250+ make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c,
251+ &vpx_idct8x8_1_add_msa, TX_8X8, 1),
252+ make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c,
253+ &vpx_idct4x4_1_add_msa, TX_4X4, 1)));
341254 #endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
342255
343256 } // namespace
test/pp_filter_test.cc+18−22
@@ -15,22 +15,16 @@ · 14 unmodified lines
1515 #include "vpx/vpx_integer.h"
1616 #include "vpx_mem/vpx_mem.h"
1717
18−typedef void (*PostProcFunc)(unsigned char *src_ptr,
19− unsigned char *dst_ptr,
20− int src_pixels_per_line,
21− int dst_pixels_per_line,
22− int cols,
23− unsigned char *flimit,
24− int size);
18+typedef void (*PostProcFunc)(unsigned char *src_ptr, unsigned char *dst_ptr,
19+ int src_pixels_per_line, int dst_pixels_per_line,
20+ int cols, unsigned char *flimit, int size);
2521
2622 namespace {
2723
2824 class VPxPostProcessingFilterTest
2925 : public ::testing::TestWithParam<PostProcFunc> {
3026 public:
31− virtual void TearDown() {
32− libvpx_test::ClearSystemState();
33− }
27+ virtual void TearDown() { libvpx_test::ClearSystemState(); }
3428 };
3529
3630 // Test routine for the VPx post-processing function
@@ -38,7 +32,7 @@ class VPxPostProcessingFilterTest · 1 unmodified line
3832
3933 TEST_P(VPxPostProcessingFilterTest, FilterOutputCheck) {
4034 // Size of the underlying data block that will be filtered.
41− const int block_width = 16;
35+ const int block_width = 16;
4236 const int block_height = 16;
4337
4438 // 5-tap filter needs 2 padding rows above and below the block in the input.
@@ -54,9 +48,9 @@ TEST_P(VPxPostProcessingFilterTest, FilterOutputCheck) { · 9 unmodified lines
5448 const int output_size = output_width * output_height;
5549
5650 uint8_t *const src_image =
57− reinterpret_cast<uint8_t*>(vpx_calloc(input_size, 1));
51+ reinterpret_cast<uint8_t *>(vpx_calloc(input_size, 1));
5852 uint8_t *const dst_image =
59− reinterpret_cast<uint8_t*>(vpx_calloc(output_size, 1));
53+ reinterpret_cast<uint8_t *>(vpx_calloc(output_size, 1));
6054
6155 // Pointers to top-left pixel of block in the input and output images.
6256 uint8_t *const src_image_ptr = src_image + (input_stride << 1);
@@ -80,13 +74,12 @@ TEST_P(VPxPostProcessingFilterTest, FilterOutputCheck) { · 17 unmodified lines
8074 // Initialize pixels in the output to 99.
8175 (void)memset(dst_image, 99, output_size);
8276
83− ASM_REGISTER_STATE_CHECK(
84− GetParam()(src_image_ptr, dst_image_ptr, input_stride,
85− output_stride, block_width, flimits, 16));
77+ ASM_REGISTER_STATE_CHECK(GetParam()(src_image_ptr, dst_image_ptr,
78+ input_stride, output_stride, block_width,
79+ flimits, 16));
8680
87− static const uint8_t expected_data[block_height] = {
88− 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4
89− };
81+ static const uint8_t expected_data[block_height] = { 4, 3, 1, 1, 1, 1, 1, 1,
82+ 1, 1, 1, 1, 1, 1, 3, 4 };
9083
9184 pixel_ptr = dst_image_ptr;
9285 for (int i = 0; i < block_height; ++i) {
@@ -102,16 +95,19 @@ TEST_P(VPxPostProcessingFilterTest, FilterOutputCheck) { · 9 unmodified lines
10295 vpx_free(flimits);
10396 };
10497
105−INSTANTIATE_TEST_CASE_P(C, VPxPostProcessingFilterTest,
98+INSTANTIATE_TEST_CASE_P(
99+ C, VPxPostProcessingFilterTest,
106100 ::testing::Values(vpx_post_proc_down_and_across_mb_row_c));
107101
108102 #if HAVE_SSE2
109−INSTANTIATE_TEST_CASE_P(SSE2, VPxPostProcessingFilterTest,
103+INSTANTIATE_TEST_CASE_P(
104+ SSE2, VPxPostProcessingFilterTest,
110105 ::testing::Values(vpx_post_proc_down_and_across_mb_row_sse2));
111106 #endif
112107
113108 #if HAVE_MSA
114−INSTANTIATE_TEST_CASE_P(MSA, VPxPostProcessingFilterTest,
109+INSTANTIATE_TEST_CASE_P(
110+ MSA, VPxPostProcessingFilterTest,
115111 ::testing::Values(vpx_post_proc_down_and_across_mb_row_msa));
116112 #endif
117113
test/realtime_test.cc+1−2
@@ -23,8 +23,7 @@ class RealtimeTest · 22 unmodified lines
2323 : public ::libvpx_test::EncoderTest,
2424 public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
2525 protected:
26− RealtimeTest()
27− : EncoderTest(GET_PARAM(0)), frame_packets_(0) {}
26+ RealtimeTest() : EncoderTest(GET_PARAM(0)), frame_packets_(0) {}
2827 virtual ~RealtimeTest() {}
2928
3029 virtual void SetUp() {
test/register_state_check.h+23−20
@@ -36,7 +36,7 @@ · 35 unmodified lines
3636 #include <windows.h>
3737 #include <winnt.h>
3838
39−inline bool operator==(const M128A& lhs, const M128A& rhs) {
39+inline bool operator==(const M128A &lhs, const M128A &rhs) {
4040 return (lhs.Low == rhs.Low && lhs.High == rhs.High);
4141 }
4242
@@ -51,7 +51,7 @@ class RegisterStateCheck { · 8 unmodified lines
5151 ~RegisterStateCheck() { Check(); }
5252
5353 private:
54− static bool StoreRegisters(CONTEXT* const context) {
54+ static bool StoreRegisters(CONTEXT *const context) {
5555 const HANDLE this_thread = GetCurrentThread();
5656 EXPECT_TRUE(this_thread != NULL);
5757 context->ContextFlags = CONTEXT_FLOATING_POINT;
@@ -66,8 +66,8 @@ class RegisterStateCheck { · 8 unmodified lines
6666 CONTEXT post_context;
6767 ASSERT_TRUE(StoreRegisters(&post_context));
6868
69− const M128A* xmm_pre = &pre_context_.Xmm6;
70− const M128A* xmm_post = &post_context.Xmm6;
69+ const M128A *xmm_pre = &pre_context_.Xmm6;
70+ const M128A *xmm_post = &post_context.Xmm6;
7171 for (int i = 6; i <= 15; ++i) {
7272 EXPECT_EQ(*xmm_pre, *xmm_post) << "xmm" << i << " has been modified!";
7373 ++xmm_pre;
@@ -79,15 +79,16 @@ class RegisterStateCheck { · 5 unmodified lines
7979 CONTEXT pre_context_;
8080 };
8181
82−#define ASM_REGISTER_STATE_CHECK(statement) do { \
83− libvpx_test::RegisterStateCheck reg_check; \
84− statement; \
85−} while (false)
82+#define ASM_REGISTER_STATE_CHECK(statement) \
83+ do { \
84+ libvpx_test::RegisterStateCheck reg_check; \
85+ statement; \
86+ } while (false)
8687
8788 } // namespace libvpx_test
8889
89−#elif defined(CONFIG_SHARED) && defined(HAVE_NEON_ASM) && defined(CONFIG_VP9) \
90− && !CONFIG_SHARED && HAVE_NEON_ASM && CONFIG_VP9
90+#elif defined(CONFIG_SHARED) && defined(HAVE_NEON_ASM) && \
91+ defined(CONFIG_VP9) && !CONFIG_SHARED && HAVE_NEON_ASM && CONFIG_VP9
9192
9293 extern "C" {
9394 // Save the d8-d15 registers into store.
@@ -110,18 +111,19 @@ class RegisterStateCheck { · 16 unmodified lines
110111 int64_t post_store[8];
111112 vpx_push_neon(post_store);
112113 for (int i = 0; i < 8; ++i) {
113− EXPECT_EQ(pre_store_[i], post_store[i]) << "d"
114− << i + 8 << " has been modified";
114+ EXPECT_EQ(pre_store_[i], post_store[i]) << "d" << i + 8
115+ << " has been modified";
115116 }
116117 }
117118
118119 int64_t pre_store_[8];
119120 };
120121
121−#define ASM_REGISTER_STATE_CHECK(statement) do { \
122− libvpx_test::RegisterStateCheck reg_check; \
123− statement; \
124−} while (false)
122+#define ASM_REGISTER_STATE_CHECK(statement) \
123+ do { \
124+ libvpx_test::RegisterStateCheck reg_check; \
125+ statement; \
126+ } while (false)
125127
126128 } // namespace libvpx_test
127129
@@ -165,10 +167,11 @@ class RegisterStateCheckMMX { · 37 unmodified lines
165167 uint16_t pre_fpu_env_[14];
166168 };
167169
168−#define API_REGISTER_STATE_CHECK(statement) do { \
169− libvpx_test::RegisterStateCheckMMX reg_check; \
170− ASM_REGISTER_STATE_CHECK(statement); \
171−} while (false)
170+#define API_REGISTER_STATE_CHECK(statement) \
171+ do { \
172+ libvpx_test::RegisterStateCheckMMX reg_check; \
173+ ASM_REGISTER_STATE_CHECK(statement); \
174+ } while (false)
172175
173176 } // namespace libvpx_test
174177
test/resize_test.cc+43−60
@@ -44,9 +44,9 @@ static void write_ivf_file_header(const vpx_codec_enc_cfg_t *const cfg, · 43 unmodified lines
4444 header[1] = 'K';
4545 header[2] = 'I';
4646 header[3] = 'F';
47− mem_put_le16(header + 4, 0); /* version */
48− mem_put_le16(header + 6, 32); /* headersize */
49− mem_put_le32(header + 8, 0x30395056); /* fourcc (vp9) */
47+ mem_put_le16(header + 4, 0); /* version */
48+ mem_put_le16(header + 6, 32); /* headersize */
49+ mem_put_le32(header + 8, 0x30395056); /* fourcc (vp9) */
5050 mem_put_le16(header + 12, cfg->g_w); /* width */
5151 mem_put_le16(header + 14, cfg->g_h); /* height */
5252 mem_put_le32(header + 16, cfg->g_timebase.den); /* rate */
@@ -68,8 +68,7 @@ static void write_ivf_frame_header(const vpx_codec_cx_pkt_t *const pkt, · 15 unmodified lines
6868 char header[12];
6969 vpx_codec_pts_t pts;
7070
71− if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
72− return;
71+ if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) return;
7372
7473 pts = pkt->data.frame.pts;
7574 mem_put_le32(header, static_cast<unsigned int>(pkt->data.frame.sz));
@@ -92,12 +91,9 @@ struct FrameInfo { · 16 unmodified lines
9291 unsigned int h;
9392 };
9493
95−void ScaleForFrameNumber(unsigned int frame,
96− unsigned int initial_w,
97− unsigned int initial_h,
98− unsigned int *w,
99− unsigned int *h,
100− int flag_codec) {
94+void ScaleForFrameNumber(unsigned int frame, unsigned int initial_w,
95+ unsigned int initial_h, unsigned int *w,
96+ unsigned int *h, int flag_codec) {
10197 if (frame < 10) {
10298 *w = initial_w;
10399 *h = initial_h;
@@ -219,7 +215,7 @@ void ScaleForFrameNumber(unsigned int frame, · 115 unmodified lines
219215 return;
220216 }
221217 if (frame < 250) {
222− *w = initial_w / 2;
218+ *w = initial_w / 2;
223219 *h = initial_h / 2;
224220 return;
225221 }
@@ -268,8 +264,9 @@ class ResizingVideoSource : public ::libvpx_test::DummyVideoSource { · 42 unmodified lines
268264 }
269265 };
270266
271−class ResizeTest : public ::libvpx_test::EncoderTest,
272− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
267+class ResizeTest
268+ : public ::libvpx_test::EncoderTest,
269+ public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
273270 protected:
274271 ResizeTest() : EncoderTest(GET_PARAM(0)) {}
275272
@@ -285,7 +282,7 @@ class ResizeTest : public ::libvpx_test::EncoderTest, · 9 unmodified lines
285282 frame_info_list_.push_back(FrameInfo(pts, img.d_w, img.d_h));
286283 }
287284
288− std::vector< FrameInfo > frame_info_list_;
285+ std::vector<FrameInfo> frame_info_list_;
289286 };
290287
291288 TEST_P(ResizeTest, TestExternalResizeWorks) {
@@ -299,12 +296,12 @@ TEST_P(ResizeTest, TestExternalResizeWorks) { · 7 unmodified lines
299296 const unsigned int frame = static_cast<unsigned>(info->pts);
300297 unsigned int expected_w;
301298 unsigned int expected_h;
302− ScaleForFrameNumber(frame, kInitialWidth, kInitialHeight,
303− &expected_w, &expected_h, 0);
304− EXPECT_EQ(expected_w, info->w)
305− << "Frame " << frame << " had unexpected width";
306− EXPECT_EQ(expected_h, info->h)
307− << "Frame " << frame << " had unexpected height";
299+ ScaleForFrameNumber(frame, kInitialWidth, kInitialHeight, &expected_w,
300+ &expected_h, 0);
301+ EXPECT_EQ(expected_w, info->w) << "Frame " << frame
302+ << " had unexpected width";
303+ EXPECT_EQ(expected_h, info->h) << "Frame " << frame
304+ << " had unexpected height";
308305 }
309306 }
310307
@@ -315,10 +312,7 @@ class ResizeInternalTest : public ResizeTest { · 4 unmodified lines
315312 protected:
316313 #if WRITE_COMPRESSED_STREAM
317314 ResizeInternalTest()
318− : ResizeTest(),
319− frame0_psnr_(0.0),
320− outfile_(NULL),
321− out_frames_(0) {}
315+ : ResizeTest(), frame0_psnr_(0.0), outfile_(NULL), out_frames_(0) {}
322316 #else
323317 ResizeInternalTest() : ResizeTest(), frame0_psnr_(0.0) {}
324318 #endif
@@ -347,30 +341,29 @@ class ResizeInternalTest : public ResizeTest { · 22 unmodified lines
347341 if (change_config_) {
348342 int new_q = 60;
349343 if (video->frame() == 0) {
350− struct vpx_scaling_mode mode = {VP8E_ONETWO, VP8E_ONETWO};
344+ struct vpx_scaling_mode mode = { VP8E_ONETWO, VP8E_ONETWO };
351345 encoder->Control(VP8E_SET_SCALEMODE, &mode);
352346 }
353347 if (video->frame() == 1) {
354− struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
348+ struct vpx_scaling_mode mode = { VP8E_NORMAL, VP8E_NORMAL };
355349 encoder->Control(VP8E_SET_SCALEMODE, &mode);
356350 cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = new_q;
357351 encoder->Config(&cfg_);
358352 }
359353 } else {
360354 if (video->frame() == kStepDownFrame) {
361− struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};
355+ struct vpx_scaling_mode mode = { VP8E_FOURFIVE, VP8E_THREEFIVE };
362356 encoder->Control(VP8E_SET_SCALEMODE, &mode);
363357 }
364358 if (video->frame() == kStepUpFrame) {
365− struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
359+ struct vpx_scaling_mode mode = { VP8E_NORMAL, VP8E_NORMAL };
366360 encoder->Control(VP8E_SET_SCALEMODE, &mode);
367361 }
368362 }
369363 }
370364
371365 virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
372− if (frame0_psnr_ == 0.)
373− frame0_psnr_ = pkt->data.psnr.psnr[0];
366+ if (frame0_psnr_ == 0.) frame0_psnr_ = pkt->data.psnr.psnr[0];
374367 EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0);
375368 }
376369
@@ -379,8 +372,7 @@ class ResizeInternalTest : public ResizeTest { · 2 unmodified lines
379372 ++out_frames_;
380373
381374 // Write initial file header if first frame.
382− if (pkt->data.frame.pts == 0)
383− write_ivf_file_header(&cfg_, 0, outfile_);
375+ if (pkt->data.frame.pts == 0) write_ivf_file_header(&cfg_, 0, outfile_);
384376
385377 // Write frame header and data.
386378 write_ivf_frame_header(pkt, outfile_);
@@ -434,8 +426,9 @@ TEST_P(ResizeInternalTest, TestInternalResizeChangeConfig) { · 47 unmodified lines
434426 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
435427 }
436428
437−class ResizeRealtimeTest : public ::libvpx_test::EncoderTest,
438− public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
429+class ResizeRealtimeTest
430+ : public ::libvpx_test::EncoderTest,
431+ public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
439432 protected:
440433 ResizeRealtimeTest() : EncoderTest(GET_PARAM(0)) {}
441434 virtual ~ResizeRealtimeTest() {}
@@ -465,16 +458,13 @@ class ResizeRealtimeTest : public ::libvpx_test::EncoderTest, · 23 unmodified lines
465458 frame_info_list_.push_back(FrameInfo(pts, img.d_w, img.d_h));
466459 }
467460
468− virtual void MismatchHook(const vpx_image_t *img1,
469− const vpx_image_t *img2) {
461+ virtual void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2) {
470462 double mismatch_psnr = compute_psnr(img1, img2);
471463 mismatch_psnr_ += mismatch_psnr;
472464 ++mismatch_nframes_;
473465 }
474466
475− unsigned int GetMismatchFrames() {
476− return mismatch_nframes_;
477− }
467+ unsigned int GetMismatchFrames() { return mismatch_nframes_; }
478468
479469 void DefaultConfig() {
480470 cfg_.rc_buf_initial_sz = 500;
@@ -491,14 +481,14 @@ class ResizeRealtimeTest : public ::libvpx_test::EncoderTest, · 10 unmodified lines
491481 // Enable dropped frames.
492482 cfg_.rc_dropframe_thresh = 1;
493483 // Enable error_resilience mode.
494− cfg_.g_error_resilient = 1;
484+ cfg_.g_error_resilient = 1;
495485 // Enable dynamic resizing.
496486 cfg_.rc_resize_allowed = 1;
497487 // Run at low bitrate.
498488 cfg_.rc_target_bitrate = 200;
499489 }
500490
501− std::vector< FrameInfo > frame_info_list_;
491+ std::vector<FrameInfo> frame_info_list_;
502492 int set_cpu_used_;
503493 bool change_bitrate_;
504494 double mismatch_psnr_;
@@ -521,12 +511,12 @@ TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) { · 16 unmodified lines
521511 const unsigned int frame = static_cast<unsigned>(info->pts);
522512 unsigned int expected_w;
523513 unsigned int expected_h;
524− ScaleForFrameNumber(frame, kInitialWidth, kInitialHeight,
525− &expected_w, &expected_h, 1);
526− EXPECT_EQ(expected_w, info->w)
527− << "Frame " << frame << " had unexpected width";
528− EXPECT_EQ(expected_h, info->h)
529− << "Frame " << frame << " had unexpected height";
514+ ScaleForFrameNumber(frame, kInitialWidth, kInitialHeight, &expected_w,
515+ &expected_h, 1);
516+ EXPECT_EQ(expected_w, info->w) << "Frame " << frame
517+ << " had unexpected width";
518+ EXPECT_EQ(expected_h, info->h) << "Frame " << frame
519+ << " had unexpected height";
530520 EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
531521 }
532522 }
@@ -618,10 +608,8 @@ TEST_P(ResizeRealtimeTest, TestInternalResizeDownUpChangeBitRate) { · 85 unmodified lines
618608 }
619609
620610 vpx_img_fmt_t CspForFrameNumber(int frame) {
621− if (frame < 10)
622− return VPX_IMG_FMT_I420;
623− if (frame < 20)
624− return VPX_IMG_FMT_I444;
611+ if (frame < 10) return VPX_IMG_FMT_I420;
612+ if (frame < 20) return VPX_IMG_FMT_I444;
625613 return VPX_IMG_FMT_I420;
626614 }
627615
@@ -629,10 +617,7 @@ class ResizeCspTest : public ResizeTest { · 1 unmodified line
629617 protected:
630618 #if WRITE_COMPRESSED_STREAM
631619 ResizeCspTest()
632− : ResizeTest(),
633− frame0_psnr_(0.0),
634− outfile_(NULL),
635− out_frames_(0) {}
620+ : ResizeTest(), frame0_psnr_(0.0), outfile_(NULL), out_frames_(0) {}
636621 #else
637622 ResizeCspTest() : ResizeTest(), frame0_psnr_(0.0) {}
638623 #endif
@@ -671,8 +656,7 @@ class ResizeCspTest : public ResizeTest { · 32 unmodified lines
671656 }
672657
673658 virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
674− if (frame0_psnr_ == 0.)
675− frame0_psnr_ = pkt->data.psnr.psnr[0];
659+ if (frame0_psnr_ == 0.) frame0_psnr_ = pkt->data.psnr.psnr[0];
676660 EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0);
677661 }
678662
@@ -681,8 +665,7 @@ class ResizeCspTest : public ResizeTest { · 2 unmodified lines
681665 ++out_frames_;
682666
683667 // Write initial file header if first frame.
684− if (pkt->data.frame.pts == 0)
685− write_ivf_file_header(&cfg_, 0, outfile_);
668+ if (pkt->data.frame.pts == 0) write_ivf_file_header(&cfg_, 0, outfile_);
686669
687670 // Write frame header and data.
688671 write_ivf_frame_header(pkt, outfile_);
test/sad_test.cc+18−20
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 * be found in the AUTHORS file in the root of the source tree.
99 */
1010
11−
1211 #include <string.h>
1312 #include <limits.h>
1413 #include <stdio.h>
@@ -25,7 +24,7 @@ · 10 unmodified lines
2524 #include "vpx_mem/vpx_mem.h"
2625 #include "vpx_ports/mem.h"
2726
28−template<typename Function>
27+template <typename Function>
2928 struct TestParams {
3029 TestParams(int w, int h, Function f, int bd = -1)
3130 : width(w), height(h), bit_depth(bd), func(f) {}
@@ -50,24 +49,24 @@ typedef TestParams<SadMxNx4Func> SadMxNx4Param; · 18 unmodified lines
5049 using libvpx_test::ACMRandom;
5150
5251 namespace {
53−template<typename ParamType>
52+template <typename ParamType>
5453 class SADTestBase : public ::testing::TestWithParam<ParamType> {
5554 public:
56− explicit SADTestBase(const ParamType& params) : params_(params) {}
55+ explicit SADTestBase(const ParamType &params) : params_(params) {}
5756
5857 virtual void SetUp() {
59− source_data8_ = reinterpret_cast<uint8_t*>(
58+ source_data8_ = reinterpret_cast<uint8_t *>(
6059 vpx_memalign(kDataAlignment, kDataBlockSize));
61− reference_data8_ = reinterpret_cast<uint8_t*>(
60+ reference_data8_ = reinterpret_cast<uint8_t *>(
6261 vpx_memalign(kDataAlignment, kDataBufferSize));
63− second_pred8_ = reinterpret_cast<uint8_t*>(
64− vpx_memalign(kDataAlignment, 64*64));
65− source_data16_ = reinterpret_cast<uint16_t*>(
66− vpx_memalign(kDataAlignment, kDataBlockSize*sizeof(uint16_t)));
67− reference_data16_ = reinterpret_cast<uint16_t*>(
68− vpx_memalign(kDataAlignment, kDataBufferSize*sizeof(uint16_t)));
69− second_pred16_ = reinterpret_cast<uint16_t*>(
70− vpx_memalign(kDataAlignment, 64*64*sizeof(uint16_t)));
62+ second_pred8_ =
63+ reinterpret_cast<uint8_t *>(vpx_memalign(kDataAlignment, 64 * 64));
64+ source_data16_ = reinterpret_cast<uint16_t *>(
65+ vpx_memalign(kDataAlignment, kDataBlockSize * sizeof(uint16_t)));
66+ reference_data16_ = reinterpret_cast<uint16_t *>(
67+ vpx_memalign(kDataAlignment, kDataBufferSize * sizeof(uint16_t)));
68+ second_pred16_ = reinterpret_cast<uint16_t *>(
69+ vpx_memalign(kDataAlignment, 64 * 64 * sizeof(uint16_t)));
7170
7271 if (params_.bit_depth == -1) {
7372 use_high_bit_depth_ = false;
@@ -167,13 +166,13 @@ class SADTestBase : public ::testing::TestWithParam<ParamType> { · 93 unmodified lines
167166 for (int w = 0; w < params_.width; ++w) {
168167 if (!use_high_bit_depth_) {
169168 const int tmp = second_pred8[h * params_.width + w] +
170− reference8[h * reference_stride_ + w];
169+ reference8[h * reference_stride_ + w];
171170 const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
172171 sad += abs(source8[h * source_stride_ + w] - comp_pred);
173172 #if CONFIG_VP9_HIGHBITDEPTH
174173 } else {
175174 const int tmp = second_pred16[h * params_.width + w] +
176− reference16[h * reference_stride_ + w];
175+ reference16[h * reference_stride_ + w];
177176 const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
178177 sad += abs(source16[h * source_stride_ + w] - comp_pred);
179178 #endif // CONFIG_VP9_HIGHBITDEPTH
@@ -248,9 +247,8 @@ class SADx4Test : public SADTestBase<SadMxNx4Param> { · 68 unmodified lines
248247 const uint8_t *references[] = { GetReference(0), GetReference(1),
249248 GetReference(2), GetReference(3) };
250249
251− ASM_REGISTER_STATE_CHECK(params_.func(source_data_, source_stride_,
252− references, reference_stride_,
253− results));
250+ ASM_REGISTER_STATE_CHECK(params_.func(
251+ source_data_, source_stride_, references, reference_stride_, results));
254252 }
255253
256254 void CheckSADs() const {
@@ -453,7 +451,7 @@ TEST_P(SADx4Test, ShortSrc) { · 196 unmodified lines
453451 }
454452
455453 TEST_P(SADx4Test, SrcAlignedByWidth) {
456− uint8_t * tmp_source_data = source_data_;
454+ uint8_t *tmp_source_data = source_data_;
457455 source_data_ += params_.width;
458456 FillRandom(source_data_, source_stride_);
459457 FillRandom(GetReference(0), reference_stride_);
test/set_roi.cc+43−53
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 * be found in the AUTHORS file in the root of the source tree.
99 */
1010
11−
1211 #include <math.h>
1312 #include <stddef.h>
1413 #include <stdio.h>
@@ -33,14 +32,10 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 18 unmodified lines
3332 unsigned int threshold[MAX_MB_SEGMENTS] = { 0, 100, 200, 300 };
3433
3534 const int internalq_trans[] = {
36− 0, 1, 2, 3, 4, 5, 7, 8,
37− 9, 10, 12, 13, 15, 17, 18, 19,
38− 20, 21, 23, 24, 25, 26, 27, 28,
39− 29, 30, 31, 33, 35, 37, 39, 41,
40− 43, 45, 47, 49, 51, 53, 55, 57,
41− 59, 61, 64, 67, 70, 73, 76, 79,
42− 82, 85, 88, 91, 94, 97, 100, 103,
43− 106, 109, 112, 115, 118, 121, 124, 127,
35+ 0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 15, 17, 18, 19,
36+ 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 37, 39, 41,
37+ 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 64, 67, 70, 73, 76, 79,
38+ 82, 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127,
4439 };
4540
4641 // Initialize elements of cpi with valid defaults.
@@ -60,17 +55,17 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 13 unmodified lines
6055
6156 // Allocate memory for the source memory map.
6257 unsigned char *roi_map =
63− reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1));
58+ reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1));
6459 memset(&roi_map[mbs >> 2], 1, (mbs >> 2));
6560 memset(&roi_map[mbs >> 1], 2, (mbs >> 2));
66− memset(&roi_map[mbs -(mbs >> 2)], 3, (mbs >> 2));
61+ memset(&roi_map[mbs - (mbs >> 2)], 3, (mbs >> 2));
6762
6863 // Do a test call with valid parameters.
69− int roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
70− cpi.common.mb_cols, delta_q, delta_lf,
71− threshold);
64+ int roi_retval =
65+ vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows, cpi.common.mb_cols,
66+ delta_q, delta_lf, threshold);
7267 EXPECT_EQ(0, roi_retval)
73− << "vp8_set_roimap roi failed with default test parameters";
68+ << "vp8_set_roimap roi failed with default test parameters";
7469
7570 // Check that the values in the cpi structure get set as expected.
7671 if (roi_retval == 0) {
@@ -83,9 +78,9 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 6 unmodified lines
8378 for (int i = 0; i < MAX_MB_SEGMENTS; ++i) {
8479 const int transq = internalq_trans[abs(delta_q[i])];
8580 if (abs(cpi.segment_feature_data[MB_LVL_ALT_Q][i]) != transq) {
86− EXPECT_EQ(transq, cpi.segment_feature_data[MB_LVL_ALT_Q][i])
87− << "segment delta_q error";
88− break;
81+ EXPECT_EQ(transq, cpi.segment_feature_data[MB_LVL_ALT_Q][i])
82+ << "segment delta_q error";
83+ break;
8984 }
9085 }
9186
@@ -93,7 +88,7 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 1 unmodified line
9388 for (int i = 0; i < MAX_MB_SEGMENTS; ++i) {
9489 if (cpi.segment_feature_data[MB_LVL_ALT_LF][i] != delta_lf[i]) {
9590 EXPECT_EQ(delta_lf[i], cpi.segment_feature_data[MB_LVL_ALT_LF][i])
96− << "segment delta_lf error";
91+ << "segment delta_lf error";
9792 break;
9893 }
9994 }
@@ -101,23 +96,21 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 1 unmodified line
10196 // Check the breakout thresholds
10297 for (int i = 0; i < MAX_MB_SEGMENTS; ++i) {
10398 unsigned int breakout =
104− static_cast<unsigned int>(cpi.segment_encode_breakout[i]);
99+ static_cast<unsigned int>(cpi.segment_encode_breakout[i]);
105100
106101 if (threshold[i] != breakout) {
107− EXPECT_EQ(threshold[i], breakout)
108− << "breakout threshold error";
102+ EXPECT_EQ(threshold[i], breakout) << "breakout threshold error";
109103 break;
110104 }
111105 }
112106
113107 // Segmentation, and segmentation update flages should be set.
114108 EXPECT_EQ(1, cpi.mb.e_mbd.segmentation_enabled)
115− << "segmentation_enabled error";
109+ << "segmentation_enabled error";
116110 EXPECT_EQ(1, cpi.mb.e_mbd.update_mb_segmentation_map)
117− << "update_mb_segmentation_map error";
111+ << "update_mb_segmentation_map error";
118112 EXPECT_EQ(1, cpi.mb.e_mbd.update_mb_segmentation_data)
119− << "update_mb_segmentation_data error";
120−
113+ << "update_mb_segmentation_data error";
121114
122115 // Try a range of delta q and lf parameters (some legal, some not)
123116 for (int i = 0; i < 1000; ++i) {
@@ -128,57 +121,54 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 4 unmodified lines
128121 rand_deltas[2] = rnd(160) - 80;
129122 rand_deltas[3] = rnd(160) - 80;
130123
131− deltas_valid = ((abs(rand_deltas[0]) <= 63) &&
132− (abs(rand_deltas[1]) <= 63) &&
133− (abs(rand_deltas[2]) <= 63) &&
134− (abs(rand_deltas[3]) <= 63)) ? 0 : -1;
124+ deltas_valid =
125+ ((abs(rand_deltas[0]) <= 63) && (abs(rand_deltas[1]) <= 63) &&
126+ (abs(rand_deltas[2]) <= 63) && (abs(rand_deltas[3]) <= 63))
127+ ? 0
128+ : -1;
135129
136130 // Test with random delta q values.
137− roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
138− cpi.common.mb_cols, rand_deltas,
139− delta_lf, threshold);
131+ roi_retval =
132+ vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows, cpi.common.mb_cols,
133+ rand_deltas, delta_lf, threshold);
140134 EXPECT_EQ(deltas_valid, roi_retval) << "dq range check error";
141135
142136 // One delta_q error shown at a time
143− if (deltas_valid != roi_retval)
144− break;
137+ if (deltas_valid != roi_retval) break;
145138
146139 // Test with random loop filter values.
147− roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
148− cpi.common.mb_cols, delta_q,
149− rand_deltas, threshold);
140+ roi_retval =
141+ vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows, cpi.common.mb_cols,
142+ delta_q, rand_deltas, threshold);
150143 EXPECT_EQ(deltas_valid, roi_retval) << "dlf range check error";
151144
152145 // One delta loop filter error shown at a time
153− if (deltas_valid != roi_retval)
154− break;
146+ if (deltas_valid != roi_retval) break;
155147 }
156148
157149 // Test that we report and error if cyclic refresh is enabled.
158150 cpi.cyclic_refresh_mode_enabled = 1;
159− roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
160− cpi.common.mb_cols, delta_q,
161− delta_lf, threshold);
151+ roi_retval =
152+ vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows, cpi.common.mb_cols,
153+ delta_q, delta_lf, threshold);
162154 EXPECT_EQ(-1, roi_retval) << "cyclic refresh check error";
163155 cpi.cyclic_refresh_mode_enabled = 0;
164156
165157 // Test invalid number of rows or colums.
166− roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows + 1,
167− cpi.common.mb_cols, delta_q,
168− delta_lf, threshold);
158+ roi_retval =
159+ vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows + 1,
160+ cpi.common.mb_cols, delta_q, delta_lf, threshold);
169161 EXPECT_EQ(-1, roi_retval) << "MB rows bounds check error";
170162
171− roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
172− cpi.common.mb_cols - 1, delta_q,
173− delta_lf, threshold);
163+ roi_retval =
164+ vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
165+ cpi.common.mb_cols - 1, delta_q, delta_lf, threshold);
174166 EXPECT_EQ(-1, roi_retval) << "MB cols bounds check error";
175167 }
176168
177169 // Free allocated memory
178− if (cpi.segmentation_map)
179− vpx_free(cpi.segmentation_map);
180− if (roi_map)
181− vpx_free(roi_map);
170+ if (cpi.segmentation_map) vpx_free(cpi.segmentation_map);
171+ if (roi_map) vpx_free(roi_map);
182172 };
183173
184174 } // namespace
test/sixtap_predict_test.cc+97−101
@@ -25,22 +25,19 @@ · 24 unmodified lines
2525
2626 namespace {
2727
28−typedef void (*SixtapPredictFunc)(uint8_t *src_ptr,
29− int src_pixels_per_line,
30− int xoffset,
31− int yoffset,
32− uint8_t *dst_ptr,
28+typedef void (*SixtapPredictFunc)(uint8_t *src_ptr, int src_pixels_per_line,
29+ int xoffset, int yoffset, uint8_t *dst_ptr,
3330 int dst_pitch);
3431
3532 typedef std::tr1::tuple<int, int, SixtapPredictFunc> SixtapPredictParam;
3633
37−class SixtapPredictTest
38− : public ::testing::TestWithParam<SixtapPredictParam> {
34+class SixtapPredictTest : public ::testing::TestWithParam<SixtapPredictParam> {
3935 public:
4036 static void SetUpTestCase() {
41− src_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kSrcSize));
42− dst_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kDstSize));
43− dst_c_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kDstSize));
37+ src_ = reinterpret_cast<uint8_t *>(vpx_memalign(kDataAlignment, kSrcSize));
38+ dst_ = reinterpret_cast<uint8_t *>(vpx_memalign(kDataAlignment, kDstSize));
39+ dst_c_ =
40+ reinterpret_cast<uint8_t *>(vpx_memalign(kDataAlignment, kDstSize));
4441 }
4542
4643 static void TearDownTestCase() {
@@ -52,9 +49,7 @@ class SixtapPredictTest · 5 unmodified lines
5249 dst_c_ = NULL;
5350 }
5451
55− virtual void TearDown() {
56− libvpx_test::ClearSystemState();
57− }
52+ virtual void TearDown() { libvpx_test::ClearSystemState(); }
5853
5954 protected:
6055 // Make test arrays big enough for 16x16 functions. Six-tap filters
@@ -80,74 +75,76 @@ class SixtapPredictTest · 19 unmodified lines
8075 // The src stores the macroblock we will filter on, and makes it 1 byte larger
8176 // in order to test unaligned access. The result is stored in dst and dst_c(c
8277 // reference code result).
83− static uint8_t* src_;
84− static uint8_t* dst_;
85− static uint8_t* dst_c_;
78+ static uint8_t *src_;
79+ static uint8_t *dst_;
80+ static uint8_t *dst_c_;
8681 };
8782
88−uint8_t* SixtapPredictTest::src_ = NULL;
89−uint8_t* SixtapPredictTest::dst_ = NULL;
90−uint8_t* SixtapPredictTest::dst_c_ = NULL;
83+uint8_t *SixtapPredictTest::src_ = NULL;
84+uint8_t *SixtapPredictTest::dst_ = NULL;
85+uint8_t *SixtapPredictTest::dst_c_ = NULL;
9186
9287 TEST_P(SixtapPredictTest, TestWithPresetData) {
9388 // Test input
9489 static const uint8_t test_data[kSrcSize] = {
95− 216, 184, 4, 191, 82, 92, 41, 0, 1, 226, 236, 172, 20, 182, 42, 226, 177,
96− 79, 94, 77, 179, 203, 206, 198, 22, 192, 19, 75, 17, 192, 44, 233, 120,
97− 48, 168, 203, 141, 210, 203, 143, 180, 184, 59, 201, 110, 102, 171, 32,
98− 182, 10, 109, 105, 213, 60, 47, 236, 253, 67, 55, 14, 3, 99, 247, 124,
99− 148, 159, 71, 34, 114, 19, 177, 38, 203, 237, 239, 58, 83, 155, 91, 10,
100− 166, 201, 115, 124, 5, 163, 104, 2, 231, 160, 16, 234, 4, 8, 103, 153,
101− 167, 174, 187, 26, 193, 109, 64, 141, 90, 48, 200, 174, 204, 36, 184,
102− 114, 237, 43, 238, 242, 207, 86, 245, 182, 247, 6, 161, 251, 14, 8, 148,
103− 182, 182, 79, 208, 120, 188, 17, 6, 23, 65, 206, 197, 13, 242, 126, 128,
104− 224, 170, 110, 211, 121, 197, 200, 47, 188, 207, 208, 184, 221, 216, 76,
105− 148, 143, 156, 100, 8, 89, 117, 14, 112, 183, 221, 54, 197, 208, 180, 69,
106− 176, 94, 180, 131, 215, 121, 76, 7, 54, 28, 216, 238, 249, 176, 58, 142,
107− 64, 215, 242, 72, 49, 104, 87, 161, 32, 52, 216, 230, 4, 141, 44, 181,
108− 235, 224, 57, 195, 89, 134, 203, 144, 162, 163, 126, 156, 84, 185, 42,
109− 148, 145, 29, 221, 194, 134, 52, 100, 166, 105, 60, 140, 110, 201, 184,
110− 35, 181, 153, 93, 121, 243, 227, 68, 131, 134, 232, 2, 35, 60, 187, 77,
111− 209, 76, 106, 174, 15, 241, 227, 115, 151, 77, 175, 36, 187, 121, 221,
112− 223, 47, 118, 61, 168, 105, 32, 237, 236, 167, 213, 238, 202, 17, 170,
113− 24, 226, 247, 131, 145, 6, 116, 117, 121, 11, 194, 41, 48, 126, 162, 13,
114− 93, 209, 131, 154, 122, 237, 187, 103, 217, 99, 60, 200, 45, 78, 115, 69,
115− 49, 106, 200, 194, 112, 60, 56, 234, 72, 251, 19, 120, 121, 182, 134, 215,
116− 135, 10, 114, 2, 247, 46, 105, 209, 145, 165, 153, 191, 243, 12, 5, 36,
117− 119, 206, 231, 231, 11, 32, 209, 83, 27, 229, 204, 149, 155, 83, 109, 35,
118− 93, 223, 37, 84, 14, 142, 37, 160, 52, 191, 96, 40, 204, 101, 77, 67, 52,
119− 53, 43, 63, 85, 253, 147, 113, 226, 96, 6, 125, 179, 115, 161, 17, 83,
120− 198, 101, 98, 85, 139, 3, 137, 75, 99, 178, 23, 201, 255, 91, 253, 52,
121− 134, 60, 138, 131, 208, 251, 101, 48, 2, 227, 228, 118, 132, 245, 202,
122− 75, 91, 44, 160, 231, 47, 41, 50, 147, 220, 74, 92, 219, 165, 89, 16
90+ 216, 184, 4, 191, 82, 92, 41, 0, 1, 226, 236, 172, 20, 182, 42,
91+ 226, 177, 79, 94, 77, 179, 203, 206, 198, 22, 192, 19, 75, 17, 192,
92+ 44, 233, 120, 48, 168, 203, 141, 210, 203, 143, 180, 184, 59, 201, 110,
93+ 102, 171, 32, 182, 10, 109, 105, 213, 60, 47, 236, 253, 67, 55, 14,
94+ 3, 99, 247, 124, 148, 159, 71, 34, 114, 19, 177, 38, 203, 237, 239,
95+ 58, 83, 155, 91, 10, 166, 201, 115, 124, 5, 163, 104, 2, 231, 160,
96+ 16, 234, 4, 8, 103, 153, 167, 174, 187, 26, 193, 109, 64, 141, 90,
97+ 48, 200, 174, 204, 36, 184, 114, 237, 43, 238, 242, 207, 86, 245, 182,
98+ 247, 6, 161, 251, 14, 8, 148, 182, 182, 79, 208, 120, 188, 17, 6,
99+ 23, 65, 206, 197, 13, 242, 126, 128, 224, 170, 110, 211, 121, 197, 200,
100+ 47, 188, 207, 208, 184, 221, 216, 76, 148, 143, 156, 100, 8, 89, 117,
101+ 14, 112, 183, 221, 54, 197, 208, 180, 69, 176, 94, 180, 131, 215, 121,
102+ 76, 7, 54, 28, 216, 238, 249, 176, 58, 142, 64, 215, 242, 72, 49,
103+ 104, 87, 161, 32, 52, 216, 230, 4, 141, 44, 181, 235, 224, 57, 195,
104+ 89, 134, 203, 144, 162, 163, 126, 156, 84, 185, 42, 148, 145, 29, 221,
105+ 194, 134, 52, 100, 166, 105, 60, 140, 110, 201, 184, 35, 181, 153, 93,
106+ 121, 243, 227, 68, 131, 134, 232, 2, 35, 60, 187, 77, 209, 76, 106,
107+ 174, 15, 241, 227, 115, 151, 77, 175, 36, 187, 121, 221, 223, 47, 118,
108+ 61, 168, 105, 32, 237, 236, 167, 213, 238, 202, 17, 170, 24, 226, 247,
109+ 131, 145, 6, 116, 117, 121, 11, 194, 41, 48, 126, 162, 13, 93, 209,
110+ 131, 154, 122, 237, 187, 103, 217, 99, 60, 200, 45, 78, 115, 69, 49,
111+ 106, 200, 194, 112, 60, 56, 234, 72, 251, 19, 120, 121, 182, 134, 215,
112+ 135, 10, 114, 2, 247, 46, 105, 209, 145, 165, 153, 191, 243, 12, 5,
113+ 36, 119, 206, 231, 231, 11, 32, 209, 83, 27, 229, 204, 149, 155, 83,
114+ 109, 35, 93, 223, 37, 84, 14, 142, 37, 160, 52, 191, 96, 40, 204,
115+ 101, 77, 67, 52, 53, 43, 63, 85, 253, 147, 113, 226, 96, 6, 125,
116+ 179, 115, 161, 17, 83, 198, 101, 98, 85, 139, 3, 137, 75, 99, 178,
117+ 23, 201, 255, 91, 253, 52, 134, 60, 138, 131, 208, 251, 101, 48, 2,
118+ 227, 228, 118, 132, 245, 202, 75, 91, 44, 160, 231, 47, 41, 50, 147,
119+ 220, 74, 92, 219, 165, 89, 16
123120 };
124121
125122 // Expected result
126123 static const uint8_t expected_dst[kDstSize] = {
127− 117, 102, 74, 135, 42, 98, 175, 206, 70, 73, 222, 197, 50, 24, 39, 49, 38,
128− 105, 90, 47, 169, 40, 171, 215, 200, 73, 109, 141, 53, 85, 177, 164, 79,
129− 208, 124, 89, 212, 18, 81, 145, 151, 164, 217, 153, 91, 154, 102, 102,
130− 159, 75, 164, 152, 136, 51, 213, 219, 186, 116, 193, 224, 186, 36, 231,
131− 208, 84, 211, 155, 167, 35, 59, 42, 76, 216, 149, 73, 201, 78, 149, 184,
132− 100, 96, 196, 189, 198, 188, 235, 195, 117, 129, 120, 129, 49, 25, 133,
133− 113, 69, 221, 114, 70, 143, 99, 157, 108, 189, 140, 78, 6, 55, 65, 240,
134− 255, 245, 184, 72, 90, 100, 116, 131, 39, 60, 234, 167, 33, 160, 88, 185,
135− 200, 157, 159, 176, 127, 151, 138, 102, 168, 106, 170, 86, 82, 219, 189,
136− 76, 33, 115, 197, 106, 96, 198, 136, 97, 141, 237, 151, 98, 137, 191,
137− 185, 2, 57, 95, 142, 91, 255, 185, 97, 137, 76, 162, 94, 173, 131, 193,
138− 161, 81, 106, 72, 135, 222, 234, 137, 66, 137, 106, 243, 210, 147, 95,
139− 15, 137, 110, 85, 66, 16, 96, 167, 147, 150, 173, 203, 140, 118, 196,
140− 84, 147, 160, 19, 95, 101, 123, 74, 132, 202, 82, 166, 12, 131, 166,
141− 189, 170, 159, 85, 79, 66, 57, 152, 132, 203, 194, 0, 1, 56, 146, 180,
142− 224, 156, 28, 83, 181, 79, 76, 80, 46, 160, 175, 59, 106, 43, 87, 75,
143− 136, 85, 189, 46, 71, 200, 90
124+ 117, 102, 74, 135, 42, 98, 175, 206, 70, 73, 222, 197, 50, 24, 39,
125+ 49, 38, 105, 90, 47, 169, 40, 171, 215, 200, 73, 109, 141, 53, 85,
126+ 177, 164, 79, 208, 124, 89, 212, 18, 81, 145, 151, 164, 217, 153, 91,
127+ 154, 102, 102, 159, 75, 164, 152, 136, 51, 213, 219, 186, 116, 193, 224,
128+ 186, 36, 231, 208, 84, 211, 155, 167, 35, 59, 42, 76, 216, 149, 73,
129+ 201, 78, 149, 184, 100, 96, 196, 189, 198, 188, 235, 195, 117, 129, 120,
130+ 129, 49, 25, 133, 113, 69, 221, 114, 70, 143, 99, 157, 108, 189, 140,
131+ 78, 6, 55, 65, 240, 255, 245, 184, 72, 90, 100, 116, 131, 39, 60,
132+ 234, 167, 33, 160, 88, 185, 200, 157, 159, 176, 127, 151, 138, 102, 168,
133+ 106, 170, 86, 82, 219, 189, 76, 33, 115, 197, 106, 96, 198, 136, 97,
134+ 141, 237, 151, 98, 137, 191, 185, 2, 57, 95, 142, 91, 255, 185, 97,
135+ 137, 76, 162, 94, 173, 131, 193, 161, 81, 106, 72, 135, 222, 234, 137,
136+ 66, 137, 106, 243, 210, 147, 95, 15, 137, 110, 85, 66, 16, 96, 167,
137+ 147, 150, 173, 203, 140, 118, 196, 84, 147, 160, 19, 95, 101, 123, 74,
138+ 132, 202, 82, 166, 12, 131, 166, 189, 170, 159, 85, 79, 66, 57, 152,
139+ 132, 203, 194, 0, 1, 56, 146, 180, 224, 156, 28, 83, 181, 79, 76,
140+ 80, 46, 160, 175, 59, 106, 43, 87, 75, 136, 85, 189, 46, 71, 200,
141+ 90
144142 };
145143
146− uint8_t *src = const_cast<uint8_t*>(test_data);
144+ uint8_t *src = const_cast<uint8_t *>(test_data);
147145
148− ASM_REGISTER_STATE_CHECK(
149− sixtap_predict_(&src[kSrcStride * 2 + 2 + 1], kSrcStride,
150− 2, 2, dst_, kDstStride));
146+ ASM_REGISTER_STATE_CHECK(sixtap_predict_(&src[kSrcStride * 2 + 2 + 1],
147+ kSrcStride, 2, 2, dst_, kDstStride));
151148
152149 for (int i = 0; i < height_; ++i)
153150 for (int j = 0; j < width_; ++j)
@@ -159,8 +156,7 @@ using libvpx_test::ACMRandom; · 5 unmodified lines
159156
160157 TEST_P(SixtapPredictTest, TestWithRandomData) {
161158 ACMRandom rnd(ACMRandom::DeterministicSeed());
162− for (int i = 0; i < kSrcSize; ++i)
163− src_[i] = rnd.Rand8();
159+ for (int i = 0; i < kSrcSize; ++i) src_[i] = rnd.Rand8();
164160
165161 // Run tests for all possible offsets.
166162 for (int xoffset = 0; xoffset < 8; ++xoffset) {
@@ -172,9 +168,9 @@ TEST_P(SixtapPredictTest, TestWithRandomData) { · 5 unmodified lines
172168 xoffset, yoffset, dst_c_, kDstStride);
173169
174170 // Run test.
175− ASM_REGISTER_STATE_CHECK(
176− sixtap_predict_(&src_[kSrcStride * 2 + 2 + 1], kSrcStride,
177− xoffset, yoffset, dst_, kDstStride));
171+ ASM_REGISTER_STATE_CHECK(sixtap_predict_(&src_[kSrcStride * 2 + 2 + 1],
172+ kSrcStride, xoffset, yoffset,
173+ dst_, kDstStride));
178174
179175 for (int i = 0; i < height_; ++i)
180176 for (int j = 0; j < width_; ++j)
@@ -187,47 +183,47 @@ TEST_P(SixtapPredictTest, TestWithRandomData) { · 6 unmodified lines
187183 using std::tr1::make_tuple;
188184
189185 INSTANTIATE_TEST_CASE_P(
190− C, SixtapPredictTest, ::testing::Values(
191− make_tuple(16, 16, &vp8_sixtap_predict16x16_c),
192− make_tuple(8, 8, &vp8_sixtap_predict8x8_c),
193− make_tuple(8, 4, &vp8_sixtap_predict8x4_c),
194− make_tuple(4, 4, &vp8_sixtap_predict4x4_c)));
186+ C, SixtapPredictTest,
187+ ::testing::Values(make_tuple(16, 16, &vp8_sixtap_predict16x16_c),
188+ make_tuple(8, 8, &vp8_sixtap_predict8x8_c),
189+ make_tuple(8, 4, &vp8_sixtap_predict8x4_c),
190+ make_tuple(4, 4, &vp8_sixtap_predict4x4_c)));
195191 #if HAVE_NEON
196192 INSTANTIATE_TEST_CASE_P(
197− NEON, SixtapPredictTest, ::testing::Values(
198− make_tuple(16, 16, &vp8_sixtap_predict16x16_neon),
199− make_tuple(8, 8, &vp8_sixtap_predict8x8_neon),
200− make_tuple(8, 4, &vp8_sixtap_predict8x4_neon)));
193+ NEON, SixtapPredictTest,
194+ ::testing::Values(make_tuple(16, 16, &vp8_sixtap_predict16x16_neon),
195+ make_tuple(8, 8, &vp8_sixtap_predict8x8_neon),
196+ make_tuple(8, 4, &vp8_sixtap_predict8x4_neon)));
201197 #endif
202198 #if HAVE_MMX
203199 INSTANTIATE_TEST_CASE_P(
204− MMX, SixtapPredictTest, ::testing::Values(
205− make_tuple(16, 16, &vp8_sixtap_predict16x16_mmx),
206− make_tuple(8, 8, &vp8_sixtap_predict8x8_mmx),
207− make_tuple(8, 4, &vp8_sixtap_predict8x4_mmx),
208− make_tuple(4, 4, &vp8_sixtap_predict4x4_mmx)));
200+ MMX, SixtapPredictTest,
201+ ::testing::Values(make_tuple(16, 16, &vp8_sixtap_predict16x16_mmx),
202+ make_tuple(8, 8, &vp8_sixtap_predict8x8_mmx),
203+ make_tuple(8, 4, &vp8_sixtap_predict8x4_mmx),
204+ make_tuple(4, 4, &vp8_sixtap_predict4x4_mmx)));
209205 #endif
210206 #if HAVE_SSE2
211207 INSTANTIATE_TEST_CASE_P(
212− SSE2, SixtapPredictTest, ::testing::Values(
213− make_tuple(16, 16, &vp8_sixtap_predict16x16_sse2),
214− make_tuple(8, 8, &vp8_sixtap_predict8x8_sse2),
215− make_tuple(8, 4, &vp8_sixtap_predict8x4_sse2)));
208+ SSE2, SixtapPredictTest,
209+ ::testing::Values(make_tuple(16, 16, &vp8_sixtap_predict16x16_sse2),
210+ make_tuple(8, 8, &vp8_sixtap_predict8x8_sse2),
211+ make_tuple(8, 4, &vp8_sixtap_predict8x4_sse2)));
216212 #endif
217213 #if HAVE_SSSE3
218214 INSTANTIATE_TEST_CASE_P(
219− SSSE3, SixtapPredictTest, ::testing::Values(
220− make_tuple(16, 16, &vp8_sixtap_predict16x16_ssse3),
221− make_tuple(8, 8, &vp8_sixtap_predict8x8_ssse3),
222− make_tuple(8, 4, &vp8_sixtap_predict8x4_ssse3),
223− make_tuple(4, 4, &vp8_sixtap_predict4x4_ssse3)));
215+ SSSE3, SixtapPredictTest,
216+ ::testing::Values(make_tuple(16, 16, &vp8_sixtap_predict16x16_ssse3),
217+ make_tuple(8, 8, &vp8_sixtap_predict8x8_ssse3),
218+ make_tuple(8, 4, &vp8_sixtap_predict8x4_ssse3),
219+ make_tuple(4, 4, &vp8_sixtap_predict4x4_ssse3)));
224220 #endif
225221 #if HAVE_MSA
226222 INSTANTIATE_TEST_CASE_P(
227− MSA, SixtapPredictTest, ::testing::Values(
228− make_tuple(16, 16, &vp8_sixtap_predict16x16_msa),
229− make_tuple(8, 8, &vp8_sixtap_predict8x8_msa),
230− make_tuple(8, 4, &vp8_sixtap_predict8x4_msa),
231− make_tuple(4, 4, &vp8_sixtap_predict4x4_msa)));
223+ MSA, SixtapPredictTest,
224+ ::testing::Values(make_tuple(16, 16, &vp8_sixtap_predict16x16_msa),
225+ make_tuple(8, 8, &vp8_sixtap_predict8x8_msa),
226+ make_tuple(8, 4, &vp8_sixtap_predict8x4_msa),
227+ make_tuple(4, 4, &vp8_sixtap_predict4x4_msa)));
232228 #endif
233229 } // namespace
test/sum_squares_test.cc+10−12
@@ -52,9 +52,9 @@ TEST_P(SumSquaresTest, OperationCheck) { · 51 unmodified lines
5252 const int limit = 1 << (msb + 1);
5353
5454 for (int k = 0; k < kNumIterations; k++) {
55− const int size = 4 << rnd(6); // Up to 128x128
56− int stride = 4 << rnd(7); // Up to 256 stride
57− while (stride < size) { // Make sure it's valid
55+ const int size = 4 << rnd(6); // Up to 128x128
56+ int stride = 4 << rnd(7); // Up to 256 stride
57+ while (stride < size) { // Make sure it's valid
5858 stride = 4 << rnd(7);
5959 }
6060
@@ -68,9 +68,8 @@ TEST_P(SumSquaresTest, OperationCheck) { · 7 unmodified lines
6868 uint64_t res_tst;
6969 ASM_REGISTER_STATE_CHECK(res_tst = tst_func_(src, stride, size));
7070
71− ASSERT_EQ(res_ref, res_tst)
72− << "Error: Sum Squares Test"
73− << " C output does not match optimized output.";
71+ ASSERT_EQ(res_ref, res_tst) << "Error: Sum Squares Test"
72+ << " C output does not match optimized output.";
7473 }
7574 }
7675
@@ -81,9 +80,9 @@ TEST_P(SumSquaresTest, ExtremeValues) { · 4 unmodified lines
8180 const int limit = 1 << (msb + 1);
8281
8382 for (int k = 0; k < kNumIterations; k++) {
84− const int size = 4 << rnd(6); // Up to 128x128
85− int stride = 4 << rnd(7); // Up to 256 stride
86− while (stride < size) { // Make sure it's valid
83+ const int size = 4 << rnd(6); // Up to 128x128
84+ int stride = 4 << rnd(7); // Up to 256 stride
85+ while (stride < size) { // Make sure it's valid
8786 stride = 4 << rnd(7);
8887 }
8988
@@ -98,9 +97,8 @@ TEST_P(SumSquaresTest, ExtremeValues) { · 8 unmodified lines
9897 uint64_t res_tst;
9998 ASM_REGISTER_STATE_CHECK(res_tst = tst_func_(src, stride, size));
10099
101− ASSERT_EQ(res_ref, res_tst)
102− << "Error: Sum Squares Test"
103− << " C output does not match optimized output.";
100+ ASSERT_EQ(res_ref, res_tst) << "Error: Sum Squares Test"
101+ << " C output does not match optimized output.";
104102 }
105103 }
106104
test/superframe_test.cc+19−23
@@ -18,13 +18,14 @@ namespace { · 17 unmodified lines
1818
1919 const int kTestMode = 0;
2020
21−typedef std::tr1::tuple<libvpx_test::TestMode,int> SuperframeTestParam;
21+typedef std::tr1::tuple<libvpx_test::TestMode, int> SuperframeTestParam;
2222
23−class SuperframeTest : public ::libvpx_test::EncoderTest,
24− public ::libvpx_test::CodecTestWithParam<SuperframeTestParam> {
23+class SuperframeTest
24+ : public ::libvpx_test::EncoderTest,
25+ public ::libvpx_test::CodecTestWithParam<SuperframeTestParam> {
2526 protected:
26− SuperframeTest() : EncoderTest(GET_PARAM(0)), modified_buf_(NULL),
27− last_sf_pts_(0) {}
27+ SuperframeTest()
28+ : EncoderTest(GET_PARAM(0)), modified_buf_(NULL), last_sf_pts_(0) {}
2829 virtual ~SuperframeTest() {}
2930
3031 virtual void SetUp() {
@@ -36,9 +37,7 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 5 unmodified lines
3637 sf_count_max_ = INT_MAX;
3738 }
3839
39− virtual void TearDown() {
40− delete[] modified_buf_;
41− }
40+ virtual void TearDown() { delete[] modified_buf_; }
4241
4342 virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
4443 libvpx_test::Encoder *encoder) {
@@ -47,25 +46,21 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 2 unmodified lines
4746 }
4847 }
4948
50− virtual const vpx_codec_cx_pkt_t * MutateEncoderOutputHook(
49+ virtual const vpx_codec_cx_pkt_t *MutateEncoderOutputHook(
5150 const vpx_codec_cx_pkt_t *pkt) {
52− if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
53− return pkt;
51+ if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) return pkt;
5452
55− const uint8_t *buffer = reinterpret_cast<uint8_t*>(pkt->data.frame.buf);
53+ const uint8_t *buffer = reinterpret_cast<uint8_t *>(pkt->data.frame.buf);
5654 const uint8_t marker = buffer[pkt->data.frame.sz - 1];
5755 const int frames = (marker & 0x7) + 1;
5856 const int mag = ((marker >> 3) & 3) + 1;
5957 const unsigned int index_sz = 2 + mag * frames;
60− if ((marker & 0xe0) == 0xc0 &&
61− pkt->data.frame.sz >= index_sz &&
58+ if ((marker & 0xe0) == 0xc0 && pkt->data.frame.sz >= index_sz &&
6259 buffer[pkt->data.frame.sz - index_sz] == marker) {
6360 // frame is a superframe. strip off the index.
64− if (modified_buf_)
65− delete[] modified_buf_;
61+ if (modified_buf_) delete[] modified_buf_;
6662 modified_buf_ = new uint8_t[pkt->data.frame.sz - index_sz];
67− memcpy(modified_buf_, pkt->data.frame.buf,
68− pkt->data.frame.sz - index_sz);
63+ memcpy(modified_buf_, pkt->data.frame.buf, pkt->data.frame.sz - index_sz);
6964 modified_pkt_ = *pkt;
7065 modified_pkt_.data.frame.buf = modified_buf_;
7166 modified_pkt_.data.frame.sz -= index_sz;
@@ -76,8 +71,8 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 4 unmodified lines
7671 }
7772
7873 // Make sure we do a few frames after the last SF
79− abort_ |= sf_count_ > sf_count_max_ &&
80− pkt->data.frame.pts - last_sf_pts_ >= 5;
74+ abort_ |=
75+ sf_count_ > sf_count_max_ && pkt->data.frame.pts - last_sf_pts_ >= 5;
8176 return pkt;
8277 }
8378
@@ -98,7 +93,8 @@ TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) { · 14 unmodified lines
9893 EXPECT_EQ(sf_count_, 1);
9994 }
10095
101−VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
102− ::testing::Values(::libvpx_test::kTwoPassGood),
103− ::testing::Values(0)));
96+VP9_INSTANTIATE_TEST_CASE(
97+ SuperframeTest,
98+ ::testing::Combine(::testing::Values(::libvpx_test::kTwoPassGood),
99+ ::testing::Values(0)));
104100 } // namespace
test/svc_test.cc+45−53
@@ -33,10 +33,8 @@ class SvcTest : public ::testing::Test { · 32 unmodified lines
3333 static const uint32_t kHeight = 288;
3434
3535 SvcTest()
36− : codec_iface_(0),
37− test_file_name_("hantro_collage_w352h288.yuv"),
38− codec_initialized_(false),
39− decoder_(0) {
36+ : codec_iface_(0), test_file_name_("hantro_collage_w352h288.yuv"),
37+ codec_initialized_(false), decoder_(0) {
4038 memset(&svc_, 0, sizeof(svc_));
4139 memset(&codec_, 0, sizeof(codec_));
4240 memset(&codec_enc_, 0, sizeof(codec_enc_));
@@ -70,7 +68,7 @@ class SvcTest : public ::testing::Test { · 27 unmodified lines
7068
7169 virtual void TearDown() {
7270 ReleaseEncoder();
73− delete(decoder_);
71+ delete (decoder_);
7472 }
7573
7674 void InitializeEncoder() {
@@ -97,7 +95,7 @@ class SvcTest : public ::testing::Test { · 20 unmodified lines
9795 if (cx_pkt->kind == VPX_CODEC_STATS_PKT) {
9896 EXPECT_GT(cx_pkt->data.twopass_stats.sz, 0U);
9997 ASSERT_TRUE(cx_pkt->data.twopass_stats.buf != NULL);
100− stats_buf->append(static_cast<char*>(cx_pkt->data.twopass_stats.buf),
98+ stats_buf->append(static_cast<char *>(cx_pkt->data.twopass_stats.buf),
10199 cx_pkt->data.twopass_stats.sz);
102100 }
103101 }
@@ -113,10 +111,9 @@ class SvcTest : public ::testing::Test { · 9 unmodified lines
113111 codec_enc_.g_pass = VPX_RC_FIRST_PASS;
114112 InitializeEncoder();
115113
116− libvpx_test::I420VideoSource video(test_file_name_,
117− codec_enc_.g_w, codec_enc_.g_h,
118− codec_enc_.g_timebase.den,
119− codec_enc_.g_timebase.num, 0, 30);
114+ libvpx_test::I420VideoSource video(
115+ test_file_name_, codec_enc_.g_w, codec_enc_.g_h,
116+ codec_enc_.g_timebase.den, codec_enc_.g_timebase.num, 0, 30);
120117 video.Begin();
121118
122119 for (int i = 0; i < n; ++i) {
@@ -128,8 +125,8 @@ class SvcTest : public ::testing::Test { · 5 unmodified lines
128125 }
129126
130127 // Flush encoder and test EOS packet.
131− res = vpx_svc_encode(&svc_, &codec_, NULL, video.pts(),
132− video.duration(), VPX_DL_GOOD_QUALITY);
128+ res = vpx_svc_encode(&svc_, &codec_, NULL, video.pts(), video.duration(),
129+ VPX_DL_GOOD_QUALITY);
133130 ASSERT_EQ(VPX_CODEC_OK, res);
134131 GetStatsData(stats_buf);
135132
@@ -163,8 +160,8 @@ class SvcTest : public ::testing::Test { · 27 unmodified lines
163160 }
164161 }
165162
166− void Pass2EncodeNFrames(std::string *const stats_buf,
167− const int n, const int layers,
163+ void Pass2EncodeNFrames(std::string *const stats_buf, const int n,
164+ const int layers,
168165 struct vpx_fixed_buf *const outputs) {
169166 vpx_codec_err_t res;
170167 size_t frame_received = 0;
@@ -182,10 +179,9 @@ class SvcTest : public ::testing::Test { · 11 unmodified lines
182179 }
183180 InitializeEncoder();
184181
185− libvpx_test::I420VideoSource video(test_file_name_,
186− codec_enc_.g_w, codec_enc_.g_h,
187− codec_enc_.g_timebase.den,
188− codec_enc_.g_timebase.num, 0, 30);
182+ libvpx_test::I420VideoSource video(
183+ test_file_name_, codec_enc_.g_w, codec_enc_.g_h,
184+ codec_enc_.g_timebase.den, codec_enc_.g_timebase.num, 0, 30);
189185 video.Begin();
190186
191187 for (int i = 0; i < n; ++i) {
@@ -197,8 +193,8 @@ class SvcTest : public ::testing::Test { · 5 unmodified lines
197193 }
198194
199195 // Flush encoder.
200− res = vpx_svc_encode(&svc_, &codec_, NULL, 0,
201− video.duration(), VPX_DL_GOOD_QUALITY);
196+ res = vpx_svc_encode(&svc_, &codec_, NULL, 0, video.duration(),
197+ VPX_DL_GOOD_QUALITY);
202198 EXPECT_EQ(VPX_CODEC_OK, res);
203199 StoreFrames(n, outputs, &frame_received);
204200
@@ -217,9 +213,8 @@ class SvcTest : public ::testing::Test { · 12 unmodified lines
217213 for (int i = 0; i < n; ++i) {
218214 ASSERT_TRUE(inputs[i].buf != NULL);
219215 ASSERT_GT(inputs[i].sz, 0U);
220− const vpx_codec_err_t res_dec =
221− decoder_->DecodeFrame(static_cast<const uint8_t *>(inputs[i].buf),
222− inputs[i].sz);
216+ const vpx_codec_err_t res_dec = decoder_->DecodeFrame(
217+ static_cast<const uint8_t *>(inputs[i].buf), inputs[i].sz);
223218 ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder_->DecodeError();
224219 ++decoded_frames;
225220
@@ -240,17 +235,16 @@ class SvcTest : public ::testing::Test { · 14 unmodified lines
240235 ASSERT_GT(remained_spatial_layers, 0);
241236
242237 for (int i = 0; i < num_super_frames; ++i) {
243− uint32_t frame_sizes[8] = {0};
238+ uint32_t frame_sizes[8] = { 0 };
244239 int frame_count = 0;
245240 int frames_found = 0;
246241 int frame;
247242 ASSERT_TRUE(inputs[i].buf != NULL);
248243 ASSERT_GT(inputs[i].sz, 0U);
249244
250− vpx_codec_err_t res =
251− vp9_parse_superframe_index(static_cast<const uint8_t*>(inputs[i].buf),
252− inputs[i].sz, frame_sizes, &frame_count,
253− NULL, NULL);
245+ vpx_codec_err_t res = vp9_parse_superframe_index(
246+ static_cast<const uint8_t *>(inputs[i].buf), inputs[i].sz,
247+ frame_sizes, &frame_count, NULL, NULL);
254248 ASSERT_EQ(VPX_CODEC_OK, res);
255249
256250 if (frame_count == 0) {
@@ -258,28 +252,27 @@ class SvcTest : public ::testing::Test { · 1 unmodified line
258252 ASSERT_EQ(1, remained_spatial_layers);
259253 } else {
260254 // Found a super frame.
261− uint8_t *frame_data = static_cast<uint8_t*>(inputs[i].buf);
255+ uint8_t *frame_data = static_cast<uint8_t *>(inputs[i].buf);
262256 uint8_t *frame_start = frame_data;
263257 for (frame = 0; frame < frame_count; ++frame) {
264258 // Looking for a visible frame.
265259 if (frame_data[0] & 0x02) {
266260 ++frames_found;
267− if (frames_found == remained_spatial_layers)
268− break;
261+ if (frames_found == remained_spatial_layers) break;
269262 }
270263 frame_data += frame_sizes[frame];
271264 }
272− ASSERT_LT(frame, frame_count) << "Couldn't find a visible frame. "
265+ ASSERT_LT(frame, frame_count)
266+ << "Couldn't find a visible frame. "
273267 << "remained_spatial_layers: " << remained_spatial_layers
274268 << " super_frame: " << i;
275− if (frame == frame_count - 1)
276− continue;
269+ if (frame == frame_count - 1) continue;
277270
278271 frame_data += frame_sizes[frame];
279272
280273 // We need to add one more frame for multiple frame contexts.
281274 uint8_t marker =
282− static_cast<const uint8_t*>(inputs[i].buf)[inputs[i].sz - 1];
275+ static_cast<const uint8_t *>(inputs[i].buf)[inputs[i].sz - 1];
283276 const uint32_t mag = ((marker >> 3) & 0x3) + 1;
284277 const size_t index_sz = 2 + mag * frame_count;
285278 const size_t new_index_sz = 2 + mag * (frame + 1);
@@ -445,7 +438,7 @@ TEST_F(SvcTest, SetAutoAltRefOption) { · 159 unmodified lines
445438 // Test that decoder can handle an SVC frame as the first frame in a sequence.
446439 TEST_F(SvcTest, OnePassEncodeOneFrame) {
447440 codec_enc_.g_pass = VPX_RC_ONE_PASS;
448− vpx_fixed_buf output = {0};
441+ vpx_fixed_buf output = { 0 };
449442 Pass2EncodeNFrames(NULL, 1, 2, &output);
450443 DecodeNFrames(&output, 1);
451444 FreeBitstreamBuffers(&output, 1);
@@ -539,8 +532,7 @@ TEST_F(SvcTest, TwoPassEncode2SNRLayers) { · 87 unmodified lines
539532
540533 // Second pass encode
541534 codec_enc_.g_pass = VPX_RC_LAST_PASS;
542− vpx_svc_set_options(&svc_,
543− "auto-alt-refs=1,1 scale-factors=1/1,1/1");
535+ vpx_svc_set_options(&svc_, "auto-alt-refs=1,1 scale-factors=1/1,1/1");
544536 vpx_fixed_buf outputs[20];
545537 memset(&outputs[0], 0, sizeof(outputs));
546538 Pass2EncodeNFrames(&stats_buf, 20, 2, &outputs[0]);
@@ -556,8 +548,7 @@ TEST_F(SvcTest, TwoPassEncode3SNRLayersDecode321Layers) { · 9 unmodified lines
556548
557549 // Second pass encode
558550 codec_enc_.g_pass = VPX_RC_LAST_PASS;
559− vpx_svc_set_options(&svc_,
560− "auto-alt-refs=1,1,1 scale-factors=1/1,1/1,1/1");
551+ vpx_svc_set_options(&svc_, "auto-alt-refs=1,1,1 scale-factors=1/1,1/1,1/1");
561552 vpx_fixed_buf outputs[20];
562553 memset(&outputs[0], 0, sizeof(outputs));
563554 Pass2EncodeNFrames(&stats_buf, 20, 3, &outputs[0]);
@@ -572,8 +563,7 @@ TEST_F(SvcTest, TwoPassEncode3SNRLayersDecode321Layers) { · 8 unmodified lines
572563
573564 TEST_F(SvcTest, SetMultipleFrameContextsOption) {
574565 svc_.spatial_layers = 5;
575− vpx_codec_err_t res =
576− vpx_svc_set_options(&svc_, "multi-frame-contexts=1");
566+ vpx_codec_err_t res = vpx_svc_set_options(&svc_, "multi-frame-contexts=1");
577567 EXPECT_EQ(VPX_CODEC_OK, res);
578568 res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
579569 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
@@ -626,7 +616,8 @@ TEST_F(SvcTest, TwoPassEncode2SNRLayersWithMultipleFrameContexts) { · 46 unmodified lines
626616 // Second pass encode
627617 codec_enc_.g_pass = VPX_RC_LAST_PASS;
628618 codec_enc_.g_error_resilient = 0;
629− vpx_svc_set_options(&svc_, "auto-alt-refs=1,1 scale-factors=1/1,1/1 "
619+ vpx_svc_set_options(&svc_,
620+ "auto-alt-refs=1,1 scale-factors=1/1,1/1 "
630621 "multi-frame-contexts=1");
631622 vpx_fixed_buf outputs[10];
632623 memset(&outputs[0], 0, sizeof(outputs));
@@ -645,7 +636,8 @@ TEST_F(SvcTest, · 12 unmodified lines
645636 // Second pass encode
646637 codec_enc_.g_pass = VPX_RC_LAST_PASS;
647638 codec_enc_.g_error_resilient = 0;
648− vpx_svc_set_options(&svc_, "auto-alt-refs=1,1,1 scale-factors=1/1,1/1,1/1 "
639+ vpx_svc_set_options(&svc_,
640+ "auto-alt-refs=1,1,1 scale-factors=1/1,1/1,1/1 "
649641 "multi-frame-contexts=1");
650642 vpx_fixed_buf outputs[10];
651643 memset(&outputs[0], 0, sizeof(outputs));
@@ -689,7 +681,8 @@ TEST_F(SvcTest, TwoPassEncode2TemporalLayersWithMultipleFrameContexts) { · 37 unmodified lines
689681 codec_enc_.g_pass = VPX_RC_LAST_PASS;
690682 svc_.temporal_layers = 2;
691683 codec_enc_.g_error_resilient = 0;
692− vpx_svc_set_options(&svc_, "auto-alt-refs=1 scale-factors=1/1 "
684+ vpx_svc_set_options(&svc_,
685+ "auto-alt-refs=1 scale-factors=1/1 "
693686 "multi-frame-contexts=1");
694687 vpx_fixed_buf outputs[10];
695688 memset(&outputs[0], 0, sizeof(outputs));
@@ -714,8 +707,7 @@ TEST_F(SvcTest, TwoPassEncode2TemporalLayersDecodeBaseLayer) { · 18 unmodified lines
714707 Pass2EncodeNFrames(&stats_buf, 10, 1, &outputs[0]);
715708
716709 vpx_fixed_buf base_layer[5];
717− for (int i = 0; i < 5; ++i)
718− base_layer[i] = outputs[i * 2];
710+ for (int i = 0; i < 5; ++i) base_layer[i] = outputs[i * 2];
719711
720712 DecodeNFrames(&base_layer[0], 5);
721713 FreeBitstreamBuffers(&outputs[0], 10);
@@ -733,15 +725,15 @@ TEST_F(SvcTest, · 11 unmodified lines
733725 codec_enc_.g_pass = VPX_RC_LAST_PASS;
734726 svc_.temporal_layers = 2;
735727 codec_enc_.g_error_resilient = 0;
736− vpx_svc_set_options(&svc_, "auto-alt-refs=1 scale-factors=1/1 "
728+ vpx_svc_set_options(&svc_,
729+ "auto-alt-refs=1 scale-factors=1/1 "
737730 "multi-frame-contexts=1");
738731 vpx_fixed_buf outputs[10];
739732 memset(&outputs[0], 0, sizeof(outputs));
740733 Pass2EncodeNFrames(&stats_buf, 10, 1, &outputs[0]);
741734
742735 vpx_fixed_buf base_layer[5];
743− for (int i = 0; i < 5; ++i)
744− base_layer[i] = outputs[i * 2];
736+ for (int i = 0; i < 5; ++i) base_layer[i] = outputs[i * 2];
745737
746738 DecodeNFrames(&base_layer[0], 5);
747739 FreeBitstreamBuffers(&outputs[0], 10);
@@ -769,8 +761,7 @@ TEST_F(SvcTest, TwoPassEncode2TemporalLayersWithTiles) { · 21 unmodified lines
769761 FreeBitstreamBuffers(&outputs[0], 10);
770762 }
771763
772−TEST_F(SvcTest,
773− TwoPassEncode2TemporalLayersWithMultipleFrameContextsAndTiles) {
764+TEST_F(SvcTest, TwoPassEncode2TemporalLayersWithMultipleFrameContextsAndTiles) {
774765 // First pass encode
775766 std::string stats_buf;
776767 vpx_svc_set_options(&svc_, "scale-factors=1/1");
@@ -785,7 +776,8 @@ TEST_F(SvcTest, · 8 unmodified lines
785776 codec_enc_.g_h = 144;
786777 tile_columns_ = 1;
787778 tile_rows_ = 1;
788− vpx_svc_set_options(&svc_, "auto-alt-refs=1 scale-factors=1/1 "
779+ vpx_svc_set_options(&svc_,
780+ "auto-alt-refs=1 scale-factors=1/1 "
789781 "multi-frame-contexts=1");
790782 vpx_fixed_buf outputs[10];
791783 memset(&outputs[0], 0, sizeof(outputs));
test/test_intra_pred_speed.cc+55−82
@@ -31,9 +31,9 @@ typedef void (*VpxPredFunc)(uint8_t *dst, ptrdiff_t y_stride, · 30 unmodified lines
3131
3232 const int kNumVp9IntraPredFuncs = 13;
3333 const char *kVp9IntraPredNames[kNumVp9IntraPredFuncs] = {
34− "DC_PRED", "DC_LEFT_PRED", "DC_TOP_PRED", "DC_128_PRED", "V_PRED", "H_PRED",
35− "D45_PRED", "D135_PRED", "D117_PRED", "D153_PRED", "D207_PRED", "D63_PRED",
36− "TM_PRED"
34+ "DC_PRED", "DC_LEFT_PRED", "DC_TOP_PRED", "DC_128_PRED", "V_PRED",
35+ "H_PRED", "D45_PRED", "D135_PRED", "D117_PRED", "D153_PRED",
36+ "D207_PRED", "D63_PRED", "TM_PRED"
3737 };
3838
3939 void TestIntraPred(const char name[], VpxPredFunc const *pred_funcs,
@@ -82,18 +82,12 @@ void TestIntraPred(const char name[], VpxPredFunc const *pred_funcs, · 42 unmodified lines
8282 void TestIntraPred4(VpxPredFunc const *pred_funcs) {
8383 static const int kNumVp9IntraFuncs = 13;
8484 static const char *const kSignatures[kNumVp9IntraFuncs] = {
85− "4334156168b34ab599d9b5b30f522fe9",
86− "bc4649d5ba47c7ff178d92e475960fb0",
87− "8d316e5933326dcac24e1064794b5d12",
88− "a27270fed024eafd762c95de85f4da51",
89− "c33dff000d4256c2b8f3bf9e9bab14d2",
90− "44d8cddc2ad8f79b8ed3306051722b4f",
91− "eb54839b2bad6699d8946f01ec041cd0",
92− "ecb0d56ae5f677ea45127ce9d5c058e4",
93− "0b7936841f6813da818275944895b574",
94− "9117972ef64f91a58ff73e1731c81db2",
95− "c56d5e8c729e46825f46dd5d3b5d508a",
96− "c0889e2039bcf7bcb5d2f33cdca69adc",
85+ "4334156168b34ab599d9b5b30f522fe9", "bc4649d5ba47c7ff178d92e475960fb0",
86+ "8d316e5933326dcac24e1064794b5d12", "a27270fed024eafd762c95de85f4da51",
87+ "c33dff000d4256c2b8f3bf9e9bab14d2", "44d8cddc2ad8f79b8ed3306051722b4f",
88+ "eb54839b2bad6699d8946f01ec041cd0", "ecb0d56ae5f677ea45127ce9d5c058e4",
89+ "0b7936841f6813da818275944895b574", "9117972ef64f91a58ff73e1731c81db2",
90+ "c56d5e8c729e46825f46dd5d3b5d508a", "c0889e2039bcf7bcb5d2f33cdca69adc",
9791 "309a618577b27c648f9c5ee45252bc8f",
9892 };
9993 TestIntraPred("Intra4", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs,
@@ -103,18 +97,12 @@ void TestIntraPred4(VpxPredFunc const *pred_funcs) { · 3 unmodified lines
10397 void TestIntraPred8(VpxPredFunc const *pred_funcs) {
10498 static const int kNumVp9IntraFuncs = 13;
10599 static const char *const kSignatures[kNumVp9IntraFuncs] = {
106− "7694ddeeefed887faf9d339d18850928",
107− "7d726b1213591b99f736be6dec65065b",
108− "19c5711281357a485591aaf9c96c0a67",
109− "ba6b66877a089e71cd938e3b8c40caac",
110− "802440c93317e0f8ba93fab02ef74265",
111− "9e09a47a15deb0b9d8372824f9805080",
112− "b7c2d8c662268c0c427da412d7b0311d",
113− "78339c1c60bb1d67d248ab8c4da08b7f",
114− "5c97d70f7d47de1882a6cd86c165c8a9",
115− "8182bf60688b42205acd95e59e967157",
116− "08323400005a297f16d7e57e7fe1eaac",
117− "95f7bfc262329a5849eda66d8f7c68ce",
100+ "7694ddeeefed887faf9d339d18850928", "7d726b1213591b99f736be6dec65065b",
101+ "19c5711281357a485591aaf9c96c0a67", "ba6b66877a089e71cd938e3b8c40caac",
102+ "802440c93317e0f8ba93fab02ef74265", "9e09a47a15deb0b9d8372824f9805080",
103+ "b7c2d8c662268c0c427da412d7b0311d", "78339c1c60bb1d67d248ab8c4da08b7f",
104+ "5c97d70f7d47de1882a6cd86c165c8a9", "8182bf60688b42205acd95e59e967157",
105+ "08323400005a297f16d7e57e7fe1eaac", "95f7bfc262329a5849eda66d8f7c68ce",
118106 "815b75c8e0d91cc1ae766dc5d3e445a3",
119107 };
120108 TestIntraPred("Intra8", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs,
@@ -124,18 +112,12 @@ void TestIntraPred8(VpxPredFunc const *pred_funcs) { · 3 unmodified lines
124112 void TestIntraPred16(VpxPredFunc const *pred_funcs) {
125113 static const int kNumVp9IntraFuncs = 13;
126114 static const char *const kSignatures[kNumVp9IntraFuncs] = {
127− "b40dbb555d5d16a043dc361e6694fe53",
128− "fb08118cee3b6405d64c1fd68be878c6",
129− "6c190f341475c837cc38c2e566b64875",
130− "db5c34ccbe2c7f595d9b08b0dc2c698c",
131− "a62cbfd153a1f0b9fed13e62b8408a7a",
132− "143df5b4c89335e281103f610f5052e4",
133− "d87feb124107cdf2cfb147655aa0bb3c",
134− "7841fae7d4d47b519322e6a03eeed9dc",
135− "f6ebed3f71cbcf8d6d0516ce87e11093",
136− "3cc480297dbfeed01a1c2d78dd03d0c5",
137− "b9f69fa6532b372c545397dcb78ef311",
138− "a8fe1c70432f09d0c20c67bdb6432c4d",
115+ "b40dbb555d5d16a043dc361e6694fe53", "fb08118cee3b6405d64c1fd68be878c6",
116+ "6c190f341475c837cc38c2e566b64875", "db5c34ccbe2c7f595d9b08b0dc2c698c",
117+ "a62cbfd153a1f0b9fed13e62b8408a7a", "143df5b4c89335e281103f610f5052e4",
118+ "d87feb124107cdf2cfb147655aa0bb3c", "7841fae7d4d47b519322e6a03eeed9dc",
119+ "f6ebed3f71cbcf8d6d0516ce87e11093", "3cc480297dbfeed01a1c2d78dd03d0c5",
120+ "b9f69fa6532b372c545397dcb78ef311", "a8fe1c70432f09d0c20c67bdb6432c4d",
139121 "b8a41aa968ec108af447af4217cba91b",
140122 };
141123 TestIntraPred("Intra16", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs,
@@ -145,18 +127,12 @@ void TestIntraPred16(VpxPredFunc const *pred_funcs) { · 3 unmodified lines
145127 void TestIntraPred32(VpxPredFunc const *pred_funcs) {
146128 static const int kNumVp9IntraFuncs = 13;
147129 static const char *const kSignatures[kNumVp9IntraFuncs] = {
148− "558541656d84f9ae7896db655826febe",
149− "b3587a1f9a01495fa38c8cd3c8e2a1bf",
150− "4c6501e64f25aacc55a2a16c7e8f0255",
151− "b3b01379ba08916ef6b1b35f7d9ad51c",
152− "0f1eb38b6cbddb3d496199ef9f329071",
153− "911c06efb9ed1c3b4c104b232b55812f",
154− "9225beb0ddfa7a1d24eaa1be430a6654",
155− "0a6d584a44f8db9aa7ade2e2fdb9fc9e",
156− "b01c9076525216925f3456f034fb6eee",
157− "d267e20ad9e5cd2915d1a47254d3d149",
158− "ed012a4a5da71f36c2393023184a0e59",
159− "f162b51ed618d28b936974cff4391da5",
130+ "558541656d84f9ae7896db655826febe", "b3587a1f9a01495fa38c8cd3c8e2a1bf",
131+ "4c6501e64f25aacc55a2a16c7e8f0255", "b3b01379ba08916ef6b1b35f7d9ad51c",
132+ "0f1eb38b6cbddb3d496199ef9f329071", "911c06efb9ed1c3b4c104b232b55812f",
133+ "9225beb0ddfa7a1d24eaa1be430a6654", "0a6d584a44f8db9aa7ade2e2fdb9fc9e",
134+ "b01c9076525216925f3456f034fb6eee", "d267e20ad9e5cd2915d1a47254d3d149",
135+ "ed012a4a5da71f36c2393023184a0e59", "f162b51ed618d28b936974cff4391da5",
160136 "9e1370c6d42e08d357d9612c93a71cfc",
161137 };
162138 TestIntraPred("Intra32", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs,
@@ -167,13 +143,13 @@ void TestIntraPred32(VpxPredFunc const *pred_funcs) { · 4 unmodified lines
167143
168144 // Defines a test case for |arch| (e.g., C, SSE2, ...) passing the predictors
169145 // to |test_func|. The test name is 'arch.test_func', e.g., C.TestIntraPred4.
170−#define INTRA_PRED_TEST(arch, test_func, dc, dc_left, dc_top, dc_128, v, h, \
171− d45, d135, d117, d153, d207, d63, tm) \
172− TEST(arch, test_func) { \
173− static const VpxPredFunc vpx_intra_pred[] = { \
174− dc, dc_left, dc_top, dc_128, v, h, d45, \
175− d135, d117, d153, d207, d63, tm}; \
176− test_func(vpx_intra_pred); \
146+#define INTRA_PRED_TEST(arch, test_func, dc, dc_left, dc_top, dc_128, v, h, \
147+ d45, d135, d117, d153, d207, d63, tm) \
148+ TEST(arch, test_func) { \
149+ static const VpxPredFunc vpx_intra_pred[] = { \
150+ dc, dc_left, dc_top, dc_128, v, h, d45, d135, d117, d153, d207, d63, tm \
151+ }; \
152+ test_func(vpx_intra_pred); \
177153 }
178154
179155 // -----------------------------------------------------------------------------
@@ -197,9 +173,8 @@ INTRA_PRED_TEST(SSE2, TestIntraPred4, vpx_dc_predictor_4x4_sse2, · 17 unmodified lines
197173 #endif // HAVE_SSE2
198174
199175 #if HAVE_SSSE3
200−INTRA_PRED_TEST(SSSE3, TestIntraPred4, NULL, NULL, NULL, NULL, NULL,
201− NULL, NULL, NULL, NULL,
202− vpx_d153_predictor_4x4_ssse3, NULL,
176+INTRA_PRED_TEST(SSSE3, TestIntraPred4, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
177+ NULL, NULL, vpx_d153_predictor_4x4_ssse3, NULL,
203178 vpx_d63_predictor_4x4_ssse3, NULL)
204179 #endif // HAVE_SSSE3
205180
@@ -222,8 +197,8 @@ INTRA_PRED_TEST(NEON, TestIntraPred4, vpx_dc_predictor_4x4_neon, · 16 unmodified lines
222197 INTRA_PRED_TEST(MSA, TestIntraPred4, vpx_dc_predictor_4x4_msa,
223198 vpx_dc_left_predictor_4x4_msa, vpx_dc_top_predictor_4x4_msa,
224199 vpx_dc_128_predictor_4x4_msa, vpx_v_predictor_4x4_msa,
225− vpx_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL,
226− NULL, vpx_tm_predictor_4x4_msa)
200+ vpx_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL, NULL,
201+ vpx_tm_predictor_4x4_msa)
227202 #endif // HAVE_MSA
228203
229204 // -----------------------------------------------------------------------------
@@ -246,10 +221,9 @@ INTRA_PRED_TEST(SSE2, TestIntraPred8, vpx_dc_predictor_8x8_sse2, · 16 unmodified lines
246221 #endif // HAVE_SSE2
247222
248223 #if HAVE_SSSE3
249−INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL,
250− NULL, NULL, NULL, NULL,
251− vpx_d153_predictor_8x8_ssse3, vpx_d207_predictor_8x8_ssse3,
252− vpx_d63_predictor_8x8_ssse3, NULL)
224+INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
225+ NULL, NULL, vpx_d153_predictor_8x8_ssse3,
226+ vpx_d207_predictor_8x8_ssse3, vpx_d63_predictor_8x8_ssse3, NULL)
253227 #endif // HAVE_SSSE3
254228
255229 #if HAVE_DSPR2
@@ -271,8 +245,8 @@ INTRA_PRED_TEST(NEON, TestIntraPred8, vpx_dc_predictor_8x8_neon, · 15 unmodified lines
271245 INTRA_PRED_TEST(MSA, TestIntraPred8, vpx_dc_predictor_8x8_msa,
272246 vpx_dc_left_predictor_8x8_msa, vpx_dc_top_predictor_8x8_msa,
273247 vpx_dc_128_predictor_8x8_msa, vpx_v_predictor_8x8_msa,
274− vpx_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL,
275− NULL, vpx_tm_predictor_8x8_msa)
248+ vpx_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL, NULL,
249+ vpx_tm_predictor_8x8_msa)
276250 #endif // HAVE_MSA
277251
278252 // -----------------------------------------------------------------------------
@@ -296,11 +270,10 @@ INTRA_PRED_TEST(SSE2, TestIntraPred16, vpx_dc_predictor_16x16_sse2, · 17 unmodified lines
296270 #endif // HAVE_SSE2
297271
298272 #if HAVE_SSSE3
299−INTRA_PRED_TEST(SSSE3, TestIntraPred16, NULL, NULL, NULL, NULL, NULL,
300− NULL, vpx_d45_predictor_16x16_ssse3,
301− NULL, NULL, vpx_d153_predictor_16x16_ssse3,
302− vpx_d207_predictor_16x16_ssse3, vpx_d63_predictor_16x16_ssse3,
303− NULL)
273+INTRA_PRED_TEST(SSSE3, TestIntraPred16, NULL, NULL, NULL, NULL, NULL, NULL,
274+ vpx_d45_predictor_16x16_ssse3, NULL, NULL,
275+ vpx_d153_predictor_16x16_ssse3, vpx_d207_predictor_16x16_ssse3,
276+ vpx_d63_predictor_16x16_ssse3, NULL)
304277 #endif // HAVE_SSSE3
305278
306279 #if HAVE_DSPR2
@@ -322,8 +295,8 @@ INTRA_PRED_TEST(NEON, TestIntraPred16, vpx_dc_predictor_16x16_neon, · 15 unmodified lines
322295 INTRA_PRED_TEST(MSA, TestIntraPred16, vpx_dc_predictor_16x16_msa,
323296 vpx_dc_left_predictor_16x16_msa, vpx_dc_top_predictor_16x16_msa,
324297 vpx_dc_128_predictor_16x16_msa, vpx_v_predictor_16x16_msa,
325− vpx_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL,
326− NULL, vpx_tm_predictor_16x16_msa)
298+ vpx_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL, NULL,
299+ vpx_tm_predictor_16x16_msa)
327300 #endif // HAVE_MSA
328301
329302 // -----------------------------------------------------------------------------
@@ -342,13 +315,13 @@ INTRA_PRED_TEST(SSE2, TestIntraPred32, vpx_dc_predictor_32x32_sse2, · 12 unmodified lines
342315 vpx_dc_left_predictor_32x32_sse2,
343316 vpx_dc_top_predictor_32x32_sse2,
344317 vpx_dc_128_predictor_32x32_sse2, vpx_v_predictor_32x32_sse2,
345− vpx_h_predictor_32x32_sse2, NULL, NULL, NULL, NULL, NULL,
346− NULL, vpx_tm_predictor_32x32_sse2)
318+ vpx_h_predictor_32x32_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
319+ vpx_tm_predictor_32x32_sse2)
347320 #endif // HAVE_SSE2
348321
349322 #if HAVE_SSSE3
350−INTRA_PRED_TEST(SSSE3, TestIntraPred32, NULL, NULL, NULL, NULL, NULL,
351− NULL, vpx_d45_predictor_32x32_ssse3, NULL, NULL,
323+INTRA_PRED_TEST(SSSE3, TestIntraPred32, NULL, NULL, NULL, NULL, NULL, NULL,
324+ vpx_d45_predictor_32x32_ssse3, NULL, NULL,
352325 vpx_d153_predictor_32x32_ssse3, vpx_d207_predictor_32x32_ssse3,
353326 vpx_d63_predictor_32x32_ssse3, NULL)
354327 #endif // HAVE_SSSE3
@@ -366,8 +339,8 @@ INTRA_PRED_TEST(NEON, TestIntraPred32, vpx_dc_predictor_32x32_neon, · 11 unmodified lines
366339 INTRA_PRED_TEST(MSA, TestIntraPred32, vpx_dc_predictor_32x32_msa,
367340 vpx_dc_left_predictor_32x32_msa, vpx_dc_top_predictor_32x32_msa,
368341 vpx_dc_128_predictor_32x32_msa, vpx_v_predictor_32x32_msa,
369− vpx_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL,
370− NULL, vpx_tm_predictor_32x32_msa)
342+ vpx_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL, NULL,
343+ vpx_tm_predictor_32x32_msa)
371344 #endif // HAVE_MSA
372345
373346 #include "test/test_libvpx.cc"
test/test_libvpx.cc+6−12
@@ -41,22 +41,16 @@ int main(int argc, char **argv) { · 40 unmodified lines
4141
4242 #if ARCH_X86 || ARCH_X86_64
4343 const int simd_caps = x86_simd_caps();
44− if (!(simd_caps & HAS_MMX))
45− append_negative_gtest_filter(":MMX.*:MMX/*");
46− if (!(simd_caps & HAS_SSE))
47− append_negative_gtest_filter(":SSE.*:SSE/*");
48− if (!(simd_caps & HAS_SSE2))
49− append_negative_gtest_filter(":SSE2.*:SSE2/*");
50− if (!(simd_caps & HAS_SSE3))
51− append_negative_gtest_filter(":SSE3.*:SSE3/*");
44+ if (!(simd_caps & HAS_MMX)) append_negative_gtest_filter(":MMX.*:MMX/*");
45+ if (!(simd_caps & HAS_SSE)) append_negative_gtest_filter(":SSE.*:SSE/*");
46+ if (!(simd_caps & HAS_SSE2)) append_negative_gtest_filter(":SSE2.*:SSE2/*");
47+ if (!(simd_caps & HAS_SSE3)) append_negative_gtest_filter(":SSE3.*:SSE3/*");
5248 if (!(simd_caps & HAS_SSSE3))
5349 append_negative_gtest_filter(":SSSE3.*:SSSE3/*");
5450 if (!(simd_caps & HAS_SSE4_1))
5551 append_negative_gtest_filter(":SSE4_1.*:SSE4_1/*");
56− if (!(simd_caps & HAS_AVX))
57− append_negative_gtest_filter(":AVX.*:AVX/*");
58− if (!(simd_caps & HAS_AVX2))
59− append_negative_gtest_filter(":AVX2.*:AVX2/*");
52+ if (!(simd_caps & HAS_AVX)) append_negative_gtest_filter(":AVX.*:AVX/*");
53+ if (!(simd_caps & HAS_AVX2)) append_negative_gtest_filter(":AVX2.*:AVX2/*");
6054 #endif // ARCH_X86 || ARCH_X86_64
6155
6256 #if !CONFIG_SHARED
test/test_vector_test.cc+15−22
@@ -28,43 +28,36 @@ · 27 unmodified lines
2828
2929 namespace {
3030
31−enum DecodeMode {
32− kSerialMode,
33− kFrameParallelMode
34−};
31+enum DecodeMode { kSerialMode, kFrameParallelMode };
3532
3633 const int kDecodeMode = 0;
3734 const int kThreads = 1;
3835 const int kFileName = 2;
3936
40−typedef std::tr1::tuple<int, int, const char*> DecodeParam;
37+typedef std::tr1::tuple<int, int, const char *> DecodeParam;
4138
4239 class TestVectorTest : public ::libvpx_test::DecoderTest,
43− public ::libvpx_test::CodecTestWithParam<DecodeParam> {
40+ public ::libvpx_test::CodecTestWithParam<DecodeParam> {
4441 protected:
45− TestVectorTest()
46− : DecoderTest(GET_PARAM(0)),
47− md5_file_(NULL) {
42+ TestVectorTest() : DecoderTest(GET_PARAM(0)), md5_file_(NULL) {
4843 #if CONFIG_VP9_DECODER
49− resize_clips_.insert(
50− ::libvpx_test::kVP9TestVectorsResize,
51− ::libvpx_test::kVP9TestVectorsResize +
52− ::libvpx_test::kNumVP9TestVectorsResize);
44+ resize_clips_.insert(::libvpx_test::kVP9TestVectorsResize,
45+ ::libvpx_test::kVP9TestVectorsResize +
46+ ::libvpx_test::kNumVP9TestVectorsResize);
5347 #endif
5448 }
5549
5650 virtual ~TestVectorTest() {
57− if (md5_file_)
58− fclose(md5_file_);
51+ if (md5_file_) fclose(md5_file_);
5952 }
6053
61− void OpenMD5File(const std::string& md5_file_name_) {
54+ void OpenMD5File(const std::string &md5_file_name_) {
6255 md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
6356 ASSERT_TRUE(md5_file_ != NULL) << "Md5 file open failed. Filename: "
64− << md5_file_name_;
57+ << md5_file_name_;
6558 }
6659
67− virtual void DecompressedFrameHook(const vpx_image_t& img,
60+ virtual void DecompressedFrameHook(const vpx_image_t &img,
6861 const unsigned int frame_number) {
6962 ASSERT_TRUE(md5_file_ != NULL);
7063 char expected_md5[33];
@@ -121,8 +114,8 @@ TEST_P(TestVectorTest, MD5Match) { · 50 unmodified lines
121114 cfg.threads = threads;
122115
123116 snprintf(str, sizeof(str) / sizeof(str[0]) - 1,
124− "file: %s mode: %s threads: %d",
125− filename.c_str(), mode == 0 ? "Serial" : "Parallel", threads);
117+ "file: %s mode: %s threads: %d", filename.c_str(),
118+ mode == 0 ? "Serial" : "Parallel", threads);
126119 SCOPED_TRACE(str);
127120
128121 // Open compressed video file.
@@ -183,8 +176,8 @@ INSTANTIATE_TEST_CASE_P( · 54 unmodified lines
183176 ::testing::Values(
184177 static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)),
185178 ::testing::Combine(
186− ::testing::Values(1), // Frame Parallel mode.
187− ::testing::Range(2, 9), // With 2 ~ 8 threads.
179+ ::testing::Values(1), // Frame Parallel mode.
180+ ::testing::Range(2, 9), // With 2 ~ 8 threads.
188181 ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
189182 libvpx_test::kVP9TestVectors +
190183 libvpx_test::kNumVP9TestVectors))));
test/test_vectors.cc+323−192
@@ -16,201 +16,324 @@ namespace libvpx_test { · 15 unmodified lines
1616
1717 #if CONFIG_VP8_DECODER
1818 const char *const kVP8TestVectors[] = {
19− "vp80-00-comprehensive-001.ivf",
20− "vp80-00-comprehensive-002.ivf", "vp80-00-comprehensive-003.ivf",
21− "vp80-00-comprehensive-004.ivf", "vp80-00-comprehensive-005.ivf",
22− "vp80-00-comprehensive-006.ivf", "vp80-00-comprehensive-007.ivf",
23− "vp80-00-comprehensive-008.ivf", "vp80-00-comprehensive-009.ivf",
24− "vp80-00-comprehensive-010.ivf", "vp80-00-comprehensive-011.ivf",
25− "vp80-00-comprehensive-012.ivf", "vp80-00-comprehensive-013.ivf",
26− "vp80-00-comprehensive-014.ivf", "vp80-00-comprehensive-015.ivf",
27− "vp80-00-comprehensive-016.ivf", "vp80-00-comprehensive-017.ivf",
28− "vp80-00-comprehensive-018.ivf", "vp80-01-intra-1400.ivf",
29− "vp80-01-intra-1411.ivf", "vp80-01-intra-1416.ivf",
30− "vp80-01-intra-1417.ivf", "vp80-02-inter-1402.ivf",
31− "vp80-02-inter-1412.ivf", "vp80-02-inter-1418.ivf",
32− "vp80-02-inter-1424.ivf", "vp80-03-segmentation-01.ivf",
33− "vp80-03-segmentation-02.ivf", "vp80-03-segmentation-03.ivf",
34− "vp80-03-segmentation-04.ivf", "vp80-03-segmentation-1401.ivf",
35− "vp80-03-segmentation-1403.ivf", "vp80-03-segmentation-1407.ivf",
36− "vp80-03-segmentation-1408.ivf", "vp80-03-segmentation-1409.ivf",
37− "vp80-03-segmentation-1410.ivf", "vp80-03-segmentation-1413.ivf",
38− "vp80-03-segmentation-1414.ivf", "vp80-03-segmentation-1415.ivf",
39− "vp80-03-segmentation-1425.ivf", "vp80-03-segmentation-1426.ivf",
40− "vp80-03-segmentation-1427.ivf", "vp80-03-segmentation-1432.ivf",
41− "vp80-03-segmentation-1435.ivf", "vp80-03-segmentation-1436.ivf",
42− "vp80-03-segmentation-1437.ivf", "vp80-03-segmentation-1441.ivf",
43− "vp80-03-segmentation-1442.ivf", "vp80-04-partitions-1404.ivf",
44− "vp80-04-partitions-1405.ivf", "vp80-04-partitions-1406.ivf",
45− "vp80-05-sharpness-1428.ivf", "vp80-05-sharpness-1429.ivf",
46− "vp80-05-sharpness-1430.ivf", "vp80-05-sharpness-1431.ivf",
47− "vp80-05-sharpness-1433.ivf", "vp80-05-sharpness-1434.ivf",
48− "vp80-05-sharpness-1438.ivf", "vp80-05-sharpness-1439.ivf",
49− "vp80-05-sharpness-1440.ivf", "vp80-05-sharpness-1443.ivf",
50− "vp80-06-smallsize.ivf"
19+ "vp80-00-comprehensive-001.ivf", "vp80-00-comprehensive-002.ivf",
20+ "vp80-00-comprehensive-003.ivf", "vp80-00-comprehensive-004.ivf",
21+ "vp80-00-comprehensive-005.ivf", "vp80-00-comprehensive-006.ivf",
22+ "vp80-00-comprehensive-007.ivf", "vp80-00-comprehensive-008.ivf",
23+ "vp80-00-comprehensive-009.ivf", "vp80-00-comprehensive-010.ivf",
24+ "vp80-00-comprehensive-011.ivf", "vp80-00-comprehensive-012.ivf",
25+ "vp80-00-comprehensive-013.ivf", "vp80-00-comprehensive-014.ivf",
26+ "vp80-00-comprehensive-015.ivf", "vp80-00-comprehensive-016.ivf",
27+ "vp80-00-comprehensive-017.ivf", "vp80-00-comprehensive-018.ivf",
28+ "vp80-01-intra-1400.ivf", "vp80-01-intra-1411.ivf",
29+ "vp80-01-intra-1416.ivf", "vp80-01-intra-1417.ivf",
30+ "vp80-02-inter-1402.ivf", "vp80-02-inter-1412.ivf",
31+ "vp80-02-inter-1418.ivf", "vp80-02-inter-1424.ivf",
32+ "vp80-03-segmentation-01.ivf", "vp80-03-segmentation-02.ivf",
33+ "vp80-03-segmentation-03.ivf", "vp80-03-segmentation-04.ivf",
34+ "vp80-03-segmentation-1401.ivf", "vp80-03-segmentation-1403.ivf",
35+ "vp80-03-segmentation-1407.ivf", "vp80-03-segmentation-1408.ivf",
36+ "vp80-03-segmentation-1409.ivf", "vp80-03-segmentation-1410.ivf",
37+ "vp80-03-segmentation-1413.ivf", "vp80-03-segmentation-1414.ivf",
38+ "vp80-03-segmentation-1415.ivf", "vp80-03-segmentation-1425.ivf",
39+ "vp80-03-segmentation-1426.ivf", "vp80-03-segmentation-1427.ivf",
40+ "vp80-03-segmentation-1432.ivf", "vp80-03-segmentation-1435.ivf",
41+ "vp80-03-segmentation-1436.ivf", "vp80-03-segmentation-1437.ivf",
42+ "vp80-03-segmentation-1441.ivf", "vp80-03-segmentation-1442.ivf",
43+ "vp80-04-partitions-1404.ivf", "vp80-04-partitions-1405.ivf",
44+ "vp80-04-partitions-1406.ivf", "vp80-05-sharpness-1428.ivf",
45+ "vp80-05-sharpness-1429.ivf", "vp80-05-sharpness-1430.ivf",
46+ "vp80-05-sharpness-1431.ivf", "vp80-05-sharpness-1433.ivf",
47+ "vp80-05-sharpness-1434.ivf", "vp80-05-sharpness-1438.ivf",
48+ "vp80-05-sharpness-1439.ivf", "vp80-05-sharpness-1440.ivf",
49+ "vp80-05-sharpness-1443.ivf", "vp80-06-smallsize.ivf"
5150 };
5251 const int kNumVP8TestVectors = NELEMENTS(kVP8TestVectors);
5352 #endif // CONFIG_VP8_DECODER
5453 #if CONFIG_VP9_DECODER
55−#define RESIZE_TEST_VECTORS "vp90-2-21-resize_inter_320x180_5_1-2.webm", \
56− "vp90-2-21-resize_inter_320x180_5_3-4.webm", \
57− "vp90-2-21-resize_inter_320x180_7_1-2.webm", \
58− "vp90-2-21-resize_inter_320x180_7_3-4.webm", \
59− "vp90-2-21-resize_inter_320x240_5_1-2.webm", \
60− "vp90-2-21-resize_inter_320x240_5_3-4.webm", \
61− "vp90-2-21-resize_inter_320x240_7_1-2.webm", \
62− "vp90-2-21-resize_inter_320x240_7_3-4.webm", \
63− "vp90-2-21-resize_inter_640x360_5_1-2.webm", \
64− "vp90-2-21-resize_inter_640x360_5_3-4.webm", \
65− "vp90-2-21-resize_inter_640x360_7_1-2.webm", \
66− "vp90-2-21-resize_inter_640x360_7_3-4.webm", \
67− "vp90-2-21-resize_inter_640x480_5_1-2.webm", \
68− "vp90-2-21-resize_inter_640x480_5_3-4.webm", \
69− "vp90-2-21-resize_inter_640x480_7_1-2.webm", \
70− "vp90-2-21-resize_inter_640x480_7_3-4.webm", \
71− "vp90-2-21-resize_inter_1280x720_5_1-2.webm", \
72− "vp90-2-21-resize_inter_1280x720_5_3-4.webm", \
73− "vp90-2-21-resize_inter_1280x720_7_1-2.webm", \
74− "vp90-2-21-resize_inter_1280x720_7_3-4.webm", \
75− "vp90-2-21-resize_inter_1920x1080_5_1-2.webm", \
76− "vp90-2-21-resize_inter_1920x1080_5_3-4.webm", \
77− "vp90-2-21-resize_inter_1920x1080_7_1-2.webm", \
78− "vp90-2-21-resize_inter_1920x1080_7_3-4.webm",
54+#define RESIZE_TEST_VECTORS \
55+ "vp90-2-21-resize_inter_320x180_5_1-2.webm", \
56+ "vp90-2-21-resize_inter_320x180_5_3-4.webm", \
57+ "vp90-2-21-resize_inter_320x180_7_1-2.webm", \
58+ "vp90-2-21-resize_inter_320x180_7_3-4.webm", \
59+ "vp90-2-21-resize_inter_320x240_5_1-2.webm", \
60+ "vp90-2-21-resize_inter_320x240_5_3-4.webm", \
61+ "vp90-2-21-resize_inter_320x240_7_1-2.webm", \
62+ "vp90-2-21-resize_inter_320x240_7_3-4.webm", \
63+ "vp90-2-21-resize_inter_640x360_5_1-2.webm", \
64+ "vp90-2-21-resize_inter_640x360_5_3-4.webm", \
65+ "vp90-2-21-resize_inter_640x360_7_1-2.webm", \
66+ "vp90-2-21-resize_inter_640x360_7_3-4.webm", \
67+ "vp90-2-21-resize_inter_640x480_5_1-2.webm", \
68+ "vp90-2-21-resize_inter_640x480_5_3-4.webm", \
69+ "vp90-2-21-resize_inter_640x480_7_1-2.webm", \
70+ "vp90-2-21-resize_inter_640x480_7_3-4.webm", \
71+ "vp90-2-21-resize_inter_1280x720_5_1-2.webm", \
72+ "vp90-2-21-resize_inter_1280x720_5_3-4.webm", \
73+ "vp90-2-21-resize_inter_1280x720_7_1-2.webm", \
74+ "vp90-2-21-resize_inter_1280x720_7_3-4.webm", \
75+ "vp90-2-21-resize_inter_1920x1080_5_1-2.webm", \
76+ "vp90-2-21-resize_inter_1920x1080_5_3-4.webm", \
77+ "vp90-2-21-resize_inter_1920x1080_7_1-2.webm", \
78+ "vp90-2-21-resize_inter_1920x1080_7_3-4.webm",
7979
8080 const char *const kVP9TestVectors[] = {
81− "vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
82− "vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.webm",
83− "vp90-2-00-quantizer-04.webm", "vp90-2-00-quantizer-05.webm",
84− "vp90-2-00-quantizer-06.webm", "vp90-2-00-quantizer-07.webm",
85− "vp90-2-00-quantizer-08.webm", "vp90-2-00-quantizer-09.webm",
86− "vp90-2-00-quantizer-10.webm", "vp90-2-00-quantizer-11.webm",
87− "vp90-2-00-quantizer-12.webm", "vp90-2-00-quantizer-13.webm",
88− "vp90-2-00-quantizer-14.webm", "vp90-2-00-quantizer-15.webm",
89− "vp90-2-00-quantizer-16.webm", "vp90-2-00-quantizer-17.webm",
90− "vp90-2-00-quantizer-18.webm", "vp90-2-00-quantizer-19.webm",
91− "vp90-2-00-quantizer-20.webm", "vp90-2-00-quantizer-21.webm",
92− "vp90-2-00-quantizer-22.webm", "vp90-2-00-quantizer-23.webm",
93− "vp90-2-00-quantizer-24.webm", "vp90-2-00-quantizer-25.webm",
94− "vp90-2-00-quantizer-26.webm", "vp90-2-00-quantizer-27.webm",
95− "vp90-2-00-quantizer-28.webm", "vp90-2-00-quantizer-29.webm",
96− "vp90-2-00-quantizer-30.webm", "vp90-2-00-quantizer-31.webm",
97− "vp90-2-00-quantizer-32.webm", "vp90-2-00-quantizer-33.webm",
98− "vp90-2-00-quantizer-34.webm", "vp90-2-00-quantizer-35.webm",
99− "vp90-2-00-quantizer-36.webm", "vp90-2-00-quantizer-37.webm",
100− "vp90-2-00-quantizer-38.webm", "vp90-2-00-quantizer-39.webm",
101− "vp90-2-00-quantizer-40.webm", "vp90-2-00-quantizer-41.webm",
102− "vp90-2-00-quantizer-42.webm", "vp90-2-00-quantizer-43.webm",
103− "vp90-2-00-quantizer-44.webm", "vp90-2-00-quantizer-45.webm",
104− "vp90-2-00-quantizer-46.webm", "vp90-2-00-quantizer-47.webm",
105− "vp90-2-00-quantizer-48.webm", "vp90-2-00-quantizer-49.webm",
106− "vp90-2-00-quantizer-50.webm", "vp90-2-00-quantizer-51.webm",
107− "vp90-2-00-quantizer-52.webm", "vp90-2-00-quantizer-53.webm",
108− "vp90-2-00-quantizer-54.webm", "vp90-2-00-quantizer-55.webm",
109− "vp90-2-00-quantizer-56.webm", "vp90-2-00-quantizer-57.webm",
110− "vp90-2-00-quantizer-58.webm", "vp90-2-00-quantizer-59.webm",
111− "vp90-2-00-quantizer-60.webm", "vp90-2-00-quantizer-61.webm",
112− "vp90-2-00-quantizer-62.webm", "vp90-2-00-quantizer-63.webm",
113− "vp90-2-01-sharpness-1.webm", "vp90-2-01-sharpness-2.webm",
114− "vp90-2-01-sharpness-3.webm", "vp90-2-01-sharpness-4.webm",
115− "vp90-2-01-sharpness-5.webm", "vp90-2-01-sharpness-6.webm",
116− "vp90-2-01-sharpness-7.webm", "vp90-2-02-size-08x08.webm",
117− "vp90-2-02-size-08x10.webm", "vp90-2-02-size-08x16.webm",
118− "vp90-2-02-size-08x18.webm", "vp90-2-02-size-08x32.webm",
119− "vp90-2-02-size-08x34.webm", "vp90-2-02-size-08x64.webm",
120− "vp90-2-02-size-08x66.webm", "vp90-2-02-size-10x08.webm",
121− "vp90-2-02-size-10x10.webm", "vp90-2-02-size-10x16.webm",
122− "vp90-2-02-size-10x18.webm", "vp90-2-02-size-10x32.webm",
123− "vp90-2-02-size-10x34.webm", "vp90-2-02-size-10x64.webm",
124− "vp90-2-02-size-10x66.webm", "vp90-2-02-size-16x08.webm",
125− "vp90-2-02-size-16x10.webm", "vp90-2-02-size-16x16.webm",
126− "vp90-2-02-size-16x18.webm", "vp90-2-02-size-16x32.webm",
127− "vp90-2-02-size-16x34.webm", "vp90-2-02-size-16x64.webm",
128− "vp90-2-02-size-16x66.webm", "vp90-2-02-size-18x08.webm",
129− "vp90-2-02-size-18x10.webm", "vp90-2-02-size-18x16.webm",
130− "vp90-2-02-size-18x18.webm", "vp90-2-02-size-18x32.webm",
131− "vp90-2-02-size-18x34.webm", "vp90-2-02-size-18x64.webm",
132− "vp90-2-02-size-18x66.webm", "vp90-2-02-size-32x08.webm",
133− "vp90-2-02-size-32x10.webm", "vp90-2-02-size-32x16.webm",
134− "vp90-2-02-size-32x18.webm", "vp90-2-02-size-32x32.webm",
135− "vp90-2-02-size-32x34.webm", "vp90-2-02-size-32x64.webm",
136− "vp90-2-02-size-32x66.webm", "vp90-2-02-size-34x08.webm",
137− "vp90-2-02-size-34x10.webm", "vp90-2-02-size-34x16.webm",
138− "vp90-2-02-size-34x18.webm", "vp90-2-02-size-34x32.webm",
139− "vp90-2-02-size-34x34.webm", "vp90-2-02-size-34x64.webm",
140− "vp90-2-02-size-34x66.webm", "vp90-2-02-size-64x08.webm",
141− "vp90-2-02-size-64x10.webm", "vp90-2-02-size-64x16.webm",
142− "vp90-2-02-size-64x18.webm", "vp90-2-02-size-64x32.webm",
143− "vp90-2-02-size-64x34.webm", "vp90-2-02-size-64x64.webm",
144− "vp90-2-02-size-64x66.webm", "vp90-2-02-size-66x08.webm",
145− "vp90-2-02-size-66x10.webm", "vp90-2-02-size-66x16.webm",
146− "vp90-2-02-size-66x18.webm", "vp90-2-02-size-66x32.webm",
147− "vp90-2-02-size-66x34.webm", "vp90-2-02-size-66x64.webm",
148− "vp90-2-02-size-66x66.webm", "vp90-2-02-size-130x132.webm",
149− "vp90-2-02-size-132x130.webm", "vp90-2-02-size-132x132.webm",
150− "vp90-2-02-size-178x180.webm", "vp90-2-02-size-180x178.webm",
151− "vp90-2-02-size-180x180.webm", "vp90-2-03-size-196x196.webm",
152− "vp90-2-03-size-196x198.webm", "vp90-2-03-size-196x200.webm",
153− "vp90-2-03-size-196x202.webm", "vp90-2-03-size-196x208.webm",
154− "vp90-2-03-size-196x210.webm", "vp90-2-03-size-196x224.webm",
155− "vp90-2-03-size-196x226.webm", "vp90-2-03-size-198x196.webm",
156− "vp90-2-03-size-198x198.webm", "vp90-2-03-size-198x200.webm",
157− "vp90-2-03-size-198x202.webm", "vp90-2-03-size-198x208.webm",
158− "vp90-2-03-size-198x210.webm", "vp90-2-03-size-198x224.webm",
159− "vp90-2-03-size-198x226.webm", "vp90-2-03-size-200x196.webm",
160− "vp90-2-03-size-200x198.webm", "vp90-2-03-size-200x200.webm",
161− "vp90-2-03-size-200x202.webm", "vp90-2-03-size-200x208.webm",
162− "vp90-2-03-size-200x210.webm", "vp90-2-03-size-200x224.webm",
163− "vp90-2-03-size-200x226.webm", "vp90-2-03-size-202x196.webm",
164− "vp90-2-03-size-202x198.webm", "vp90-2-03-size-202x200.webm",
165− "vp90-2-03-size-202x202.webm", "vp90-2-03-size-202x208.webm",
166− "vp90-2-03-size-202x210.webm", "vp90-2-03-size-202x224.webm",
167− "vp90-2-03-size-202x226.webm", "vp90-2-03-size-208x196.webm",
168− "vp90-2-03-size-208x198.webm", "vp90-2-03-size-208x200.webm",
169− "vp90-2-03-size-208x202.webm", "vp90-2-03-size-208x208.webm",
170− "vp90-2-03-size-208x210.webm", "vp90-2-03-size-208x224.webm",
171− "vp90-2-03-size-208x226.webm", "vp90-2-03-size-210x196.webm",
172− "vp90-2-03-size-210x198.webm", "vp90-2-03-size-210x200.webm",
173− "vp90-2-03-size-210x202.webm", "vp90-2-03-size-210x208.webm",
174− "vp90-2-03-size-210x210.webm", "vp90-2-03-size-210x224.webm",
175− "vp90-2-03-size-210x226.webm", "vp90-2-03-size-224x196.webm",
176− "vp90-2-03-size-224x198.webm", "vp90-2-03-size-224x200.webm",
177− "vp90-2-03-size-224x202.webm", "vp90-2-03-size-224x208.webm",
178− "vp90-2-03-size-224x210.webm", "vp90-2-03-size-224x224.webm",
179− "vp90-2-03-size-224x226.webm", "vp90-2-03-size-226x196.webm",
180− "vp90-2-03-size-226x198.webm", "vp90-2-03-size-226x200.webm",
181− "vp90-2-03-size-226x202.webm", "vp90-2-03-size-226x208.webm",
182− "vp90-2-03-size-226x210.webm", "vp90-2-03-size-226x224.webm",
183− "vp90-2-03-size-226x226.webm", "vp90-2-03-size-352x288.webm",
81+ "vp90-2-00-quantizer-00.webm",
82+ "vp90-2-00-quantizer-01.webm",
83+ "vp90-2-00-quantizer-02.webm",
84+ "vp90-2-00-quantizer-03.webm",
85+ "vp90-2-00-quantizer-04.webm",
86+ "vp90-2-00-quantizer-05.webm",
87+ "vp90-2-00-quantizer-06.webm",
88+ "vp90-2-00-quantizer-07.webm",
89+ "vp90-2-00-quantizer-08.webm",
90+ "vp90-2-00-quantizer-09.webm",
91+ "vp90-2-00-quantizer-10.webm",
92+ "vp90-2-00-quantizer-11.webm",
93+ "vp90-2-00-quantizer-12.webm",
94+ "vp90-2-00-quantizer-13.webm",
95+ "vp90-2-00-quantizer-14.webm",
96+ "vp90-2-00-quantizer-15.webm",
97+ "vp90-2-00-quantizer-16.webm",
98+ "vp90-2-00-quantizer-17.webm",
99+ "vp90-2-00-quantizer-18.webm",
100+ "vp90-2-00-quantizer-19.webm",
101+ "vp90-2-00-quantizer-20.webm",
102+ "vp90-2-00-quantizer-21.webm",
103+ "vp90-2-00-quantizer-22.webm",
104+ "vp90-2-00-quantizer-23.webm",
105+ "vp90-2-00-quantizer-24.webm",
106+ "vp90-2-00-quantizer-25.webm",
107+ "vp90-2-00-quantizer-26.webm",
108+ "vp90-2-00-quantizer-27.webm",
109+ "vp90-2-00-quantizer-28.webm",
110+ "vp90-2-00-quantizer-29.webm",
111+ "vp90-2-00-quantizer-30.webm",
112+ "vp90-2-00-quantizer-31.webm",
113+ "vp90-2-00-quantizer-32.webm",
114+ "vp90-2-00-quantizer-33.webm",
115+ "vp90-2-00-quantizer-34.webm",
116+ "vp90-2-00-quantizer-35.webm",
117+ "vp90-2-00-quantizer-36.webm",
118+ "vp90-2-00-quantizer-37.webm",
119+ "vp90-2-00-quantizer-38.webm",
120+ "vp90-2-00-quantizer-39.webm",
121+ "vp90-2-00-quantizer-40.webm",
122+ "vp90-2-00-quantizer-41.webm",
123+ "vp90-2-00-quantizer-42.webm",
124+ "vp90-2-00-quantizer-43.webm",
125+ "vp90-2-00-quantizer-44.webm",
126+ "vp90-2-00-quantizer-45.webm",
127+ "vp90-2-00-quantizer-46.webm",
128+ "vp90-2-00-quantizer-47.webm",
129+ "vp90-2-00-quantizer-48.webm",
130+ "vp90-2-00-quantizer-49.webm",
131+ "vp90-2-00-quantizer-50.webm",
132+ "vp90-2-00-quantizer-51.webm",
133+ "vp90-2-00-quantizer-52.webm",
134+ "vp90-2-00-quantizer-53.webm",
135+ "vp90-2-00-quantizer-54.webm",
136+ "vp90-2-00-quantizer-55.webm",
137+ "vp90-2-00-quantizer-56.webm",
138+ "vp90-2-00-quantizer-57.webm",
139+ "vp90-2-00-quantizer-58.webm",
140+ "vp90-2-00-quantizer-59.webm",
141+ "vp90-2-00-quantizer-60.webm",
142+ "vp90-2-00-quantizer-61.webm",
143+ "vp90-2-00-quantizer-62.webm",
144+ "vp90-2-00-quantizer-63.webm",
145+ "vp90-2-01-sharpness-1.webm",
146+ "vp90-2-01-sharpness-2.webm",
147+ "vp90-2-01-sharpness-3.webm",
148+ "vp90-2-01-sharpness-4.webm",
149+ "vp90-2-01-sharpness-5.webm",
150+ "vp90-2-01-sharpness-6.webm",
151+ "vp90-2-01-sharpness-7.webm",
152+ "vp90-2-02-size-08x08.webm",
153+ "vp90-2-02-size-08x10.webm",
154+ "vp90-2-02-size-08x16.webm",
155+ "vp90-2-02-size-08x18.webm",
156+ "vp90-2-02-size-08x32.webm",
157+ "vp90-2-02-size-08x34.webm",
158+ "vp90-2-02-size-08x64.webm",
159+ "vp90-2-02-size-08x66.webm",
160+ "vp90-2-02-size-10x08.webm",
161+ "vp90-2-02-size-10x10.webm",
162+ "vp90-2-02-size-10x16.webm",
163+ "vp90-2-02-size-10x18.webm",
164+ "vp90-2-02-size-10x32.webm",
165+ "vp90-2-02-size-10x34.webm",
166+ "vp90-2-02-size-10x64.webm",
167+ "vp90-2-02-size-10x66.webm",
168+ "vp90-2-02-size-16x08.webm",
169+ "vp90-2-02-size-16x10.webm",
170+ "vp90-2-02-size-16x16.webm",
171+ "vp90-2-02-size-16x18.webm",
172+ "vp90-2-02-size-16x32.webm",
173+ "vp90-2-02-size-16x34.webm",
174+ "vp90-2-02-size-16x64.webm",
175+ "vp90-2-02-size-16x66.webm",
176+ "vp90-2-02-size-18x08.webm",
177+ "vp90-2-02-size-18x10.webm",
178+ "vp90-2-02-size-18x16.webm",
179+ "vp90-2-02-size-18x18.webm",
180+ "vp90-2-02-size-18x32.webm",
181+ "vp90-2-02-size-18x34.webm",
182+ "vp90-2-02-size-18x64.webm",
183+ "vp90-2-02-size-18x66.webm",
184+ "vp90-2-02-size-32x08.webm",
185+ "vp90-2-02-size-32x10.webm",
186+ "vp90-2-02-size-32x16.webm",
187+ "vp90-2-02-size-32x18.webm",
188+ "vp90-2-02-size-32x32.webm",
189+ "vp90-2-02-size-32x34.webm",
190+ "vp90-2-02-size-32x64.webm",
191+ "vp90-2-02-size-32x66.webm",
192+ "vp90-2-02-size-34x08.webm",
193+ "vp90-2-02-size-34x10.webm",
194+ "vp90-2-02-size-34x16.webm",
195+ "vp90-2-02-size-34x18.webm",
196+ "vp90-2-02-size-34x32.webm",
197+ "vp90-2-02-size-34x34.webm",
198+ "vp90-2-02-size-34x64.webm",
199+ "vp90-2-02-size-34x66.webm",
200+ "vp90-2-02-size-64x08.webm",
201+ "vp90-2-02-size-64x10.webm",
202+ "vp90-2-02-size-64x16.webm",
203+ "vp90-2-02-size-64x18.webm",
204+ "vp90-2-02-size-64x32.webm",
205+ "vp90-2-02-size-64x34.webm",
206+ "vp90-2-02-size-64x64.webm",
207+ "vp90-2-02-size-64x66.webm",
208+ "vp90-2-02-size-66x08.webm",
209+ "vp90-2-02-size-66x10.webm",
210+ "vp90-2-02-size-66x16.webm",
211+ "vp90-2-02-size-66x18.webm",
212+ "vp90-2-02-size-66x32.webm",
213+ "vp90-2-02-size-66x34.webm",
214+ "vp90-2-02-size-66x64.webm",
215+ "vp90-2-02-size-66x66.webm",
216+ "vp90-2-02-size-130x132.webm",
217+ "vp90-2-02-size-132x130.webm",
218+ "vp90-2-02-size-132x132.webm",
219+ "vp90-2-02-size-178x180.webm",
220+ "vp90-2-02-size-180x178.webm",
221+ "vp90-2-02-size-180x180.webm",
222+ "vp90-2-03-size-196x196.webm",
223+ "vp90-2-03-size-196x198.webm",
224+ "vp90-2-03-size-196x200.webm",
225+ "vp90-2-03-size-196x202.webm",
226+ "vp90-2-03-size-196x208.webm",
227+ "vp90-2-03-size-196x210.webm",
228+ "vp90-2-03-size-196x224.webm",
229+ "vp90-2-03-size-196x226.webm",
230+ "vp90-2-03-size-198x196.webm",
231+ "vp90-2-03-size-198x198.webm",
232+ "vp90-2-03-size-198x200.webm",
233+ "vp90-2-03-size-198x202.webm",
234+ "vp90-2-03-size-198x208.webm",
235+ "vp90-2-03-size-198x210.webm",
236+ "vp90-2-03-size-198x224.webm",
237+ "vp90-2-03-size-198x226.webm",
238+ "vp90-2-03-size-200x196.webm",
239+ "vp90-2-03-size-200x198.webm",
240+ "vp90-2-03-size-200x200.webm",
241+ "vp90-2-03-size-200x202.webm",
242+ "vp90-2-03-size-200x208.webm",
243+ "vp90-2-03-size-200x210.webm",
244+ "vp90-2-03-size-200x224.webm",
245+ "vp90-2-03-size-200x226.webm",
246+ "vp90-2-03-size-202x196.webm",
247+ "vp90-2-03-size-202x198.webm",
248+ "vp90-2-03-size-202x200.webm",
249+ "vp90-2-03-size-202x202.webm",
250+ "vp90-2-03-size-202x208.webm",
251+ "vp90-2-03-size-202x210.webm",
252+ "vp90-2-03-size-202x224.webm",
253+ "vp90-2-03-size-202x226.webm",
254+ "vp90-2-03-size-208x196.webm",
255+ "vp90-2-03-size-208x198.webm",
256+ "vp90-2-03-size-208x200.webm",
257+ "vp90-2-03-size-208x202.webm",
258+ "vp90-2-03-size-208x208.webm",
259+ "vp90-2-03-size-208x210.webm",
260+ "vp90-2-03-size-208x224.webm",
261+ "vp90-2-03-size-208x226.webm",
262+ "vp90-2-03-size-210x196.webm",
263+ "vp90-2-03-size-210x198.webm",
264+ "vp90-2-03-size-210x200.webm",
265+ "vp90-2-03-size-210x202.webm",
266+ "vp90-2-03-size-210x208.webm",
267+ "vp90-2-03-size-210x210.webm",
268+ "vp90-2-03-size-210x224.webm",
269+ "vp90-2-03-size-210x226.webm",
270+ "vp90-2-03-size-224x196.webm",
271+ "vp90-2-03-size-224x198.webm",
272+ "vp90-2-03-size-224x200.webm",
273+ "vp90-2-03-size-224x202.webm",
274+ "vp90-2-03-size-224x208.webm",
275+ "vp90-2-03-size-224x210.webm",
276+ "vp90-2-03-size-224x224.webm",
277+ "vp90-2-03-size-224x226.webm",
278+ "vp90-2-03-size-226x196.webm",
279+ "vp90-2-03-size-226x198.webm",
280+ "vp90-2-03-size-226x200.webm",
281+ "vp90-2-03-size-226x202.webm",
282+ "vp90-2-03-size-226x208.webm",
283+ "vp90-2-03-size-226x210.webm",
284+ "vp90-2-03-size-226x224.webm",
285+ "vp90-2-03-size-226x226.webm",
286+ "vp90-2-03-size-352x288.webm",
184287 "vp90-2-03-deltaq.webm",
185− "vp90-2-05-resize.ivf", "vp90-2-06-bilinear.webm",
186− "vp90-2-07-frame_parallel.webm", "vp90-2-08-tile_1x2_frame_parallel.webm",
187− "vp90-2-08-tile_1x2.webm", "vp90-2-08-tile_1x4_frame_parallel.webm",
188− "vp90-2-08-tile_1x4.webm", "vp90-2-08-tile_1x8_frame_parallel.webm",
189− "vp90-2-08-tile_1x8.webm", "vp90-2-08-tile-4x4.webm",
190− "vp90-2-08-tile-4x1.webm", "vp90-2-09-subpixel-00.ivf",
191− "vp90-2-02-size-lf-1920x1080.webm", "vp90-2-09-aq2.webm",
192− "vp90-2-09-lf_deltas.webm", "vp90-2-10-show-existing-frame.webm",
288+ "vp90-2-05-resize.ivf",
289+ "vp90-2-06-bilinear.webm",
290+ "vp90-2-07-frame_parallel.webm",
291+ "vp90-2-08-tile_1x2_frame_parallel.webm",
292+ "vp90-2-08-tile_1x2.webm",
293+ "vp90-2-08-tile_1x4_frame_parallel.webm",
294+ "vp90-2-08-tile_1x4.webm",
295+ "vp90-2-08-tile_1x8_frame_parallel.webm",
296+ "vp90-2-08-tile_1x8.webm",
297+ "vp90-2-08-tile-4x4.webm",
298+ "vp90-2-08-tile-4x1.webm",
299+ "vp90-2-09-subpixel-00.ivf",
300+ "vp90-2-02-size-lf-1920x1080.webm",
301+ "vp90-2-09-aq2.webm",
302+ "vp90-2-09-lf_deltas.webm",
303+ "vp90-2-10-show-existing-frame.webm",
193304 "vp90-2-10-show-existing-frame2.webm",
194− "vp90-2-11-size-351x287.webm", "vp90-2-11-size-351x288.webm",
195− "vp90-2-11-size-352x287.webm", "vp90-2-12-droppable_1.ivf",
196− "vp90-2-12-droppable_2.ivf", "vp90-2-12-droppable_3.ivf",
305+ "vp90-2-11-size-351x287.webm",
306+ "vp90-2-11-size-351x288.webm",
307+ "vp90-2-11-size-352x287.webm",
308+ "vp90-2-12-droppable_1.ivf",
309+ "vp90-2-12-droppable_2.ivf",
310+ "vp90-2-12-droppable_3.ivf",
197311 #if !CONFIG_SIZE_LIMIT || \
198312 (DECODE_WIDTH_LIMIT >= 20400 && DECODE_HEIGHT_LIMIT >= 120)
199313 "vp90-2-13-largescaling.webm",
200314 #endif
201315 "vp90-2-14-resize-fp-tiles-1-16.webm",
202316 "vp90-2-14-resize-fp-tiles-1-2-4-8-16.webm",
203− "vp90-2-14-resize-fp-tiles-1-2.webm", "vp90-2-14-resize-fp-tiles-1-4.webm",
204− "vp90-2-14-resize-fp-tiles-16-1.webm", "vp90-2-14-resize-fp-tiles-16-2.webm",
317+ "vp90-2-14-resize-fp-tiles-1-2.webm",
318+ "vp90-2-14-resize-fp-tiles-1-4.webm",
319+ "vp90-2-14-resize-fp-tiles-16-1.webm",
320+ "vp90-2-14-resize-fp-tiles-16-2.webm",
205321 "vp90-2-14-resize-fp-tiles-16-4.webm",
206322 "vp90-2-14-resize-fp-tiles-16-8-4-2-1.webm",
207− "vp90-2-14-resize-fp-tiles-16-8.webm", "vp90-2-14-resize-fp-tiles-1-8.webm",
208− "vp90-2-14-resize-fp-tiles-2-16.webm", "vp90-2-14-resize-fp-tiles-2-1.webm",
209− "vp90-2-14-resize-fp-tiles-2-4.webm", "vp90-2-14-resize-fp-tiles-2-8.webm",
210− "vp90-2-14-resize-fp-tiles-4-16.webm", "vp90-2-14-resize-fp-tiles-4-1.webm",
211− "vp90-2-14-resize-fp-tiles-4-2.webm", "vp90-2-14-resize-fp-tiles-4-8.webm",
212− "vp90-2-14-resize-fp-tiles-8-16.webm", "vp90-2-14-resize-fp-tiles-8-1.webm",
213− "vp90-2-14-resize-fp-tiles-8-2.webm", "vp90-2-14-resize-fp-tiles-8-4.webm",
323+ "vp90-2-14-resize-fp-tiles-16-8.webm",
324+ "vp90-2-14-resize-fp-tiles-1-8.webm",
325+ "vp90-2-14-resize-fp-tiles-2-16.webm",
326+ "vp90-2-14-resize-fp-tiles-2-1.webm",
327+ "vp90-2-14-resize-fp-tiles-2-4.webm",
328+ "vp90-2-14-resize-fp-tiles-2-8.webm",
329+ "vp90-2-14-resize-fp-tiles-4-16.webm",
330+ "vp90-2-14-resize-fp-tiles-4-1.webm",
331+ "vp90-2-14-resize-fp-tiles-4-2.webm",
332+ "vp90-2-14-resize-fp-tiles-4-8.webm",
333+ "vp90-2-14-resize-fp-tiles-8-16.webm",
334+ "vp90-2-14-resize-fp-tiles-8-1.webm",
335+ "vp90-2-14-resize-fp-tiles-8-2.webm",
336+ "vp90-2-14-resize-fp-tiles-8-4.webm",
214337 "vp90-2-14-resize-10frames-fp-tiles-1-2-4-8.webm",
215338 "vp90-2-14-resize-10frames-fp-tiles-1-2.webm",
216339 "vp90-2-14-resize-10frames-fp-tiles-1-4.webm",
@@ -225,25 +348,33 @@ const char *const kVP9TestVectors[] = { · 8 unmodified lines
225348 "vp90-2-14-resize-10frames-fp-tiles-8-2.webm",
226349 "vp90-2-14-resize-10frames-fp-tiles-8-4-2-1.webm",
227350 "vp90-2-14-resize-10frames-fp-tiles-8-4.webm",
228− "vp90-2-15-segkey.webm", "vp90-2-15-segkey_adpq.webm",
229− "vp90-2-16-intra-only.webm", "vp90-2-17-show-existing-frame.webm",
230− "vp90-2-18-resize.ivf", "vp90-2-19-skip.webm",
231− "vp90-2-19-skip-01.webm", "vp90-2-19-skip-02.webm",
351+ "vp90-2-15-segkey.webm",
352+ "vp90-2-15-segkey_adpq.webm",
353+ "vp90-2-16-intra-only.webm",
354+ "vp90-2-17-show-existing-frame.webm",
355+ "vp90-2-18-resize.ivf",
356+ "vp90-2-19-skip.webm",
357+ "vp90-2-19-skip-01.webm",
358+ "vp90-2-19-skip-02.webm",
232359 "vp91-2-04-yuv444.webm",
233− "vp91-2-04-yuv422.webm", "vp91-2-04-yuv440.webm",
360+ "vp91-2-04-yuv422.webm",
361+ "vp91-2-04-yuv440.webm",
234362 #if CONFIG_VP9_HIGHBITDEPTH
235− "vp92-2-20-10bit-yuv420.webm", "vp92-2-20-12bit-yuv420.webm",
236− "vp93-2-20-10bit-yuv422.webm", "vp93-2-20-12bit-yuv422.webm",
237− "vp93-2-20-10bit-yuv440.webm", "vp93-2-20-12bit-yuv440.webm",
238− "vp93-2-20-10bit-yuv444.webm", "vp93-2-20-12bit-yuv444.webm",
363+ "vp92-2-20-10bit-yuv420.webm",
364+ "vp92-2-20-12bit-yuv420.webm",
365+ "vp93-2-20-10bit-yuv422.webm",
366+ "vp93-2-20-12bit-yuv422.webm",
367+ "vp93-2-20-10bit-yuv440.webm",
368+ "vp93-2-20-12bit-yuv440.webm",
369+ "vp93-2-20-10bit-yuv444.webm",
370+ "vp93-2-20-12bit-yuv444.webm",
239371 #endif // CONFIG_VP9_HIGHBITDEPTH
240− "vp90-2-20-big_superframe-01.webm", "vp90-2-20-big_superframe-02.webm",
372+ "vp90-2-20-big_superframe-01.webm",
373+ "vp90-2-20-big_superframe-02.webm",
241374 RESIZE_TEST_VECTORS
242375 };
243376 const int kNumVP9TestVectors = NELEMENTS(kVP9TestVectors);
244−const char *const kVP9TestVectorsResize[] = {
245− RESIZE_TEST_VECTORS
246−};
377+const char *const kVP9TestVectorsResize[] = { RESIZE_TEST_VECTORS };
247378 const int kNumVP9TestVectorsResize = NELEMENTS(kVP9TestVectorsResize);
248379 #undef RESIZE_TEST_VECTORS
249380 #endif // CONFIG_VP9_DECODER
test/tile_independence_test.cc+2−4
@@ -24,9 +24,7 @@ class TileIndependenceTest : public ::libvpx_test::EncoderTest, · 23 unmodified lines
2424 public ::libvpx_test::CodecTestWithParam<int> {
2525 protected:
2626 TileIndependenceTest()
27− : EncoderTest(GET_PARAM(0)),
28− md5_fw_order_(),
29− md5_inv_order_(),
27+ : EncoderTest(GET_PARAM(0)), md5_fw_order_(), md5_inv_order_(),
3028 n_tiles_(GET_PARAM(1)) {
3129 init_flags_ = VPX_CODEC_USE_PSNR;
3230 vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
@@ -58,7 +56,7 @@ class TileIndependenceTest : public ::libvpx_test::EncoderTest, · 25 unmodified lines
5856 void UpdateMD5(::libvpx_test::Decoder *dec, const vpx_codec_cx_pkt_t *pkt,
5957 ::libvpx_test::MD5 *md5) {
6058 const vpx_codec_err_t res = dec->DecodeFrame(
61− reinterpret_cast<uint8_t*>(pkt->data.frame.buf), pkt->data.frame.sz);
59+ reinterpret_cast<uint8_t *>(pkt->data.frame.buf), pkt->data.frame.sz);
6260 if (res != VPX_CODEC_OK) {
6361 abort_ = true;
6462 ASSERT_EQ(VPX_CODEC_OK, res);
test/user_priv_test.cc+2−2
@@ -34,8 +34,8 @@ using libvpx_test::ACMRandom; · 33 unmodified lines
3434
3535 void CheckUserPrivateData(void *user_priv, int *target) {
3636 // actual pointer value should be the same as expected.
37− EXPECT_EQ(reinterpret_cast<void *>(target), user_priv) <<
38− "user_priv pointer value does not match.";
37+ EXPECT_EQ(reinterpret_cast<void *>(target), user_priv)
38+ << "user_priv pointer value does not match.";
3939 }
4040
4141 // Decodes |filename|. Passes in user_priv data when calling DecodeFrame and
test/util.h+3−4
@@ -17,14 +17,13 @@ · 16 unmodified lines
1717 #include "vpx/vpx_image.h"
1818
1919 // Macros
20−#define GET_PARAM(k) std::tr1::get< k >(GetParam())
20+#define GET_PARAM(k) std::tr1::get<k>(GetParam())
2121
2222 inline double compute_psnr(const vpx_image_t *img1, const vpx_image_t *img2) {
23− assert((img1->fmt == img2->fmt) &&
24− (img1->d_w == img2->d_w) &&
23+ assert((img1->fmt == img2->fmt) && (img1->d_w == img2->d_w) &&
2524 (img1->d_h == img2->d_h));
2625
27− const unsigned int width_y = img1->d_w;
26+ const unsigned int width_y = img1->d_w;
2827 const unsigned int height_y = img1->d_h;
2928 unsigned int i, j;
3029
test/variance_test.cc+131−145
@@ -57,8 +57,7 @@ static void RoundHighBitDepth(int bit_depth, int64_t *se, uint64_t *sse) { · 56 unmodified lines
5757 *se = (*se + 2) >> 2;
5858 break;
5959 case VPX_BITS_8:
60− default:
61− break;
60+ default: break;
6261 }
6362 }
6463
@@ -74,10 +73,9 @@ static unsigned int mb_ss_ref(const int16_t *src) { · 9 unmodified lines
7473 * Our codebase calculates the "diff" value in the variance algorithm by
7574 * (src - ref).
7675 */
77−static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref,
78− int l2w, int l2h, int src_stride,
79− int ref_stride, uint32_t *sse_ptr,
80− bool use_high_bit_depth_,
76+static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, int l2w,
77+ int l2h, int src_stride, int ref_stride,
78+ uint32_t *sse_ptr, bool use_high_bit_depth_,
8179 vpx_bit_depth_t bit_depth) {
8280 int64_t se = 0;
8381 uint64_t sse = 0;
@@ -87,8 +85,7 @@ static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, · 3 unmodified lines
8785 for (int x = 0; x < w; x++) {
8886 int diff;
8987 if (!use_high_bit_depth_) {
90− diff = src[y * src_stride + x] -
91− ref[y * ref_stride + x];
88+ diff = src[y * src_stride + x] - ref[y * ref_stride + x];
9289 se += diff;
9390 sse += diff * diff;
9491 #if CONFIG_VP9_HIGHBITDEPTH
@@ -103,9 +100,8 @@ static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, · 8 unmodified lines
103100 }
104101 RoundHighBitDepth(bit_depth, &se, &sse);
105102 *sse_ptr = static_cast<uint32_t>(sse);
106− return static_cast<uint32_t>(sse -
107− ((static_cast<int64_t>(se) * se) >>
108− (l2w + l2h)));
103+ return static_cast<uint32_t>(
104+ sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
109105 }
110106
111107 /* The subpel reference functions differ from the codec version in one aspect:
@@ -116,8 +112,7 @@ static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, · 4 unmodified lines
116112 */
117113 static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
118114 int l2w, int l2h, int xoff, int yoff,
119− uint32_t *sse_ptr,
120− bool use_high_bit_depth_,
115+ uint32_t *sse_ptr, bool use_high_bit_depth_,
121116 vpx_bit_depth_t bit_depth) {
122117 int64_t se = 0;
123118 uint64_t sse = 0;
@@ -161,16 +156,13 @@ static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src, · 37 unmodified lines
161156 }
162157 RoundHighBitDepth(bit_depth, &se, &sse);
163158 *sse_ptr = static_cast<uint32_t>(sse);
164− return static_cast<uint32_t>(sse -
165− ((static_cast<int64_t>(se) * se) >>
166− (l2w + l2h)));
159+ return static_cast<uint32_t>(
160+ sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
167161 }
168162
169−static uint32_t subpel_avg_variance_ref(const uint8_t *ref,
170− const uint8_t *src,
171− const uint8_t *second_pred,
172− int l2w, int l2h,
173− int xoff, int yoff,
163+static uint32_t subpel_avg_variance_ref(const uint8_t *ref, const uint8_t *src,
164+ const uint8_t *second_pred, int l2w,
165+ int l2h, int xoff, int yoff,
174166 uint32_t *sse_ptr,
175167 bool use_high_bit_depth,
176168 vpx_bit_depth_t bit_depth) {
@@ -218,9 +210,8 @@ static uint32_t subpel_avg_variance_ref(const uint8_t *ref, · 41 unmodified lines
218210 }
219211 RoundHighBitDepth(bit_depth, &se, &sse);
220212 *sse_ptr = static_cast<uint32_t>(sse);
221− return static_cast<uint32_t>(sse -
222− ((static_cast<int64_t>(se) * se) >>
223− (l2w + l2h)));
213+ return static_cast<uint32_t>(
214+ sse - ((static_cast<int64_t>(se) * se) >> (l2w + l2h)));
224215 }
225216
226217 ////////////////////////////////////////////////////////////////////////////////
@@ -229,9 +220,7 @@ class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> { · 2 unmodified lines
229220 public:
230221 SumOfSquaresTest() : func_(GetParam()) {}
231222
232− virtual ~SumOfSquaresTest() {
233− libvpx_test::ClearSystemState();
234− }
223+ virtual ~SumOfSquaresTest() { libvpx_test::ClearSystemState(); }
235224
236225 protected:
237226 void ConstTest();
@@ -272,10 +261,10 @@ void SumOfSquaresTest::RefTest() { · 34 unmodified lines
272261 // some testing context.
273262 // Can be used for MSE, SSE, Variance, etc.
274263
275−template<typename Func>
264+template <typename Func>
276265 struct TestParams {
277− TestParams(int log2w = 0, int log2h = 0,
278− Func function = NULL, int bit_depth_value = 0)
266+ TestParams(int log2w = 0, int log2h = 0, Func function = NULL,
267+ int bit_depth_value = 0)
279268 : log2width(log2w), log2height(log2h), func(function) {
280269 use_high_bit_depth = (bit_depth_value > 0);
281270 if (use_high_bit_depth) {
@@ -298,17 +287,17 @@ struct TestParams { · 16 unmodified lines
298287 uint32_t mask;
299288 };
300289
301−template<typename Func>
290+template <typename Func>
302291 std::ostream &operator<<(std::ostream &os, const TestParams<Func> &p) {
303292 return os << "log2width/height:" << p.log2width << "/" << p.log2height
304− << " function:" << reinterpret_cast<const void*>(p.func)
293+ << " function:" << reinterpret_cast<const void *>(p.func)
305294 << " bit-depth:" << p.bit_depth;
306295 }
307296
308297 // Main class for testing a function type
309−template<typename FunctionType>
310−class MainTestClass :
311− public ::testing::TestWithParam<TestParams<FunctionType> > {
298+template <typename FunctionType>
299+class MainTestClass
300+ : public ::testing::TestWithParam<TestParams<FunctionType> > {
312301 public:
313302 virtual void SetUp() {
314303 params_ = this->GetParam();
@@ -316,7 +305,7 @@ class MainTestClass : · 1 unmodified line
316305 rnd_.Reset(ACMRandom::DeterministicSeed());
317306 const size_t unit =
318307 use_high_bit_depth() ? sizeof(uint16_t) : sizeof(uint8_t);
319− src_ = reinterpret_cast<uint8_t*>(vpx_memalign(16, block_size() * unit));
308+ src_ = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_size() * unit));
320309 ref_ = new uint8_t[block_size() * unit];
321310 ASSERT_TRUE(src_ != NULL);
322311 ASSERT_TRUE(ref_ != NULL);
@@ -333,8 +322,8 @@ class MainTestClass : · 10 unmodified lines
333322 #if CONFIG_VP9_HIGHBITDEPTH
334323 if (use_high_bit_depth()) {
335324 // TODO(skal): remove!
336− src_ = reinterpret_cast<uint8_t*>(CONVERT_TO_SHORTPTR(src_));
337− ref_ = reinterpret_cast<uint8_t*>(CONVERT_TO_SHORTPTR(ref_));
325+ src_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(src_));
326+ ref_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(ref_));
338327 }
339328 #endif
340329
@@ -380,20 +369,20 @@ class MainTestClass : · 39 unmodified lines
380369 ////////////////////////////////////////////////////////////////////////////////
381370 // Tests related to variance.
382371
383−template<typename VarianceFunctionType>
372+template <typename VarianceFunctionType>
384373 void MainTestClass<VarianceFunctionType>::ZeroTest() {
385374 for (int i = 0; i <= 255; ++i) {
386375 if (!use_high_bit_depth()) {
387376 memset(src_, i, block_size());
388377 } else {
389− uint16_t* const src16 = CONVERT_TO_SHORTPTR(src_);
378+ uint16_t *const src16 = CONVERT_TO_SHORTPTR(src_);
390379 for (int k = 0; k < block_size(); ++k) src16[k] = i << byte_shift();
391380 }
392381 for (int j = 0; j <= 255; ++j) {
393382 if (!use_high_bit_depth()) {
394383 memset(ref_, j, block_size());
395384 } else {
396− uint16_t* const ref16 = CONVERT_TO_SHORTPTR(ref_);
385+ uint16_t *const ref16 = CONVERT_TO_SHORTPTR(ref_);
397386 for (int k = 0; k < block_size(); ++k) ref16[k] = j << byte_shift();
398387 }
399388 unsigned int sse, var;
@@ -404,7 +393,7 @@ void MainTestClass<VarianceFunctionType>::ZeroTest() { · 4 unmodified lines
404393 }
405394 }
406395
407−template<typename VarianceFunctionType>
396+template <typename VarianceFunctionType>
408397 void MainTestClass<VarianceFunctionType>::RefTest() {
409398 for (int i = 0; i < 10; ++i) {
410399 for (int j = 0; j < block_size(); j++) {
@@ -422,15 +411,15 @@ void MainTestClass<VarianceFunctionType>::RefTest() { · 11 unmodified lines
422411 const int stride = width();
423412 ASM_REGISTER_STATE_CHECK(
424413 var1 = params_.func(src_, stride, ref_, stride, &sse1));
425− var2 = variance_ref(src_, ref_, params_.log2width, params_.log2height,
426− stride, stride, &sse2,
427− use_high_bit_depth(), params_.bit_depth);
414+ var2 =
415+ variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
416+ stride, &sse2, use_high_bit_depth(), params_.bit_depth);
428417 EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
429418 EXPECT_EQ(var1, var2) << "Error at test index: " << i;
430419 }
431420 }
432421
433−template<typename VarianceFunctionType>
422+template <typename VarianceFunctionType>
434423 void MainTestClass<VarianceFunctionType>::RefStrideTest() {
435424 for (int i = 0; i < 10; ++i) {
436425 const int ref_stride = (i & 1) * width();
@@ -453,16 +442,15 @@ void MainTestClass<VarianceFunctionType>::RefStrideTest() { · 16 unmodified lines
453442
454443 ASM_REGISTER_STATE_CHECK(
455444 var1 = params_.func(src_, src_stride, ref_, ref_stride, &sse1));
456− var2 = variance_ref(src_, ref_,
457− params_.log2width, params_.log2height,
458− src_stride, ref_stride, &sse2,
459− use_high_bit_depth(), params_.bit_depth);
445+ var2 = variance_ref(src_, ref_, params_.log2width, params_.log2height,
446+ src_stride, ref_stride, &sse2, use_high_bit_depth(),
447+ params_.bit_depth);
460448 EXPECT_EQ(sse1, sse2) << "Error at test index: " << i;
461449 EXPECT_EQ(var1, var2) << "Error at test index: " << i;
462450 }
463451 }
464452
465−template<typename VarianceFunctionType>
453+template <typename VarianceFunctionType>
466454 void MainTestClass<VarianceFunctionType>::OneQuarterTest() {
467455 const int half = block_size() / 2;
468456 if (!use_high_bit_depth()) {
@@ -486,7 +474,7 @@ void MainTestClass<VarianceFunctionType>::OneQuarterTest() { · 17 unmodified lines
486474 ////////////////////////////////////////////////////////////////////////////////
487475 // Tests related to MSE / SSE.
488476
489−template<typename FunctionType>
477+template <typename FunctionType>
490478 void MainTestClass<FunctionType>::RefTestMse() {
491479 for (int i = 0; i < 10; ++i) {
492480 for (int j = 0; j < block_size(); ++j) {
@@ -496,13 +484,13 @@ void MainTestClass<FunctionType>::RefTestMse() { · 3 unmodified lines
496484 unsigned int sse1, sse2;
497485 const int stride = width();
498486 ASM_REGISTER_STATE_CHECK(params_.func(src_, stride, ref_, stride, &sse1));
499− variance_ref(src_, ref_, params_.log2width, params_.log2height,
500− stride, stride, &sse2, false, VPX_BITS_8);
487+ variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
488+ stride, &sse2, false, VPX_BITS_8);
501489 EXPECT_EQ(sse1, sse2);
502490 }
503491 }
504492
505−template<typename FunctionType>
493+template <typename FunctionType>
506494 void MainTestClass<FunctionType>::RefTestSse() {
507495 for (int i = 0; i < 10; ++i) {
508496 for (int j = 0; j < block_size(); ++j) {
@@ -513,13 +501,13 @@ void MainTestClass<FunctionType>::RefTestSse() { · 4 unmodified lines
513501 unsigned int var1;
514502 const int stride = width();
515503 ASM_REGISTER_STATE_CHECK(var1 = params_.func(src_, stride, ref_, stride));
516− variance_ref(src_, ref_, params_.log2width, params_.log2height,
517− stride, stride, &sse2, false, VPX_BITS_8);
504+ variance_ref(src_, ref_, params_.log2width, params_.log2height, stride,
505+ stride, &sse2, false, VPX_BITS_8);
518506 EXPECT_EQ(var1, sse2);
519507 }
520508 }
521509
522−template<typename FunctionType>
510+template <typename FunctionType>
523511 void MainTestClass<FunctionType>::MaxTestMse() {
524512 memset(src_, 255, block_size());
525513 memset(ref_, 0, block_size());
@@ -529,7 +517,7 @@ void MainTestClass<FunctionType>::MaxTestMse() { · 3 unmodified lines
529517 EXPECT_EQ(expected, sse);
530518 }
531519
532−template<typename FunctionType>
520+template <typename FunctionType>
533521 void MainTestClass<FunctionType>::MaxTestSse() {
534522 memset(src_, 255, block_size());
535523 memset(ref_, 0, block_size());
@@ -545,27 +533,27 @@ using ::std::tr1::get; · 9 unmodified lines
545533 using ::std::tr1::make_tuple;
546534 using ::std::tr1::tuple;
547535
548−template<typename SubpelVarianceFunctionType>
536+template <typename SubpelVarianceFunctionType>
549537 class SubpelVarianceTest
550− : public ::testing::TestWithParam<tuple<int, int,
551− SubpelVarianceFunctionType, int> > {
538+ : public ::testing::TestWithParam<
539+ tuple<int, int, SubpelVarianceFunctionType, int> > {
552540 public:
553541 virtual void SetUp() {
554− const tuple<int, int, SubpelVarianceFunctionType, int>& params =
542+ const tuple<int, int, SubpelVarianceFunctionType, int> &params =
555543 this->GetParam();
556− log2width_ = get<0>(params);
544+ log2width_ = get<0>(params);
557545 width_ = 1 << log2width_;
558546 log2height_ = get<1>(params);
559547 height_ = 1 << log2height_;
560548 subpel_variance_ = get<2>(params);
561549 if (get<3>(params)) {
562− bit_depth_ = (vpx_bit_depth_t) get<3>(params);
550+ bit_depth_ = (vpx_bit_depth_t)get<3>(params);
563551 use_high_bit_depth_ = true;
564552 } else {
565553 bit_depth_ = VPX_BITS_8;
566554 use_high_bit_depth_ = false;
567555 }
568− mask_ = (1 << bit_depth_)-1;
556+ mask_ = (1 << bit_depth_) - 1;
569557
570558 rnd_.Reset(ACMRandom::DeterministicSeed());
571559 block_size_ = width_ * height_;
@@ -575,14 +563,12 @@ class SubpelVarianceTest · 3 unmodified lines
575563 ref_ = new uint8_t[block_size_ + width_ + height_ + 1];
576564 #if CONFIG_VP9_HIGHBITDEPTH
577565 } else {
578− src_ = CONVERT_TO_BYTEPTR(
579− reinterpret_cast<uint16_t *>(
580− vpx_memalign(16, block_size_*sizeof(uint16_t))));
581− sec_ = CONVERT_TO_BYTEPTR(
582− reinterpret_cast<uint16_t *>(
583− vpx_memalign(16, block_size_*sizeof(uint16_t))));
584− ref_ = CONVERT_TO_BYTEPTR(
585− new uint16_t[block_size_ + width_ + height_ + 1]);
566+ src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
567+ vpx_memalign(16, block_size_ * sizeof(uint16_t))));
568+ sec_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
569+ vpx_memalign(16, block_size_ * sizeof(uint16_t))));
570+ ref_ =
571+ CONVERT_TO_BYTEPTR(new uint16_t[block_size_ + width_ + height_ + 1]);
586572 #endif // CONFIG_VP9_HIGHBITDEPTH
587573 }
588574 ASSERT_TRUE(src_ != NULL);
@@ -617,11 +603,11 @@ class SubpelVarianceTest · 28 unmodified lines
617603 vpx_bit_depth_t bit_depth_;
618604 int width_, log2width_;
619605 int height_, log2height_;
620− int block_size_, mask_;
606+ int block_size_, mask_;
621607 SubpelVarianceFunctionType subpel_variance_;
622608 };
623609
624−template<typename SubpelVarianceFunctionType>
610+template <typename SubpelVarianceFunctionType>
625611 void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
626612 for (int x = 0; x < 8; ++x) {
627613 for (int y = 0; y < 8; ++y) {
@@ -644,20 +630,18 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() { · 16 unmodified lines
644630 }
645631 unsigned int sse1, sse2;
646632 unsigned int var1;
647− ASM_REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y,
648− src_, width_, &sse1));
649− const unsigned int var2 = subpel_variance_ref(ref_, src_,
650− log2width_, log2height_,
651− x, y, &sse2,
652− use_high_bit_depth_,
653− bit_depth_);
633+ ASM_REGISTER_STATE_CHECK(
634+ var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1));
635+ const unsigned int var2 =
636+ subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2,
637+ use_high_bit_depth_, bit_depth_);
654638 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
655639 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
656640 }
657641 }
658642 }
659643
660−template<typename SubpelVarianceFunctionType>
644+template <typename SubpelVarianceFunctionType>
661645 void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() {
662646 // Compare against reference.
663647 // Src: Set the first half of values to 0, the second half to the maximum.
@@ -684,15 +668,15 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() { · 20 unmodified lines
684668 ASM_REGISTER_STATE_CHECK(
685669 var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1));
686670 const unsigned int var2 =
687− subpel_variance_ref(ref_, src_, log2width_, log2height_,
688− x, y, &sse2, use_high_bit_depth_, bit_depth_);
671+ subpel_variance_ref(ref_, src_, log2width_, log2height_, x, y, &sse2,
672+ use_high_bit_depth_, bit_depth_);
689673 EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y;
690674 EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y;
691675 }
692676 }
693677 }
694678
695−template<>
679+template <>
696680 void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() {
697681 for (int x = 0; x < 8; ++x) {
698682 for (int y = 0; y < 8; ++y) {
@@ -717,13 +701,11 @@ void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() { · 18 unmodified lines
717701 }
718702 uint32_t sse1, sse2;
719703 uint32_t var1, var2;
720− ASM_REGISTER_STATE_CHECK(
721− var1 = subpel_variance_(ref_, width_ + 1, x, y,
722− src_, width_, &sse1, sec_));
723− var2 = subpel_avg_variance_ref(ref_, src_, sec_,
724− log2width_, log2height_,
725− x, y, &sse2,
726− use_high_bit_depth_,
704+ ASM_REGISTER_STATE_CHECK(var1 =
705+ subpel_variance_(ref_, width_ + 1, x, y,
706+ src_, width_, &sse1, sec_));
707+ var2 = subpel_avg_variance_ref(ref_, src_, sec_, log2width_, log2height_,
708+ x, y, &sse2, use_high_bit_depth_,
727709 static_cast<vpx_bit_depth_t>(bit_depth_));
728710 EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
729711 EXPECT_EQ(var1, var2) << "at position " << x << ", " << y;
@@ -756,14 +738,15 @@ INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest, · 26 unmodified lines
756738
757739 typedef TestParams<Get4x4SseFunc> SseParams;
758740 INSTANTIATE_TEST_CASE_P(C, VpxSseTest,
759− ::testing::Values(SseParams(2, 2, &vpx_get4x4sse_cs_c)));
741+ ::testing::Values(SseParams(2, 2,
742+ &vpx_get4x4sse_cs_c)));
760743
761744 typedef TestParams<VarianceMxNFunc> MseParams;
762745 INSTANTIATE_TEST_CASE_P(C, VpxMseTest,
763− ::testing::Values(MseParams(4, 4, &vpx_mse16x16_c),
764− MseParams(4, 3, &vpx_mse16x8_c),
765− MseParams(3, 4, &vpx_mse8x16_c),
766− MseParams(3, 3, &vpx_mse8x8_c)));
746+ ::testing::Values(MseParams(4, 4, &vpx_mse16x16_c),
747+ MseParams(4, 3, &vpx_mse16x8_c),
748+ MseParams(3, 4, &vpx_mse8x16_c),
749+ MseParams(3, 3, &vpx_mse8x8_c)));
767750
768751 typedef TestParams<VarianceMxNFunc> VarianceParams;
769752 INSTANTIATE_TEST_CASE_P(
@@ -818,8 +801,7 @@ INSTANTIATE_TEST_CASE_P( · 48 unmodified lines
818801 typedef MainTestClass<VarianceMxNFunc> VpxHBDMseTest;
819802 typedef MainTestClass<VarianceMxNFunc> VpxHBDVarianceTest;
820803 typedef SubpelVarianceTest<SubpixVarMxNFunc> VpxHBDSubpelVarianceTest;
821−typedef SubpelVarianceTest<SubpixAvgVarMxNFunc>
822− VpxHBDSubpelAvgVarianceTest;
804+typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> VpxHBDSubpelAvgVarianceTest;
823805
824806 TEST_P(VpxHBDMseTest, RefMse) { RefTestMse(); }
825807 TEST_P(VpxHBDMseTest, MaxMse) { MaxTestMse(); }
@@ -982,10 +964,10 @@ INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest, · 156 unmodified lines
982964 ::testing::Values(vpx_get_mb_ss_sse2));
983965
984966 INSTANTIATE_TEST_CASE_P(SSE2, VpxMseTest,
985− ::testing::Values(MseParams(4, 4, &vpx_mse16x16_sse2),
986− MseParams(4, 3, &vpx_mse16x8_sse2),
987− MseParams(3, 4, &vpx_mse8x16_sse2),
988− MseParams(3, 3, &vpx_mse8x8_sse2)));
967+ ::testing::Values(MseParams(4, 4, &vpx_mse16x16_sse2),
968+ MseParams(4, 3, &vpx_mse16x8_sse2),
969+ MseParams(3, 4, &vpx_mse8x16_sse2),
970+ MseParams(3, 3, &vpx_mse8x8_sse2)));
989971
990972 INSTANTIATE_TEST_CASE_P(
991973 SSE2, VpxVarianceTest,
@@ -1055,37 +1037,38 @@ INSTANTIATE_TEST_CASE_P( · 63 unmodified lines
10551037 */
10561038
10571039 INSTANTIATE_TEST_CASE_P(
1058− SSE2, VpxHBDVarianceTest, ::testing::Values(
1059− VarianceParams(6, 6, &vpx_highbd_12_variance64x64_sse2, 12),
1060− VarianceParams(6, 5, &vpx_highbd_12_variance64x32_sse2, 12),
1061− VarianceParams(5, 6, &vpx_highbd_12_variance32x64_sse2, 12),
1062− VarianceParams(5, 5, &vpx_highbd_12_variance32x32_sse2, 12),
1063− VarianceParams(5, 4, &vpx_highbd_12_variance32x16_sse2, 12),
1064− VarianceParams(4, 5, &vpx_highbd_12_variance16x32_sse2, 12),
1065− VarianceParams(4, 4, &vpx_highbd_12_variance16x16_sse2, 12),
1066− VarianceParams(4, 3, &vpx_highbd_12_variance16x8_sse2, 12),
1067− VarianceParams(3, 4, &vpx_highbd_12_variance8x16_sse2, 12),
1068− VarianceParams(3, 3, &vpx_highbd_12_variance8x8_sse2, 12),
1069− VarianceParams(6, 6, &vpx_highbd_10_variance64x64_sse2, 10),
1070− VarianceParams(6, 5, &vpx_highbd_10_variance64x32_sse2, 10),
1071− VarianceParams(5, 6, &vpx_highbd_10_variance32x64_sse2, 10),
1072− VarianceParams(5, 5, &vpx_highbd_10_variance32x32_sse2, 10),
1073− VarianceParams(5, 4, &vpx_highbd_10_variance32x16_sse2, 10),
1074− VarianceParams(4, 5, &vpx_highbd_10_variance16x32_sse2, 10),
1075− VarianceParams(4, 4, &vpx_highbd_10_variance16x16_sse2, 10),
1076− VarianceParams(4, 3, &vpx_highbd_10_variance16x8_sse2, 10),
1077− VarianceParams(3, 4, &vpx_highbd_10_variance8x16_sse2, 10),
1078− VarianceParams(3, 3, &vpx_highbd_10_variance8x8_sse2, 10),
1079− VarianceParams(6, 6, &vpx_highbd_8_variance64x64_sse2, 8),
1080− VarianceParams(6, 5, &vpx_highbd_8_variance64x32_sse2, 8),
1081− VarianceParams(5, 6, &vpx_highbd_8_variance32x64_sse2, 8),
1082− VarianceParams(5, 5, &vpx_highbd_8_variance32x32_sse2, 8),
1083− VarianceParams(5, 4, &vpx_highbd_8_variance32x16_sse2, 8),
1084− VarianceParams(4, 5, &vpx_highbd_8_variance16x32_sse2, 8),
1085− VarianceParams(4, 4, &vpx_highbd_8_variance16x16_sse2, 8),
1086− VarianceParams(4, 3, &vpx_highbd_8_variance16x8_sse2, 8),
1087− VarianceParams(3, 4, &vpx_highbd_8_variance8x16_sse2, 8),
1088− VarianceParams(3, 3, &vpx_highbd_8_variance8x8_sse2, 8)));
1040+ SSE2, VpxHBDVarianceTest,
1041+ ::testing::Values(
1042+ VarianceParams(6, 6, &vpx_highbd_12_variance64x64_sse2, 12),
1043+ VarianceParams(6, 5, &vpx_highbd_12_variance64x32_sse2, 12),
1044+ VarianceParams(5, 6, &vpx_highbd_12_variance32x64_sse2, 12),
1045+ VarianceParams(5, 5, &vpx_highbd_12_variance32x32_sse2, 12),
1046+ VarianceParams(5, 4, &vpx_highbd_12_variance32x16_sse2, 12),
1047+ VarianceParams(4, 5, &vpx_highbd_12_variance16x32_sse2, 12),
1048+ VarianceParams(4, 4, &vpx_highbd_12_variance16x16_sse2, 12),
1049+ VarianceParams(4, 3, &vpx_highbd_12_variance16x8_sse2, 12),
1050+ VarianceParams(3, 4, &vpx_highbd_12_variance8x16_sse2, 12),
1051+ VarianceParams(3, 3, &vpx_highbd_12_variance8x8_sse2, 12),
1052+ VarianceParams(6, 6, &vpx_highbd_10_variance64x64_sse2, 10),
1053+ VarianceParams(6, 5, &vpx_highbd_10_variance64x32_sse2, 10),
1054+ VarianceParams(5, 6, &vpx_highbd_10_variance32x64_sse2, 10),
1055+ VarianceParams(5, 5, &vpx_highbd_10_variance32x32_sse2, 10),
1056+ VarianceParams(5, 4, &vpx_highbd_10_variance32x16_sse2, 10),
1057+ VarianceParams(4, 5, &vpx_highbd_10_variance16x32_sse2, 10),
1058+ VarianceParams(4, 4, &vpx_highbd_10_variance16x16_sse2, 10),
1059+ VarianceParams(4, 3, &vpx_highbd_10_variance16x8_sse2, 10),
1060+ VarianceParams(3, 4, &vpx_highbd_10_variance8x16_sse2, 10),
1061+ VarianceParams(3, 3, &vpx_highbd_10_variance8x8_sse2, 10),
1062+ VarianceParams(6, 6, &vpx_highbd_8_variance64x64_sse2, 8),
1063+ VarianceParams(6, 5, &vpx_highbd_8_variance64x32_sse2, 8),
1064+ VarianceParams(5, 6, &vpx_highbd_8_variance32x64_sse2, 8),
1065+ VarianceParams(5, 5, &vpx_highbd_8_variance32x32_sse2, 8),
1066+ VarianceParams(5, 4, &vpx_highbd_8_variance32x16_sse2, 8),
1067+ VarianceParams(4, 5, &vpx_highbd_8_variance16x32_sse2, 8),
1068+ VarianceParams(4, 4, &vpx_highbd_8_variance16x16_sse2, 8),
1069+ VarianceParams(4, 3, &vpx_highbd_8_variance16x8_sse2, 8),
1070+ VarianceParams(3, 4, &vpx_highbd_8_variance8x16_sse2, 8),
1071+ VarianceParams(3, 3, &vpx_highbd_8_variance8x8_sse2, 8)));
10891072
10901073 INSTANTIATE_TEST_CASE_P(
10911074 SSE2, VpxHBDSubpelVarianceTest,
@@ -1200,7 +1183,7 @@ INSTANTIATE_TEST_CASE_P( · 108 unmodified lines
12001183
12011184 #if HAVE_AVX2
12021185 INSTANTIATE_TEST_CASE_P(AVX2, VpxMseTest,
1203− ::testing::Values(MseParams(4, 4, &vpx_mse16x16_avx2)));
1186+ ::testing::Values(MseParams(4, 4, &vpx_mse16x16_avx2)));
12041187
12051188 INSTANTIATE_TEST_CASE_P(
12061189 AVX2, VpxVarianceTest,
@@ -1224,7 +1207,8 @@ INSTANTIATE_TEST_CASE_P( · 17 unmodified lines
12241207
12251208 #if HAVE_MEDIA
12261209 INSTANTIATE_TEST_CASE_P(MEDIA, VpxMseTest,
1227− ::testing::Values(MseParams(4, 4, &vpx_mse16x16_media)));
1210+ ::testing::Values(MseParams(4, 4,
1211+ &vpx_mse16x16_media)));
12281212
12291213 INSTANTIATE_TEST_CASE_P(
12301214 MEDIA, VpxVarianceTest,
@@ -1239,10 +1223,11 @@ INSTANTIATE_TEST_CASE_P( · 8 unmodified lines
12391223
12401224 #if HAVE_NEON
12411225 INSTANTIATE_TEST_CASE_P(NEON, VpxSseTest,
1242− ::testing::Values(SseParams(2, 2, &vpx_get4x4sse_cs_neon)));
1226+ ::testing::Values(SseParams(2, 2,
1227+ &vpx_get4x4sse_cs_neon)));
12431228
12441229 INSTANTIATE_TEST_CASE_P(NEON, VpxMseTest,
1245− ::testing::Values(MseParams(4, 4, &vpx_mse16x16_neon)));
1230+ ::testing::Values(MseParams(4, 4, &vpx_mse16x16_neon)));
12461231
12471232 INSTANTIATE_TEST_CASE_P(
12481233 NEON, VpxVarianceTest,
@@ -1268,13 +1253,14 @@ INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest, · 19 unmodified lines
12681253 ::testing::Values(vpx_get_mb_ss_msa));
12691254
12701255 INSTANTIATE_TEST_CASE_P(MSA, VpxSseTest,
1271− ::testing::Values(SseParams(2, 2, &vpx_get4x4sse_cs_msa)));
1256+ ::testing::Values(SseParams(2, 2,
1257+ &vpx_get4x4sse_cs_msa)));
12721258
12731259 INSTANTIATE_TEST_CASE_P(MSA, VpxMseTest,
1274− ::testing::Values(MseParams(4, 4, &vpx_mse16x16_msa),
1275− MseParams(4, 3, &vpx_mse16x8_msa),
1276− MseParams(3, 4, &vpx_mse8x16_msa),
1277− MseParams(3, 3, &vpx_mse8x8_msa)));
1260+ ::testing::Values(MseParams(4, 4, &vpx_mse16x16_msa),
1261+ MseParams(4, 3, &vpx_mse16x8_msa),
1262+ MseParams(3, 4, &vpx_mse8x16_msa),
1263+ MseParams(3, 3, &vpx_mse8x8_msa)));
12781264
12791265 INSTANTIATE_TEST_CASE_P(
12801266 MSA, VpxVarianceTest,
test/video_source.h+14−29
@@ -51,7 +51,7 @@ static std::string GetDataPath() { · 50 unmodified lines
5151 #undef TO_STRING
5252 #undef STRINGIFY
5353
54−inline FILE *OpenTestDataFile(const std::string& file_name) {
54+inline FILE *OpenTestDataFile(const std::string &file_name) {
5555 const std::string path_to_source = GetDataPath() + "/" + file_name;
5656 return fopen(path_to_source.c_str(), "rb");
5757 }
@@ -76,21 +76,15 @@ static FILE *GetTempOutFile(std::string *file_name) { · 18 unmodified lines
7676
7777 class TempOutFile {
7878 public:
79− TempOutFile() {
80− file_ = GetTempOutFile(&file_name_);
81− }
79+ TempOutFile() { file_ = GetTempOutFile(&file_name_); }
8280 ~TempOutFile() {
8381 CloseFile();
8482 if (!file_name_.empty()) {
8583 EXPECT_EQ(0, remove(file_name_.c_str()));
8684 }
8785 }
88− FILE *file() {
89− return file_;
90− }
91− const std::string& file_name() {
92− return file_name_;
93− }
86+ FILE *file() { return file_; }
87+ const std::string &file_name() { return file_name_; }
9488
9589 protected:
9690 void CloseFile() {
@@ -134,14 +128,10 @@ class VideoSource { · 37 unmodified lines
134128 virtual unsigned int limit() const = 0;
135129 };
136130
137−
138131 class DummyVideoSource : public VideoSource {
139132 public:
140133 DummyVideoSource()
141− : img_(NULL),
142− limit_(100),
143− width_(80),
144− height_(64),
134+ : img_(NULL), limit_(100), width_(80), height_(64),
145135 format_(VPX_IMG_FMT_I420) {
146136 ReallocImage();
147137 }
@@ -158,9 +148,7 @@ class DummyVideoSource : public VideoSource { · 10 unmodified lines
158148 FillFrame();
159149 }
160150
161− virtual vpx_image_t *img() const {
162− return (frame_ < limit_) ? img_ : NULL;
163− }
151+ virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL; }
164152
165153 // Models a stream where Timebase = 1/FPS, so pts == frame.
166154 virtual vpx_codec_pts_t pts() const { return frame_; }
@@ -168,7 +156,7 @@ class DummyVideoSource : public VideoSource { · 1 unmodified line
168156 virtual unsigned long duration() const { return 1; }
169157
170158 virtual vpx_rational_t timebase() const {
171− const vpx_rational_t t = {1, 30};
159+ const vpx_rational_t t = { 1, 30 };
172160 return t;
173161 }
174162
@@ -176,9 +164,7 @@ class DummyVideoSource : public VideoSource { · 1 unmodified line
176164
177165 virtual unsigned int limit() const { return limit_; }
178166
179− void set_limit(unsigned int limit) {
180− limit_ = limit;
181− }
167+ void set_limit(unsigned int limit) { limit_ = limit; }
182168
183169 void SetSize(unsigned int width, unsigned int height) {
184170 if (width != width_ || height != height_) {
@@ -196,7 +182,9 @@ class DummyVideoSource : public VideoSource { · 11 unmodified lines
196182 }
197183
198184 protected:
199− virtual void FillFrame() { if (img_) memset(img_->img_data, 0, raw_sz_); }
185+ virtual void FillFrame() {
186+ if (img_) memset(img_->img_data, 0, raw_sz_);
187+ }
200188
201189 void ReallocImage() {
202190 vpx_img_free(img_);
@@ -205,7 +193,7 @@ class DummyVideoSource : public VideoSource { · 2 unmodified lines
205193 }
206194
207195 vpx_image_t *img_;
208− size_t raw_sz_;
196+ size_t raw_sz_;
209197 unsigned int limit_;
210198 unsigned int frame_;
211199 unsigned int width_;
@@ -213,12 +201,10 @@ class DummyVideoSource : public VideoSource { · 1 unmodified line
213201 vpx_img_fmt_t format_;
214202 };
215203
216−
217204 class RandomVideoSource : public DummyVideoSource {
218205 public:
219206 RandomVideoSource(int seed = ACMRandom::DeterministicSeed())
220− : rnd_(seed),
221− seed_(seed) { }
207+ : rnd_(seed), seed_(seed) {}
222208
223209 protected:
224210 // Reset the RNG to get a matching stream for the second pass
@@ -233,8 +219,7 @@ class RandomVideoSource : public DummyVideoSource { · 8 unmodified lines
233219 virtual void FillFrame() {
234220 if (img_) {
235221 if (frame_ % 30 < 15)
236− for (size_t i = 0; i < raw_sz_; ++i)
237− img_->img_data[i] = rnd_.Rand8();
222+ for (size_t i = 0; i < raw_sz_; ++i) img_->img_data[i] = rnd_.Rand8();
238223 else
239224 memset(img_->img_data, 0, raw_sz_);
240225 }
test/vp8_boolcoder_test.cc+9−10
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 * be found in the AUTHORS file in the root of the source tree.
99 */
1010
11−
1211 #include <math.h>
1312 #include <stddef.h>
1413 #include <stdio.h>
@@ -41,9 +40,9 @@ void encrypt_buffer(uint8_t *buffer, size_t size) { · 26 unmodified lines
4140 }
4241 }
4342
44−void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
45− uint8_t *output, int count) {
46− const size_t offset = input - reinterpret_cast<uint8_t*>(decrypt_state);
43+void test_decrypt_cb(void *decrypt_state, const uint8_t *input, uint8_t *output,
44+ int count) {
45+ const size_t offset = input - reinterpret_cast<uint8_t *>(decrypt_state);
4746 for (int i = 0; i < count; i++) {
4847 output[i] = input[i] ^ secret_key[(offset + i) & 15];
4948 }
@@ -56,12 +55,13 @@ using libvpx_test::ACMRandom; · 6 unmodified lines
5655 TEST(VP8, TestBitIO) {
5756 ACMRandom rnd(ACMRandom::DeterministicSeed());
5857 for (int n = 0; n < num_tests; ++n) {
59− for (int method = 0; method <= 7; ++method) { // we generate various proba
58+ for (int method = 0; method <= 7; ++method) { // we generate various proba
6059 const int kBitsToTest = 1000;
6160 uint8_t probas[kBitsToTest];
6261
6362 for (int i = 0; i < kBitsToTest; ++i) {
6463 const int parity = i & 1;
64+ /* clang-format off */
6565 probas[i] =
6666 (method == 0) ? 0 : (method == 1) ? 255 :
6767 (method == 2) ? 128 :
@@ -72,6 +72,7 @@ TEST(VP8, TestBitIO) { · 4 unmodified lines
7272 (method == 6) ?
7373 (parity ? rnd(64) : 255 - rnd(64)) :
7474 (parity ? rnd(32) : 255 - rnd(32));
75+ /* clang-format on */
7576 }
7677 for (int bit_method = 0; bit_method <= 3; ++bit_method) {
7778 const int random_seed = 6432;
@@ -95,8 +96,7 @@ TEST(VP8, TestBitIO) { · 17 unmodified lines
9596
9697 BOOL_DECODER br;
9798 encrypt_buffer(bw_buffer, kBufferSize);
98− vp8dx_start_decode(&br, bw_buffer, kBufferSize,
99− test_decrypt_cb,
99+ vp8dx_start_decode(&br, bw_buffer, kBufferSize, test_decrypt_cb,
100100 reinterpret_cast<void *>(bw_buffer));
101101 bit_rnd.Reset(random_seed);
102102 for (int i = 0; i < kBitsToTest; ++i) {
@@ -106,9 +106,8 @@ TEST(VP8, TestBitIO) { · 3 unmodified lines
106106 bit = bit_rnd(2);
107107 }
108108 GTEST_ASSERT_EQ(vp8dx_decode_bool(&br, probas[i]), bit)
109− << "pos: "<< i << " / " << kBitsToTest
110− << " bit_method: " << bit_method
111− << " method: " << method;
109+ << "pos: " << i << " / " << kBitsToTest
110+ << " bit_method: " << bit_method << " method: " << method;
112111 }
113112 }
114113 }
test/vp8_decrypt_test.cc+4−6
@@ -21,10 +21,8 @@ namespace { · 20 unmodified lines
2121 // with whatever internal state the decryptor uses. For testing we'll just
2222 // xor with a constant key, and decrypt_state will point to the start of
2323 // the original buffer.
24−const uint8_t test_key[16] = {
25− 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
26− 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0
27−};
24+const uint8_t test_key[16] = { 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
25+ 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0 };
2826
2927 void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size,
3028 ptrdiff_t offset) {
@@ -33,8 +31,8 @@ void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size, · 2 unmodified lines
3331 }
3432 }
3533
36−void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
37− uint8_t *output, int count) {
34+void test_decrypt_cb(void *decrypt_state, const uint8_t *input, uint8_t *output,
35+ int count) {
3836 encrypt_buffer(input, output, count,
3937 input - reinterpret_cast<uint8_t *>(decrypt_state));
4038 }
test/vp8_denoiser_sse2_test.cc+3−5
@@ -32,9 +32,7 @@ class VP8DenoiserTest : public ::testing::TestWithParam<int> { · 31 unmodified lines
3232 public:
3333 virtual ~VP8DenoiserTest() {}
3434
35− virtual void SetUp() {
36− increase_denoising_ = GetParam();
37− }
35+ virtual void SetUp() { increase_denoising_ = GetParam(); }
3836
3937 virtual void TearDown() { libvpx_test::ClearSystemState(); }
4038
@@ -71,8 +69,8 @@ TEST_P(VP8DenoiserTest, BitexactCheck) { · 30 unmodified lines
7169 sig_block_sse2[j] = sig_block_c[j] = rnd.Rand8();
7270 // The pixels in mc_avg_block are generated by adding a random
7371 // number in range [-19, 19] to corresponding pixels in sig_block.
74− temp = sig_block_c[j] + (rnd.Rand8() % 2 == 0 ? -1 : 1) *
75− (rnd.Rand8() % 20);
72+ temp =
73+ sig_block_c[j] + (rnd.Rand8() % 2 == 0 ? -1 : 1) * (rnd.Rand8() % 20);
7674 // Clip.
7775 mc_avg_block[j] = (temp < 0) ? 0 : ((temp > 255) ? 255 : temp);
7876 }
test/vp8_fdct4x4_test.cc+12−11
@@ -95,11 +95,12 @@ TEST(VP8FdctTest, SignBiasCheck) { · 94 unmodified lines
9595
9696 bool bias_acceptable = true;
9797 for (int j = 0; j < 16; ++j)
98− bias_acceptable = bias_acceptable &&
99− (abs(count_sign_block[j][0] - count_sign_block[j][1]) < 10000);
98+ bias_acceptable =
99+ bias_acceptable &&
100+ (abs(count_sign_block[j][0] - count_sign_block[j][1]) < 10000);
100101
101102 EXPECT_EQ(true, bias_acceptable)
102− << "Error: 4x4 FDCT has a sign bias > 1% for input range [-255, 255]";
103+ << "Error: 4x4 FDCT has a sign bias > 1% for input range [-255, 255]";
103104
104105 memset(count_sign_block, 0, sizeof(count_sign_block));
105106
@@ -120,11 +121,12 @@ TEST(VP8FdctTest, SignBiasCheck) { · 14 unmodified lines
120121
121122 bias_acceptable = true;
122123 for (int j = 0; j < 16; ++j)
123− bias_acceptable = bias_acceptable &&
124− (abs(count_sign_block[j][0] - count_sign_block[j][1]) < 100000);
124+ bias_acceptable =
125+ bias_acceptable &&
126+ (abs(count_sign_block[j][0] - count_sign_block[j][1]) < 100000);
125127
126128 EXPECT_EQ(true, bias_acceptable)
127− << "Error: 4x4 FDCT has a sign bias > 10% for input range [-15, 15]";
129+ << "Error: 4x4 FDCT has a sign bias > 10% for input range [-15, 15]";
128130 };
129131
130132 TEST(VP8FdctTest, RoundTripErrorCheck) {
@@ -148,17 +150,16 @@ TEST(VP8FdctTest, RoundTripErrorCheck) { · 17 unmodified lines
148150 for (int j = 0; j < 16; ++j) {
149151 const int diff = test_input_block[j] - test_output_block[j];
150152 const int error = diff * diff;
151− if (max_error < error)
152− max_error = error;
153+ if (max_error < error) max_error = error;
153154 total_error += error;
154155 }
155156 }
156157
157− EXPECT_GE(1, max_error )
158− << "Error: FDCT/IDCT has an individual roundtrip error > 1";
158+ EXPECT_GE(1, max_error)
159+ << "Error: FDCT/IDCT has an individual roundtrip error > 1";
159160
160161 EXPECT_GE(count_test_block, total_error)
161− << "Error: FDCT/IDCT has average roundtrip error > 1 per block";
162+ << "Error: FDCT/IDCT has average roundtrip error > 1 per block";
162163 };
163164
164165 } // namespace
test/vp8_fragments_test.cc+2−3
@@ -13,9 +13,8 @@ · 12 unmodified lines
1313
1414 namespace {
1515
16−class VP8FramgmentsTest
17− : public ::libvpx_test::EncoderTest,
18− public ::testing::Test {
16+class VP8FramgmentsTest : public ::libvpx_test::EncoderTest,
17+ public ::testing::Test {
1918 protected:
2019 VP8FramgmentsTest() : EncoderTest(&::libvpx_test::kVP8) {}
2120 virtual ~VP8FramgmentsTest() {}
test/vp9_arf_freq_test.cc+31−47
@@ -22,8 +22,8 @@ namespace { · 21 unmodified lines
2222 const unsigned int kFrames = 100;
2323 const int kBitrate = 500;
2424
25−#define ARF_NOT_SEEN 1000001
26−#define ARF_SEEN_ONCE 1000000
25+#define ARF_NOT_SEEN 1000001
26+#define ARF_SEEN_ONCE 1000000
2727
2828 typedef struct {
2929 const char *filename;
@@ -44,24 +44,20 @@ typedef struct { · 14 unmodified lines
4444
4545 const TestVideoParam kTestVectors[] = {
4646 // artificially increase framerate to trigger default check
47− {"hantro_collage_w352h288.yuv", 352, 288, 5000, 1,
48− 8, VPX_IMG_FMT_I420, VPX_BITS_8, 0},
49− {"hantro_collage_w352h288.yuv", 352, 288, 30, 1,
50− 8, VPX_IMG_FMT_I420, VPX_BITS_8, 0},
51− {"rush_hour_444.y4m", 352, 288, 30, 1,
52− 8, VPX_IMG_FMT_I444, VPX_BITS_8, 1},
47+ { "hantro_collage_w352h288.yuv", 352, 288, 5000, 1, 8, VPX_IMG_FMT_I420,
48+ VPX_BITS_8, 0 },
49+ { "hantro_collage_w352h288.yuv", 352, 288, 30, 1, 8, VPX_IMG_FMT_I420,
50+ VPX_BITS_8, 0 },
51+ { "rush_hour_444.y4m", 352, 288, 30, 1, 8, VPX_IMG_FMT_I444, VPX_BITS_8, 1 },
5352 #if CONFIG_VP9_HIGHBITDEPTH
54− // Add list of profile 2/3 test videos here ...
53+// Add list of profile 2/3 test videos here ...
5554 #endif // CONFIG_VP9_HIGHBITDEPTH
5655 };
5756
5857 const TestEncodeParam kEncodeVectors[] = {
59− {::libvpx_test::kOnePassGood, 2},
60− {::libvpx_test::kOnePassGood, 5},
61− {::libvpx_test::kTwoPassGood, 1},
62− {::libvpx_test::kTwoPassGood, 2},
63− {::libvpx_test::kTwoPassGood, 5},
64− {::libvpx_test::kRealTime, 5},
58+ { ::libvpx_test::kOnePassGood, 2 }, { ::libvpx_test::kOnePassGood, 5 },
59+ { ::libvpx_test::kTwoPassGood, 1 }, { ::libvpx_test::kTwoPassGood, 2 },
60+ { ::libvpx_test::kTwoPassGood, 5 }, { ::libvpx_test::kRealTime, 5 },
6561 };
6662
6763 const int kMinArfVectors[] = {
@@ -80,15 +76,12 @@ int is_extension_y4m(const char *filename) { · 12 unmodified lines
8076
8177 class ArfFreqTest
8278 : public ::libvpx_test::EncoderTest,
83− public ::libvpx_test::CodecTestWith3Params<TestVideoParam, \
79+ public ::libvpx_test::CodecTestWith3Params<TestVideoParam,
8480 TestEncodeParam, int> {
8581 protected:
8682 ArfFreqTest()
87− : EncoderTest(GET_PARAM(0)),
88− test_video_param_(GET_PARAM(1)),
89− test_encode_param_(GET_PARAM(2)),
90− min_arf_requested_(GET_PARAM(3)) {
91− }
83+ : EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(1)),
84+ test_encode_param_(GET_PARAM(2)), min_arf_requested_(GET_PARAM(3)) {}
9285
9386 virtual ~ArfFreqTest() {}
9487
@@ -114,17 +107,16 @@ class ArfFreqTest · 19 unmodified lines
114107 }
115108
116109 int GetNumFramesInPkt(const vpx_codec_cx_pkt_t *pkt) {
117− const uint8_t *buffer = reinterpret_cast<uint8_t*>(pkt->data.frame.buf);
110+ const uint8_t *buffer = reinterpret_cast<uint8_t *>(pkt->data.frame.buf);
118111 const uint8_t marker = buffer[pkt->data.frame.sz - 1];
119112 const int mag = ((marker >> 3) & 3) + 1;
120113 int frames = (marker & 0x7) + 1;
121− const unsigned int index_sz = 2 + mag * frames;
114+ const unsigned int index_sz = 2 + mag * frames;
122115 // Check for superframe or not.
123116 // Assume superframe has only one visible frame, the rest being
124117 // invisible. If superframe index is not found, then there is only
125118 // one frame.
126− if (!((marker & 0xe0) == 0xc0 &&
127− pkt->data.frame.sz >= index_sz &&
119+ if (!((marker & 0xe0) == 0xc0 && pkt->data.frame.sz >= index_sz &&
128120 buffer[pkt->data.frame.sz - index_sz] == marker)) {
129121 frames = 1;
130122 }
@@ -132,8 +124,7 @@ class ArfFreqTest · 1 unmodified line
132124 }
133125
134126 virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
135− if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
136− return;
127+ if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) return;
137128 const int frames = GetNumFramesInPkt(pkt);
138129 if (frames == 1) {
139130 run_of_visible_frames_++;
@@ -167,9 +158,7 @@ class ArfFreqTest · 27 unmodified lines
167158 }
168159 }
169160
170− int GetMinVisibleRun() const {
171− return min_run_;
172− }
161+ int GetMinVisibleRun() const { return min_run_; }
173162
174163 int GetMinArfDistanceRequested() const {
175164 if (min_arf_requested_)
@@ -178,7 +167,7 @@ class ArfFreqTest · 2 unmodified lines
178167 return vp9_rc_get_default_min_gf_interval(
179168 test_video_param_.width, test_video_param_.height,
180169 (double)test_video_param_.framerate_num /
181− test_video_param_.framerate_den);
170+ test_video_param_.framerate_den);
182171 }
183172
184173 TestVideoParam test_video_param_;
@@ -197,21 +186,18 @@ TEST_P(ArfFreqTest, MinArfFreqTest) { · 12 unmodified lines
197186 cfg_.g_input_bit_depth = test_video_param_.input_bit_depth;
198187 cfg_.g_bit_depth = test_video_param_.bit_depth;
199188 init_flags_ = VPX_CODEC_USE_PSNR;
200− if (cfg_.g_bit_depth > 8)
201− init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
189+ if (cfg_.g_bit_depth > 8) init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
202190
203191 testing::internal::scoped_ptr<libvpx_test::VideoSource> video;
204192 if (is_extension_y4m(test_video_param_.filename)) {
205− video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename,
206− 0, kFrames));
193+ video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename, 0,
194+ kFrames));
207195 } else {
208− video.reset(new libvpx_test::YUVVideoSource(test_video_param_.filename,
209− test_video_param_.fmt,
210− test_video_param_.width,
211− test_video_param_.height,
212− test_video_param_.framerate_num,
213− test_video_param_.framerate_den,
214− 0, kFrames));
196+ video.reset(new libvpx_test::YUVVideoSource(
197+ test_video_param_.filename, test_video_param_.fmt,
198+ test_video_param_.width, test_video_param_.height,
199+ test_video_param_.framerate_num, test_video_param_.framerate_den, 0,
200+ kFrames));
215201 }
216202
217203 ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
@@ -223,9 +209,7 @@ TEST_P(ArfFreqTest, MinArfFreqTest) { · 5 unmodified lines
223209 }
224210 }
225211
226−VP9_INSTANTIATE_TEST_CASE(
227− ArfFreqTest,
228− ::testing::ValuesIn(kTestVectors),
229− ::testing::ValuesIn(kEncodeVectors),
230− ::testing::ValuesIn(kMinArfVectors));
212+VP9_INSTANTIATE_TEST_CASE(ArfFreqTest, ::testing::ValuesIn(kTestVectors),
213+ ::testing::ValuesIn(kEncodeVectors),
214+ ::testing::ValuesIn(kMinArfVectors));
231215 } // namespace
test/vp9_boolcoder_test.cc+4−3
@@ -28,12 +28,13 @@ const int num_tests = 10; · 27 unmodified lines
2828 TEST(VP9, TestBitIO) {
2929 ACMRandom rnd(ACMRandom::DeterministicSeed());
3030 for (int n = 0; n < num_tests; ++n) {
31− for (int method = 0; method <= 7; ++method) { // we generate various proba
31+ for (int method = 0; method <= 7; ++method) { // we generate various proba
3232 const int kBitsToTest = 1000;
3333 uint8_t probas[kBitsToTest];
3434
3535 for (int i = 0; i < kBitsToTest; ++i) {
3636 const int parity = i & 1;
37+ /* clang-format off */
3738 probas[i] =
3839 (method == 0) ? 0 : (method == 1) ? 255 :
3940 (method == 2) ? 128 :
@@ -44,6 +45,7 @@ TEST(VP9, TestBitIO) { · 4 unmodified lines
4445 (method == 6) ?
4546 (parity ? rnd(64) : 255 - rnd(64)) :
4647 (parity ? rnd(32) : 255 - rnd(32));
48+ /* clang-format on */
4749 }
4850 for (int bit_method = 0; bit_method <= 3; ++bit_method) {
4951 const int random_seed = 6432;
@@ -79,8 +81,7 @@ TEST(VP9, TestBitIO) { · 29 unmodified lines
7981 }
8082 GTEST_ASSERT_EQ(vpx_read(&br, probas[i]), bit)
8183 << "pos: " << i << " / " << kBitsToTest
82− << " bit_method: " << bit_method
83− << " method: " << method;
84+ << " bit_method: " << bit_method << " method: " << method;
8485 }
8586 }
8687 }
test/vp9_decrypt_test.cc+4−6
@@ -21,10 +21,8 @@ namespace { · 20 unmodified lines
2121 // with whatever internal state the decryptor uses. For testing we'll just
2222 // xor with a constant key, and decrypt_state will point to the start of
2323 // the original buffer.
24−const uint8_t test_key[16] = {
25− 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
26− 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0
27−};
24+const uint8_t test_key[16] = { 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
25+ 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0 };
2826
2927 void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size,
3028 ptrdiff_t offset) {
@@ -33,8 +31,8 @@ void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size, · 2 unmodified lines
3331 }
3432 }
3533
36−void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
37− uint8_t *output, int count) {
34+void test_decrypt_cb(void *decrypt_state, const uint8_t *input, uint8_t *output,
35+ int count) {
3836 encrypt_buffer(input, output, count,
3937 input - reinterpret_cast<uint8_t *>(decrypt_state));
4038 }
test/vp9_denoiser_sse2_test.cc+13−15
@@ -33,9 +33,7 @@ class VP9DenoiserTest : public ::testing::TestWithParam<BLOCK_SIZE> { · 32 unmodified lines
3333 public:
3434 virtual ~VP9DenoiserTest() {}
3535
36− virtual void SetUp() {
37− bs_ = GetParam();
38− }
36+ virtual void SetUp() { bs_ = GetParam(); }
3937
4038 virtual void TearDown() { libvpx_test::ClearSystemState(); }
4139
@@ -68,19 +66,19 @@ TEST_P(VP9DenoiserTest, BitexactCheck) { · 26 unmodified lines
6866 sig_block[j] = rnd.Rand8();
6967 // The pixels in mc_avg_block are generated by adding a random
7068 // number in range [-19, 19] to corresponding pixels in sig_block.
71− temp = sig_block[j] + ((rnd.Rand8() % 2 == 0) ? -1 : 1) *
72− (rnd.Rand8() % 20);
69+ temp =
70+ sig_block[j] + ((rnd.Rand8() % 2 == 0) ? -1 : 1) * (rnd.Rand8() % 20);
7371 // Clip.
7472 mc_avg_block[j] = (temp < 0) ? 0 : ((temp > 255) ? 255 : temp);
7573 }
7674
77− ASM_REGISTER_STATE_CHECK(vp9_denoiser_filter_c(
78− sig_block, 64, mc_avg_block, 64, avg_block_c,
79− 64, 0, bs_, motion_magnitude_random));
75+ ASM_REGISTER_STATE_CHECK(vp9_denoiser_filter_c(sig_block, 64, mc_avg_block,
76+ 64, avg_block_c, 64, 0, bs_,
77+ motion_magnitude_random));
8078
8179 ASM_REGISTER_STATE_CHECK(vp9_denoiser_filter_sse2(
82− sig_block, 64, mc_avg_block, 64, avg_block_sse2,
83− 64, 0, bs_, motion_magnitude_random));
80+ sig_block, 64, mc_avg_block, 64, avg_block_sse2, 64, 0, bs_,
81+ motion_magnitude_random));
8482
8583 // Test bitexactness.
8684 for (int h = 0; h < (4 << b_height_log2_lookup[bs_]); ++h) {
@@ -92,9 +90,9 @@ TEST_P(VP9DenoiserTest, BitexactCheck) { · 5 unmodified lines
9290 }
9391
9492 // Test for all block size.
95−INSTANTIATE_TEST_CASE_P(
96− SSE2, VP9DenoiserTest,
97− ::testing::Values(BLOCK_8X8, BLOCK_8X16, BLOCK_16X8, BLOCK_16X16,
98− BLOCK_16X32, BLOCK_32X16, BLOCK_32X32, BLOCK_32X64,
99− BLOCK_64X32, BLOCK_64X64));
93+INSTANTIATE_TEST_CASE_P(SSE2, VP9DenoiserTest,
94+ ::testing::Values(BLOCK_8X8, BLOCK_8X16, BLOCK_16X8,
95+ BLOCK_16X16, BLOCK_16X32, BLOCK_32X16,
96+ BLOCK_32X32, BLOCK_32X64, BLOCK_64X32,
97+ BLOCK_64X64));
10098 } // namespace
test/vp9_encoder_parms_get_to_decoder.cc+5−5
@@ -29,7 +29,7 @@ struct EncodePerfTestVideo { · 28 unmodified lines
2929 };
3030
3131 const EncodePerfTestVideo kVP9EncodePerfTestVectors[] = {
32− {"niklas_1280_720_30.y4m", 1280, 720, 600, 10},
32+ { "niklas_1280_720_30.y4m", 1280, 720, 600, 10 },
3333 };
3434
3535 struct EncodeParameters {
@@ -45,10 +45,10 @@ struct EncodeParameters { · 9 unmodified lines
4545 };
4646
4747 const EncodeParameters kVP9EncodeParameterSet[] = {
48− {0, 0, 0, 1, 0, VPX_CR_STUDIO_RANGE, VPX_CS_BT_601, { 0, 0 }},
49− {0, 0, 0, 0, 0, VPX_CR_FULL_RANGE, VPX_CS_BT_709, { 0, 0 }},
50− {0, 0, 1, 0, 0, VPX_CR_FULL_RANGE, VPX_CS_BT_2020, { 0, 0 }},
51− {0, 2, 0, 0, 1, VPX_CR_STUDIO_RANGE, VPX_CS_UNKNOWN, { 640, 480 }},
48+ { 0, 0, 0, 1, 0, VPX_CR_STUDIO_RANGE, VPX_CS_BT_601, { 0, 0 } },
49+ { 0, 0, 0, 0, 0, VPX_CR_FULL_RANGE, VPX_CS_BT_709, { 0, 0 } },
50+ { 0, 0, 1, 0, 0, VPX_CR_FULL_RANGE, VPX_CS_BT_2020, { 0, 0 } },
51+ { 0, 2, 0, 0, 1, VPX_CR_STUDIO_RANGE, VPX_CS_UNKNOWN, { 640, 480 } },
5252 // TODO(JBB): Test profiles (requires more work).
5353 };
5454
test/vp9_end_to_end_test.cc+34−47
@@ -18,21 +18,17 @@ · 17 unmodified lines
1818
1919 namespace {
2020
21−const unsigned int kWidth = 160;
21+const unsigned int kWidth = 160;
2222 const unsigned int kHeight = 90;
2323 const unsigned int kFramerate = 50;
2424 const unsigned int kFrames = 10;
2525 const int kBitrate = 500;
2626 // List of psnr thresholds for speed settings 0-7 and 5 encoding modes
2727 const double kPsnrThreshold[][5] = {
28− { 36.0, 37.0, 37.0, 37.0, 37.0 },
29− { 35.0, 36.0, 36.0, 36.0, 36.0 },
30− { 34.0, 35.0, 35.0, 35.0, 35.0 },
31− { 33.0, 34.0, 34.0, 34.0, 34.0 },
32− { 32.0, 33.0, 33.0, 33.0, 33.0 },
33− { 31.0, 32.0, 32.0, 32.0, 32.0 },
34− { 30.0, 31.0, 31.0, 31.0, 31.0 },
35− { 29.0, 30.0, 30.0, 30.0, 30.0 },
28+ { 36.0, 37.0, 37.0, 37.0, 37.0 }, { 35.0, 36.0, 36.0, 36.0, 36.0 },
29+ { 34.0, 35.0, 35.0, 35.0, 35.0 }, { 33.0, 34.0, 34.0, 34.0, 34.0 },
30+ { 32.0, 33.0, 33.0, 33.0, 33.0 }, { 31.0, 32.0, 32.0, 32.0, 32.0 },
31+ { 30.0, 31.0, 31.0, 31.0, 31.0 }, { 29.0, 30.0, 30.0, 30.0, 30.0 },
3632 };
3733
3834 typedef struct {
@@ -44,31 +40,30 @@ typedef struct { · 5 unmodified lines
4440 } TestVideoParam;
4541
4642 const TestVideoParam kTestVectors[] = {
47− {"park_joy_90p_8_420.y4m", 8, VPX_IMG_FMT_I420, VPX_BITS_8, 0},
48− {"park_joy_90p_8_422.y4m", 8, VPX_IMG_FMT_I422, VPX_BITS_8, 1},
49− {"park_joy_90p_8_444.y4m", 8, VPX_IMG_FMT_I444, VPX_BITS_8, 1},
50− {"park_joy_90p_8_440.yuv", 8, VPX_IMG_FMT_I440, VPX_BITS_8, 1},
43+ { "park_joy_90p_8_420.y4m", 8, VPX_IMG_FMT_I420, VPX_BITS_8, 0 },
44+ { "park_joy_90p_8_422.y4m", 8, VPX_IMG_FMT_I422, VPX_BITS_8, 1 },
45+ { "park_joy_90p_8_444.y4m", 8, VPX_IMG_FMT_I444, VPX_BITS_8, 1 },
46+ { "park_joy_90p_8_440.yuv", 8, VPX_IMG_FMT_I440, VPX_BITS_8, 1 },
5147 #if CONFIG_VP9_HIGHBITDEPTH
52− {"park_joy_90p_10_420.y4m", 10, VPX_IMG_FMT_I42016, VPX_BITS_10, 2},
53− {"park_joy_90p_10_422.y4m", 10, VPX_IMG_FMT_I42216, VPX_BITS_10, 3},
54− {"park_joy_90p_10_444.y4m", 10, VPX_IMG_FMT_I44416, VPX_BITS_10, 3},
55− {"park_joy_90p_10_440.yuv", 10, VPX_IMG_FMT_I44016, VPX_BITS_10, 3},
56− {"park_joy_90p_12_420.y4m", 12, VPX_IMG_FMT_I42016, VPX_BITS_12, 2},
57− {"park_joy_90p_12_422.y4m", 12, VPX_IMG_FMT_I42216, VPX_BITS_12, 3},
58− {"park_joy_90p_12_444.y4m", 12, VPX_IMG_FMT_I44416, VPX_BITS_12, 3},
59− {"park_joy_90p_12_440.yuv", 12, VPX_IMG_FMT_I44016, VPX_BITS_12, 3},
48+ { "park_joy_90p_10_420.y4m", 10, VPX_IMG_FMT_I42016, VPX_BITS_10, 2 },
49+ { "park_joy_90p_10_422.y4m", 10, VPX_IMG_FMT_I42216, VPX_BITS_10, 3 },
50+ { "park_joy_90p_10_444.y4m", 10, VPX_IMG_FMT_I44416, VPX_BITS_10, 3 },
51+ { "park_joy_90p_10_440.yuv", 10, VPX_IMG_FMT_I44016, VPX_BITS_10, 3 },
52+ { "park_joy_90p_12_420.y4m", 12, VPX_IMG_FMT_I42016, VPX_BITS_12, 2 },
53+ { "park_joy_90p_12_422.y4m", 12, VPX_IMG_FMT_I42216, VPX_BITS_12, 3 },
54+ { "park_joy_90p_12_444.y4m", 12, VPX_IMG_FMT_I44416, VPX_BITS_12, 3 },
55+ { "park_joy_90p_12_440.yuv", 12, VPX_IMG_FMT_I44016, VPX_BITS_12, 3 },
6056 #endif // CONFIG_VP9_HIGHBITDEPTH
6157 };
6258
6359 // Encoding modes tested
6460 const libvpx_test::TestMode kEncodingModeVectors[] = {
65− ::libvpx_test::kTwoPassGood,
66− ::libvpx_test::kOnePassGood,
61+ ::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
6762 ::libvpx_test::kRealTime,
6863 };
6964
7065 // Speed settings tested
71−const int kCpuUsedVectors[] = {1, 2, 3, 5, 6};
66+const int kCpuUsedVectors[] = { 1, 2, 3, 5, 6 };
7267
7368 int is_extension_y4m(const char *filename) {
7469 const char *dot = strrchr(filename, '.');
@@ -80,17 +75,13 @@ int is_extension_y4m(const char *filename) { · 5 unmodified lines
8075
8176 class EndToEndTestLarge
8277 : public ::libvpx_test::EncoderTest,
83− public ::libvpx_test::CodecTestWith3Params<libvpx_test::TestMode, \
78+ public ::libvpx_test::CodecTestWith3Params<libvpx_test::TestMode,
8479 TestVideoParam, int> {
8580 protected:
8681 EndToEndTestLarge()
87− : EncoderTest(GET_PARAM(0)),
88− test_video_param_(GET_PARAM(2)),
89− cpu_used_(GET_PARAM(3)),
90− psnr_(0.0),
91− nframes_(0),
92− encoding_mode_(GET_PARAM(1)) {
93− }
82+ : EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(2)),
83+ cpu_used_(GET_PARAM(3)), psnr_(0.0), nframes_(0),
84+ encoding_mode_(GET_PARAM(1)) {}
9485
9586 virtual ~EndToEndTestLarge() {}
9687
@@ -136,8 +127,7 @@ class EndToEndTestLarge · 39 unmodified lines
136127 }
137128
138129 double GetAveragePsnr() const {
139− if (nframes_)
140− return psnr_ / nframes_;
130+ if (nframes_) return psnr_ / nframes_;
141131 return 0.0;
142132 }
143133
@@ -161,29 +151,26 @@ TEST_P(EndToEndTestLarge, EndtoEndPSNRTest) { · 17 unmodified lines
161151 cfg_.g_input_bit_depth = test_video_param_.input_bit_depth;
162152 cfg_.g_bit_depth = test_video_param_.bit_depth;
163153 init_flags_ = VPX_CODEC_USE_PSNR;
164− if (cfg_.g_bit_depth > 8)
165− init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
154+ if (cfg_.g_bit_depth > 8) init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
166155
167156 libvpx_test::VideoSource *video;
168157 if (is_extension_y4m(test_video_param_.filename)) {
169− video = new libvpx_test::Y4mVideoSource(test_video_param_.filename,
170− 0, kFrames);
158+ video =
159+ new libvpx_test::Y4mVideoSource(test_video_param_.filename, 0, kFrames);
171160 } else {
172161 video = new libvpx_test::YUVVideoSource(test_video_param_.filename,
173− test_video_param_.fmt,
174− kWidth, kHeight,
175− kFramerate, 1, 0, kFrames);
162+ test_video_param_.fmt, kWidth,
163+ kHeight, kFramerate, 1, 0, kFrames);
176164 }
177165
178166 ASSERT_NO_FATAL_FAILURE(RunLoop(video));
179167 const double psnr = GetAveragePsnr();
180168 EXPECT_GT(psnr, GetPsnrThreshold());
181− delete(video);
169+ delete (video);
182170 }
183171
184−VP9_INSTANTIATE_TEST_CASE(
185− EndToEndTestLarge,
186− ::testing::ValuesIn(kEncodingModeVectors),
187− ::testing::ValuesIn(kTestVectors),
188− ::testing::ValuesIn(kCpuUsedVectors));
172+VP9_INSTANTIATE_TEST_CASE(EndToEndTestLarge,
173+ ::testing::ValuesIn(kEncodingModeVectors),
174+ ::testing::ValuesIn(kTestVectors),
175+ ::testing::ValuesIn(kCpuUsedVectors));
189176 } // namespace
test/vp9_error_block_test.cc+26−28
@@ -32,11 +32,10 @@ const int kNumIterations = 1000; · 31 unmodified lines
3232
3333 typedef int64_t (*ErrorBlockFunc)(const tran_low_t *coeff,
3434 const tran_low_t *dqcoeff,
35− intptr_t block_size,
36− int64_t *ssz, int bps);
35+ intptr_t block_size, int64_t *ssz, int bps);
3736
3837 typedef std::tr1::tuple<ErrorBlockFunc, ErrorBlockFunc, vpx_bit_depth_t>
39− ErrorBlockParam;
38+ ErrorBlockParam;
4039
4140 // wrapper for 8-bit block error functions without a 'bps' param.
4241 typedef int64_t (*HighBdBlockError8bit)(const tran_low_t *coeff,
@@ -51,14 +50,13 @@ int64_t HighBdBlockError8bitWrapper(const tran_low_t *coeff, · 8 unmodified lines
5150 return fn(coeff, dqcoeff, block_size, ssz);
5251 }
5352
54−class ErrorBlockTest
55− : public ::testing::TestWithParam<ErrorBlockParam> {
53+class ErrorBlockTest : public ::testing::TestWithParam<ErrorBlockParam> {
5654 public:
5755 virtual ~ErrorBlockTest() {}
5856 virtual void SetUp() {
59− error_block_op_ = GET_PARAM(0);
57+ error_block_op_ = GET_PARAM(0);
6058 ref_error_block_op_ = GET_PARAM(1);
61− bit_depth_ = GET_PARAM(2);
59+ bit_depth_ = GET_PARAM(2);
6260 }
6361
6462 virtual void TearDown() { libvpx_test::ClearSystemState(); }
@@ -89,18 +87,18 @@ TEST_P(ErrorBlockTest, OperationCheck) { · 24 unmodified lines
8987 // can be used for optimization, so generate test input precisely.
9088 if (rnd(2)) {
9189 // Positive number
92− coeff[j] = rnd(1 << msb);
90+ coeff[j] = rnd(1 << msb);
9391 dqcoeff[j] = rnd(1 << msb);
9492 } else {
9593 // Negative number
96− coeff[j] = -rnd(1 << msb);
94+ coeff[j] = -rnd(1 << msb);
9795 dqcoeff[j] = -rnd(1 << msb);
9896 }
9997 }
100− ref_ret = ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz,
101− bit_depth_);
102− ASM_REGISTER_STATE_CHECK(ret = error_block_op_(coeff, dqcoeff, block_size,
103− &ssz, bit_depth_));
98+ ref_ret =
99+ ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz, bit_depth_);
100+ ASM_REGISTER_STATE_CHECK(
101+ ret = error_block_op_(coeff, dqcoeff, block_size, &ssz, bit_depth_));
104102 err_count += (ref_ret != ret) | (ref_ssz != ssz);
105103 if (err_count && !err_count_total) {
106104 first_failure = i;
@@ -130,35 +128,35 @@ TEST_P(ErrorBlockTest, ExtremeValues) { · 23 unmodified lines
130128 int k = (i / 9) % 9;
131129
132130 // Change the maximum coeff value, to test different bit boundaries
133− if ( k == 8 && (i % 9) == 0 ) {
131+ if (k == 8 && (i % 9) == 0) {
134132 max_val >>= 1;
135133 }
136134 block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64
137135 for (int j = 0; j < block_size; j++) {
138136 if (k < 4) {
139137 // Test at positive maximum values
140− coeff[j] = k % 2 ? max_val : 0;
138+ coeff[j] = k % 2 ? max_val : 0;
141139 dqcoeff[j] = (k >> 1) % 2 ? max_val : 0;
142140 } else if (k < 8) {
143141 // Test at negative maximum values
144− coeff[j] = k % 2 ? -max_val : 0;
142+ coeff[j] = k % 2 ? -max_val : 0;
145143 dqcoeff[j] = (k >> 1) % 2 ? -max_val : 0;
146144 } else {
147145 if (rnd(2)) {
148146 // Positive number
149− coeff[j] = rnd(1 << 14);
147+ coeff[j] = rnd(1 << 14);
150148 dqcoeff[j] = rnd(1 << 14);
151149 } else {
152150 // Negative number
153− coeff[j] = -rnd(1 << 14);
151+ coeff[j] = -rnd(1 << 14);
154152 dqcoeff[j] = -rnd(1 << 14);
155153 }
156154 }
157155 }
158− ref_ret = ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz,
159− bit_depth_);
160− ASM_REGISTER_STATE_CHECK(ret = error_block_op_(coeff, dqcoeff, block_size,
161− &ssz, bit_depth_));
156+ ref_ret =
157+ ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz, bit_depth_);
158+ ASM_REGISTER_STATE_CHECK(
159+ ret = error_block_op_(coeff, dqcoeff, block_size, &ssz, bit_depth_));
162160 err_count += (ref_ret != ret) | (ref_ssz != ssz);
163161 if (err_count && !err_count_total) {
164162 first_failure = i;
@@ -176,12 +174,12 @@ using std::tr1::make_tuple; · 11 unmodified lines
176174 INSTANTIATE_TEST_CASE_P(
177175 SSE2, ErrorBlockTest,
178176 ::testing::Values(
179− make_tuple(&vp9_highbd_block_error_sse2,
180− &vp9_highbd_block_error_c, VPX_BITS_10),
181− make_tuple(&vp9_highbd_block_error_sse2,
182− &vp9_highbd_block_error_c, VPX_BITS_12),
183− make_tuple(&vp9_highbd_block_error_sse2,
184− &vp9_highbd_block_error_c, VPX_BITS_8),
177+ make_tuple(&vp9_highbd_block_error_sse2, &vp9_highbd_block_error_c,
178+ VPX_BITS_10),
179+ make_tuple(&vp9_highbd_block_error_sse2, &vp9_highbd_block_error_c,
180+ VPX_BITS_12),
181+ make_tuple(&vp9_highbd_block_error_sse2, &vp9_highbd_block_error_c,
182+ VPX_BITS_8),
185183 make_tuple(
186184 &HighBdBlockError8bitWrapper<vp9_highbd_block_error_8bit_sse2>,
187185 &HighBdBlockError8bitWrapper<vp9_highbd_block_error_8bit_c>,
test/vp9_ethread_test.cc+8−11
@@ -23,11 +23,8 @@ class VPxEncoderThreadTest · 22 unmodified lines
2323 public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
2424 protected:
2525 VPxEncoderThreadTest()
26− : EncoderTest(GET_PARAM(0)),
27− encoder_initialized_(false),
28− tiles_(2),
29− encoding_mode_(GET_PARAM(1)),
30− set_cpu_used_(GET_PARAM(2)) {
26+ : EncoderTest(GET_PARAM(0)), encoder_initialized_(false), tiles_(2),
27+ encoding_mode_(GET_PARAM(1)), set_cpu_used_(GET_PARAM(2)) {
3128 init_flags_ = VPX_CODEC_USE_PSNR;
3229 md5_.clear();
3330 }
@@ -82,7 +79,7 @@ class VPxEncoderThreadTest · 48 unmodified lines
8279 }
8380
8481 virtual bool HandleDecodeResult(const vpx_codec_err_t res,
85− const libvpx_test::VideoSource& /*video*/,
82+ const libvpx_test::VideoSource & /*video*/,
8683 libvpx_test::Decoder * /*decoder*/) {
8784 if (res != VPX_CODEC_OK) {
8885 EXPECT_EQ(VPX_CODEC_OK, res);
@@ -123,9 +120,9 @@ TEST_P(VPxEncoderThreadTest, EncoderResultTest) { · 34 unmodified lines
123120 ASSERT_EQ(single_thr_md5, multi_thr_md5);
124121 }
125122
126−VP9_INSTANTIATE_TEST_CASE(
127− VPxEncoderThreadTest,
128− ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
129− ::libvpx_test::kRealTime),
130− ::testing::Range(1, 9));
123+VP9_INSTANTIATE_TEST_CASE(VPxEncoderThreadTest,
124+ ::testing::Values(::libvpx_test::kTwoPassGood,
125+ ::libvpx_test::kOnePassGood,
126+ ::libvpx_test::kRealTime),
127+ ::testing::Range(1, 9));
131128 } // namespace
test/vp9_frame_parallel_test.cc+14−17
@@ -46,7 +46,7 @@ string DecodeFileWithPause(const string &filename, int num_threads, · 45 unmodified lines
4646 int in_frames = 0;
4747 int out_frames = 0;
4848
49− vpx_codec_dec_cfg_t cfg = {0};
49+ vpx_codec_dec_cfg_t cfg = { 0 };
5050 cfg.threads = num_threads;
5151 vpx_codec_flags_t flags = 0;
5252 flags |= VPX_CODEC_USE_FRAME_THREADING;
@@ -74,8 +74,7 @@ string DecodeFileWithPause(const string &filename, int num_threads, · 21 unmodified lines
7474 }
7575
7676 // Flush the decoder at the end of the video.
77− if (!video.cxdata())
78− decoder.DecodeFrame(NULL, 0);
77+ if (!video.cxdata()) decoder.DecodeFrame(NULL, 0);
7978
8079 libvpx_test::DxDataIterator dec_iter = decoder.GetDxData();
8180 const vpx_image_t *img;
@@ -87,8 +86,8 @@ string DecodeFileWithPause(const string &filename, int num_threads, · 5 unmodified lines
8786 }
8887 } while (video.cxdata() != NULL);
8988
90− EXPECT_EQ(in_frames, out_frames) <<
91− "Input frame count does not match output frame count";
89+ EXPECT_EQ(in_frames, out_frames)
90+ << "Input frame count does not match output frame count";
9291
9392 return string(md5.Get());
9493 }
@@ -108,12 +107,12 @@ TEST(VP9MultiThreadedFrameParallel, PauseSeekResume) { · 13 unmodified lines
108107 // vp90-2-07-frame_parallel-1.webm is a 40 frame video file with
109108 // one key frame for every ten frames.
110109 static const PauseFileList files[] = {
111− { "vp90-2-07-frame_parallel-1.webm",
112− "6ea7c3875d67252e7caf2bc6e75b36b1", 6 },
113− { "vp90-2-07-frame_parallel-1.webm",
114− "4bb634160c7356a8d7d4299b6dc83a45", 12 },
115− { "vp90-2-07-frame_parallel-1.webm",
116− "89772591e6ef461f9fa754f916c78ed8", 26 },
110+ { "vp90-2-07-frame_parallel-1.webm", "6ea7c3875d67252e7caf2bc6e75b36b1",
111+ 6 },
112+ { "vp90-2-07-frame_parallel-1.webm", "4bb634160c7356a8d7d4299b6dc83a45",
113+ 12 },
114+ { "vp90-2-07-frame_parallel-1.webm", "89772591e6ef461f9fa754f916c78ed8",
115+ 26 },
117116 { NULL, NULL, 0 },
118117 };
119118 DecodeFilesWithPause(files);
@@ -155,8 +154,7 @@ string DecodeFile(const string &filename, int num_threads, · 35 unmodified lines
155154 video.Next();
156155
157156 // Flush the decoder at the end of the video.
158− if (!video.cxdata())
159− decoder.DecodeFrame(NULL, 0);
157+ if (!video.cxdata()) decoder.DecodeFrame(NULL, 0);
160158
161159 libvpx_test::DxDataIterator dec_iter = decoder.GetDxData();
162160 const vpx_image_t *img;
@@ -168,8 +166,8 @@ string DecodeFile(const string &filename, int num_threads, · 5 unmodified lines
168166 }
169167 } while (video.cxdata() != NULL);
170168
171− EXPECT_EQ(expected_frame_count, out_frames) <<
172− "Input frame count does not match expected output frame count";
169+ EXPECT_EQ(expected_frame_count, out_frames)
170+ << "Input frame count does not match expected output frame count";
173171
174172 return string(md5.Get());
175173 }
@@ -209,8 +207,7 @@ TEST(VP9MultiThreadedFrameParallel, InvalidFileTest) { · 33 unmodified lines
209207 TEST(VP9MultiThreadedFrameParallel, ValidFileTest) {
210208 static const FileList files[] = {
211209 #if CONFIG_VP9_HIGHBITDEPTH
212− { "vp92-2-20-10bit-yuv420.webm",
213− "a16b99df180c584e8db2ffeda987d293", 10 },
210+ { "vp92-2-20-10bit-yuv420.webm", "a16b99df180c584e8db2ffeda987d293", 10 },
214211 #endif
215212 { NULL, NULL, 0 },
216213 };
test/vp9_intrapred_test.cc+92−93
@@ -28,15 +28,14 @@ using libvpx_test::ACMRandom; · 27 unmodified lines
2828
2929 const int count_test_block = 100000;
3030
31−typedef void (*IntraPred)(uint16_t* dst, ptrdiff_t stride,
32− const uint16_t* above, const uint16_t* left,
33− int bps);
31+typedef void (*IntraPred)(uint16_t *dst, ptrdiff_t stride,
32+ const uint16_t *above, const uint16_t *left, int bps);
3433
3534 struct IntraPredFunc {
3635 IntraPredFunc(IntraPred pred = NULL, IntraPred ref = NULL,
3736 int block_size_value = 0, int bit_depth_value = 0)
38− : pred_fn(pred), ref_fn(ref),
39− block_size(block_size_value), bit_depth(bit_depth_value) {}
37+ : pred_fn(pred), ref_fn(ref), block_size(block_size_value),
38+ bit_depth(bit_depth_value) {}
4039
4140 IntraPred pred_fn;
4241 IntraPred ref_fn;
@@ -46,8 +45,8 @@ struct IntraPredFunc { · 3 unmodified lines
4645
4746 class VP9IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> {
4847 public:
49− void RunTest(uint16_t* left_col, uint16_t* above_data,
50− uint16_t* dst, uint16_t* ref_dst) {
48+ void RunTest(uint16_t *left_col, uint16_t *above_data, uint16_t *dst,
49+ uint16_t *ref_dst) {
5150 ACMRandom rnd(ACMRandom::DeterministicSeed());
5251 const int block_size = params_.block_size;
5352 above_row_ = above_data + 16;
@@ -81,14 +80,14 @@ class VP9IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> { · 27 unmodified lines
8180 virtual void SetUp() {
8281 params_ = GetParam();
8382 stride_ = params_.block_size * 3;
84− mask_ = (1 << params_.bit_depth) - 1;
83+ mask_ = (1 << params_.bit_depth) - 1;
8584 }
8685
8786 void Predict() {
8887 const int bit_depth = params_.bit_depth;
8988 params_.ref_fn(ref_dst_, stride_, above_row_, left_col_, bit_depth);
90− ASM_REGISTER_STATE_CHECK(params_.pred_fn(dst_, stride_,
91− above_row_, left_col_, bit_depth));
89+ ASM_REGISTER_STATE_CHECK(
90+ params_.pred_fn(dst_, stride_, above_row_, left_col_, bit_depth));
9291 }
9392
9493 void CheckPrediction(int test_case_number, int *error_count) const {
@@ -99,7 +98,7 @@ class VP9IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> { · 4 unmodified lines
9998 *error_count += ref_dst_[x + y * stride_] != dst_[x + y * stride_];
10099 if (*error_count == 1) {
101100 ASSERT_EQ(ref_dst_[x + y * stride_], dst_[x + y * stride_])
102− << " Failed on Test Case Number "<< test_case_number;
101+ << " Failed on Test Case Number " << test_case_number;
103102 }
104103 }
105104 }
@@ -117,8 +116,8 @@ class VP9IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> { · 11 unmodified lines
117116
118117 TEST_P(VP9IntraPredTest, IntraPredTests) {
119118 // max block size is 32
120− DECLARE_ALIGNED(16, uint16_t, left_col[2*32]);
121− DECLARE_ALIGNED(16, uint16_t, above_data[2*32+32]);
119+ DECLARE_ALIGNED(16, uint16_t, left_col[2 * 32]);
120+ DECLARE_ALIGNED(16, uint16_t, above_data[2 * 32 + 32]);
122121 DECLARE_ALIGNED(16, uint16_t, dst[3 * 32 * 32]);
123122 DECLARE_ALIGNED(16, uint16_t, ref_dst[3 * 32 * 32]);
124123 RunTest(left_col, above_data, dst, ref_dst);
@@ -126,86 +125,86 @@ TEST_P(VP9IntraPredTest, IntraPredTests) { · 1 unmodified line
126125
127126 #if HAVE_SSE2
128127 #if CONFIG_VP9_HIGHBITDEPTH
129−INSTANTIATE_TEST_CASE_P(SSE2_TO_C_8, VP9IntraPredTest,
130− ::testing::Values(
131− IntraPredFunc(&vpx_highbd_dc_predictor_32x32_sse2,
132− &vpx_highbd_dc_predictor_32x32_c, 32, 8),
133− IntraPredFunc(&vpx_highbd_tm_predictor_16x16_sse2,
134− &vpx_highbd_tm_predictor_16x16_c, 16, 8),
135− IntraPredFunc(&vpx_highbd_tm_predictor_32x32_sse2,
136− &vpx_highbd_tm_predictor_32x32_c, 32, 8),
137− IntraPredFunc(&vpx_highbd_dc_predictor_4x4_sse2,
138− &vpx_highbd_dc_predictor_4x4_c, 4, 8),
139− IntraPredFunc(&vpx_highbd_dc_predictor_8x8_sse2,
140− &vpx_highbd_dc_predictor_8x8_c, 8, 8),
141− IntraPredFunc(&vpx_highbd_dc_predictor_16x16_sse2,
142− &vpx_highbd_dc_predictor_16x16_c, 16, 8),
143− IntraPredFunc(&vpx_highbd_v_predictor_4x4_sse2,
144− &vpx_highbd_v_predictor_4x4_c, 4, 8),
145− IntraPredFunc(&vpx_highbd_v_predictor_8x8_sse2,
146− &vpx_highbd_v_predictor_8x8_c, 8, 8),
147− IntraPredFunc(&vpx_highbd_v_predictor_16x16_sse2,
148− &vpx_highbd_v_predictor_16x16_c, 16, 8),
149− IntraPredFunc(&vpx_highbd_v_predictor_32x32_sse2,
150− &vpx_highbd_v_predictor_32x32_c, 32, 8),
151− IntraPredFunc(&vpx_highbd_tm_predictor_4x4_sse2,
152− &vpx_highbd_tm_predictor_4x4_c, 4, 8),
153− IntraPredFunc(&vpx_highbd_tm_predictor_8x8_sse2,
154− &vpx_highbd_tm_predictor_8x8_c, 8, 8)));
155−
156−INSTANTIATE_TEST_CASE_P(SSE2_TO_C_10, VP9IntraPredTest,
157− ::testing::Values(
158− IntraPredFunc(&vpx_highbd_dc_predictor_32x32_sse2,
159− &vpx_highbd_dc_predictor_32x32_c, 32, 10),
160− IntraPredFunc(&vpx_highbd_tm_predictor_16x16_sse2,
161− &vpx_highbd_tm_predictor_16x16_c, 16, 10),
162− IntraPredFunc(&vpx_highbd_tm_predictor_32x32_sse2,
163− &vpx_highbd_tm_predictor_32x32_c, 32, 10),
164− IntraPredFunc(&vpx_highbd_dc_predictor_4x4_sse2,
165− &vpx_highbd_dc_predictor_4x4_c, 4, 10),
166− IntraPredFunc(&vpx_highbd_dc_predictor_8x8_sse2,
167− &vpx_highbd_dc_predictor_8x8_c, 8, 10),
168− IntraPredFunc(&vpx_highbd_dc_predictor_16x16_sse2,
169− &vpx_highbd_dc_predictor_16x16_c, 16, 10),
170− IntraPredFunc(&vpx_highbd_v_predictor_4x4_sse2,
171− &vpx_highbd_v_predictor_4x4_c, 4, 10),
172− IntraPredFunc(&vpx_highbd_v_predictor_8x8_sse2,
173− &vpx_highbd_v_predictor_8x8_c, 8, 10),
174− IntraPredFunc(&vpx_highbd_v_predictor_16x16_sse2,
175− &vpx_highbd_v_predictor_16x16_c, 16, 10),
176− IntraPredFunc(&vpx_highbd_v_predictor_32x32_sse2,
177− &vpx_highbd_v_predictor_32x32_c, 32, 10),
178− IntraPredFunc(&vpx_highbd_tm_predictor_4x4_sse2,
179− &vpx_highbd_tm_predictor_4x4_c, 4, 10),
180− IntraPredFunc(&vpx_highbd_tm_predictor_8x8_sse2,
181− &vpx_highbd_tm_predictor_8x8_c, 8, 10)));
182−
183−INSTANTIATE_TEST_CASE_P(SSE2_TO_C_12, VP9IntraPredTest,
184− ::testing::Values(
185− IntraPredFunc(&vpx_highbd_dc_predictor_32x32_sse2,
186− &vpx_highbd_dc_predictor_32x32_c, 32, 12),
187− IntraPredFunc(&vpx_highbd_tm_predictor_16x16_sse2,
188− &vpx_highbd_tm_predictor_16x16_c, 16, 12),
189− IntraPredFunc(&vpx_highbd_tm_predictor_32x32_sse2,
190− &vpx_highbd_tm_predictor_32x32_c, 32, 12),
191− IntraPredFunc(&vpx_highbd_dc_predictor_4x4_sse2,
192− &vpx_highbd_dc_predictor_4x4_c, 4, 12),
193− IntraPredFunc(&vpx_highbd_dc_predictor_8x8_sse2,
194− &vpx_highbd_dc_predictor_8x8_c, 8, 12),
195− IntraPredFunc(&vpx_highbd_dc_predictor_16x16_sse2,
196− &vpx_highbd_dc_predictor_16x16_c, 16, 12),
197− IntraPredFunc(&vpx_highbd_v_predictor_4x4_sse2,
198− &vpx_highbd_v_predictor_4x4_c, 4, 12),
199− IntraPredFunc(&vpx_highbd_v_predictor_8x8_sse2,
200− &vpx_highbd_v_predictor_8x8_c, 8, 12),
201− IntraPredFunc(&vpx_highbd_v_predictor_16x16_sse2,
202− &vpx_highbd_v_predictor_16x16_c, 16, 12),
203− IntraPredFunc(&vpx_highbd_v_predictor_32x32_sse2,
204− &vpx_highbd_v_predictor_32x32_c, 32, 12),
205− IntraPredFunc(&vpx_highbd_tm_predictor_4x4_sse2,
206− &vpx_highbd_tm_predictor_4x4_c, 4, 12),
207− IntraPredFunc(&vpx_highbd_tm_predictor_8x8_sse2,
208− &vpx_highbd_tm_predictor_8x8_c, 8, 12)));
128+INSTANTIATE_TEST_CASE_P(
129+ SSE2_TO_C_8, VP9IntraPredTest,
130+ ::testing::Values(IntraPredFunc(&vpx_highbd_dc_predictor_32x32_sse2,
131+ &vpx_highbd_dc_predictor_32x32_c, 32, 8),
132+ IntraPredFunc(&vpx_highbd_tm_predictor_16x16_sse2,
133+ &vpx_highbd_tm_predictor_16x16_c, 16, 8),
134+ IntraPredFunc(&vpx_highbd_tm_predictor_32x32_sse2,
135+ &vpx_highbd_tm_predictor_32x32_c, 32, 8),
136+ IntraPredFunc(&vpx_highbd_dc_predictor_4x4_sse2,
137+ &vpx_highbd_dc_predictor_4x4_c, 4, 8),
138+ IntraPredFunc(&vpx_highbd_dc_predictor_8x8_sse2,
139+ &vpx_highbd_dc_predictor_8x8_c, 8, 8),
140+ IntraPredFunc(&vpx_highbd_dc_predictor_16x16_sse2,
141+ &vpx_highbd_dc_predictor_16x16_c, 16, 8),
142+ IntraPredFunc(&vpx_highbd_v_predictor_4x4_sse2,
143+ &vpx_highbd_v_predictor_4x4_c, 4, 8),
144+ IntraPredFunc(&vpx_highbd_v_predictor_8x8_sse2,
145+ &vpx_highbd_v_predictor_8x8_c, 8, 8),
146+ IntraPredFunc(&vpx_highbd_v_predictor_16x16_sse2,
147+ &vpx_highbd_v_predictor_16x16_c, 16, 8),
148+ IntraPredFunc(&vpx_highbd_v_predictor_32x32_sse2,
149+ &vpx_highbd_v_predictor_32x32_c, 32, 8),
150+ IntraPredFunc(&vpx_highbd_tm_predictor_4x4_sse2,
151+ &vpx_highbd_tm_predictor_4x4_c, 4, 8),
152+ IntraPredFunc(&vpx_highbd_tm_predictor_8x8_sse2,
153+ &vpx_highbd_tm_predictor_8x8_c, 8, 8)));
154+
155+INSTANTIATE_TEST_CASE_P(
156+ SSE2_TO_C_10, VP9IntraPredTest,
157+ ::testing::Values(IntraPredFunc(&vpx_highbd_dc_predictor_32x32_sse2,
158+ &vpx_highbd_dc_predictor_32x32_c, 32, 10),
159+ IntraPredFunc(&vpx_highbd_tm_predictor_16x16_sse2,
160+ &vpx_highbd_tm_predictor_16x16_c, 16, 10),
161+ IntraPredFunc(&vpx_highbd_tm_predictor_32x32_sse2,
162+ &vpx_highbd_tm_predictor_32x32_c, 32, 10),
163+ IntraPredFunc(&vpx_highbd_dc_predictor_4x4_sse2,
164+ &vpx_highbd_dc_predictor_4x4_c, 4, 10),
165+ IntraPredFunc(&vpx_highbd_dc_predictor_8x8_sse2,
166+ &vpx_highbd_dc_predictor_8x8_c, 8, 10),
167+ IntraPredFunc(&vpx_highbd_dc_predictor_16x16_sse2,
168+ &vpx_highbd_dc_predictor_16x16_c, 16, 10),
169+ IntraPredFunc(&vpx_highbd_v_predictor_4x4_sse2,
170+ &vpx_highbd_v_predictor_4x4_c, 4, 10),
171+ IntraPredFunc(&vpx_highbd_v_predictor_8x8_sse2,
172+ &vpx_highbd_v_predictor_8x8_c, 8, 10),
173+ IntraPredFunc(&vpx_highbd_v_predictor_16x16_sse2,
174+ &vpx_highbd_v_predictor_16x16_c, 16, 10),
175+ IntraPredFunc(&vpx_highbd_v_predictor_32x32_sse2,
176+ &vpx_highbd_v_predictor_32x32_c, 32, 10),
177+ IntraPredFunc(&vpx_highbd_tm_predictor_4x4_sse2,
178+ &vpx_highbd_tm_predictor_4x4_c, 4, 10),
179+ IntraPredFunc(&vpx_highbd_tm_predictor_8x8_sse2,
180+ &vpx_highbd_tm_predictor_8x8_c, 8, 10)));
181+
182+INSTANTIATE_TEST_CASE_P(
183+ SSE2_TO_C_12, VP9IntraPredTest,
184+ ::testing::Values(IntraPredFunc(&vpx_highbd_dc_predictor_32x32_sse2,
185+ &vpx_highbd_dc_predictor_32x32_c, 32, 12),
186+ IntraPredFunc(&vpx_highbd_tm_predictor_16x16_sse2,
187+ &vpx_highbd_tm_predictor_16x16_c, 16, 12),
188+ IntraPredFunc(&vpx_highbd_tm_predictor_32x32_sse2,
189+ &vpx_highbd_tm_predictor_32x32_c, 32, 12),
190+ IntraPredFunc(&vpx_highbd_dc_predictor_4x4_sse2,
191+ &vpx_highbd_dc_predictor_4x4_c, 4, 12),
192+ IntraPredFunc(&vpx_highbd_dc_predictor_8x8_sse2,
193+ &vpx_highbd_dc_predictor_8x8_c, 8, 12),
194+ IntraPredFunc(&vpx_highbd_dc_predictor_16x16_sse2,
195+ &vpx_highbd_dc_predictor_16x16_c, 16, 12),
196+ IntraPredFunc(&vpx_highbd_v_predictor_4x4_sse2,
197+ &vpx_highbd_v_predictor_4x4_c, 4, 12),
198+ IntraPredFunc(&vpx_highbd_v_predictor_8x8_sse2,
199+ &vpx_highbd_v_predictor_8x8_c, 8, 12),
200+ IntraPredFunc(&vpx_highbd_v_predictor_16x16_sse2,
201+ &vpx_highbd_v_predictor_16x16_c, 16, 12),
202+ IntraPredFunc(&vpx_highbd_v_predictor_32x32_sse2,
203+ &vpx_highbd_v_predictor_32x32_c, 32, 12),
204+ IntraPredFunc(&vpx_highbd_tm_predictor_4x4_sse2,
205+ &vpx_highbd_tm_predictor_4x4_c, 4, 12),
206+ IntraPredFunc(&vpx_highbd_tm_predictor_8x8_sse2,
207+ &vpx_highbd_tm_predictor_8x8_c, 8, 12)));
209208
210209 #endif // CONFIG_VP9_HIGHBITDEPTH
211210 #endif // HAVE_SSE2
test/vp9_lossless_test.cc+7−12
@@ -21,15 +21,13 @@ namespace { · 20 unmodified lines
2121
2222 const int kMaxPsnr = 100;
2323
24−class LosslessTest : public ::libvpx_test::EncoderTest,
25− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
24+class LosslessTest
25+ : public ::libvpx_test::EncoderTest,
26+ public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
2627 protected:
2728 LosslessTest()
28− : EncoderTest(GET_PARAM(0)),
29− psnr_(kMaxPsnr),
30− nframes_(0),
31− encoding_mode_(GET_PARAM(1)) {
32− }
29+ : EncoderTest(GET_PARAM(0)), psnr_(kMaxPsnr), nframes_(0),
30+ encoding_mode_(GET_PARAM(1)) {}
3331
3432 virtual ~LosslessTest() {}
3533
@@ -55,13 +53,10 @@ class LosslessTest : public ::libvpx_test::EncoderTest, · 19 unmodified lines
5553 }
5654
5755 virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
58− if (pkt->data.psnr.psnr[0] < psnr_)
59− psnr_= pkt->data.psnr.psnr[0];
56+ if (pkt->data.psnr.psnr[0] < psnr_) psnr_ = pkt->data.psnr.psnr[0];
6057 }
6158
62− double GetMinPsnr() const {
63− return psnr_;
64− }
59+ double GetMinPsnr() const { return psnr_; }
6560
6661 private:
6762 double psnr_;
test/vp9_quantize_test.cc+60−67
@@ -34,9 +34,8 @@ const int number_of_iterations = 100; · 33 unmodified lines
3434 typedef void (*QuantizeFunc)(const tran_low_t *coeff, intptr_t count,
3535 int skip_block, const int16_t *zbin,
3636 const int16_t *round, const int16_t *quant,
37− const int16_t *quant_shift,
38− tran_low_t *qcoeff, tran_low_t *dqcoeff,
39− const int16_t *dequant,
37+ const int16_t *quant_shift, tran_low_t *qcoeff,
38+ tran_low_t *dqcoeff, const int16_t *dequant,
4039 uint16_t *eob, const int16_t *scan,
4140 const int16_t *iscan);
4241 typedef std::tr1::tuple<QuantizeFunc, QuantizeFunc, vpx_bit_depth_t>
@@ -46,9 +45,9 @@ class VP9QuantizeTest : public ::testing::TestWithParam<QuantizeParam> { · 3 unmodified lines
4645 public:
4746 virtual ~VP9QuantizeTest() {}
4847 virtual void SetUp() {
49− quantize_op_ = GET_PARAM(0);
48+ quantize_op_ = GET_PARAM(0);
5049 ref_quantize_op_ = GET_PARAM(1);
51− bit_depth_ = GET_PARAM(2);
50+ bit_depth_ = GET_PARAM(2);
5251 mask_ = (1 << bit_depth_) - 1;
5352 }
5453
@@ -65,9 +64,9 @@ class VP9Quantize32Test : public ::testing::TestWithParam<QuantizeParam> { · 10 unmodified lines
6564 public:
6665 virtual ~VP9Quantize32Test() {}
6766 virtual void SetUp() {
68− quantize_op_ = GET_PARAM(0);
67+ quantize_op_ = GET_PARAM(0);
6968 ref_quantize_op_ = GET_PARAM(1);
70− bit_depth_ = GET_PARAM(2);
69+ bit_depth_ = GET_PARAM(2);
7170 mask_ = (1 << bit_depth_) - 1;
7271 }
7372
@@ -106,10 +105,10 @@ TEST_P(VP9QuantizeTest, OperationCheck) { · 32 unmodified lines
106105 *eob_ptr = rnd.Rand16();
107106 *ref_eob_ptr = *eob_ptr;
108107 for (int j = 0; j < count; j++) {
109− coeff_ptr[j] = rnd.Rand16()&mask_;
108+ coeff_ptr[j] = rnd.Rand16() & mask_;
110109 }
111110 for (int j = 0; j < 2; j++) {
112− zbin_ptr[j] = rnd.Rand16()&mask_;
111+ zbin_ptr[j] = rnd.Rand16() & mask_;
113112 round_ptr[j] = rnd.Rand16();
114113 quant_ptr[j] = rnd.Rand16();
115114 quant_shift_ptr[j] = rnd.Rand16();
@@ -117,16 +116,15 @@ TEST_P(VP9QuantizeTest, OperationCheck) { · 1 unmodified line
117116 }
118117 ref_quantize_op_(coeff_ptr, count, skip_block, zbin_ptr, round_ptr,
119118 quant_ptr, quant_shift_ptr, ref_qcoeff_ptr,
120− ref_dqcoeff_ptr, dequant_ptr,
121− ref_eob_ptr, scan_order->scan, scan_order->iscan);
122− ASM_REGISTER_STATE_CHECK(quantize_op_(coeff_ptr, count, skip_block,
123− zbin_ptr, round_ptr, quant_ptr,
124− quant_shift_ptr, qcoeff_ptr,
125− dqcoeff_ptr, dequant_ptr, eob_ptr,
126− scan_order->scan, scan_order->iscan));
119+ ref_dqcoeff_ptr, dequant_ptr, ref_eob_ptr,
120+ scan_order->scan, scan_order->iscan);
121+ ASM_REGISTER_STATE_CHECK(quantize_op_(
122+ coeff_ptr, count, skip_block, zbin_ptr, round_ptr, quant_ptr,
123+ quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr,
124+ scan_order->scan, scan_order->iscan));
127125 for (int j = 0; j < sz; ++j) {
128− err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
129− (ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
126+ err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
127+ (ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
130128 }
131129 err_count += (*ref_eob_ptr != *eob_ptr);
132130 if (err_count && !err_count_total) {
@@ -165,10 +163,10 @@ TEST_P(VP9Quantize32Test, OperationCheck) { · 32 unmodified lines
165163 *eob_ptr = rnd.Rand16();
166164 *ref_eob_ptr = *eob_ptr;
167165 for (int j = 0; j < count; j++) {
168− coeff_ptr[j] = rnd.Rand16()&mask_;
166+ coeff_ptr[j] = rnd.Rand16() & mask_;
169167 }
170168 for (int j = 0; j < 2; j++) {
171− zbin_ptr[j] = rnd.Rand16()&mask_;
169+ zbin_ptr[j] = rnd.Rand16() & mask_;
172170 round_ptr[j] = rnd.Rand16();
173171 quant_ptr[j] = rnd.Rand16();
174172 quant_shift_ptr[j] = rnd.Rand16();
@@ -176,16 +174,15 @@ TEST_P(VP9Quantize32Test, OperationCheck) { · 1 unmodified line
176174 }
177175 ref_quantize_op_(coeff_ptr, count, skip_block, zbin_ptr, round_ptr,
178176 quant_ptr, quant_shift_ptr, ref_qcoeff_ptr,
179− ref_dqcoeff_ptr, dequant_ptr,
180− ref_eob_ptr, scan_order->scan, scan_order->iscan);
181− ASM_REGISTER_STATE_CHECK(quantize_op_(coeff_ptr, count, skip_block,
182− zbin_ptr, round_ptr, quant_ptr,
183− quant_shift_ptr, qcoeff_ptr,
184− dqcoeff_ptr, dequant_ptr, eob_ptr,
185− scan_order->scan, scan_order->iscan));
177+ ref_dqcoeff_ptr, dequant_ptr, ref_eob_ptr,
178+ scan_order->scan, scan_order->iscan);
179+ ASM_REGISTER_STATE_CHECK(quantize_op_(
180+ coeff_ptr, count, skip_block, zbin_ptr, round_ptr, quant_ptr,
181+ quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr,
182+ scan_order->scan, scan_order->iscan));
186183 for (int j = 0; j < sz; ++j) {
187− err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
188− (ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
184+ err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
185+ (ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
189186 }
190187 err_count += (*ref_eob_ptr != *eob_ptr);
191188 if (err_count && !err_count_total) {
@@ -227,10 +224,10 @@ TEST_P(VP9QuantizeTest, EOBCheck) { · 35 unmodified lines
227224 for (int j = 0; j < count; j++) {
228225 coeff_ptr[j] = 0;
229226 }
230− coeff_ptr[rnd(count)] = rnd.Rand16()&mask_;
231− coeff_ptr[rnd(count)] = rnd.Rand16()&mask_;
227+ coeff_ptr[rnd(count)] = rnd.Rand16() & mask_;
228+ coeff_ptr[rnd(count)] = rnd.Rand16() & mask_;
232229 for (int j = 0; j < 2; j++) {
233− zbin_ptr[j] = rnd.Rand16()&mask_;
230+ zbin_ptr[j] = rnd.Rand16() & mask_;
234231 round_ptr[j] = rnd.Rand16();
235232 quant_ptr[j] = rnd.Rand16();
236233 quant_shift_ptr[j] = rnd.Rand16();
@@ -239,17 +236,16 @@ TEST_P(VP9QuantizeTest, EOBCheck) { · 2 unmodified lines
239236
240237 ref_quantize_op_(coeff_ptr, count, skip_block, zbin_ptr, round_ptr,
241238 quant_ptr, quant_shift_ptr, ref_qcoeff_ptr,
242− ref_dqcoeff_ptr, dequant_ptr,
243− ref_eob_ptr, scan_order->scan, scan_order->iscan);
244− ASM_REGISTER_STATE_CHECK(quantize_op_(coeff_ptr, count, skip_block,
245− zbin_ptr, round_ptr, quant_ptr,
246− quant_shift_ptr, qcoeff_ptr,
247− dqcoeff_ptr, dequant_ptr, eob_ptr,
248− scan_order->scan, scan_order->iscan));
239+ ref_dqcoeff_ptr, dequant_ptr, ref_eob_ptr,
240+ scan_order->scan, scan_order->iscan);
241+ ASM_REGISTER_STATE_CHECK(quantize_op_(
242+ coeff_ptr, count, skip_block, zbin_ptr, round_ptr, quant_ptr,
243+ quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr,
244+ scan_order->scan, scan_order->iscan));
249245
250246 for (int j = 0; j < sz; ++j) {
251− err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
252− (ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
247+ err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
248+ (ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
253249 }
254250 err_count += (*ref_eob_ptr != *eob_ptr);
255251 if (err_count && !err_count_total) {
@@ -291,10 +287,10 @@ TEST_P(VP9Quantize32Test, EOBCheck) { · 35 unmodified lines
291287 coeff_ptr[j] = 0;
292288 }
293289 // Two random entries
294− coeff_ptr[rnd(count)] = rnd.Rand16()&mask_;
295− coeff_ptr[rnd(count)] = rnd.Rand16()&mask_;
290+ coeff_ptr[rnd(count)] = rnd.Rand16() & mask_;
291+ coeff_ptr[rnd(count)] = rnd.Rand16() & mask_;
296292 for (int j = 0; j < 2; j++) {
297− zbin_ptr[j] = rnd.Rand16()&mask_;
293+ zbin_ptr[j] = rnd.Rand16() & mask_;
298294 round_ptr[j] = rnd.Rand16();
299295 quant_ptr[j] = rnd.Rand16();
300296 quant_shift_ptr[j] = rnd.Rand16();
@@ -303,17 +299,16 @@ TEST_P(VP9Quantize32Test, EOBCheck) { · 2 unmodified lines
303299
304300 ref_quantize_op_(coeff_ptr, count, skip_block, zbin_ptr, round_ptr,
305301 quant_ptr, quant_shift_ptr, ref_qcoeff_ptr,
306− ref_dqcoeff_ptr, dequant_ptr,
307− ref_eob_ptr, scan_order->scan, scan_order->iscan);
308− ASM_REGISTER_STATE_CHECK(quantize_op_(coeff_ptr, count, skip_block,
309− zbin_ptr, round_ptr, quant_ptr,
310− quant_shift_ptr, qcoeff_ptr,
311− dqcoeff_ptr, dequant_ptr, eob_ptr,
312− scan_order->scan, scan_order->iscan));
302+ ref_dqcoeff_ptr, dequant_ptr, ref_eob_ptr,
303+ scan_order->scan, scan_order->iscan);
304+ ASM_REGISTER_STATE_CHECK(quantize_op_(
305+ coeff_ptr, count, skip_block, zbin_ptr, round_ptr, quant_ptr,
306+ quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr, eob_ptr,
307+ scan_order->scan, scan_order->iscan));
313308
314309 for (int j = 0; j < sz; ++j) {
315− err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
316− (ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
310+ err_count += (ref_qcoeff_ptr[j] != qcoeff_ptr[j]) |
311+ (ref_dqcoeff_ptr[j] != dqcoeff_ptr[j]);
317312 }
318313 err_count += (*ref_eob_ptr != *eob_ptr);
319314 if (err_count && !err_count_total) {
@@ -330,22 +325,20 @@ using std::tr1::make_tuple; · 10 unmodified lines
330325 #if HAVE_SSE2
331326 INSTANTIATE_TEST_CASE_P(
332327 SSE2, VP9QuantizeTest,
333− ::testing::Values(
334− make_tuple(&vpx_highbd_quantize_b_sse2,
335− &vpx_highbd_quantize_b_c, VPX_BITS_8),
336− make_tuple(&vpx_highbd_quantize_b_sse2,
337− &vpx_highbd_quantize_b_c, VPX_BITS_10),
338− make_tuple(&vpx_highbd_quantize_b_sse2,
339− &vpx_highbd_quantize_b_c, VPX_BITS_12)));
328+ ::testing::Values(make_tuple(&vpx_highbd_quantize_b_sse2,
329+ &vpx_highbd_quantize_b_c, VPX_BITS_8),
330+ make_tuple(&vpx_highbd_quantize_b_sse2,
331+ &vpx_highbd_quantize_b_c, VPX_BITS_10),
332+ make_tuple(&vpx_highbd_quantize_b_sse2,
333+ &vpx_highbd_quantize_b_c, VPX_BITS_12)));
340334 INSTANTIATE_TEST_CASE_P(
341335 SSE2, VP9Quantize32Test,
342− ::testing::Values(
343− make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
344− &vpx_highbd_quantize_b_32x32_c, VPX_BITS_8),
345− make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
346− &vpx_highbd_quantize_b_32x32_c, VPX_BITS_10),
347− make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
348− &vpx_highbd_quantize_b_32x32_c, VPX_BITS_12)));
336+ ::testing::Values(make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
337+ &vpx_highbd_quantize_b_32x32_c, VPX_BITS_8),
338+ make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
339+ &vpx_highbd_quantize_b_32x32_c, VPX_BITS_10),
340+ make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
341+ &vpx_highbd_quantize_b_32x32_c, VPX_BITS_12)));
349342 #endif // HAVE_SSE2
350343 #endif // CONFIG_VP9_HIGHBITDEPTH
351344 } // namespace
test/vp9_skip_loopfilter_test.cc+5−11
@@ -24,14 +24,10 @@ const char kVp9Md5File[] = "vp90-2-08-tile_1x8_frame_parallel.webm.md5"; · 23 unmodified lines
2424 // Class for testing shutting off the loop filter.
2525 class SkipLoopFilterTest {
2626 public:
27− SkipLoopFilterTest()
28− : video_(NULL),
29− decoder_(NULL),
30− md5_file_(NULL) {}
27+ SkipLoopFilterTest() : video_(NULL), decoder_(NULL), md5_file_(NULL) {}
3128
3229 ~SkipLoopFilterTest() {
33− if (md5_file_ != NULL)
34− fclose(md5_file_);
30+ if (md5_file_ != NULL) fclose(md5_file_);
3531 delete decoder_;
3632 delete video_;
3733 }
@@ -46,8 +42,7 @@ class SkipLoopFilterTest { · 8 unmodified lines
4642 video_->Begin();
4743
4844 vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
49− if (num_threads > 0)
50− cfg.threads = num_threads;
45+ if (num_threads > 0) cfg.threads = num_threads;
5146 decoder_ = new libvpx_test::VP9Decoder(cfg, 0);
5247 ASSERT_TRUE(decoder_ != NULL);
5348
@@ -73,8 +68,7 @@ class SkipLoopFilterTest { · 19 unmodified lines
7368 for (; video_->cxdata() != NULL; video_->Next()) {
7469 const vpx_codec_err_t res =
7570 decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
76− if (res != VPX_CODEC_OK)
77− return res;
71+ if (res != VPX_CODEC_OK) return res;
7872 ReadMd5();
7973 }
8074 return VPX_CODEC_OK;
@@ -92,7 +86,7 @@ class SkipLoopFilterTest { · 11 unmodified lines
9286 void OpenMd5File(const std::string &md5_file_name) {
9387 md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name);
9488 ASSERT_TRUE(md5_file_ != NULL) << "MD5 file open failed. Filename: "
95− << md5_file_name;
89+ << md5_file_name;
9690 }
9791
9892 // Reads the next line of the MD5 file.
test/vp9_subtract_test.cc+16−21
@@ -19,18 +19,16 @@ · 18 unmodified lines
1919 #include "vp9/common/vp9_blockd.h"
2020 #include "vpx_mem/vpx_mem.h"
2121
22−typedef void (*SubtractFunc)(int rows, int cols,
23− int16_t *diff_ptr, ptrdiff_t diff_stride,
24− const uint8_t *src_ptr, ptrdiff_t src_stride,
25− const uint8_t *pred_ptr, ptrdiff_t pred_stride);
22+typedef void (*SubtractFunc)(int rows, int cols, int16_t *diff_ptr,
23+ ptrdiff_t diff_stride, const uint8_t *src_ptr,
24+ ptrdiff_t src_stride, const uint8_t *pred_ptr,
25+ ptrdiff_t pred_stride);
2626
2727 namespace vp9 {
2828
2929 class VP9SubtractBlockTest : public ::testing::TestWithParam<SubtractFunc> {
3030 public:
31− virtual void TearDown() {
32− libvpx_test::ClearSystemState();
33− }
31+ virtual void TearDown() { libvpx_test::ClearSystemState(); }
3432 };
3533
3634 using libvpx_test::ACMRandom;
@@ -47,7 +45,7 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) { · 10 unmodified lines
4745 vpx_memalign(16, sizeof(*diff) * block_width * block_height * 2));
4846 uint8_t *pred = reinterpret_cast<uint8_t *>(
4947 vpx_memalign(16, block_width * block_height * 2));
50− uint8_t *src = reinterpret_cast<uint8_t *>(
48+ uint8_t *src = reinterpret_cast<uint8_t *>(
5149 vpx_memalign(16, block_width * block_height * 2));
5250
5351 for (int n = 0; n < 100; n++) {
@@ -58,29 +56,26 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) { · 4 unmodified lines
5856 }
5957 }
6058
61− GetParam()(block_height, block_width, diff, block_width,
62− src, block_width, pred, block_width);
59+ GetParam()(block_height, block_width, diff, block_width, src, block_width,
60+ pred, block_width);
6361
6462 for (int r = 0; r < block_height; ++r) {
6563 for (int c = 0; c < block_width; ++c) {
6664 EXPECT_EQ(diff[r * block_width + c],
67− (src[r * block_width + c] -
68− pred[r * block_width + c])) << "r = " << r
69− << ", c = " << c
70− << ", bs = " << bsize;
65+ (src[r * block_width + c] - pred[r * block_width + c]))
66+ << "r = " << r << ", c = " << c << ", bs = " << bsize;
7167 }
7268 }
7369
74− GetParam()(block_height, block_width, diff, block_width * 2,
75− src, block_width * 2, pred, block_width * 2);
70+ GetParam()(block_height, block_width, diff, block_width * 2, src,
71+ block_width * 2, pred, block_width * 2);
7672
7773 for (int r = 0; r < block_height; ++r) {
7874 for (int c = 0; c < block_width; ++c) {
79− EXPECT_EQ(diff[r * block_width * 2 + c],
80− (src[r * block_width * 2 + c] -
81− pred[r * block_width * 2 + c])) << "r = " << r
82− << ", c = " << c
83− << ", bs = " << bsize;
75+ EXPECT_EQ(
76+ diff[r * block_width * 2 + c],
77+ (src[r * block_width * 2 + c] - pred[r * block_width * 2 + c]))
78+ << "r = " << r << ", c = " << c << ", bs = " << bsize;
8479 }
8580 }
8681 }
test/vp9_thread_test.cc+16−22
@@ -27,15 +27,11 @@ using std::string; · 26 unmodified lines
2727 class VPxWorkerThreadTest : public ::testing::TestWithParam<bool> {
2828 protected:
2929 virtual ~VPxWorkerThreadTest() {}
30− virtual void SetUp() {
31− vpx_get_worker_interface()->init(&worker_);
32− }
30+ virtual void SetUp() { vpx_get_worker_interface()->init(&worker_); }
3331
34− virtual void TearDown() {
35− vpx_get_worker_interface()->end(&worker_);
36− }
32+ virtual void TearDown() { vpx_get_worker_interface()->end(&worker_); }
3733
38− void Run(VPxWorker* worker) {
34+ void Run(VPxWorker *worker) {
3935 const bool synchronous = GetParam();
4036 if (synchronous) {
4137 vpx_get_worker_interface()->execute(worker);
@@ -47,10 +43,10 @@ class VPxWorkerThreadTest : public ::testing::TestWithParam<bool> { · 5 unmodified lines
4743 VPxWorker worker_;
4844 };
4945
50−int ThreadHook(void* data, void* return_value) {
51− int* const hook_data = reinterpret_cast<int*>(data);
46+int ThreadHook(void *data, void *return_value) {
47+ int *const hook_data = reinterpret_cast<int *>(data);
5248 *hook_data = 5;
53− return *reinterpret_cast<int*>(return_value);
49+ return *reinterpret_cast<int *>(return_value);
5450 }
5551
5652 TEST_P(VPxWorkerThreadTest, HookSuccess) {
@@ -159,7 +155,7 @@ struct FileList { · 102 unmodified lines
159155 };
160156
161157 // Decodes |filename| with |num_threads|. Returns the md5 of the decoded frames.
162−string DecodeFile(const string& filename, int num_threads) {
158+string DecodeFile(const string &filename, int num_threads) {
163159 libvpx_test::WebMVideoSource video(filename);
164160 video.Init();
165161
@@ -191,8 +187,8 @@ void DecodeFiles(const FileList files[]) { · 25 unmodified lines
191187 for (const FileList *iter = files; iter->name != NULL; ++iter) {
192188 SCOPED_TRACE(iter->name);
193189 for (int t = 1; t <= 8; ++t) {
194− EXPECT_EQ(iter->expected_md5, DecodeFile(iter->name, t))
195− << "threads = " << t;
190+ EXPECT_EQ(iter->expected_md5, DecodeFile(iter->name, t)) << "threads = "
191+ << t;
196192 }
197193 }
198194 }
@@ -242,15 +238,13 @@ TEST(VP9DecodeMultiThreadedTest, NoTilesNonFrameParallel) { · 43 unmodified lines
242238 }
243239
244240 TEST(VP9DecodeMultiThreadedTest, FrameParallel) {
245− static const FileList files[] = {
246− { "vp90-2-08-tile_1x2_frame_parallel.webm",
247− "68ede6abd66bae0a2edf2eb9232241b6" },
248− { "vp90-2-08-tile_1x4_frame_parallel.webm",
249− "368ebc6ebf3a5e478d85b2c3149b2848" },
250− { "vp90-2-08-tile_1x8_frame_parallel.webm",
251− "17e439da2388aff3a0f69cb22579c6c1" },
252− { NULL, NULL }
253− };
241+ static const FileList files[] = { { "vp90-2-08-tile_1x2_frame_parallel.webm",
242+ "68ede6abd66bae0a2edf2eb9232241b6" },
243+ { "vp90-2-08-tile_1x4_frame_parallel.webm",
244+ "368ebc6ebf3a5e478d85b2c3149b2848" },
245+ { "vp90-2-08-tile_1x8_frame_parallel.webm",
246+ "17e439da2388aff3a0f69cb22579c6c1" },
247+ { NULL, NULL } };
254248
255249 DecodeFiles(files);
256250 }
test/vpx_scale_test.cc+20−39
@@ -25,9 +25,7 @@ typedef void (*CopyFrameFunc)(const YV12_BUFFER_CONFIG *src_ybf, · 24 unmodified lines
2525
2626 class VpxScaleBase {
2727 public:
28− virtual ~VpxScaleBase() {
29− libvpx_test::ClearSystemState();
30− }
28+ virtual ~VpxScaleBase() { libvpx_test::ClearSystemState(); }
3129
3230 void ResetImage(int width, int height) {
3331 width_ = width;
@@ -105,28 +103,22 @@ class VpxScaleBase { · 71 unmodified lines
105103 }
106104
107105 uint8_t *bottom = left + (crop_height * stride);
108− for (int y = 0; y < bottom_extend; ++y) {
106+ for (int y = 0; y < bottom_extend; ++y) {
109107 memcpy(bottom, left + (crop_height - 1) * stride, extend_width);
110108 bottom += stride;
111109 }
112110 }
113111
114112 void ReferenceExtendBorder() {
115− ExtendPlane(ref_img_.y_buffer,
116− ref_img_.y_crop_width, ref_img_.y_crop_height,
117− ref_img_.y_width, ref_img_.y_height,
118− ref_img_.y_stride,
119− ref_img_.border);
120− ExtendPlane(ref_img_.u_buffer,
121− ref_img_.uv_crop_width, ref_img_.uv_crop_height,
122− ref_img_.uv_width, ref_img_.uv_height,
123− ref_img_.uv_stride,
124− ref_img_.border / 2);
125− ExtendPlane(ref_img_.v_buffer,
126− ref_img_.uv_crop_width, ref_img_.uv_crop_height,
127− ref_img_.uv_width, ref_img_.uv_height,
128− ref_img_.uv_stride,
129− ref_img_.border / 2);
113+ ExtendPlane(ref_img_.y_buffer, ref_img_.y_crop_width,
114+ ref_img_.y_crop_height, ref_img_.y_width, ref_img_.y_height,
115+ ref_img_.y_stride, ref_img_.border);
116+ ExtendPlane(ref_img_.u_buffer, ref_img_.uv_crop_width,
117+ ref_img_.uv_crop_height, ref_img_.uv_width, ref_img_.uv_height,
118+ ref_img_.uv_stride, ref_img_.border / 2);
119+ ExtendPlane(ref_img_.v_buffer, ref_img_.uv_crop_width,
120+ ref_img_.uv_crop_height, ref_img_.uv_width, ref_img_.uv_height,
121+ ref_img_.uv_stride, ref_img_.border / 2);
130122 }
131123
132124 void ReferenceCopyFrame() {
@@ -172,13 +164,9 @@ class ExtendBorderTest · 39 unmodified lines
172164 virtual ~ExtendBorderTest() {}
173165
174166 protected:
175− virtual void SetUp() {
176− extend_fn_ = GetParam();
177− }
167+ virtual void SetUp() { extend_fn_ = GetParam(); }
178168
179− void ExtendBorder() {
180− ASM_REGISTER_STATE_CHECK(extend_fn_(&img_));
181− }
169+ void ExtendBorder() { ASM_REGISTER_STATE_CHECK(extend_fn_(&img_)); }
182170
183171 void RunTest() {
184172 #if ARCH_ARM
@@ -187,7 +175,7 @@ class ExtendBorderTest · 2 unmodified lines
187175 #else
188176 static const int kNumSizesToTest = 7;
189177 #endif
190− static const int kSizesToTest[] = {1, 15, 33, 145, 512, 1025, 16383};
178+ static const int kSizesToTest[] = { 1, 15, 33, 145, 512, 1025, 16383 };
191179 for (int h = 0; h < kNumSizesToTest; ++h) {
192180 for (int w = 0; w < kNumSizesToTest; ++w) {
193181 ResetImage(kSizesToTest[w], kSizesToTest[h]);
@@ -202,23 +190,18 @@ class ExtendBorderTest · 8 unmodified lines
202190 ExtendFrameBorderFunc extend_fn_;
203191 };
204192
205−TEST_P(ExtendBorderTest, ExtendBorder) {
206− ASSERT_NO_FATAL_FAILURE(RunTest());
207−}
193+TEST_P(ExtendBorderTest, ExtendBorder) { ASSERT_NO_FATAL_FAILURE(RunTest()); }
208194
209195 INSTANTIATE_TEST_CASE_P(C, ExtendBorderTest,
210196 ::testing::Values(vp8_yv12_extend_frame_borders_c));
211197
212−class CopyFrameTest
213− : public VpxScaleBase,
214− public ::testing::TestWithParam<CopyFrameFunc> {
198+class CopyFrameTest : public VpxScaleBase,
199+ public ::testing::TestWithParam<CopyFrameFunc> {
215200 public:
216201 virtual ~CopyFrameTest() {}
217202
218203 protected:
219− virtual void SetUp() {
220− copy_frame_fn_ = GetParam();
221− }
204+ virtual void SetUp() { copy_frame_fn_ = GetParam(); }
222205
223206 void CopyFrame() {
224207 ASM_REGISTER_STATE_CHECK(copy_frame_fn_(&img_, &cpy_img_));
@@ -231,7 +214,7 @@ class CopyFrameTest · 6 unmodified lines
231214 #else
232215 static const int kNumSizesToTest = 7;
233216 #endif
234− static const int kSizesToTest[] = {1, 15, 33, 145, 512, 1025, 16383};
217+ static const int kSizesToTest[] = { 1, 15, 33, 145, 512, 1025, 16383 };
235218 for (int h = 0; h < kNumSizesToTest; ++h) {
236219 for (int w = 0; w < kNumSizesToTest; ++w) {
237220 ResetImage(kSizesToTest[w], kSizesToTest[h]);
@@ -246,9 +229,7 @@ class CopyFrameTest · 8 unmodified lines
246229 CopyFrameFunc copy_frame_fn_;
247230 };
248231
249−TEST_P(CopyFrameTest, CopyFrame) {
250− ASSERT_NO_FATAL_FAILURE(RunTest());
251−}
232+TEST_P(CopyFrameTest, CopyFrame) { ASSERT_NO_FATAL_FAILURE(RunTest()); }
252233
253234 INSTANTIATE_TEST_CASE_P(C, CopyFrameTest,
254235 ::testing::Values(vp8_yv12_copy_frame_c));
test/webm_video_source.h+7−16
@@ -25,30 +25,23 @@ namespace libvpx_test { · 24 unmodified lines
2525 class WebMVideoSource : public CompressedVideoSource {
2626 public:
2727 explicit WebMVideoSource(const std::string &file_name)
28− : file_name_(file_name),
29− vpx_ctx_(new VpxInputContext()),
30− webm_ctx_(new WebmInputContext()),
31− buf_(NULL),
32− buf_sz_(0),
33− frame_(0),
34− end_of_file_(false) {
35− }
28+ : file_name_(file_name), vpx_ctx_(new VpxInputContext()),
29+ webm_ctx_(new WebmInputContext()), buf_(NULL), buf_sz_(0), frame_(0),
30+ end_of_file_(false) {}
3631
3732 virtual ~WebMVideoSource() {
38− if (vpx_ctx_->file != NULL)
39− fclose(vpx_ctx_->file);
33+ if (vpx_ctx_->file != NULL) fclose(vpx_ctx_->file);
4034 webm_free(webm_ctx_);
4135 delete vpx_ctx_;
4236 delete webm_ctx_;
4337 }
4438
45− virtual void Init() {
46− }
39+ virtual void Init() {}
4740
4841 virtual void Begin() {
4942 vpx_ctx_->file = OpenTestDataFile(file_name_);
5043 ASSERT_TRUE(vpx_ctx_->file != NULL) << "Input file open failed. Filename: "
51− << file_name_;
44+ << file_name_;
5245
5346 ASSERT_EQ(file_is_webm(webm_ctx_, vpx_ctx_), 1) << "file is not WebM";
5447
@@ -81,9 +74,7 @@ class WebMVideoSource : public CompressedVideoSource { · 26 unmodified lines
8174 } while (!webm_ctx_->is_key_frame && !end_of_file_);
8275 }
8376
84− virtual const uint8_t *cxdata() const {
85− return end_of_file_ ? NULL : buf_;
86− }
77+ virtual const uint8_t *cxdata() const { return end_of_file_ ? NULL : buf_; }
8778 virtual size_t frame_size() const { return buf_sz_; }
8879 virtual unsigned int frame_number() const { return frame_; }
8980
test/y4m_test.cc+33−37
@@ -22,7 +22,7 @@ namespace { · 21 unmodified lines
2222
2323 using std::string;
2424
25−static const unsigned int kWidth = 160;
25+static const unsigned int kWidth = 160;
2626 static const unsigned int kHeight = 90;
2727 static const unsigned int kFrames = 10;
2828
@@ -34,24 +34,24 @@ struct Y4mTestParam { · 5 unmodified lines
3434 };
3535
3636 const Y4mTestParam kY4mTestVectors[] = {
37− {"park_joy_90p_8_420.y4m", 8, VPX_IMG_FMT_I420,
38− "e5406275b9fc6bb3436c31d4a05c1cab"},
39− {"park_joy_90p_8_422.y4m", 8, VPX_IMG_FMT_I422,
40− "284a47a47133b12884ec3a14e959a0b6"},
41− {"park_joy_90p_8_444.y4m", 8, VPX_IMG_FMT_I444,
42− "90517ff33843d85de712fd4fe60dbed0"},
43− {"park_joy_90p_10_420.y4m", 10, VPX_IMG_FMT_I42016,
44− "63f21f9f717d8b8631bd2288ee87137b"},
45− {"park_joy_90p_10_422.y4m", 10, VPX_IMG_FMT_I42216,
46− "48ab51fb540aed07f7ff5af130c9b605"},
47− {"park_joy_90p_10_444.y4m", 10, VPX_IMG_FMT_I44416,
48− "067bfd75aa85ff9bae91fa3e0edd1e3e"},
49− {"park_joy_90p_12_420.y4m", 12, VPX_IMG_FMT_I42016,
50− "9e6d8f6508c6e55625f6b697bc461cef"},
51− {"park_joy_90p_12_422.y4m", 12, VPX_IMG_FMT_I42216,
52− "b239c6b301c0b835485be349ca83a7e3"},
53− {"park_joy_90p_12_444.y4m", 12, VPX_IMG_FMT_I44416,
54− "5a6481a550821dab6d0192f5c63845e9"},
37+ { "park_joy_90p_8_420.y4m", 8, VPX_IMG_FMT_I420,
38+ "e5406275b9fc6bb3436c31d4a05c1cab" },
39+ { "park_joy_90p_8_422.y4m", 8, VPX_IMG_FMT_I422,
40+ "284a47a47133b12884ec3a14e959a0b6" },
41+ { "park_joy_90p_8_444.y4m", 8, VPX_IMG_FMT_I444,
42+ "90517ff33843d85de712fd4fe60dbed0" },
43+ { "park_joy_90p_10_420.y4m", 10, VPX_IMG_FMT_I42016,
44+ "63f21f9f717d8b8631bd2288ee87137b" },
45+ { "park_joy_90p_10_422.y4m", 10, VPX_IMG_FMT_I42216,
46+ "48ab51fb540aed07f7ff5af130c9b605" },
47+ { "park_joy_90p_10_444.y4m", 10, VPX_IMG_FMT_I44416,
48+ "067bfd75aa85ff9bae91fa3e0edd1e3e" },
49+ { "park_joy_90p_12_420.y4m", 12, VPX_IMG_FMT_I42016,
50+ "9e6d8f6508c6e55625f6b697bc461cef" },
51+ { "park_joy_90p_12_422.y4m", 12, VPX_IMG_FMT_I42216,
52+ "b239c6b301c0b835485be349ca83a7e3" },
53+ { "park_joy_90p_12_444.y4m", 12, VPX_IMG_FMT_I44416,
54+ "5a6481a550821dab6d0192f5c63845e9" },
5555 };
5656
5757 static void write_image_file(const vpx_image_t *img, FILE *file) {
@@ -60,10 +60,12 @@ static void write_image_file(const vpx_image_t *img, FILE *file) { · 2 unmodified lines
6060 const unsigned char *buf = img->planes[plane];
6161 const int stride = img->stride[plane];
6262 const int bytes_per_sample = (img->fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? 2 : 1;
63− const int h = (plane ? (img->d_h + img->y_chroma_shift) >>
64− img->y_chroma_shift : img->d_h);
65− const int w = (plane ? (img->d_w + img->x_chroma_shift) >>
66− img->x_chroma_shift : img->d_w);
63+ const int h =
64+ (plane ? (img->d_h + img->y_chroma_shift) >> img->y_chroma_shift
65+ : img->d_h);
66+ const int w =
67+ (plane ? (img->d_w + img->x_chroma_shift) >> img->x_chroma_shift
68+ : img->d_w);
6769 for (y = 0; y < h; ++y) {
6870 fwrite(buf, bytes_per_sample, w, file);
6971 buf += stride;
@@ -71,15 +73,12 @@ static void write_image_file(const vpx_image_t *img, FILE *file) { · 1 unmodified line
7173 }
7274 }
7375
74−class Y4mVideoSourceTest
75− : public ::testing::TestWithParam<Y4mTestParam>,
76− public ::libvpx_test::Y4mVideoSource {
76+class Y4mVideoSourceTest : public ::testing::TestWithParam<Y4mTestParam>,
77+ public ::libvpx_test::Y4mVideoSource {
7778 protected:
7879 Y4mVideoSourceTest() : Y4mVideoSource("", 0, 0) {}
7980
80− virtual ~Y4mVideoSourceTest() {
81− CloseSource();
82− }
81+ virtual ~Y4mVideoSourceTest() { CloseSource(); }
8382
8483 virtual void Init(const std::string &file_name, int limit) {
8584 file_name_ = file_name;
@@ -137,8 +136,7 @@ TEST_P(Y4mVideoSourceTest, SourceTest) { · 51 unmodified lines
137136 INSTANTIATE_TEST_CASE_P(C, Y4mVideoSourceTest,
138137 ::testing::ValuesIn(kY4mTestVectors));
139138
140−class Y4mVideoWriteTest
141− : public Y4mVideoSourceTest {
139+class Y4mVideoWriteTest : public Y4mVideoSourceTest {
142140 protected:
143141 Y4mVideoWriteTest() {}
144142
@@ -158,14 +156,12 @@ class Y4mVideoWriteTest · 13 unmodified lines
158156 // Writes out a y4m file and then reads it back
159157 void WriteY4mAndReadBack() {
160158 ASSERT_TRUE(input_file_ != NULL);
161− char buf[Y4M_BUFFER_SIZE] = {0};
162− const struct VpxRational framerate = {y4m_.fps_n, y4m_.fps_d};
159+ char buf[Y4M_BUFFER_SIZE] = { 0 };
160+ const struct VpxRational framerate = { y4m_.fps_n, y4m_.fps_d };
163161 tmpfile_ = new libvpx_test::TempOutFile;
164162 ASSERT_TRUE(tmpfile_->file() != NULL);
165− y4m_write_file_header(buf, sizeof(buf),
166− kWidth, kHeight,
167− &framerate, y4m_.vpx_fmt,
168− y4m_.bit_depth);
163+ y4m_write_file_header(buf, sizeof(buf), kWidth, kHeight, &framerate,
164+ y4m_.vpx_fmt, y4m_.bit_depth);
169165 fputs(buf, tmpfile_->file());
170166 for (unsigned int i = start_; i < limit_; i++) {
171167 y4m_write_frame_header(buf, sizeof(buf));
test/y4m_video_source.h+4−12
@@ -21,18 +21,10 @@ namespace libvpx_test { · 20 unmodified lines
2121 // so that we can do actual file encodes.
2222 class Y4mVideoSource : public VideoSource {
2323 public:
24− Y4mVideoSource(const std::string &file_name,
25− unsigned int start, int limit)
26− : file_name_(file_name),
27− input_file_(NULL),
28− img_(new vpx_image_t()),
29− start_(start),
30− limit_(limit),
31− frame_(0),
32− framerate_numerator_(0),
33− framerate_denominator_(0),
34− y4m_() {
35− }
24+ Y4mVideoSource(const std::string &file_name, unsigned int start, int limit)
25+ : file_name_(file_name), input_file_(NULL), img_(new vpx_image_t()),
26+ start_(start), limit_(limit), frame_(0), framerate_numerator_(0),
27+ framerate_denominator_(0), y4m_() {}
3628
3729 virtual ~Y4mVideoSource() {
3830 vpx_img_free(img_.get());
test/yuv_video_source.h+17−44
@@ -25,19 +25,11 @@ namespace libvpx_test { · 24 unmodified lines
2525 class YUVVideoSource : public VideoSource {
2626 public:
2727 YUVVideoSource(const std::string &file_name, vpx_img_fmt format,
28− unsigned int width, unsigned int height,
29− int rate_numerator, int rate_denominator,
30− unsigned int start, int limit)
31− : file_name_(file_name),
32− input_file_(NULL),
33− img_(NULL),
34− start_(start),
35− limit_(limit),
36− frame_(0),
37− width_(0),
38− height_(0),
39− format_(VPX_IMG_FMT_NONE),
40− framerate_numerator_(rate_numerator),
28+ unsigned int width, unsigned int height, int rate_numerator,
29+ int rate_denominator, unsigned int start, int limit)
30+ : file_name_(file_name), input_file_(NULL), img_(NULL), start_(start),
31+ limit_(limit), frame_(0), width_(0), height_(0),
32+ format_(VPX_IMG_FMT_NONE), framerate_numerator_(rate_numerator),
4133 framerate_denominator_(rate_denominator) {
4234 // This initializes format_, raw_size_, width_, height_ and allocates img.
4335 SetSize(width, height, format);
@@ -45,13 +37,11 @@ class YUVVideoSource : public VideoSource { · 1 unmodified line
4537
4638 virtual ~YUVVideoSource() {
4739 vpx_img_free(img_);
48− if (input_file_)
49− fclose(input_file_);
40+ if (input_file_) fclose(input_file_);
5041 }
5142
5243 virtual void Begin() {
53− if (input_file_)
54− fclose(input_file_);
44+ if (input_file_) fclose(input_file_);
5545 input_file_ = OpenTestDataFile(file_name_);
5646 ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
5747 << file_name_;
@@ -67,7 +57,7 @@ class YUVVideoSource : public VideoSource { · 9 unmodified lines
6757 FillFrame();
6858 }
6959
70− virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL; }
60+ virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL; }
7161
7262 // Models a stream where Timebase = 1/FPS, so pts == frame.
7363 virtual vpx_codec_pts_t pts() const { return frame_; }
@@ -93,32 +83,15 @@ class YUVVideoSource : public VideoSource { · 19 unmodified lines
9383 height_ = height;
9484 format_ = format;
9585 switch (format) {
96− case VPX_IMG_FMT_I420:
97− raw_size_ = width * height * 3 / 2;
98− break;
99− case VPX_IMG_FMT_I422:
100− raw_size_ = width * height * 2;
101− break;
102− case VPX_IMG_FMT_I440:
103− raw_size_ = width * height * 2;
104− break;
105− case VPX_IMG_FMT_I444:
106− raw_size_ = width * height * 3;
107− break;
108− case VPX_IMG_FMT_I42016:
109− raw_size_ = width * height * 3;
110− break;
111− case VPX_IMG_FMT_I42216:
112− raw_size_ = width * height * 4;
113− break;
114− case VPX_IMG_FMT_I44016:
115− raw_size_ = width * height * 4;
116− break;
117− case VPX_IMG_FMT_I44416:
118− raw_size_ = width * height * 6;
119− break;
120− default:
121− ASSERT_TRUE(0);
86+ case VPX_IMG_FMT_I420: raw_size_ = width * height * 3 / 2; break;
87+ case VPX_IMG_FMT_I422: raw_size_ = width * height * 2; break;
88+ case VPX_IMG_FMT_I440: raw_size_ = width * height * 2; break;
89+ case VPX_IMG_FMT_I444: raw_size_ = width * height * 3; break;
90+ case VPX_IMG_FMT_I42016: raw_size_ = width * height * 3; break;
91+ case VPX_IMG_FMT_I42216: raw_size_ = width * height * 4; break;
92+ case VPX_IMG_FMT_I44016: raw_size_ = width * height * 4; break;
93+ case VPX_IMG_FMT_I44416: raw_size_ = width * height * 6; break;
94+ default: ASSERT_TRUE(0);
12295 }
12396 }
12497 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t