Commit c6139478 authored by fbarchard@google.com's avatar fbarchard@google.com

Test for YToARGB to ensure ordering of values.

BUG=393
TESTED=TestYToARGB
R=harryjin@google.com

Review URL: https://webrtc-codereview.appspot.com/37819004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1256 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent dc2c9010
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1256
Version: 1257
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1256
#define LIBYUV_VERSION 1257
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -1243,4 +1243,24 @@ TEST_F(libyuvTest, HaveJPEG) {
#endif
}
TEST_F(libyuvTest, TestYToARGB) {
uint8 y[32];
uint8 expectedg[32];
for (int i = 0; i < 32; ++i) {
y[i] = i * 5 + 17;
expectedg[i] = round((y[i] - 16) * 1.164);
}
uint8 argb[32 * 4];
YToARGB(y, 0, argb, 0, 32, 1);
for (int i = 0; i < 32; ++i) {
printf("%d: %d <-> %d,%d,%d,%d\n", y[i], expectedg[i],
argb[i * 4 + 0],
argb[i * 4 + 1],
argb[i * 4 + 2],
argb[i * 4 + 3]);
EXPECT_NEAR(expectedg[i], argb[i * 4 + 0], 1);
}
}
} // namespace libyuv
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