andrewm@379
|
1 /*
|
andrewm@379
|
2 * Copyright 2013-15 ARM Limited and Contributors.
|
andrewm@379
|
3 * All rights reserved.
|
andrewm@379
|
4 *
|
andrewm@379
|
5 * Redistribution and use in source and binary forms, with or without
|
andrewm@379
|
6 * modification, are permitted provided that the following conditions are met:
|
andrewm@379
|
7 * * Redistributions of source code must retain the above copyright
|
andrewm@379
|
8 * notice, this list of conditions and the following disclaimer.
|
andrewm@379
|
9 * * Redistributions in binary form must reproduce the above copyright
|
andrewm@379
|
10 * notice, this list of conditions and the following disclaimer in the
|
andrewm@379
|
11 * documentation and/or other materials provided with the distribution.
|
andrewm@379
|
12 * * Neither the name of ARM Limited nor the
|
andrewm@379
|
13 * names of its contributors may be used to endorse or promote products
|
andrewm@379
|
14 * derived from this software without specific prior written permission.
|
andrewm@379
|
15 *
|
andrewm@379
|
16 * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND
|
andrewm@379
|
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
andrewm@379
|
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
andrewm@379
|
19 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY
|
andrewm@379
|
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
andrewm@379
|
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
andrewm@379
|
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
andrewm@379
|
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
andrewm@379
|
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
andrewm@379
|
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
andrewm@379
|
26 */
|
andrewm@379
|
27
|
andrewm@379
|
28 /*
|
andrewm@379
|
29 * NE10 Library : inc/NE10_imgproc.h
|
andrewm@379
|
30 */
|
andrewm@379
|
31
|
andrewm@379
|
32
|
andrewm@379
|
33 #include "NE10_types.h"
|
andrewm@379
|
34
|
andrewm@379
|
35 #ifndef NE10_IMGPROC_H
|
andrewm@379
|
36 #define NE10_IMGPROC_H
|
andrewm@379
|
37
|
andrewm@379
|
38 #ifdef __cplusplus
|
andrewm@379
|
39 extern "C" {
|
andrewm@379
|
40 #endif
|
andrewm@379
|
41
|
andrewm@379
|
42 ne10_result_t ne10_init_imgproc (ne10_int32_t is_NEON_available);
|
andrewm@379
|
43
|
andrewm@379
|
44 ///////////////////////////
|
andrewm@379
|
45 // function prototypes:
|
andrewm@379
|
46 ///////////////////////////
|
andrewm@379
|
47
|
andrewm@379
|
48 /* image resize functions*/
|
andrewm@379
|
49 /* function pointers*/
|
andrewm@379
|
50 extern void (*ne10_img_resize_bilinear_rgba) (ne10_uint8_t* dst,
|
andrewm@379
|
51 ne10_uint32_t dst_width,
|
andrewm@379
|
52 ne10_uint32_t dst_height,
|
andrewm@379
|
53 ne10_uint8_t* src,
|
andrewm@379
|
54 ne10_uint32_t src_width,
|
andrewm@379
|
55 ne10_uint32_t src_height,
|
andrewm@379
|
56 ne10_uint32_t src_stride);
|
andrewm@379
|
57 /* C version*/
|
andrewm@379
|
58 extern void ne10_img_resize_bilinear_rgba_c (ne10_uint8_t* dst,
|
andrewm@379
|
59 ne10_uint32_t dst_width,
|
andrewm@379
|
60 ne10_uint32_t dst_height,
|
andrewm@379
|
61 ne10_uint8_t* src,
|
andrewm@379
|
62 ne10_uint32_t src_width,
|
andrewm@379
|
63 ne10_uint32_t src_height,
|
andrewm@379
|
64 ne10_uint32_t src_stride);
|
andrewm@379
|
65 /* NEON version*/
|
andrewm@379
|
66 extern void ne10_img_resize_bilinear_rgba_neon (ne10_uint8_t* dst,
|
andrewm@379
|
67 ne10_uint32_t dst_width,
|
andrewm@379
|
68 ne10_uint32_t dst_height,
|
andrewm@379
|
69 ne10_uint8_t* src,
|
andrewm@379
|
70 ne10_uint32_t src_width,
|
andrewm@379
|
71 ne10_uint32_t src_height,
|
andrewm@379
|
72 ne10_uint32_t src_stride)
|
andrewm@379
|
73 asm ("ne10_img_resize_bilinear_rgba_neon");
|
andrewm@379
|
74
|
andrewm@379
|
75 /* image rotate functions*/
|
andrewm@379
|
76 /* function pointers*/
|
andrewm@379
|
77 extern void (*ne10_img_rotate_rgba) (ne10_uint8_t* dst,
|
andrewm@379
|
78 ne10_uint32_t* dst_width,
|
andrewm@379
|
79 ne10_uint32_t* dst_height,
|
andrewm@379
|
80 ne10_uint8_t* src,
|
andrewm@379
|
81 ne10_uint32_t src_width,
|
andrewm@379
|
82 ne10_uint32_t src_height,
|
andrewm@379
|
83 ne10_int32_t angle);
|
andrewm@379
|
84 /* C version*/
|
andrewm@379
|
85 extern void ne10_img_rotate_rgba_c (ne10_uint8_t* dst,
|
andrewm@379
|
86 ne10_uint32_t* dst_width,
|
andrewm@379
|
87 ne10_uint32_t* dst_height,
|
andrewm@379
|
88 ne10_uint8_t* src,
|
andrewm@379
|
89 ne10_uint32_t src_width,
|
andrewm@379
|
90 ne10_uint32_t src_height,
|
andrewm@379
|
91 ne10_int32_t angle);
|
andrewm@379
|
92 #ifdef ENABLE_NE10_IMG_ROTATE_RGBA_NEON
|
andrewm@379
|
93 /* NEON version*/
|
andrewm@379
|
94 extern void ne10_img_rotate_rgba_neon (ne10_uint8_t* dst,
|
andrewm@379
|
95 ne10_uint32_t* dst_width,
|
andrewm@379
|
96 ne10_uint32_t* dst_height,
|
andrewm@379
|
97 ne10_uint8_t* src,
|
andrewm@379
|
98 ne10_uint32_t src_width,
|
andrewm@379
|
99 ne10_uint32_t src_height,
|
andrewm@379
|
100 ne10_int32_t angle)
|
andrewm@379
|
101 asm ("ne10_img_rotate_rgba_neon");
|
andrewm@379
|
102 #endif // ENABLE_NE10_IMG_ROTATE_RGBA_NEON
|
andrewm@379
|
103
|
andrewm@379
|
104 /* image boxfilter functions */
|
andrewm@379
|
105 /* function pointers */
|
andrewm@379
|
106 extern void (*ne10_img_boxfilter_rgba8888) (const ne10_uint8_t *src,
|
andrewm@379
|
107 ne10_uint8_t *dst,
|
andrewm@379
|
108 ne10_size_t src_size,
|
andrewm@379
|
109 ne10_int32_t src_stride,
|
andrewm@379
|
110 ne10_int32_t dst_stride,
|
andrewm@379
|
111 ne10_size_t kernel_size);
|
andrewm@379
|
112 /* C version*/
|
andrewm@379
|
113 extern void ne10_img_boxfilter_rgba8888_c (const ne10_uint8_t *src,
|
andrewm@379
|
114 ne10_uint8_t *dst,
|
andrewm@379
|
115 ne10_size_t src_size,
|
andrewm@379
|
116 ne10_int32_t src_stride,
|
andrewm@379
|
117 ne10_int32_t dst_stride,
|
andrewm@379
|
118 ne10_size_t kernel_size);
|
andrewm@379
|
119 /* NEON version*/
|
andrewm@379
|
120 extern void ne10_img_boxfilter_rgba8888_neon (const ne10_uint8_t *src,
|
andrewm@379
|
121 ne10_uint8_t *dst,
|
andrewm@379
|
122 ne10_size_t src_size,
|
andrewm@379
|
123 ne10_int32_t src_stride,
|
andrewm@379
|
124 ne10_int32_t dst_stride,
|
andrewm@379
|
125 ne10_size_t kernel_size);
|
andrewm@379
|
126
|
andrewm@379
|
127 #ifdef __cplusplus
|
andrewm@379
|
128 }
|
andrewm@379
|
129 #endif
|
andrewm@379
|
130
|
andrewm@379
|
131 #endif
|