OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_BLOCK_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_BLOCK_H_ |
6 #define MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_BLOCK_H_ | 6 #define MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_BLOCK_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "media/base/media_export.h" | 9 #include "media/base/media_export.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 | 12 |
13 // Size (in pixels) of each square block used for diffing. This must be a | 13 enum { |
14 // multiple of sizeof(uint64)/8. | 14 // Size (in pixels) of each square block used for diffing. This must be a |
15 const int kBlockSize = 32; | 15 // multiple of sizeof(uint64)/8. |
| 16 kBlockSize = 32, |
16 | 17 |
17 // Format: BGRA 32 bit. | 18 // Format: BGRA 32 bit. |
18 const int kBytesPerPixel = 4; | 19 kBytesPerPixel = 4, |
| 20 }; |
| 21 |
| 22 // Selects the optimal CPU specific BlockDifference() method at runtime. Must |
| 23 // be called prior to using BlockDifference. Called during media library init; |
| 24 // most users should not need to call this function. |
| 25 MEDIA_EXPORT void InitializeCPUSpecificBlockDifference(); |
19 | 26 |
20 // Low level functions to compare 2 blocks of pixels. Zero means the blocks | 27 // Low level functions to compare 2 blocks of pixels. Zero means the blocks |
21 // are identical. One - the blocks are different. | 28 // are identical. One - the blocks are different. |
22 MEDIA_EXPORT int BlockDifference(const uint8* image1, | 29 MEDIA_EXPORT int BlockDifference(const uint8* image1, |
23 const uint8* image2, | 30 const uint8* image2, |
24 int stride); | 31 int stride); |
25 | 32 |
26 } // namespace media | 33 } // namespace media |
27 | 34 |
28 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_BLOCK_H_ | 35 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_DIFFER_BLOCK_H_ |
OLD | NEW |