From 0494ffee81bffdf4a175fd60ab0a9f71baa537e1 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Mon, 2 Feb 2015 21:06:51 +0000 Subject: [PATCH] use lrintf to round from float to int instead of round and then cast. BUG=393 TESTED=local windows test passed. R=harryjin@google.com Review URL: https://webrtc-codereview.appspot.com/37899004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1257 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- unit_test/color_test.cc | 2 +- unit_test/convert_test.cc | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.chromium b/README.chromium index 066c7c91e..dbf6f522f 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1257 +Version: 1258 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 6c371b523..7a05b94a1 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1257 +#define LIBYUV_VERSION 1258 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/unit_test/color_test.cc b/unit_test/color_test.cc index 887327323..3baf33935 100644 --- a/unit_test/color_test.cc +++ b/unit_test/color_test.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include // For round +#include // For lrintf #include #include "libyuv/convert.h" diff --git a/unit_test/convert_test.cc b/unit_test/convert_test.cc index ea198504c..5ac2a2ecd 100644 --- a/unit_test/convert_test.cc +++ b/unit_test/convert_test.cc @@ -8,6 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include // For lrintf #include #include @@ -1248,7 +1249,7 @@ TEST_F(libyuvTest, TestYToARGB) { uint8 expectedg[32]; for (int i = 0; i < 32; ++i) { y[i] = i * 5 + 17; - expectedg[i] = round((y[i] - 16) * 1.164); + expectedg[i] = lrintf((y[i] - 16) * 1.164); } uint8 argb[32 * 4]; YToARGB(y, 0, argb, 0, 32, 1);