Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: source/libvpx/test/sad_test.cc

Issue 17451020: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/test/pp_filter_test.cc ('k') | source/libvpx/test/sixtap_predict_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 11
12 #include <string.h> 12 #include <string.h>
13 #include <limits.h> 13 #include <limits.h>
14 #include <stdio.h> 14 #include <stdio.h>
15 15
16 extern "C" { 16 extern "C" {
17 #include "./vpx_config.h" 17 #include "./vpx_config.h"
18 #if CONFIG_VP8_ENCODER 18 #if CONFIG_VP8_ENCODER
19 #include "./vp8_rtcd.h" 19 #include "./vp8_rtcd.h"
20 //#include "vp8/common/blockd.h" 20 //#include "vp8/common/blockd.h"
21 #endif 21 #endif
22 #if CONFIG_VP9_ENCODER 22 #if CONFIG_VP9_ENCODER
23 #include "./vp9_rtcd.h" 23 #include "./vp9_rtcd.h"
24 #endif 24 #endif
25 #include "vpx_mem/vpx_mem.h" 25 #include "vpx_mem/vpx_mem.h"
26 } 26 }
27 27
28 #include "test/acm_random.h" 28 #include "test/acm_random.h"
29 #include "test/clear_system_state.h"
29 #include "test/register_state_check.h" 30 #include "test/register_state_check.h"
30 #include "test/util.h" 31 #include "test/util.h"
31 #include "third_party/googletest/src/include/gtest/gtest.h" 32 #include "third_party/googletest/src/include/gtest/gtest.h"
32 33
33 34
34 typedef unsigned int (*sad_m_by_n_fn_t)(const unsigned char *source_ptr, 35 typedef unsigned int (*sad_m_by_n_fn_t)(const unsigned char *source_ptr,
35 int source_stride, 36 int source_stride,
36 const unsigned char *reference_ptr, 37 const unsigned char *reference_ptr,
37 int reference_stride, 38 int reference_stride,
38 unsigned int max_sad); 39 unsigned int max_sad);
(...skipping 21 matching lines...) Expand all
60 vpx_memalign(kDataAlignment, kDataBufferSize)); 61 vpx_memalign(kDataAlignment, kDataBufferSize));
61 } 62 }
62 63
63 static void TearDownTestCase() { 64 static void TearDownTestCase() {
64 vpx_free(source_data_); 65 vpx_free(source_data_);
65 source_data_ = NULL; 66 source_data_ = NULL;
66 vpx_free(reference_data_); 67 vpx_free(reference_data_);
67 reference_data_ = NULL; 68 reference_data_ = NULL;
68 } 69 }
69 70
71 virtual void TearDown() {
72 libvpx_test::ClearSystemState();
73 }
74
70 protected: 75 protected:
71 // Handle blocks up to 4 blocks 64x64 with stride up to 128 76 // Handle blocks up to 4 blocks 64x64 with stride up to 128
72 static const int kDataAlignment = 16; 77 static const int kDataAlignment = 16;
73 static const int kDataBlockSize = 64 * 128; 78 static const int kDataBlockSize = 64 * 128;
74 static const int kDataBufferSize = 4 * kDataBlockSize; 79 static const int kDataBufferSize = 4 * kDataBlockSize;
75 80
76 virtual void SetUp() { 81 virtual void SetUp() {
77 source_stride_ = (width_ + 31) & ~31; 82 source_stride_ = (width_ + 31) & ~31;
78 reference_stride_ = width_ * 2; 83 reference_stride_ = width_ * 2;
79 rnd_.Reset(ACMRandom::DeterministicSeed()); 84 rnd_.Reset(ACMRandom::DeterministicSeed());
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 #endif 522 #endif
518 #endif 523 #endif
519 524
520 #if HAVE_SSSE3 525 #if HAVE_SSSE3
521 const sad_m_by_n_fn_t sad_16x16_sse3 = vp8_sad16x16_sse3; 526 const sad_m_by_n_fn_t sad_16x16_sse3 = vp8_sad16x16_sse3;
522 INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values( 527 INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values(
523 make_tuple(16, 16, sad_16x16_sse3))); 528 make_tuple(16, 16, sad_16x16_sse3)));
524 #endif 529 #endif
525 530
526 } // namespace 531 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/pp_filter_test.cc ('k') | source/libvpx/test/sixtap_predict_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698