mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
Allow assemblers with a slightly different syntax to use the optimized neon routines. Removed extra constraints on the calling of the optimized routines. All neon routines can load unaligned and handle odd widths. Align allocated buffers in rotate_test.cc Add neon rotate file to gyp file for arm targets. Review URL: http://webrtc-codereview.appspot.com/253007 git-svn-id: http://libyuv.googlecode.com/svn/trunk@59 16f28f9a-4ce2-e073-06de-1de4eb20be90
65 lines
1.4 KiB
C++
65 lines
1.4 KiB
C++
/*
|
|
* Copyright (c) 2011 The LibYuv project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef UINIT_TEST_H_
|
|
#define UINIT_TEST_H_
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#define align_buffer_16(var, size) \
|
|
uint8 *var; \
|
|
uint8 *var##_mem; \
|
|
var##_mem = reinterpret_cast<uint8*>(calloc(size+15, sizeof(uint8))); \
|
|
var = reinterpret_cast<uint8*> \
|
|
((reinterpret_cast<intptr_t>(var##_mem) + 15) & (~0x0f));
|
|
|
|
#define free_aligned_buffer_16(var) \
|
|
free(var##_mem); \
|
|
var = 0;
|
|
|
|
#ifdef WIN32
|
|
|
|
#include <windows.h>
|
|
static double get_time()
|
|
{
|
|
LARGE_INTEGER t, f;
|
|
QueryPerformanceCounter(&t);
|
|
QueryPerformanceFrequency(&f);
|
|
return double(t.QuadPart)/double(f.QuadPart);
|
|
}
|
|
|
|
#else
|
|
|
|
#include <sys/time.h>
|
|
#include <sys/resource.h>
|
|
|
|
static double get_time()
|
|
{
|
|
struct timeval t;
|
|
struct timezone tzp;
|
|
gettimeofday(&t, &tzp);
|
|
return t.tv_sec + t.tv_usec*1e-6;
|
|
}
|
|
|
|
#endif
|
|
|
|
class libyuvTest : public ::testing::Test {
|
|
protected:
|
|
libyuvTest();
|
|
virtual void SetUp();
|
|
virtual void TearDown();
|
|
|
|
const int _rotate_max_w;
|
|
const int _rotate_max_h;
|
|
|
|
};
|
|
|
|
#endif // UNIT_TEST_H_
|