Commit 4127a263 authored by fbarchard@google.com's avatar fbarchard@google.com

ARGBInterpolate odd width support and inverted odd width test. ARGBToNV12/21…

ARGBInterpolate odd width support and inverted odd width test.  ARGBToNV12/21 odd height fix.  Compare test tolerate small height with warning.
BUG=202
TEST=libyuvTest.ARGBInterpolate85_Any_Invert
Review URL: https://webrtc-codereview.appspot.com/1325004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@663 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent cd6056c0
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 662
Version: 663
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 662
#define LIBYUV_VERSION 663
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -348,7 +348,6 @@ int ARGBToNV12(const uint8* src_argb, int src_stride_argb,
ARGBToUVRow(src_argb, 0, row_u, row_v, width);
MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
ARGBToYRow(src_argb, dst_y, width);
ARGBToYRow(src_argb + 0, dst_y + dst_stride_y, width);
}
return 0;
}
......@@ -451,7 +450,6 @@ int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
ARGBToUVRow(src_argb, 0, row_u, row_v, width);
MergeUVRow_(row_v, row_u, dst_uv, halfwidth);
ARGBToYRow(src_argb, dst_y, width);
ARGBToYRow(src_argb + 0, dst_y + dst_stride_y, width);
}
return 0;
}
......
......@@ -274,12 +274,18 @@ TEST_F(libyuvTest, Ssim) {
memset(src_a, 0, kSrcPlaneSize);
memset(src_b, 0, kSrcPlaneSize);
if (kSrcWidth <=8 || kSrcHeight <= 8) {
printf("warning - Ssim size too small. Testing function executes.\n");
}
double err;
err = CalcFrameSsim(src_a + kSrcStride * b + b, kSrcStride,
src_b + kSrcStride * b + b, kSrcStride,
kSrcWidth, kSrcHeight);
EXPECT_EQ(err, 1.0);
if (kSrcWidth > 8 && kSrcHeight > 8) {
EXPECT_EQ(err, 1.0);
}
memset(src_a, 255, kSrcPlaneSize);
......@@ -287,7 +293,9 @@ TEST_F(libyuvTest, Ssim) {
src_b + kSrcStride * b + b, kSrcStride,
kSrcWidth, kSrcHeight);
EXPECT_LT(err, 0.0001);
if (kSrcWidth > 8 && kSrcHeight > 8) {
EXPECT_LT(err, 0.0001);
}
memset(src_a, 1, kSrcPlaneSize);
......@@ -295,8 +303,10 @@ TEST_F(libyuvTest, Ssim) {
src_b + kSrcStride * b + b, kSrcStride,
kSrcWidth, kSrcHeight);
EXPECT_GT(err, 0.0001);
EXPECT_LT(err, 0.9);
if (kSrcWidth > 8 && kSrcHeight > 8) {
EXPECT_GT(err, 0.0001);
EXPECT_LT(err, 0.9);
}
for (int i = 0; i < kSrcPlaneSize; ++i) {
src_a[i] = i;
......@@ -306,8 +316,10 @@ TEST_F(libyuvTest, Ssim) {
src_b + kSrcStride * b + b, kSrcStride,
kSrcWidth, kSrcHeight);
EXPECT_GT(err, 0.0);
EXPECT_LT(err, 0.01);
if (kSrcWidth > 8 && kSrcHeight > 8) {
EXPECT_GT(err, 0.0);
EXPECT_LT(err, 0.01);
}
srandom(time(NULL));
for (int i = b; i < (kSrcHeight + b); ++i) {
......@@ -330,7 +342,9 @@ TEST_F(libyuvTest, Ssim) {
src_b + kSrcStride * b + b, kSrcStride,
kSrcWidth, kSrcHeight);
EXPECT_EQ(opt_err, c_err);
if (kSrcWidth > 8 && kSrcHeight > 8) {
EXPECT_EQ(opt_err, c_err);
}
free_aligned_buffer_64(src_a)
free_aligned_buffer_64(src_b)
......
This diff is collapsed.
......@@ -783,7 +783,7 @@ TEST_F(libyuvTest, TestInterpolate) {
FMT_B, BPP_B, STRIDE_B, \
W1280, TERP, DIFF, N, NEG, OFF) \
TEST_F(libyuvTest, ARGBInterpolate##TERP##N) { \
const int kWidth = W1280; \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
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; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment