mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
Aligned buffer sizes for subsampled Bayer formats.
BUG=289 TEST=drmemory Review URL: https://webrtc-codereview.appspot.com/4819004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@888 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
d0a4b4ac01
commit
339ce58196
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 886
|
||||
Version: 888
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 886
|
||||
#define LIBYUV_VERSION 888
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -786,21 +786,23 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \
|
||||
TESTATOBIPLANAR(ARGB, 4, NV12, 2, 2)
|
||||
TESTATOBIPLANAR(ARGB, 4, NV21, 2, 2)
|
||||
|
||||
#define TESTATOBI(FMT_A, BPP_A, STRIDE_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, \
|
||||
#define TESTATOBI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, \
|
||||
W1280, DIFF, N, NEG, OFF) \
|
||||
TEST_F(libyuvTest, FMT_A##To##FMT_B##N) { \
|
||||
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
|
||||
const int kHeight = benchmark_height_; \
|
||||
const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \
|
||||
const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \
|
||||
const int kStrideA = (kWidth * BPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \
|
||||
const int kStrideB = (kWidth * BPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \
|
||||
align_buffer_64(src_argb, kStrideA * kHeight + OFF); \
|
||||
align_buffer_64(dst_argb_c, kStrideB * kHeight); \
|
||||
align_buffer_64(dst_argb_opt, kStrideB * kHeight); \
|
||||
memset(dst_argb_c, 0, kStrideB * kHeight); \
|
||||
memset(dst_argb_opt, 0, kStrideB * kHeight); \
|
||||
align_buffer_64(src_argb, kStrideA * kHeightA + OFF); \
|
||||
align_buffer_64(dst_argb_c, kStrideB * kHeightB); \
|
||||
align_buffer_64(dst_argb_opt, kStrideB * kHeightB); \
|
||||
memset(dst_argb_c, 0, kStrideB * kHeightB); \
|
||||
memset(dst_argb_opt, 0, kStrideB * kHeightB); \
|
||||
srandom(time(NULL)); \
|
||||
for (int i = 0; i < kStrideA * kHeight; ++i) { \
|
||||
for (int i = 0; i < kStrideA * kHeightA; ++i) { \
|
||||
src_argb[i + OFF] = (random() & 0xff); \
|
||||
} \
|
||||
MaskCpuFlags(0); \
|
||||
@ -814,7 +816,7 @@ TEST_F(libyuvTest, FMT_A##To##FMT_B##N) { \
|
||||
kWidth, NEG kHeight); \
|
||||
} \
|
||||
int max_diff = 0; \
|
||||
for (int i = 0; i < kStrideB * kHeight; ++i) { \
|
||||
for (int i = 0; i < kStrideB * kHeightB; ++i) { \
|
||||
int abs_diff = \
|
||||
abs(static_cast<int>(dst_argb_c[i]) - \
|
||||
static_cast<int>(dst_argb_opt[i])); \
|
||||
@ -873,17 +875,17 @@ TEST_F(libyuvTest, FMT_A##To##FMT_B##_Random) { \
|
||||
|
||||
#define TESTATOB(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, DIFF) \
|
||||
TESTATOBI(FMT_A, BPP_A, STRIDE_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, \
|
||||
TESTATOBI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, \
|
||||
benchmark_width_ - 4, DIFF, _Any, +, 0) \
|
||||
TESTATOBI(FMT_A, BPP_A, STRIDE_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, \
|
||||
TESTATOBI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, \
|
||||
benchmark_width_, DIFF, _Unaligned, +, 1) \
|
||||
TESTATOBI(FMT_A, BPP_A, STRIDE_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, \
|
||||
TESTATOBI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, \
|
||||
benchmark_width_, DIFF, _Invert, -, 0) \
|
||||
TESTATOBI(FMT_A, BPP_A, STRIDE_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, \
|
||||
TESTATOBI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, \
|
||||
benchmark_width_, DIFF, _Opt, +, 0) \
|
||||
TESTATOBRANDOM(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
|
||||
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, DIFF)
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
#define BENCHMARK_ITERATIONS 1
|
||||
|
||||
libyuvTest::libyuvTest() : rotate_max_w_(128), rotate_max_h_(128),
|
||||
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(33),
|
||||
benchmark_height_(19) {
|
||||
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(22),
|
||||
benchmark_height_(14) {
|
||||
const char* repeat = getenv("LIBYUV_REPEAT");
|
||||
if (repeat) {
|
||||
benchmark_iterations_ = atoi(repeat); // NOLINT
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user