Commit 9c96867a authored by fbarchard@google.com's avatar fbarchard@google.com

lrintf is not supported by visual studio 2010; replace instances of lrintf with a cast to int.

BUG=409
TESTED=python build\gyp_chromium -fninja -G msvs_version=2010 --depth=. libyuv_test.gyp
R=harryjin@google.com

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

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1312 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 697c5aa8
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1311 Version: 1312
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1311 #define LIBYUV_VERSION 1312
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <math.h> // For lrintf
#include <stdlib.h> #include <stdlib.h>
#include "libyuv/convert.h" #include "libyuv/convert.h"
...@@ -185,7 +184,7 @@ static void YToRGB(int y, int* r, int* g, int* b) { ...@@ -185,7 +184,7 @@ static void YToRGB(int y, int* r, int* g, int* b) {
} }
static int RoundToByte(double f) { static int RoundToByte(double f) {
int i = lrintf(f); int i = static_cast<int>(f + 0.5);
if (i < 0) { if (i < 0) {
i = 0; i = 0;
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <math.h> // For lrintf
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
...@@ -1364,7 +1363,7 @@ TEST_F(libyuvTest, TestYToARGB) { ...@@ -1364,7 +1363,7 @@ TEST_F(libyuvTest, TestYToARGB) {
uint8 expectedg[32]; uint8 expectedg[32];
for (int i = 0; i < 32; ++i) { for (int i = 0; i < 32; ++i) {
y[i] = i * 5 + 17; y[i] = i * 5 + 17;
expectedg[i] = lrintf((y[i] - 16) * 1.164); expectedg[i] = static_cast<int>((y[i] - 16) * 1.164f + 0.5f);
} }
uint8 argb[32 * 4]; uint8 argb[32 * 4];
YToARGB(y, 0, argb, 0, 32, 1); YToARGB(y, 0, argb, 0, 32, 1);
......
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