39 #include "unit_test_common.h" 45 #define SRC_HEIGHT 512 47 #define DST_HEIGHT 734 //sqrt(512*512 + 512*512) + 10 48 #define DST_WIDTH 734 //sqrt(512*512 + 512*512) + 10 49 #define TEST_COUNT 5000 64 #ifdef ENABLE_NE10_IMG_ROTATE_RGBA_NEON 65 void test_rotate_conformance_case()
86 for (i = 0; i < in_size; i++)
88 in_c[i] = in_neon[i] = (rand() & 0xff);
91 for (angle = -360; angle <= 360; angle += 30)
93 printf (
"rotate angle %d \n", angle);
95 memset (out_c, 0, out_size);
98 memset (out_neon, 0, out_size);
101 PSNR = CAL_PSNR_UINT8 (out_c, out_neon, dstw_c * dsth_c * 4);
102 assert_false ( (PSNR < PSNR_THRESHOLD));
110 #endif // ENABLE_NE10_IMG_ROTATE_RGBA_NEON 112 void test_rotate_performance_case()
134 for (i = 0; i < in_size; i++)
136 in_c[i] = in_neon[i] = (rand() & 0xff);
140 for (angle = 45; angle <= 45; angle += 5)
142 printf (
"rotate angle %d \n", angle);
144 memset (out_c, 0, out_size);
154 #ifdef ENABLE_NE10_IMG_ROTATE_RGBA_NEON 155 memset (out_neon, 0, out_size);
164 #endif // ENABLE_NE10_IMG_ROTATE_RGBA_NEON 168 ne10_log (__FUNCTION__,
"IMAGEROTATE%20d%20lld%20lld%19.2f%%%18.2f:1\n", angle, time_c, time_neon, 0, 0);
179 #ifdef ENABLE_NE10_IMG_ROTATE_RGBA_NEON 180 #if defined (SMOKE_TEST)||(REGRESSION_TEST) 181 test_rotate_conformance_case();
183 #endif // ENABLE_NE10_IMG_ROTATE_RGBA_NEON 185 #if defined PERFORMANCE_TEST 186 test_rotate_performance_case();
192 ne10_log_buffer_ptr = ne10_log_buffer;
195 void test_fixture_rotate (
void)
197 test_fixture_start();
201 run_test (test_rotate);
void ne10_img_rotate_rgba_neon(ne10_uint8_t *dst, ne10_uint32_t *dst_width, ne10_uint32_t *dst_height, ne10_uint8_t *src, ne10_uint32_t src_width, ne10_uint32_t src_height, ne10_int32_t angle) asm("ne10_img_rotate_rgba_neon")
Specific implementation of ne10_img_rotate_rgba using NEON SIMD capabilities.
void ne10_img_rotate_rgba_c(ne10_uint8_t *dst, ne10_uint32_t *dst_width, ne10_uint32_t *dst_height, ne10_uint8_t *src, ne10_uint32_t src_width, ne10_uint32_t src_height, ne10_int32_t angle)
Specific implementation of ne10_img_rotate_rgba using plain C.