Unified · Split
| @@ -23,9 +23,7 @@ class ACMRandom { · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | explicit ACMRandom(int seed) : random_(seed) {} |
| 25 | 25 | |
| 26 | − void Reset(int seed) { | |
| 27 | − random_.Reseed(seed); | |
| 28 | − } | |
| 26 | + void Reset(int seed) { random_.Reseed(seed); } | |
| 29 | 27 | uint16_t Rand16(void) { |
| 30 | 28 | const uint32_t value = |
| 31 | 29 | random_.Generate(testing::internal::Random::kMaxRange); |
| @@ -52,17 +50,11 @@ class ACMRandom { · 20 unmodified lines | ||
| 52 | 50 | return r < 128 ? r << 4 : r >> 4; |
| 53 | 51 | } |
| 54 | 52 | |
| 55 | − int PseudoUniform(int range) { | |
| 56 | − return random_.Generate(range); | |
| 57 | − } | |
| 53 | + int PseudoUniform(int range) { return random_.Generate(range); } | |
| 58 | 54 | |
| 59 | − int operator()(int n) { | |
| 60 | − return PseudoUniform(n); | |
| 61 | − } | |
| 55 | + int operator()(int n) { return PseudoUniform(n); } | |
| 62 | 56 | |
| 63 | − static int DeterministicSeed(void) { | |
| 64 | − return 0xbaba; | |
| 65 | − } | |
| 57 | + static int DeterministicSeed(void) { return 0xbaba; } | |
| 66 | 58 | |
| 67 | 59 | private: |
| 68 | 60 | testing::internal::Random random_; |
| @@ -17,8 +17,8 @@ · 16 unmodified lines | ||
| 17 | 17 | namespace { |
| 18 | 18 | |
| 19 | 19 | // Check if any pixel in a 16x16 macroblock varies between frames. |
| 20 | −int CheckMb(const vpx_image_t ¤t, const vpx_image_t &previous, | |
| 21 | − int mb_r, int mb_c) { | |
| 20 | +int CheckMb(const vpx_image_t ¤t, const vpx_image_t &previous, int mb_r, | |
| 21 | + int mb_c) { | |
| 22 | 22 | for (int plane = 0; plane < 3; plane++) { |
| 23 | 23 | int r = 16 * mb_r; |
| 24 | 24 | int c0 = 16 * mb_c; |
| @@ -39,6 +39,7 @@ class ActiveMapTest · 38 unmodified lines | ||
| 39 | 39 | encoder->Control(VP8E_SET_CPUUSED, cpu_used_); |
| 40 | 40 | } else if (video->frame() == 3) { |
| 41 | 41 | vpx_active_map_t map = vpx_active_map_t(); |
| 42 | + /* clang-format off */ | |
| 42 | 43 | uint8_t active_map[9 * 13] = { |
| 43 | 44 | 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, |
| 44 | 45 | 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, |
| @@ -50,6 +51,7 @@ class ActiveMapTest · 5 unmodified lines | ||
| 50 | 51 | 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, |
| 51 | 52 | 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, |
| 52 | 53 | }; |
| 54 | + /* clang-format on */ | |
| 53 | 55 | map.cols = (kWidth + 15) / 16; |
| 54 | 56 | map.rows = (kHeight + 15) / 16; |
| 55 | 57 | ASSERT_EQ(map.cols, 13u); |
| @@ -77,8 +79,8 @@ TEST_P(ActiveMapTest, Test) { · 21 unmodified lines | ||
| 77 | 79 | cfg_.rc_end_usage = VPX_CBR; |
| 78 | 80 | cfg_.kf_max_dist = 90000; |
| 79 | 81 | |
| 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); | |
| 82 | 84 | |
| 83 | 85 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 84 | 86 | } |
| @@ -22,15 +22,12 @@ static const int kNoiseSize = 3072; · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | // TODO(jimbankoski): make width and height integers not unsigned. |
| 24 | 24 | 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); | |
| 27 | 27 | |
| 28 | −class AddNoiseTest | |
| 29 | − : public ::testing::TestWithParam<AddNoiseFunc> { | |
| 28 | +class AddNoiseTest : public ::testing::TestWithParam<AddNoiseFunc> { | |
| 30 | 29 | public: |
| 31 | − virtual void TearDown() { | |
| 32 | − libvpx_test::ClearSystemState(); | |
| 33 | − } | |
| 30 | + virtual void TearDown() { libvpx_test::ClearSystemState(); } | |
| 34 | 31 | virtual ~AddNoiseTest() {} |
| 35 | 32 | }; |
| 36 | 33 | |
| @@ -43,18 +40,18 @@ double stddev6(char a, char b, char c, char d, char e, char f) { · 6 unmodified lines | ||
| 43 | 40 | } |
| 44 | 41 | |
| 45 | 42 | TEST_P(AddNoiseTest, CheckNoiseAdded) { |
| 46 | − const int width = 64; | |
| 43 | + const int width = 64; | |
| 47 | 44 | const int height = 64; |
| 48 | 45 | const int image_size = width * height; |
| 49 | 46 | int8_t noise[kNoiseSize]; |
| 50 | 47 | 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))); | |
| 53 | 50 | ASSERT_TRUE(s != NULL); |
| 54 | 51 | memset(s, 99, image_size * sizeof(*s)); |
| 55 | 52 | |
| 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)); | |
| 58 | 55 | |
| 59 | 56 | // Check to make sure we don't end up having either the same or no added |
| 60 | 57 | // noise either vertically or horizontally. |
| @@ -72,8 +69,8 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) { · 11 unmodified lines | ||
| 72 | 69 | // Initialize pixels in the image to 255 and check for roll over. |
| 73 | 70 | memset(s, 255, image_size); |
| 74 | 71 | |
| 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)); | |
| 77 | 74 | |
| 78 | 75 | // Check to make sure don't roll over. |
| 79 | 76 | for (int i = 0; i < image_size; ++i) { |
| @@ -83,8 +80,8 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) { · 3 unmodified lines | ||
| 83 | 80 | // Initialize pixels in the image to 0 and check for roll under. |
| 84 | 81 | memset(s, 0, image_size); |
| 85 | 82 | |
| 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)); | |
| 88 | 85 | |
| 89 | 86 | // Check to make sure don't roll under. |
| 90 | 87 | for (int i = 0; i < image_size; ++i) { |
| @@ -95,7 +92,7 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) { · 4 unmodified lines | ||
| 95 | 92 | } |
| 96 | 93 | |
| 97 | 94 | TEST_P(AddNoiseTest, CheckCvsAssembly) { |
| 98 | − const int width = 64; | |
| 95 | + const int width = 64; | |
| 99 | 96 | const int height = 64; |
| 100 | 97 | const int image_size = width * height; |
| 101 | 98 | int8_t noise[kNoiseSize]; |
| @@ -21,7 +21,7 @@ const int kLookAheadMin = 5; · 20 unmodified lines | ||
| 21 | 21 | const int kLookAheadMax = 26; |
| 22 | 22 | |
| 23 | 23 | class AltRefTest : public ::libvpx_test::EncoderTest, |
| 24 | − public ::libvpx_test::CodecTestWithParam<int> { | |
| 24 | + public ::libvpx_test::CodecTestWithParam<int> { | |
| 25 | 25 | protected: |
| 26 | 26 | AltRefTest() : EncoderTest(GET_PARAM(0)), altref_count_(0) {} |
| 27 | 27 | virtual ~AltRefTest() {} |
| @@ -31,9 +31,7 @@ class AltRefTest : public ::libvpx_test::EncoderTest, · 3 unmodified lines | ||
| 31 | 31 | SetMode(libvpx_test::kTwoPassGood); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | − virtual void BeginPassHook(unsigned int pass) { | |
| 35 | − altref_count_ = 0; | |
| 36 | − } | |
| 34 | + virtual void BeginPassHook(unsigned int pass) { altref_count_ = 0; } | |
| 37 | 35 | |
| 38 | 36 | virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video, |
| 39 | 37 | libvpx_test::Encoder *encoder) { |
| @@ -75,11 +73,8 @@ class AltRefForcedKeyTestLarge · 35 unmodified lines | ||
| 75 | 73 | public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> { |
| 76 | 74 | protected: |
| 77 | 75 | 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) {} | |
| 83 | 78 | virtual ~AltRefForcedKeyTestLarge() {} |
| 84 | 79 | |
| 85 | 80 | virtual void SetUp() { |
| @@ -94,8 +89,8 @@ class AltRefForcedKeyTestLarge · 8 unmodified lines | ||
| 94 | 89 | if (video->frame() == 0) { |
| 95 | 90 | encoder->Control(VP8E_SET_CPUUSED, cpu_used_); |
| 96 | 91 | encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1); |
| 97 | − // override test default for tile columns if necessary. | |
| 98 | 92 | #if CONFIG_VP9_ENCODER |
| 93 | + // override test default for tile columns if necessary. | |
| 99 | 94 | if (GET_PARAM(0) == &libvpx_test::kVP9) { |
| 100 | 95 | encoder->Control(VP9E_SET_TILE_COLUMNS, 6); |
| 101 | 96 | } |
| @@ -147,13 +142,11 @@ TEST_P(AltRefForcedKeyTestLarge, ForcedFrameIsKey) { · 45 unmodified lines | ||
| 147 | 142 | } |
| 148 | 143 | } |
| 149 | 144 | |
| 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)); | |
| 154 | 148 | |
| 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)); | |
| 159 | 152 | } // namespace |
| @@ -57,7 +57,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ1) { · 56 unmodified lines | ||
| 57 | 57 | aq_mode_ = 1; |
| 58 | 58 | |
| 59 | 59 | ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, |
| 60 | − 30, 1, 0, 100); | |
| 60 | + 30, 1, 0, 100); | |
| 61 | 61 | |
| 62 | 62 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 63 | 63 | } |
| @@ -77,7 +77,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ2) { · 13 unmodified lines | ||
| 77 | 77 | aq_mode_ = 2; |
| 78 | 78 | |
| 79 | 79 | ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, |
| 80 | − 30, 1, 0, 100); | |
| 80 | + 30, 1, 0, 100); | |
| 81 | 81 | |
| 82 | 82 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 83 | 83 | } |
| @@ -97,7 +97,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ3) { · 13 unmodified lines | ||
| 97 | 97 | aq_mode_ = 3; |
| 98 | 98 | |
| 99 | 99 | ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, |
| 100 | − 30, 1, 0, 100); | |
| 100 | + 30, 1, 0, 100); | |
| 101 | 101 | |
| 102 | 102 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 103 | 103 | } |
| @@ -31,7 +31,7 @@ class AverageTestBase : public ::testing::Test { · 30 unmodified lines | ||
| 31 | 31 | AverageTestBase(int width, int height) : width_(width), height_(height) {} |
| 32 | 32 | |
| 33 | 33 | static void SetUpTestCase() { |
| 34 | − source_data_ = reinterpret_cast<uint8_t*>( | |
| 34 | + source_data_ = reinterpret_cast<uint8_t *>( | |
| 35 | 35 | vpx_memalign(kDataAlignment, kDataBlockSize)); |
| 36 | 36 | } |
| 37 | 37 | |
| @@ -40,9 +40,7 @@ class AverageTestBase : public ::testing::Test { · 2 unmodified lines | ||
| 40 | 40 | source_data_ = NULL; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | − virtual void TearDown() { | |
| 44 | − libvpx_test::ClearSystemState(); | |
| 45 | − } | |
| 43 | + virtual void TearDown() { libvpx_test::ClearSystemState(); } | |
| 46 | 44 | |
| 47 | 45 | protected: |
| 48 | 46 | // Handle blocks up to 4 blocks 64x64 with stride up to 128 |
| @@ -55,47 +53,44 @@ class AverageTestBase : public ::testing::Test { · 6 unmodified lines | ||
| 55 | 53 | } |
| 56 | 54 | |
| 57 | 55 | // Sum Pixels |
| 58 | − unsigned int ReferenceAverage8x8(const uint8_t* source, int pitch) { | |
| 56 | + unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) { | |
| 59 | 57 | unsigned int average = 0; |
| 60 | 58 | 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]; | |
| 63 | 60 | return ((average + 32) >> 6); |
| 64 | 61 | } |
| 65 | 62 | |
| 66 | − unsigned int ReferenceAverage4x4(const uint8_t* source, int pitch) { | |
| 63 | + unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) { | |
| 67 | 64 | unsigned int average = 0; |
| 68 | 65 | 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]; | |
| 71 | 67 | return ((average + 8) >> 4); |
| 72 | 68 | } |
| 73 | 69 | |
| 74 | 70 | void FillConstant(uint8_t fill_constant) { |
| 75 | 71 | for (int i = 0; i < width_ * height_; ++i) { |
| 76 | − source_data_[i] = fill_constant; | |
| 72 | + source_data_[i] = fill_constant; | |
| 77 | 73 | } |
| 78 | 74 | } |
| 79 | 75 | |
| 80 | 76 | void FillRandom() { |
| 81 | 77 | for (int i = 0; i < width_ * height_; ++i) { |
| 82 | − source_data_[i] = rnd_.Rand8(); | |
| 78 | + source_data_[i] = rnd_.Rand8(); | |
| 83 | 79 | } |
| 84 | 80 | } |
| 85 | 81 | |
| 86 | 82 | int width_, height_; |
| 87 | − static uint8_t* source_data_; | |
| 83 | + static uint8_t *source_data_; | |
| 88 | 84 | int source_stride_; |
| 89 | 85 | |
| 90 | 86 | ACMRandom rnd_; |
| 91 | 87 | }; |
| 92 | −typedef unsigned int (*AverageFunction)(const uint8_t* s, int pitch); | |
| 88 | +typedef unsigned int (*AverageFunction)(const uint8_t *s, int pitch); | |
| 93 | 89 | |
| 94 | 90 | typedef std::tr1::tuple<int, int, int, int, AverageFunction> AvgFunc; |
| 95 | 91 | |
| 96 | −class AverageTest | |
| 97 | − : public AverageTestBase, | |
| 98 | − public ::testing::WithParamInterface<AvgFunc>{ | |
| 92 | +class AverageTest : public AverageTestBase, | |
| 93 | + public ::testing::WithParamInterface<AvgFunc> { | |
| 99 | 94 | public: |
| 100 | 95 | AverageTest() : AverageTestBase(GET_PARAM(0), GET_PARAM(1)) {} |
| 101 | 96 | |
| @@ -103,17 +98,17 @@ class AverageTest · 1 unmodified line | ||
| 103 | 98 | void CheckAverages() { |
| 104 | 99 | unsigned int expected = 0; |
| 105 | 100 | 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_); | |
| 111 | 106 | } |
| 112 | 107 | |
| 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_); | |
| 117 | 112 | |
| 118 | 113 | EXPECT_EQ(expected, actual); |
| 119 | 114 | } |
| @@ -124,23 +119,20 @@ typedef void (*IntProRowFunc)(int16_t hbuf[16], uint8_t const *ref, · 4 unmodified lines | ||
| 124 | 119 | |
| 125 | 120 | typedef std::tr1::tuple<int, IntProRowFunc, IntProRowFunc> IntProRowParam; |
| 126 | 121 | |
| 127 | −class IntProRowTest | |
| 128 | − : public AverageTestBase, | |
| 129 | − public ::testing::WithParamInterface<IntProRowParam> { | |
| 122 | +class IntProRowTest : public AverageTestBase, | |
| 123 | + public ::testing::WithParamInterface<IntProRowParam> { | |
| 130 | 124 | public: |
| 131 | 125 | 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) { | |
| 135 | 127 | asm_func_ = GET_PARAM(1); |
| 136 | 128 | c_func_ = GET_PARAM(2); |
| 137 | 129 | } |
| 138 | 130 | |
| 139 | 131 | protected: |
| 140 | 132 | virtual void SetUp() { |
| 141 | − hbuf_asm_ = reinterpret_cast<int16_t*>( | |
| 133 | + hbuf_asm_ = reinterpret_cast<int16_t *>( | |
| 142 | 134 | vpx_memalign(kDataAlignment, sizeof(*hbuf_asm_) * 16)); |
| 143 | − hbuf_c_ = reinterpret_cast<int16_t*>( | |
| 135 | + hbuf_c_ = reinterpret_cast<int16_t *>( | |
| 144 | 136 | vpx_memalign(kDataAlignment, sizeof(*hbuf_c_) * 16)); |
| 145 | 137 | } |
| 146 | 138 | |
| @@ -169,9 +161,8 @@ typedef int16_t (*IntProColFunc)(uint8_t const *ref, const int width); · 22 unmodified lines | ||
| 169 | 161 | |
| 170 | 162 | typedef std::tr1::tuple<int, IntProColFunc, IntProColFunc> IntProColParam; |
| 171 | 163 | |
| 172 | −class IntProColTest | |
| 173 | − : public AverageTestBase, | |
| 174 | − public ::testing::WithParamInterface<IntProColParam> { | |
| 164 | +class IntProColTest : public AverageTestBase, | |
| 165 | + public ::testing::WithParamInterface<IntProColParam> { | |
| 175 | 166 | public: |
| 176 | 167 | IntProColTest() : AverageTestBase(GET_PARAM(0), 1), sum_asm_(0), sum_c_(0) { |
| 177 | 168 | asm_func_ = GET_PARAM(1); |
| @@ -195,15 +186,14 @@ class IntProColTest · 17 unmodified lines | ||
| 195 | 186 | typedef int (*SatdFunc)(const int16_t *coeffs, int length); |
| 196 | 187 | typedef std::tr1::tuple<int, SatdFunc> SatdTestParam; |
| 197 | 188 | |
| 198 | −class SatdTest | |
| 199 | − : public ::testing::Test, | |
| 200 | − public ::testing::WithParamInterface<SatdTestParam> { | |
| 189 | +class SatdTest : public ::testing::Test, | |
| 190 | + public ::testing::WithParamInterface<SatdTestParam> { | |
| 201 | 191 | protected: |
| 202 | 192 | virtual void SetUp() { |
| 203 | 193 | satd_size_ = GET_PARAM(0); |
| 204 | 194 | satd_func_ = GET_PARAM(1); |
| 205 | 195 | rnd_.Reset(ACMRandom::DeterministicSeed()); |
| 206 | − src_ = reinterpret_cast<int16_t*>( | |
| 196 | + src_ = reinterpret_cast<int16_t *>( | |
| 207 | 197 | vpx_memalign(16, sizeof(*src_) * satd_size_)); |
| 208 | 198 | ASSERT_TRUE(src_ != NULL); |
| 209 | 199 | } |
| @@ -235,7 +225,7 @@ class SatdTest · 25 unmodified lines | ||
| 235 | 225 | ACMRandom rnd_; |
| 236 | 226 | }; |
| 237 | 227 | |
| 238 | −uint8_t* AverageTestBase::source_data_ = NULL; | |
| 228 | +uint8_t *AverageTestBase::source_data_ = NULL; | |
| 239 | 229 | |
| 240 | 230 | TEST_P(AverageTest, MinValue) { |
| 241 | 231 | FillConstant(0); |
| @@ -286,7 +276,6 @@ TEST_P(IntProColTest, Random) { · 44 unmodified lines | ||
| 286 | 276 | RunComparison(); |
| 287 | 277 | } |
| 288 | 278 | |
| 289 | − | |
| 290 | 279 | TEST_P(SatdTest, MinValue) { |
| 291 | 280 | const int kMin = -32640; |
| 292 | 281 | const int expected = -kMin * satd_size_; |
| @@ -320,92 +309,86 @@ using std::tr1::make_tuple; · 27 unmodified lines | ||
| 320 | 309 | |
| 321 | 310 | INSTANTIATE_TEST_CASE_P( |
| 322 | 311 | 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))); | |
| 326 | 314 | |
| 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))); | |
| 334 | 320 | |
| 335 | 321 | #if HAVE_SSE2 |
| 336 | 322 | INSTANTIATE_TEST_CASE_P( |
| 337 | 323 | 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))); | |
| 345 | 330 | |
| 346 | 331 | 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))); | |
| 351 | 337 | |
| 352 | 338 | 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))); | |
| 365 | 350 | #endif |
| 366 | 351 | |
| 367 | 352 | #if HAVE_NEON |
| 368 | 353 | INSTANTIATE_TEST_CASE_P( |
| 369 | 354 | 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))); | |
| 383 | 361 | |
| 384 | 362 | 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))); | |
| 389 | 368 | |
| 390 | 369 | 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))); | |
| 397 | 381 | #endif |
| 398 | 382 | |
| 399 | 383 | #if HAVE_MSA |
| 400 | 384 | INSTANTIATE_TEST_CASE_P( |
| 401 | 385 | 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))); | |
| 409 | 392 | #endif |
| 410 | 393 | |
| 411 | 394 | } // namespace |
| @@ -26,11 +26,9 @@ · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | #include "vpx_mem/vpx_mem.h" |
| 28 | 28 | |
| 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); | |
| 34 | 32 | |
| 35 | 33 | using libvpx_test::ACMRandom; |
| 36 | 34 | |
| @@ -40,9 +38,9 @@ class BlockinessTestBase : public ::testing::Test { · 3 unmodified lines | ||
| 40 | 38 | BlockinessTestBase(int width, int height) : width_(width), height_(height) {} |
| 41 | 39 | |
| 42 | 40 | static void SetUpTestCase() { |
| 43 | − source_data_ = reinterpret_cast<uint8_t*>( | |
| 41 | + source_data_ = reinterpret_cast<uint8_t *>( | |
| 44 | 42 | vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 45 | − reference_data_ = reinterpret_cast<uint8_t*>( | |
| 43 | + reference_data_ = reinterpret_cast<uint8_t *>( | |
| 46 | 44 | vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 47 | 45 | } |
| 48 | 46 | |
| @@ -53,14 +51,12 @@ class BlockinessTestBase : public ::testing::Test { · 4 unmodified lines | ||
| 53 | 51 | reference_data_ = NULL; |
| 54 | 52 | } |
| 55 | 53 | |
| 56 | − virtual void TearDown() { | |
| 57 | − libvpx_test::ClearSystemState(); | |
| 58 | − } | |
| 54 | + virtual void TearDown() { libvpx_test::ClearSystemState(); } | |
| 59 | 55 | |
| 60 | 56 | protected: |
| 61 | 57 | // Handle frames up to 640x480 |
| 62 | 58 | static const int kDataAlignment = 16; |
| 63 | − static const int kDataBufferSize = 640*480; | |
| 59 | + static const int kDataBufferSize = 640 * 480; | |
| 64 | 60 | |
| 65 | 61 | virtual void SetUp() { |
| 66 | 62 | source_stride_ = (width_ + 31) & ~31; |
| @@ -68,8 +64,8 @@ class BlockinessTestBase : public ::testing::Test { · 1 unmodified line | ||
| 68 | 64 | rnd_.Reset(ACMRandom::DeterministicSeed()); |
| 69 | 65 | } |
| 70 | 66 | |
| 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) { | |
| 73 | 69 | for (int h = 0; h < height; ++h) { |
| 74 | 70 | for (int w = 0; w < width; ++w) { |
| 75 | 71 | data[h * stride + w] = fill_constant; |
| @@ -104,7 +100,7 @@ class BlockinessTestBase : public ::testing::Test { · 28 unmodified lines | ||
| 104 | 100 | void FillCheckerboard(uint8_t *data, int stride) { |
| 105 | 101 | for (int h = 0; h < height_; h += 4) { |
| 106 | 102 | for (int w = 0; w < width_; w += 4) { |
| 107 | − if (((h/4) ^ (w/4)) & 1) | |
| 103 | + if (((h / 4) ^ (w / 4)) & 1) | |
| 108 | 104 | FillConstant(data + h * stride + w, stride, 255, 4, 4); |
| 109 | 105 | else |
| 110 | 106 | FillConstant(data + h * stride + w, stride, 0, 4, 4); |
| @@ -135,9 +131,9 @@ class BlockinessTestBase : public ::testing::Test { · 24 unmodified lines | ||
| 135 | 131 | } |
| 136 | 132 | } |
| 137 | 133 | int width_, height_; |
| 138 | − static uint8_t* source_data_; | |
| 134 | + static uint8_t *source_data_; | |
| 139 | 135 | int source_stride_; |
| 140 | − static uint8_t* reference_data_; | |
| 136 | + static uint8_t *reference_data_; | |
| 141 | 137 | int reference_stride_; |
| 142 | 138 | |
| 143 | 139 | ACMRandom rnd_; |
| @@ -153,15 +149,14 @@ class BlockinessVP9Test · 9 unmodified lines | ||
| 153 | 149 | |
| 154 | 150 | protected: |
| 155 | 151 | 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_); | |
| 159 | 154 | } |
| 160 | 155 | }; |
| 161 | 156 | #endif // CONFIG_VP9_ENCODER |
| 162 | 157 | |
| 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; | |
| 165 | 160 | |
| 166 | 161 | #if CONFIG_VP9_ENCODER |
| 167 | 162 | TEST_P(BlockinessVP9Test, SourceBlockierThanReference) { |
| @@ -212,7 +207,6 @@ TEST_P(BlockinessVP9Test, WorstCaseBlockiness) { · 44 unmodified lines | ||
| 212 | 207 | } |
| 213 | 208 | #endif // CONFIG_VP9_ENCODER |
| 214 | 209 | |
| 215 | − | |
| 216 | 210 | using std::tr1::make_tuple; |
| 217 | 211 | |
| 218 | 212 | //------------------------------------------------------------------------------ |
| @@ -220,9 +214,7 @@ using std::tr1::make_tuple; · 1 unmodified line | ||
| 220 | 214 | |
| 221 | 215 | #if CONFIG_VP9_ENCODER |
| 222 | 216 | 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), | |
| 226 | 218 | }; |
| 227 | 219 | INSTANTIATE_TEST_CASE_P(C, BlockinessVP9Test, ::testing::ValuesIn(c_vp9_tests)); |
| 228 | 220 | #endif |
| @@ -17,8 +17,9 @@ · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | namespace { |
| 19 | 19 | |
| 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> { | |
| 22 | 23 | protected: |
| 23 | 24 | BordersTest() : EncoderTest(GET_PARAM(0)) {} |
| 24 | 25 | virtual ~BordersTest() {} |
| @@ -78,6 +79,6 @@ TEST_P(BordersTest, TestLowBitrate) { · 53 unmodified lines | ||
| 78 | 79 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | −VP9_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values( | |
| 82 | − ::libvpx_test::kTwoPassGood)); | |
| 82 | +VP9_INSTANTIATE_TEST_CASE(BordersTest, | |
| 83 | + ::testing::Values(::libvpx_test::kTwoPassGood)); | |
| 83 | 84 | } // namespace |
| @@ -36,29 +36,26 @@ struct ByteAlignmentTestParam { · 35 unmodified lines | ||
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | 38 | 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 }, | |
| 52 | 52 | }; |
| 53 | 53 | |
| 54 | 54 | // Class for testing byte alignment of reference buffers. |
| 55 | 55 | class ByteAlignmentTest |
| 56 | 56 | : public ::testing::TestWithParam<ByteAlignmentTestParam> { |
| 57 | 57 | protected: |
| 58 | − ByteAlignmentTest() | |
| 59 | − : video_(NULL), | |
| 60 | − decoder_(NULL), | |
| 61 | − md5_file_(NULL) {} | |
| 58 | + ByteAlignmentTest() : video_(NULL), decoder_(NULL), md5_file_(NULL) {} | |
| 62 | 59 | |
| 63 | 60 | virtual void SetUp() { |
| 64 | 61 | video_ = new libvpx_test::WebMVideoSource(kVP9TestFile); |
| @@ -74,8 +71,7 @@ class ByteAlignmentTest · 9 unmodified lines | ||
| 74 | 71 | } |
| 75 | 72 | |
| 76 | 73 | virtual void TearDown() { |
| 77 | − if (md5_file_ != NULL) | |
| 78 | − fclose(md5_file_); | |
| 74 | + if (md5_file_ != NULL) fclose(md5_file_); | |
| 79 | 75 | |
| 80 | 76 | delete decoder_; |
| 81 | 77 | delete video_; |
| @@ -89,8 +85,7 @@ class ByteAlignmentTest · 7 unmodified lines | ||
| 89 | 85 | const vpx_codec_err_t res = |
| 90 | 86 | decoder_->DecodeFrame(video_->cxdata(), video_->frame_size()); |
| 91 | 87 | CheckDecodedFrames(byte_alignment_to_check); |
| 92 | − if (res == VPX_CODEC_OK) | |
| 93 | − video_->Next(); | |
| 88 | + if (res == VPX_CODEC_OK) video_->Next(); | |
| 94 | 89 | return res; |
| 95 | 90 | } |
| 96 | 91 | |
| @@ -98,8 +93,7 @@ class ByteAlignmentTest · 1 unmodified line | ||
| 98 | 93 | for (; video_->cxdata() != NULL; video_->Next()) { |
| 99 | 94 | const vpx_codec_err_t res = |
| 100 | 95 | decoder_->DecodeFrame(video_->cxdata(), video_->frame_size()); |
| 101 | − if (res != VPX_CODEC_OK) | |
| 102 | − return res; | |
| 96 | + if (res != VPX_CODEC_OK) return res; | |
| 103 | 97 | CheckDecodedFrames(byte_alignment_to_check); |
| 104 | 98 | } |
| 105 | 99 | return VPX_CODEC_OK; |
| @@ -135,7 +129,7 @@ class ByteAlignmentTest · 29 unmodified lines | ||
| 135 | 129 | void OpenMd5File(const std::string &md5_file_name_) { |
| 136 | 130 | md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_); |
| 137 | 131 | ASSERT_TRUE(md5_file_ != NULL) << "MD5 file open failed. Filename: " |
| 138 | − << md5_file_name_; | |
| 132 | + << md5_file_name_; | |
| 139 | 133 | } |
| 140 | 134 | |
| 141 | 135 | void CheckMd5(const vpx_image_t &img) { |
| @@ -163,8 +157,8 @@ class ByteAlignmentTest · 21 unmodified lines | ||
| 163 | 157 | |
| 164 | 158 | TEST_F(ByteAlignmentTest, SwitchByteAlignment) { |
| 165 | 159 | 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 }; | |
| 168 | 162 | |
| 169 | 163 | for (int i = 0; i < num_elements; ++i) { |
| 170 | 164 | SetByteAlignment(byte_alignments[i], VPX_CODEC_OK); |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #include "./vpx_config.h" |
| 14 | 14 | #if ARCH_X86 || ARCH_X86_64 |
| 15 | −# include "vpx_ports/x86.h" | |
| 15 | +#include "vpx_ports/x86.h" | |
| 16 | 16 | #endif |
| 17 | 17 | |
| 18 | 18 | namespace libvpx_test { |
| @@ -32,15 +32,15 @@ class CodecFactory { · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | virtual ~CodecFactory() {} |
| 34 | 34 | |
| 35 | − virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 35 | + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 36 | 36 | unsigned long deadline) const = 0; |
| 37 | 37 | |
| 38 | − virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 38 | + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 39 | 39 | const vpx_codec_flags_t flags, |
| 40 | 40 | unsigned long deadline) // NOLINT(runtime/int) |
| 41 | − const = 0; | |
| 41 | + const = 0; | |
| 42 | 42 | |
| 43 | − virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg, | |
| 43 | + virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg, | |
| 44 | 44 | unsigned long deadline, |
| 45 | 45 | const unsigned long init_flags, |
| 46 | 46 | TwopassStatsStore *stats) const = 0; |
| @@ -53,20 +53,20 @@ class CodecFactory { · 6 unmodified lines | ||
| 53 | 53 | * to avoid having to include a pointer to the CodecFactory in every test |
| 54 | 54 | * definition. |
| 55 | 55 | */ |
| 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> > {}; | |
| 60 | 60 | |
| 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> > {}; | |
| 65 | 65 | |
| 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> > {}; | |
| 70 | 70 | |
| 71 | 71 | /* |
| 72 | 72 | * VP8 Codec Definitions |
| @@ -82,7 +82,7 @@ class VP8Decoder : public Decoder { · 9 unmodified lines | ||
| 82 | 82 | : Decoder(cfg, flag, deadline) {} |
| 83 | 83 | |
| 84 | 84 | protected: |
| 85 | − virtual vpx_codec_iface_t* CodecInterface() const { | |
| 85 | + virtual vpx_codec_iface_t *CodecInterface() const { | |
| 86 | 86 | #if CONFIG_VP8_DECODER |
| 87 | 87 | return &vpx_codec_vp8_dx_algo; |
| 88 | 88 | #else |
| @@ -98,7 +98,7 @@ class VP8Encoder : public Encoder { · 9 unmodified lines | ||
| 98 | 98 | : Encoder(cfg, deadline, init_flags, stats) {} |
| 99 | 99 | |
| 100 | 100 | protected: |
| 101 | − virtual vpx_codec_iface_t* CodecInterface() const { | |
| 101 | + virtual vpx_codec_iface_t *CodecInterface() const { | |
| 102 | 102 | #if CONFIG_VP8_ENCODER |
| 103 | 103 | return &vpx_codec_vp8_cx_algo; |
| 104 | 104 | #else |
| @@ -111,12 +111,12 @@ class VP8CodecFactory : public CodecFactory { · 6 unmodified lines | ||
| 111 | 111 | public: |
| 112 | 112 | VP8CodecFactory() : CodecFactory() {} |
| 113 | 113 | |
| 114 | − virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 114 | + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 115 | 115 | unsigned long deadline) const { |
| 116 | 116 | return CreateDecoder(cfg, 0, deadline); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | − virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 119 | + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 120 | 120 | const vpx_codec_flags_t flags, |
| 121 | 121 | unsigned long deadline) const { // NOLINT |
| 122 | 122 | #if CONFIG_VP8_DECODER |
| @@ -126,7 +126,7 @@ class VP8CodecFactory : public CodecFactory { · 3 unmodified lines | ||
| 126 | 126 | #endif |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | − virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg, | |
| 129 | + virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg, | |
| 130 | 130 | unsigned long deadline, |
| 131 | 131 | const unsigned long init_flags, |
| 132 | 132 | TwopassStatsStore *stats) const { |
| @@ -149,17 +149,17 @@ class VP8CodecFactory : public CodecFactory { · 16 unmodified lines | ||
| 149 | 149 | |
| 150 | 150 | const libvpx_test::VP8CodecFactory kVP8; |
| 151 | 151 | |
| 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)), \ | |
| 157 | 158 | __VA_ARGS__)) |
| 158 | 159 | #else |
| 159 | 160 | #define VP8_INSTANTIATE_TEST_CASE(test, ...) |
| 160 | 161 | #endif // CONFIG_VP8 |
| 161 | 162 | |
| 162 | − | |
| 163 | 163 | /* |
| 164 | 164 | * VP9 Codec Definitions |
| 165 | 165 | */ |
| @@ -174,7 +174,7 @@ class VP9Decoder : public Decoder { · 8 unmodified lines | ||
| 174 | 174 | : Decoder(cfg, flag, deadline) {} |
| 175 | 175 | |
| 176 | 176 | protected: |
| 177 | − virtual vpx_codec_iface_t* CodecInterface() const { | |
| 177 | + virtual vpx_codec_iface_t *CodecInterface() const { | |
| 178 | 178 | #if CONFIG_VP9_DECODER |
| 179 | 179 | return &vpx_codec_vp9_dx_algo; |
| 180 | 180 | #else |
| @@ -190,7 +190,7 @@ class VP9Encoder : public Encoder { · 9 unmodified lines | ||
| 190 | 190 | : Encoder(cfg, deadline, init_flags, stats) {} |
| 191 | 191 | |
| 192 | 192 | protected: |
| 193 | − virtual vpx_codec_iface_t* CodecInterface() const { | |
| 193 | + virtual vpx_codec_iface_t *CodecInterface() const { | |
| 194 | 194 | #if CONFIG_VP9_ENCODER |
| 195 | 195 | return &vpx_codec_vp9_cx_algo; |
| 196 | 196 | #else |
| @@ -203,12 +203,12 @@ class VP9CodecFactory : public CodecFactory { · 6 unmodified lines | ||
| 203 | 203 | public: |
| 204 | 204 | VP9CodecFactory() : CodecFactory() {} |
| 205 | 205 | |
| 206 | − virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 206 | + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 207 | 207 | unsigned long deadline) const { |
| 208 | 208 | return CreateDecoder(cfg, 0, deadline); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | − virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 211 | + virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg, | |
| 212 | 212 | const vpx_codec_flags_t flags, |
| 213 | 213 | unsigned long deadline) const { // NOLINT |
| 214 | 214 | #if CONFIG_VP9_DECODER |
| @@ -218,7 +218,7 @@ class VP9CodecFactory : public CodecFactory { · 3 unmodified lines | ||
| 218 | 218 | #endif |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | − virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg, | |
| 221 | + virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg, | |
| 222 | 222 | unsigned long deadline, |
| 223 | 223 | const unsigned long init_flags, |
| 224 | 224 | TwopassStatsStore *stats) const { |
| @@ -241,11 +241,12 @@ class VP9CodecFactory : public CodecFactory { · 16 unmodified lines | ||
| 241 | 241 | |
| 242 | 242 | const libvpx_test::VP9CodecFactory kVP9; |
| 243 | 243 | |
| 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)), \ | |
| 249 | 250 | __VA_ARGS__)) |
| 250 | 251 | #else |
| 251 | 252 | #define VP9_INSTANTIATE_TEST_CASE(test, ...) |
| @@ -15,11 +15,13 @@ · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | namespace { |
| 17 | 17 | |
| 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> { | |
| 20 | 21 | 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) {} | |
| 23 | 25 | virtual ~ConfigTest() {} |
| 24 | 26 | |
| 25 | 27 | virtual void SetUp() { |
| @@ -32,12 +34,12 @@ class ConfigTest : public ::libvpx_test::EncoderTest, · 6 unmodified lines | ||
| 32 | 34 | frame_count_out_ = 0; |
| 33 | 35 | } |
| 34 | 36 | |
| 35 | − virtual void PreEncodeFrameHook(libvpx_test::VideoSource* /*video*/) { | |
| 37 | + virtual void PreEncodeFrameHook(libvpx_test::VideoSource * /*video*/) { | |
| 36 | 38 | ++frame_count_in_; |
| 37 | 39 | abort_ |= (frame_count_in_ >= frame_count_max_); |
| 38 | 40 | } |
| 39 | 41 | |
| 40 | − virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) { | |
| 42 | + virtual void FramePktHook(const vpx_codec_cx_pkt_t * /*pkt*/) { | |
| 41 | 43 | ++frame_count_out_; |
| 42 | 44 | } |
| 43 | 45 | |
| @@ -26,12 +26,10 @@ · 25 unmodified lines | ||
| 26 | 26 | #include "vpx_dsp/ssim.h" |
| 27 | 27 | #include "vpx_mem/vpx_mem.h" |
| 28 | 28 | |
| 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); | |
| 35 | 33 | |
| 36 | 34 | using libvpx_test::ACMRandom; |
| 37 | 35 | |
| @@ -41,20 +39,18 @@ class ConsistencyTestBase : public ::testing::Test { · 3 unmodified lines | ||
| 41 | 39 | ConsistencyTestBase(int width, int height) : width_(width), height_(height) {} |
| 42 | 40 | |
| 43 | 41 | static void SetUpTestCase() { |
| 44 | − source_data_[0] = reinterpret_cast<uint8_t*>( | |
| 42 | + source_data_[0] = reinterpret_cast<uint8_t *>( | |
| 45 | 43 | vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 46 | − reference_data_[0] = reinterpret_cast<uint8_t*>( | |
| 44 | + reference_data_[0] = reinterpret_cast<uint8_t *>( | |
| 47 | 45 | vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 48 | − source_data_[1] = reinterpret_cast<uint8_t*>( | |
| 46 | + source_data_[1] = reinterpret_cast<uint8_t *>( | |
| 49 | 47 | vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 50 | − reference_data_[1] = reinterpret_cast<uint8_t*>( | |
| 48 | + reference_data_[1] = reinterpret_cast<uint8_t *>( | |
| 51 | 49 | vpx_memalign(kDataAlignment, kDataBufferSize)); |
| 52 | 50 | ssim_array_ = new Ssimv[kDataBufferSize / 16]; |
| 53 | 51 | } |
| 54 | 52 | |
| 55 | − static void ClearSsim() { | |
| 56 | − memset(ssim_array_, 0, kDataBufferSize / 16); | |
| 57 | − } | |
| 53 | + static void ClearSsim() { memset(ssim_array_, 0, kDataBufferSize / 16); } | |
| 58 | 54 | static void TearDownTestCase() { |
| 59 | 55 | vpx_free(source_data_[0]); |
| 60 | 56 | source_data_[0] = NULL; |
| @@ -68,14 +64,12 @@ class ConsistencyTestBase : public ::testing::Test { · 7 unmodified lines | ||
| 68 | 64 | delete[] ssim_array_; |
| 69 | 65 | } |
| 70 | 66 | |
| 71 | − virtual void TearDown() { | |
| 72 | − libvpx_test::ClearSystemState(); | |
| 73 | − } | |
| 67 | + virtual void TearDown() { libvpx_test::ClearSystemState(); } | |
| 74 | 68 | |
| 75 | 69 | protected: |
| 76 | 70 | // Handle frames up to 640x480 |
| 77 | 71 | static const int kDataAlignment = 16; |
| 78 | − static const int kDataBufferSize = 640*480; | |
| 72 | + static const int kDataBufferSize = 640 * 480; | |
| 79 | 73 | |
| 80 | 74 | virtual void SetUp() { |
| 81 | 75 | source_stride_ = (width_ + 31) & ~31; |
| @@ -122,9 +116,9 @@ class ConsistencyTestBase : public ::testing::Test { · 40 unmodified lines | ||
| 122 | 116 | } |
| 123 | 117 | } |
| 124 | 118 | int width_, height_; |
| 125 | − static uint8_t* source_data_[2]; | |
| 119 | + static uint8_t *source_data_[2]; | |
| 126 | 120 | int source_stride_; |
| 127 | − static uint8_t* reference_data_[2]; | |
| 121 | + static uint8_t *reference_data_[2]; | |
| 128 | 122 | int reference_stride_; |
| 129 | 123 | static Ssimv *ssim_array_; |
| 130 | 124 | Metrics metrics_; |
| @@ -142,18 +136,17 @@ class ConsistencyVP9Test · 11 unmodified lines | ||
| 142 | 136 | |
| 143 | 137 | protected: |
| 144 | 138 | 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); | |
| 150 | 143 | } |
| 151 | 144 | }; |
| 152 | 145 | #endif // CONFIG_VP9_ENCODER |
| 153 | 146 | |
| 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; | |
| 157 | 150 | |
| 158 | 151 | #if CONFIG_VP9_ENCODER |
| 159 | 152 | TEST_P(ConsistencyVP9Test, ConsistencyIsZero) { |
| @@ -205,7 +198,6 @@ TEST_P(ConsistencyVP9Test, ConsistencyIsZero) { · 45 unmodified lines | ||
| 205 | 198 | } |
| 206 | 199 | #endif // CONFIG_VP9_ENCODER |
| 207 | 200 | |
| 208 | − | |
| 209 | 201 | using std::tr1::make_tuple; |
| 210 | 202 | |
| 211 | 203 | //------------------------------------------------------------------------------ |
| @@ -213,9 +205,7 @@ using std::tr1::make_tuple; · 1 unmodified line | ||
| 213 | 205 | |
| 214 | 206 | #if CONFIG_VP9_ENCODER |
| 215 | 207 | 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), | |
| 219 | 209 | }; |
| 220 | 210 | INSTANTIATE_TEST_CASE_P(C, ConsistencyVP9Test, |
| 221 | 211 | ::testing::ValuesIn(c_vp9_tests)); |
| @@ -37,14 +37,12 @@ typedef void (*ConvolveFunc)(const uint8_t *src, ptrdiff_t src_stride, · 36 unmodified lines | ||
| 37 | 37 | int w, int h); |
| 38 | 38 | |
| 39 | 39 | 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) | |
| 48 | 46 | : copy_(copy), avg_(avg), h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg), |
| 49 | 47 | v8_avg_(v8_avg), hv8_avg_(hv8_avg), sh8_(sh8), sv8_(sv8), shv8_(shv8), |
| 50 | 48 | sh8_avg_(sh8_avg), sv8_avg_(sv8_avg), shv8_avg_(shv8_avg), |
| @@ -58,49 +56,35 @@ struct ConvolveFunctions { · 7 unmodified lines | ||
| 58 | 56 | ConvolveFunc h8_avg_; |
| 59 | 57 | ConvolveFunc v8_avg_; |
| 60 | 58 | 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 | |
| 67 | 65 | int use_highbd_; // 0 if high bitdepth not used, else the actual bit depth. |
| 68 | 66 | }; |
| 69 | 67 | |
| 70 | 68 | typedef std::tr1::tuple<int, int, const ConvolveFunctions *> ConvolveParam; |
| 71 | 69 | |
| 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) | |
| 86 | 78 | |
| 87 | 79 | // Reference 8-tap subpixel filter, slightly modified to fit into this test. |
| 88 | 80 | #define VP9_FILTER_WEIGHT 128 |
| 89 | 81 | #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; } | |
| 95 | 83 | |
| 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) { | |
| 104 | 88 | // Between passes, we use an intermediate buffer whose height is extended to |
| 105 | 89 | // have enough horizontally filtered values as input for the vertical pass. |
| 106 | 90 | // 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 | ||
| 128 | 112 | for (i = 0; i < intermediate_height; ++i) { |
| 129 | 113 | for (j = 0; j < output_width; ++j) { |
| 130 | 114 | // 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 | |
| 140 | 120 | |
| 141 | 121 | // Normalize back to 0-255... |
| 142 | 122 | *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 | ||
| 153 | 133 | for (i = 0; i < output_height; ++i) { |
| 154 | 134 | for (j = 0; j < output_width; ++j) { |
| 155 | 135 | // 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 | |
| 165 | 141 | |
| 166 | 142 | // Normalize back to 0-255... |
| 167 | 143 | *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 | ||
| 172 | 148 | } |
| 173 | 149 | } |
| 174 | 150 | |
| 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) { | |
| 181 | 154 | unsigned int i, j; |
| 182 | 155 | for (i = 0; i < output_height; ++i) { |
| 183 | 156 | for (j = 0; j < output_width; ++j) { |
| @@ -189,10 +162,8 @@ void block2d_average_c(uint8_t *src, · 5 unmodified lines | ||
| 189 | 162 | |
| 190 | 163 | void filter_average_block2d_8_c(const uint8_t *src_ptr, |
| 191 | 164 | 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, | |
| 196 | 167 | unsigned int output_width, |
| 197 | 168 | unsigned int output_height) { |
| 198 | 169 | uint8_t tmp[kMaxDimension * kMaxDimension]; |
| @@ -201,20 +172,16 @@ void filter_average_block2d_8_c(const uint8_t *src_ptr, · 2 unmodified lines | ||
| 201 | 172 | assert(output_height <= kMaxDimension); |
| 202 | 173 | filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64, |
| 203 | 174 | 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); | |
| 206 | 176 | } |
| 207 | 177 | |
| 208 | 178 | #if CONFIG_VP9_HIGHBITDEPTH |
| 209 | 179 | void highbd_filter_block2d_8_c(const uint16_t *src_ptr, |
| 210 | 180 | 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, | |
| 215 | 183 | unsigned int output_width, |
| 216 | − unsigned int output_height, | |
| 217 | − int bd) { | |
| 184 | + unsigned int output_height, int bd) { | |
| 218 | 185 | // Between passes, we use an intermediate buffer whose height is extended to |
| 219 | 186 | // have enough horizontally filtered values as input for the vertical pass. |
| 220 | 187 | // 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 | ||
| 243 | 210 | for (i = 0; i < intermediate_height; ++i) { |
| 244 | 211 | for (j = 0; j < output_width; ++j) { |
| 245 | 212 | // 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]) + | |
| 254 | 217 | (VP9_FILTER_WEIGHT >> 1); // Rounding |
| 255 | 218 | |
| 256 | 219 | // Normalize back to 0-255... |
| @@ -271,14 +234,10 @@ void highbd_filter_block2d_8_c(const uint16_t *src_ptr, · 14 unmodified lines | ||
| 271 | 234 | for (i = 0; i < output_height; ++i) { |
| 272 | 235 | for (j = 0; j < output_width; ++j) { |
| 273 | 236 | // 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]) + | |
| 282 | 241 | (VP9_FILTER_WEIGHT >> 1); // Rounding |
| 283 | 242 | |
| 284 | 243 | // Normalize back to 0-255... |
| @@ -291,10 +250,8 @@ void highbd_filter_block2d_8_c(const uint16_t *src_ptr, · 6 unmodified lines | ||
| 291 | 250 | } |
| 292 | 251 | } |
| 293 | 252 | |
| 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, | |
| 298 | 255 | unsigned int output_width, |
| 299 | 256 | unsigned int output_height) { |
| 300 | 257 | unsigned int i, j; |
| @@ -306,23 +263,19 @@ void highbd_block2d_average_c(uint16_t *src, · 5 unmodified lines | ||
| 306 | 263 | } |
| 307 | 264 | } |
| 308 | 265 | |
| 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) { | |
| 318 | 271 | uint16_t tmp[kMaxDimension * kMaxDimension]; |
| 319 | 272 | |
| 320 | 273 | assert(output_width <= kMaxDimension); |
| 321 | 274 | assert(output_height <= kMaxDimension); |
| 322 | 275 | highbd_filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64, |
| 323 | 276 | 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); | |
| 326 | 279 | } |
| 327 | 280 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 328 | 281 | |
| @@ -330,19 +283,20 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { · 1 unmodified line | ||
| 330 | 283 | public: |
| 331 | 284 | static void SetUpTestCase() { |
| 332 | 285 | // 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 *>( | |
| 336 | 290 | vpx_memalign(kDataAlignment, kOutputBufferSize)); |
| 337 | − output_ref_ = reinterpret_cast<uint8_t*>( | |
| 291 | + output_ref_ = reinterpret_cast<uint8_t *>( | |
| 338 | 292 | vpx_memalign(kDataAlignment, kOutputBufferSize)); |
| 339 | 293 | #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 *>( | |
| 344 | 298 | vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t))); |
| 345 | − output16_ref_ = reinterpret_cast<uint16_t*>( | |
| 299 | + output16_ref_ = reinterpret_cast<uint16_t *>( | |
| 346 | 300 | vpx_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t))); |
| 347 | 301 | #endif |
| 348 | 302 | } |
| @@ -438,8 +392,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { · 89 unmodified lines | ||
| 438 | 392 | |
| 439 | 393 | void CheckGuardBlocks() { |
| 440 | 394 | 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]); | |
| 443 | 396 | } |
| 444 | 397 | } |
| 445 | 398 | |
| @@ -497,98 +450,88 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> { · 51 unmodified lines | ||
| 497 | 450 | void assign_val(uint8_t *list, int index, uint16_t val) const { |
| 498 | 451 | #if CONFIG_VP9_HIGHBITDEPTH |
| 499 | 452 | if (UUT_->use_highbd_ == 0) { |
| 500 | − list[index] = (uint8_t) val; | |
| 453 | + list[index] = (uint8_t)val; | |
| 501 | 454 | } else { |
| 502 | 455 | CONVERT_TO_SHORTPTR(list)[index] = val; |
| 503 | 456 | } |
| 504 | 457 | #else |
| 505 | − list[index] = (uint8_t) val; | |
| 458 | + list[index] = (uint8_t)val; | |
| 506 | 459 | #endif |
| 507 | 460 | } |
| 508 | 461 | |
| 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) { | |
| 517 | 467 | #if CONFIG_VP9_HIGHBITDEPTH |
| 518 | 468 | 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); | |
| 522 | 471 | } 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_); | |
| 528 | 476 | } |
| 529 | 477 | #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); | |
| 533 | 480 | #endif |
| 534 | 481 | } |
| 535 | 482 | |
| 536 | 483 | void wrapper_filter_block2d_8_c(const uint8_t *src_ptr, |
| 537 | 484 | const unsigned int src_stride, |
| 538 | 485 | const int16_t *HFilter, |
| 539 | − const int16_t *VFilter, | |
| 540 | − uint8_t *dst_ptr, | |
| 486 | + const int16_t *VFilter, uint8_t *dst_ptr, | |
| 541 | 487 | unsigned int dst_stride, |
| 542 | 488 | unsigned int output_width, |
| 543 | 489 | unsigned int output_height) { |
| 544 | 490 | #if CONFIG_VP9_HIGHBITDEPTH |
| 545 | 491 | 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); | |
| 548 | 494 | } else { |
| 549 | 495 | 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_); | |
| 553 | 499 | } |
| 554 | 500 | #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); | |
| 557 | 503 | #endif |
| 558 | 504 | } |
| 559 | 505 | |
| 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_; | |
| 564 | 510 | #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_; | |
| 568 | 514 | int mask_; |
| 569 | 515 | #endif |
| 570 | 516 | }; |
| 571 | 517 | |
| 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; | |
| 575 | 521 | #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; | |
| 579 | 525 | #endif |
| 580 | 526 | |
| 581 | −TEST_P(ConvolveTest, GuardBlocks) { | |
| 582 | − CheckGuardBlocks(); | |
| 583 | −} | |
| 527 | +TEST_P(ConvolveTest, GuardBlocks) { CheckGuardBlocks(); } | |
| 584 | 528 | |
| 585 | 529 | 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(); | |
| 588 | 532 | |
| 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())); | |
| 592 | 535 | |
| 593 | 536 | CheckGuardBlocks(); |
| 594 | 537 | |
| @@ -600,14 +543,13 @@ TEST_P(ConvolveTest, Copy) { · 5 unmodified lines | ||
| 600 | 543 | } |
| 601 | 544 | |
| 602 | 545 | 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(); | |
| 606 | 549 | CopyOutputToRef(); |
| 607 | 550 | |
| 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())); | |
| 611 | 553 | |
| 612 | 554 | CheckGuardBlocks(); |
| 613 | 555 | |
| @@ -615,18 +557,20 @@ TEST_P(ConvolveTest, Avg) { · 1 unmodified line | ||
| 615 | 557 | for (int x = 0; x < Width(); ++x) |
| 616 | 558 | ASSERT_EQ(lookup(out, y * kOutputStride + x), |
| 617 | 559 | 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)) | |
| 619 | 562 | << "(" << x << "," << y << ")"; |
| 620 | 563 | } |
| 621 | 564 | |
| 622 | 565 | 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 }; | |
| 626 | 570 | |
| 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())); | |
| 630 | 574 | |
| 631 | 575 | CheckGuardBlocks(); |
| 632 | 576 | |
| @@ -638,13 +582,14 @@ TEST_P(ConvolveTest, CopyHoriz) { · 5 unmodified lines | ||
| 638 | 582 | } |
| 639 | 583 | |
| 640 | 584 | 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 }; | |
| 644 | 589 | |
| 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())); | |
| 648 | 593 | |
| 649 | 594 | CheckGuardBlocks(); |
| 650 | 595 | |
| @@ -656,13 +601,14 @@ TEST_P(ConvolveTest, CopyVert) { · 5 unmodified lines | ||
| 656 | 601 | } |
| 657 | 602 | |
| 658 | 603 | 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 }; | |
| 662 | 608 | |
| 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())); | |
| 666 | 612 | |
| 667 | 613 | CheckGuardBlocks(); |
| 668 | 614 | |
| @@ -700,12 +646,12 @@ TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) { · 31 unmodified lines | ||
| 700 | 646 | const int16_t kInvalidFilter[8] = { 0 }; |
| 701 | 647 | |
| 702 | 648 | 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(); | |
| 705 | 651 | #if CONFIG_VP9_HIGHBITDEPTH |
| 706 | 652 | uint8_t ref8[kOutputStride * kMaxDimension]; |
| 707 | 653 | uint16_t ref16[kOutputStride * kMaxDimension]; |
| 708 | − uint8_t* ref; | |
| 654 | + uint8_t *ref; | |
| 709 | 655 | if (UUT_->use_highbd_ == 0) { |
| 710 | 656 | ref = ref8; |
| 711 | 657 | } else { |
| @@ -721,31 +667,26 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) { · 9 unmodified lines | ||
| 721 | 667 | |
| 722 | 668 | for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { |
| 723 | 669 | 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, | |
| 727 | 672 | Width(), Height()); |
| 728 | 673 | |
| 729 | 674 | 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())); | |
| 734 | 678 | else if (filter_y) |
| 735 | 679 | 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())); | |
| 739 | 682 | else if (filter_x) |
| 740 | 683 | 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())); | |
| 744 | 686 | else |
| 745 | 687 | 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())); | |
| 749 | 690 | |
| 750 | 691 | CheckGuardBlocks(); |
| 751 | 692 | |
| @@ -754,20 +695,20 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) { · 2 unmodified lines | ||
| 754 | 695 | ASSERT_EQ(lookup(ref, y * kOutputStride + x), |
| 755 | 696 | lookup(out, y * kOutputStride + x)) |
| 756 | 697 | << "mismatch at (" << x << "," << y << "), " |
| 757 | − << "filters (" << filter_bank << "," | |
| 758 | − << filter_x << "," << filter_y << ")"; | |
| 698 | + << "filters (" << filter_bank << "," << filter_x << "," | |
| 699 | + << filter_y << ")"; | |
| 759 | 700 | } |
| 760 | 701 | } |
| 761 | 702 | } |
| 762 | 703 | } |
| 763 | 704 | |
| 764 | 705 | 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(); | |
| 767 | 708 | #if CONFIG_VP9_HIGHBITDEPTH |
| 768 | 709 | uint8_t ref8[kOutputStride * kMaxDimension]; |
| 769 | 710 | uint16_t ref16[kOutputStride * kMaxDimension]; |
| 770 | − uint8_t* ref; | |
| 711 | + uint8_t *ref; | |
| 771 | 712 | if (UUT_->use_highbd_ == 0) { |
| 772 | 713 | ref = ref8; |
| 773 | 714 | } else { |
| @@ -803,31 +744,26 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) { · 29 unmodified lines | ||
| 803 | 744 | |
| 804 | 745 | for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { |
| 805 | 746 | 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()); | |
| 810 | 750 | |
| 811 | 751 | 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())); | |
| 816 | 755 | 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())); | |
| 821 | 759 | 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())); | |
| 826 | 763 | else |
| 827 | 764 | 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())); | |
| 831 | 767 | |
| 832 | 768 | CheckGuardBlocks(); |
| 833 | 769 | |
| @@ -836,8 +772,8 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) { · 2 unmodified lines | ||
| 836 | 772 | ASSERT_EQ(lookup(ref, y * kOutputStride + x), |
| 837 | 773 | lookup(out, y * kOutputStride + x)) |
| 838 | 774 | << "mismatch at (" << x << "," << y << "), " |
| 839 | − << "filters (" << filter_bank << "," | |
| 840 | − << filter_x << "," << filter_y << ")"; | |
| 775 | + << "filters (" << filter_bank << "," << filter_x << "," | |
| 776 | + << filter_y << ")"; | |
| 841 | 777 | } |
| 842 | 778 | } |
| 843 | 779 | } |
| @@ -884,16 +820,16 @@ TEST_P(ConvolveTest, FilterExtremes) { · 40 unmodified lines | ||
| 884 | 820 | for (int y = 0; y < 8; ++y) { |
| 885 | 821 | for (int x = 0; x < 8; ++x) { |
| 886 | 822 | #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_); | |
| 889 | 825 | #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); | |
| 892 | 828 | #endif |
| 893 | 829 | if (axis) seed_val++; |
| 894 | 830 | } |
| 895 | 831 | if (axis) |
| 896 | − seed_val-= 8; | |
| 832 | + seed_val -= 8; | |
| 897 | 833 | else |
| 898 | 834 | seed_val++; |
| 899 | 835 | } |
| @@ -904,38 +840,33 @@ TEST_P(ConvolveTest, FilterExtremes) { · 4 unmodified lines | ||
| 904 | 840 | vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)]; |
| 905 | 841 | for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { |
| 906 | 842 | 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, | |
| 910 | 845 | Width(), Height()); |
| 911 | 846 | 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())); | |
| 916 | 850 | 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())); | |
| 921 | 854 | 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())); | |
| 926 | 858 | 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())); | |
| 931 | 862 | |
| 932 | 863 | for (int y = 0; y < Height(); ++y) |
| 933 | 864 | for (int x = 0; x < Width(); ++x) |
| 934 | 865 | ASSERT_EQ(lookup(ref, y * kOutputStride + x), |
| 935 | 866 | lookup(out, y * kOutputStride + x)) |
| 936 | 867 | << "mismatch at (" << x << "," << y << "), " |
| 937 | − << "filters (" << filter_bank << "," | |
| 938 | − << filter_x << "," << filter_y << ")"; | |
| 868 | + << "filters (" << filter_bank << "," << filter_x << "," | |
| 869 | + << filter_y << ")"; | |
| 939 | 870 | } |
| 940 | 871 | } |
| 941 | 872 | } |
| @@ -946,8 +877,8 @@ TEST_P(ConvolveTest, FilterExtremes) { · 4 unmodified lines | ||
| 946 | 877 | /* This test exercises that enough rows and columns are filtered with every |
| 947 | 878 | possible initial fractional positions and scaling steps. */ |
| 948 | 879 | 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(); | |
| 951 | 882 | const InterpKernel *const eighttap = vp9_filter_kernels[EIGHTTAP]; |
| 952 | 883 | |
| 953 | 884 | SetConstantInput(127); |
| @@ -956,9 +887,8 @@ TEST_P(ConvolveTest, CheckScalingFiltering) { · 2 unmodified lines | ||
| 956 | 887 | for (int step = 1; step <= 32; ++step) { |
| 957 | 888 | /* Test the horizontal and vertical filters in combination. */ |
| 958 | 889 | 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())); | |
| 962 | 892 | |
| 963 | 893 | CheckGuardBlocks(); |
| 964 | 894 | |
| @@ -966,8 +896,8 @@ TEST_P(ConvolveTest, CheckScalingFiltering) { · 1 unmodified line | ||
| 966 | 896 | for (int x = 0; x < Width(); ++x) { |
| 967 | 897 | ASSERT_EQ(lookup(in, y * kInputStride + x), |
| 968 | 898 | 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; | |
| 971 | 901 | } |
| 972 | 902 | } |
| 973 | 903 | } |
| @@ -977,18 +907,14 @@ TEST_P(ConvolveTest, CheckScalingFiltering) { · 3 unmodified lines | ||
| 977 | 907 | using std::tr1::make_tuple; |
| 978 | 908 | |
| 979 | 909 | #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 | + } | |
| 992 | 918 | #if HAVE_SSE2 && ARCH_X86_64 |
| 993 | 919 | WRAP(convolve_copy_sse2, 8) |
| 994 | 920 | WRAP(convolve_avg_sse2, 8) |
| @@ -1043,48 +969,40 @@ WRAP(convolve8_avg_c, 12) · 48 unmodified lines | ||
| 1043 | 969 | #undef WRAP |
| 1044 | 970 | |
| 1045 | 971 | 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, | |
| 1050 | 975 | 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); | |
| 1053 | 978 | 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, | |
| 1055 | 982 | 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); | |
| 1061 | 985 | 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, | |
| 1066 | 989 | 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); | |
| 1069 | 992 | 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) | |
| 1073 | 994 | }; |
| 1074 | 995 | |
| 1075 | 996 | #else |
| 1076 | 997 | 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, | |
| 1083 | 1002 | vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0); |
| 1084 | 1003 | const ConvolveParam kArrayConvolve_c[] = { ALL_SIZES(convolve8_c) }; |
| 1085 | 1004 | #endif |
| 1086 | −INSTANTIATE_TEST_CASE_P(C, ConvolveTest, | |
| 1087 | − ::testing::ValuesIn(kArrayConvolve_c)); | |
| 1005 | +INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::ValuesIn(kArrayConvolve_c)); | |
| 1088 | 1006 | |
| 1089 | 1007 | #if HAVE_SSE2 && ARCH_X86_64 |
| 1090 | 1008 | #if CONFIG_VP9_HIGHBITDEPTH |
| @@ -1112,20 +1030,16 @@ const ConvolveFunctions convolve12_sse2( · 21 unmodified lines | ||
| 1112 | 1030 | wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12, |
| 1113 | 1031 | wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12, |
| 1114 | 1032 | 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) }; | |
| 1120 | 1036 | #else |
| 1121 | 1037 | 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); | |
| 1129 | 1043 | |
| 1130 | 1044 | const ConvolveParam kArrayConvolve_sse2[] = { ALL_SIZES(convolve8_sse2) }; |
| 1131 | 1045 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| @@ -1135,13 +1049,11 @@ INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, · 3 unmodified lines | ||
| 1135 | 1049 | |
| 1136 | 1050 | #if HAVE_SSSE3 |
| 1137 | 1051 | 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); | |
| 1145 | 1057 | |
| 1146 | 1058 | const ConvolveParam kArrayConvolve8_ssse3[] = { ALL_SIZES(convolve8_ssse3) }; |
| 1147 | 1059 | INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, |
| @@ -1150,13 +1062,11 @@ INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, · 2 unmodified lines | ||
| 1150 | 1062 | |
| 1151 | 1063 | #if HAVE_AVX2 && HAVE_SSSE3 |
| 1152 | 1064 | 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); | |
| 1160 | 1070 | |
| 1161 | 1071 | const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES(convolve8_avx2) }; |
| 1162 | 1072 | INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, |
| @@ -1166,22 +1076,18 @@ INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, · 3 unmodified lines | ||
| 1166 | 1076 | #if HAVE_NEON |
| 1167 | 1077 | #if HAVE_NEON_ASM |
| 1168 | 1078 | 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 | |
| 1177 | 1085 | 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); | |
| 1185 | 1091 | #endif // HAVE_NEON_ASM |
| 1186 | 1092 | |
| 1187 | 1093 | const ConvolveParam kArrayConvolve8_neon[] = { ALL_SIZES(convolve8_neon) }; |
| @@ -1191,13 +1097,11 @@ INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, · 3 unmodified lines | ||
| 1191 | 1097 | |
| 1192 | 1098 | #if HAVE_DSPR2 |
| 1193 | 1099 | 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); | |
| 1201 | 1105 | |
| 1202 | 1106 | const ConvolveParam kArrayConvolve8_dspr2[] = { ALL_SIZES(convolve8_dspr2) }; |
| 1203 | 1107 | INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, |
| @@ -1206,13 +1110,11 @@ INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, · 2 unmodified lines | ||
| 1206 | 1110 | |
| 1207 | 1111 | #if HAVE_MSA |
| 1208 | 1112 | 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); | |
| 1216 | 1118 | |
| 1217 | 1119 | const ConvolveParam kArrayConvolve8_msa[] = { ALL_SIZES(convolve8_msa) }; |
| 1218 | 1120 | INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest, |
| @@ -23,10 +23,8 @@ class CpuSpeedTest · 22 unmodified lines | ||
| 23 | 23 | public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> { |
| 24 | 24 | protected: |
| 25 | 25 | 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), | |
| 30 | 28 | tune_content_(VP9E_CONTENT_DEFAULT) {} |
| 31 | 29 | virtual ~CpuSpeedTest() {} |
| 32 | 30 | |
| @@ -42,9 +40,7 @@ class CpuSpeedTest · 9 unmodified lines | ||
| 42 | 40 | } |
| 43 | 41 | } |
| 44 | 42 | |
| 45 | − virtual void BeginPassHook(unsigned int /*pass*/) { | |
| 46 | − min_psnr_ = kMaxPSNR; | |
| 47 | − } | |
| 43 | + virtual void BeginPassHook(unsigned int /*pass*/) { min_psnr_ = kMaxPSNR; } | |
| 48 | 44 | |
| 49 | 45 | virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video, |
| 50 | 46 | ::libvpx_test::Encoder *encoder) { |
| @@ -61,8 +57,7 @@ class CpuSpeedTest · 10 unmodified lines | ||
| 61 | 57 | } |
| 62 | 58 | |
| 63 | 59 | 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]; | |
| 66 | 61 | } |
| 67 | 62 | |
| 68 | 63 | ::libvpx_test::TestMode encoding_mode_; |
| @@ -153,9 +148,9 @@ TEST_P(CpuSpeedTest, TestLowBitrate) { · 84 unmodified lines | ||
| 153 | 148 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 154 | 149 | } |
| 155 | 150 | |
| 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)); | |
| 161 | 156 | } // namespace |
| @@ -24,14 +24,12 @@ const int kCQLevelStep = 8; · 23 unmodified lines | ||
| 24 | 24 | const unsigned int kCQTargetBitrate = 2000; |
| 25 | 25 | |
| 26 | 26 | class CQTest : public ::libvpx_test::EncoderTest, |
| 27 | − public ::libvpx_test::CodecTestWithParam<int> { | |
| 27 | + public ::libvpx_test::CodecTestWithParam<int> { | |
| 28 | 28 | public: |
| 29 | 29 | // maps the cqlevel to the bitrate produced. |
| 30 | 30 | typedef std::map<int, uint32_t> BitrateMap; |
| 31 | 31 | |
| 32 | − static void SetUpTestCase() { | |
| 33 | − bitrates_.clear(); | |
| 34 | − } | |
| 32 | + static void SetUpTestCase() { bitrates_.clear(); } | |
| 35 | 33 | |
| 36 | 34 | static void TearDownTestCase() { |
| 37 | 35 | ASSERT_TRUE(!HasFailure()) |
| @@ -128,7 +126,6 @@ TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) { · 90 unmodified lines | ||
| 128 | 126 | EXPECT_GE(cq_psnr_lin, vbr_psnr_lin); |
| 129 | 127 | } |
| 130 | 128 | |
| 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)); | |
| 134 | 131 | } // namespace |
| @@ -18,8 +18,9 @@ · 17 unmodified lines | ||
| 18 | 18 | |
| 19 | 19 | namespace { |
| 20 | 20 | |
| 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> { | |
| 23 | 24 | public: |
| 24 | 25 | DatarateTestLarge() : EncoderTest(GET_PARAM(0)) {} |
| 25 | 26 | |
| @@ -71,8 +72,7 @@ class DatarateTestLarge : public ::libvpx_test::EncoderTest, · 45 unmodified lines | ||
| 71 | 72 | // http://code.google.com/p/webm/issues/detail?id=496 is fixed. |
| 72 | 73 | // For now the codec assumes buffer starts at starting buffer rate |
| 73 | 74 | // plus one frame's time. |
| 74 | − if (last_pts_ == 0) | |
| 75 | − duration = 1; | |
| 75 | + if (last_pts_ == 0) duration = 1; | |
| 76 | 76 | |
| 77 | 77 | // Add to the buffer the bits we'd expect from a constant bitrate server. |
| 78 | 78 | bits_in_buffer_model_ += static_cast<int64_t>( |
| @@ -83,11 +83,11 @@ class DatarateTestLarge : public ::libvpx_test::EncoderTest, · 4 unmodified lines | ||
| 83 | 83 | * empty - and then stop showing frames until we've got enough bits to |
| 84 | 84 | * show one. As noted in comment below (issue 495), this does not currently |
| 85 | 85 | * 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; | |
| 88 | 88 | if (!key_frame) { |
| 89 | 89 | ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame " |
| 90 | − << pkt->data.frame.pts; | |
| 90 | + << pkt->data.frame.pts; | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | 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 | ||
| 99 | 99 | bits_total_ += frame_size_in_bits; |
| 100 | 100 | |
| 101 | 101 | // 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; | |
| 104 | 103 | |
| 105 | 104 | // Update the most recent pts. |
| 106 | 105 | last_pts_ = pkt->data.frame.pts; |
| @@ -119,8 +118,8 @@ class DatarateTestLarge : public ::libvpx_test::EncoderTest, · 12 unmodified lines | ||
| 119 | 118 | duration_ = (last_pts_ + 1) * timebase_; |
| 120 | 119 | |
| 121 | 120 | // 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_); | |
| 124 | 123 | |
| 125 | 124 | file_datarate_ = file_size_in_kb / duration_; |
| 126 | 125 | } |
| @@ -256,8 +255,9 @@ TEST_P(DatarateTestLarge, ChangingDropFrameThresh) { · 129 unmodified lines | ||
| 256 | 255 | } |
| 257 | 256 | } |
| 258 | 257 | |
| 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> { | |
| 261 | 261 | public: |
| 262 | 262 | DatarateTestVP9Large() : EncoderTest(GET_PARAM(0)) {} |
| 263 | 263 | |
| @@ -307,8 +307,8 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 43 unmodified lines | ||
| 307 | 307 | if (num_temp_layers == 2) { |
| 308 | 308 | if (frame_num % 2 == 0) { |
| 309 | 309 | // 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; | |
| 312 | 312 | } else { |
| 313 | 313 | // Layer 1: predict from L, G and ARF, and update G. |
| 314 | 314 | 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 | ||
| 317 | 317 | } else if (num_temp_layers == 3) { |
| 318 | 318 | if (frame_num % 4 == 0) { |
| 319 | 319 | // 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; | |
| 322 | 322 | } else if ((frame_num - 2) % 4 == 0) { |
| 323 | 323 | // Layer 1: predict from L, G, ARF; update G. |
| 324 | 324 | 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) { | |
| 326 | 326 | // 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; | |
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | return frame_flags; |
| @@ -353,8 +353,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 21 unmodified lines | ||
| 353 | 353 | |
| 354 | 354 | virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video, |
| 355 | 355 | ::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_); | |
| 358 | 357 | |
| 359 | 358 | if (denoiser_offon_test_) { |
| 360 | 359 | ASSERT_GT(denoiser_offon_period_, 0) |
| @@ -374,8 +373,8 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 13 unmodified lines | ||
| 374 | 373 | vpx_svc_layer_id_t layer_id; |
| 375 | 374 | layer_id.spatial_layer_id = 0; |
| 376 | 375 | 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); | |
| 379 | 378 | encoder->Control(VP9E_SET_SVC_LAYER_ID, &layer_id); |
| 380 | 379 | } |
| 381 | 380 | const vpx_rational_t tb = video->timebase(); |
| @@ -383,15 +382,13 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 1 unmodified line | ||
| 383 | 382 | duration_ = 0; |
| 384 | 383 | } |
| 385 | 384 | |
| 386 | − | |
| 387 | 385 | virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) { |
| 388 | 386 | // Time since last timestamp = duration. |
| 389 | 387 | vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_; |
| 390 | 388 | |
| 391 | 389 | if (duration > 1) { |
| 392 | 390 | // 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; | |
| 395 | 392 | // Update the number of frame drops. |
| 396 | 393 | num_drops_ += static_cast<int>(duration - 1); |
| 397 | 394 | // Update counter for total number of frames (#frames input to encoder). |
| @@ -407,7 +404,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 9 unmodified lines | ||
| 407 | 404 | |
| 408 | 405 | // Buffer should not go negative. |
| 409 | 406 | ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame " |
| 410 | − << pkt->data.frame.pts; | |
| 407 | + << pkt->data.frame.pts; | |
| 411 | 408 | |
| 412 | 409 | const size_t frame_size_in_bits = pkt->data.frame.sz * 8; |
| 413 | 410 | |
| @@ -425,7 +422,7 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest, · 11 unmodified lines | ||
| 425 | 422 | |
| 426 | 423 | virtual void EndPassHook(void) { |
| 427 | 424 | for (int layer = 0; layer < static_cast<int>(cfg_.ts_number_layers); |
| 428 | − ++layer) { | |
| 425 | + ++layer) { | |
| 429 | 426 | duration_ = (last_pts_ + 1) * timebase_; |
| 430 | 427 | if (bits_total_[layer]) { |
| 431 | 428 | // Effective file datarate: |
| @@ -546,7 +543,7 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting444) { · 114 unmodified lines | ||
| 546 | 543 | ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate), |
| 547 | 544 | effective_datarate_[0] * 1.15) |
| 548 | 545 | << " The datarate for the file missed the target!" |
| 549 | − << cfg_.rc_target_bitrate << " "<< effective_datarate_; | |
| 546 | + << cfg_.rc_target_bitrate << " " << effective_datarate_; | |
| 550 | 547 | } |
| 551 | 548 | } |
| 552 | 549 | |
| @@ -616,8 +613,7 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting2TemporalLayers) { · 63 unmodified lines | ||
| 616 | 613 | |
| 617 | 614 | cfg_.temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS; |
| 618 | 615 | |
| 619 | − if (deadline_ == VPX_DL_REALTIME) | |
| 620 | − cfg_.g_error_resilient = 1; | |
| 616 | + if (deadline_ == VPX_DL_REALTIME) cfg_.g_error_resilient = 1; | |
| 621 | 617 | |
| 622 | 618 | ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, |
| 623 | 619 | 30, 1, 0, 200); |
| @@ -631,10 +627,12 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting2TemporalLayers) { · 7 unmodified lines | ||
| 631 | 627 | for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) { |
| 632 | 628 | ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.85) |
| 633 | 629 | << " The datarate for the file is lower than target by too much, " |
| 634 | − "for layer: " << j; | |
| 630 | + "for layer: " | |
| 631 | + << j; | |
| 635 | 632 | ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.15) |
| 636 | 633 | << " The datarate for the file is greater than target by too much, " |
| 637 | − "for layer: " << j; | |
| 634 | + "for layer: " | |
| 635 | + << j; | |
| 638 | 636 | } |
| 639 | 637 | } |
| 640 | 638 | } |
| @@ -674,12 +672,14 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayers) { · 33 unmodified lines | ||
| 674 | 672 | // Adjust the thresholds to be tighter than .75. |
| 675 | 673 | ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.75) |
| 676 | 674 | << " The datarate for the file is lower than target by too much, " |
| 677 | − "for layer: " << j; | |
| 675 | + "for layer: " | |
| 676 | + << j; | |
| 678 | 677 | // TODO(yaowu): Work out more stable rc control strategy and |
| 679 | 678 | // Adjust the thresholds to be tighter than 1.25. |
| 680 | 679 | ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.25) |
| 681 | 680 | << " The datarate for the file is greater than target by too much, " |
| 682 | − "for layer: " << j; | |
| 681 | + "for layer: " | |
| 682 | + << j; | |
| 683 | 683 | } |
| 684 | 684 | } |
| 685 | 685 | } |
| @@ -719,10 +719,12 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayersFrameDropping) { · 33 unmodified lines | ||
| 719 | 719 | for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) { |
| 720 | 720 | ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.85) |
| 721 | 721 | << " The datarate for the file is lower than target by too much, " |
| 722 | − "for layer: " << j; | |
| 722 | + "for layer: " | |
| 723 | + << j; | |
| 723 | 724 | ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.15) |
| 724 | 725 | << " The datarate for the file is greater than target by too much, " |
| 725 | − "for layer: " << j; | |
| 726 | + "for layer: " | |
| 727 | + << j; | |
| 726 | 728 | // Expect some frame drops in this test: for this 200 frames test, |
| 727 | 729 | // expect at least 10% and not more than 60% drops. |
| 728 | 730 | ASSERT_GE(num_drops_, 20); |
| @@ -792,11 +794,13 @@ TEST_P(DatarateTestVP9Large, DenoiserOffOn) { · 63 unmodified lines | ||
| 792 | 794 | } |
| 793 | 795 | #endif // CONFIG_VP9_TEMPORAL_DENOISING |
| 794 | 796 | |
| 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> { | |
| 797 | 800 | public: |
| 798 | 801 | DatarateOnePassCbrSvc() : EncoderTest(GET_PARAM(0)) {} |
| 799 | 802 | virtual ~DatarateOnePassCbrSvc() {} |
| 803 | + | |
| 800 | 804 | protected: |
| 801 | 805 | virtual void SetUp() { |
| 802 | 806 | InitializeConfig(); |
| @@ -814,8 +818,7 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest, · 11 unmodified lines | ||
| 814 | 818 | mismatch_psnr_ = 0.0; |
| 815 | 819 | mismatch_nframes_ = 0; |
| 816 | 820 | } |
| 817 | − virtual void BeginPassHook(unsigned int /*pass*/) { | |
| 818 | − } | |
| 821 | + virtual void BeginPassHook(unsigned int /*pass*/) {} | |
| 819 | 822 | virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video, |
| 820 | 823 | ::libvpx_test::Encoder *encoder) { |
| 821 | 824 | if (video->frame() == 0) { |
| @@ -837,21 +840,19 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest, · 15 unmodified lines | ||
| 837 | 840 | } |
| 838 | 841 | virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) { |
| 839 | 842 | 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; | |
| 842 | 844 | bits_in_buffer_model_ += static_cast<int64_t>( |
| 843 | 845 | 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; | |
| 846 | 848 | if (!key_frame) { |
| 847 | 849 | ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame " |
| 848 | − << pkt->data.frame.pts; | |
| 850 | + << pkt->data.frame.pts; | |
| 849 | 851 | } |
| 850 | 852 | const size_t frame_size_in_bits = pkt->data.frame.sz * 8; |
| 851 | 853 | bits_in_buffer_model_ -= frame_size_in_bits; |
| 852 | 854 | 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; | |
| 855 | 856 | last_pts_ = pkt->data.frame.pts; |
| 856 | 857 | bits_in_last_frame_ = frame_size_in_bits; |
| 857 | 858 | ++frame_number_; |
| @@ -864,16 +865,13 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest, · 6 unmodified lines | ||
| 864 | 865 | } |
| 865 | 866 | } |
| 866 | 867 | |
| 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) { | |
| 869 | 869 | double mismatch_psnr = compute_psnr(img1, img2); |
| 870 | 870 | mismatch_psnr_ += mismatch_psnr; |
| 871 | 871 | ++mismatch_nframes_; |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | − unsigned int GetMismatchFrames() { | |
| 875 | − return mismatch_nframes_; | |
| 876 | − } | |
| 874 | + unsigned int GetMismatchFrames() { return mismatch_nframes_; } | |
| 877 | 875 | |
| 878 | 876 | vpx_codec_pts_t last_pts_; |
| 879 | 877 | int64_t bits_in_buffer_model_; |
| @@ -890,37 +888,31 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest, · 10 unmodified lines | ||
| 890 | 888 | int mismatch_nframes_; |
| 891 | 889 | }; |
| 892 | 890 | 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) { | |
| 897 | 894 | int sl, spatial_layer_target; |
| 898 | 895 | float total = 0; |
| 899 | − float alloc_ratio[VPX_MAX_LAYERS] = {0}; | |
| 896 | + float alloc_ratio[VPX_MAX_LAYERS] = { 0 }; | |
| 900 | 897 | for (sl = 0; sl < spatial_layers; ++sl) { |
| 901 | 898 | 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]); | |
| 904 | 901 | total += alloc_ratio[sl]; |
| 905 | 902 | } |
| 906 | 903 | } |
| 907 | 904 | for (sl = 0; sl < spatial_layers; ++sl) { |
| 908 | 905 | 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); | |
| 911 | 907 | const int index = sl * temporal_layers; |
| 912 | 908 | 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; | |
| 915 | 910 | enc_cfg->layer_target_bitrate[index + 1] = |
| 916 | 911 | (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; | |
| 919 | 913 | } 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; | |
| 924 | 916 | } |
| 925 | 917 | } |
| 926 | 918 | } |
| @@ -957,10 +949,10 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers) { · 30 unmodified lines | ||
| 957 | 949 | cfg_.rc_target_bitrate = i; |
| 958 | 950 | ResetModel(); |
| 959 | 951 | 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); | |
| 961 | 953 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 962 | 954 | 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!"; | |
| 964 | 956 | ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15) |
| 965 | 957 | << " The datarate for the file is lower than the target by too much!"; |
| 966 | 958 | EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); |
| @@ -999,10 +991,10 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayersSmallKf) { · 32 unmodified lines | ||
| 999 | 991 | cfg_.kf_max_dist = j; |
| 1000 | 992 | ResetModel(); |
| 1001 | 993 | 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); | |
| 1003 | 995 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 1004 | 996 | 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!"; | |
| 1006 | 998 | ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15) |
| 1007 | 999 | << " The datarate for the file is lower than the target by too much!"; |
| 1008 | 1000 | EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); |
| @@ -1033,15 +1025,15 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers4threads) { · 24 unmodified lines | ||
| 1033 | 1025 | svc_params_.scaling_factor_den[1] = 288; |
| 1034 | 1026 | cfg_.rc_dropframe_thresh = 10; |
| 1035 | 1027 | 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); | |
| 1038 | 1030 | cfg_.rc_target_bitrate = 800; |
| 1039 | 1031 | ResetModel(); |
| 1040 | 1032 | 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); | |
| 1042 | 1034 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 1043 | 1035 | 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!"; | |
| 1045 | 1037 | ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15) |
| 1046 | 1038 | << " The datarate for the file is lower than the target by too much!"; |
| 1047 | 1039 | EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); |
| @@ -1073,15 +1065,15 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers) { · 25 unmodified lines | ||
| 1073 | 1065 | svc_params_.scaling_factor_den[2] = 288; |
| 1074 | 1066 | cfg_.rc_dropframe_thresh = 10; |
| 1075 | 1067 | 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); | |
| 1078 | 1070 | cfg_.rc_target_bitrate = 800; |
| 1079 | 1071 | ResetModel(); |
| 1080 | 1072 | 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); | |
| 1082 | 1074 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 1083 | 1075 | 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!"; | |
| 1085 | 1077 | ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.22) |
| 1086 | 1078 | << " The datarate for the file is lower than the target by too much!"; |
| 1087 | 1079 | EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); |
| @@ -1112,8 +1104,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) { · 24 unmodified lines | ||
| 1112 | 1104 | svc_params_.scaling_factor_num[2] = 288; |
| 1113 | 1105 | svc_params_.scaling_factor_den[2] = 288; |
| 1114 | 1106 | 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); | |
| 1117 | 1109 | cfg_.rc_target_bitrate = 800; |
| 1118 | 1110 | // For this 3 temporal layer case, pattern repeats every 4 frames, so choose |
| 1119 | 1111 | // 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 | ||
| 1121 | 1113 | cfg_.kf_max_dist = j; |
| 1122 | 1114 | ResetModel(); |
| 1123 | 1115 | 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); | |
| 1125 | 1117 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 1126 | 1118 | 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!"; | |
| 1128 | 1120 | ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.30) |
| 1129 | 1121 | << " The datarate for the file is lower than the target by too much!"; |
| 1130 | 1122 | EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); |
| @@ -1157,15 +1149,15 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers4threads) { · 26 unmodified lines | ||
| 1157 | 1149 | svc_params_.scaling_factor_den[2] = 288; |
| 1158 | 1150 | cfg_.rc_dropframe_thresh = 10; |
| 1159 | 1151 | 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); | |
| 1162 | 1154 | cfg_.rc_target_bitrate = 800; |
| 1163 | 1155 | ResetModel(); |
| 1164 | 1156 | 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); | |
| 1166 | 1158 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 1167 | 1159 | 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!"; | |
| 1169 | 1161 | ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.22) |
| 1170 | 1162 | << " The datarate for the file is lower than the target by too much!"; |
| 1171 | 1163 | EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); |
| @@ -54,16 +54,16 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 53 unmodified lines | ||
| 54 | 54 | double temp1, temp2; |
| 55 | 55 | |
| 56 | 56 | // 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]; | |
| 67 | 67 | step[10] = input[5] - input[10]; |
| 68 | 68 | step[11] = input[4] - input[11]; |
| 69 | 69 | step[12] = input[3] - input[12]; |
| @@ -81,13 +81,13 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 11 unmodified lines | ||
| 81 | 81 | output[6] = step[1] - step[6]; |
| 82 | 82 | output[7] = step[0] - step[7]; |
| 83 | 83 | |
| 84 | − temp1 = step[ 8] * C7; | |
| 84 | + temp1 = step[8] * C7; | |
| 85 | 85 | temp2 = step[15] * C9; |
| 86 | − output[ 8] = temp1 + temp2; | |
| 86 | + output[8] = temp1 + temp2; | |
| 87 | 87 | |
| 88 | − temp1 = step[ 9] * C11; | |
| 88 | + temp1 = step[9] * C11; | |
| 89 | 89 | temp2 = step[14] * C5; |
| 90 | − output[ 9] = temp1 - temp2; | |
| 90 | + output[9] = temp1 - temp2; | |
| 91 | 91 | |
| 92 | 92 | temp1 = step[10] * C3; |
| 93 | 93 | temp2 = step[13] * C13; |
| @@ -105,40 +105,40 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 11 unmodified lines | ||
| 105 | 105 | temp2 = step[13] * C3; |
| 106 | 106 | output[13] = temp2 - temp1; |
| 107 | 107 | |
| 108 | − temp1 = step[ 9] * C5; | |
| 108 | + temp1 = step[9] * C5; | |
| 109 | 109 | temp2 = step[14] * C11; |
| 110 | 110 | output[14] = temp2 + temp1; |
| 111 | 111 | |
| 112 | − temp1 = step[ 8] * C9; | |
| 112 | + temp1 = step[8] * C9; | |
| 113 | 113 | temp2 = step[15] * C7; |
| 114 | 114 | output[15] = temp2 - temp1; |
| 115 | 115 | |
| 116 | 116 | // 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]; | |
| 121 | 121 | |
| 122 | 122 | temp1 = output[4] * C14; |
| 123 | 123 | temp2 = output[7] * C2; |
| 124 | − step[ 4] = temp1 + temp2; | |
| 124 | + step[4] = temp1 + temp2; | |
| 125 | 125 | |
| 126 | 126 | temp1 = output[5] * C10; |
| 127 | 127 | temp2 = output[6] * C6; |
| 128 | − step[ 5] = temp1 + temp2; | |
| 128 | + step[5] = temp1 + temp2; | |
| 129 | 129 | |
| 130 | 130 | temp1 = output[5] * C6; |
| 131 | 131 | temp2 = output[6] * C10; |
| 132 | − step[ 6] = temp2 - temp1; | |
| 132 | + step[6] = temp2 - temp1; | |
| 133 | 133 | |
| 134 | 134 | temp1 = output[4] * C2; |
| 135 | 135 | temp2 = output[7] * C14; |
| 136 | − step[ 7] = temp2 - temp1; | |
| 136 | + step[7] = temp2 - temp1; | |
| 137 | 137 | |
| 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]; | |
| 142 | 142 | |
| 143 | 143 | step[12] = output[12] + output[15]; |
| 144 | 144 | step[13] = output[13] + output[14]; |
| @@ -146,25 +146,25 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 1 unmodified line | ||
| 146 | 146 | step[15] = output[12] - output[15]; |
| 147 | 147 | |
| 148 | 148 | // 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]); | |
| 151 | 151 | |
| 152 | 152 | temp1 = step[2] * C12; |
| 153 | 153 | temp2 = step[3] * C4; |
| 154 | 154 | temp1 = temp1 + temp2; |
| 155 | − output[ 4] = 2*(temp1 * C8); | |
| 155 | + output[4] = 2 * (temp1 * C8); | |
| 156 | 156 | |
| 157 | 157 | temp1 = step[2] * C4; |
| 158 | 158 | temp2 = step[3] * C12; |
| 159 | 159 | temp1 = temp2 - temp1; |
| 160 | 160 | output[12] = 2 * (temp1 * C8); |
| 161 | 161 | |
| 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); | |
| 164 | 164 | |
| 165 | 165 | temp1 = step[4] - step[5]; |
| 166 | 166 | temp2 = step[6] + step[7]; |
| 167 | − output[ 6] = (temp1 + temp2); | |
| 167 | + output[6] = (temp1 + temp2); | |
| 168 | 168 | output[10] = (temp1 - temp2); |
| 169 | 169 | |
| 170 | 170 | intermediate[8] = step[8] + step[14]; |
| @@ -180,18 +180,18 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 9 unmodified lines | ||
| 180 | 180 | temp1 = temp2 + temp1; |
| 181 | 181 | output[13] = 2 * (temp1 * C8); |
| 182 | 182 | |
| 183 | − output[ 9] = 2 * ((step[10] + step[11]) * C8); | |
| 183 | + output[9] = 2 * ((step[10] + step[11]) * C8); | |
| 184 | 184 | |
| 185 | 185 | intermediate[11] = step[10] - step[11]; |
| 186 | 186 | intermediate[12] = step[12] + step[13]; |
| 187 | 187 | 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]; | |
| 190 | 190 | |
| 191 | 191 | output[15] = (intermediate[11] + intermediate[12]); |
| 192 | − output[ 1] = -(intermediate[11] - intermediate[12]); | |
| 192 | + output[1] = -(intermediate[11] - intermediate[12]); | |
| 193 | 193 | |
| 194 | − output[ 7] = 2 * (intermediate[13] * C8); | |
| 194 | + output[7] = 2 * (intermediate[13] * C8); | |
| 195 | 195 | |
| 196 | 196 | temp1 = intermediate[14] * C12; |
| 197 | 197 | temp2 = intermediate[15] * C4; |
| @@ -201,28 +201,24 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) { · 3 unmodified lines | ||
| 201 | 201 | temp1 = intermediate[14] * C4; |
| 202 | 202 | temp2 = intermediate[15] * C12; |
| 203 | 203 | temp1 = temp2 + temp1; |
| 204 | − output[ 5] = 2 * (temp1 * C8); | |
| 204 | + output[5] = 2 * (temp1 * C8); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | void reference_16x16_dct_2d(int16_t input[256], double output[256]) { |
| 208 | 208 | // First transform columns |
| 209 | 209 | for (int i = 0; i < 16; ++i) { |
| 210 | 210 | 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]; | |
| 213 | 212 | 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]; | |
| 216 | 214 | } |
| 217 | 215 | // Then transform rows |
| 218 | 216 | for (int i = 0; i < 16; ++i) { |
| 219 | 217 | 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]; | |
| 222 | 219 | butterfly_16x16_dct_1d(temp_in, temp_out); |
| 223 | 220 | // 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; | |
| 226 | 222 | } |
| 227 | 223 | } |
| 228 | 224 | |
| @@ -248,8 +244,7 @@ void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, · 19 unmodified lines | ||
| 248 | 244 | vpx_idct16x16_256_add_c(in, dest, stride); |
| 249 | 245 | } |
| 250 | 246 | |
| 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) { | |
| 253 | 248 | vp9_fht16x16_c(in, out, stride, tx_type); |
| 254 | 249 | } |
| 255 | 250 | |
| @@ -351,11 +346,10 @@ class Trans16x16TestBase { · 95 unmodified lines | ||
| 351 | 346 | } |
| 352 | 347 | } |
| 353 | 348 | |
| 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_)); | |
| 356 | 351 | 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_)); | |
| 359 | 353 | #if CONFIG_VP9_HIGHBITDEPTH |
| 360 | 354 | } else { |
| 361 | 355 | ASM_REGISTER_STATE_CHECK( |
| @@ -366,18 +360,17 @@ class Trans16x16TestBase { · 4 unmodified lines | ||
| 366 | 360 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 367 | 361 | #if CONFIG_VP9_HIGHBITDEPTH |
| 368 | 362 | 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]; | |
| 370 | 364 | #else |
| 371 | 365 | const int32_t diff = dst[j] - src[j]; |
| 372 | 366 | #endif |
| 373 | 367 | const uint32_t error = diff * diff; |
| 374 | − if (max_error < error) | |
| 375 | − max_error = error; | |
| 368 | + if (max_error < error) max_error = error; | |
| 376 | 369 | total_error += error; |
| 377 | 370 | } |
| 378 | 371 | } |
| 379 | 372 | |
| 380 | − EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error) | |
| 373 | + EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error) | |
| 381 | 374 | << "Error: 16x16 FHT/IHT has an individual round trip error > 1"; |
| 382 | 375 | |
| 383 | 376 | EXPECT_GE(count_test_block << 2 * (bit_depth_ - 8), total_error) |
| @@ -418,16 +411,14 @@ class Trans16x16TestBase { · 34 unmodified lines | ||
| 418 | 411 | input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; |
| 419 | 412 | } |
| 420 | 413 | 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_; | |
| 423 | 415 | } 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_; | |
| 426 | 417 | } |
| 427 | 418 | |
| 428 | 419 | 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_)); | |
| 431 | 422 | |
| 432 | 423 | // The minimum quant value is 4. |
| 433 | 424 | for (int j = 0; j < kNumCoeffs; ++j) { |
| @@ -457,11 +448,9 @@ class Trans16x16TestBase { · 23 unmodified lines | ||
| 457 | 448 | input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; |
| 458 | 449 | } |
| 459 | 450 | 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_; | |
| 462 | 452 | 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_; | |
| 465 | 454 | |
| 466 | 455 | fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_); |
| 467 | 456 | |
| @@ -484,17 +473,15 @@ class Trans16x16TestBase { · 16 unmodified lines | ||
| 484 | 473 | } else { |
| 485 | 474 | inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_, |
| 486 | 475 | 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_)); | |
| 489 | 478 | #endif |
| 490 | 479 | } |
| 491 | 480 | 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]); | |
| 494 | 482 | #if CONFIG_VP9_HIGHBITDEPTH |
| 495 | 483 | } 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]); | |
| 498 | 485 | #endif |
| 499 | 486 | } |
| 500 | 487 | } |
| @@ -538,8 +525,8 @@ class Trans16x16TestBase { · 37 unmodified lines | ||
| 538 | 525 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16)); |
| 539 | 526 | #if CONFIG_VP9_HIGHBITDEPTH |
| 540 | 527 | } 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)); | |
| 543 | 530 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 544 | 531 | } |
| 545 | 532 | |
| @@ -551,9 +538,8 @@ class Trans16x16TestBase { · 5 unmodified lines | ||
| 551 | 538 | const uint32_t diff = dst[j] - src[j]; |
| 552 | 539 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 553 | 540 | 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; | |
| 557 | 543 | } |
| 558 | 544 | } |
| 559 | 545 | } |
| @@ -595,8 +581,8 @@ class Trans16x16TestBase { · 35 unmodified lines | ||
| 595 | 581 | } else { |
| 596 | 582 | #if CONFIG_VP9_HIGHBITDEPTH |
| 597 | 583 | 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_)); | |
| 600 | 586 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 601 | 587 | } |
| 602 | 588 | |
| @@ -608,9 +594,8 @@ class Trans16x16TestBase { · 5 unmodified lines | ||
| 608 | 594 | const uint32_t diff = dst[j] - ref[j]; |
| 609 | 595 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 610 | 596 | 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; | |
| 614 | 599 | } |
| 615 | 600 | } |
| 616 | 601 | } |
| @@ -623,32 +608,25 @@ class Trans16x16TestBase { · 6 unmodified lines | ||
| 623 | 608 | IhtFunc inv_txfm_ref; |
| 624 | 609 | }; |
| 625 | 610 | |
| 626 | −class Trans16x16DCT | |
| 627 | − : public Trans16x16TestBase, | |
| 628 | − public ::testing::TestWithParam<Dct16x16Param> { | |
| 611 | +class Trans16x16DCT : public Trans16x16TestBase, | |
| 612 | + public ::testing::TestWithParam<Dct16x16Param> { | |
| 629 | 613 | public: |
| 630 | 614 | virtual ~Trans16x16DCT() {} |
| 631 | 615 | |
| 632 | 616 | virtual void SetUp() { |
| 633 | 617 | fwd_txfm_ = GET_PARAM(0); |
| 634 | 618 | inv_txfm_ = GET_PARAM(1); |
| 635 | − tx_type_ = GET_PARAM(2); | |
| 619 | + tx_type_ = GET_PARAM(2); | |
| 636 | 620 | bit_depth_ = GET_PARAM(3); |
| 637 | − pitch_ = 16; | |
| 621 | + pitch_ = 16; | |
| 638 | 622 | fwd_txfm_ref = fdct16x16_ref; |
| 639 | 623 | inv_txfm_ref = idct16x16_ref; |
| 640 | 624 | mask_ = (1 << bit_depth_) - 1; |
| 641 | 625 | #if CONFIG_VP9_HIGHBITDEPTH |
| 642 | 626 | 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; | |
| 652 | 630 | } |
| 653 | 631 | #else |
| 654 | 632 | inv_txfm_ref = idct16x16_ref; |
| @@ -668,17 +646,11 @@ class Trans16x16DCT · 13 unmodified lines | ||
| 668 | 646 | IdctFunc inv_txfm_; |
| 669 | 647 | }; |
| 670 | 648 | |
| 671 | −TEST_P(Trans16x16DCT, AccuracyCheck) { | |
| 672 | − RunAccuracyCheck(); | |
| 673 | −} | |
| 649 | +TEST_P(Trans16x16DCT, AccuracyCheck) { RunAccuracyCheck(); } | |
| 674 | 650 | |
| 675 | −TEST_P(Trans16x16DCT, CoeffCheck) { | |
| 676 | − RunCoeffCheck(); | |
| 677 | −} | |
| 651 | +TEST_P(Trans16x16DCT, CoeffCheck) { RunCoeffCheck(); } | |
| 678 | 652 | |
| 679 | −TEST_P(Trans16x16DCT, MemCheck) { | |
| 680 | − RunMemCheck(); | |
| 681 | −} | |
| 653 | +TEST_P(Trans16x16DCT, MemCheck) { RunMemCheck(); } | |
| 682 | 654 | |
| 683 | 655 | TEST_P(Trans16x16DCT, QuantCheck) { |
| 684 | 656 | // Use maximally allowed quantization step sizes for DC and AC |
| @@ -686,36 +658,27 @@ TEST_P(Trans16x16DCT, QuantCheck) { · 1 unmodified line | ||
| 686 | 658 | RunQuantCheck(1336, 1828); |
| 687 | 659 | } |
| 688 | 660 | |
| 689 | −TEST_P(Trans16x16DCT, InvAccuracyCheck) { | |
| 690 | − RunInvAccuracyCheck(); | |
| 691 | −} | |
| 661 | +TEST_P(Trans16x16DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); } | |
| 692 | 662 | |
| 693 | −class Trans16x16HT | |
| 694 | − : public Trans16x16TestBase, | |
| 695 | − public ::testing::TestWithParam<Ht16x16Param> { | |
| 663 | +class Trans16x16HT : public Trans16x16TestBase, | |
| 664 | + public ::testing::TestWithParam<Ht16x16Param> { | |
| 696 | 665 | public: |
| 697 | 666 | virtual ~Trans16x16HT() {} |
| 698 | 667 | |
| 699 | 668 | virtual void SetUp() { |
| 700 | 669 | fwd_txfm_ = GET_PARAM(0); |
| 701 | 670 | inv_txfm_ = GET_PARAM(1); |
| 702 | − tx_type_ = GET_PARAM(2); | |
| 671 | + tx_type_ = GET_PARAM(2); | |
| 703 | 672 | bit_depth_ = GET_PARAM(3); |
| 704 | − pitch_ = 16; | |
| 673 | + pitch_ = 16; | |
| 705 | 674 | fwd_txfm_ref = fht16x16_ref; |
| 706 | 675 | inv_txfm_ref = iht16x16_ref; |
| 707 | 676 | mask_ = (1 << bit_depth_) - 1; |
| 708 | 677 | #if CONFIG_VP9_HIGHBITDEPTH |
| 709 | 678 | 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; | |
| 719 | 682 | } |
| 720 | 683 | #else |
| 721 | 684 | inv_txfm_ref = iht16x16_ref; |
| @@ -735,17 +698,11 @@ class Trans16x16HT · 13 unmodified lines | ||
| 735 | 698 | IhtFunc inv_txfm_; |
| 736 | 699 | }; |
| 737 | 700 | |
| 738 | −TEST_P(Trans16x16HT, AccuracyCheck) { | |
| 739 | − RunAccuracyCheck(); | |
| 740 | −} | |
| 701 | +TEST_P(Trans16x16HT, AccuracyCheck) { RunAccuracyCheck(); } | |
| 741 | 702 | |
| 742 | −TEST_P(Trans16x16HT, CoeffCheck) { | |
| 743 | − RunCoeffCheck(); | |
| 744 | −} | |
| 703 | +TEST_P(Trans16x16HT, CoeffCheck) { RunCoeffCheck(); } | |
| 745 | 704 | |
| 746 | −TEST_P(Trans16x16HT, MemCheck) { | |
| 747 | − RunMemCheck(); | |
| 748 | −} | |
| 705 | +TEST_P(Trans16x16HT, MemCheck) { RunMemCheck(); } | |
| 749 | 706 | |
| 750 | 707 | TEST_P(Trans16x16HT, QuantCheck) { |
| 751 | 708 | // The encoder skips any non-DC intra prediction modes, |
| @@ -753,9 +710,8 @@ TEST_P(Trans16x16HT, QuantCheck) { · 1 unmodified line | ||
| 753 | 710 | RunQuantCheck(429, 729); |
| 754 | 711 | } |
| 755 | 712 | |
| 756 | −class InvTrans16x16DCT | |
| 757 | − : public Trans16x16TestBase, | |
| 758 | − public ::testing::TestWithParam<Idct16x16Param> { | |
| 713 | +class InvTrans16x16DCT : public Trans16x16TestBase, | |
| 714 | + public ::testing::TestWithParam<Idct16x16Param> { | |
| 759 | 715 | public: |
| 760 | 716 | virtual ~InvTrans16x16DCT() {} |
| 761 | 717 | |
| @@ -766,7 +722,7 @@ class InvTrans16x16DCT · 4 unmodified lines | ||
| 766 | 722 | bit_depth_ = GET_PARAM(3); |
| 767 | 723 | pitch_ = 16; |
| 768 | 724 | mask_ = (1 << bit_depth_) - 1; |
| 769 | −} | |
| 725 | + } | |
| 770 | 726 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 771 | 727 | |
| 772 | 728 | protected: |
| @@ -784,9 +740,8 @@ TEST_P(InvTrans16x16DCT, CompareReference) { · 11 unmodified lines | ||
| 784 | 740 | CompareInvReference(ref_txfm_, thresh_); |
| 785 | 741 | } |
| 786 | 742 | |
| 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> > { | |
| 790 | 745 | public: |
| 791 | 746 | virtual ~PartialTrans16x16Test() {} |
| 792 | 747 | virtual void SetUp() { |
| @@ -855,10 +810,10 @@ INSTANTIATE_TEST_CASE_P( · 62 unmodified lines | ||
| 855 | 810 | make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12), |
| 856 | 811 | make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8))); |
| 857 | 812 | #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))); | |
| 862 | 817 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 863 | 818 | |
| 864 | 819 | #if CONFIG_VP9_HIGHBITDEPTH |
| @@ -898,28 +853,25 @@ INSTANTIATE_TEST_CASE_P(C, PartialTrans16x16Test, · 33 unmodified lines | ||
| 898 | 853 | #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 899 | 854 | INSTANTIATE_TEST_CASE_P( |
| 900 | 855 | 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))); | |
| 904 | 858 | #endif |
| 905 | 859 | |
| 906 | 860 | #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 907 | 861 | INSTANTIATE_TEST_CASE_P( |
| 908 | 862 | 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))); | |
| 912 | 865 | INSTANTIATE_TEST_CASE_P( |
| 913 | 866 | 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))); | |
| 923 | 875 | INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test, |
| 924 | 876 | ::testing::Values(make_tuple(&vpx_fdct16x16_1_sse2, |
| 925 | 877 | VPX_BITS_8))); |
| @@ -929,16 +881,14 @@ INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test, · 3 unmodified lines | ||
| 929 | 881 | INSTANTIATE_TEST_CASE_P( |
| 930 | 882 | SSE2, Trans16x16DCT, |
| 931 | 883 | ::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))); | |
| 942 | 892 | INSTANTIATE_TEST_CASE_P( |
| 943 | 893 | SSE2, Trans16x16HT, |
| 944 | 894 | ::testing::Values( |
| @@ -951,26 +901,24 @@ INSTANTIATE_TEST_CASE_P( · 6 unmodified lines | ||
| 951 | 901 | // that to test both branches. |
| 952 | 902 | INSTANTIATE_TEST_CASE_P( |
| 953 | 903 | 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))); | |
| 963 | 912 | INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test, |
| 964 | 913 | ::testing::Values(make_tuple(&vpx_fdct16x16_1_sse2, |
| 965 | 914 | VPX_BITS_8))); |
| 966 | 915 | #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 967 | 916 | |
| 968 | 917 | #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))); | |
| 974 | 922 | INSTANTIATE_TEST_CASE_P( |
| 975 | 923 | MSA, Trans16x16HT, |
| 976 | 924 | ::testing::Values( |
| @@ -39,8 +39,7 @@ void reference_32x32_dct_1d(const double in[32], double out[32]) { · 38 unmodified lines | ||
| 39 | 39 | out[k] = 0.0; |
| 40 | 40 | for (int n = 0; n < 32; n++) |
| 41 | 41 | 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; | |
| 44 | 43 | } |
| 45 | 44 | } |
| 46 | 45 | |
| @@ -49,21 +48,17 @@ void reference_32x32_dct_2d(const int16_t input[kNumCoeffs], · 2 unmodified lines | ||
| 49 | 48 | // First transform columns |
| 50 | 49 | for (int i = 0; i < 32; ++i) { |
| 51 | 50 | 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]; | |
| 54 | 52 | 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]; | |
| 57 | 54 | } |
| 58 | 55 | // Then transform rows |
| 59 | 56 | for (int i = 0; i < 32; ++i) { |
| 60 | 57 | 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]; | |
| 63 | 59 | reference_32x32_dct_1d(temp_in, temp_out); |
| 64 | 60 | // 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; | |
| 67 | 62 | } |
| 68 | 63 | } |
| 69 | 64 | |
| @@ -89,8 +84,8 @@ class Trans32x32Test : public ::testing::TestWithParam<Trans32x32Param> { · 19 unmodified lines | ||
| 89 | 84 | virtual void SetUp() { |
| 90 | 85 | fwd_txfm_ = GET_PARAM(0); |
| 91 | 86 | 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 | |
| 94 | 89 | bit_depth_ = GET_PARAM(3); |
| 95 | 90 | mask_ = (1 << bit_depth_) - 1; |
| 96 | 91 | } |
| @@ -140,8 +135,8 @@ TEST_P(Trans32x32Test, AccuracyCheck) { · 43 unmodified lines | ||
| 140 | 135 | ASM_REGISTER_STATE_CHECK(inv_txfm_(test_temp_block, dst, 32)); |
| 141 | 136 | #if CONFIG_VP9_HIGHBITDEPTH |
| 142 | 137 | } 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)); | |
| 145 | 140 | #endif |
| 146 | 141 | } |
| 147 | 142 | |
| @@ -153,8 +148,7 @@ TEST_P(Trans32x32Test, AccuracyCheck) { · 5 unmodified lines | ||
| 153 | 148 | const int32_t diff = dst[j] - src[j]; |
| 154 | 149 | #endif |
| 155 | 150 | const uint32_t error = diff * diff; |
| 156 | − if (max_error < error) | |
| 157 | − max_error = error; | |
| 151 | + if (max_error < error) max_error = error; | |
| 158 | 152 | total_error += error; |
| 159 | 153 | } |
| 160 | 154 | } |
| @@ -213,11 +207,9 @@ TEST_P(Trans32x32Test, MemCheck) { · 52 unmodified lines | ||
| 213 | 207 | input_extreme_block[j] = rnd.Rand8() & 1 ? mask_ : -mask_; |
| 214 | 208 | } |
| 215 | 209 | 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_; | |
| 218 | 211 | } 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_; | |
| 221 | 213 | } |
| 222 | 214 | |
| 223 | 215 | const int stride = 32; |
| @@ -291,9 +283,8 @@ TEST_P(Trans32x32Test, InverseAccuracy) { · 67 unmodified lines | ||
| 291 | 283 | const int diff = dst[j] - src[j]; |
| 292 | 284 | #endif |
| 293 | 285 | 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; | |
| 297 | 288 | } |
| 298 | 289 | } |
| 299 | 290 | } |
| @@ -365,18 +356,13 @@ using std::tr1::make_tuple; · 65 unmodified lines | ||
| 365 | 356 | INSTANTIATE_TEST_CASE_P( |
| 366 | 357 | C, Trans32x32Test, |
| 367 | 358 | ::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))); | |
| 380 | 366 | INSTANTIATE_TEST_CASE_P( |
| 381 | 367 | C, PartialTrans32x32Test, |
| 382 | 368 | ::testing::Values(make_tuple(&vpx_highbd_fdct32x32_1_c, VPX_BITS_8), |
| @@ -385,11 +371,10 @@ INSTANTIATE_TEST_CASE_P( · 2 unmodified lines | ||
| 385 | 371 | #else |
| 386 | 372 | INSTANTIATE_TEST_CASE_P( |
| 387 | 373 | 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))); | |
| 393 | 378 | INSTANTIATE_TEST_CASE_P(C, PartialTrans32x32Test, |
| 394 | 379 | ::testing::Values(make_tuple(&vpx_fdct32x32_1_c, |
| 395 | 380 | VPX_BITS_8))); |
| @@ -398,21 +383,19 @@ INSTANTIATE_TEST_CASE_P(C, PartialTrans32x32Test, · 2 unmodified lines | ||
| 398 | 383 | #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 399 | 384 | INSTANTIATE_TEST_CASE_P( |
| 400 | 385 | 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))); | |
| 406 | 390 | #endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 407 | 391 | |
| 408 | 392 | #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 409 | 393 | INSTANTIATE_TEST_CASE_P( |
| 410 | 394 | 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))); | |
| 416 | 399 | INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans32x32Test, |
| 417 | 400 | ::testing::Values(make_tuple(&vpx_fdct32x32_1_sse2, |
| 418 | 401 | VPX_BITS_8))); |
| @@ -440,21 +423,19 @@ INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans32x32Test, · 21 unmodified lines | ||
| 440 | 423 | #if HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 441 | 424 | INSTANTIATE_TEST_CASE_P( |
| 442 | 425 | 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))); | |
| 448 | 430 | #endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 449 | 431 | |
| 450 | 432 | #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 451 | 433 | INSTANTIATE_TEST_CASE_P( |
| 452 | 434 | 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))); | |
| 458 | 439 | INSTANTIATE_TEST_CASE_P(MSA, PartialTrans32x32Test, |
| 459 | 440 | ::testing::Values(make_tuple(&vpx_fdct32x32_1_msa, |
| 460 | 441 | VPX_BITS_8))); |
| @@ -28,7 +28,7 @@ TEST(DecodeAPI, InvalidParams) { · 27 unmodified lines | ||
| 28 | 28 | &vpx_codec_vp9_dx_algo, |
| 29 | 29 | #endif |
| 30 | 30 | }; |
| 31 | − uint8_t buf[1] = {0}; | |
| 31 | + uint8_t buf[1] = { 0 }; | |
| 32 | 32 | vpx_codec_ctx_t dec; |
| 33 | 33 | |
| 34 | 34 | EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_dec_init(NULL, NULL, NULL, 0)); |
| @@ -51,8 +51,7 @@ TEST(DecodeAPI, InvalidParams) { · 16 unmodified lines | ||
| 51 | 51 | vpx_codec_decode(&dec, buf, NELEMENTS(buf), NULL, 0)); |
| 52 | 52 | EXPECT_EQ(VPX_CODEC_INVALID_PARAM, |
| 53 | 53 | 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)); | |
| 56 | 55 | |
| 57 | 56 | EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec)); |
| 58 | 57 | } |
| @@ -77,12 +76,9 @@ TEST(DecodeAPI, OptionalParams) { · 18 unmodified lines | ||
| 77 | 76 | // Test VP9 codec controls after a decode error to ensure the code doesn't |
| 78 | 77 | // misbehave. |
| 79 | 78 | 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 }; | |
| 86 | 82 | int val[2]; |
| 87 | 83 | |
| 88 | 84 | for (int i = 0; i < NELEMENTS(kControls); ++i) { |
| @@ -91,9 +87,7 @@ void TestVp9Controls(vpx_codec_ctx_t *dec) { · 2 unmodified lines | ||
| 91 | 87 | case VP8D_GET_FRAME_CORRUPTED: |
| 92 | 88 | EXPECT_EQ(VPX_CODEC_ERROR, res) << kControls[i]; |
| 93 | 89 | 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; | |
| 97 | 91 | } |
| 98 | 92 | EXPECT_EQ(VPX_CODEC_INVALID_PARAM, |
| 99 | 93 | vpx_codec_control_(dec, kControls[i], NULL)); |
| @@ -150,10 +144,9 @@ TEST(DecodeAPI, Vp9PeekSI) { · 50 unmodified lines | ||
| 150 | 144 | // size 10, this should return VPX_CODEC_UNSUP_BITSTREAM and after that it |
| 151 | 145 | // should return VPX_CODEC_CORRUPT_FRAME. |
| 152 | 146 | 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, | |
| 157 | 150 | }; |
| 158 | 151 | |
| 159 | 152 | for (uint32_t data_sz = 1; data_sz <= 32; ++data_sz) { |
| @@ -162,9 +155,9 @@ TEST(DecodeAPI, Vp9PeekSI) { · 2 unmodified lines | ||
| 162 | 155 | if (data_sz >= 8) { |
| 163 | 156 | vpx_codec_ctx_t dec; |
| 164 | 157 | 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)); | |
| 168 | 161 | vpx_codec_iter_t iter = NULL; |
| 169 | 162 | EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter)); |
| 170 | 163 | EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec)); |
| @@ -70,8 +70,7 @@ const DecodePerfParam kVP9DecodePerfVectors[] = { · 69 unmodified lines | ||
| 70 | 70 | power/temp/min max frame decode times/etc |
| 71 | 71 | */ |
| 72 | 72 | |
| 73 | −class DecodePerfTest : public ::testing::TestWithParam<DecodePerfParam> { | |
| 74 | −}; | |
| 73 | +class DecodePerfTest : public ::testing::TestWithParam<DecodePerfParam> {}; | |
| 75 | 74 | |
| 76 | 75 | TEST_P(DecodePerfTest, PerfTest) { |
| 77 | 76 | const char *const video_name = GET_PARAM(VIDEO_NAME); |
| @@ -92,8 +91,7 @@ TEST_P(DecodePerfTest, PerfTest) { · 14 unmodified lines | ||
| 92 | 91 | } |
| 93 | 92 | |
| 94 | 93 | 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; | |
| 97 | 95 | const unsigned frames = video.frame_number(); |
| 98 | 96 | const double fps = double(frames) / elapsed_secs; |
| 99 | 97 | |
| @@ -111,17 +109,13 @@ TEST_P(DecodePerfTest, PerfTest) { · 11 unmodified lines | ||
| 111 | 109 | INSTANTIATE_TEST_CASE_P(VP9, DecodePerfTest, |
| 112 | 110 | ::testing::ValuesIn(kVP9DecodePerfVectors)); |
| 113 | 111 | |
| 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> { | |
| 117 | 115 | protected: |
| 118 | 116 | 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) {} | |
| 125 | 119 | |
| 126 | 120 | virtual ~VP9NewEncodeDecodePerfTest() {} |
| 127 | 121 | |
| @@ -182,9 +176,7 @@ class VP9NewEncodeDecodePerfTest : · 54 unmodified lines | ||
| 182 | 176 | |
| 183 | 177 | virtual bool DoDecode() { return false; } |
| 184 | 178 | |
| 185 | − void set_speed(unsigned int speed) { | |
| 186 | − speed_ = speed; | |
| 187 | − } | |
| 179 | + void set_speed(unsigned int speed) { speed_ = speed; } | |
| 188 | 180 | |
| 189 | 181 | private: |
| 190 | 182 | libvpx_test::TestMode encoding_mode_; |
| @@ -196,10 +188,7 @@ class VP9NewEncodeDecodePerfTest : · 5 unmodified lines | ||
| 196 | 188 | struct EncodePerfTestVideo { |
| 197 | 189 | EncodePerfTestVideo(const char *name_, uint32_t width_, uint32_t height_, |
| 198 | 190 | 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_), | |
| 203 | 192 | frames(frames_) {} |
| 204 | 193 | const char *name; |
| 205 | 194 | uint32_t width; |
| @@ -225,10 +214,8 @@ TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) { · 19 unmodified lines | ||
| 225 | 214 | |
| 226 | 215 | const char *video_name = kVP9EncodePerfTestVectors[i].name; |
| 227 | 216 | 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, | |
| 232 | 219 | kVP9EncodePerfTestVectors[i].frames); |
| 233 | 220 | set_speed(2); |
| 234 | 221 | |
| @@ -268,6 +255,6 @@ TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) { · 33 unmodified lines | ||
| 268 | 255 | printf("}\n"); |
| 269 | 256 | } |
| 270 | 257 | |
| 271 | −VP9_INSTANTIATE_TEST_CASE( | |
| 272 | − VP9NewEncodeDecodePerfTest, ::testing::Values(::libvpx_test::kTwoPassGood)); | |
| 258 | +VP9_INSTANTIATE_TEST_CASE(VP9NewEncodeDecodePerfTest, | |
| 259 | + ::testing::Values(::libvpx_test::kTwoPassGood)); | |
| 273 | 260 | } // namespace |
| @@ -21,9 +21,8 @@ const char kVP8Name[] = "WebM Project VP8"; · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | vpx_codec_err_t Decoder::PeekStream(const uint8_t *cxdata, size_t size, |
| 23 | 23 | 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); | |
| 27 | 26 | } |
| 28 | 27 | |
| 29 | 28 | 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 | ||
| 35 | 34 | vpx_codec_err_t res_dec; |
| 36 | 35 | InitOnce(); |
| 37 | 36 | 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)); | |
| 41 | 39 | return res_dec; |
| 42 | 40 | } |
| 43 | 41 | |
| @@ -67,7 +65,7 @@ void DecoderTest::HandlePeekResult(Decoder *const decoder, · 23 unmodified lines | ||
| 67 | 65 | |
| 68 | 66 | void DecoderTest::RunLoop(CompressedVideoSource *video, |
| 69 | 67 | 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); | |
| 71 | 69 | ASSERT_TRUE(decoder != NULL); |
| 72 | 70 | bool end_of_file = false; |
| 73 | 71 | |
| @@ -80,16 +78,14 @@ void DecoderTest::RunLoop(CompressedVideoSource *video, · 6 unmodified lines | ||
| 80 | 78 | stream_info.sz = sizeof(stream_info); |
| 81 | 79 | |
| 82 | 80 | 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); | |
| 86 | 83 | HandlePeekResult(decoder, video, res_peek); |
| 87 | 84 | ASSERT_FALSE(::testing::Test::HasFailure()); |
| 88 | 85 | |
| 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; | |
| 93 | 89 | } else { |
| 94 | 90 | // Signal end of the file to the decoder. |
| 95 | 91 | 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 | ||
| 116 | 112 | memcpy(&cfg_, &dec_cfg, sizeof(cfg_)); |
| 117 | 113 | } |
| 118 | 114 | |
| 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; } | |
| 122 | 116 | |
| 123 | 117 | } // namespace libvpx_test |
| @@ -26,13 +26,11 @@ class DxDataIterator { · 25 unmodified lines | ||
| 26 | 26 | explicit DxDataIterator(vpx_codec_ctx_t *decoder) |
| 27 | 27 | : decoder_(decoder), iter_(NULL) {} |
| 28 | 28 | |
| 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_); } | |
| 32 | 30 | |
| 33 | 31 | 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_; | |
| 36 | 34 | }; |
| 37 | 35 | |
| 38 | 36 | // Provides a simplified interface to manage one video decoding. |
| @@ -47,13 +45,14 @@ class Decoder { · 8 unmodified lines | ||
| 47 | 45 | |
| 48 | 46 | Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag, |
| 49 | 47 | 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) { | |
| 51 | 52 | memset(&decoder_, 0, sizeof(decoder_)); |
| 52 | 53 | } |
| 53 | 54 | |
| 54 | − virtual ~Decoder() { | |
| 55 | − vpx_codec_destroy(&decoder_); | |
| 56 | − } | |
| 55 | + virtual ~Decoder() { vpx_codec_destroy(&decoder_); } | |
| 57 | 56 | |
| 58 | 57 | vpx_codec_err_t PeekStream(const uint8_t *cxdata, size_t size, |
| 59 | 58 | vpx_codec_stream_info_t *stream_info); |
| @@ -63,17 +62,11 @@ class Decoder { · 3 unmodified lines | ||
| 63 | 62 | vpx_codec_err_t DecodeFrame(const uint8_t *cxdata, size_t size, |
| 64 | 63 | void *user_priv); |
| 65 | 64 | |
| 66 | − DxDataIterator GetDxData() { | |
| 67 | − return DxDataIterator(&decoder_); | |
| 68 | − } | |
| 65 | + DxDataIterator GetDxData() { return DxDataIterator(&decoder_); } | |
| 69 | 66 | |
| 70 | − void set_deadline(unsigned long deadline) { | |
| 71 | − deadline_ = deadline; | |
| 72 | − } | |
| 67 | + void set_deadline(unsigned long deadline) { deadline_ = deadline; } | |
| 73 | 68 | |
| 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); } | |
| 77 | 70 | |
| 78 | 71 | void Control(int ctrl_id, const void *arg) { |
| 79 | 72 | InitOnce(); |
| @@ -87,7 +80,7 @@ class Decoder { · 7 unmodified lines | ||
| 87 | 80 | ASSERT_EQ(expected_value, res) << DecodeError(); |
| 88 | 81 | } |
| 89 | 82 | |
| 90 | − const char* DecodeError() { | |
| 83 | + const char *DecodeError() { | |
| 91 | 84 | const char *detail = vpx_codec_error_detail(&decoder_); |
| 92 | 85 | return detail ? detail : vpx_codec_error(&decoder_); |
| 93 | 86 | } |
| @@ -97,38 +90,35 @@ class Decoder { · 3 unmodified lines | ||
| 97 | 90 | vpx_get_frame_buffer_cb_fn_t cb_get, |
| 98 | 91 | vpx_release_frame_buffer_cb_fn_t cb_release, void *user_priv) { |
| 99 | 92 | 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); | |
| 102 | 95 | } |
| 103 | 96 | |
| 104 | − const char* GetDecoderName() const { | |
| 97 | + const char *GetDecoderName() const { | |
| 105 | 98 | return vpx_codec_iface_name(CodecInterface()); |
| 106 | 99 | } |
| 107 | 100 | |
| 108 | 101 | bool IsVP8() const; |
| 109 | 102 | |
| 110 | − vpx_codec_ctx_t * GetDecoder() { | |
| 111 | − return &decoder_; | |
| 112 | − } | |
| 103 | + vpx_codec_ctx_t *GetDecoder() { return &decoder_; } | |
| 113 | 104 | |
| 114 | 105 | protected: |
| 115 | − virtual vpx_codec_iface_t* CodecInterface() const = 0; | |
| 106 | + virtual vpx_codec_iface_t *CodecInterface() const = 0; | |
| 116 | 107 | |
| 117 | 108 | void InitOnce() { |
| 118 | 109 | 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_); | |
| 122 | 112 | ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError(); |
| 123 | 113 | init_done_ = true; |
| 124 | 114 | } |
| 125 | 115 | } |
| 126 | 116 | |
| 127 | − vpx_codec_ctx_t decoder_; | |
| 117 | + vpx_codec_ctx_t decoder_; | |
| 128 | 118 | 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_; | |
| 132 | 122 | }; |
| 133 | 123 | |
| 134 | 124 | // Common test functionality for all Decoder tests. |
| @@ -143,37 +133,35 @@ class DecoderTest { · 8 unmodified lines | ||
| 143 | 133 | virtual void set_flags(const vpx_codec_flags_t flags); |
| 144 | 134 | |
| 145 | 135 | // 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*/) {} | |
| 148 | 138 | |
| 149 | 139 | // Hook to be called to handle decode result. Return true to continue. |
| 150 | 140 | virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec, |
| 151 | − const CompressedVideoSource& /*video*/, | |
| 141 | + const CompressedVideoSource & /*video*/, | |
| 152 | 142 | Decoder *decoder) { |
| 153 | 143 | EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError(); |
| 154 | 144 | return VPX_CODEC_OK == res_dec; |
| 155 | 145 | } |
| 156 | 146 | |
| 157 | 147 | // 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*/, | |
| 159 | 149 | const unsigned int /*frame_number*/) {} |
| 160 | 150 | |
| 161 | 151 | // Hook to be called on peek result |
| 162 | − virtual void HandlePeekResult(Decoder* const decoder, | |
| 152 | + virtual void HandlePeekResult(Decoder *const decoder, | |
| 163 | 153 | CompressedVideoSource *video, |
| 164 | 154 | const vpx_codec_err_t res_peek); |
| 165 | 155 | |
| 166 | 156 | protected: |
| 167 | 157 | explicit DecoderTest(const CodecFactory *codec) |
| 168 | − : codec_(codec), | |
| 169 | − cfg_(), | |
| 170 | − flags_(0) {} | |
| 158 | + : codec_(codec), cfg_(), flags_(0) {} | |
| 171 | 159 | |
| 172 | 160 | virtual ~DecoderTest() {} |
| 173 | 161 | |
| 174 | 162 | const CodecFactory *codec_; |
| 175 | 163 | vpx_codec_dec_cfg_t cfg_; |
| 176 | − vpx_codec_flags_t flags_; | |
| 164 | + vpx_codec_flags_t flags_; | |
| 177 | 165 | }; |
| 178 | 166 | |
| 179 | 167 | } // namespace libvpx_test |
| @@ -27,7 +27,7 @@ TEST(EncodeAPI, InvalidParams) { · 26 unmodified lines | ||
| 27 | 27 | &vpx_codec_vp9_cx_algo, |
| 28 | 28 | #endif |
| 29 | 29 | }; |
| 30 | − uint8_t buf[1] = {0}; | |
| 30 | + uint8_t buf[1] = { 0 }; | |
| 31 | 31 | vpx_image_t img; |
| 32 | 32 | vpx_codec_ctx_t enc; |
| 33 | 33 | vpx_codec_enc_cfg_t cfg; |
| @@ -26,10 +26,7 @@ const double kUsecsInSec = 1000000.0; · 25 unmodified lines | ||
| 26 | 26 | struct EncodePerfTestVideo { |
| 27 | 27 | EncodePerfTestVideo(const char *name_, uint32_t width_, uint32_t height_, |
| 28 | 28 | 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_), | |
| 33 | 30 | frames(frames_) {} |
| 34 | 31 | const char *name; |
| 35 | 32 | uint32_t width; |
| @@ -45,8 +42,8 @@ const EncodePerfTestVideo kVP9EncodePerfTestVectors[] = { · 9 unmodified lines | ||
| 45 | 42 | EncodePerfTestVideo("macmarcostationary_640_480_30.yuv", 640, 480, 200, 718), |
| 46 | 43 | EncodePerfTestVideo("niklas_640_480_30.yuv", 640, 480, 200, 471), |
| 47 | 44 | 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), | |
| 50 | 47 | EncodePerfTestVideo("thaloundeskmtg_640_480_30.yuv", 640, 480, 200, 300), |
| 51 | 48 | EncodePerfTestVideo("niklas_1280_720_30.yuv", 1280, 720, 600, 470), |
| 52 | 49 | }; |
| @@ -61,12 +58,8 @@ class VP9EncodePerfTest · 8 unmodified lines | ||
| 61 | 58 | public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> { |
| 62 | 59 | protected: |
| 63 | 60 | 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) {} | |
| 70 | 63 | |
| 71 | 64 | virtual ~VP9EncodePerfTest() {} |
| 72 | 65 | |
| @@ -107,24 +100,18 @@ class VP9EncodePerfTest · 34 unmodified lines | ||
| 107 | 100 | |
| 108 | 101 | virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) { |
| 109 | 102 | if (pkt->data.psnr.psnr[0] < min_psnr_) { |
| 110 | − min_psnr_= pkt->data.psnr.psnr[0]; | |
| 103 | + min_psnr_ = pkt->data.psnr.psnr[0]; | |
| 111 | 104 | } |
| 112 | 105 | } |
| 113 | 106 | |
| 114 | 107 | // for performance reasons don't decode |
| 115 | 108 | virtual bool DoDecode() { return 0; } |
| 116 | 109 | |
| 117 | − double min_psnr() const { | |
| 118 | − return min_psnr_; | |
| 119 | − } | |
| 110 | + double min_psnr() const { return min_psnr_; } | |
| 120 | 111 | |
| 121 | − void set_speed(unsigned int speed) { | |
| 122 | − speed_ = speed; | |
| 123 | − } | |
| 112 | + void set_speed(unsigned int speed) { speed_ = speed; } | |
| 124 | 113 | |
| 125 | − void set_threads(unsigned int threads) { | |
| 126 | − threads_ = threads; | |
| 127 | − } | |
| 114 | + void set_threads(unsigned int threads) { threads_ = threads; } | |
| 128 | 115 | |
| 129 | 116 | private: |
| 130 | 117 | double min_psnr_; |
| @@ -157,10 +144,8 @@ TEST_P(VP9EncodePerfTest, PerfTest) { · 26 unmodified lines | ||
| 157 | 144 | const unsigned frames = kVP9EncodePerfTestVectors[i].frames; |
| 158 | 145 | const char *video_name = kVP9EncodePerfTestVectors[i].name; |
| 159 | 146 | 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, | |
| 164 | 149 | kVP9EncodePerfTestVectors[i].frames); |
| 165 | 150 | set_speed(kEncodePerfTestSpeeds[j]); |
| 166 | 151 | |
| @@ -197,6 +182,6 @@ TEST_P(VP9EncodePerfTest, PerfTest) { · 30 unmodified lines | ||
| 197 | 182 | } |
| 198 | 183 | } |
| 199 | 184 | |
| 200 | −VP9_INSTANTIATE_TEST_CASE( | |
| 201 | − VP9EncodePerfTest, ::testing::Values(::libvpx_test::kRealTime)); | |
| 185 | +VP9_INSTANTIATE_TEST_CASE(VP9EncodePerfTest, | |
| 186 | + ::testing::Values(::libvpx_test::kRealTime)); | |
| 202 | 187 | } // namespace |
| @@ -30,8 +30,7 @@ void Encoder::InitEncoder(VideoSource *video) { · 29 unmodified lines | ||
| 30 | 30 | cfg_.g_timebase = video->timebase(); |
| 31 | 31 | cfg_.rc_twopass_stats_in = stats_->buf(); |
| 32 | 32 | |
| 33 | − res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_, | |
| 34 | − init_flags_); | |
| 33 | + res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_, init_flags_); | |
| 35 | 34 | ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
| 36 | 35 | |
| 37 | 36 | #if CONFIG_VP9_ENCODER |
| @@ -62,8 +61,7 @@ void Encoder::EncodeFrame(VideoSource *video, const unsigned long frame_flags) { · 24 unmodified lines | ||
| 62 | 61 | CxDataIterator iter = GetCxData(); |
| 63 | 62 | |
| 64 | 63 | 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; | |
| 67 | 65 | |
| 68 | 66 | stats_->Append(*pkt); |
| 69 | 67 | } |
| @@ -83,15 +81,15 @@ void Encoder::EncodeFrameInternal(const VideoSource &video, · 13 unmodified lines | ||
| 83 | 81 | } |
| 84 | 82 | |
| 85 | 83 | // 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_)); | |
| 89 | 87 | ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); |
| 90 | 88 | } |
| 91 | 89 | |
| 92 | 90 | 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_); | |
| 95 | 93 | if (!encoder_.priv) |
| 96 | 94 | ASSERT_EQ(VPX_CODEC_ERROR, res) << EncoderError(); |
| 97 | 95 | else |
| @@ -106,22 +104,15 @@ void EncoderTest::InitializeConfig() { · 8 unmodified lines | ||
| 106 | 104 | |
| 107 | 105 | void EncoderTest::SetMode(TestMode mode) { |
| 108 | 106 | switch (mode) { |
| 109 | − case kRealTime: | |
| 110 | − deadline_ = VPX_DL_REALTIME; | |
| 111 | − break; | |
| 107 | + case kRealTime: deadline_ = VPX_DL_REALTIME; break; | |
| 112 | 108 | |
| 113 | 109 | case kOnePassGood: |
| 114 | − case kTwoPassGood: | |
| 115 | − deadline_ = VPX_DL_GOOD_QUALITY; | |
| 116 | − break; | |
| 110 | + case kTwoPassGood: deadline_ = VPX_DL_GOOD_QUALITY; break; | |
| 117 | 111 | |
| 118 | 112 | case kOnePassBest: |
| 119 | − case kTwoPassBest: | |
| 120 | − deadline_ = VPX_DL_BEST_QUALITY; | |
| 121 | − break; | |
| 113 | + case kTwoPassBest: deadline_ = VPX_DL_BEST_QUALITY; break; | |
| 122 | 114 | |
| 123 | − default: | |
| 124 | − ASSERT_TRUE(false) << "Unexpected mode " << mode; | |
| 115 | + default: ASSERT_TRUE(false) << "Unexpected mode " << mode; | |
| 125 | 116 | } |
| 126 | 117 | |
| 127 | 118 | if (mode == kTwoPassGood || mode == kTwoPassBest) |
| @@ -131,35 +122,35 @@ void EncoderTest::SetMode(TestMode mode) { · 3 unmodified lines | ||
| 131 | 122 | } |
| 132 | 123 | // The function should return "true" most of the time, therefore no early |
| 133 | 124 | // 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; | |
| 142 | 130 | const unsigned int height_y = img1->d_h; |
| 143 | 131 | unsigned int i; |
| 144 | 132 | for (i = 0; i < height_y; ++i) |
| 145 | 133 | match = (memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y], |
| 146 | 134 | 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; | |
| 149 | 138 | 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) | |
| 151 | 140 | match = (memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U], |
| 152 | 141 | img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U], |
| 153 | − width_uv) == 0) && match; | |
| 142 | + width_uv) == 0) && | |
| 143 | + match; | |
| 154 | 144 | for (i = 0; i < height_uv; ++i) |
| 155 | 145 | match = (memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V], |
| 156 | 146 | img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V], |
| 157 | − width_uv) == 0) && match; | |
| 147 | + width_uv) == 0) && | |
| 148 | + match; | |
| 158 | 149 | return match; |
| 159 | 150 | } |
| 160 | 151 | |
| 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*/) { | |
| 163 | 154 | ASSERT_TRUE(0) << "Encode/Decode mismatch found"; |
| 164 | 155 | } |
| 165 | 156 | |
| @@ -215,10 +206,9 @@ void EncoderTest::RunLoop(VideoSource *video) { · 49 unmodified lines | ||
| 215 | 206 | has_cxdata = true; |
| 216 | 207 | if (decoder.get() != NULL && DoDecode()) { |
| 217 | 208 | 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); | |
| 219 | 210 | |
| 220 | − if (!HandleDecodeResult(res_dec, *video, decoder.get())) | |
| 221 | − break; | |
| 211 | + if (!HandleDecodeResult(res_dec, *video, decoder.get())) break; | |
| 222 | 212 | |
| 223 | 213 | has_dxdata = true; |
| 224 | 214 | } |
| @@ -227,20 +217,16 @@ void EncoderTest::RunLoop(VideoSource *video) { · 2 unmodified lines | ||
| 227 | 217 | FramePktHook(pkt); |
| 228 | 218 | break; |
| 229 | 219 | |
| 230 | − case VPX_CODEC_PSNR_PKT: | |
| 231 | − PSNRPktHook(pkt); | |
| 232 | − break; | |
| 220 | + case VPX_CODEC_PSNR_PKT: PSNRPktHook(pkt); break; | |
| 233 | 221 | |
| 234 | − default: | |
| 235 | − break; | |
| 222 | + default: break; | |
| 236 | 223 | } |
| 237 | 224 | } |
| 238 | 225 | |
| 239 | 226 | // Flush the decoder when there are no more fragments. |
| 240 | 227 | if ((init_flags_ & VPX_CODEC_USE_OUTPUT_PARTITION) && has_dxdata) { |
| 241 | 228 | 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; | |
| 244 | 230 | } |
| 245 | 231 | |
| 246 | 232 | if (has_dxdata && has_cxdata) { |
| @@ -253,17 +239,14 @@ void EncoderTest::RunLoop(VideoSource *video) { · 6 unmodified lines | ||
| 253 | 239 | MismatchHook(img_enc, img_dec); |
| 254 | 240 | } |
| 255 | 241 | } |
| 256 | − if (img_dec) | |
| 257 | − DecompressedFrameHook(*img_dec, video->pts()); | |
| 242 | + if (img_dec) DecompressedFrameHook(*img_dec, video->pts()); | |
| 258 | 243 | } |
| 259 | − if (!Continue()) | |
| 260 | − break; | |
| 244 | + if (!Continue()) break; | |
| 261 | 245 | } |
| 262 | 246 | |
| 263 | 247 | EndPassHook(); |
| 264 | 248 | |
| 265 | − if (!Continue()) | |
| 266 | − break; | |
| 249 | + if (!Continue()) break; | |
| 267 | 250 | } |
| 268 | 251 | } |
| 269 | 252 | |
| @@ -33,19 +33,17 @@ enum TestMode { · 32 unmodified lines | ||
| 33 | 33 | kTwoPassGood, |
| 34 | 34 | kTwoPassBest |
| 35 | 35 | }; |
| 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) | |
| 41 | 40 | |
| 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) | |
| 48 | 44 | |
| 45 | +#define TWO_PASS_TEST_MODES \ | |
| 46 | + ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kTwoPassBest) | |
| 49 | 47 | |
| 50 | 48 | // Provides an object to handle the libvpx get_cx_data() iteration pattern |
| 51 | 49 | class CxDataIterator { |
| @@ -58,8 +56,8 @@ class CxDataIterator { · 6 unmodified lines | ||
| 58 | 56 | } |
| 59 | 57 | |
| 60 | 58 | 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_; | |
| 63 | 61 | }; |
| 64 | 62 | |
| 65 | 63 | // Implements an in-memory store for libvpx twopass statistics |
| @@ -75,15 +73,12 @@ class TwopassStatsStore { · 9 unmodified lines | ||
| 75 | 73 | return buf; |
| 76 | 74 | } |
| 77 | 75 | |
| 78 | − void Reset() { | |
| 79 | − buffer_.clear(); | |
| 80 | − } | |
| 76 | + void Reset() { buffer_.clear(); } | |
| 81 | 77 | |
| 82 | 78 | protected: |
| 83 | − std::string buffer_; | |
| 79 | + std::string buffer_; | |
| 84 | 80 | }; |
| 85 | 81 | |
| 86 | − | |
| 87 | 82 | // Provides a simplified interface to manage one video encoding pass, given |
| 88 | 83 | // a configuration and video source. |
| 89 | 84 | // |
| @@ -97,13 +92,9 @@ class Encoder { · 7 unmodified lines | ||
| 97 | 92 | memset(&encoder_, 0, sizeof(encoder_)); |
| 98 | 93 | } |
| 99 | 94 | |
| 100 | − virtual ~Encoder() { | |
| 101 | − vpx_codec_destroy(&encoder_); | |
| 102 | − } | |
| 95 | + virtual ~Encoder() { vpx_codec_destroy(&encoder_); } | |
| 103 | 96 | |
| 104 | − CxDataIterator GetCxData() { | |
| 105 | − return CxDataIterator(&encoder_); | |
| 106 | − } | |
| 97 | + CxDataIterator GetCxData() { return CxDataIterator(&encoder_); } | |
| 107 | 98 | |
| 108 | 99 | void InitEncoder(VideoSource *video); |
| 109 | 100 | |
| @@ -115,9 +106,7 @@ class Encoder { · 5 unmodified lines | ||
| 115 | 106 | void EncodeFrame(VideoSource *video, const unsigned long frame_flags); |
| 116 | 107 | |
| 117 | 108 | // Convenience wrapper for EncodeFrame() |
| 118 | − void EncodeFrame(VideoSource *video) { | |
| 119 | − EncodeFrame(video, 0); | |
| 120 | − } | |
| 109 | + void EncodeFrame(VideoSource *video) { EncodeFrame(video, 0); } | |
| 121 | 110 | |
| 122 | 111 | void Control(int ctrl_id, int arg) { |
| 123 | 112 | const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); |
| @@ -156,12 +145,10 @@ class Encoder { · 32 unmodified lines | ||
| 156 | 145 | cfg_ = *cfg; |
| 157 | 146 | } |
| 158 | 147 | |
| 159 | − void set_deadline(unsigned long deadline) { | |
| 160 | − deadline_ = deadline; | |
| 161 | − } | |
| 148 | + void set_deadline(unsigned long deadline) { deadline_ = deadline; } | |
| 162 | 149 | |
| 163 | 150 | protected: |
| 164 | − virtual vpx_codec_iface_t* CodecInterface() const = 0; | |
| 151 | + virtual vpx_codec_iface_t *CodecInterface() const = 0; | |
| 165 | 152 | |
| 166 | 153 | const char *EncoderError() { |
| 167 | 154 | const char *detail = vpx_codec_error_detail(&encoder_); |
| @@ -175,11 +162,11 @@ class Encoder { · 7 unmodified lines | ||
| 175 | 162 | // Flush the encoder on EOS |
| 176 | 163 | void Flush(); |
| 177 | 164 | |
| 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_; | |
| 183 | 170 | }; |
| 184 | 171 | |
| 185 | 172 | // Common test functionality for all Encoder tests. |
| @@ -221,36 +208,35 @@ class EncoderTest { · 35 unmodified lines | ||
| 221 | 208 | virtual void EndPassHook() {} |
| 222 | 209 | |
| 223 | 210 | // 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*/) {} | |
| 227 | 214 | |
| 228 | 215 | // 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*/) {} | |
| 230 | 217 | |
| 231 | 218 | // 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*/) {} | |
| 233 | 220 | |
| 234 | 221 | // Hook to determine whether the encode loop should continue. |
| 235 | 222 | virtual bool Continue() const { |
| 236 | 223 | return !(::testing::Test::HasFatalFailure() || abort_); |
| 237 | 224 | } |
| 238 | 225 | |
| 239 | − const CodecFactory *codec_; | |
| 226 | + const CodecFactory *codec_; | |
| 240 | 227 | // Hook to determine whether to decode frame after encoding |
| 241 | 228 | virtual bool DoDecode() const { return 1; } |
| 242 | 229 | |
| 243 | 230 | // 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); | |
| 246 | 232 | |
| 247 | 233 | // 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*/, | |
| 249 | 235 | vpx_codec_pts_t /*pts*/) {} |
| 250 | 236 | |
| 251 | 237 | // Hook to be called to handle decode result. Return true to continue. |
| 252 | 238 | virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec, |
| 253 | − const VideoSource& /*video*/, | |
| 239 | + const VideoSource & /*video*/, | |
| 254 | 240 | Decoder *decoder) { |
| 255 | 241 | EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError(); |
| 256 | 242 | return VPX_CODEC_OK == res_dec; |
| @@ -262,15 +248,15 @@ class EncoderTest { · 5 unmodified lines | ||
| 262 | 248 | return pkt; |
| 263 | 249 | } |
| 264 | 250 | |
| 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_; | |
| 274 | 260 | }; |
| 275 | 261 | |
| 276 | 262 | } // namespace libvpx_test |
| @@ -19,16 +19,13 @@ namespace { · 18 unmodified lines | ||
| 19 | 19 | const int kMaxErrorFrames = 12; |
| 20 | 20 | const int kMaxDroppableFrames = 12; |
| 21 | 21 | |
| 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> { | |
| 24 | 25 | protected: |
| 25 | 26 | 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), | |
| 32 | 29 | encoding_mode_(GET_PARAM(1)) { |
| 33 | 30 | Reset(); |
| 34 | 31 | } |
| @@ -66,81 +63,70 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest, · 31 unmodified lines | ||
| 66 | 63 | // LAST is updated on base/layer 0, GOLDEN updated on layer 1. |
| 67 | 64 | // Non-zero pattern_switch parameter means pattern will switch to |
| 68 | 65 | // 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) { | |
| 72 | 67 | int frame_flags = 0; |
| 73 | 68 | 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; | |
| 86 | 74 | } 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; | |
| 97 | 87 | } |
| 88 | + } | |
| 98 | 89 | } |
| 99 | 90 | return frame_flags; |
| 100 | 91 | } |
| 101 | 92 | |
| 102 | 93 | virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video, |
| 103 | 94 | ::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); | |
| 107 | 97 | // For temporal layer case. |
| 108 | 98 | 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_); | |
| 112 | 101 | for (unsigned int i = 0; i < droppable_nframes_; ++i) { |
| 113 | 102 | 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"; | |
| 116 | 105 | } |
| 117 | 106 | } |
| 118 | 107 | } 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 | + } | |
| 132 | 120 | } |
| 133 | 121 | } |
| 134 | 122 | |
| 135 | 123 | double GetAveragePsnr() const { |
| 136 | − if (nframes_) | |
| 137 | − return psnr_ / nframes_; | |
| 124 | + if (nframes_) return psnr_ / nframes_; | |
| 138 | 125 | return 0.0; |
| 139 | 126 | } |
| 140 | 127 | |
| 141 | 128 | double GetAverageMismatchPsnr() const { |
| 142 | − if (mismatch_nframes_) | |
| 143 | − return mismatch_psnr_ / mismatch_nframes_; | |
| 129 | + if (mismatch_nframes_) return mismatch_psnr_ / mismatch_nframes_; | |
| 144 | 130 | return 0.0; |
| 145 | 131 | } |
| 146 | 132 | |
| @@ -158,8 +144,7 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest, · 11 unmodified lines | ||
| 158 | 144 | return 1; |
| 159 | 145 | } |
| 160 | 146 | |
| 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) { | |
| 163 | 148 | double mismatch_psnr = compute_psnr(img1, img2); |
| 164 | 149 | mismatch_psnr_ += mismatch_psnr; |
| 165 | 150 | ++mismatch_nframes_; |
| @@ -186,13 +171,9 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest, · 20 unmodified lines | ||
| 186 | 171 | droppable_frames_[i] = list[i]; |
| 187 | 172 | } |
| 188 | 173 | |
| 189 | − unsigned int GetMismatchFrames() { | |
| 190 | − return mismatch_nframes_; | |
| 191 | − } | |
| 174 | + unsigned int GetMismatchFrames() { return mismatch_nframes_; } | |
| 192 | 175 | |
| 193 | − void SetPatternSwitch(int frame_switch) { | |
| 194 | − pattern_switch_ = frame_switch; | |
| 195 | − } | |
| 176 | + void SetPatternSwitch(int frame_switch) { pattern_switch_ = frame_switch; } | |
| 196 | 177 | |
| 197 | 178 | bool svc_support_; |
| 198 | 179 | |
| @@ -265,15 +246,14 @@ TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) { · 66 unmodified lines | ||
| 265 | 246 | // In addition to isolated loss/drop, add a long consecutive series |
| 266 | 247 | // (of size 9) of dropped frames. |
| 267 | 248 | 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 }; | |
| 270 | 251 | SetDroppableFrames(num_droppable_frames, droppable_frame_list); |
| 271 | 252 | SetErrorFrames(num_droppable_frames, droppable_frame_list); |
| 272 | 253 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 273 | 254 | // 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); | |
| 277 | 257 | |
| 278 | 258 | // Reset previously set of error/droppable frames. |
| 279 | 259 | Reset(); |
| @@ -306,8 +286,7 @@ TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) { · 26 unmodified lines | ||
| 306 | 286 | // layer, so successful decoding is expected. |
| 307 | 287 | TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) { |
| 308 | 288 | // This test doesn't run if SVC is not supported. |
| 309 | − if (!svc_support_) | |
| 310 | − return; | |
| 289 | + if (!svc_support_) return; | |
| 311 | 290 | |
| 312 | 291 | const vpx_rational timebase = { 33333333, 1000000000 }; |
| 313 | 292 | cfg_.g_timebase = timebase; |
| @@ -337,14 +316,13 @@ TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) { · 23 unmodified lines | ||
| 337 | 316 | // The odd frames are the enhancement layer for 2 layer pattern, so set |
| 338 | 317 | // those frames as droppable. Drop the last 7 frames. |
| 339 | 318 | 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 }; | |
| 341 | 320 | SetDroppableFrames(num_droppable_frames, droppable_frame_list); |
| 342 | 321 | SetErrorFrames(num_droppable_frames, droppable_frame_list); |
| 343 | 322 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 344 | 323 | // 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); | |
| 348 | 326 | |
| 349 | 327 | // Reset previously set of error/droppable frames. |
| 350 | 328 | Reset(); |
| @@ -355,8 +333,7 @@ TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) { · 4 unmodified lines | ||
| 355 | 333 | // sequence, the LAST ref is not used anymore. |
| 356 | 334 | TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) { |
| 357 | 335 | // This test doesn't run if SVC is not supported. |
| 358 | − if (!svc_support_) | |
| 359 | − return; | |
| 336 | + if (!svc_support_) return; | |
| 360 | 337 | |
| 361 | 338 | const vpx_rational timebase = { 33333333, 1000000000 }; |
| 362 | 339 | cfg_.g_timebase = timebase; |
| @@ -385,20 +362,19 @@ TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) { · 22 unmodified lines | ||
| 385 | 362 | |
| 386 | 363 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 387 | 364 | // 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); | |
| 391 | 367 | |
| 392 | 368 | // Reset previously set of error/droppable frames. |
| 393 | 369 | Reset(); |
| 394 | 370 | } |
| 395 | 371 | |
| 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> { | |
| 398 | 375 | protected: |
| 399 | 376 | ErrorResilienceTestLargeCodecControls() |
| 400 | − : EncoderTest(GET_PARAM(0)), | |
| 401 | − encoding_mode_(GET_PARAM(1)) { | |
| 377 | + : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)) { | |
| 402 | 378 | Reset(); |
| 403 | 379 | } |
| 404 | 380 | |
| @@ -437,8 +413,8 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 32 unmodified lines | ||
| 437 | 413 | if (num_temp_layers == 2) { |
| 438 | 414 | if (frame_num % 2 == 0) { |
| 439 | 415 | // 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; | |
| 442 | 418 | } else { |
| 443 | 419 | // Layer 1: predict from L, G and ARF, and update G. |
| 444 | 420 | 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 | ||
| 451 | 427 | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF; |
| 452 | 428 | } else if ((frame_num - 2) % 4 == 0) { |
| 453 | 429 | // 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) { | |
| 457 | 433 | // Layer 2: predict from L, G, ARF; update ARG. |
| 458 | 434 | frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_LAST; |
| 459 | 435 | } |
| @@ -467,7 +443,7 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 7 unmodified lines | ||
| 467 | 443 | if (frame_num % 2 == 0) { |
| 468 | 444 | layer_id = 0; |
| 469 | 445 | } else { |
| 470 | − layer_id = 1; | |
| 446 | + layer_id = 1; | |
| 471 | 447 | } |
| 472 | 448 | } else if (num_temp_layers == 3) { |
| 473 | 449 | if (frame_num % 4 == 0) { |
| @@ -484,16 +460,16 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 10 unmodified lines | ||
| 484 | 460 | virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video, |
| 485 | 461 | libvpx_test::Encoder *encoder) { |
| 486 | 462 | 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; | |
| 497 | 473 | } |
| 498 | 474 | } |
| 499 | 475 | |
| @@ -519,26 +495,28 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest, · 19 unmodified lines | ||
| 519 | 495 | |
| 520 | 496 | virtual void EndPassHook(void) { |
| 521 | 497 | duration_ = (last_pts_ + 1) * timebase_; |
| 522 | − if (cfg_.ts_number_layers > 1) { | |
| 498 | + if (cfg_.ts_number_layers > 1) { | |
| 523 | 499 | for (int layer = 0; layer < static_cast<int>(cfg_.ts_number_layers); |
| 524 | − ++layer) { | |
| 500 | + ++layer) { | |
| 525 | 501 | if (bits_total_[layer]) { |
| 526 | 502 | // Effective file datarate: |
| 527 | − effective_datarate_[layer] = (bits_total_[layer] / 1000.0) / duration_; | |
| 503 | + effective_datarate_[layer] = | |
| 504 | + (bits_total_[layer] / 1000.0) / duration_; | |
| 528 | 505 | } |
| 529 | 506 | } |
| 530 | 507 | } |
| 531 | 508 | } |
| 532 | 509 | |
| 533 | 510 | 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 | +}; | |
| 542 | 520 | |
| 543 | 521 | // Check two codec controls used for: |
| 544 | 522 | // (1) for setting temporal layer id, and (2) for settings encoder flags. |
| @@ -582,10 +560,12 @@ TEST_P(ErrorResilienceTestLargeCodecControls, CodecControl3TemporalLayers) { · 37 unmodified lines | ||
| 582 | 560 | for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) { |
| 583 | 561 | ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.75) |
| 584 | 562 | << " The datarate for the file is lower than target by too much, " |
| 585 | − "for layer: " << j; | |
| 563 | + "for layer: " | |
| 564 | + << j; | |
| 586 | 565 | ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.25) |
| 587 | 566 | << " The datarate for the file is greater than target by too much, " |
| 588 | − "for layer: " << j; | |
| 567 | + "for layer: " | |
| 568 | + << j; | |
| 589 | 569 | } |
| 590 | 570 | } |
| 591 | 571 | } |
| @@ -34,21 +34,18 @@ struct ExternalFrameBuffer { · 33 unmodified lines | ||
| 34 | 34 | // Class to manipulate a list of external frame buffers. |
| 35 | 35 | class ExternalFrameBufferList { |
| 36 | 36 | public: |
| 37 | − ExternalFrameBufferList() | |
| 38 | − : num_buffers_(0), | |
| 39 | − ext_fb_list_(NULL) {} | |
| 37 | + ExternalFrameBufferList() : num_buffers_(0), ext_fb_list_(NULL) {} | |
| 40 | 38 | |
| 41 | 39 | virtual ~ExternalFrameBufferList() { |
| 42 | 40 | for (int i = 0; i < num_buffers_; ++i) { |
| 43 | − delete [] ext_fb_list_[i].data; | |
| 41 | + delete[] ext_fb_list_[i].data; | |
| 44 | 42 | } |
| 45 | − delete [] ext_fb_list_; | |
| 43 | + delete[] ext_fb_list_; | |
| 46 | 44 | } |
| 47 | 45 | |
| 48 | 46 | // Creates the list to hold the external buffers. Returns true on success. |
| 49 | 47 | bool CreateBufferList(int num_buffers) { |
| 50 | − if (num_buffers < 0) | |
| 51 | − return false; | |
| 48 | + if (num_buffers < 0) return false; | |
| 52 | 49 | |
| 53 | 50 | num_buffers_ = num_buffers; |
| 54 | 51 | ext_fb_list_ = new ExternalFrameBuffer[num_buffers_]; |
| @@ -64,11 +61,10 @@ class ExternalFrameBufferList { · 9 unmodified lines | ||
| 64 | 61 | int GetFreeFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) { |
| 65 | 62 | EXPECT_TRUE(fb != NULL); |
| 66 | 63 | const int idx = FindFreeBufferIndex(); |
| 67 | − if (idx == num_buffers_) | |
| 68 | − return -1; | |
| 64 | + if (idx == num_buffers_) return -1; | |
| 69 | 65 | |
| 70 | 66 | if (ext_fb_list_[idx].size < min_size) { |
| 71 | − delete [] ext_fb_list_[idx].data; | |
| 67 | + delete[] ext_fb_list_[idx].data; | |
| 72 | 68 | ext_fb_list_[idx].data = new uint8_t[min_size]; |
| 73 | 69 | memset(ext_fb_list_[idx].data, 0, min_size); |
| 74 | 70 | ext_fb_list_[idx].size = min_size; |
| @@ -83,11 +79,10 @@ class ExternalFrameBufferList { · 8 unmodified lines | ||
| 83 | 79 | int GetZeroFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) { |
| 84 | 80 | EXPECT_TRUE(fb != NULL); |
| 85 | 81 | const int idx = FindFreeBufferIndex(); |
| 86 | − if (idx == num_buffers_) | |
| 87 | − return -1; | |
| 82 | + if (idx == num_buffers_) return -1; | |
| 88 | 83 | |
| 89 | 84 | if (ext_fb_list_[idx].size < min_size) { |
| 90 | − delete [] ext_fb_list_[idx].data; | |
| 85 | + delete[] ext_fb_list_[idx].data; | |
| 91 | 86 | ext_fb_list_[idx].data = NULL; |
| 92 | 87 | ext_fb_list_[idx].size = min_size; |
| 93 | 88 | } |
| @@ -104,7 +99,7 @@ class ExternalFrameBufferList { · 10 unmodified lines | ||
| 104 | 99 | return -1; |
| 105 | 100 | } |
| 106 | 101 | ExternalFrameBuffer *const ext_fb = |
| 107 | − reinterpret_cast<ExternalFrameBuffer*>(fb->priv); | |
| 102 | + reinterpret_cast<ExternalFrameBuffer *>(fb->priv); | |
| 108 | 103 | if (ext_fb == NULL) { |
| 109 | 104 | EXPECT_TRUE(ext_fb != NULL); |
| 110 | 105 | return -1; |
| @@ -119,7 +114,7 @@ class ExternalFrameBufferList { · 8 unmodified lines | ||
| 119 | 114 | void CheckXImageFrameBuffer(const vpx_image_t *img) { |
| 120 | 115 | if (img->fb_priv != NULL) { |
| 121 | 116 | const struct ExternalFrameBuffer *const ext_fb = |
| 122 | − reinterpret_cast<ExternalFrameBuffer*>(img->fb_priv); | |
| 117 | + reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv); | |
| 123 | 118 | |
| 124 | 119 | ASSERT_TRUE(img->planes[0] >= ext_fb->data && |
| 125 | 120 | img->planes[0] < (ext_fb->data + ext_fb->size)); |
| @@ -133,8 +128,7 @@ class ExternalFrameBufferList { · 7 unmodified lines | ||
| 133 | 128 | int i; |
| 134 | 129 | // Find a free frame buffer. |
| 135 | 130 | 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; | |
| 138 | 132 | } |
| 139 | 133 | return i; |
| 140 | 134 | } |
| @@ -161,16 +155,15 @@ class ExternalFrameBufferList { · 20 unmodified lines | ||
| 161 | 155 | int get_vp9_frame_buffer(void *user_priv, size_t min_size, |
| 162 | 156 | vpx_codec_frame_buffer_t *fb) { |
| 163 | 157 | ExternalFrameBufferList *const fb_list = |
| 164 | − reinterpret_cast<ExternalFrameBufferList*>(user_priv); | |
| 158 | + reinterpret_cast<ExternalFrameBufferList *>(user_priv); | |
| 165 | 159 | return fb_list->GetFreeFrameBuffer(min_size, fb); |
| 166 | 160 | } |
| 167 | 161 | |
| 168 | 162 | // Callback used by libvpx to tell the application that |fb| is not needed |
| 169 | 163 | // 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) { | |
| 172 | 165 | ExternalFrameBufferList *const fb_list = |
| 173 | − reinterpret_cast<ExternalFrameBufferList*>(user_priv); | |
| 166 | + reinterpret_cast<ExternalFrameBufferList *>(user_priv); | |
| 174 | 167 | return fb_list->ReturnFrameBuffer(fb); |
| 175 | 168 | } |
| 176 | 169 | |
| @@ -178,7 +171,7 @@ int release_vp9_frame_buffer(void *user_priv, · 1 unmodified line | ||
| 178 | 171 | int get_vp9_zero_frame_buffer(void *user_priv, size_t min_size, |
| 179 | 172 | vpx_codec_frame_buffer_t *fb) { |
| 180 | 173 | ExternalFrameBufferList *const fb_list = |
| 181 | − reinterpret_cast<ExternalFrameBufferList*>(user_priv); | |
| 174 | + reinterpret_cast<ExternalFrameBufferList *>(user_priv); | |
| 182 | 175 | return fb_list->GetZeroFrameBuffer(min_size, fb); |
| 183 | 176 | } |
| 184 | 177 | |
| @@ -186,7 +179,7 @@ int get_vp9_zero_frame_buffer(void *user_priv, size_t min_size, · 1 unmodified line | ||
| 186 | 179 | int get_vp9_one_less_byte_frame_buffer(void *user_priv, size_t min_size, |
| 187 | 180 | vpx_codec_frame_buffer_t *fb) { |
| 188 | 181 | ExternalFrameBufferList *const fb_list = |
| 189 | − reinterpret_cast<ExternalFrameBufferList*>(user_priv); | |
| 182 | + reinterpret_cast<ExternalFrameBufferList *>(user_priv); | |
| 190 | 183 | return fb_list->GetFreeFrameBuffer(min_size - 1, fb); |
| 191 | 184 | } |
| 192 | 185 | |
| @@ -203,16 +196,14 @@ int do_not_release_vp9_frame_buffer(void *user_priv, · 10 unmodified lines | ||
| 203 | 196 | // Class for testing passing in external frame buffers to libvpx. |
| 204 | 197 | class ExternalFrameBufferMD5Test |
| 205 | 198 | : public ::libvpx_test::DecoderTest, |
| 206 | − public ::libvpx_test::CodecTestWithParam<const char*> { | |
| 199 | + public ::libvpx_test::CodecTestWithParam<const char *> { | |
| 207 | 200 | protected: |
| 208 | 201 | ExternalFrameBufferMD5Test() |
| 209 | 202 | : DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)), |
| 210 | − md5_file_(NULL), | |
| 211 | − num_buffers_(0) {} | |
| 203 | + md5_file_(NULL), num_buffers_(0) {} | |
| 212 | 204 | |
| 213 | 205 | virtual ~ExternalFrameBufferMD5Test() { |
| 214 | − if (md5_file_ != NULL) | |
| 215 | − fclose(md5_file_); | |
| 206 | + if (md5_file_ != NULL) fclose(md5_file_); | |
| 216 | 207 | } |
| 217 | 208 | |
| 218 | 209 | virtual void PreDecodeFrameHook( |
| @@ -222,15 +213,15 @@ class ExternalFrameBufferMD5Test · 3 unmodified lines | ||
| 222 | 213 | // Have libvpx use frame buffers we create. |
| 223 | 214 | ASSERT_TRUE(fb_list_.CreateBufferList(num_buffers_)); |
| 224 | 215 | ASSERT_EQ(VPX_CODEC_OK, |
| 225 | − decoder->SetFrameBufferFunctions( | |
| 226 | − GetVP9FrameBuffer, ReleaseVP9FrameBuffer, this)); | |
| 216 | + decoder->SetFrameBufferFunctions(GetVP9FrameBuffer, | |
| 217 | + ReleaseVP9FrameBuffer, this)); | |
| 227 | 218 | } |
| 228 | 219 | } |
| 229 | 220 | |
| 230 | 221 | void OpenMD5File(const std::string &md5_file_name_) { |
| 231 | 222 | md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_); |
| 232 | 223 | ASSERT_TRUE(md5_file_ != NULL) << "Md5 file open failed. Filename: " |
| 233 | − << md5_file_name_; | |
| 224 | + << md5_file_name_; | |
| 234 | 225 | } |
| 235 | 226 | |
| 236 | 227 | virtual void DecompressedFrameHook(const vpx_image_t &img, |
| @@ -258,7 +249,7 @@ class ExternalFrameBufferMD5Test · 21 unmodified lines | ||
| 258 | 249 | static int GetVP9FrameBuffer(void *user_priv, size_t min_size, |
| 259 | 250 | vpx_codec_frame_buffer_t *fb) { |
| 260 | 251 | ExternalFrameBufferMD5Test *const md5Test = |
| 261 | − reinterpret_cast<ExternalFrameBufferMD5Test*>(user_priv); | |
| 252 | + reinterpret_cast<ExternalFrameBufferMD5Test *>(user_priv); | |
| 262 | 253 | return md5Test->fb_list_.GetFreeFrameBuffer(min_size, fb); |
| 263 | 254 | } |
| 264 | 255 | |
| @@ -267,7 +258,7 @@ class ExternalFrameBufferMD5Test · 2 unmodified lines | ||
| 267 | 258 | static int ReleaseVP9FrameBuffer(void *user_priv, |
| 268 | 259 | vpx_codec_frame_buffer_t *fb) { |
| 269 | 260 | ExternalFrameBufferMD5Test *const md5Test = |
| 270 | − reinterpret_cast<ExternalFrameBufferMD5Test*>(user_priv); | |
| 261 | + reinterpret_cast<ExternalFrameBufferMD5Test *>(user_priv); | |
| 271 | 262 | return md5Test->fb_list_.ReturnFrameBuffer(fb); |
| 272 | 263 | } |
| 273 | 264 | |
| @@ -286,10 +277,7 @@ const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm"; · 12 unmodified lines | ||
| 286 | 277 | // Class for testing passing in external frame buffers to libvpx. |
| 287 | 278 | class ExternalFrameBufferTest : public ::testing::Test { |
| 288 | 279 | protected: |
| 289 | − ExternalFrameBufferTest() | |
| 290 | − : video_(NULL), | |
| 291 | − decoder_(NULL), | |
| 292 | − num_buffers_(0) {} | |
| 280 | + ExternalFrameBufferTest() : video_(NULL), decoder_(NULL), num_buffers_(0) {} | |
| 293 | 281 | |
| 294 | 282 | virtual void SetUp() { |
| 295 | 283 | video_ = new libvpx_test::WebMVideoSource(kVP9TestFile); |
| @@ -309,8 +297,7 @@ class ExternalFrameBufferTest : public ::testing::Test { · 13 unmodified lines | ||
| 309 | 297 | |
| 310 | 298 | // Passes the external frame buffer information to libvpx. |
| 311 | 299 | 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, | |
| 314 | 301 | vpx_release_frame_buffer_cb_fn_t cb_release) { |
| 315 | 302 | if (num_buffers > 0) { |
| 316 | 303 | num_buffers_ = num_buffers; |
| @@ -324,8 +311,7 @@ class ExternalFrameBufferTest : public ::testing::Test { · 7 unmodified lines | ||
| 324 | 311 | const vpx_codec_err_t res = |
| 325 | 312 | decoder_->DecodeFrame(video_->cxdata(), video_->frame_size()); |
| 326 | 313 | CheckDecodedFrames(); |
| 327 | − if (res == VPX_CODEC_OK) | |
| 328 | − video_->Next(); | |
| 314 | + if (res == VPX_CODEC_OK) video_->Next(); | |
| 329 | 315 | return res; |
| 330 | 316 | } |
| 331 | 317 | |
| @@ -333,8 +319,7 @@ class ExternalFrameBufferTest : public ::testing::Test { · 1 unmodified line | ||
| 333 | 319 | for (; video_->cxdata() != NULL; video_->Next()) { |
| 334 | 320 | const vpx_codec_err_t res = |
| 335 | 321 | decoder_->DecodeFrame(video_->cxdata(), video_->frame_size()); |
| 336 | − if (res != VPX_CODEC_OK) | |
| 337 | − return res; | |
| 322 | + if (res != VPX_CODEC_OK) return res; | |
| 338 | 323 | CheckDecodedFrames(); |
| 339 | 324 | } |
| 340 | 325 | return VPX_CODEC_OK; |
| @@ -409,8 +394,8 @@ TEST_F(ExternalFrameBufferTest, MinFrameBuffers) { · 68 unmodified lines | ||
| 409 | 394 | // #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS. |
| 410 | 395 | const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS; |
| 411 | 396 | 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)); | |
| 414 | 399 | ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames()); |
| 415 | 400 | } |
| 416 | 401 | |
| @@ -421,8 +406,8 @@ TEST_F(ExternalFrameBufferTest, EightJitterBuffers) { · 4 unmodified lines | ||
| 421 | 406 | const int num_buffers = |
| 422 | 407 | VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers; |
| 423 | 408 | 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)); | |
| 426 | 411 | ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames()); |
| 427 | 412 | } |
| 428 | 413 | |
| @@ -432,8 +417,8 @@ TEST_F(ExternalFrameBufferTest, NotEnoughBuffers) { · 3 unmodified lines | ||
| 432 | 417 | // only use 5 frame buffers at one time. |
| 433 | 418 | const int num_buffers = 2; |
| 434 | 419 | 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)); | |
| 437 | 422 | ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame()); |
| 438 | 423 | ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeRemainingFrames()); |
| 439 | 424 | } |
| @@ -457,18 +442,17 @@ TEST_F(ExternalFrameBufferTest, NullRealloc) { · 17 unmodified lines | ||
| 457 | 442 | |
| 458 | 443 | TEST_F(ExternalFrameBufferTest, ReallocOneLessByte) { |
| 459 | 444 | 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)); | |
| 464 | 448 | ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeOneFrame()); |
| 465 | 449 | } |
| 466 | 450 | |
| 467 | 451 | TEST_F(ExternalFrameBufferTest, NullGetFunction) { |
| 468 | 452 | 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)); | |
| 472 | 456 | } |
| 473 | 457 | |
| 474 | 458 | TEST_F(ExternalFrameBufferTest, NullReleaseFunction) { |
| @@ -481,13 +465,14 @@ TEST_F(ExternalFrameBufferTest, SetAfterDecode) { · 6 unmodified lines | ||
| 481 | 465 | const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS; |
| 482 | 466 | ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame()); |
| 483 | 467 | 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)); | |
| 486 | 470 | } |
| 487 | 471 | #endif // CONFIG_WEBM_IO |
| 488 | 472 | |
| 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)); | |
| 493 | 478 | } // namespace |
| @@ -128,14 +128,14 @@ class Trans4x4TestBase { · 127 unmodified lines | ||
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
| 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_)); | |
| 133 | 133 | if (bit_depth_ == VPX_BITS_8) { |
| 134 | 134 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_)); |
| 135 | 135 | #if CONFIG_VP9_HIGHBITDEPTH |
| 136 | 136 | } 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_)); | |
| 139 | 139 | #endif |
| 140 | 140 | } |
| 141 | 141 | |
| @@ -148,15 +148,13 @@ class Trans4x4TestBase { · 6 unmodified lines | ||
| 148 | 148 | const int diff = dst[j] - src[j]; |
| 149 | 149 | #endif |
| 150 | 150 | const uint32_t error = diff * diff; |
| 151 | − if (max_error < error) | |
| 152 | − max_error = error; | |
| 151 | + if (max_error < error) max_error = error; | |
| 153 | 152 | total_error += error; |
| 154 | 153 | } |
| 155 | 154 | } |
| 156 | 155 | |
| 157 | 156 | 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; | |
| 160 | 158 | |
| 161 | 159 | EXPECT_GE(count_test_block * limit, total_error) |
| 162 | 160 | << "Error: 4x4 FHT/IHT has average round trip error > " << limit |
| @@ -197,16 +195,14 @@ class Trans4x4TestBase { · 34 unmodified lines | ||
| 197 | 195 | input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; |
| 198 | 196 | } |
| 199 | 197 | 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_; | |
| 202 | 199 | } 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_; | |
| 205 | 201 | } |
| 206 | 202 | |
| 207 | 203 | 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_)); | |
| 210 | 206 | |
| 211 | 207 | // The minimum quant value is 4. |
| 212 | 208 | for (int j = 0; j < kNumCoeffs; ++j) { |
| @@ -251,8 +247,8 @@ class Trans4x4TestBase { · 38 unmodified lines | ||
| 251 | 247 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_)); |
| 252 | 248 | #if CONFIG_VP9_HIGHBITDEPTH |
| 253 | 249 | } 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_)); | |
| 256 | 252 | #endif |
| 257 | 253 | } |
| 258 | 254 | |
| @@ -265,8 +261,7 @@ class Trans4x4TestBase { · 6 unmodified lines | ||
| 265 | 261 | #endif |
| 266 | 262 | const uint32_t error = diff * diff; |
| 267 | 263 | 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; | |
| 270 | 265 | } |
| 271 | 266 | } |
| 272 | 267 | } |
| @@ -278,17 +273,16 @@ class Trans4x4TestBase { · 5 unmodified lines | ||
| 278 | 273 | int mask_; |
| 279 | 274 | }; |
| 280 | 275 | |
| 281 | −class Trans4x4DCT | |
| 282 | − : public Trans4x4TestBase, | |
| 283 | − public ::testing::TestWithParam<Dct4x4Param> { | |
| 276 | +class Trans4x4DCT : public Trans4x4TestBase, | |
| 277 | + public ::testing::TestWithParam<Dct4x4Param> { | |
| 284 | 278 | public: |
| 285 | 279 | virtual ~Trans4x4DCT() {} |
| 286 | 280 | |
| 287 | 281 | virtual void SetUp() { |
| 288 | 282 | fwd_txfm_ = GET_PARAM(0); |
| 289 | 283 | inv_txfm_ = GET_PARAM(1); |
| 290 | − tx_type_ = GET_PARAM(2); | |
| 291 | − pitch_ = 4; | |
| 284 | + tx_type_ = GET_PARAM(2); | |
| 285 | + pitch_ = 4; | |
| 292 | 286 | fwd_txfm_ref = fdct4x4_ref; |
| 293 | 287 | bit_depth_ = GET_PARAM(3); |
| 294 | 288 | mask_ = (1 << bit_depth_) - 1; |
| @@ -307,33 +301,24 @@ class Trans4x4DCT · 12 unmodified lines | ||
| 307 | 301 | IdctFunc inv_txfm_; |
| 308 | 302 | }; |
| 309 | 303 | |
| 310 | −TEST_P(Trans4x4DCT, AccuracyCheck) { | |
| 311 | − RunAccuracyCheck(1); | |
| 312 | −} | |
| 304 | +TEST_P(Trans4x4DCT, AccuracyCheck) { RunAccuracyCheck(1); } | |
| 313 | 305 | |
| 314 | −TEST_P(Trans4x4DCT, CoeffCheck) { | |
| 315 | − RunCoeffCheck(); | |
| 316 | −} | |
| 306 | +TEST_P(Trans4x4DCT, CoeffCheck) { RunCoeffCheck(); } | |
| 317 | 307 | |
| 318 | −TEST_P(Trans4x4DCT, MemCheck) { | |
| 319 | − RunMemCheck(); | |
| 320 | −} | |
| 308 | +TEST_P(Trans4x4DCT, MemCheck) { RunMemCheck(); } | |
| 321 | 309 | |
| 322 | −TEST_P(Trans4x4DCT, InvAccuracyCheck) { | |
| 323 | − RunInvAccuracyCheck(1); | |
| 324 | −} | |
| 310 | +TEST_P(Trans4x4DCT, InvAccuracyCheck) { RunInvAccuracyCheck(1); } | |
| 325 | 311 | |
| 326 | −class Trans4x4HT | |
| 327 | − : public Trans4x4TestBase, | |
| 328 | − public ::testing::TestWithParam<Ht4x4Param> { | |
| 312 | +class Trans4x4HT : public Trans4x4TestBase, | |
| 313 | + public ::testing::TestWithParam<Ht4x4Param> { | |
| 329 | 314 | public: |
| 330 | 315 | virtual ~Trans4x4HT() {} |
| 331 | 316 | |
| 332 | 317 | virtual void SetUp() { |
| 333 | 318 | fwd_txfm_ = GET_PARAM(0); |
| 334 | 319 | inv_txfm_ = GET_PARAM(1); |
| 335 | − tx_type_ = GET_PARAM(2); | |
| 336 | − pitch_ = 4; | |
| 320 | + tx_type_ = GET_PARAM(2); | |
| 321 | + pitch_ = 4; | |
| 337 | 322 | fwd_txfm_ref = fht4x4_ref; |
| 338 | 323 | bit_depth_ = GET_PARAM(3); |
| 339 | 324 | mask_ = (1 << bit_depth_) - 1; |
| @@ -353,33 +338,24 @@ class Trans4x4HT · 13 unmodified lines | ||
| 353 | 338 | IhtFunc inv_txfm_; |
| 354 | 339 | }; |
| 355 | 340 | |
| 356 | −TEST_P(Trans4x4HT, AccuracyCheck) { | |
| 357 | − RunAccuracyCheck(1); | |
| 358 | −} | |
| 341 | +TEST_P(Trans4x4HT, AccuracyCheck) { RunAccuracyCheck(1); } | |
| 359 | 342 | |
| 360 | −TEST_P(Trans4x4HT, CoeffCheck) { | |
| 361 | − RunCoeffCheck(); | |
| 362 | −} | |
| 343 | +TEST_P(Trans4x4HT, CoeffCheck) { RunCoeffCheck(); } | |
| 363 | 344 | |
| 364 | −TEST_P(Trans4x4HT, MemCheck) { | |
| 365 | − RunMemCheck(); | |
| 366 | −} | |
| 345 | +TEST_P(Trans4x4HT, MemCheck) { RunMemCheck(); } | |
| 367 | 346 | |
| 368 | −TEST_P(Trans4x4HT, InvAccuracyCheck) { | |
| 369 | − RunInvAccuracyCheck(1); | |
| 370 | −} | |
| 347 | +TEST_P(Trans4x4HT, InvAccuracyCheck) { RunInvAccuracyCheck(1); } | |
| 371 | 348 | |
| 372 | −class Trans4x4WHT | |
| 373 | − : public Trans4x4TestBase, | |
| 374 | − public ::testing::TestWithParam<Dct4x4Param> { | |
| 349 | +class Trans4x4WHT : public Trans4x4TestBase, | |
| 350 | + public ::testing::TestWithParam<Dct4x4Param> { | |
| 375 | 351 | public: |
| 376 | 352 | virtual ~Trans4x4WHT() {} |
| 377 | 353 | |
| 378 | 354 | virtual void SetUp() { |
| 379 | 355 | fwd_txfm_ = GET_PARAM(0); |
| 380 | 356 | inv_txfm_ = GET_PARAM(1); |
| 381 | − tx_type_ = GET_PARAM(2); | |
| 382 | − pitch_ = 4; | |
| 357 | + tx_type_ = GET_PARAM(2); | |
| 358 | + pitch_ = 4; | |
| 383 | 359 | fwd_txfm_ref = fwht4x4_ref; |
| 384 | 360 | bit_depth_ = GET_PARAM(3); |
| 385 | 361 | mask_ = (1 << bit_depth_) - 1; |
| @@ -398,21 +374,13 @@ class Trans4x4WHT · 12 unmodified lines | ||
| 398 | 374 | IdctFunc inv_txfm_; |
| 399 | 375 | }; |
| 400 | 376 | |
| 401 | −TEST_P(Trans4x4WHT, AccuracyCheck) { | |
| 402 | − RunAccuracyCheck(0); | |
| 403 | −} | |
| 377 | +TEST_P(Trans4x4WHT, AccuracyCheck) { RunAccuracyCheck(0); } | |
| 404 | 378 | |
| 405 | −TEST_P(Trans4x4WHT, CoeffCheck) { | |
| 406 | − RunCoeffCheck(); | |
| 407 | −} | |
| 379 | +TEST_P(Trans4x4WHT, CoeffCheck) { RunCoeffCheck(); } | |
| 408 | 380 | |
| 409 | −TEST_P(Trans4x4WHT, MemCheck) { | |
| 410 | − RunMemCheck(); | |
| 411 | −} | |
| 381 | +TEST_P(Trans4x4WHT, MemCheck) { RunMemCheck(); } | |
| 412 | 382 | |
| 413 | −TEST_P(Trans4x4WHT, InvAccuracyCheck) { | |
| 414 | − RunInvAccuracyCheck(0); | |
| 415 | −} | |
| 383 | +TEST_P(Trans4x4WHT, InvAccuracyCheck) { RunInvAccuracyCheck(0); } | |
| 416 | 384 | using std::tr1::make_tuple; |
| 417 | 385 | |
| 418 | 386 | #if CONFIG_VP9_HIGHBITDEPTH |
| @@ -423,10 +391,10 @@ INSTANTIATE_TEST_CASE_P( · 4 unmodified lines | ||
| 423 | 391 | make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12), |
| 424 | 392 | make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8))); |
| 425 | 393 | #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))); | |
| 430 | 398 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 431 | 399 | |
| 432 | 400 | #if CONFIG_VP9_HIGHBITDEPTH |
| @@ -463,18 +431,17 @@ INSTANTIATE_TEST_CASE_P( · 30 unmodified lines | ||
| 463 | 431 | make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_12, 0, VPX_BITS_12), |
| 464 | 432 | make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8))); |
| 465 | 433 | #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))); | |
| 470 | 438 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 471 | 439 | |
| 472 | 440 | #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))); | |
| 478 | 445 | #endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 479 | 446 | |
| 480 | 447 | #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| @@ -496,11 +463,10 @@ INSTANTIATE_TEST_CASE_P( · 15 unmodified lines | ||
| 496 | 463 | #endif |
| 497 | 464 | |
| 498 | 465 | #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))); | |
| 504 | 470 | INSTANTIATE_TEST_CASE_P( |
| 505 | 471 | SSE2, Trans4x4HT, |
| 506 | 472 | ::testing::Values( |
| @@ -514,12 +480,11 @@ INSTANTIATE_TEST_CASE_P( · 7 unmodified lines | ||
| 514 | 480 | INSTANTIATE_TEST_CASE_P( |
| 515 | 481 | SSE2, Trans4x4DCT, |
| 516 | 482 | ::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), | |
| 518 | 484 | 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), | |
| 520 | 486 | 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))); | |
| 523 | 488 | |
| 524 | 489 | INSTANTIATE_TEST_CASE_P( |
| 525 | 490 | SSE2, Trans4x4HT, |
| @@ -531,10 +496,10 @@ INSTANTIATE_TEST_CASE_P( · 5 unmodified lines | ||
| 531 | 496 | #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 532 | 497 | |
| 533 | 498 | #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))); | |
| 538 | 503 | INSTANTIATE_TEST_CASE_P( |
| 539 | 504 | MSA, Trans4x4HT, |
| 540 | 505 | ::testing::Values( |
| @@ -53,8 +53,7 @@ void reference_8x8_dct_1d(const double in[8], double out[8]) { · 52 unmodified lines | ||
| 53 | 53 | out[k] = 0.0; |
| 54 | 54 | for (int n = 0; n < 8; n++) |
| 55 | 55 | 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; | |
| 58 | 57 | } |
| 59 | 58 | } |
| 60 | 59 | |
| @@ -63,25 +62,20 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs], · 2 unmodified lines | ||
| 63 | 62 | // First transform columns |
| 64 | 63 | for (int i = 0; i < 8; ++i) { |
| 65 | 64 | 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]; | |
| 68 | 66 | 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]; | |
| 71 | 68 | } |
| 72 | 69 | // Then transform rows |
| 73 | 70 | for (int i = 0; i < 8; ++i) { |
| 74 | 71 | 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]; | |
| 77 | 73 | reference_8x8_dct_1d(temp_in, temp_out); |
| 78 | 74 | // 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; | |
| 81 | 76 | } |
| 82 | 77 | } |
| 83 | 78 | |
| 84 | − | |
| 85 | 79 | void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride, |
| 86 | 80 | int /*tx_type*/) { |
| 87 | 81 | vpx_fdct8x8_c(in, out, stride); |
| @@ -177,8 +171,7 @@ class FwdTrans8x8TestBase { · 89 unmodified lines | ||
| 177 | 171 | << 1. * max_diff / count_test_block * 100 << "%" |
| 178 | 172 | << " for input range [-255, 255] at index " << j |
| 179 | 173 | << " 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; | |
| 182 | 175 | } |
| 183 | 176 | |
| 184 | 177 | memset(count_sign_block, 0, sizeof(count_sign_block)); |
| @@ -186,8 +179,8 @@ class FwdTrans8x8TestBase { · 1 unmodified line | ||
| 186 | 179 | for (int i = 0; i < count_test_block; ++i) { |
| 187 | 180 | // Initialize a test block with input range [-mask_ / 16, mask_ / 16]. |
| 188 | 181 | 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); | |
| 191 | 184 | ASM_REGISTER_STATE_CHECK( |
| 192 | 185 | RunFwdTxfm(test_input_block, test_output_block, pitch_)); |
| 193 | 186 | |
| @@ -207,8 +200,7 @@ class FwdTrans8x8TestBase { · 13 unmodified lines | ||
| 207 | 200 | << 1. * max_diff / count_test_block * 100 << "%" |
| 208 | 201 | << " for input range [-15, 15] at index " << j |
| 209 | 202 | << " 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; | |
| 212 | 204 | } |
| 213 | 205 | } |
| 214 | 206 | |
| @@ -245,19 +237,18 @@ class FwdTrans8x8TestBase { · 30 unmodified lines | ||
| 245 | 237 | ASM_REGISTER_STATE_CHECK( |
| 246 | 238 | RunFwdTxfm(test_input_block, test_temp_block, pitch_)); |
| 247 | 239 | 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 | + } | |
| 257 | 249 | } |
| 258 | 250 | 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_)); | |
| 261 | 252 | #if CONFIG_VP9_HIGHBITDEPTH |
| 262 | 253 | } else { |
| 263 | 254 | ASM_REGISTER_STATE_CHECK( |
| @@ -273,19 +264,18 @@ class FwdTrans8x8TestBase { · 9 unmodified lines | ||
| 273 | 264 | const int diff = dst[j] - src[j]; |
| 274 | 265 | #endif |
| 275 | 266 | const int error = diff * diff; |
| 276 | − if (max_error < error) | |
| 277 | − max_error = error; | |
| 267 | + if (max_error < error) max_error = error; | |
| 278 | 268 | total_error += error; |
| 279 | 269 | } |
| 280 | 270 | } |
| 281 | 271 | |
| 282 | 272 | 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"; | |
| 285 | 275 | |
| 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"; | |
| 289 | 279 | } |
| 290 | 280 | |
| 291 | 281 | void RunExtremalCheck() { |
| @@ -341,8 +331,7 @@ class FwdTrans8x8TestBase { · 49 unmodified lines | ||
| 341 | 331 | ASM_REGISTER_STATE_CHECK( |
| 342 | 332 | fwd_txfm_ref(test_input_block, ref_temp_block, pitch_, tx_type_)); |
| 343 | 333 | 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_)); | |
| 346 | 335 | #if CONFIG_VP9_HIGHBITDEPTH |
| 347 | 336 | } else { |
| 348 | 337 | ASM_REGISTER_STATE_CHECK( |
| @@ -358,8 +347,7 @@ class FwdTrans8x8TestBase { · 9 unmodified lines | ||
| 358 | 347 | const int diff = dst[j] - src[j]; |
| 359 | 348 | #endif |
| 360 | 349 | const int error = diff * diff; |
| 361 | − if (max_error < error) | |
| 362 | − max_error = error; | |
| 350 | + if (max_error < error) max_error = error; | |
| 363 | 351 | total_error += error; |
| 364 | 352 | |
| 365 | 353 | const int coeff_diff = test_temp_block[j] - ref_temp_block[j]; |
| @@ -370,7 +358,7 @@ class FwdTrans8x8TestBase { · 4 unmodified lines | ||
| 370 | 358 | << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has" |
| 371 | 359 | << "an individual roundtrip error > 1"; |
| 372 | 360 | |
| 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) | |
| 374 | 362 | << "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average" |
| 375 | 363 | << " roundtrip error > 1/5 per block"; |
| 376 | 364 | |
| @@ -418,8 +406,8 @@ class FwdTrans8x8TestBase { · 41 unmodified lines | ||
| 418 | 406 | ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_)); |
| 419 | 407 | #if CONFIG_VP9_HIGHBITDEPTH |
| 420 | 408 | } 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_)); | |
| 423 | 411 | #endif |
| 424 | 412 | } |
| 425 | 413 | |
| @@ -432,8 +420,7 @@ class FwdTrans8x8TestBase { · 6 unmodified lines | ||
| 432 | 420 | #endif |
| 433 | 421 | const uint32_t error = diff * diff; |
| 434 | 422 | 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; | |
| 437 | 424 | } |
| 438 | 425 | } |
| 439 | 426 | } |
| @@ -461,13 +448,12 @@ class FwdTrans8x8TestBase { · 21 unmodified lines | ||
| 461 | 448 | const int32_t diff = coeff[j] - coeff_r[j]; |
| 462 | 449 | const uint32_t error = diff * diff; |
| 463 | 450 | 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; | |
| 466 | 452 | } |
| 467 | 453 | } |
| 468 | 454 | } |
| 469 | 455 | |
| 470 | −void CompareInvReference(IdctFunc ref_txfm, int thresh) { | |
| 456 | + void CompareInvReference(IdctFunc ref_txfm, int thresh) { | |
| 471 | 457 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 472 | 458 | const int count_test_block = 10000; |
| 473 | 459 | const int eob = 12; |
| @@ -484,7 +470,7 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { · 10 unmodified lines | ||
| 484 | 470 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 485 | 471 | if (j < eob) { |
| 486 | 472 | // 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)); | |
| 488 | 474 | } else { |
| 489 | 475 | coeff[scan[j]] = 0; |
| 490 | 476 | } |
| @@ -504,8 +490,8 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { · 13 unmodified lines | ||
| 504 | 490 | #if CONFIG_VP9_HIGHBITDEPTH |
| 505 | 491 | } else { |
| 506 | 492 | 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_)); | |
| 509 | 495 | #endif |
| 510 | 496 | } |
| 511 | 497 | |
| @@ -517,9 +503,8 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { · 5 unmodified lines | ||
| 517 | 503 | const int diff = dst[j] - ref[j]; |
| 518 | 504 | #endif |
| 519 | 505 | 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; | |
| 523 | 508 | } |
| 524 | 509 | } |
| 525 | 510 | } |
| @@ -530,17 +515,16 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) { · 4 unmodified lines | ||
| 530 | 515 | int mask_; |
| 531 | 516 | }; |
| 532 | 517 | |
| 533 | −class FwdTrans8x8DCT | |
| 534 | − : public FwdTrans8x8TestBase, | |
| 535 | − public ::testing::TestWithParam<Dct8x8Param> { | |
| 518 | +class FwdTrans8x8DCT : public FwdTrans8x8TestBase, | |
| 519 | + public ::testing::TestWithParam<Dct8x8Param> { | |
| 536 | 520 | public: |
| 537 | 521 | virtual ~FwdTrans8x8DCT() {} |
| 538 | 522 | |
| 539 | 523 | virtual void SetUp() { |
| 540 | 524 | fwd_txfm_ = GET_PARAM(0); |
| 541 | 525 | inv_txfm_ = GET_PARAM(1); |
| 542 | − tx_type_ = GET_PARAM(2); | |
| 543 | − pitch_ = 8; | |
| 526 | + tx_type_ = GET_PARAM(2); | |
| 527 | + pitch_ = 8; | |
| 544 | 528 | fwd_txfm_ref = fdct8x8_ref; |
| 545 | 529 | bit_depth_ = GET_PARAM(3); |
| 546 | 530 | mask_ = (1 << bit_depth_) - 1; |
| @@ -560,37 +544,26 @@ class FwdTrans8x8DCT · 13 unmodified lines | ||
| 560 | 544 | IdctFunc inv_txfm_; |
| 561 | 545 | }; |
| 562 | 546 | |
| 563 | −TEST_P(FwdTrans8x8DCT, SignBiasCheck) { | |
| 564 | − RunSignBiasCheck(); | |
| 565 | −} | |
| 547 | +TEST_P(FwdTrans8x8DCT, SignBiasCheck) { RunSignBiasCheck(); } | |
| 566 | 548 | |
| 567 | −TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) { | |
| 568 | − RunRoundTripErrorCheck(); | |
| 569 | −} | |
| 549 | +TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) { RunRoundTripErrorCheck(); } | |
| 570 | 550 | |
| 571 | −TEST_P(FwdTrans8x8DCT, ExtremalCheck) { | |
| 572 | − RunExtremalCheck(); | |
| 573 | −} | |
| 551 | +TEST_P(FwdTrans8x8DCT, ExtremalCheck) { RunExtremalCheck(); } | |
| 574 | 552 | |
| 575 | −TEST_P(FwdTrans8x8DCT, FwdAccuracyCheck) { | |
| 576 | − RunFwdAccuracyCheck(); | |
| 577 | −} | |
| 553 | +TEST_P(FwdTrans8x8DCT, FwdAccuracyCheck) { RunFwdAccuracyCheck(); } | |
| 578 | 554 | |
| 579 | −TEST_P(FwdTrans8x8DCT, InvAccuracyCheck) { | |
| 580 | − RunInvAccuracyCheck(); | |
| 581 | −} | |
| 555 | +TEST_P(FwdTrans8x8DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); } | |
| 582 | 556 | |
| 583 | −class FwdTrans8x8HT | |
| 584 | − : public FwdTrans8x8TestBase, | |
| 585 | − public ::testing::TestWithParam<Ht8x8Param> { | |
| 557 | +class FwdTrans8x8HT : public FwdTrans8x8TestBase, | |
| 558 | + public ::testing::TestWithParam<Ht8x8Param> { | |
| 586 | 559 | public: |
| 587 | 560 | virtual ~FwdTrans8x8HT() {} |
| 588 | 561 | |
| 589 | 562 | virtual void SetUp() { |
| 590 | 563 | fwd_txfm_ = GET_PARAM(0); |
| 591 | 564 | inv_txfm_ = GET_PARAM(1); |
| 592 | − tx_type_ = GET_PARAM(2); | |
| 593 | − pitch_ = 8; | |
| 565 | + tx_type_ = GET_PARAM(2); | |
| 566 | + pitch_ = 8; | |
| 594 | 567 | fwd_txfm_ref = fht8x8_ref; |
| 595 | 568 | bit_depth_ = GET_PARAM(3); |
| 596 | 569 | mask_ = (1 << bit_depth_) - 1; |
| @@ -610,21 +583,14 @@ class FwdTrans8x8HT · 13 unmodified lines | ||
| 610 | 583 | IhtFunc inv_txfm_; |
| 611 | 584 | }; |
| 612 | 585 | |
| 613 | −TEST_P(FwdTrans8x8HT, SignBiasCheck) { | |
| 614 | − RunSignBiasCheck(); | |
| 615 | −} | |
| 586 | +TEST_P(FwdTrans8x8HT, SignBiasCheck) { RunSignBiasCheck(); } | |
| 616 | 587 | |
| 617 | −TEST_P(FwdTrans8x8HT, RoundTripErrorCheck) { | |
| 618 | − RunRoundTripErrorCheck(); | |
| 619 | −} | |
| 588 | +TEST_P(FwdTrans8x8HT, RoundTripErrorCheck) { RunRoundTripErrorCheck(); } | |
| 620 | 589 | |
| 621 | −TEST_P(FwdTrans8x8HT, ExtremalCheck) { | |
| 622 | − RunExtremalCheck(); | |
| 623 | −} | |
| 590 | +TEST_P(FwdTrans8x8HT, ExtremalCheck) { RunExtremalCheck(); } | |
| 624 | 591 | |
| 625 | −class InvTrans8x8DCT | |
| 626 | − : public FwdTrans8x8TestBase, | |
| 627 | − public ::testing::TestWithParam<Idct8x8Param> { | |
| 592 | +class InvTrans8x8DCT : public FwdTrans8x8TestBase, | |
| 593 | + public ::testing::TestWithParam<Idct8x8Param> { | |
| 628 | 594 | public: |
| 629 | 595 | virtual ~InvTrans8x8DCT() {} |
| 630 | 596 | |
| @@ -664,10 +630,10 @@ INSTANTIATE_TEST_CASE_P( · 33 unmodified lines | ||
| 664 | 630 | make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10), |
| 665 | 631 | make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12))); |
| 666 | 632 | #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))); | |
| 671 | 637 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 672 | 638 | |
| 673 | 639 | #if CONFIG_VP9_HIGHBITDEPTH |
| @@ -697,11 +663,10 @@ INSTANTIATE_TEST_CASE_P( · 23 unmodified lines | ||
| 697 | 663 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 698 | 664 | |
| 699 | 665 | #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))); | |
| 705 | 670 | #endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 706 | 671 | |
| 707 | 672 | #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| @@ -715,11 +680,10 @@ INSTANTIATE_TEST_CASE_P( · 7 unmodified lines | ||
| 715 | 680 | #endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 716 | 681 | |
| 717 | 682 | #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))); | |
| 723 | 687 | INSTANTIATE_TEST_CASE_P( |
| 724 | 688 | SSE2, FwdTrans8x8HT, |
| 725 | 689 | ::testing::Values( |
| @@ -732,16 +696,16 @@ INSTANTIATE_TEST_CASE_P( · 6 unmodified lines | ||
| 732 | 696 | #if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 733 | 697 | INSTANTIATE_TEST_CASE_P( |
| 734 | 698 | 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))); | |
| 745 | 709 | |
| 746 | 710 | INSTANTIATE_TEST_CASE_P( |
| 747 | 711 | SSE2, FwdTrans8x8HT, |
| @@ -756,30 +720,27 @@ INSTANTIATE_TEST_CASE_P( · 8 unmodified lines | ||
| 756 | 720 | INSTANTIATE_TEST_CASE_P( |
| 757 | 721 | SSE2, InvTrans8x8DCT, |
| 758 | 722 | ::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))); | |
| 767 | 729 | #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 768 | 730 | |
| 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))); | |
| 776 | 737 | #endif |
| 777 | 738 | |
| 778 | 739 | #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))); | |
| 783 | 744 | INSTANTIATE_TEST_CASE_P( |
| 784 | 745 | MSA, FwdTrans8x8HT, |
| 785 | 746 | ::testing::Values( |
| @@ -13,12 +13,11 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | namespace { |
| 15 | 15 | |
| 16 | −class VP9FrameSizeTestsLarge | |
| 17 | − : public ::libvpx_test::EncoderTest, | |
| 18 | − public ::testing::Test { | |
| 16 | +class VP9FrameSizeTestsLarge : public ::libvpx_test::EncoderTest, | |
| 17 | + public ::testing::Test { | |
| 19 | 18 | 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) {} | |
| 22 | 21 | virtual ~VP9FrameSizeTestsLarge() {} |
| 23 | 22 | |
| 24 | 23 | virtual void SetUp() { |
| @@ -27,7 +26,7 @@ class VP9FrameSizeTestsLarge · 2 unmodified lines | ||
| 27 | 26 | } |
| 28 | 27 | |
| 29 | 28 | virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec, |
| 30 | − const libvpx_test::VideoSource& /*video*/, | |
| 29 | + const libvpx_test::VideoSource & /*video*/, | |
| 31 | 30 | libvpx_test::Decoder *decoder) { |
| 32 | 31 | EXPECT_EQ(expected_res_, res_dec) << decoder->DecodeError(); |
| 33 | 32 | return !::testing::Test::HasFailure(); |
| @@ -67,13 +66,13 @@ TEST_F(VP9FrameSizeTestsLarge, ValidSizes) { · 33 unmodified lines | ||
| 67 | 66 | expected_res_ = VPX_CODEC_OK; |
| 68 | 67 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 69 | 68 | #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. | |
| 77 | 76 | #if defined(_WIN32) && !defined(_WIN64) || defined(__OS2__) |
| 78 | 77 | video.SetSize(4096, 3072); |
| 79 | 78 | #else |
| @@ -80,8 +80,8 @@ void reference_hadamard16x16(const int16_t *a, int a_stride, int16_t *b) { · 79 unmodified lines | ||
| 80 | 80 | const int16_t b3 = (a2 - a3) >> 1; |
| 81 | 81 | |
| 82 | 82 | /* 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; | |
| 85 | 85 | b[128] = b0 - b2; |
| 86 | 86 | b[192] = b1 - b3; |
| 87 | 87 | |
| @@ -21,14 +21,11 @@ namespace libvpx_test { · 20 unmodified lines | ||
| 21 | 21 | // so that we can do actual file encodes. |
| 22 | 22 | class I420VideoSource : public YUVVideoSource { |
| 23 | 23 | 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, | |
| 27 | 26 | 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) {} | |
| 32 | 29 | }; |
| 33 | 30 | |
| 34 | 31 | } // namespace libvpx_test |
| @@ -29,9 +29,8 @@ void reference_dct_1d(double input[8], double output[8]) { · 28 unmodified lines | ||
| 29 | 29 | for (int k = 0; k < 8; k++) { |
| 30 | 30 | output[k] = 0.0; |
| 31 | 31 | 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; | |
| 35 | 34 | } |
| 36 | 35 | } |
| 37 | 36 | |
| @@ -39,24 +38,19 @@ void reference_dct_2d(int16_t input[64], double output[64]) { · 1 unmodified line | ||
| 39 | 38 | // First transform columns |
| 40 | 39 | for (int i = 0; i < 8; ++i) { |
| 41 | 40 | 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]; | |
| 44 | 42 | 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]; | |
| 47 | 44 | } |
| 48 | 45 | // Then transform rows |
| 49 | 46 | for (int i = 0; i < 8; ++i) { |
| 50 | 47 | 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]; | |
| 53 | 49 | 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]; | |
| 56 | 51 | } |
| 57 | 52 | // 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; | |
| 60 | 54 | } |
| 61 | 55 | |
| 62 | 56 | TEST(VP9Idct8x8Test, AccuracyCheck) { |
| @@ -73,8 +67,7 @@ TEST(VP9Idct8x8Test, AccuracyCheck) { · 10 unmodified lines | ||
| 73 | 67 | dst[j] = rnd.Rand8(); |
| 74 | 68 | } |
| 75 | 69 | // 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]; | |
| 78 | 71 | |
| 79 | 72 | reference_dct_2d(input, output_r); |
| 80 | 73 | for (int j = 0; j < 64; ++j) |
| @@ -83,9 +76,8 @@ TEST(VP9Idct8x8Test, AccuracyCheck) { · 2 unmodified lines | ||
| 83 | 76 | for (int j = 0; j < 64; ++j) { |
| 84 | 77 | const int diff = dst[j] - src[j]; |
| 85 | 78 | 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; | |
| 89 | 81 | } |
| 90 | 82 | } |
| 91 | 83 | } |
| @@ -34,21 +34,19 @@ std::ostream &operator<<(std::ostream &os, const DecodeParam &dp) { · 33 unmodified lines | ||
| 34 | 34 | return os << "threads: " << dp.threads << " file: " << dp.filename; |
| 35 | 35 | } |
| 36 | 36 | |
| 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> { | |
| 40 | 39 | protected: |
| 41 | 40 | InvalidFileTest() : DecoderTest(GET_PARAM(0)), res_file_(NULL) {} |
| 42 | 41 | |
| 43 | 42 | virtual ~InvalidFileTest() { |
| 44 | − if (res_file_ != NULL) | |
| 45 | − fclose(res_file_); | |
| 43 | + if (res_file_ != NULL) fclose(res_file_); | |
| 46 | 44 | } |
| 47 | 45 | |
| 48 | 46 | void OpenResFile(const std::string &res_file_name_) { |
| 49 | 47 | res_file_ = libvpx_test::OpenTestDataFile(res_file_name_); |
| 50 | 48 | ASSERT_TRUE(res_file_ != NULL) << "Result file open failed. Filename: " |
| 51 | − << res_file_name_; | |
| 49 | + << res_file_name_; | |
| 52 | 50 | } |
| 53 | 51 | |
| 54 | 52 | virtual bool HandleDecodeResult( |
| @@ -72,8 +70,9 @@ class InvalidFileTest · 17 unmodified lines | ||
| 72 | 70 | EXPECT_TRUE(res_dec == expected_res_dec || |
| 73 | 71 | res_dec == VPX_CODEC_CORRUPT_FRAME) |
| 74 | 72 | << "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; | |
| 77 | 76 | } else { |
| 78 | 77 | EXPECT_EQ(expected_res_dec, res_dec) |
| 79 | 78 | << "Results don't match: frame number = " << video.frame_number() |
| @@ -119,25 +118,23 @@ class InvalidFileTest · 39 unmodified lines | ||
| 119 | 118 | FILE *res_file_; |
| 120 | 119 | }; |
| 121 | 120 | |
| 122 | −TEST_P(InvalidFileTest, ReturnCode) { | |
| 123 | − RunTest(); | |
| 124 | −} | |
| 121 | +TEST_P(InvalidFileTest, ReturnCode) { RunTest(); } | |
| 125 | 122 | |
| 126 | 123 | const DecodeParam kVP9InvalidFileTests[] = { |
| 127 | − {1, "invalid-vp90-02-v2.webm"}, | |
| 124 | + { 1, "invalid-vp90-02-v2.webm" }, | |
| 128 | 125 | #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" }, | |
| 130 | 127 | #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" }, | |
| 141 | 138 | }; |
| 142 | 139 | |
| 143 | 140 | VP9_INSTANTIATE_TEST_CASE(InvalidFileTest, |
| @@ -149,34 +146,34 @@ class InvalidFileInvalidPeekTest : public InvalidFileTest { · 5 unmodified lines | ||
| 149 | 146 | protected: |
| 150 | 147 | InvalidFileInvalidPeekTest() : InvalidFileTest() {} |
| 151 | 148 | virtual void HandlePeekResult(libvpx_test::Decoder *const /*decoder*/, |
| 152 | − libvpx_test::CompressedVideoSource* /*video*/, | |
| 149 | + libvpx_test::CompressedVideoSource * /*video*/, | |
| 153 | 150 | const vpx_codec_err_t /*res_peek*/) {} |
| 154 | 151 | }; |
| 155 | 152 | |
| 156 | −TEST_P(InvalidFileInvalidPeekTest, ReturnCode) { | |
| 157 | − RunTest(); | |
| 158 | −} | |
| 153 | +TEST_P(InvalidFileInvalidPeekTest, ReturnCode) { RunTest(); } | |
| 159 | 154 | |
| 160 | 155 | const DecodeParam kVP9InvalidFileInvalidPeekTests[] = { |
| 161 | − {1, "invalid-vp90-01-v3.webm"}, | |
| 156 | + { 1, "invalid-vp90-01-v3.webm" }, | |
| 162 | 157 | }; |
| 163 | 158 | |
| 164 | 159 | VP9_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest, |
| 165 | 160 | ::testing::ValuesIn(kVP9InvalidFileInvalidPeekTests)); |
| 166 | 161 | |
| 167 | 162 | 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" }, | |
| 174 | 171 | }; |
| 175 | 172 | |
| 176 | 173 | INSTANTIATE_TEST_CASE_P( |
| 177 | 174 | VP9MultiThreaded, InvalidFileTest, |
| 178 | 175 | ::testing::Combine( |
| 179 | 176 | ::testing::Values( |
| 180 | − static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)), | |
| 177 | + static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)), | |
| 181 | 178 | ::testing::ValuesIn(kMultiThreadedVP9InvalidFileTests))); |
| 182 | 179 | } // namespace |
| @@ -29,19 +29,13 @@ static unsigned int MemGetLe32(const uint8_t *mem) { · 28 unmodified lines | ||
| 29 | 29 | class IVFVideoSource : public CompressedVideoSource { |
| 30 | 30 | public: |
| 31 | 31 | 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) {} | |
| 39 | 34 | |
| 40 | 35 | virtual ~IVFVideoSource() { |
| 41 | 36 | delete[] compressed_frame_buf_; |
| 42 | 37 | |
| 43 | − if (input_file_) | |
| 44 | − fclose(input_file_); | |
| 38 | + if (input_file_) fclose(input_file_); | |
| 45 | 39 | } |
| 46 | 40 | |
| 47 | 41 | virtual void Init() { |
| @@ -54,15 +48,16 @@ class IVFVideoSource : public CompressedVideoSource { · 6 unmodified lines | ||
| 54 | 48 | virtual void Begin() { |
| 55 | 49 | input_file_ = OpenTestDataFile(file_name_); |
| 56 | 50 | ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: " |
| 57 | − << file_name_; | |
| 51 | + << file_name_; | |
| 58 | 52 | |
| 59 | 53 | // Read file header |
| 60 | 54 | uint8_t file_hdr[kIvfFileHdrSize]; |
| 61 | 55 | ASSERT_EQ(kIvfFileHdrSize, fread(file_hdr, 1, kIvfFileHdrSize, input_file_)) |
| 62 | 56 | << "File header read failed."; |
| 63 | 57 | // 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."; | |
| 66 | 61 | |
| 67 | 62 | FillFrame(); |
| 68 | 63 | } |
| @@ -76,8 +71,8 @@ class IVFVideoSource : public CompressedVideoSource { · 7 unmodified lines | ||
| 76 | 71 | ASSERT_TRUE(input_file_ != NULL); |
| 77 | 72 | uint8_t frame_hdr[kIvfFrameHdrSize]; |
| 78 | 73 | // 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) { | |
| 81 | 76 | end_of_file_ = true; |
| 82 | 77 | } else { |
| 83 | 78 | end_of_file_ = false; |
| @@ -17,8 +17,9 @@ · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | namespace { |
| 19 | 19 | |
| 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> { | |
| 22 | 23 | protected: |
| 23 | 24 | KeyframeTest() : EncoderTest(GET_PARAM(0)) {} |
| 24 | 25 | virtual ~KeyframeTest() {} |
| @@ -65,8 +66,7 @@ TEST_P(KeyframeTest, TestRandomVideoSource) { · 40 unmodified lines | ||
| 65 | 66 | |
| 66 | 67 | // In realtime mode - auto placed keyframes are exceedingly rare, don't |
| 67 | 68 | // 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); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | TEST_P(KeyframeTest, TestDisableKeyframes) { |
| @@ -114,8 +114,7 @@ TEST_P(KeyframeTest, TestAutoKeyframe) { · 41 unmodified lines | ||
| 114 | 114 | // may not produce a keyframe like we expect. This is necessary when running |
| 115 | 115 | // on very slow environments (like Valgrind). The step -11 was determined |
| 116 | 116 | // 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; | |
| 119 | 118 | |
| 120 | 119 | // This clip has a cut scene every 30 frames -> Frame 0, 30, 60, 90, 120. |
| 121 | 120 | // 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 | ||
| 135 | 134 | iter != kf_pts_list_.end(); ++iter) { |
| 136 | 135 | if (deadline_ == VPX_DL_REALTIME && *iter > 0) |
| 137 | 136 | EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame " |
| 138 | − << *iter; | |
| 137 | + << *iter; | |
| 139 | 138 | else |
| 140 | 139 | EXPECT_EQ(0, *iter % 30) << "Unexpected keyframe at frame " << *iter; |
| 141 | 140 | } |
| @@ -19,12 +19,9 @@ class LevelTest · 18 unmodified lines | ||
| 19 | 19 | public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> { |
| 20 | 20 | protected: |
| 21 | 21 | 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) {} | |
| 28 | 25 | virtual ~LevelTest() {} |
| 29 | 26 | |
| 30 | 27 | virtual void SetUp() { |
| @@ -36,8 +36,7 @@ const int number_of_iterations = 10000; · 35 unmodified lines | ||
| 36 | 36 | |
| 37 | 37 | #if CONFIG_VP9_HIGHBITDEPTH |
| 38 | 38 | 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); | |
| 41 | 40 | typedef void (*dual_loop_op_t)(uint16_t *s, int p, const uint8_t *blimit0, |
| 42 | 41 | const uint8_t *limit0, const uint8_t *thresh0, |
| 43 | 42 | const uint8_t *blimit1, const uint8_t *limit1, |
| @@ -108,21 +107,18 @@ TEST_P(Loop8Test6Param, OperationCheck) { · 64 unmodified lines | ||
| 108 | 107 | for (int i = 0; i < count_test_block; ++i) { |
| 109 | 108 | int err_count = 0; |
| 110 | 109 | 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 }; | |
| 115 | 113 | 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 }; | |
| 120 | 117 | 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; | |
| 126 | 122 | |
| 127 | 123 | uint16_t tmp_s[kNumCoeffs]; |
| 128 | 124 | int j = 0; |
| @@ -158,7 +154,7 @@ TEST_P(Loop8Test6Param, OperationCheck) { · 29 unmodified lines | ||
| 158 | 154 | ASM_REGISTER_STATE_CHECK( |
| 159 | 155 | loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd)); |
| 160 | 156 | #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); | |
| 162 | 158 | ASM_REGISTER_STATE_CHECK( |
| 163 | 159 | loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh)); |
| 164 | 160 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| @@ -206,20 +202,17 @@ TEST_P(Loop8Test6Param, ValueCheck) { · 41 unmodified lines | ||
| 206 | 202 | for (int i = 0; i < count_test_block; ++i) { |
| 207 | 203 | int err_count = 0; |
| 208 | 204 | 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 }; | |
| 213 | 208 | 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 }; | |
| 218 | 212 | 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 }; | |
| 223 | 216 | int32_t p = kNumCoeffs / 32; |
| 224 | 217 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 225 | 218 | s[j] = rnd.Rand16() & mask_; |
| @@ -230,7 +223,7 @@ TEST_P(Loop8Test6Param, ValueCheck) { · 4 unmodified lines | ||
| 230 | 223 | ASM_REGISTER_STATE_CHECK( |
| 231 | 224 | loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd)); |
| 232 | 225 | #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); | |
| 234 | 227 | ASM_REGISTER_STATE_CHECK( |
| 235 | 228 | loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh)); |
| 236 | 229 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| @@ -256,43 +249,37 @@ TEST_P(Loop8Test9Param, OperationCheck) { · 19 unmodified lines | ||
| 256 | 249 | DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); |
| 257 | 250 | DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); |
| 258 | 251 | #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]); | |
| 261 | 254 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 262 | 255 | int err_count_total = 0; |
| 263 | 256 | int first_failure = -1; |
| 264 | 257 | for (int i = 0; i < count_test_block; ++i) { |
| 265 | 258 | int err_count = 0; |
| 266 | 259 | 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 }; | |
| 271 | 263 | 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 }; | |
| 276 | 267 | 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 }; | |
| 281 | 271 | 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 }; | |
| 286 | 275 | 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 }; | |
| 291 | 279 | 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 }; | |
| 296 | 283 | int32_t p = kNumCoeffs / 32; |
| 297 | 284 | uint16_t tmp_s[kNumCoeffs]; |
| 298 | 285 | int j = 0; |
| @@ -325,17 +312,16 @@ TEST_P(Loop8Test9Param, OperationCheck) { · 26 unmodified lines | ||
| 325 | 312 | ref_s[j] = s[j]; |
| 326 | 313 | } |
| 327 | 314 | #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)); | |
| 333 | 320 | #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)); | |
| 339 | 325 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 340 | 326 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 341 | 327 | err_count += ref_s[j] != s[j]; |
| @@ -358,43 +344,37 @@ TEST_P(Loop8Test9Param, ValueCheck) { · 16 unmodified lines | ||
| 358 | 344 | DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); |
| 359 | 345 | DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); |
| 360 | 346 | #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]); | |
| 363 | 349 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 364 | 350 | int err_count_total = 0; |
| 365 | 351 | int first_failure = -1; |
| 366 | 352 | for (int i = 0; i < count_test_block; ++i) { |
| 367 | 353 | int err_count = 0; |
| 368 | 354 | 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 }; | |
| 373 | 358 | 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 }; | |
| 378 | 362 | 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 }; | |
| 383 | 366 | 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 }; | |
| 388 | 370 | 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 }; | |
| 393 | 374 | 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 }; | |
| 398 | 378 | int32_t p = kNumCoeffs / 32; // TODO(pdlf) can we have non-square here? |
| 399 | 379 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 400 | 380 | s[j] = rnd.Rand16() & mask_; |
| @@ -402,17 +382,16 @@ TEST_P(Loop8Test9Param, ValueCheck) { · 1 unmodified line | ||
| 402 | 382 | } |
| 403 | 383 | #if CONFIG_VP9_HIGHBITDEPTH |
| 404 | 384 | 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)); | |
| 410 | 390 | #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)); | |
| 416 | 395 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 417 | 396 | for (int j = 0; j < kNumCoeffs; ++j) { |
| 418 | 397 | err_count += ref_s[j] != s[j]; |
| @@ -434,129 +413,120 @@ using std::tr1::make_tuple; · 15 unmodified lines | ||
| 434 | 413 | #if CONFIG_VP9_HIGHBITDEPTH |
| 435 | 414 | INSTANTIATE_TEST_CASE_P( |
| 436 | 415 | 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))); | |
| 486 | 464 | #else |
| 487 | 465 | INSTANTIATE_TEST_CASE_P( |
| 488 | 466 | SSE2, Loop8Test6Param, |
| 489 | 467 | ::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), | |
| 494 | 470 | make_tuple(&vpx_lpf_horizontal_edge_8_sse2, |
| 495 | 471 | &vpx_lpf_horizontal_edge_8_c, 8), |
| 496 | 472 | make_tuple(&vpx_lpf_horizontal_edge_16_sse2, |
| 497 | 473 | &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))); | |
| 506 | 479 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 507 | 480 | #endif |
| 508 | 481 | |
| 509 | 482 | #if HAVE_AVX2 && (!CONFIG_VP9_HIGHBITDEPTH) |
| 510 | 483 | INSTANTIATE_TEST_CASE_P( |
| 511 | 484 | 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))); | |
| 517 | 489 | #endif |
| 518 | 490 | |
| 519 | 491 | #if HAVE_SSE2 |
| 520 | 492 | #if CONFIG_VP9_HIGHBITDEPTH |
| 521 | 493 | INSTANTIATE_TEST_CASE_P( |
| 522 | 494 | 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))); | |
| 548 | 519 | #else |
| 549 | 520 | INSTANTIATE_TEST_CASE_P( |
| 550 | 521 | 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))); | |
| 560 | 530 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 561 | 531 | #endif |
| 562 | 532 | |
| @@ -567,39 +537,33 @@ INSTANTIATE_TEST_CASE_P( · 4 unmodified lines | ||
| 567 | 537 | INSTANTIATE_TEST_CASE_P( |
| 568 | 538 | NEON, Loop8Test6Param, |
| 569 | 539 | ::testing::Values( |
| 570 | −#if HAVE_NEON_ASM | |
| 571 | 540 | // Using #if inside the macro is unsupported on MSVS but the tests are not |
| 572 | 541 | // currently built for MSVS with ARM and NEON. |
| 542 | +#if HAVE_NEON_ASM | |
| 573 | 543 | make_tuple(&vpx_lpf_horizontal_edge_8_neon, |
| 574 | 544 | &vpx_lpf_horizontal_edge_8_c, 8), |
| 575 | 545 | make_tuple(&vpx_lpf_horizontal_edge_16_neon, |
| 576 | 546 | &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), | |
| 581 | 550 | #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( | |
| 593 | 557 | #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), | |
| 598 | 562 | #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))); | |
| 603 | 567 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 604 | 568 | #endif // HAVE_NEON |
| 605 | 569 | |
| @@ -607,66 +571,52 @@ INSTANTIATE_TEST_CASE_P( · 1 unmodified line | ||
| 607 | 571 | INSTANTIATE_TEST_CASE_P( |
| 608 | 572 | DSPR2, Loop8Test6Param, |
| 609 | 573 | ::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))); | |
| 626 | 583 | |
| 627 | 584 | INSTANTIATE_TEST_CASE_P( |
| 628 | 585 | 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))); | |
| 638 | 594 | #endif // HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH |
| 639 | 595 | |
| 640 | 596 | #if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH) |
| 641 | 597 | INSTANTIATE_TEST_CASE_P( |
| 642 | 598 | MSA, Loop8Test6Param, |
| 643 | 599 | ::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), | |
| 650 | 604 | make_tuple(&vpx_lpf_horizontal_edge_16_msa, |
| 651 | 605 | &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))); | |
| 658 | 609 | |
| 659 | 610 | INSTANTIATE_TEST_CASE_P( |
| 660 | 611 | 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))); | |
| 670 | 620 | #endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH) |
| 671 | 621 | |
| 672 | 622 | } // namespace |
| @@ -17,9 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | namespace libvpx_test { |
| 18 | 18 | class MD5 { |
| 19 | 19 | public: |
| 20 | − MD5() { | |
| 21 | − MD5Init(&md5_); | |
| 22 | − } | |
| 20 | + MD5() { MD5Init(&md5_); } | |
| 23 | 21 | |
| 24 | 22 | void Add(const vpx_image_t *img) { |
| 25 | 23 | for (int plane = 0; plane < 3; ++plane) { |
| @@ -30,10 +28,13 @@ class MD5 { · 4 unmodified lines | ||
| 30 | 28 | // This works only for chroma_shift of 0 and 1. |
| 31 | 29 | const int bytes_per_sample = |
| 32 | 30 | (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; | |
| 37 | 38 | |
| 38 | 39 | for (int y = 0; y < h; ++y) { |
| 39 | 40 | MD5Update(&md5_, buf, w); |
| @@ -56,8 +57,8 @@ class MD5 { · 16 unmodified lines | ||
| 56 | 57 | |
| 57 | 58 | MD5Final(tmp, &ctx_tmp); |
| 58 | 59 | 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]; | |
| 61 | 62 | } |
| 62 | 63 | res_[32] = 0; |
| 63 | 64 | |
| @@ -23,9 +23,8 @@ namespace { · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | using ::libvpx_test::ACMRandom; |
| 25 | 25 | |
| 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); | |
| 29 | 28 | |
| 30 | 29 | class MinMaxTest : public ::testing::TestWithParam<MinMaxFunc> { |
| 31 | 30 | public: |
| @@ -39,9 +38,8 @@ class MinMaxTest : public ::testing::TestWithParam<MinMaxFunc> { · 7 unmodified lines | ||
| 39 | 38 | ACMRandom rnd_; |
| 40 | 39 | }; |
| 41 | 40 | |
| 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) { | |
| 45 | 43 | int min = 255; |
| 46 | 44 | int max = 0; |
| 47 | 45 | for (int i = 0; i < 8; i++) { |
| @@ -110,9 +108,9 @@ TEST_P(MinMaxTest, CompareReferenceAndVaryStride) { · 62 unmodified lines | ||
| 110 | 108 | reference_minmax(a, a_stride, b, b_stride, &min_ref, &max_ref); |
| 111 | 109 | ASM_REGISTER_STATE_CHECK(mm_func_(a, a_stride, b, b_stride, &min, &max)); |
| 112 | 110 | EXPECT_EQ(max_ref, max) << "when a_stride = " << a_stride |
| 113 | − << " and b_stride = " << b_stride;; | |
| 111 | + << " and b_stride = " << b_stride; | |
| 114 | 112 | EXPECT_EQ(min_ref, min) << "when a_stride = " << a_stride |
| 115 | − << " and b_stride = " << b_stride;; | |
| 113 | + << " and b_stride = " << b_stride; | |
| 116 | 114 | } |
| 117 | 115 | } |
| 118 | 116 | } |
| @@ -29,10 +29,8 @@ using libvpx_test::ACMRandom; · 28 unmodified lines | ||
| 29 | 29 | namespace { |
| 30 | 30 | typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride); |
| 31 | 31 | 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; | |
| 36 | 34 | const int kMaxNumCoeffs = 1024; |
| 37 | 35 | class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> { |
| 38 | 36 | public: |
| @@ -41,7 +39,7 @@ class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> { · 2 unmodified lines | ||
| 41 | 39 | ftxfm_ = GET_PARAM(0); |
| 42 | 40 | full_itxfm_ = GET_PARAM(1); |
| 43 | 41 | partial_itxfm_ = GET_PARAM(2); |
| 44 | − tx_size_ = GET_PARAM(3); | |
| 42 | + tx_size_ = GET_PARAM(3); | |
| 45 | 43 | last_nonzero_ = GET_PARAM(4); |
| 46 | 44 | } |
| 47 | 45 | |
| @@ -59,21 +57,11 @@ TEST_P(PartialIDctTest, RunQuantCheck) { · 11 unmodified lines | ||
| 59 | 57 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 60 | 58 | int size; |
| 61 | 59 | 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; | |
| 77 | 65 | } |
| 78 | 66 | DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]); |
| 79 | 67 | DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]); |
| @@ -99,11 +87,9 @@ TEST_P(PartialIDctTest, RunQuantCheck) { · 19 unmodified lines | ||
| 99 | 87 | for (int i = 0; i < count_test_block; ++i) { |
| 100 | 88 | // Initialize a test block with input range [-255, 255]. |
| 101 | 89 | 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; | |
| 104 | 91 | } 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; | |
| 107 | 93 | } else { |
| 108 | 94 | for (int j = 0; j < block_size; ++j) { |
| 109 | 95 | input_extreme_block[j] = rnd.Rand8() % 2 ? 255 : -255; |
| @@ -115,8 +101,8 @@ TEST_P(PartialIDctTest, RunQuantCheck) { · 5 unmodified lines | ||
| 115 | 101 | // quantization with maximum allowed step sizes |
| 116 | 102 | test_coef_block1[0] = (output_ref_block[0] / 1336) * 1336; |
| 117 | 103 | 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; | |
| 120 | 106 | } |
| 121 | 107 | |
| 122 | 108 | ASM_REGISTER_STATE_CHECK(full_itxfm_(test_coef_block1, dst1, size)); |
| @@ -125,8 +111,7 @@ TEST_P(PartialIDctTest, RunQuantCheck) { · 2 unmodified lines | ||
| 125 | 111 | for (int j = 0; j < block_size; ++j) { |
| 126 | 112 | const int diff = dst1[j] - dst2[j]; |
| 127 | 113 | const int error = diff * diff; |
| 128 | − if (max_error < error) | |
| 129 | − max_error = error; | |
| 114 | + if (max_error < error) max_error = error; | |
| 130 | 115 | } |
| 131 | 116 | } |
| 132 | 117 | |
| @@ -138,21 +123,11 @@ TEST_P(PartialIDctTest, ResultsMatch) { · 5 unmodified lines | ||
| 138 | 123 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 139 | 124 | int size; |
| 140 | 125 | 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; | |
| 156 | 131 | } |
| 157 | 132 | DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]); |
| 158 | 133 | DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]); |
| @@ -189,8 +164,7 @@ TEST_P(PartialIDctTest, ResultsMatch) { · 30 unmodified lines | ||
| 189 | 164 | for (int j = 0; j < block_size; ++j) { |
| 190 | 165 | const int diff = dst1[j] - dst2[j]; |
| 191 | 166 | const int error = diff * diff; |
| 192 | − if (max_error < error) | |
| 193 | − max_error = error; | |
| 167 | + if (max_error < error) max_error = error; | |
| 194 | 168 | } |
| 195 | 169 | } |
| 196 | 170 | |
| @@ -201,143 +175,82 @@ using std::tr1::make_tuple; · 4 unmodified lines | ||
| 201 | 175 | |
| 202 | 176 | INSTANTIATE_TEST_CASE_P( |
| 203 | 177 | 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))); | |
| 233 | 192 | |
| 234 | 193 | #if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 235 | 194 | INSTANTIATE_TEST_CASE_P( |
| 236 | 195 | 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))); | |
| 262 | 208 | #endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 263 | 209 | |
| 264 | 210 | #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 265 | 211 | INSTANTIATE_TEST_CASE_P( |
| 266 | 212 | 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))); | |
| 296 | 227 | #endif |
| 297 | 228 | |
| 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 | |
| 300 | 231 | INSTANTIATE_TEST_CASE_P( |
| 301 | 232 | 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))); | |
| 307 | 235 | #endif |
| 308 | 236 | |
| 309 | 237 | #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 310 | 238 | INSTANTIATE_TEST_CASE_P( |
| 311 | 239 | 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))); | |
| 341 | 254 | #endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
| 342 | 255 | |
| 343 | 256 | } // namespace |
| @@ -15,22 +15,16 @@ · 14 unmodified lines | ||
| 15 | 15 | #include "vpx/vpx_integer.h" |
| 16 | 16 | #include "vpx_mem/vpx_mem.h" |
| 17 | 17 | |
| 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); | |
| 25 | 21 | |
| 26 | 22 | namespace { |
| 27 | 23 | |
| 28 | 24 | class VPxPostProcessingFilterTest |
| 29 | 25 | : public ::testing::TestWithParam<PostProcFunc> { |
| 30 | 26 | public: |
| 31 | − virtual void TearDown() { | |
| 32 | − libvpx_test::ClearSystemState(); | |
| 33 | − } | |
| 27 | + virtual void TearDown() { libvpx_test::ClearSystemState(); } | |
| 34 | 28 | }; |
| 35 | 29 | |
| 36 | 30 | // Test routine for the VPx post-processing function |
| @@ -38,7 +32,7 @@ class VPxPostProcessingFilterTest · 1 unmodified line | ||
| 38 | 32 | |
| 39 | 33 | TEST_P(VPxPostProcessingFilterTest, FilterOutputCheck) { |
| 40 | 34 | // Size of the underlying data block that will be filtered. |
| 41 | − const int block_width = 16; | |
| 35 | + const int block_width = 16; | |
| 42 | 36 | const int block_height = 16; |
| 43 | 37 | |
| 44 | 38 | // 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 | ||
| 54 | 48 | const int output_size = output_width * output_height; |
| 55 | 49 | |
| 56 | 50 | 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)); | |
| 58 | 52 | 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)); | |
| 60 | 54 | |
| 61 | 55 | // Pointers to top-left pixel of block in the input and output images. |
| 62 | 56 | uint8_t *const src_image_ptr = src_image + (input_stride << 1); |
| @@ -80,13 +74,12 @@ TEST_P(VPxPostProcessingFilterTest, FilterOutputCheck) { · 17 unmodified lines | ||
| 80 | 74 | // Initialize pixels in the output to 99. |
| 81 | 75 | (void)memset(dst_image, 99, output_size); |
| 82 | 76 | |
| 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)); | |
| 86 | 80 | |
| 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 }; | |
| 90 | 83 | |
| 91 | 84 | pixel_ptr = dst_image_ptr; |
| 92 | 85 | for (int i = 0; i < block_height; ++i) { |
| @@ -102,16 +95,19 @@ TEST_P(VPxPostProcessingFilterTest, FilterOutputCheck) { · 9 unmodified lines | ||
| 102 | 95 | vpx_free(flimits); |
| 103 | 96 | }; |
| 104 | 97 | |
| 105 | −INSTANTIATE_TEST_CASE_P(C, VPxPostProcessingFilterTest, | |
| 98 | +INSTANTIATE_TEST_CASE_P( | |
| 99 | + C, VPxPostProcessingFilterTest, | |
| 106 | 100 | ::testing::Values(vpx_post_proc_down_and_across_mb_row_c)); |
| 107 | 101 | |
| 108 | 102 | #if HAVE_SSE2 |
| 109 | −INSTANTIATE_TEST_CASE_P(SSE2, VPxPostProcessingFilterTest, | |
| 103 | +INSTANTIATE_TEST_CASE_P( | |
| 104 | + SSE2, VPxPostProcessingFilterTest, | |
| 110 | 105 | ::testing::Values(vpx_post_proc_down_and_across_mb_row_sse2)); |
| 111 | 106 | #endif |
| 112 | 107 | |
| 113 | 108 | #if HAVE_MSA |
| 114 | −INSTANTIATE_TEST_CASE_P(MSA, VPxPostProcessingFilterTest, | |
| 109 | +INSTANTIATE_TEST_CASE_P( | |
| 110 | + MSA, VPxPostProcessingFilterTest, | |
| 115 | 111 | ::testing::Values(vpx_post_proc_down_and_across_mb_row_msa)); |
| 116 | 112 | #endif |
| 117 | 113 | |
| @@ -23,8 +23,7 @@ class RealtimeTest · 22 unmodified lines | ||
| 23 | 23 | : public ::libvpx_test::EncoderTest, |
| 24 | 24 | public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> { |
| 25 | 25 | protected: |
| 26 | − RealtimeTest() | |
| 27 | − : EncoderTest(GET_PARAM(0)), frame_packets_(0) {} | |
| 26 | + RealtimeTest() : EncoderTest(GET_PARAM(0)), frame_packets_(0) {} | |
| 28 | 27 | virtual ~RealtimeTest() {} |
| 29 | 28 | |
| 30 | 29 | virtual void SetUp() { |
| @@ -36,7 +36,7 @@ · 35 unmodified lines | ||
| 36 | 36 | #include <windows.h> |
| 37 | 37 | #include <winnt.h> |
| 38 | 38 | |
| 39 | −inline bool operator==(const M128A& lhs, const M128A& rhs) { | |
| 39 | +inline bool operator==(const M128A &lhs, const M128A &rhs) { | |
| 40 | 40 | return (lhs.Low == rhs.Low && lhs.High == rhs.High); |
| 41 | 41 | } |
| 42 | 42 | |
| @@ -51,7 +51,7 @@ class RegisterStateCheck { · 8 unmodified lines | ||
| 51 | 51 | ~RegisterStateCheck() { Check(); } |
| 52 | 52 | |
| 53 | 53 | private: |
| 54 | − static bool StoreRegisters(CONTEXT* const context) { | |
| 54 | + static bool StoreRegisters(CONTEXT *const context) { | |
| 55 | 55 | const HANDLE this_thread = GetCurrentThread(); |
| 56 | 56 | EXPECT_TRUE(this_thread != NULL); |
| 57 | 57 | context->ContextFlags = CONTEXT_FLOATING_POINT; |
| @@ -66,8 +66,8 @@ class RegisterStateCheck { · 8 unmodified lines | ||
| 66 | 66 | CONTEXT post_context; |
| 67 | 67 | ASSERT_TRUE(StoreRegisters(&post_context)); |
| 68 | 68 | |
| 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; | |
| 71 | 71 | for (int i = 6; i <= 15; ++i) { |
| 72 | 72 | EXPECT_EQ(*xmm_pre, *xmm_post) << "xmm" << i << " has been modified!"; |
| 73 | 73 | ++xmm_pre; |
| @@ -79,15 +79,16 @@ class RegisterStateCheck { · 5 unmodified lines | ||
| 79 | 79 | CONTEXT pre_context_; |
| 80 | 80 | }; |
| 81 | 81 | |
| 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) | |
| 86 | 87 | |
| 87 | 88 | } // namespace libvpx_test |
| 88 | 89 | |
| 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 | |
| 91 | 92 | |
| 92 | 93 | extern "C" { |
| 93 | 94 | // Save the d8-d15 registers into store. |
| @@ -110,18 +111,19 @@ class RegisterStateCheck { · 16 unmodified lines | ||
| 110 | 111 | int64_t post_store[8]; |
| 111 | 112 | vpx_push_neon(post_store); |
| 112 | 113 | 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"; | |
| 115 | 116 | } |
| 116 | 117 | } |
| 117 | 118 | |
| 118 | 119 | int64_t pre_store_[8]; |
| 119 | 120 | }; |
| 120 | 121 | |
| 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) | |
| 125 | 127 | |
| 126 | 128 | } // namespace libvpx_test |
| 127 | 129 | |
| @@ -165,10 +167,11 @@ class RegisterStateCheckMMX { · 37 unmodified lines | ||
| 165 | 167 | uint16_t pre_fpu_env_[14]; |
| 166 | 168 | }; |
| 167 | 169 | |
| 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) | |
| 172 | 175 | |
| 173 | 176 | } // namespace libvpx_test |
| 174 | 177 | |
| @@ -44,9 +44,9 @@ static void write_ivf_file_header(const vpx_codec_enc_cfg_t *const cfg, · 43 unmodified lines | ||
| 44 | 44 | header[1] = 'K'; |
| 45 | 45 | header[2] = 'I'; |
| 46 | 46 | 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) */ | |
| 50 | 50 | mem_put_le16(header + 12, cfg->g_w); /* width */ |
| 51 | 51 | mem_put_le16(header + 14, cfg->g_h); /* height */ |
| 52 | 52 | 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 | ||
| 68 | 68 | char header[12]; |
| 69 | 69 | vpx_codec_pts_t pts; |
| 70 | 70 | |
| 71 | − if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) | |
| 72 | − return; | |
| 71 | + if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) return; | |
| 73 | 72 | |
| 74 | 73 | pts = pkt->data.frame.pts; |
| 75 | 74 | mem_put_le32(header, static_cast<unsigned int>(pkt->data.frame.sz)); |
| @@ -92,12 +91,9 @@ struct FrameInfo { · 16 unmodified lines | ||
| 92 | 91 | unsigned int h; |
| 93 | 92 | }; |
| 94 | 93 | |
| 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) { | |
| 101 | 97 | if (frame < 10) { |
| 102 | 98 | *w = initial_w; |
| 103 | 99 | *h = initial_h; |
| @@ -219,7 +215,7 @@ void ScaleForFrameNumber(unsigned int frame, · 115 unmodified lines | ||
| 219 | 215 | return; |
| 220 | 216 | } |
| 221 | 217 | if (frame < 250) { |
| 222 | − *w = initial_w / 2; | |
| 218 | + *w = initial_w / 2; | |
| 223 | 219 | *h = initial_h / 2; |
| 224 | 220 | return; |
| 225 | 221 | } |
| @@ -268,8 +264,9 @@ class ResizingVideoSource : public ::libvpx_test::DummyVideoSource { · 42 unmodified lines | ||
| 268 | 264 | } |
| 269 | 265 | }; |
| 270 | 266 | |
| 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> { | |
| 273 | 270 | protected: |
| 274 | 271 | ResizeTest() : EncoderTest(GET_PARAM(0)) {} |
| 275 | 272 | |
| @@ -285,7 +282,7 @@ class ResizeTest : public ::libvpx_test::EncoderTest, · 9 unmodified lines | ||
| 285 | 282 | frame_info_list_.push_back(FrameInfo(pts, img.d_w, img.d_h)); |
| 286 | 283 | } |
| 287 | 284 | |
| 288 | − std::vector< FrameInfo > frame_info_list_; | |
| 285 | + std::vector<FrameInfo> frame_info_list_; | |
| 289 | 286 | }; |
| 290 | 287 | |
| 291 | 288 | TEST_P(ResizeTest, TestExternalResizeWorks) { |
| @@ -299,12 +296,12 @@ TEST_P(ResizeTest, TestExternalResizeWorks) { · 7 unmodified lines | ||
| 299 | 296 | const unsigned int frame = static_cast<unsigned>(info->pts); |
| 300 | 297 | unsigned int expected_w; |
| 301 | 298 | 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"; | |
| 308 | 305 | } |
| 309 | 306 | } |
| 310 | 307 | |
| @@ -315,10 +312,7 @@ class ResizeInternalTest : public ResizeTest { · 4 unmodified lines | ||
| 315 | 312 | protected: |
| 316 | 313 | #if WRITE_COMPRESSED_STREAM |
| 317 | 314 | 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) {} | |
| 322 | 316 | #else |
| 323 | 317 | ResizeInternalTest() : ResizeTest(), frame0_psnr_(0.0) {} |
| 324 | 318 | #endif |
| @@ -347,30 +341,29 @@ class ResizeInternalTest : public ResizeTest { · 22 unmodified lines | ||
| 347 | 341 | if (change_config_) { |
| 348 | 342 | int new_q = 60; |
| 349 | 343 | if (video->frame() == 0) { |
| 350 | − struct vpx_scaling_mode mode = {VP8E_ONETWO, VP8E_ONETWO}; | |
| 344 | + struct vpx_scaling_mode mode = { VP8E_ONETWO, VP8E_ONETWO }; | |
| 351 | 345 | encoder->Control(VP8E_SET_SCALEMODE, &mode); |
| 352 | 346 | } |
| 353 | 347 | if (video->frame() == 1) { |
| 354 | − struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL}; | |
| 348 | + struct vpx_scaling_mode mode = { VP8E_NORMAL, VP8E_NORMAL }; | |
| 355 | 349 | encoder->Control(VP8E_SET_SCALEMODE, &mode); |
| 356 | 350 | cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = new_q; |
| 357 | 351 | encoder->Config(&cfg_); |
| 358 | 352 | } |
| 359 | 353 | } else { |
| 360 | 354 | if (video->frame() == kStepDownFrame) { |
| 361 | − struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE}; | |
| 355 | + struct vpx_scaling_mode mode = { VP8E_FOURFIVE, VP8E_THREEFIVE }; | |
| 362 | 356 | encoder->Control(VP8E_SET_SCALEMODE, &mode); |
| 363 | 357 | } |
| 364 | 358 | if (video->frame() == kStepUpFrame) { |
| 365 | − struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL}; | |
| 359 | + struct vpx_scaling_mode mode = { VP8E_NORMAL, VP8E_NORMAL }; | |
| 366 | 360 | encoder->Control(VP8E_SET_SCALEMODE, &mode); |
| 367 | 361 | } |
| 368 | 362 | } |
| 369 | 363 | } |
| 370 | 364 | |
| 371 | 365 | 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]; | |
| 374 | 367 | EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0); |
| 375 | 368 | } |
| 376 | 369 | |
| @@ -379,8 +372,7 @@ class ResizeInternalTest : public ResizeTest { · 2 unmodified lines | ||
| 379 | 372 | ++out_frames_; |
| 380 | 373 | |
| 381 | 374 | // 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_); | |
| 384 | 376 | |
| 385 | 377 | // Write frame header and data. |
| 386 | 378 | write_ivf_frame_header(pkt, outfile_); |
| @@ -434,8 +426,9 @@ TEST_P(ResizeInternalTest, TestInternalResizeChangeConfig) { · 47 unmodified lines | ||
| 434 | 426 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 435 | 427 | } |
| 436 | 428 | |
| 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> { | |
| 439 | 432 | protected: |
| 440 | 433 | ResizeRealtimeTest() : EncoderTest(GET_PARAM(0)) {} |
| 441 | 434 | virtual ~ResizeRealtimeTest() {} |
| @@ -465,16 +458,13 @@ class ResizeRealtimeTest : public ::libvpx_test::EncoderTest, · 23 unmodified lines | ||
| 465 | 458 | frame_info_list_.push_back(FrameInfo(pts, img.d_w, img.d_h)); |
| 466 | 459 | } |
| 467 | 460 | |
| 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) { | |
| 470 | 462 | double mismatch_psnr = compute_psnr(img1, img2); |
| 471 | 463 | mismatch_psnr_ += mismatch_psnr; |
| 472 | 464 | ++mismatch_nframes_; |
| 473 | 465 | } |
| 474 | 466 | |
| 475 | − unsigned int GetMismatchFrames() { | |
| 476 | − return mismatch_nframes_; | |
| 477 | − } | |
| 467 | + unsigned int GetMismatchFrames() { return mismatch_nframes_; } | |
| 478 | 468 | |
| 479 | 469 | void DefaultConfig() { |
| 480 | 470 | cfg_.rc_buf_initial_sz = 500; |
| @@ -491,14 +481,14 @@ class ResizeRealtimeTest : public ::libvpx_test::EncoderTest, · 10 unmodified lines | ||
| 491 | 481 | // Enable dropped frames. |
| 492 | 482 | cfg_.rc_dropframe_thresh = 1; |
| 493 | 483 | // Enable error_resilience mode. |
| 494 | − cfg_.g_error_resilient = 1; | |
| 484 | + cfg_.g_error_resilient = 1; | |
| 495 | 485 | // Enable dynamic resizing. |
| 496 | 486 | cfg_.rc_resize_allowed = 1; |
| 497 | 487 | // Run at low bitrate. |
| 498 | 488 | cfg_.rc_target_bitrate = 200; |
| 499 | 489 | } |
| 500 | 490 | |
| 501 | − std::vector< FrameInfo > frame_info_list_; | |
| 491 | + std::vector<FrameInfo> frame_info_list_; | |
| 502 | 492 | int set_cpu_used_; |
| 503 | 493 | bool change_bitrate_; |
| 504 | 494 | double mismatch_psnr_; |
| @@ -521,12 +511,12 @@ TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) { · 16 unmodified lines | ||
| 521 | 511 | const unsigned int frame = static_cast<unsigned>(info->pts); |
| 522 | 512 | unsigned int expected_w; |
| 523 | 513 | 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"; | |
| 530 | 520 | EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); |
| 531 | 521 | } |
| 532 | 522 | } |
| @@ -618,10 +608,8 @@ TEST_P(ResizeRealtimeTest, TestInternalResizeDownUpChangeBitRate) { · 85 unmodified lines | ||
| 618 | 608 | } |
| 619 | 609 | |
| 620 | 610 | 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; | |
| 625 | 613 | return VPX_IMG_FMT_I420; |
| 626 | 614 | } |
| 627 | 615 | |
| @@ -629,10 +617,7 @@ class ResizeCspTest : public ResizeTest { · 1 unmodified line | ||
| 629 | 617 | protected: |
| 630 | 618 | #if WRITE_COMPRESSED_STREAM |
| 631 | 619 | 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) {} | |
| 636 | 621 | #else |
| 637 | 622 | ResizeCspTest() : ResizeTest(), frame0_psnr_(0.0) {} |
| 638 | 623 | #endif |
| @@ -671,8 +656,7 @@ class ResizeCspTest : public ResizeTest { · 32 unmodified lines | ||
| 671 | 656 | } |
| 672 | 657 | |
| 673 | 658 | 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]; | |
| 676 | 660 | EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0); |
| 677 | 661 | } |
| 678 | 662 | |
| @@ -681,8 +665,7 @@ class ResizeCspTest : public ResizeTest { · 2 unmodified lines | ||
| 681 | 665 | ++out_frames_; |
| 682 | 666 | |
| 683 | 667 | // 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_); | |
| 686 | 669 | |
| 687 | 670 | // Write frame header and data. |
| 688 | 671 | write_ivf_frame_header(pkt, outfile_); |
| @@ -8,7 +8,6 @@ · 7 unmodified lines | ||
| 8 | 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | − | |
| 12 | 11 | #include <string.h> |
| 13 | 12 | #include <limits.h> |
| 14 | 13 | #include <stdio.h> |
| @@ -25,7 +24,7 @@ · 10 unmodified lines | ||
| 25 | 24 | #include "vpx_mem/vpx_mem.h" |
| 26 | 25 | #include "vpx_ports/mem.h" |
| 27 | 26 | |
| 28 | −template<typename Function> | |
| 27 | +template <typename Function> | |
| 29 | 28 | struct TestParams { |
| 30 | 29 | TestParams(int w, int h, Function f, int bd = -1) |
| 31 | 30 | : width(w), height(h), bit_depth(bd), func(f) {} |
| @@ -50,24 +49,24 @@ typedef TestParams<SadMxNx4Func> SadMxNx4Param; · 18 unmodified lines | ||
| 50 | 49 | using libvpx_test::ACMRandom; |
| 51 | 50 | |
| 52 | 51 | namespace { |
| 53 | −template<typename ParamType> | |
| 52 | +template <typename ParamType> | |
| 54 | 53 | class SADTestBase : public ::testing::TestWithParam<ParamType> { |
| 55 | 54 | public: |
| 56 | − explicit SADTestBase(const ParamType& params) : params_(params) {} | |
| 55 | + explicit SADTestBase(const ParamType ¶ms) : params_(params) {} | |
| 57 | 56 | |
| 58 | 57 | virtual void SetUp() { |
| 59 | − source_data8_ = reinterpret_cast<uint8_t*>( | |
| 58 | + source_data8_ = reinterpret_cast<uint8_t *>( | |
| 60 | 59 | vpx_memalign(kDataAlignment, kDataBlockSize)); |
| 61 | − reference_data8_ = reinterpret_cast<uint8_t*>( | |
| 60 | + reference_data8_ = reinterpret_cast<uint8_t *>( | |
| 62 | 61 | 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))); | |
| 71 | 70 | |
| 72 | 71 | if (params_.bit_depth == -1) { |
| 73 | 72 | use_high_bit_depth_ = false; |
| @@ -167,13 +166,13 @@ class SADTestBase : public ::testing::TestWithParam<ParamType> { · 93 unmodified lines | ||
| 167 | 166 | for (int w = 0; w < params_.width; ++w) { |
| 168 | 167 | if (!use_high_bit_depth_) { |
| 169 | 168 | const int tmp = second_pred8[h * params_.width + w] + |
| 170 | − reference8[h * reference_stride_ + w]; | |
| 169 | + reference8[h * reference_stride_ + w]; | |
| 171 | 170 | const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); |
| 172 | 171 | sad += abs(source8[h * source_stride_ + w] - comp_pred); |
| 173 | 172 | #if CONFIG_VP9_HIGHBITDEPTH |
| 174 | 173 | } else { |
| 175 | 174 | const int tmp = second_pred16[h * params_.width + w] + |
| 176 | − reference16[h * reference_stride_ + w]; | |
| 175 | + reference16[h * reference_stride_ + w]; | |
| 177 | 176 | const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1); |
| 178 | 177 | sad += abs(source16[h * source_stride_ + w] - comp_pred); |
| 179 | 178 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| @@ -248,9 +247,8 @@ class SADx4Test : public SADTestBase<SadMxNx4Param> { · 68 unmodified lines | ||
| 248 | 247 | const uint8_t *references[] = { GetReference(0), GetReference(1), |
| 249 | 248 | GetReference(2), GetReference(3) }; |
| 250 | 249 | |
| 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)); | |
| 254 | 252 | } |
| 255 | 253 | |
| 256 | 254 | void CheckSADs() const { |
| @@ -453,7 +451,7 @@ TEST_P(SADx4Test, ShortSrc) { · 196 unmodified lines | ||
| 453 | 451 | } |
| 454 | 452 | |
| 455 | 453 | TEST_P(SADx4Test, SrcAlignedByWidth) { |
| 456 | − uint8_t * tmp_source_data = source_data_; | |
| 454 | + uint8_t *tmp_source_data = source_data_; | |
| 457 | 455 | source_data_ += params_.width; |
| 458 | 456 | FillRandom(source_data_, source_stride_); |
| 459 | 457 | FillRandom(GetReference(0), reference_stride_); |
| @@ -8,7 +8,6 @@ · 7 unmodified lines | ||
| 8 | 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | − | |
| 12 | 11 | #include <math.h> |
| 13 | 12 | #include <stddef.h> |
| 14 | 13 | #include <stdio.h> |
| @@ -33,14 +32,10 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 18 unmodified lines | ||
| 33 | 32 | unsigned int threshold[MAX_MB_SEGMENTS] = { 0, 100, 200, 300 }; |
| 34 | 33 | |
| 35 | 34 | 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, | |
| 44 | 39 | }; |
| 45 | 40 | |
| 46 | 41 | // Initialize elements of cpi with valid defaults. |
| @@ -60,17 +55,17 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 13 unmodified lines | ||
| 60 | 55 | |
| 61 | 56 | // Allocate memory for the source memory map. |
| 62 | 57 | unsigned char *roi_map = |
| 63 | − reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1)); | |
| 58 | + reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1)); | |
| 64 | 59 | memset(&roi_map[mbs >> 2], 1, (mbs >> 2)); |
| 65 | 60 | 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)); | |
| 67 | 62 | |
| 68 | 63 | // 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); | |
| 72 | 67 | 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"; | |
| 74 | 69 | |
| 75 | 70 | // Check that the values in the cpi structure get set as expected. |
| 76 | 71 | if (roi_retval == 0) { |
| @@ -83,9 +78,9 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 6 unmodified lines | ||
| 83 | 78 | for (int i = 0; i < MAX_MB_SEGMENTS; ++i) { |
| 84 | 79 | const int transq = internalq_trans[abs(delta_q[i])]; |
| 85 | 80 | 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; | |
| 89 | 84 | } |
| 90 | 85 | } |
| 91 | 86 | |
| @@ -93,7 +88,7 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 1 unmodified line | ||
| 93 | 88 | for (int i = 0; i < MAX_MB_SEGMENTS; ++i) { |
| 94 | 89 | if (cpi.segment_feature_data[MB_LVL_ALT_LF][i] != delta_lf[i]) { |
| 95 | 90 | EXPECT_EQ(delta_lf[i], cpi.segment_feature_data[MB_LVL_ALT_LF][i]) |
| 96 | − << "segment delta_lf error"; | |
| 91 | + << "segment delta_lf error"; | |
| 97 | 92 | break; |
| 98 | 93 | } |
| 99 | 94 | } |
| @@ -101,23 +96,21 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 1 unmodified line | ||
| 101 | 96 | // Check the breakout thresholds |
| 102 | 97 | for (int i = 0; i < MAX_MB_SEGMENTS; ++i) { |
| 103 | 98 | unsigned int breakout = |
| 104 | − static_cast<unsigned int>(cpi.segment_encode_breakout[i]); | |
| 99 | + static_cast<unsigned int>(cpi.segment_encode_breakout[i]); | |
| 105 | 100 | |
| 106 | 101 | if (threshold[i] != breakout) { |
| 107 | − EXPECT_EQ(threshold[i], breakout) | |
| 108 | − << "breakout threshold error"; | |
| 102 | + EXPECT_EQ(threshold[i], breakout) << "breakout threshold error"; | |
| 109 | 103 | break; |
| 110 | 104 | } |
| 111 | 105 | } |
| 112 | 106 | |
| 113 | 107 | // Segmentation, and segmentation update flages should be set. |
| 114 | 108 | EXPECT_EQ(1, cpi.mb.e_mbd.segmentation_enabled) |
| 115 | − << "segmentation_enabled error"; | |
| 109 | + << "segmentation_enabled error"; | |
| 116 | 110 | EXPECT_EQ(1, cpi.mb.e_mbd.update_mb_segmentation_map) |
| 117 | − << "update_mb_segmentation_map error"; | |
| 111 | + << "update_mb_segmentation_map error"; | |
| 118 | 112 | EXPECT_EQ(1, cpi.mb.e_mbd.update_mb_segmentation_data) |
| 119 | − << "update_mb_segmentation_data error"; | |
| 120 | − | |
| 113 | + << "update_mb_segmentation_data error"; | |
| 121 | 114 | |
| 122 | 115 | // Try a range of delta q and lf parameters (some legal, some not) |
| 123 | 116 | for (int i = 0; i < 1000; ++i) { |
| @@ -128,57 +121,54 @@ TEST(VP8RoiMapTest, ParameterCheck) { · 4 unmodified lines | ||
| 128 | 121 | rand_deltas[2] = rnd(160) - 80; |
| 129 | 122 | rand_deltas[3] = rnd(160) - 80; |
| 130 | 123 | |
| 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; | |
| 135 | 129 | |
| 136 | 130 | // 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); | |
| 140 | 134 | EXPECT_EQ(deltas_valid, roi_retval) << "dq range check error"; |
| 141 | 135 | |
| 142 | 136 | // One delta_q error shown at a time |
| 143 | − if (deltas_valid != roi_retval) | |
| 144 | − break; | |
| 137 | + if (deltas_valid != roi_retval) break; | |
| 145 | 138 | |
| 146 | 139 | // 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); | |
| 150 | 143 | EXPECT_EQ(deltas_valid, roi_retval) << "dlf range check error"; |
| 151 | 144 | |
| 152 | 145 | // One delta loop filter error shown at a time |
| 153 | − if (deltas_valid != roi_retval) | |
| 154 | − break; | |
| 146 | + if (deltas_valid != roi_retval) break; | |
| 155 | 147 | } |
| 156 | 148 | |
| 157 | 149 | // Test that we report and error if cyclic refresh is enabled. |
| 158 | 150 | 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); | |
| 162 | 154 | EXPECT_EQ(-1, roi_retval) << "cyclic refresh check error"; |
| 163 | 155 | cpi.cyclic_refresh_mode_enabled = 0; |
| 164 | 156 | |
| 165 | 157 | // 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); | |
| 169 | 161 | EXPECT_EQ(-1, roi_retval) << "MB rows bounds check error"; |
| 170 | 162 | |
| 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); | |
| 174 | 166 | EXPECT_EQ(-1, roi_retval) << "MB cols bounds check error"; |
| 175 | 167 | } |
| 176 | 168 | |
| 177 | 169 | // 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); | |
| 182 | 172 | }; |
| 183 | 173 | |
| 184 | 174 | } // namespace |
| @@ -25,22 +25,19 @@ · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | namespace { |
| 27 | 27 | |
| 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, | |
| 33 | 30 | int dst_pitch); |
| 34 | 31 | |
| 35 | 32 | typedef std::tr1::tuple<int, int, SixtapPredictFunc> SixtapPredictParam; |
| 36 | 33 | |
| 37 | −class SixtapPredictTest | |
| 38 | − : public ::testing::TestWithParam<SixtapPredictParam> { | |
| 34 | +class SixtapPredictTest : public ::testing::TestWithParam<SixtapPredictParam> { | |
| 39 | 35 | public: |
| 40 | 36 | 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)); | |
| 44 | 41 | } |
| 45 | 42 | |
| 46 | 43 | static void TearDownTestCase() { |
| @@ -52,9 +49,7 @@ class SixtapPredictTest · 5 unmodified lines | ||
| 52 | 49 | dst_c_ = NULL; |
| 53 | 50 | } |
| 54 | 51 | |
| 55 | − virtual void TearDown() { | |
| 56 | − libvpx_test::ClearSystemState(); | |
| 57 | − } | |
| 52 | + virtual void TearDown() { libvpx_test::ClearSystemState(); } | |
| 58 | 53 | |
| 59 | 54 | protected: |
| 60 | 55 | // Make test arrays big enough for 16x16 functions. Six-tap filters |
| @@ -80,74 +75,76 @@ class SixtapPredictTest · 19 unmodified lines | ||
| 80 | 75 | // The src stores the macroblock we will filter on, and makes it 1 byte larger |
| 81 | 76 | // in order to test unaligned access. The result is stored in dst and dst_c(c |
| 82 | 77 | // 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_; | |
| 86 | 81 | }; |
| 87 | 82 | |
| 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; | |
| 91 | 86 | |
| 92 | 87 | TEST_P(SixtapPredictTest, TestWithPresetData) { |
| 93 | 88 | // Test input |
| 94 | 89 | 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 | |
| 123 | 120 | }; |
| 124 | 121 | |
| 125 | 122 | // Expected result |
| 126 | 123 | 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 | |
| 144 | 142 | }; |
| 145 | 143 | |
| 146 | − uint8_t *src = const_cast<uint8_t*>(test_data); | |
| 144 | + uint8_t *src = const_cast<uint8_t *>(test_data); | |
| 147 | 145 | |
| 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)); | |
| 151 | 148 | |
| 152 | 149 | for (int i = 0; i < height_; ++i) |
| 153 | 150 | for (int j = 0; j < width_; ++j) |
| @@ -159,8 +156,7 @@ using libvpx_test::ACMRandom; · 5 unmodified lines | ||
| 159 | 156 | |
| 160 | 157 | TEST_P(SixtapPredictTest, TestWithRandomData) { |
| 161 | 158 | 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(); | |
| 164 | 160 | |
| 165 | 161 | // Run tests for all possible offsets. |
| 166 | 162 | for (int xoffset = 0; xoffset < 8; ++xoffset) { |
| @@ -172,9 +168,9 @@ TEST_P(SixtapPredictTest, TestWithRandomData) { · 5 unmodified lines | ||
| 172 | 168 | xoffset, yoffset, dst_c_, kDstStride); |
| 173 | 169 | |
| 174 | 170 | // 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)); | |
| 178 | 174 | |
| 179 | 175 | for (int i = 0; i < height_; ++i) |
| 180 | 176 | for (int j = 0; j < width_; ++j) |
| @@ -187,47 +183,47 @@ TEST_P(SixtapPredictTest, TestWithRandomData) { · 6 unmodified lines | ||
| 187 | 183 | using std::tr1::make_tuple; |
| 188 | 184 | |
| 189 | 185 | 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))); | |
| 195 | 191 | #if HAVE_NEON |
| 196 | 192 | 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))); | |
| 201 | 197 | #endif |
| 202 | 198 | #if HAVE_MMX |
| 203 | 199 | 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))); | |
| 209 | 205 | #endif |
| 210 | 206 | #if HAVE_SSE2 |
| 211 | 207 | 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))); | |
| 216 | 212 | #endif |
| 217 | 213 | #if HAVE_SSSE3 |
| 218 | 214 | 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))); | |
| 224 | 220 | #endif |
| 225 | 221 | #if HAVE_MSA |
| 226 | 222 | 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))); | |
| 232 | 228 | #endif |
| 233 | 229 | } // namespace |
| @@ -52,9 +52,9 @@ TEST_P(SumSquaresTest, OperationCheck) { · 51 unmodified lines | ||
| 52 | 52 | const int limit = 1 << (msb + 1); |
| 53 | 53 | |
| 54 | 54 | 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 | |
| 58 | 58 | stride = 4 << rnd(7); |
| 59 | 59 | } |
| 60 | 60 | |
| @@ -68,9 +68,8 @@ TEST_P(SumSquaresTest, OperationCheck) { · 7 unmodified lines | ||
| 68 | 68 | uint64_t res_tst; |
| 69 | 69 | ASM_REGISTER_STATE_CHECK(res_tst = tst_func_(src, stride, size)); |
| 70 | 70 | |
| 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."; | |
| 74 | 73 | } |
| 75 | 74 | } |
| 76 | 75 | |
| @@ -81,9 +80,9 @@ TEST_P(SumSquaresTest, ExtremeValues) { · 4 unmodified lines | ||
| 81 | 80 | const int limit = 1 << (msb + 1); |
| 82 | 81 | |
| 83 | 82 | 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 | |
| 87 | 86 | stride = 4 << rnd(7); |
| 88 | 87 | } |
| 89 | 88 | |
| @@ -98,9 +97,8 @@ TEST_P(SumSquaresTest, ExtremeValues) { · 8 unmodified lines | ||
| 98 | 97 | uint64_t res_tst; |
| 99 | 98 | ASM_REGISTER_STATE_CHECK(res_tst = tst_func_(src, stride, size)); |
| 100 | 99 | |
| 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."; | |
| 104 | 102 | } |
| 105 | 103 | } |
| 106 | 104 | |
| @@ -18,13 +18,14 @@ namespace { · 17 unmodified lines | ||
| 18 | 18 | |
| 19 | 19 | const int kTestMode = 0; |
| 20 | 20 | |
| 21 | −typedef std::tr1::tuple<libvpx_test::TestMode,int> SuperframeTestParam; | |
| 21 | +typedef std::tr1::tuple<libvpx_test::TestMode, int> SuperframeTestParam; | |
| 22 | 22 | |
| 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> { | |
| 25 | 26 | 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) {} | |
| 28 | 29 | virtual ~SuperframeTest() {} |
| 29 | 30 | |
| 30 | 31 | virtual void SetUp() { |
| @@ -36,9 +37,7 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 5 unmodified lines | ||
| 36 | 37 | sf_count_max_ = INT_MAX; |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | − virtual void TearDown() { | |
| 40 | − delete[] modified_buf_; | |
| 41 | − } | |
| 40 | + virtual void TearDown() { delete[] modified_buf_; } | |
| 42 | 41 | |
| 43 | 42 | virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video, |
| 44 | 43 | libvpx_test::Encoder *encoder) { |
| @@ -47,25 +46,21 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 2 unmodified lines | ||
| 47 | 46 | } |
| 48 | 47 | } |
| 49 | 48 | |
| 50 | − virtual const vpx_codec_cx_pkt_t * MutateEncoderOutputHook( | |
| 49 | + virtual const vpx_codec_cx_pkt_t *MutateEncoderOutputHook( | |
| 51 | 50 | 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; | |
| 54 | 52 | |
| 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); | |
| 56 | 54 | const uint8_t marker = buffer[pkt->data.frame.sz - 1]; |
| 57 | 55 | const int frames = (marker & 0x7) + 1; |
| 58 | 56 | const int mag = ((marker >> 3) & 3) + 1; |
| 59 | 57 | 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 && | |
| 62 | 59 | buffer[pkt->data.frame.sz - index_sz] == marker) { |
| 63 | 60 | // frame is a superframe. strip off the index. |
| 64 | − if (modified_buf_) | |
| 65 | − delete[] modified_buf_; | |
| 61 | + if (modified_buf_) delete[] modified_buf_; | |
| 66 | 62 | 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); | |
| 69 | 64 | modified_pkt_ = *pkt; |
| 70 | 65 | modified_pkt_.data.frame.buf = modified_buf_; |
| 71 | 66 | modified_pkt_.data.frame.sz -= index_sz; |
| @@ -76,8 +71,8 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 4 unmodified lines | ||
| 76 | 71 | } |
| 77 | 72 | |
| 78 | 73 | // 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; | |
| 81 | 76 | return pkt; |
| 82 | 77 | } |
| 83 | 78 | |
| @@ -98,7 +93,8 @@ TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) { · 14 unmodified lines | ||
| 98 | 93 | EXPECT_EQ(sf_count_, 1); |
| 99 | 94 | } |
| 100 | 95 | |
| 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))); | |
| 104 | 100 | } // namespace |
| @@ -33,10 +33,8 @@ class SvcTest : public ::testing::Test { · 32 unmodified lines | ||
| 33 | 33 | static const uint32_t kHeight = 288; |
| 34 | 34 | |
| 35 | 35 | 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) { | |
| 40 | 38 | memset(&svc_, 0, sizeof(svc_)); |
| 41 | 39 | memset(&codec_, 0, sizeof(codec_)); |
| 42 | 40 | memset(&codec_enc_, 0, sizeof(codec_enc_)); |
| @@ -70,7 +68,7 @@ class SvcTest : public ::testing::Test { · 27 unmodified lines | ||
| 70 | 68 | |
| 71 | 69 | virtual void TearDown() { |
| 72 | 70 | ReleaseEncoder(); |
| 73 | − delete(decoder_); | |
| 71 | + delete (decoder_); | |
| 74 | 72 | } |
| 75 | 73 | |
| 76 | 74 | void InitializeEncoder() { |
| @@ -97,7 +95,7 @@ class SvcTest : public ::testing::Test { · 20 unmodified lines | ||
| 97 | 95 | if (cx_pkt->kind == VPX_CODEC_STATS_PKT) { |
| 98 | 96 | EXPECT_GT(cx_pkt->data.twopass_stats.sz, 0U); |
| 99 | 97 | 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), | |
| 101 | 99 | cx_pkt->data.twopass_stats.sz); |
| 102 | 100 | } |
| 103 | 101 | } |
| @@ -113,10 +111,9 @@ class SvcTest : public ::testing::Test { · 9 unmodified lines | ||
| 113 | 111 | codec_enc_.g_pass = VPX_RC_FIRST_PASS; |
| 114 | 112 | InitializeEncoder(); |
| 115 | 113 | |
| 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); | |
| 120 | 117 | video.Begin(); |
| 121 | 118 | |
| 122 | 119 | for (int i = 0; i < n; ++i) { |
| @@ -128,8 +125,8 @@ class SvcTest : public ::testing::Test { · 5 unmodified lines | ||
| 128 | 125 | } |
| 129 | 126 | |
| 130 | 127 | // 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); | |
| 133 | 130 | ASSERT_EQ(VPX_CODEC_OK, res); |
| 134 | 131 | GetStatsData(stats_buf); |
| 135 | 132 | |
| @@ -163,8 +160,8 @@ class SvcTest : public ::testing::Test { · 27 unmodified lines | ||
| 163 | 160 | } |
| 164 | 161 | } |
| 165 | 162 | |
| 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, | |
| 168 | 165 | struct vpx_fixed_buf *const outputs) { |
| 169 | 166 | vpx_codec_err_t res; |
| 170 | 167 | size_t frame_received = 0; |
| @@ -182,10 +179,9 @@ class SvcTest : public ::testing::Test { · 11 unmodified lines | ||
| 182 | 179 | } |
| 183 | 180 | InitializeEncoder(); |
| 184 | 181 | |
| 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); | |
| 189 | 185 | video.Begin(); |
| 190 | 186 | |
| 191 | 187 | for (int i = 0; i < n; ++i) { |
| @@ -197,8 +193,8 @@ class SvcTest : public ::testing::Test { · 5 unmodified lines | ||
| 197 | 193 | } |
| 198 | 194 | |
| 199 | 195 | // 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); | |
| 202 | 198 | EXPECT_EQ(VPX_CODEC_OK, res); |
| 203 | 199 | StoreFrames(n, outputs, &frame_received); |
| 204 | 200 | |
| @@ -217,9 +213,8 @@ class SvcTest : public ::testing::Test { · 12 unmodified lines | ||
| 217 | 213 | for (int i = 0; i < n; ++i) { |
| 218 | 214 | ASSERT_TRUE(inputs[i].buf != NULL); |
| 219 | 215 | 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); | |
| 223 | 218 | ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder_->DecodeError(); |
| 224 | 219 | ++decoded_frames; |
| 225 | 220 | |
| @@ -240,17 +235,16 @@ class SvcTest : public ::testing::Test { · 14 unmodified lines | ||
| 240 | 235 | ASSERT_GT(remained_spatial_layers, 0); |
| 241 | 236 | |
| 242 | 237 | for (int i = 0; i < num_super_frames; ++i) { |
| 243 | − uint32_t frame_sizes[8] = {0}; | |
| 238 | + uint32_t frame_sizes[8] = { 0 }; | |
| 244 | 239 | int frame_count = 0; |
| 245 | 240 | int frames_found = 0; |
| 246 | 241 | int frame; |
| 247 | 242 | ASSERT_TRUE(inputs[i].buf != NULL); |
| 248 | 243 | ASSERT_GT(inputs[i].sz, 0U); |
| 249 | 244 | |
| 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); | |
| 254 | 248 | ASSERT_EQ(VPX_CODEC_OK, res); |
| 255 | 249 | |
| 256 | 250 | if (frame_count == 0) { |
| @@ -258,28 +252,27 @@ class SvcTest : public ::testing::Test { · 1 unmodified line | ||
| 258 | 252 | ASSERT_EQ(1, remained_spatial_layers); |
| 259 | 253 | } else { |
| 260 | 254 | // 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); | |
| 262 | 256 | uint8_t *frame_start = frame_data; |
| 263 | 257 | for (frame = 0; frame < frame_count; ++frame) { |
| 264 | 258 | // Looking for a visible frame. |
| 265 | 259 | if (frame_data[0] & 0x02) { |
| 266 | 260 | ++frames_found; |
| 267 | − if (frames_found == remained_spatial_layers) | |
| 268 | − break; | |
| 261 | + if (frames_found == remained_spatial_layers) break; | |
| 269 | 262 | } |
| 270 | 263 | frame_data += frame_sizes[frame]; |
| 271 | 264 | } |
| 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. " | |
| 273 | 267 | << "remained_spatial_layers: " << remained_spatial_layers |
| 274 | 268 | << " super_frame: " << i; |
| 275 | − if (frame == frame_count - 1) | |
| 276 | − continue; | |
| 269 | + if (frame == frame_count - 1) continue; | |
| 277 | 270 | |
| 278 | 271 | frame_data += frame_sizes[frame]; |
| 279 | 272 | |
| 280 | 273 | // We need to add one more frame for multiple frame contexts. |
| 281 | 274 | 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]; | |
| 283 | 276 | const uint32_t mag = ((marker >> 3) & 0x3) + 1; |
| 284 | 277 | const size_t index_sz = 2 + mag * frame_count; |
| 285 | 278 | const size_t new_index_sz = 2 + mag * (frame + 1); |
| @@ -445,7 +438,7 @@ TEST_F(SvcTest, SetAutoAltRefOption) { · 159 unmodified lines | ||
| 445 | 438 | // Test that decoder can handle an SVC frame as the first frame in a sequence. |
| 446 | 439 | TEST_F(SvcTest, OnePassEncodeOneFrame) { |
| 447 | 440 | codec_enc_.g_pass = VPX_RC_ONE_PASS; |
| 448 | − vpx_fixed_buf output = {0}; | |
| 441 | + vpx_fixed_buf output = { 0 }; | |
| 449 | 442 | Pass2EncodeNFrames(NULL, 1, 2, &output); |
| 450 | 443 | DecodeNFrames(&output, 1); |
| 451 | 444 | FreeBitstreamBuffers(&output, 1); |
| @@ -539,8 +532,7 @@ TEST_F(SvcTest, TwoPassEncode2SNRLayers) { · 87 unmodified lines | ||
| 539 | 532 | |
| 540 | 533 | // Second pass encode |
| 541 | 534 | 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"); | |
| 544 | 536 | vpx_fixed_buf outputs[20]; |
| 545 | 537 | memset(&outputs[0], 0, sizeof(outputs)); |
| 546 | 538 | Pass2EncodeNFrames(&stats_buf, 20, 2, &outputs[0]); |
| @@ -556,8 +548,7 @@ TEST_F(SvcTest, TwoPassEncode3SNRLayersDecode321Layers) { · 9 unmodified lines | ||
| 556 | 548 | |
| 557 | 549 | // Second pass encode |
| 558 | 550 | 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"); | |
| 561 | 552 | vpx_fixed_buf outputs[20]; |
| 562 | 553 | memset(&outputs[0], 0, sizeof(outputs)); |
| 563 | 554 | Pass2EncodeNFrames(&stats_buf, 20, 3, &outputs[0]); |
| @@ -572,8 +563,7 @@ TEST_F(SvcTest, TwoPassEncode3SNRLayersDecode321Layers) { · 8 unmodified lines | ||
| 572 | 563 | |
| 573 | 564 | TEST_F(SvcTest, SetMultipleFrameContextsOption) { |
| 574 | 565 | 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"); | |
| 577 | 567 | EXPECT_EQ(VPX_CODEC_OK, res); |
| 578 | 568 | res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_); |
| 579 | 569 | EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res); |
| @@ -626,7 +616,8 @@ TEST_F(SvcTest, TwoPassEncode2SNRLayersWithMultipleFrameContexts) { · 46 unmodified lines | ||
| 626 | 616 | // Second pass encode |
| 627 | 617 | codec_enc_.g_pass = VPX_RC_LAST_PASS; |
| 628 | 618 | 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 " | |
| 630 | 621 | "multi-frame-contexts=1"); |
| 631 | 622 | vpx_fixed_buf outputs[10]; |
| 632 | 623 | memset(&outputs[0], 0, sizeof(outputs)); |
| @@ -645,7 +636,8 @@ TEST_F(SvcTest, · 12 unmodified lines | ||
| 645 | 636 | // Second pass encode |
| 646 | 637 | codec_enc_.g_pass = VPX_RC_LAST_PASS; |
| 647 | 638 | 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 " | |
| 649 | 641 | "multi-frame-contexts=1"); |
| 650 | 642 | vpx_fixed_buf outputs[10]; |
| 651 | 643 | memset(&outputs[0], 0, sizeof(outputs)); |
| @@ -689,7 +681,8 @@ TEST_F(SvcTest, TwoPassEncode2TemporalLayersWithMultipleFrameContexts) { · 37 unmodified lines | ||
| 689 | 681 | codec_enc_.g_pass = VPX_RC_LAST_PASS; |
| 690 | 682 | svc_.temporal_layers = 2; |
| 691 | 683 | 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 " | |
| 693 | 686 | "multi-frame-contexts=1"); |
| 694 | 687 | vpx_fixed_buf outputs[10]; |
| 695 | 688 | memset(&outputs[0], 0, sizeof(outputs)); |
| @@ -714,8 +707,7 @@ TEST_F(SvcTest, TwoPassEncode2TemporalLayersDecodeBaseLayer) { · 18 unmodified lines | ||
| 714 | 707 | Pass2EncodeNFrames(&stats_buf, 10, 1, &outputs[0]); |
| 715 | 708 | |
| 716 | 709 | 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]; | |
| 719 | 711 | |
| 720 | 712 | DecodeNFrames(&base_layer[0], 5); |
| 721 | 713 | FreeBitstreamBuffers(&outputs[0], 10); |
| @@ -733,15 +725,15 @@ TEST_F(SvcTest, · 11 unmodified lines | ||
| 733 | 725 | codec_enc_.g_pass = VPX_RC_LAST_PASS; |
| 734 | 726 | svc_.temporal_layers = 2; |
| 735 | 727 | 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 " | |
| 737 | 730 | "multi-frame-contexts=1"); |
| 738 | 731 | vpx_fixed_buf outputs[10]; |
| 739 | 732 | memset(&outputs[0], 0, sizeof(outputs)); |
| 740 | 733 | Pass2EncodeNFrames(&stats_buf, 10, 1, &outputs[0]); |
| 741 | 734 | |
| 742 | 735 | 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]; | |
| 745 | 737 | |
| 746 | 738 | DecodeNFrames(&base_layer[0], 5); |
| 747 | 739 | FreeBitstreamBuffers(&outputs[0], 10); |
| @@ -769,8 +761,7 @@ TEST_F(SvcTest, TwoPassEncode2TemporalLayersWithTiles) { · 21 unmodified lines | ||
| 769 | 761 | FreeBitstreamBuffers(&outputs[0], 10); |
| 770 | 762 | } |
| 771 | 763 | |
| 772 | −TEST_F(SvcTest, | |
| 773 | − TwoPassEncode2TemporalLayersWithMultipleFrameContextsAndTiles) { | |
| 764 | +TEST_F(SvcTest, TwoPassEncode2TemporalLayersWithMultipleFrameContextsAndTiles) { | |
| 774 | 765 | // First pass encode |
| 775 | 766 | std::string stats_buf; |
| 776 | 767 | vpx_svc_set_options(&svc_, "scale-factors=1/1"); |
| @@ -785,7 +776,8 @@ TEST_F(SvcTest, · 8 unmodified lines | ||
| 785 | 776 | codec_enc_.g_h = 144; |
| 786 | 777 | tile_columns_ = 1; |
| 787 | 778 | 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 " | |
| 789 | 781 | "multi-frame-contexts=1"); |
| 790 | 782 | vpx_fixed_buf outputs[10]; |
| 791 | 783 | memset(&outputs[0], 0, sizeof(outputs)); |
| @@ -31,9 +31,9 @@ typedef void (*VpxPredFunc)(uint8_t *dst, ptrdiff_t y_stride, · 30 unmodified lines | ||
| 31 | 31 | |
| 32 | 32 | const int kNumVp9IntraPredFuncs = 13; |
| 33 | 33 | 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" | |
| 37 | 37 | }; |
| 38 | 38 | |
| 39 | 39 | 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 | ||
| 82 | 82 | void TestIntraPred4(VpxPredFunc const *pred_funcs) { |
| 83 | 83 | static const int kNumVp9IntraFuncs = 13; |
| 84 | 84 | 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", | |
| 97 | 91 | "309a618577b27c648f9c5ee45252bc8f", |
| 98 | 92 | }; |
| 99 | 93 | TestIntraPred("Intra4", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs, |
| @@ -103,18 +97,12 @@ void TestIntraPred4(VpxPredFunc const *pred_funcs) { · 3 unmodified lines | ||
| 103 | 97 | void TestIntraPred8(VpxPredFunc const *pred_funcs) { |
| 104 | 98 | static const int kNumVp9IntraFuncs = 13; |
| 105 | 99 | 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", | |
| 118 | 106 | "815b75c8e0d91cc1ae766dc5d3e445a3", |
| 119 | 107 | }; |
| 120 | 108 | TestIntraPred("Intra8", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs, |
| @@ -124,18 +112,12 @@ void TestIntraPred8(VpxPredFunc const *pred_funcs) { · 3 unmodified lines | ||
| 124 | 112 | void TestIntraPred16(VpxPredFunc const *pred_funcs) { |
| 125 | 113 | static const int kNumVp9IntraFuncs = 13; |
| 126 | 114 | 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", | |
| 139 | 121 | "b8a41aa968ec108af447af4217cba91b", |
| 140 | 122 | }; |
| 141 | 123 | TestIntraPred("Intra16", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs, |
| @@ -145,18 +127,12 @@ void TestIntraPred16(VpxPredFunc const *pred_funcs) { · 3 unmodified lines | ||
| 145 | 127 | void TestIntraPred32(VpxPredFunc const *pred_funcs) { |
| 146 | 128 | static const int kNumVp9IntraFuncs = 13; |
| 147 | 129 | 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", | |
| 160 | 136 | "9e1370c6d42e08d357d9612c93a71cfc", |
| 161 | 137 | }; |
| 162 | 138 | TestIntraPred("Intra32", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs, |
| @@ -167,13 +143,13 @@ void TestIntraPred32(VpxPredFunc const *pred_funcs) { · 4 unmodified lines | ||
| 167 | 143 | |
| 168 | 144 | // Defines a test case for |arch| (e.g., C, SSE2, ...) passing the predictors |
| 169 | 145 | // 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); \ | |
| 177 | 153 | } |
| 178 | 154 | |
| 179 | 155 | // ----------------------------------------------------------------------------- |
| @@ -197,9 +173,8 @@ INTRA_PRED_TEST(SSE2, TestIntraPred4, vpx_dc_predictor_4x4_sse2, · 17 unmodified lines | ||
| 197 | 173 | #endif // HAVE_SSE2 |
| 198 | 174 | |
| 199 | 175 | #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, | |
| 203 | 178 | vpx_d63_predictor_4x4_ssse3, NULL) |
| 204 | 179 | #endif // HAVE_SSSE3 |
| 205 | 180 | |
| @@ -222,8 +197,8 @@ INTRA_PRED_TEST(NEON, TestIntraPred4, vpx_dc_predictor_4x4_neon, · 16 unmodified lines | ||
| 222 | 197 | INTRA_PRED_TEST(MSA, TestIntraPred4, vpx_dc_predictor_4x4_msa, |
| 223 | 198 | vpx_dc_left_predictor_4x4_msa, vpx_dc_top_predictor_4x4_msa, |
| 224 | 199 | 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) | |
| 227 | 202 | #endif // HAVE_MSA |
| 228 | 203 | |
| 229 | 204 | // ----------------------------------------------------------------------------- |
| @@ -246,10 +221,9 @@ INTRA_PRED_TEST(SSE2, TestIntraPred8, vpx_dc_predictor_8x8_sse2, · 16 unmodified lines | ||
| 246 | 221 | #endif // HAVE_SSE2 |
| 247 | 222 | |
| 248 | 223 | #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) | |
| 253 | 227 | #endif // HAVE_SSSE3 |
| 254 | 228 | |
| 255 | 229 | #if HAVE_DSPR2 |
| @@ -271,8 +245,8 @@ INTRA_PRED_TEST(NEON, TestIntraPred8, vpx_dc_predictor_8x8_neon, · 15 unmodified lines | ||
| 271 | 245 | INTRA_PRED_TEST(MSA, TestIntraPred8, vpx_dc_predictor_8x8_msa, |
| 272 | 246 | vpx_dc_left_predictor_8x8_msa, vpx_dc_top_predictor_8x8_msa, |
| 273 | 247 | 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) | |
| 276 | 250 | #endif // HAVE_MSA |
| 277 | 251 | |
| 278 | 252 | // ----------------------------------------------------------------------------- |
| @@ -296,11 +270,10 @@ INTRA_PRED_TEST(SSE2, TestIntraPred16, vpx_dc_predictor_16x16_sse2, · 17 unmodified lines | ||
| 296 | 270 | #endif // HAVE_SSE2 |
| 297 | 271 | |
| 298 | 272 | #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) | |
| 304 | 277 | #endif // HAVE_SSSE3 |
| 305 | 278 | |
| 306 | 279 | #if HAVE_DSPR2 |
| @@ -322,8 +295,8 @@ INTRA_PRED_TEST(NEON, TestIntraPred16, vpx_dc_predictor_16x16_neon, · 15 unmodified lines | ||
| 322 | 295 | INTRA_PRED_TEST(MSA, TestIntraPred16, vpx_dc_predictor_16x16_msa, |
| 323 | 296 | vpx_dc_left_predictor_16x16_msa, vpx_dc_top_predictor_16x16_msa, |
| 324 | 297 | 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) | |
| 327 | 300 | #endif // HAVE_MSA |
| 328 | 301 | |
| 329 | 302 | // ----------------------------------------------------------------------------- |
| @@ -342,13 +315,13 @@ INTRA_PRED_TEST(SSE2, TestIntraPred32, vpx_dc_predictor_32x32_sse2, · 12 unmodified lines | ||
| 342 | 315 | vpx_dc_left_predictor_32x32_sse2, |
| 343 | 316 | vpx_dc_top_predictor_32x32_sse2, |
| 344 | 317 | 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) | |
| 347 | 320 | #endif // HAVE_SSE2 |
| 348 | 321 | |
| 349 | 322 | #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, | |
| 352 | 325 | vpx_d153_predictor_32x32_ssse3, vpx_d207_predictor_32x32_ssse3, |
| 353 | 326 | vpx_d63_predictor_32x32_ssse3, NULL) |
| 354 | 327 | #endif // HAVE_SSSE3 |
| @@ -366,8 +339,8 @@ INTRA_PRED_TEST(NEON, TestIntraPred32, vpx_dc_predictor_32x32_neon, · 11 unmodified lines | ||
| 366 | 339 | INTRA_PRED_TEST(MSA, TestIntraPred32, vpx_dc_predictor_32x32_msa, |
| 367 | 340 | vpx_dc_left_predictor_32x32_msa, vpx_dc_top_predictor_32x32_msa, |
| 368 | 341 | 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) | |
| 371 | 344 | #endif // HAVE_MSA |
| 372 | 345 | |
| 373 | 346 | #include "test/test_libvpx.cc" |
| @@ -41,22 +41,16 @@ int main(int argc, char **argv) { · 40 unmodified lines | ||
| 41 | 41 | |
| 42 | 42 | #if ARCH_X86 || ARCH_X86_64 |
| 43 | 43 | 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/*"); | |
| 52 | 48 | if (!(simd_caps & HAS_SSSE3)) |
| 53 | 49 | append_negative_gtest_filter(":SSSE3.*:SSSE3/*"); |
| 54 | 50 | if (!(simd_caps & HAS_SSE4_1)) |
| 55 | 51 | 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/*"); | |
| 60 | 54 | #endif // ARCH_X86 || ARCH_X86_64 |
| 61 | 55 | |
| 62 | 56 | #if !CONFIG_SHARED |
| @@ -28,43 +28,36 @@ · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | namespace { |
| 30 | 30 | |
| 31 | −enum DecodeMode { | |
| 32 | − kSerialMode, | |
| 33 | − kFrameParallelMode | |
| 34 | −}; | |
| 31 | +enum DecodeMode { kSerialMode, kFrameParallelMode }; | |
| 35 | 32 | |
| 36 | 33 | const int kDecodeMode = 0; |
| 37 | 34 | const int kThreads = 1; |
| 38 | 35 | const int kFileName = 2; |
| 39 | 36 | |
| 40 | −typedef std::tr1::tuple<int, int, const char*> DecodeParam; | |
| 37 | +typedef std::tr1::tuple<int, int, const char *> DecodeParam; | |
| 41 | 38 | |
| 42 | 39 | class TestVectorTest : public ::libvpx_test::DecoderTest, |
| 43 | − public ::libvpx_test::CodecTestWithParam<DecodeParam> { | |
| 40 | + public ::libvpx_test::CodecTestWithParam<DecodeParam> { | |
| 44 | 41 | protected: |
| 45 | − TestVectorTest() | |
| 46 | − : DecoderTest(GET_PARAM(0)), | |
| 47 | − md5_file_(NULL) { | |
| 42 | + TestVectorTest() : DecoderTest(GET_PARAM(0)), md5_file_(NULL) { | |
| 48 | 43 | #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); | |
| 53 | 47 | #endif |
| 54 | 48 | } |
| 55 | 49 | |
| 56 | 50 | virtual ~TestVectorTest() { |
| 57 | − if (md5_file_) | |
| 58 | − fclose(md5_file_); | |
| 51 | + if (md5_file_) fclose(md5_file_); | |
| 59 | 52 | } |
| 60 | 53 | |
| 61 | − void OpenMD5File(const std::string& md5_file_name_) { | |
| 54 | + void OpenMD5File(const std::string &md5_file_name_) { | |
| 62 | 55 | md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_); |
| 63 | 56 | ASSERT_TRUE(md5_file_ != NULL) << "Md5 file open failed. Filename: " |
| 64 | − << md5_file_name_; | |
| 57 | + << md5_file_name_; | |
| 65 | 58 | } |
| 66 | 59 | |
| 67 | − virtual void DecompressedFrameHook(const vpx_image_t& img, | |
| 60 | + virtual void DecompressedFrameHook(const vpx_image_t &img, | |
| 68 | 61 | const unsigned int frame_number) { |
| 69 | 62 | ASSERT_TRUE(md5_file_ != NULL); |
| 70 | 63 | char expected_md5[33]; |
| @@ -121,8 +114,8 @@ TEST_P(TestVectorTest, MD5Match) { · 50 unmodified lines | ||
| 121 | 114 | cfg.threads = threads; |
| 122 | 115 | |
| 123 | 116 | 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); | |
| 126 | 119 | SCOPED_TRACE(str); |
| 127 | 120 | |
| 128 | 121 | // Open compressed video file. |
| @@ -183,8 +176,8 @@ INSTANTIATE_TEST_CASE_P( · 54 unmodified lines | ||
| 183 | 176 | ::testing::Values( |
| 184 | 177 | static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)), |
| 185 | 178 | ::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. | |
| 188 | 181 | ::testing::ValuesIn(libvpx_test::kVP9TestVectors, |
| 189 | 182 | libvpx_test::kVP9TestVectors + |
| 190 | 183 | libvpx_test::kNumVP9TestVectors)))); |
| @@ -16,201 +16,324 @@ namespace libvpx_test { · 15 unmodified lines | ||
| 16 | 16 | |
| 17 | 17 | #if CONFIG_VP8_DECODER |
| 18 | 18 | 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" | |
| 51 | 50 | }; |
| 52 | 51 | const int kNumVP8TestVectors = NELEMENTS(kVP8TestVectors); |
| 53 | 52 | #endif // CONFIG_VP8_DECODER |
| 54 | 53 | #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", | |
| 79 | 79 | |
| 80 | 80 | 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", | |
| 184 | 287 | "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", | |
| 193 | 304 | "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", | |
| 197 | 311 | #if !CONFIG_SIZE_LIMIT || \ |
| 198 | 312 | (DECODE_WIDTH_LIMIT >= 20400 && DECODE_HEIGHT_LIMIT >= 120) |
| 199 | 313 | "vp90-2-13-largescaling.webm", |
| 200 | 314 | #endif |
| 201 | 315 | "vp90-2-14-resize-fp-tiles-1-16.webm", |
| 202 | 316 | "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", | |
| 205 | 321 | "vp90-2-14-resize-fp-tiles-16-4.webm", |
| 206 | 322 | "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", | |
| 214 | 337 | "vp90-2-14-resize-10frames-fp-tiles-1-2-4-8.webm", |
| 215 | 338 | "vp90-2-14-resize-10frames-fp-tiles-1-2.webm", |
| 216 | 339 | "vp90-2-14-resize-10frames-fp-tiles-1-4.webm", |
| @@ -225,25 +348,33 @@ const char *const kVP9TestVectors[] = { · 8 unmodified lines | ||
| 225 | 348 | "vp90-2-14-resize-10frames-fp-tiles-8-2.webm", |
| 226 | 349 | "vp90-2-14-resize-10frames-fp-tiles-8-4-2-1.webm", |
| 227 | 350 | "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", | |
| 232 | 359 | "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", | |
| 234 | 362 | #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", | |
| 239 | 371 | #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", | |
| 241 | 374 | RESIZE_TEST_VECTORS |
| 242 | 375 | }; |
| 243 | 376 | const int kNumVP9TestVectors = NELEMENTS(kVP9TestVectors); |
| 244 | −const char *const kVP9TestVectorsResize[] = { | |
| 245 | − RESIZE_TEST_VECTORS | |
| 246 | −}; | |
| 377 | +const char *const kVP9TestVectorsResize[] = { RESIZE_TEST_VECTORS }; | |
| 247 | 378 | const int kNumVP9TestVectorsResize = NELEMENTS(kVP9TestVectorsResize); |
| 248 | 379 | #undef RESIZE_TEST_VECTORS |
| 249 | 380 | #endif // CONFIG_VP9_DECODER |
| @@ -24,9 +24,7 @@ class TileIndependenceTest : public ::libvpx_test::EncoderTest, · 23 unmodified lines | ||
| 24 | 24 | public ::libvpx_test::CodecTestWithParam<int> { |
| 25 | 25 | protected: |
| 26 | 26 | 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_(), | |
| 30 | 28 | n_tiles_(GET_PARAM(1)) { |
| 31 | 29 | init_flags_ = VPX_CODEC_USE_PSNR; |
| 32 | 30 | vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t(); |
| @@ -58,7 +56,7 @@ class TileIndependenceTest : public ::libvpx_test::EncoderTest, · 25 unmodified lines | ||
| 58 | 56 | void UpdateMD5(::libvpx_test::Decoder *dec, const vpx_codec_cx_pkt_t *pkt, |
| 59 | 57 | ::libvpx_test::MD5 *md5) { |
| 60 | 58 | 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); | |
| 62 | 60 | if (res != VPX_CODEC_OK) { |
| 63 | 61 | abort_ = true; |
| 64 | 62 | ASSERT_EQ(VPX_CODEC_OK, res); |
| @@ -34,8 +34,8 @@ using libvpx_test::ACMRandom; · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | void CheckUserPrivateData(void *user_priv, int *target) { |
| 36 | 36 | // 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."; | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | // Decodes |filename|. Passes in user_priv data when calling DecodeFrame and |
| @@ -17,14 +17,13 @@ · 16 unmodified lines | ||
| 17 | 17 | #include "vpx/vpx_image.h" |
| 18 | 18 | |
| 19 | 19 | // Macros |
| 20 | −#define GET_PARAM(k) std::tr1::get< k >(GetParam()) | |
| 20 | +#define GET_PARAM(k) std::tr1::get<k>(GetParam()) | |
| 21 | 21 | |
| 22 | 22 | 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) && | |
| 25 | 24 | (img1->d_h == img2->d_h)); |
| 26 | 25 | |
| 27 | − const unsigned int width_y = img1->d_w; | |
| 26 | + const unsigned int width_y = img1->d_w; | |
| 28 | 27 | const unsigned int height_y = img1->d_h; |
| 29 | 28 | unsigned int i, j; |
| 30 | 29 | |
| @@ -57,8 +57,7 @@ static void RoundHighBitDepth(int bit_depth, int64_t *se, uint64_t *sse) { · 56 unmodified lines | ||
| 57 | 57 | *se = (*se + 2) >> 2; |
| 58 | 58 | break; |
| 59 | 59 | case VPX_BITS_8: |
| 60 | − default: | |
| 61 | − break; | |
| 60 | + default: break; | |
| 62 | 61 | } |
| 63 | 62 | } |
| 64 | 63 | |
| @@ -74,10 +73,9 @@ static unsigned int mb_ss_ref(const int16_t *src) { · 9 unmodified lines | ||
| 74 | 73 | * Our codebase calculates the "diff" value in the variance algorithm by |
| 75 | 74 | * (src - ref). |
| 76 | 75 | */ |
| 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_, | |
| 81 | 79 | vpx_bit_depth_t bit_depth) { |
| 82 | 80 | int64_t se = 0; |
| 83 | 81 | uint64_t sse = 0; |
| @@ -87,8 +85,7 @@ static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, · 3 unmodified lines | ||
| 87 | 85 | for (int x = 0; x < w; x++) { |
| 88 | 86 | int diff; |
| 89 | 87 | 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]; | |
| 92 | 89 | se += diff; |
| 93 | 90 | sse += diff * diff; |
| 94 | 91 | #if CONFIG_VP9_HIGHBITDEPTH |
| @@ -103,9 +100,8 @@ static uint32_t variance_ref(const uint8_t *src, const uint8_t *ref, · 8 unmodified lines | ||
| 103 | 100 | } |
| 104 | 101 | RoundHighBitDepth(bit_depth, &se, &sse); |
| 105 | 102 | *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))); | |
| 109 | 105 | } |
| 110 | 106 | |
| 111 | 107 | /* 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 | ||
| 116 | 112 | */ |
| 117 | 113 | static uint32_t subpel_variance_ref(const uint8_t *ref, const uint8_t *src, |
| 118 | 114 | 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_, | |
| 121 | 116 | vpx_bit_depth_t bit_depth) { |
| 122 | 117 | int64_t se = 0; |
| 123 | 118 | 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 | ||
| 161 | 156 | } |
| 162 | 157 | RoundHighBitDepth(bit_depth, &se, &sse); |
| 163 | 158 | *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))); | |
| 167 | 161 | } |
| 168 | 162 | |
| 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, | |
| 174 | 166 | uint32_t *sse_ptr, |
| 175 | 167 | bool use_high_bit_depth, |
| 176 | 168 | vpx_bit_depth_t bit_depth) { |
| @@ -218,9 +210,8 @@ static uint32_t subpel_avg_variance_ref(const uint8_t *ref, · 41 unmodified lines | ||
| 218 | 210 | } |
| 219 | 211 | RoundHighBitDepth(bit_depth, &se, &sse); |
| 220 | 212 | *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))); | |
| 224 | 215 | } |
| 225 | 216 | |
| 226 | 217 | //////////////////////////////////////////////////////////////////////////////// |
| @@ -229,9 +220,7 @@ class SumOfSquaresTest : public ::testing::TestWithParam<SumOfSquaresFunction> { · 2 unmodified lines | ||
| 229 | 220 | public: |
| 230 | 221 | SumOfSquaresTest() : func_(GetParam()) {} |
| 231 | 222 | |
| 232 | − virtual ~SumOfSquaresTest() { | |
| 233 | − libvpx_test::ClearSystemState(); | |
| 234 | − } | |
| 223 | + virtual ~SumOfSquaresTest() { libvpx_test::ClearSystemState(); } | |
| 235 | 224 | |
| 236 | 225 | protected: |
| 237 | 226 | void ConstTest(); |
| @@ -272,10 +261,10 @@ void SumOfSquaresTest::RefTest() { · 34 unmodified lines | ||
| 272 | 261 | // some testing context. |
| 273 | 262 | // Can be used for MSE, SSE, Variance, etc. |
| 274 | 263 | |
| 275 | −template<typename Func> | |
| 264 | +template <typename Func> | |
| 276 | 265 | 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) | |
| 279 | 268 | : log2width(log2w), log2height(log2h), func(function) { |
| 280 | 269 | use_high_bit_depth = (bit_depth_value > 0); |
| 281 | 270 | if (use_high_bit_depth) { |
| @@ -298,17 +287,17 @@ struct TestParams { · 16 unmodified lines | ||
| 298 | 287 | uint32_t mask; |
| 299 | 288 | }; |
| 300 | 289 | |
| 301 | −template<typename Func> | |
| 290 | +template <typename Func> | |
| 302 | 291 | std::ostream &operator<<(std::ostream &os, const TestParams<Func> &p) { |
| 303 | 292 | return os << "log2width/height:" << p.log2width << "/" << p.log2height |
| 304 | − << " function:" << reinterpret_cast<const void*>(p.func) | |
| 293 | + << " function:" << reinterpret_cast<const void *>(p.func) | |
| 305 | 294 | << " bit-depth:" << p.bit_depth; |
| 306 | 295 | } |
| 307 | 296 | |
| 308 | 297 | // 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> > { | |
| 312 | 301 | public: |
| 313 | 302 | virtual void SetUp() { |
| 314 | 303 | params_ = this->GetParam(); |
| @@ -316,7 +305,7 @@ class MainTestClass : · 1 unmodified line | ||
| 316 | 305 | rnd_.Reset(ACMRandom::DeterministicSeed()); |
| 317 | 306 | const size_t unit = |
| 318 | 307 | 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)); | |
| 320 | 309 | ref_ = new uint8_t[block_size() * unit]; |
| 321 | 310 | ASSERT_TRUE(src_ != NULL); |
| 322 | 311 | ASSERT_TRUE(ref_ != NULL); |
| @@ -333,8 +322,8 @@ class MainTestClass : · 10 unmodified lines | ||
| 333 | 322 | #if CONFIG_VP9_HIGHBITDEPTH |
| 334 | 323 | if (use_high_bit_depth()) { |
| 335 | 324 | // 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_)); | |
| 338 | 327 | } |
| 339 | 328 | #endif |
| 340 | 329 | |
| @@ -380,20 +369,20 @@ class MainTestClass : · 39 unmodified lines | ||
| 380 | 369 | //////////////////////////////////////////////////////////////////////////////// |
| 381 | 370 | // Tests related to variance. |
| 382 | 371 | |
| 383 | −template<typename VarianceFunctionType> | |
| 372 | +template <typename VarianceFunctionType> | |
| 384 | 373 | void MainTestClass<VarianceFunctionType>::ZeroTest() { |
| 385 | 374 | for (int i = 0; i <= 255; ++i) { |
| 386 | 375 | if (!use_high_bit_depth()) { |
| 387 | 376 | memset(src_, i, block_size()); |
| 388 | 377 | } else { |
| 389 | − uint16_t* const src16 = CONVERT_TO_SHORTPTR(src_); | |
| 378 | + uint16_t *const src16 = CONVERT_TO_SHORTPTR(src_); | |
| 390 | 379 | for (int k = 0; k < block_size(); ++k) src16[k] = i << byte_shift(); |
| 391 | 380 | } |
| 392 | 381 | for (int j = 0; j <= 255; ++j) { |
| 393 | 382 | if (!use_high_bit_depth()) { |
| 394 | 383 | memset(ref_, j, block_size()); |
| 395 | 384 | } else { |
| 396 | − uint16_t* const ref16 = CONVERT_TO_SHORTPTR(ref_); | |
| 385 | + uint16_t *const ref16 = CONVERT_TO_SHORTPTR(ref_); | |
| 397 | 386 | for (int k = 0; k < block_size(); ++k) ref16[k] = j << byte_shift(); |
| 398 | 387 | } |
| 399 | 388 | unsigned int sse, var; |
| @@ -404,7 +393,7 @@ void MainTestClass<VarianceFunctionType>::ZeroTest() { · 4 unmodified lines | ||
| 404 | 393 | } |
| 405 | 394 | } |
| 406 | 395 | |
| 407 | −template<typename VarianceFunctionType> | |
| 396 | +template <typename VarianceFunctionType> | |
| 408 | 397 | void MainTestClass<VarianceFunctionType>::RefTest() { |
| 409 | 398 | for (int i = 0; i < 10; ++i) { |
| 410 | 399 | for (int j = 0; j < block_size(); j++) { |
| @@ -422,15 +411,15 @@ void MainTestClass<VarianceFunctionType>::RefTest() { · 11 unmodified lines | ||
| 422 | 411 | const int stride = width(); |
| 423 | 412 | ASM_REGISTER_STATE_CHECK( |
| 424 | 413 | 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); | |
| 428 | 417 | EXPECT_EQ(sse1, sse2) << "Error at test index: " << i; |
| 429 | 418 | EXPECT_EQ(var1, var2) << "Error at test index: " << i; |
| 430 | 419 | } |
| 431 | 420 | } |
| 432 | 421 | |
| 433 | −template<typename VarianceFunctionType> | |
| 422 | +template <typename VarianceFunctionType> | |
| 434 | 423 | void MainTestClass<VarianceFunctionType>::RefStrideTest() { |
| 435 | 424 | for (int i = 0; i < 10; ++i) { |
| 436 | 425 | const int ref_stride = (i & 1) * width(); |
| @@ -453,16 +442,15 @@ void MainTestClass<VarianceFunctionType>::RefStrideTest() { · 16 unmodified lines | ||
| 453 | 442 | |
| 454 | 443 | ASM_REGISTER_STATE_CHECK( |
| 455 | 444 | 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); | |
| 460 | 448 | EXPECT_EQ(sse1, sse2) << "Error at test index: " << i; |
| 461 | 449 | EXPECT_EQ(var1, var2) << "Error at test index: " << i; |
| 462 | 450 | } |
| 463 | 451 | } |
| 464 | 452 | |
| 465 | −template<typename VarianceFunctionType> | |
| 453 | +template <typename VarianceFunctionType> | |
| 466 | 454 | void MainTestClass<VarianceFunctionType>::OneQuarterTest() { |
| 467 | 455 | const int half = block_size() / 2; |
| 468 | 456 | if (!use_high_bit_depth()) { |
| @@ -486,7 +474,7 @@ void MainTestClass<VarianceFunctionType>::OneQuarterTest() { · 17 unmodified lines | ||
| 486 | 474 | //////////////////////////////////////////////////////////////////////////////// |
| 487 | 475 | // Tests related to MSE / SSE. |
| 488 | 476 | |
| 489 | −template<typename FunctionType> | |
| 477 | +template <typename FunctionType> | |
| 490 | 478 | void MainTestClass<FunctionType>::RefTestMse() { |
| 491 | 479 | for (int i = 0; i < 10; ++i) { |
| 492 | 480 | for (int j = 0; j < block_size(); ++j) { |
| @@ -496,13 +484,13 @@ void MainTestClass<FunctionType>::RefTestMse() { · 3 unmodified lines | ||
| 496 | 484 | unsigned int sse1, sse2; |
| 497 | 485 | const int stride = width(); |
| 498 | 486 | 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); | |
| 501 | 489 | EXPECT_EQ(sse1, sse2); |
| 502 | 490 | } |
| 503 | 491 | } |
| 504 | 492 | |
| 505 | −template<typename FunctionType> | |
| 493 | +template <typename FunctionType> | |
| 506 | 494 | void MainTestClass<FunctionType>::RefTestSse() { |
| 507 | 495 | for (int i = 0; i < 10; ++i) { |
| 508 | 496 | for (int j = 0; j < block_size(); ++j) { |
| @@ -513,13 +501,13 @@ void MainTestClass<FunctionType>::RefTestSse() { · 4 unmodified lines | ||
| 513 | 501 | unsigned int var1; |
| 514 | 502 | const int stride = width(); |
| 515 | 503 | 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); | |
| 518 | 506 | EXPECT_EQ(var1, sse2); |
| 519 | 507 | } |
| 520 | 508 | } |
| 521 | 509 | |
| 522 | −template<typename FunctionType> | |
| 510 | +template <typename FunctionType> | |
| 523 | 511 | void MainTestClass<FunctionType>::MaxTestMse() { |
| 524 | 512 | memset(src_, 255, block_size()); |
| 525 | 513 | memset(ref_, 0, block_size()); |
| @@ -529,7 +517,7 @@ void MainTestClass<FunctionType>::MaxTestMse() { · 3 unmodified lines | ||
| 529 | 517 | EXPECT_EQ(expected, sse); |
| 530 | 518 | } |
| 531 | 519 | |
| 532 | −template<typename FunctionType> | |
| 520 | +template <typename FunctionType> | |
| 533 | 521 | void MainTestClass<FunctionType>::MaxTestSse() { |
| 534 | 522 | memset(src_, 255, block_size()); |
| 535 | 523 | memset(ref_, 0, block_size()); |
| @@ -545,27 +533,27 @@ using ::std::tr1::get; · 9 unmodified lines | ||
| 545 | 533 | using ::std::tr1::make_tuple; |
| 546 | 534 | using ::std::tr1::tuple; |
| 547 | 535 | |
| 548 | −template<typename SubpelVarianceFunctionType> | |
| 536 | +template <typename SubpelVarianceFunctionType> | |
| 549 | 537 | class SubpelVarianceTest |
| 550 | − : public ::testing::TestWithParam<tuple<int, int, | |
| 551 | − SubpelVarianceFunctionType, int> > { | |
| 538 | + : public ::testing::TestWithParam< | |
| 539 | + tuple<int, int, SubpelVarianceFunctionType, int> > { | |
| 552 | 540 | public: |
| 553 | 541 | virtual void SetUp() { |
| 554 | − const tuple<int, int, SubpelVarianceFunctionType, int>& params = | |
| 542 | + const tuple<int, int, SubpelVarianceFunctionType, int> ¶ms = | |
| 555 | 543 | this->GetParam(); |
| 556 | − log2width_ = get<0>(params); | |
| 544 | + log2width_ = get<0>(params); | |
| 557 | 545 | width_ = 1 << log2width_; |
| 558 | 546 | log2height_ = get<1>(params); |
| 559 | 547 | height_ = 1 << log2height_; |
| 560 | 548 | subpel_variance_ = get<2>(params); |
| 561 | 549 | if (get<3>(params)) { |
| 562 | − bit_depth_ = (vpx_bit_depth_t) get<3>(params); | |
| 550 | + bit_depth_ = (vpx_bit_depth_t)get<3>(params); | |
| 563 | 551 | use_high_bit_depth_ = true; |
| 564 | 552 | } else { |
| 565 | 553 | bit_depth_ = VPX_BITS_8; |
| 566 | 554 | use_high_bit_depth_ = false; |
| 567 | 555 | } |
| 568 | − mask_ = (1 << bit_depth_)-1; | |
| 556 | + mask_ = (1 << bit_depth_) - 1; | |
| 569 | 557 | |
| 570 | 558 | rnd_.Reset(ACMRandom::DeterministicSeed()); |
| 571 | 559 | block_size_ = width_ * height_; |
| @@ -575,14 +563,12 @@ class SubpelVarianceTest · 3 unmodified lines | ||
| 575 | 563 | ref_ = new uint8_t[block_size_ + width_ + height_ + 1]; |
| 576 | 564 | #if CONFIG_VP9_HIGHBITDEPTH |
| 577 | 565 | } 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]); | |
| 586 | 572 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 587 | 573 | } |
| 588 | 574 | ASSERT_TRUE(src_ != NULL); |
| @@ -617,11 +603,11 @@ class SubpelVarianceTest · 28 unmodified lines | ||
| 617 | 603 | vpx_bit_depth_t bit_depth_; |
| 618 | 604 | int width_, log2width_; |
| 619 | 605 | int height_, log2height_; |
| 620 | − int block_size_, mask_; | |
| 606 | + int block_size_, mask_; | |
| 621 | 607 | SubpelVarianceFunctionType subpel_variance_; |
| 622 | 608 | }; |
| 623 | 609 | |
| 624 | −template<typename SubpelVarianceFunctionType> | |
| 610 | +template <typename SubpelVarianceFunctionType> | |
| 625 | 611 | void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() { |
| 626 | 612 | for (int x = 0; x < 8; ++x) { |
| 627 | 613 | for (int y = 0; y < 8; ++y) { |
| @@ -644,20 +630,18 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() { · 16 unmodified lines | ||
| 644 | 630 | } |
| 645 | 631 | unsigned int sse1, sse2; |
| 646 | 632 | 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_); | |
| 654 | 638 | EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; |
| 655 | 639 | EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; |
| 656 | 640 | } |
| 657 | 641 | } |
| 658 | 642 | } |
| 659 | 643 | |
| 660 | −template<typename SubpelVarianceFunctionType> | |
| 644 | +template <typename SubpelVarianceFunctionType> | |
| 661 | 645 | void SubpelVarianceTest<SubpelVarianceFunctionType>::ExtremeRefTest() { |
| 662 | 646 | // Compare against reference. |
| 663 | 647 | // 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 | ||
| 684 | 668 | ASM_REGISTER_STATE_CHECK( |
| 685 | 669 | var1 = subpel_variance_(ref_, width_ + 1, x, y, src_, width_, &sse1)); |
| 686 | 670 | 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_); | |
| 689 | 673 | EXPECT_EQ(sse1, sse2) << "for xoffset " << x << " and yoffset " << y; |
| 690 | 674 | EXPECT_EQ(var1, var2) << "for xoffset " << x << " and yoffset " << y; |
| 691 | 675 | } |
| 692 | 676 | } |
| 693 | 677 | } |
| 694 | 678 | |
| 695 | −template<> | |
| 679 | +template <> | |
| 696 | 680 | void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() { |
| 697 | 681 | for (int x = 0; x < 8; ++x) { |
| 698 | 682 | for (int y = 0; y < 8; ++y) { |
| @@ -717,13 +701,11 @@ void SubpelVarianceTest<SubpixAvgVarMxNFunc>::RefTest() { · 18 unmodified lines | ||
| 717 | 701 | } |
| 718 | 702 | uint32_t sse1, sse2; |
| 719 | 703 | 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_, | |
| 727 | 709 | static_cast<vpx_bit_depth_t>(bit_depth_)); |
| 728 | 710 | EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y; |
| 729 | 711 | EXPECT_EQ(var1, var2) << "at position " << x << ", " << y; |
| @@ -756,14 +738,15 @@ INSTANTIATE_TEST_CASE_P(C, SumOfSquaresTest, · 26 unmodified lines | ||
| 756 | 738 | |
| 757 | 739 | typedef TestParams<Get4x4SseFunc> SseParams; |
| 758 | 740 | 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))); | |
| 760 | 743 | |
| 761 | 744 | typedef TestParams<VarianceMxNFunc> MseParams; |
| 762 | 745 | 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))); | |
| 767 | 750 | |
| 768 | 751 | typedef TestParams<VarianceMxNFunc> VarianceParams; |
| 769 | 752 | INSTANTIATE_TEST_CASE_P( |
| @@ -818,8 +801,7 @@ INSTANTIATE_TEST_CASE_P( · 48 unmodified lines | ||
| 818 | 801 | typedef MainTestClass<VarianceMxNFunc> VpxHBDMseTest; |
| 819 | 802 | typedef MainTestClass<VarianceMxNFunc> VpxHBDVarianceTest; |
| 820 | 803 | typedef SubpelVarianceTest<SubpixVarMxNFunc> VpxHBDSubpelVarianceTest; |
| 821 | −typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> | |
| 822 | − VpxHBDSubpelAvgVarianceTest; | |
| 804 | +typedef SubpelVarianceTest<SubpixAvgVarMxNFunc> VpxHBDSubpelAvgVarianceTest; | |
| 823 | 805 | |
| 824 | 806 | TEST_P(VpxHBDMseTest, RefMse) { RefTestMse(); } |
| 825 | 807 | TEST_P(VpxHBDMseTest, MaxMse) { MaxTestMse(); } |
| @@ -982,10 +964,10 @@ INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest, · 156 unmodified lines | ||
| 982 | 964 | ::testing::Values(vpx_get_mb_ss_sse2)); |
| 983 | 965 | |
| 984 | 966 | 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))); | |
| 989 | 971 | |
| 990 | 972 | INSTANTIATE_TEST_CASE_P( |
| 991 | 973 | SSE2, VpxVarianceTest, |
| @@ -1055,37 +1037,38 @@ INSTANTIATE_TEST_CASE_P( · 63 unmodified lines | ||
| 1055 | 1037 | */ |
| 1056 | 1038 | |
| 1057 | 1039 | 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))); | |
| 1089 | 1072 | |
| 1090 | 1073 | INSTANTIATE_TEST_CASE_P( |
| 1091 | 1074 | SSE2, VpxHBDSubpelVarianceTest, |
| @@ -1200,7 +1183,7 @@ INSTANTIATE_TEST_CASE_P( · 108 unmodified lines | ||
| 1200 | 1183 | |
| 1201 | 1184 | #if HAVE_AVX2 |
| 1202 | 1185 | INSTANTIATE_TEST_CASE_P(AVX2, VpxMseTest, |
| 1203 | − ::testing::Values(MseParams(4, 4, &vpx_mse16x16_avx2))); | |
| 1186 | + ::testing::Values(MseParams(4, 4, &vpx_mse16x16_avx2))); | |
| 1204 | 1187 | |
| 1205 | 1188 | INSTANTIATE_TEST_CASE_P( |
| 1206 | 1189 | AVX2, VpxVarianceTest, |
| @@ -1224,7 +1207,8 @@ INSTANTIATE_TEST_CASE_P( · 17 unmodified lines | ||
| 1224 | 1207 | |
| 1225 | 1208 | #if HAVE_MEDIA |
| 1226 | 1209 | 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))); | |
| 1228 | 1212 | |
| 1229 | 1213 | INSTANTIATE_TEST_CASE_P( |
| 1230 | 1214 | MEDIA, VpxVarianceTest, |
| @@ -1239,10 +1223,11 @@ INSTANTIATE_TEST_CASE_P( · 8 unmodified lines | ||
| 1239 | 1223 | |
| 1240 | 1224 | #if HAVE_NEON |
| 1241 | 1225 | 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))); | |
| 1243 | 1228 | |
| 1244 | 1229 | INSTANTIATE_TEST_CASE_P(NEON, VpxMseTest, |
| 1245 | − ::testing::Values(MseParams(4, 4, &vpx_mse16x16_neon))); | |
| 1230 | + ::testing::Values(MseParams(4, 4, &vpx_mse16x16_neon))); | |
| 1246 | 1231 | |
| 1247 | 1232 | INSTANTIATE_TEST_CASE_P( |
| 1248 | 1233 | NEON, VpxVarianceTest, |
| @@ -1268,13 +1253,14 @@ INSTANTIATE_TEST_CASE_P(MSA, SumOfSquaresTest, · 19 unmodified lines | ||
| 1268 | 1253 | ::testing::Values(vpx_get_mb_ss_msa)); |
| 1269 | 1254 | |
| 1270 | 1255 | 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))); | |
| 1272 | 1258 | |
| 1273 | 1259 | 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))); | |
| 1278 | 1264 | |
| 1279 | 1265 | INSTANTIATE_TEST_CASE_P( |
| 1280 | 1266 | MSA, VpxVarianceTest, |
| @@ -51,7 +51,7 @@ static std::string GetDataPath() { · 50 unmodified lines | ||
| 51 | 51 | #undef TO_STRING |
| 52 | 52 | #undef STRINGIFY |
| 53 | 53 | |
| 54 | −inline FILE *OpenTestDataFile(const std::string& file_name) { | |
| 54 | +inline FILE *OpenTestDataFile(const std::string &file_name) { | |
| 55 | 55 | const std::string path_to_source = GetDataPath() + "/" + file_name; |
| 56 | 56 | return fopen(path_to_source.c_str(), "rb"); |
| 57 | 57 | } |
| @@ -76,21 +76,15 @@ static FILE *GetTempOutFile(std::string *file_name) { · 18 unmodified lines | ||
| 76 | 76 | |
| 77 | 77 | class TempOutFile { |
| 78 | 78 | public: |
| 79 | − TempOutFile() { | |
| 80 | − file_ = GetTempOutFile(&file_name_); | |
| 81 | − } | |
| 79 | + TempOutFile() { file_ = GetTempOutFile(&file_name_); } | |
| 82 | 80 | ~TempOutFile() { |
| 83 | 81 | CloseFile(); |
| 84 | 82 | if (!file_name_.empty()) { |
| 85 | 83 | EXPECT_EQ(0, remove(file_name_.c_str())); |
| 86 | 84 | } |
| 87 | 85 | } |
| 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_; } | |
| 94 | 88 | |
| 95 | 89 | protected: |
| 96 | 90 | void CloseFile() { |
| @@ -134,14 +128,10 @@ class VideoSource { · 37 unmodified lines | ||
| 134 | 128 | virtual unsigned int limit() const = 0; |
| 135 | 129 | }; |
| 136 | 130 | |
| 137 | − | |
| 138 | 131 | class DummyVideoSource : public VideoSource { |
| 139 | 132 | public: |
| 140 | 133 | DummyVideoSource() |
| 141 | − : img_(NULL), | |
| 142 | − limit_(100), | |
| 143 | − width_(80), | |
| 144 | − height_(64), | |
| 134 | + : img_(NULL), limit_(100), width_(80), height_(64), | |
| 145 | 135 | format_(VPX_IMG_FMT_I420) { |
| 146 | 136 | ReallocImage(); |
| 147 | 137 | } |
| @@ -158,9 +148,7 @@ class DummyVideoSource : public VideoSource { · 10 unmodified lines | ||
| 158 | 148 | FillFrame(); |
| 159 | 149 | } |
| 160 | 150 | |
| 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; } | |
| 164 | 152 | |
| 165 | 153 | // Models a stream where Timebase = 1/FPS, so pts == frame. |
| 166 | 154 | virtual vpx_codec_pts_t pts() const { return frame_; } |
| @@ -168,7 +156,7 @@ class DummyVideoSource : public VideoSource { · 1 unmodified line | ||
| 168 | 156 | virtual unsigned long duration() const { return 1; } |
| 169 | 157 | |
| 170 | 158 | virtual vpx_rational_t timebase() const { |
| 171 | − const vpx_rational_t t = {1, 30}; | |
| 159 | + const vpx_rational_t t = { 1, 30 }; | |
| 172 | 160 | return t; |
| 173 | 161 | } |
| 174 | 162 | |
| @@ -176,9 +164,7 @@ class DummyVideoSource : public VideoSource { · 1 unmodified line | ||
| 176 | 164 | |
| 177 | 165 | virtual unsigned int limit() const { return limit_; } |
| 178 | 166 | |
| 179 | − void set_limit(unsigned int limit) { | |
| 180 | − limit_ = limit; | |
| 181 | − } | |
| 167 | + void set_limit(unsigned int limit) { limit_ = limit; } | |
| 182 | 168 | |
| 183 | 169 | void SetSize(unsigned int width, unsigned int height) { |
| 184 | 170 | if (width != width_ || height != height_) { |
| @@ -196,7 +182,9 @@ class DummyVideoSource : public VideoSource { · 11 unmodified lines | ||
| 196 | 182 | } |
| 197 | 183 | |
| 198 | 184 | 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 | + } | |
| 200 | 188 | |
| 201 | 189 | void ReallocImage() { |
| 202 | 190 | vpx_img_free(img_); |
| @@ -205,7 +193,7 @@ class DummyVideoSource : public VideoSource { · 2 unmodified lines | ||
| 205 | 193 | } |
| 206 | 194 | |
| 207 | 195 | vpx_image_t *img_; |
| 208 | − size_t raw_sz_; | |
| 196 | + size_t raw_sz_; | |
| 209 | 197 | unsigned int limit_; |
| 210 | 198 | unsigned int frame_; |
| 211 | 199 | unsigned int width_; |
| @@ -213,12 +201,10 @@ class DummyVideoSource : public VideoSource { · 1 unmodified line | ||
| 213 | 201 | vpx_img_fmt_t format_; |
| 214 | 202 | }; |
| 215 | 203 | |
| 216 | − | |
| 217 | 204 | class RandomVideoSource : public DummyVideoSource { |
| 218 | 205 | public: |
| 219 | 206 | RandomVideoSource(int seed = ACMRandom::DeterministicSeed()) |
| 220 | − : rnd_(seed), | |
| 221 | − seed_(seed) { } | |
| 207 | + : rnd_(seed), seed_(seed) {} | |
| 222 | 208 | |
| 223 | 209 | protected: |
| 224 | 210 | // Reset the RNG to get a matching stream for the second pass |
| @@ -233,8 +219,7 @@ class RandomVideoSource : public DummyVideoSource { · 8 unmodified lines | ||
| 233 | 219 | virtual void FillFrame() { |
| 234 | 220 | if (img_) { |
| 235 | 221 | 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(); | |
| 238 | 223 | else |
| 239 | 224 | memset(img_->img_data, 0, raw_sz_); |
| 240 | 225 | } |
| @@ -8,7 +8,6 @@ · 7 unmodified lines | ||
| 8 | 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | − | |
| 12 | 11 | #include <math.h> |
| 13 | 12 | #include <stddef.h> |
| 14 | 13 | #include <stdio.h> |
| @@ -41,9 +40,9 @@ void encrypt_buffer(uint8_t *buffer, size_t size) { · 26 unmodified lines | ||
| 41 | 40 | } |
| 42 | 41 | } |
| 43 | 42 | |
| 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); | |
| 47 | 46 | for (int i = 0; i < count; i++) { |
| 48 | 47 | output[i] = input[i] ^ secret_key[(offset + i) & 15]; |
| 49 | 48 | } |
| @@ -56,12 +55,13 @@ using libvpx_test::ACMRandom; · 6 unmodified lines | ||
| 56 | 55 | TEST(VP8, TestBitIO) { |
| 57 | 56 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 58 | 57 | 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 | |
| 60 | 59 | const int kBitsToTest = 1000; |
| 61 | 60 | uint8_t probas[kBitsToTest]; |
| 62 | 61 | |
| 63 | 62 | for (int i = 0; i < kBitsToTest; ++i) { |
| 64 | 63 | const int parity = i & 1; |
| 64 | + /* clang-format off */ | |
| 65 | 65 | probas[i] = |
| 66 | 66 | (method == 0) ? 0 : (method == 1) ? 255 : |
| 67 | 67 | (method == 2) ? 128 : |
| @@ -72,6 +72,7 @@ TEST(VP8, TestBitIO) { · 4 unmodified lines | ||
| 72 | 72 | (method == 6) ? |
| 73 | 73 | (parity ? rnd(64) : 255 - rnd(64)) : |
| 74 | 74 | (parity ? rnd(32) : 255 - rnd(32)); |
| 75 | + /* clang-format on */ | |
| 75 | 76 | } |
| 76 | 77 | for (int bit_method = 0; bit_method <= 3; ++bit_method) { |
| 77 | 78 | const int random_seed = 6432; |
| @@ -95,8 +96,7 @@ TEST(VP8, TestBitIO) { · 17 unmodified lines | ||
| 95 | 96 | |
| 96 | 97 | BOOL_DECODER br; |
| 97 | 98 | 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, | |
| 100 | 100 | reinterpret_cast<void *>(bw_buffer)); |
| 101 | 101 | bit_rnd.Reset(random_seed); |
| 102 | 102 | for (int i = 0; i < kBitsToTest; ++i) { |
| @@ -106,9 +106,8 @@ TEST(VP8, TestBitIO) { · 3 unmodified lines | ||
| 106 | 106 | bit = bit_rnd(2); |
| 107 | 107 | } |
| 108 | 108 | 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; | |
| 112 | 111 | } |
| 113 | 112 | } |
| 114 | 113 | } |
| @@ -21,10 +21,8 @@ namespace { · 20 unmodified lines | ||
| 21 | 21 | // with whatever internal state the decryptor uses. For testing we'll just |
| 22 | 22 | // xor with a constant key, and decrypt_state will point to the start of |
| 23 | 23 | // 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 }; | |
| 28 | 26 | |
| 29 | 27 | void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size, |
| 30 | 28 | ptrdiff_t offset) { |
| @@ -33,8 +31,8 @@ void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size, · 2 unmodified lines | ||
| 33 | 31 | } |
| 34 | 32 | } |
| 35 | 33 | |
| 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) { | |
| 38 | 36 | encrypt_buffer(input, output, count, |
| 39 | 37 | input - reinterpret_cast<uint8_t *>(decrypt_state)); |
| 40 | 38 | } |
| @@ -32,9 +32,7 @@ class VP8DenoiserTest : public ::testing::TestWithParam<int> { · 31 unmodified lines | ||
| 32 | 32 | public: |
| 33 | 33 | virtual ~VP8DenoiserTest() {} |
| 34 | 34 | |
| 35 | − virtual void SetUp() { | |
| 36 | − increase_denoising_ = GetParam(); | |
| 37 | − } | |
| 35 | + virtual void SetUp() { increase_denoising_ = GetParam(); } | |
| 38 | 36 | |
| 39 | 37 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 40 | 38 | |
| @@ -71,8 +69,8 @@ TEST_P(VP8DenoiserTest, BitexactCheck) { · 30 unmodified lines | ||
| 71 | 69 | sig_block_sse2[j] = sig_block_c[j] = rnd.Rand8(); |
| 72 | 70 | // The pixels in mc_avg_block are generated by adding a random |
| 73 | 71 | // 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); | |
| 76 | 74 | // Clip. |
| 77 | 75 | mc_avg_block[j] = (temp < 0) ? 0 : ((temp > 255) ? 255 : temp); |
| 78 | 76 | } |
| @@ -95,11 +95,12 @@ TEST(VP8FdctTest, SignBiasCheck) { · 94 unmodified lines | ||
| 95 | 95 | |
| 96 | 96 | bool bias_acceptable = true; |
| 97 | 97 | 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); | |
| 100 | 101 | |
| 101 | 102 | 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]"; | |
| 103 | 104 | |
| 104 | 105 | memset(count_sign_block, 0, sizeof(count_sign_block)); |
| 105 | 106 | |
| @@ -120,11 +121,12 @@ TEST(VP8FdctTest, SignBiasCheck) { · 14 unmodified lines | ||
| 120 | 121 | |
| 121 | 122 | bias_acceptable = true; |
| 122 | 123 | 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); | |
| 125 | 127 | |
| 126 | 128 | 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]"; | |
| 128 | 130 | }; |
| 129 | 131 | |
| 130 | 132 | TEST(VP8FdctTest, RoundTripErrorCheck) { |
| @@ -148,17 +150,16 @@ TEST(VP8FdctTest, RoundTripErrorCheck) { · 17 unmodified lines | ||
| 148 | 150 | for (int j = 0; j < 16; ++j) { |
| 149 | 151 | const int diff = test_input_block[j] - test_output_block[j]; |
| 150 | 152 | const int error = diff * diff; |
| 151 | − if (max_error < error) | |
| 152 | − max_error = error; | |
| 153 | + if (max_error < error) max_error = error; | |
| 153 | 154 | total_error += error; |
| 154 | 155 | } |
| 155 | 156 | } |
| 156 | 157 | |
| 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"; | |
| 159 | 160 | |
| 160 | 161 | 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"; | |
| 162 | 163 | }; |
| 163 | 164 | |
| 164 | 165 | } // namespace |
| @@ -13,9 +13,8 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | namespace { |
| 15 | 15 | |
| 16 | −class VP8FramgmentsTest | |
| 17 | − : public ::libvpx_test::EncoderTest, | |
| 18 | − public ::testing::Test { | |
| 16 | +class VP8FramgmentsTest : public ::libvpx_test::EncoderTest, | |
| 17 | + public ::testing::Test { | |
| 19 | 18 | protected: |
| 20 | 19 | VP8FramgmentsTest() : EncoderTest(&::libvpx_test::kVP8) {} |
| 21 | 20 | virtual ~VP8FramgmentsTest() {} |
| @@ -22,8 +22,8 @@ namespace { · 21 unmodified lines | ||
| 22 | 22 | const unsigned int kFrames = 100; |
| 23 | 23 | const int kBitrate = 500; |
| 24 | 24 | |
| 25 | −#define ARF_NOT_SEEN 1000001 | |
| 26 | −#define ARF_SEEN_ONCE 1000000 | |
| 25 | +#define ARF_NOT_SEEN 1000001 | |
| 26 | +#define ARF_SEEN_ONCE 1000000 | |
| 27 | 27 | |
| 28 | 28 | typedef struct { |
| 29 | 29 | const char *filename; |
| @@ -44,24 +44,20 @@ typedef struct { · 14 unmodified lines | ||
| 44 | 44 | |
| 45 | 45 | const TestVideoParam kTestVectors[] = { |
| 46 | 46 | // 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 }, | |
| 53 | 52 | #if CONFIG_VP9_HIGHBITDEPTH |
| 54 | − // Add list of profile 2/3 test videos here ... | |
| 53 | +// Add list of profile 2/3 test videos here ... | |
| 55 | 54 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 56 | 55 | }; |
| 57 | 56 | |
| 58 | 57 | 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 }, | |
| 65 | 61 | }; |
| 66 | 62 | |
| 67 | 63 | const int kMinArfVectors[] = { |
| @@ -80,15 +76,12 @@ int is_extension_y4m(const char *filename) { · 12 unmodified lines | ||
| 80 | 76 | |
| 81 | 77 | class ArfFreqTest |
| 82 | 78 | : public ::libvpx_test::EncoderTest, |
| 83 | − public ::libvpx_test::CodecTestWith3Params<TestVideoParam, \ | |
| 79 | + public ::libvpx_test::CodecTestWith3Params<TestVideoParam, | |
| 84 | 80 | TestEncodeParam, int> { |
| 85 | 81 | protected: |
| 86 | 82 | 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)) {} | |
| 92 | 85 | |
| 93 | 86 | virtual ~ArfFreqTest() {} |
| 94 | 87 | |
| @@ -114,17 +107,16 @@ class ArfFreqTest · 19 unmodified lines | ||
| 114 | 107 | } |
| 115 | 108 | |
| 116 | 109 | 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); | |
| 118 | 111 | const uint8_t marker = buffer[pkt->data.frame.sz - 1]; |
| 119 | 112 | const int mag = ((marker >> 3) & 3) + 1; |
| 120 | 113 | int frames = (marker & 0x7) + 1; |
| 121 | − const unsigned int index_sz = 2 + mag * frames; | |
| 114 | + const unsigned int index_sz = 2 + mag * frames; | |
| 122 | 115 | // Check for superframe or not. |
| 123 | 116 | // Assume superframe has only one visible frame, the rest being |
| 124 | 117 | // invisible. If superframe index is not found, then there is only |
| 125 | 118 | // 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 && | |
| 128 | 120 | buffer[pkt->data.frame.sz - index_sz] == marker)) { |
| 129 | 121 | frames = 1; |
| 130 | 122 | } |
| @@ -132,8 +124,7 @@ class ArfFreqTest · 1 unmodified line | ||
| 132 | 124 | } |
| 133 | 125 | |
| 134 | 126 | 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; | |
| 137 | 128 | const int frames = GetNumFramesInPkt(pkt); |
| 138 | 129 | if (frames == 1) { |
| 139 | 130 | run_of_visible_frames_++; |
| @@ -167,9 +158,7 @@ class ArfFreqTest · 27 unmodified lines | ||
| 167 | 158 | } |
| 168 | 159 | } |
| 169 | 160 | |
| 170 | − int GetMinVisibleRun() const { | |
| 171 | − return min_run_; | |
| 172 | − } | |
| 161 | + int GetMinVisibleRun() const { return min_run_; } | |
| 173 | 162 | |
| 174 | 163 | int GetMinArfDistanceRequested() const { |
| 175 | 164 | if (min_arf_requested_) |
| @@ -178,7 +167,7 @@ class ArfFreqTest · 2 unmodified lines | ||
| 178 | 167 | return vp9_rc_get_default_min_gf_interval( |
| 179 | 168 | test_video_param_.width, test_video_param_.height, |
| 180 | 169 | (double)test_video_param_.framerate_num / |
| 181 | − test_video_param_.framerate_den); | |
| 170 | + test_video_param_.framerate_den); | |
| 182 | 171 | } |
| 183 | 172 | |
| 184 | 173 | TestVideoParam test_video_param_; |
| @@ -197,21 +186,18 @@ TEST_P(ArfFreqTest, MinArfFreqTest) { · 12 unmodified lines | ||
| 197 | 186 | cfg_.g_input_bit_depth = test_video_param_.input_bit_depth; |
| 198 | 187 | cfg_.g_bit_depth = test_video_param_.bit_depth; |
| 199 | 188 | 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; | |
| 202 | 190 | |
| 203 | 191 | testing::internal::scoped_ptr<libvpx_test::VideoSource> video; |
| 204 | 192 | 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)); | |
| 207 | 195 | } 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)); | |
| 215 | 201 | } |
| 216 | 202 | |
| 217 | 203 | ASSERT_NO_FATAL_FAILURE(RunLoop(video.get())); |
| @@ -223,9 +209,7 @@ TEST_P(ArfFreqTest, MinArfFreqTest) { · 5 unmodified lines | ||
| 223 | 209 | } |
| 224 | 210 | } |
| 225 | 211 | |
| 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)); | |
| 231 | 215 | } // namespace |
| @@ -28,12 +28,13 @@ const int num_tests = 10; · 27 unmodified lines | ||
| 28 | 28 | TEST(VP9, TestBitIO) { |
| 29 | 29 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 30 | 30 | 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 | |
| 32 | 32 | const int kBitsToTest = 1000; |
| 33 | 33 | uint8_t probas[kBitsToTest]; |
| 34 | 34 | |
| 35 | 35 | for (int i = 0; i < kBitsToTest; ++i) { |
| 36 | 36 | const int parity = i & 1; |
| 37 | + /* clang-format off */ | |
| 37 | 38 | probas[i] = |
| 38 | 39 | (method == 0) ? 0 : (method == 1) ? 255 : |
| 39 | 40 | (method == 2) ? 128 : |
| @@ -44,6 +45,7 @@ TEST(VP9, TestBitIO) { · 4 unmodified lines | ||
| 44 | 45 | (method == 6) ? |
| 45 | 46 | (parity ? rnd(64) : 255 - rnd(64)) : |
| 46 | 47 | (parity ? rnd(32) : 255 - rnd(32)); |
| 48 | + /* clang-format on */ | |
| 47 | 49 | } |
| 48 | 50 | for (int bit_method = 0; bit_method <= 3; ++bit_method) { |
| 49 | 51 | const int random_seed = 6432; |
| @@ -79,8 +81,7 @@ TEST(VP9, TestBitIO) { · 29 unmodified lines | ||
| 79 | 81 | } |
| 80 | 82 | GTEST_ASSERT_EQ(vpx_read(&br, probas[i]), bit) |
| 81 | 83 | << "pos: " << i << " / " << kBitsToTest |
| 82 | − << " bit_method: " << bit_method | |
| 83 | − << " method: " << method; | |
| 84 | + << " bit_method: " << bit_method << " method: " << method; | |
| 84 | 85 | } |
| 85 | 86 | } |
| 86 | 87 | } |
| @@ -21,10 +21,8 @@ namespace { · 20 unmodified lines | ||
| 21 | 21 | // with whatever internal state the decryptor uses. For testing we'll just |
| 22 | 22 | // xor with a constant key, and decrypt_state will point to the start of |
| 23 | 23 | // 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 }; | |
| 28 | 26 | |
| 29 | 27 | void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size, |
| 30 | 28 | ptrdiff_t offset) { |
| @@ -33,8 +31,8 @@ void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size, · 2 unmodified lines | ||
| 33 | 31 | } |
| 34 | 32 | } |
| 35 | 33 | |
| 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) { | |
| 38 | 36 | encrypt_buffer(input, output, count, |
| 39 | 37 | input - reinterpret_cast<uint8_t *>(decrypt_state)); |
| 40 | 38 | } |
| @@ -33,9 +33,7 @@ class VP9DenoiserTest : public ::testing::TestWithParam<BLOCK_SIZE> { · 32 unmodified lines | ||
| 33 | 33 | public: |
| 34 | 34 | virtual ~VP9DenoiserTest() {} |
| 35 | 35 | |
| 36 | − virtual void SetUp() { | |
| 37 | − bs_ = GetParam(); | |
| 38 | − } | |
| 36 | + virtual void SetUp() { bs_ = GetParam(); } | |
| 39 | 37 | |
| 40 | 38 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| 41 | 39 | |
| @@ -68,19 +66,19 @@ TEST_P(VP9DenoiserTest, BitexactCheck) { · 26 unmodified lines | ||
| 68 | 66 | sig_block[j] = rnd.Rand8(); |
| 69 | 67 | // The pixels in mc_avg_block are generated by adding a random |
| 70 | 68 | // 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); | |
| 73 | 71 | // Clip. |
| 74 | 72 | mc_avg_block[j] = (temp < 0) ? 0 : ((temp > 255) ? 255 : temp); |
| 75 | 73 | } |
| 76 | 74 | |
| 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)); | |
| 80 | 78 | |
| 81 | 79 | 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)); | |
| 84 | 82 | |
| 85 | 83 | // Test bitexactness. |
| 86 | 84 | for (int h = 0; h < (4 << b_height_log2_lookup[bs_]); ++h) { |
| @@ -92,9 +90,9 @@ TEST_P(VP9DenoiserTest, BitexactCheck) { · 5 unmodified lines | ||
| 92 | 90 | } |
| 93 | 91 | |
| 94 | 92 | // 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)); | |
| 100 | 98 | } // namespace |
| @@ -29,7 +29,7 @@ struct EncodePerfTestVideo { · 28 unmodified lines | ||
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | 31 | const EncodePerfTestVideo kVP9EncodePerfTestVectors[] = { |
| 32 | − {"niklas_1280_720_30.y4m", 1280, 720, 600, 10}, | |
| 32 | + { "niklas_1280_720_30.y4m", 1280, 720, 600, 10 }, | |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | 35 | struct EncodeParameters { |
| @@ -45,10 +45,10 @@ struct EncodeParameters { · 9 unmodified lines | ||
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | 47 | 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 } }, | |
| 52 | 52 | // TODO(JBB): Test profiles (requires more work). |
| 53 | 53 | }; |
| 54 | 54 | |
| @@ -18,21 +18,17 @@ · 17 unmodified lines | ||
| 18 | 18 | |
| 19 | 19 | namespace { |
| 20 | 20 | |
| 21 | −const unsigned int kWidth = 160; | |
| 21 | +const unsigned int kWidth = 160; | |
| 22 | 22 | const unsigned int kHeight = 90; |
| 23 | 23 | const unsigned int kFramerate = 50; |
| 24 | 24 | const unsigned int kFrames = 10; |
| 25 | 25 | const int kBitrate = 500; |
| 26 | 26 | // List of psnr thresholds for speed settings 0-7 and 5 encoding modes |
| 27 | 27 | 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 }, | |
| 36 | 32 | }; |
| 37 | 33 | |
| 38 | 34 | typedef struct { |
| @@ -44,31 +40,30 @@ typedef struct { · 5 unmodified lines | ||
| 44 | 40 | } TestVideoParam; |
| 45 | 41 | |
| 46 | 42 | 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 }, | |
| 51 | 47 | #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 }, | |
| 60 | 56 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 61 | 57 | }; |
| 62 | 58 | |
| 63 | 59 | // Encoding modes tested |
| 64 | 60 | const libvpx_test::TestMode kEncodingModeVectors[] = { |
| 65 | − ::libvpx_test::kTwoPassGood, | |
| 66 | − ::libvpx_test::kOnePassGood, | |
| 61 | + ::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood, | |
| 67 | 62 | ::libvpx_test::kRealTime, |
| 68 | 63 | }; |
| 69 | 64 | |
| 70 | 65 | // Speed settings tested |
| 71 | −const int kCpuUsedVectors[] = {1, 2, 3, 5, 6}; | |
| 66 | +const int kCpuUsedVectors[] = { 1, 2, 3, 5, 6 }; | |
| 72 | 67 | |
| 73 | 68 | int is_extension_y4m(const char *filename) { |
| 74 | 69 | const char *dot = strrchr(filename, '.'); |
| @@ -80,17 +75,13 @@ int is_extension_y4m(const char *filename) { · 5 unmodified lines | ||
| 80 | 75 | |
| 81 | 76 | class EndToEndTestLarge |
| 82 | 77 | : public ::libvpx_test::EncoderTest, |
| 83 | − public ::libvpx_test::CodecTestWith3Params<libvpx_test::TestMode, \ | |
| 78 | + public ::libvpx_test::CodecTestWith3Params<libvpx_test::TestMode, | |
| 84 | 79 | TestVideoParam, int> { |
| 85 | 80 | protected: |
| 86 | 81 | 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)) {} | |
| 94 | 85 | |
| 95 | 86 | virtual ~EndToEndTestLarge() {} |
| 96 | 87 | |
| @@ -136,8 +127,7 @@ class EndToEndTestLarge · 39 unmodified lines | ||
| 136 | 127 | } |
| 137 | 128 | |
| 138 | 129 | double GetAveragePsnr() const { |
| 139 | − if (nframes_) | |
| 140 | − return psnr_ / nframes_; | |
| 130 | + if (nframes_) return psnr_ / nframes_; | |
| 141 | 131 | return 0.0; |
| 142 | 132 | } |
| 143 | 133 | |
| @@ -161,29 +151,26 @@ TEST_P(EndToEndTestLarge, EndtoEndPSNRTest) { · 17 unmodified lines | ||
| 161 | 151 | cfg_.g_input_bit_depth = test_video_param_.input_bit_depth; |
| 162 | 152 | cfg_.g_bit_depth = test_video_param_.bit_depth; |
| 163 | 153 | 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; | |
| 166 | 155 | |
| 167 | 156 | libvpx_test::VideoSource *video; |
| 168 | 157 | 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); | |
| 171 | 160 | } else { |
| 172 | 161 | 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); | |
| 176 | 164 | } |
| 177 | 165 | |
| 178 | 166 | ASSERT_NO_FATAL_FAILURE(RunLoop(video)); |
| 179 | 167 | const double psnr = GetAveragePsnr(); |
| 180 | 168 | EXPECT_GT(psnr, GetPsnrThreshold()); |
| 181 | − delete(video); | |
| 169 | + delete (video); | |
| 182 | 170 | } |
| 183 | 171 | |
| 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)); | |
| 189 | 176 | } // namespace |
| @@ -32,11 +32,10 @@ const int kNumIterations = 1000; · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | typedef int64_t (*ErrorBlockFunc)(const tran_low_t *coeff, |
| 34 | 34 | 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); | |
| 37 | 36 | |
| 38 | 37 | typedef std::tr1::tuple<ErrorBlockFunc, ErrorBlockFunc, vpx_bit_depth_t> |
| 39 | − ErrorBlockParam; | |
| 38 | + ErrorBlockParam; | |
| 40 | 39 | |
| 41 | 40 | // wrapper for 8-bit block error functions without a 'bps' param. |
| 42 | 41 | typedef int64_t (*HighBdBlockError8bit)(const tran_low_t *coeff, |
| @@ -51,14 +50,13 @@ int64_t HighBdBlockError8bitWrapper(const tran_low_t *coeff, · 8 unmodified lines | ||
| 51 | 50 | return fn(coeff, dqcoeff, block_size, ssz); |
| 52 | 51 | } |
| 53 | 52 | |
| 54 | −class ErrorBlockTest | |
| 55 | − : public ::testing::TestWithParam<ErrorBlockParam> { | |
| 53 | +class ErrorBlockTest : public ::testing::TestWithParam<ErrorBlockParam> { | |
| 56 | 54 | public: |
| 57 | 55 | virtual ~ErrorBlockTest() {} |
| 58 | 56 | virtual void SetUp() { |
| 59 | − error_block_op_ = GET_PARAM(0); | |
| 57 | + error_block_op_ = GET_PARAM(0); | |
| 60 | 58 | ref_error_block_op_ = GET_PARAM(1); |
| 61 | − bit_depth_ = GET_PARAM(2); | |
| 59 | + bit_depth_ = GET_PARAM(2); | |
| 62 | 60 | } |
| 63 | 61 | |
| 64 | 62 | virtual void TearDown() { libvpx_test::ClearSystemState(); } |
| @@ -89,18 +87,18 @@ TEST_P(ErrorBlockTest, OperationCheck) { · 24 unmodified lines | ||
| 89 | 87 | // can be used for optimization, so generate test input precisely. |
| 90 | 88 | if (rnd(2)) { |
| 91 | 89 | // Positive number |
| 92 | − coeff[j] = rnd(1 << msb); | |
| 90 | + coeff[j] = rnd(1 << msb); | |
| 93 | 91 | dqcoeff[j] = rnd(1 << msb); |
| 94 | 92 | } else { |
| 95 | 93 | // Negative number |
| 96 | − coeff[j] = -rnd(1 << msb); | |
| 94 | + coeff[j] = -rnd(1 << msb); | |
| 97 | 95 | dqcoeff[j] = -rnd(1 << msb); |
| 98 | 96 | } |
| 99 | 97 | } |
| 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_)); | |
| 104 | 102 | err_count += (ref_ret != ret) | (ref_ssz != ssz); |
| 105 | 103 | if (err_count && !err_count_total) { |
| 106 | 104 | first_failure = i; |
| @@ -130,35 +128,35 @@ TEST_P(ErrorBlockTest, ExtremeValues) { · 23 unmodified lines | ||
| 130 | 128 | int k = (i / 9) % 9; |
| 131 | 129 | |
| 132 | 130 | // Change the maximum coeff value, to test different bit boundaries |
| 133 | − if ( k == 8 && (i % 9) == 0 ) { | |
| 131 | + if (k == 8 && (i % 9) == 0) { | |
| 134 | 132 | max_val >>= 1; |
| 135 | 133 | } |
| 136 | 134 | block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64 |
| 137 | 135 | for (int j = 0; j < block_size; j++) { |
| 138 | 136 | if (k < 4) { |
| 139 | 137 | // Test at positive maximum values |
| 140 | − coeff[j] = k % 2 ? max_val : 0; | |
| 138 | + coeff[j] = k % 2 ? max_val : 0; | |
| 141 | 139 | dqcoeff[j] = (k >> 1) % 2 ? max_val : 0; |
| 142 | 140 | } else if (k < 8) { |
| 143 | 141 | // Test at negative maximum values |
| 144 | − coeff[j] = k % 2 ? -max_val : 0; | |
| 142 | + coeff[j] = k % 2 ? -max_val : 0; | |
| 145 | 143 | dqcoeff[j] = (k >> 1) % 2 ? -max_val : 0; |
| 146 | 144 | } else { |
| 147 | 145 | if (rnd(2)) { |
| 148 | 146 | // Positive number |
| 149 | − coeff[j] = rnd(1 << 14); | |
| 147 | + coeff[j] = rnd(1 << 14); | |
| 150 | 148 | dqcoeff[j] = rnd(1 << 14); |
| 151 | 149 | } else { |
| 152 | 150 | // Negative number |
| 153 | − coeff[j] = -rnd(1 << 14); | |
| 151 | + coeff[j] = -rnd(1 << 14); | |
| 154 | 152 | dqcoeff[j] = -rnd(1 << 14); |
| 155 | 153 | } |
| 156 | 154 | } |
| 157 | 155 | } |
| 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_)); | |
| 162 | 160 | err_count += (ref_ret != ret) | (ref_ssz != ssz); |
| 163 | 161 | if (err_count && !err_count_total) { |
| 164 | 162 | first_failure = i; |
| @@ -176,12 +174,12 @@ using std::tr1::make_tuple; · 11 unmodified lines | ||
| 176 | 174 | INSTANTIATE_TEST_CASE_P( |
| 177 | 175 | SSE2, ErrorBlockTest, |
| 178 | 176 | ::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), | |
| 185 | 183 | make_tuple( |
| 186 | 184 | &HighBdBlockError8bitWrapper<vp9_highbd_block_error_8bit_sse2>, |
| 187 | 185 | &HighBdBlockError8bitWrapper<vp9_highbd_block_error_8bit_c>, |
| @@ -23,11 +23,8 @@ class VPxEncoderThreadTest · 22 unmodified lines | ||
| 23 | 23 | public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> { |
| 24 | 24 | protected: |
| 25 | 25 | 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)) { | |
| 31 | 28 | init_flags_ = VPX_CODEC_USE_PSNR; |
| 32 | 29 | md5_.clear(); |
| 33 | 30 | } |
| @@ -82,7 +79,7 @@ class VPxEncoderThreadTest · 48 unmodified lines | ||
| 82 | 79 | } |
| 83 | 80 | |
| 84 | 81 | virtual bool HandleDecodeResult(const vpx_codec_err_t res, |
| 85 | − const libvpx_test::VideoSource& /*video*/, | |
| 82 | + const libvpx_test::VideoSource & /*video*/, | |
| 86 | 83 | libvpx_test::Decoder * /*decoder*/) { |
| 87 | 84 | if (res != VPX_CODEC_OK) { |
| 88 | 85 | EXPECT_EQ(VPX_CODEC_OK, res); |
| @@ -123,9 +120,9 @@ TEST_P(VPxEncoderThreadTest, EncoderResultTest) { · 34 unmodified lines | ||
| 123 | 120 | ASSERT_EQ(single_thr_md5, multi_thr_md5); |
| 124 | 121 | } |
| 125 | 122 | |
| 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)); | |
| 131 | 128 | } // namespace |
| @@ -46,7 +46,7 @@ string DecodeFileWithPause(const string &filename, int num_threads, · 45 unmodified lines | ||
| 46 | 46 | int in_frames = 0; |
| 47 | 47 | int out_frames = 0; |
| 48 | 48 | |
| 49 | − vpx_codec_dec_cfg_t cfg = {0}; | |
| 49 | + vpx_codec_dec_cfg_t cfg = { 0 }; | |
| 50 | 50 | cfg.threads = num_threads; |
| 51 | 51 | vpx_codec_flags_t flags = 0; |
| 52 | 52 | flags |= VPX_CODEC_USE_FRAME_THREADING; |
| @@ -74,8 +74,7 @@ string DecodeFileWithPause(const string &filename, int num_threads, · 21 unmodified lines | ||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // 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); | |
| 79 | 78 | |
| 80 | 79 | libvpx_test::DxDataIterator dec_iter = decoder.GetDxData(); |
| 81 | 80 | const vpx_image_t *img; |
| @@ -87,8 +86,8 @@ string DecodeFileWithPause(const string &filename, int num_threads, · 5 unmodified lines | ||
| 87 | 86 | } |
| 88 | 87 | } while (video.cxdata() != NULL); |
| 89 | 88 | |
| 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"; | |
| 92 | 91 | |
| 93 | 92 | return string(md5.Get()); |
| 94 | 93 | } |
| @@ -108,12 +107,12 @@ TEST(VP9MultiThreadedFrameParallel, PauseSeekResume) { · 13 unmodified lines | ||
| 108 | 107 | // vp90-2-07-frame_parallel-1.webm is a 40 frame video file with |
| 109 | 108 | // one key frame for every ten frames. |
| 110 | 109 | 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 }, | |
| 117 | 116 | { NULL, NULL, 0 }, |
| 118 | 117 | }; |
| 119 | 118 | DecodeFilesWithPause(files); |
| @@ -155,8 +154,7 @@ string DecodeFile(const string &filename, int num_threads, · 35 unmodified lines | ||
| 155 | 154 | video.Next(); |
| 156 | 155 | |
| 157 | 156 | // 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); | |
| 160 | 158 | |
| 161 | 159 | libvpx_test::DxDataIterator dec_iter = decoder.GetDxData(); |
| 162 | 160 | const vpx_image_t *img; |
| @@ -168,8 +166,8 @@ string DecodeFile(const string &filename, int num_threads, · 5 unmodified lines | ||
| 168 | 166 | } |
| 169 | 167 | } while (video.cxdata() != NULL); |
| 170 | 168 | |
| 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"; | |
| 173 | 171 | |
| 174 | 172 | return string(md5.Get()); |
| 175 | 173 | } |
| @@ -209,8 +207,7 @@ TEST(VP9MultiThreadedFrameParallel, InvalidFileTest) { · 33 unmodified lines | ||
| 209 | 207 | TEST(VP9MultiThreadedFrameParallel, ValidFileTest) { |
| 210 | 208 | static const FileList files[] = { |
| 211 | 209 | #if CONFIG_VP9_HIGHBITDEPTH |
| 212 | − { "vp92-2-20-10bit-yuv420.webm", | |
| 213 | − "a16b99df180c584e8db2ffeda987d293", 10 }, | |
| 210 | + { "vp92-2-20-10bit-yuv420.webm", "a16b99df180c584e8db2ffeda987d293", 10 }, | |
| 214 | 211 | #endif |
| 215 | 212 | { NULL, NULL, 0 }, |
| 216 | 213 | }; |
| @@ -28,15 +28,14 @@ using libvpx_test::ACMRandom; · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | const int count_test_block = 100000; |
| 30 | 30 | |
| 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); | |
| 34 | 33 | |
| 35 | 34 | struct IntraPredFunc { |
| 36 | 35 | IntraPredFunc(IntraPred pred = NULL, IntraPred ref = NULL, |
| 37 | 36 | 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) {} | |
| 40 | 39 | |
| 41 | 40 | IntraPred pred_fn; |
| 42 | 41 | IntraPred ref_fn; |
| @@ -46,8 +45,8 @@ struct IntraPredFunc { · 3 unmodified lines | ||
| 46 | 45 | |
| 47 | 46 | class VP9IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> { |
| 48 | 47 | 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) { | |
| 51 | 50 | ACMRandom rnd(ACMRandom::DeterministicSeed()); |
| 52 | 51 | const int block_size = params_.block_size; |
| 53 | 52 | above_row_ = above_data + 16; |
| @@ -81,14 +80,14 @@ class VP9IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> { · 27 unmodified lines | ||
| 81 | 80 | virtual void SetUp() { |
| 82 | 81 | params_ = GetParam(); |
| 83 | 82 | stride_ = params_.block_size * 3; |
| 84 | − mask_ = (1 << params_.bit_depth) - 1; | |
| 83 | + mask_ = (1 << params_.bit_depth) - 1; | |
| 85 | 84 | } |
| 86 | 85 | |
| 87 | 86 | void Predict() { |
| 88 | 87 | const int bit_depth = params_.bit_depth; |
| 89 | 88 | 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)); | |
| 92 | 91 | } |
| 93 | 92 | |
| 94 | 93 | void CheckPrediction(int test_case_number, int *error_count) const { |
| @@ -99,7 +98,7 @@ class VP9IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> { · 4 unmodified lines | ||
| 99 | 98 | *error_count += ref_dst_[x + y * stride_] != dst_[x + y * stride_]; |
| 100 | 99 | if (*error_count == 1) { |
| 101 | 100 | 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; | |
| 103 | 102 | } |
| 104 | 103 | } |
| 105 | 104 | } |
| @@ -117,8 +116,8 @@ class VP9IntraPredTest : public ::testing::TestWithParam<IntraPredFunc> { · 11 unmodified lines | ||
| 117 | 116 | |
| 118 | 117 | TEST_P(VP9IntraPredTest, IntraPredTests) { |
| 119 | 118 | // 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]); | |
| 122 | 121 | DECLARE_ALIGNED(16, uint16_t, dst[3 * 32 * 32]); |
| 123 | 122 | DECLARE_ALIGNED(16, uint16_t, ref_dst[3 * 32 * 32]); |
| 124 | 123 | RunTest(left_col, above_data, dst, ref_dst); |
| @@ -126,86 +125,86 @@ TEST_P(VP9IntraPredTest, IntraPredTests) { · 1 unmodified line | ||
| 126 | 125 | |
| 127 | 126 | #if HAVE_SSE2 |
| 128 | 127 | #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))); | |
| 209 | 208 | |
| 210 | 209 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 211 | 210 | #endif // HAVE_SSE2 |
| @@ -21,15 +21,13 @@ namespace { · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | const int kMaxPsnr = 100; |
| 23 | 23 | |
| 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> { | |
| 26 | 27 | protected: |
| 27 | 28 | 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)) {} | |
| 33 | 31 | |
| 34 | 32 | virtual ~LosslessTest() {} |
| 35 | 33 | |
| @@ -55,13 +53,10 @@ class LosslessTest : public ::libvpx_test::EncoderTest, · 19 unmodified lines | ||
| 55 | 53 | } |
| 56 | 54 | |
| 57 | 55 | 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]; | |
| 60 | 57 | } |
| 61 | 58 | |
| 62 | − double GetMinPsnr() const { | |
| 63 | − return psnr_; | |
| 64 | − } | |
| 59 | + double GetMinPsnr() const { return psnr_; } | |
| 65 | 60 | |
| 66 | 61 | private: |
| 67 | 62 | double psnr_; |
| @@ -34,9 +34,8 @@ const int number_of_iterations = 100; · 33 unmodified lines | ||
| 34 | 34 | typedef void (*QuantizeFunc)(const tran_low_t *coeff, intptr_t count, |
| 35 | 35 | int skip_block, const int16_t *zbin, |
| 36 | 36 | 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, | |
| 40 | 39 | uint16_t *eob, const int16_t *scan, |
| 41 | 40 | const int16_t *iscan); |
| 42 | 41 | typedef std::tr1::tuple<QuantizeFunc, QuantizeFunc, vpx_bit_depth_t> |
| @@ -46,9 +45,9 @@ class VP9QuantizeTest : public ::testing::TestWithParam<QuantizeParam> { · 3 unmodified lines | ||
| 46 | 45 | public: |
| 47 | 46 | virtual ~VP9QuantizeTest() {} |
| 48 | 47 | virtual void SetUp() { |
| 49 | − quantize_op_ = GET_PARAM(0); | |
| 48 | + quantize_op_ = GET_PARAM(0); | |
| 50 | 49 | ref_quantize_op_ = GET_PARAM(1); |
| 51 | − bit_depth_ = GET_PARAM(2); | |
| 50 | + bit_depth_ = GET_PARAM(2); | |
| 52 | 51 | mask_ = (1 << bit_depth_) - 1; |
| 53 | 52 | } |
| 54 | 53 | |
| @@ -65,9 +64,9 @@ class VP9Quantize32Test : public ::testing::TestWithParam<QuantizeParam> { · 10 unmodified lines | ||
| 65 | 64 | public: |
| 66 | 65 | virtual ~VP9Quantize32Test() {} |
| 67 | 66 | virtual void SetUp() { |
| 68 | − quantize_op_ = GET_PARAM(0); | |
| 67 | + quantize_op_ = GET_PARAM(0); | |
| 69 | 68 | ref_quantize_op_ = GET_PARAM(1); |
| 70 | − bit_depth_ = GET_PARAM(2); | |
| 69 | + bit_depth_ = GET_PARAM(2); | |
| 71 | 70 | mask_ = (1 << bit_depth_) - 1; |
| 72 | 71 | } |
| 73 | 72 | |
| @@ -106,10 +105,10 @@ TEST_P(VP9QuantizeTest, OperationCheck) { · 32 unmodified lines | ||
| 106 | 105 | *eob_ptr = rnd.Rand16(); |
| 107 | 106 | *ref_eob_ptr = *eob_ptr; |
| 108 | 107 | for (int j = 0; j < count; j++) { |
| 109 | − coeff_ptr[j] = rnd.Rand16()&mask_; | |
| 108 | + coeff_ptr[j] = rnd.Rand16() & mask_; | |
| 110 | 109 | } |
| 111 | 110 | for (int j = 0; j < 2; j++) { |
| 112 | − zbin_ptr[j] = rnd.Rand16()&mask_; | |
| 111 | + zbin_ptr[j] = rnd.Rand16() & mask_; | |
| 113 | 112 | round_ptr[j] = rnd.Rand16(); |
| 114 | 113 | quant_ptr[j] = rnd.Rand16(); |
| 115 | 114 | quant_shift_ptr[j] = rnd.Rand16(); |
| @@ -117,16 +116,15 @@ TEST_P(VP9QuantizeTest, OperationCheck) { · 1 unmodified line | ||
| 117 | 116 | } |
| 118 | 117 | ref_quantize_op_(coeff_ptr, count, skip_block, zbin_ptr, round_ptr, |
| 119 | 118 | 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)); | |
| 127 | 125 | 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]); | |
| 130 | 128 | } |
| 131 | 129 | err_count += (*ref_eob_ptr != *eob_ptr); |
| 132 | 130 | if (err_count && !err_count_total) { |
| @@ -165,10 +163,10 @@ TEST_P(VP9Quantize32Test, OperationCheck) { · 32 unmodified lines | ||
| 165 | 163 | *eob_ptr = rnd.Rand16(); |
| 166 | 164 | *ref_eob_ptr = *eob_ptr; |
| 167 | 165 | for (int j = 0; j < count; j++) { |
| 168 | − coeff_ptr[j] = rnd.Rand16()&mask_; | |
| 166 | + coeff_ptr[j] = rnd.Rand16() & mask_; | |
| 169 | 167 | } |
| 170 | 168 | for (int j = 0; j < 2; j++) { |
| 171 | − zbin_ptr[j] = rnd.Rand16()&mask_; | |
| 169 | + zbin_ptr[j] = rnd.Rand16() & mask_; | |
| 172 | 170 | round_ptr[j] = rnd.Rand16(); |
| 173 | 171 | quant_ptr[j] = rnd.Rand16(); |
| 174 | 172 | quant_shift_ptr[j] = rnd.Rand16(); |
| @@ -176,16 +174,15 @@ TEST_P(VP9Quantize32Test, OperationCheck) { · 1 unmodified line | ||
| 176 | 174 | } |
| 177 | 175 | ref_quantize_op_(coeff_ptr, count, skip_block, zbin_ptr, round_ptr, |
| 178 | 176 | 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)); | |
| 186 | 183 | 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]); | |
| 189 | 186 | } |
| 190 | 187 | err_count += (*ref_eob_ptr != *eob_ptr); |
| 191 | 188 | if (err_count && !err_count_total) { |
| @@ -227,10 +224,10 @@ TEST_P(VP9QuantizeTest, EOBCheck) { · 35 unmodified lines | ||
| 227 | 224 | for (int j = 0; j < count; j++) { |
| 228 | 225 | coeff_ptr[j] = 0; |
| 229 | 226 | } |
| 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_; | |
| 232 | 229 | for (int j = 0; j < 2; j++) { |
| 233 | − zbin_ptr[j] = rnd.Rand16()&mask_; | |
| 230 | + zbin_ptr[j] = rnd.Rand16() & mask_; | |
| 234 | 231 | round_ptr[j] = rnd.Rand16(); |
| 235 | 232 | quant_ptr[j] = rnd.Rand16(); |
| 236 | 233 | quant_shift_ptr[j] = rnd.Rand16(); |
| @@ -239,17 +236,16 @@ TEST_P(VP9QuantizeTest, EOBCheck) { · 2 unmodified lines | ||
| 239 | 236 | |
| 240 | 237 | ref_quantize_op_(coeff_ptr, count, skip_block, zbin_ptr, round_ptr, |
| 241 | 238 | 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)); | |
| 249 | 245 | |
| 250 | 246 | 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]); | |
| 253 | 249 | } |
| 254 | 250 | err_count += (*ref_eob_ptr != *eob_ptr); |
| 255 | 251 | if (err_count && !err_count_total) { |
| @@ -291,10 +287,10 @@ TEST_P(VP9Quantize32Test, EOBCheck) { · 35 unmodified lines | ||
| 291 | 287 | coeff_ptr[j] = 0; |
| 292 | 288 | } |
| 293 | 289 | // 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_; | |
| 296 | 292 | for (int j = 0; j < 2; j++) { |
| 297 | − zbin_ptr[j] = rnd.Rand16()&mask_; | |
| 293 | + zbin_ptr[j] = rnd.Rand16() & mask_; | |
| 298 | 294 | round_ptr[j] = rnd.Rand16(); |
| 299 | 295 | quant_ptr[j] = rnd.Rand16(); |
| 300 | 296 | quant_shift_ptr[j] = rnd.Rand16(); |
| @@ -303,17 +299,16 @@ TEST_P(VP9Quantize32Test, EOBCheck) { · 2 unmodified lines | ||
| 303 | 299 | |
| 304 | 300 | ref_quantize_op_(coeff_ptr, count, skip_block, zbin_ptr, round_ptr, |
| 305 | 301 | 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)); | |
| 313 | 308 | |
| 314 | 309 | 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]); | |
| 317 | 312 | } |
| 318 | 313 | err_count += (*ref_eob_ptr != *eob_ptr); |
| 319 | 314 | if (err_count && !err_count_total) { |
| @@ -330,22 +325,20 @@ using std::tr1::make_tuple; · 10 unmodified lines | ||
| 330 | 325 | #if HAVE_SSE2 |
| 331 | 326 | INSTANTIATE_TEST_CASE_P( |
| 332 | 327 | 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))); | |
| 340 | 334 | INSTANTIATE_TEST_CASE_P( |
| 341 | 335 | 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))); | |
| 349 | 342 | #endif // HAVE_SSE2 |
| 350 | 343 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 351 | 344 | } // namespace |
| @@ -24,14 +24,10 @@ const char kVp9Md5File[] = "vp90-2-08-tile_1x8_frame_parallel.webm.md5"; · 23 unmodified lines | ||
| 24 | 24 | // Class for testing shutting off the loop filter. |
| 25 | 25 | class SkipLoopFilterTest { |
| 26 | 26 | public: |
| 27 | − SkipLoopFilterTest() | |
| 28 | − : video_(NULL), | |
| 29 | − decoder_(NULL), | |
| 30 | − md5_file_(NULL) {} | |
| 27 | + SkipLoopFilterTest() : video_(NULL), decoder_(NULL), md5_file_(NULL) {} | |
| 31 | 28 | |
| 32 | 29 | ~SkipLoopFilterTest() { |
| 33 | − if (md5_file_ != NULL) | |
| 34 | − fclose(md5_file_); | |
| 30 | + if (md5_file_ != NULL) fclose(md5_file_); | |
| 35 | 31 | delete decoder_; |
| 36 | 32 | delete video_; |
| 37 | 33 | } |
| @@ -46,8 +42,7 @@ class SkipLoopFilterTest { · 8 unmodified lines | ||
| 46 | 42 | video_->Begin(); |
| 47 | 43 | |
| 48 | 44 | 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; | |
| 51 | 46 | decoder_ = new libvpx_test::VP9Decoder(cfg, 0); |
| 52 | 47 | ASSERT_TRUE(decoder_ != NULL); |
| 53 | 48 | |
| @@ -73,8 +68,7 @@ class SkipLoopFilterTest { · 19 unmodified lines | ||
| 73 | 68 | for (; video_->cxdata() != NULL; video_->Next()) { |
| 74 | 69 | const vpx_codec_err_t res = |
| 75 | 70 | decoder_->DecodeFrame(video_->cxdata(), video_->frame_size()); |
| 76 | − if (res != VPX_CODEC_OK) | |
| 77 | − return res; | |
| 71 | + if (res != VPX_CODEC_OK) return res; | |
| 78 | 72 | ReadMd5(); |
| 79 | 73 | } |
| 80 | 74 | return VPX_CODEC_OK; |
| @@ -92,7 +86,7 @@ class SkipLoopFilterTest { · 11 unmodified lines | ||
| 92 | 86 | void OpenMd5File(const std::string &md5_file_name) { |
| 93 | 87 | md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name); |
| 94 | 88 | ASSERT_TRUE(md5_file_ != NULL) << "MD5 file open failed. Filename: " |
| 95 | − << md5_file_name; | |
| 89 | + << md5_file_name; | |
| 96 | 90 | } |
| 97 | 91 | |
| 98 | 92 | // Reads the next line of the MD5 file. |
| @@ -19,18 +19,16 @@ · 18 unmodified lines | ||
| 19 | 19 | #include "vp9/common/vp9_blockd.h" |
| 20 | 20 | #include "vpx_mem/vpx_mem.h" |
| 21 | 21 | |
| 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); | |
| 26 | 26 | |
| 27 | 27 | namespace vp9 { |
| 28 | 28 | |
| 29 | 29 | class VP9SubtractBlockTest : public ::testing::TestWithParam<SubtractFunc> { |
| 30 | 30 | public: |
| 31 | − virtual void TearDown() { | |
| 32 | − libvpx_test::ClearSystemState(); | |
| 33 | − } | |
| 31 | + virtual void TearDown() { libvpx_test::ClearSystemState(); } | |
| 34 | 32 | }; |
| 35 | 33 | |
| 36 | 34 | using libvpx_test::ACMRandom; |
| @@ -47,7 +45,7 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) { · 10 unmodified lines | ||
| 47 | 45 | vpx_memalign(16, sizeof(*diff) * block_width * block_height * 2)); |
| 48 | 46 | uint8_t *pred = reinterpret_cast<uint8_t *>( |
| 49 | 47 | vpx_memalign(16, block_width * block_height * 2)); |
| 50 | − uint8_t *src = reinterpret_cast<uint8_t *>( | |
| 48 | + uint8_t *src = reinterpret_cast<uint8_t *>( | |
| 51 | 49 | vpx_memalign(16, block_width * block_height * 2)); |
| 52 | 50 | |
| 53 | 51 | for (int n = 0; n < 100; n++) { |
| @@ -58,29 +56,26 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) { · 4 unmodified lines | ||
| 58 | 56 | } |
| 59 | 57 | } |
| 60 | 58 | |
| 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); | |
| 63 | 61 | |
| 64 | 62 | for (int r = 0; r < block_height; ++r) { |
| 65 | 63 | for (int c = 0; c < block_width; ++c) { |
| 66 | 64 | 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; | |
| 71 | 67 | } |
| 72 | 68 | } |
| 73 | 69 | |
| 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); | |
| 76 | 72 | |
| 77 | 73 | for (int r = 0; r < block_height; ++r) { |
| 78 | 74 | 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; | |
| 84 | 79 | } |
| 85 | 80 | } |
| 86 | 81 | } |
| @@ -27,15 +27,11 @@ using std::string; · 26 unmodified lines | ||
| 27 | 27 | class VPxWorkerThreadTest : public ::testing::TestWithParam<bool> { |
| 28 | 28 | protected: |
| 29 | 29 | virtual ~VPxWorkerThreadTest() {} |
| 30 | − virtual void SetUp() { | |
| 31 | − vpx_get_worker_interface()->init(&worker_); | |
| 32 | − } | |
| 30 | + virtual void SetUp() { vpx_get_worker_interface()->init(&worker_); } | |
| 33 | 31 | |
| 34 | − virtual void TearDown() { | |
| 35 | − vpx_get_worker_interface()->end(&worker_); | |
| 36 | − } | |
| 32 | + virtual void TearDown() { vpx_get_worker_interface()->end(&worker_); } | |
| 37 | 33 | |
| 38 | − void Run(VPxWorker* worker) { | |
| 34 | + void Run(VPxWorker *worker) { | |
| 39 | 35 | const bool synchronous = GetParam(); |
| 40 | 36 | if (synchronous) { |
| 41 | 37 | vpx_get_worker_interface()->execute(worker); |
| @@ -47,10 +43,10 @@ class VPxWorkerThreadTest : public ::testing::TestWithParam<bool> { · 5 unmodified lines | ||
| 47 | 43 | VPxWorker worker_; |
| 48 | 44 | }; |
| 49 | 45 | |
| 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); | |
| 52 | 48 | *hook_data = 5; |
| 53 | − return *reinterpret_cast<int*>(return_value); | |
| 49 | + return *reinterpret_cast<int *>(return_value); | |
| 54 | 50 | } |
| 55 | 51 | |
| 56 | 52 | TEST_P(VPxWorkerThreadTest, HookSuccess) { |
| @@ -159,7 +155,7 @@ struct FileList { · 102 unmodified lines | ||
| 159 | 155 | }; |
| 160 | 156 | |
| 161 | 157 | // 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) { | |
| 163 | 159 | libvpx_test::WebMVideoSource video(filename); |
| 164 | 160 | video.Init(); |
| 165 | 161 | |
| @@ -191,8 +187,8 @@ void DecodeFiles(const FileList files[]) { · 25 unmodified lines | ||
| 191 | 187 | for (const FileList *iter = files; iter->name != NULL; ++iter) { |
| 192 | 188 | SCOPED_TRACE(iter->name); |
| 193 | 189 | 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; | |
| 196 | 192 | } |
| 197 | 193 | } |
| 198 | 194 | } |
| @@ -242,15 +238,13 @@ TEST(VP9DecodeMultiThreadedTest, NoTilesNonFrameParallel) { · 43 unmodified lines | ||
| 242 | 238 | } |
| 243 | 239 | |
| 244 | 240 | 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 } }; | |
| 254 | 248 | |
| 255 | 249 | DecodeFiles(files); |
| 256 | 250 | } |
| @@ -25,9 +25,7 @@ typedef void (*CopyFrameFunc)(const YV12_BUFFER_CONFIG *src_ybf, · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | class VpxScaleBase { |
| 27 | 27 | public: |
| 28 | − virtual ~VpxScaleBase() { | |
| 29 | − libvpx_test::ClearSystemState(); | |
| 30 | − } | |
| 28 | + virtual ~VpxScaleBase() { libvpx_test::ClearSystemState(); } | |
| 31 | 29 | |
| 32 | 30 | void ResetImage(int width, int height) { |
| 33 | 31 | width_ = width; |
| @@ -105,28 +103,22 @@ class VpxScaleBase { · 71 unmodified lines | ||
| 105 | 103 | } |
| 106 | 104 | |
| 107 | 105 | 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) { | |
| 109 | 107 | memcpy(bottom, left + (crop_height - 1) * stride, extend_width); |
| 110 | 108 | bottom += stride; |
| 111 | 109 | } |
| 112 | 110 | } |
| 113 | 111 | |
| 114 | 112 | 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); | |
| 130 | 122 | } |
| 131 | 123 | |
| 132 | 124 | void ReferenceCopyFrame() { |
| @@ -172,13 +164,9 @@ class ExtendBorderTest · 39 unmodified lines | ||
| 172 | 164 | virtual ~ExtendBorderTest() {} |
| 173 | 165 | |
| 174 | 166 | protected: |
| 175 | − virtual void SetUp() { | |
| 176 | − extend_fn_ = GetParam(); | |
| 177 | − } | |
| 167 | + virtual void SetUp() { extend_fn_ = GetParam(); } | |
| 178 | 168 | |
| 179 | − void ExtendBorder() { | |
| 180 | − ASM_REGISTER_STATE_CHECK(extend_fn_(&img_)); | |
| 181 | − } | |
| 169 | + void ExtendBorder() { ASM_REGISTER_STATE_CHECK(extend_fn_(&img_)); } | |
| 182 | 170 | |
| 183 | 171 | void RunTest() { |
| 184 | 172 | #if ARCH_ARM |
| @@ -187,7 +175,7 @@ class ExtendBorderTest · 2 unmodified lines | ||
| 187 | 175 | #else |
| 188 | 176 | static const int kNumSizesToTest = 7; |
| 189 | 177 | #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 }; | |
| 191 | 179 | for (int h = 0; h < kNumSizesToTest; ++h) { |
| 192 | 180 | for (int w = 0; w < kNumSizesToTest; ++w) { |
| 193 | 181 | ResetImage(kSizesToTest[w], kSizesToTest[h]); |
| @@ -202,23 +190,18 @@ class ExtendBorderTest · 8 unmodified lines | ||
| 202 | 190 | ExtendFrameBorderFunc extend_fn_; |
| 203 | 191 | }; |
| 204 | 192 | |
| 205 | −TEST_P(ExtendBorderTest, ExtendBorder) { | |
| 206 | − ASSERT_NO_FATAL_FAILURE(RunTest()); | |
| 207 | −} | |
| 193 | +TEST_P(ExtendBorderTest, ExtendBorder) { ASSERT_NO_FATAL_FAILURE(RunTest()); } | |
| 208 | 194 | |
| 209 | 195 | INSTANTIATE_TEST_CASE_P(C, ExtendBorderTest, |
| 210 | 196 | ::testing::Values(vp8_yv12_extend_frame_borders_c)); |
| 211 | 197 | |
| 212 | −class CopyFrameTest | |
| 213 | − : public VpxScaleBase, | |
| 214 | − public ::testing::TestWithParam<CopyFrameFunc> { | |
| 198 | +class CopyFrameTest : public VpxScaleBase, | |
| 199 | + public ::testing::TestWithParam<CopyFrameFunc> { | |
| 215 | 200 | public: |
| 216 | 201 | virtual ~CopyFrameTest() {} |
| 217 | 202 | |
| 218 | 203 | protected: |
| 219 | − virtual void SetUp() { | |
| 220 | − copy_frame_fn_ = GetParam(); | |
| 221 | − } | |
| 204 | + virtual void SetUp() { copy_frame_fn_ = GetParam(); } | |
| 222 | 205 | |
| 223 | 206 | void CopyFrame() { |
| 224 | 207 | ASM_REGISTER_STATE_CHECK(copy_frame_fn_(&img_, &cpy_img_)); |
| @@ -231,7 +214,7 @@ class CopyFrameTest · 6 unmodified lines | ||
| 231 | 214 | #else |
| 232 | 215 | static const int kNumSizesToTest = 7; |
| 233 | 216 | #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 }; | |
| 235 | 218 | for (int h = 0; h < kNumSizesToTest; ++h) { |
| 236 | 219 | for (int w = 0; w < kNumSizesToTest; ++w) { |
| 237 | 220 | ResetImage(kSizesToTest[w], kSizesToTest[h]); |
| @@ -246,9 +229,7 @@ class CopyFrameTest · 8 unmodified lines | ||
| 246 | 229 | CopyFrameFunc copy_frame_fn_; |
| 247 | 230 | }; |
| 248 | 231 | |
| 249 | −TEST_P(CopyFrameTest, CopyFrame) { | |
| 250 | − ASSERT_NO_FATAL_FAILURE(RunTest()); | |
| 251 | −} | |
| 232 | +TEST_P(CopyFrameTest, CopyFrame) { ASSERT_NO_FATAL_FAILURE(RunTest()); } | |
| 252 | 233 | |
| 253 | 234 | INSTANTIATE_TEST_CASE_P(C, CopyFrameTest, |
| 254 | 235 | ::testing::Values(vp8_yv12_copy_frame_c)); |
| @@ -25,30 +25,23 @@ namespace libvpx_test { · 24 unmodified lines | ||
| 25 | 25 | class WebMVideoSource : public CompressedVideoSource { |
| 26 | 26 | public: |
| 27 | 27 | 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) {} | |
| 36 | 31 | |
| 37 | 32 | virtual ~WebMVideoSource() { |
| 38 | − if (vpx_ctx_->file != NULL) | |
| 39 | − fclose(vpx_ctx_->file); | |
| 33 | + if (vpx_ctx_->file != NULL) fclose(vpx_ctx_->file); | |
| 40 | 34 | webm_free(webm_ctx_); |
| 41 | 35 | delete vpx_ctx_; |
| 42 | 36 | delete webm_ctx_; |
| 43 | 37 | } |
| 44 | 38 | |
| 45 | − virtual void Init() { | |
| 46 | − } | |
| 39 | + virtual void Init() {} | |
| 47 | 40 | |
| 48 | 41 | virtual void Begin() { |
| 49 | 42 | vpx_ctx_->file = OpenTestDataFile(file_name_); |
| 50 | 43 | ASSERT_TRUE(vpx_ctx_->file != NULL) << "Input file open failed. Filename: " |
| 51 | − << file_name_; | |
| 44 | + << file_name_; | |
| 52 | 45 | |
| 53 | 46 | ASSERT_EQ(file_is_webm(webm_ctx_, vpx_ctx_), 1) << "file is not WebM"; |
| 54 | 47 | |
| @@ -81,9 +74,7 @@ class WebMVideoSource : public CompressedVideoSource { · 26 unmodified lines | ||
| 81 | 74 | } while (!webm_ctx_->is_key_frame && !end_of_file_); |
| 82 | 75 | } |
| 83 | 76 | |
| 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_; } | |
| 87 | 78 | virtual size_t frame_size() const { return buf_sz_; } |
| 88 | 79 | virtual unsigned int frame_number() const { return frame_; } |
| 89 | 80 | |
| @@ -22,7 +22,7 @@ namespace { · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | using std::string; |
| 24 | 24 | |
| 25 | −static const unsigned int kWidth = 160; | |
| 25 | +static const unsigned int kWidth = 160; | |
| 26 | 26 | static const unsigned int kHeight = 90; |
| 27 | 27 | static const unsigned int kFrames = 10; |
| 28 | 28 | |
| @@ -34,24 +34,24 @@ struct Y4mTestParam { · 5 unmodified lines | ||
| 34 | 34 | }; |
| 35 | 35 | |
| 36 | 36 | 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" }, | |
| 55 | 55 | }; |
| 56 | 56 | |
| 57 | 57 | 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 | ||
| 60 | 60 | const unsigned char *buf = img->planes[plane]; |
| 61 | 61 | const int stride = img->stride[plane]; |
| 62 | 62 | 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); | |
| 67 | 69 | for (y = 0; y < h; ++y) { |
| 68 | 70 | fwrite(buf, bytes_per_sample, w, file); |
| 69 | 71 | buf += stride; |
| @@ -71,15 +73,12 @@ static void write_image_file(const vpx_image_t *img, FILE *file) { · 1 unmodified line | ||
| 71 | 73 | } |
| 72 | 74 | } |
| 73 | 75 | |
| 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 { | |
| 77 | 78 | protected: |
| 78 | 79 | Y4mVideoSourceTest() : Y4mVideoSource("", 0, 0) {} |
| 79 | 80 | |
| 80 | − virtual ~Y4mVideoSourceTest() { | |
| 81 | − CloseSource(); | |
| 82 | − } | |
| 81 | + virtual ~Y4mVideoSourceTest() { CloseSource(); } | |
| 83 | 82 | |
| 84 | 83 | virtual void Init(const std::string &file_name, int limit) { |
| 85 | 84 | file_name_ = file_name; |
| @@ -137,8 +136,7 @@ TEST_P(Y4mVideoSourceTest, SourceTest) { · 51 unmodified lines | ||
| 137 | 136 | INSTANTIATE_TEST_CASE_P(C, Y4mVideoSourceTest, |
| 138 | 137 | ::testing::ValuesIn(kY4mTestVectors)); |
| 139 | 138 | |
| 140 | −class Y4mVideoWriteTest | |
| 141 | − : public Y4mVideoSourceTest { | |
| 139 | +class Y4mVideoWriteTest : public Y4mVideoSourceTest { | |
| 142 | 140 | protected: |
| 143 | 141 | Y4mVideoWriteTest() {} |
| 144 | 142 | |
| @@ -158,14 +156,12 @@ class Y4mVideoWriteTest · 13 unmodified lines | ||
| 158 | 156 | // Writes out a y4m file and then reads it back |
| 159 | 157 | void WriteY4mAndReadBack() { |
| 160 | 158 | 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 }; | |
| 163 | 161 | tmpfile_ = new libvpx_test::TempOutFile; |
| 164 | 162 | 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); | |
| 169 | 165 | fputs(buf, tmpfile_->file()); |
| 170 | 166 | for (unsigned int i = start_; i < limit_; i++) { |
| 171 | 167 | y4m_write_frame_header(buf, sizeof(buf)); |
| @@ -21,18 +21,10 @@ namespace libvpx_test { · 20 unmodified lines | ||
| 21 | 21 | // so that we can do actual file encodes. |
| 22 | 22 | class Y4mVideoSource : public VideoSource { |
| 23 | 23 | 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_() {} | |
| 36 | 28 | |
| 37 | 29 | virtual ~Y4mVideoSource() { |
| 38 | 30 | vpx_img_free(img_.get()); |
| @@ -25,19 +25,11 @@ namespace libvpx_test { · 24 unmodified lines | ||
| 25 | 25 | class YUVVideoSource : public VideoSource { |
| 26 | 26 | public: |
| 27 | 27 | 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), | |
| 41 | 33 | framerate_denominator_(rate_denominator) { |
| 42 | 34 | // This initializes format_, raw_size_, width_, height_ and allocates img. |
| 43 | 35 | SetSize(width, height, format); |
| @@ -45,13 +37,11 @@ class YUVVideoSource : public VideoSource { · 1 unmodified line | ||
| 45 | 37 | |
| 46 | 38 | virtual ~YUVVideoSource() { |
| 47 | 39 | vpx_img_free(img_); |
| 48 | − if (input_file_) | |
| 49 | − fclose(input_file_); | |
| 40 | + if (input_file_) fclose(input_file_); | |
| 50 | 41 | } |
| 51 | 42 | |
| 52 | 43 | virtual void Begin() { |
| 53 | − if (input_file_) | |
| 54 | − fclose(input_file_); | |
| 44 | + if (input_file_) fclose(input_file_); | |
| 55 | 45 | input_file_ = OpenTestDataFile(file_name_); |
| 56 | 46 | ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: " |
| 57 | 47 | << file_name_; |
| @@ -67,7 +57,7 @@ class YUVVideoSource : public VideoSource { · 9 unmodified lines | ||
| 67 | 57 | FillFrame(); |
| 68 | 58 | } |
| 69 | 59 | |
| 70 | − virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL; } | |
| 60 | + virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL; } | |
| 71 | 61 | |
| 72 | 62 | // Models a stream where Timebase = 1/FPS, so pts == frame. |
| 73 | 63 | virtual vpx_codec_pts_t pts() const { return frame_; } |
| @@ -93,32 +83,15 @@ class YUVVideoSource : public VideoSource { · 19 unmodified lines | ||
| 93 | 83 | height_ = height; |
| 94 | 84 | format_ = format; |
| 95 | 85 | 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); | |
| 122 | 95 | } |
| 123 | 96 | } |
| 124 | 97 | } |