#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;
#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;
#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;
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];