]> granicus.if.org Git - libvpx/commitdiff
tests: remove redundant round() definition
authorJames Zern <jzern@google.com>
Tue, 28 Jun 2016 03:43:04 +0000 (20:43 -0700)
committerJames Zern <jzern@google.com>
Thu, 30 Jun 2016 00:11:11 +0000 (17:11 -0700)
use vpx_ports/msvc.h for compatibility

BUG=b/29583530

Change-Id: I9433d8586cd0b790e7f4d697304298feafe801f1
(cherry picked from commit 0a64929f19cc1ce89f993aa5c9d61a29679eb961)

test/dct16x16_test.cc
test/dct32x32_test.cc
test/idct8x8_test.cc

index c4dfaf34591c4991e4dbf3955969943c0b3ff566..3c16e6ed47bab0a9c95f0ad59a52829f675b6fea 100644 (file)
 #include "vpx/vpx_codec.h"
 #include "vpx/vpx_integer.h"
 #include "vpx_ports/mem.h"
+#include "vpx_ports/msvc.h"  // for round()
 
 using libvpx_test::ACMRandom;
 
 namespace {
 
-#ifdef _MSC_VER
-static int round(double x) {
-  if (x < 0)
-    return static_cast<int>(ceil(x - 0.5));
-  else
-    return static_cast<int>(floor(x + 0.5));
-}
-#endif
-
 const int kNumCoeffs = 256;
 const double C1 = 0.995184726672197;
 const double C2 = 0.98078528040323;
index 1cbac5c636ce28158e63c918d3f6bea3e279e80d..3cb0a8e0095e18013db479736d2a9048151dcb5d 100644 (file)
 #include "vpx/vpx_codec.h"
 #include "vpx/vpx_integer.h"
 #include "vpx_ports/mem.h"
+#include "vpx_ports/msvc.h"  // for round()
 
 using libvpx_test::ACMRandom;
 
 namespace {
-#ifdef _MSC_VER
-static int round(double x) {
-  if (x < 0)
-    return static_cast<int>(ceil(x - 0.5));
-  else
-    return static_cast<int>(floor(x + 0.5));
-}
-#endif
 
 const int kNumCoeffs = 1024;
 const double kPi = 3.141592653589793238462643383279502884;
index 7f9d751d650a3ac471553285e96e359f1432e40b..04487c45252d127c8a3a4b479b7f7cdb0e011e86 100644 (file)
 #include "./vpx_dsp_rtcd.h"
 #include "test/acm_random.h"
 #include "vpx/vpx_integer.h"
+#include "vpx_ports/msvc.h"  // for round()
 
 using libvpx_test::ACMRandom;
 
 namespace {
 
-#ifdef _MSC_VER
-static int round(double x) {
-  if (x < 0)
-    return static_cast<int>(ceil(x - 0.5));
-  else
-    return static_cast<int>(floor(x + 0.5));
-}
-#endif
-
 void reference_dct_1d(double input[8], double output[8]) {
   const double kPi = 3.141592653589793238462643383279502884;
   const double kInvSqrt2 = 0.707106781186547524400844362104;
@@ -86,7 +78,7 @@ TEST(VP9Idct8x8Test, AccuracyCheck) {
 
     reference_dct_2d(input, output_r);
     for (int j = 0; j < 64; ++j)
-      coeff[j] = round(output_r[j]);
+      coeff[j] = static_cast<tran_low_t>(round(output_r[j]));
     vpx_idct8x8_64_add_c(coeff, dst, 8);
     for (int j = 0; j < 64; ++j) {
       const int diff = dst[j] - src[j];