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
This commit is contained in:
fbarchard@google.com 2015-02-02 21:06:51 +00:00
parent c61394789d
commit 0494ffee81
4 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1257
Version: 1258
License: BSD
License File: LICENSE

View File

@ -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

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <math.h> // For round
#include <math.h> // For lrintf
#include <stdlib.h>
#include "libyuv/convert.h"

View File

@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <math.h> // For lrintf
#include <stdlib.h>
#include <time.h>
@ -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);