- Timestamp:
- May 6, 2016, 3:06:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/include/nrarith1.h
r772 r821 11 11 #define _NRARITH1_H_ 12 12 13 #ifdef __cplusplus 14 #ifdef PRAGMA_VERBOSE 15 #pragma message ("C++") 16 #endif 17 extern "C" { 18 #endif 19 20 #ifdef PRAGMA_VERBOSE 21 //#pragma message("- include nrarith1.h") 22 #endif 23 24 /* ======================================================================== */ 25 /* === Beta reduction ===================================================== */ 26 /* ======================================================================== */ 27 28 IMAGE_EXPORT(int32) sum_bvector (byte *v, long nl, long nh); 29 IMAGE_EXPORT(int32) sum_si16vector (sint16 *v, long nl, long nh); 30 IMAGE_EXPORT(int32) sum_si32vector (sint32 *v, long nl, long nh); 31 IMAGE_EXPORT(float) sum_f32vector (float32 *v, long nl, long nh); 32 33 // ================== 34 // === min_vector === 35 // ================== 36 37 IMAGE_EXPORT(sint8) min_si8vector (sint8 *v, long nl, long nh); 38 IMAGE_EXPORT(uint8) min_ui8vector (uint8 *v, long nl, long nh); 39 IMAGE_EXPORT(sint16) min_si16vector (sint16 *v, long nl, long nh); 40 IMAGE_EXPORT(uint16) min_ui16vector (uint16 *v, long nl, long nh); 41 IMAGE_EXPORT(sint32) min_si32vector (sint32 *v, long nl, long nh); 42 IMAGE_EXPORT(uint32) min_ui32vector (uint32 *v, long nl, long nh); 43 IMAGE_EXPORT(float32) min_f32vector (float32 *v, long nl, long nh); 44 IMAGE_EXPORT(float64) min_f64vector (float64 *v, long nl, long nh); 45 46 // ================== 47 // === max_vector === 48 // ================== 49 50 IMAGE_EXPORT(sint8) max_si8vector (sint8 *v, long nl, long nh); 51 IMAGE_EXPORT(uint8) max_ui8vector (uint8 *v, long nl, long nh); 52 IMAGE_EXPORT(sint16) max_si16vector (sint16 *v, long nl, long nh); 53 IMAGE_EXPORT(uint16) max_ui16vector (uint16 *v, long nl, long nh); 54 IMAGE_EXPORT(sint32) max_si32vector (sint32 *v, long nl, long nh); 55 IMAGE_EXPORT(uint32) max_ui32vector (uint32 *v, long nl, long nh); 56 57 IMAGE_EXPORT(float32) max_f32vector (float32 *v, long nl, long nh); 58 IMAGE_EXPORT(float64) max_f64vector (float64 *v, long nl, long nh); 59 60 // ====================== 61 // === min_vector_pos === 62 // ====================== 63 64 IMAGE_EXPORT(sint8) min_si8vector_pos (sint8 *v, long nl, long nh, int *pos); 65 IMAGE_EXPORT(uint8) min_ui8vector_pos (uint8 *v, long nl, long nh, int *pos); 66 IMAGE_EXPORT(sint16) min_si16vector_pos (sint16 *v, long nl, long nh, int *pos); 67 IMAGE_EXPORT(uint16) min_ui16vector_pos (uint16 *v, long nl, long nh, int *pos); 68 IMAGE_EXPORT(sint32) min_si32vector_pos (sint32 *v, long nl, long nh, int *pos); 69 IMAGE_EXPORT(uint32) min_ui32vector_pos (uint32 *v, long nl, long nh, int *pos); 70 71 IMAGE_EXPORT(float32)min_f32vector_pos (float32 *v, long nl, long nh, int *pos); 72 IMAGE_EXPORT(float64)min_f64vector_pos (float64 *v, long nl, long nh, int *pos); 73 74 // ====================== 75 // === max_vector_pos === 76 // ====================== 77 78 IMAGE_EXPORT(sint8) max_si8vector_pos (sint8 *v, long nl, long nh, int *pos); 79 IMAGE_EXPORT(uint8) max_ui8vector_pos (uint8 *v, long nl, long nh, int *pos); 80 IMAGE_EXPORT(sint16) max_si16vector_pos (sint16 *v, long nl, long nh, int *pos); 81 IMAGE_EXPORT(uint16) max_ui16vector_pos (uint16 *v, long nl, long nh, int *pos); 82 IMAGE_EXPORT(sint32) max_si32vector_pos (sint32 *v, long nl, long nh, int *pos); 83 IMAGE_EXPORT(uint32) max_ui32vector_pos (uint32 *v, long nl, long nh, int *pos); 84 85 IMAGE_EXPORT(float32)max_f32vector_pos (float32 *v, long nl, long nh, int *pos); 86 IMAGE_EXPORT(float64)max_f64vector_pos (float64 *v, long nl, long nh, int *pos); 13 /* 14 * ------------------ 15 * --- sum_vector --- 16 * ------------------ 17 */ 18 19 #define sum_type_vector(t,r) \ 20 r short_name(t,sum_,vector)(t * v, int32_t nl, int32_t nh) 21 22 sum_type_vector(int8_t, int32_t); 23 sum_type_vector(uint8_t, uint32_t); 24 sum_type_vector(int16_t, int32_t); 25 sum_type_vector(uint16_t, uint32_t); 26 sum_type_vector(int32_t, int32_t); 27 sum_type_vector(uint32_t, uint32_t); 28 sum_type_vector(float, float); 29 sum_type_vector(double, double); 30 31 /* 32 * ------------------ 33 * --- min_vector --- 34 * ------------------ 35 */ 36 37 #define min_type_vector(t) \ 38 t short_name(t,min_,vector)(t * v, int32_t nl, int32_t nh) 39 40 min_type_vector(int8_t); 41 min_type_vector(uint8_t); 42 min_type_vector(int16_t); 43 min_type_vector(uint16_t); 44 min_type_vector(int32_t); 45 min_type_vector(uint32_t); 46 min_type_vector(float); 47 min_type_vector(double); 48 49 50 /* 51 * ------------------ 52 * --- max_vector --- 53 * ------------------ 54 */ 55 56 #define max_type_vector(t) \ 57 t short_name(t,max_,vector)(t * v, int32_t nl, int32_t nh) 58 59 max_type_vector(int8_t); 60 max_type_vector(uint8_t); 61 max_type_vector(int16_t); 62 max_type_vector(uint16_t); 63 max_type_vector(int32_t); 64 max_type_vector(uint32_t); 65 max_type_vector(float); 66 max_type_vector(double); 67 68 69 /* 70 * ---------------------- 71 * --- min_vector_pos --- 72 * ---------------------- 73 */ 74 75 76 #define min_type_vector_pos(t) \ 77 t short_name(t,min_,vector_pos)(t * v, int32_t nl, int32_t nh, int32_t * pos) 78 79 min_type_vector_pos(int8_t); 80 min_type_vector_pos(uint8_t); 81 min_type_vector_pos(int16_t); 82 min_type_vector_pos(uint16_t); 83 min_type_vector_pos(int32_t); 84 min_type_vector_pos(uint32_t); 85 min_type_vector_pos(float); 86 min_type_vector_pos(double); 87 88 89 /* 90 * ---------------------- 91 * --- max_vector_pos --- 92 * ---------------------- 93 */ 94 95 #define max_type_vector_pos(t) \ 96 t short_name(t,max_,vector_pos)(t * v, int32_t nl, int32_t nh, int32_t * pos) 97 98 max_type_vector_pos(int8_t); 99 max_type_vector_pos(uint8_t); 100 max_type_vector_pos(int16_t); 101 max_type_vector_pos(uint16_t); 102 max_type_vector_pos(int32_t); 103 max_type_vector_pos(uint32_t); 104 max_type_vector_pos(float); 105 max_type_vector_pos(double); 106 87 107 88 108 // ============= … … 90 110 // ============= 91 111 92 IMAGE_EXPORT(void) beta_sum_rgb32vector (rgb32 *S,long nl,long nh, rgb32 *D); 93 IMAGE_EXPORT(void) beta_average_rgb32vector(rgb32 *S,long nl,long nh, rgb32 *D); 94 95 IMAGE_EXPORT(void) add_i32vector(int32 *S1, long nl,long nh, int32 *S2, int32 *D); 96 IMAGE_EXPORT(void) sub_i32vector(int32 *S1, long nl,long nh, int32 *S2, int32 *D); 97 98 IMAGE_EXPORT(void) cumulleft_i32vector (int32 *S, long nl, long nh, int32 *D); 99 IMAGE_EXPORT(void) cumulleft_rgb32vector(rgb32 *S, long nl, long nh, rgb32 *D); 100 101 IMAGE_EXPORT(void) cumulright_i32vector (int32 *S, long nl, long nh, int32 *D); 102 IMAGE_EXPORT(void) cumulright_rgb32vector(rgb32 *S, long nl, long nh, rgb32 *D); 103 104 IMAGE_EXPORT(void) mulc_i32vector (int32 *S, long nl, long nh, int32 c, int32 *D); 105 IMAGE_EXPORT(void) mulc_rgb32vector (rgb32 *S, long nl, long nh, int32 c, rgb32 *D); 106 IMAGE_EXPORT(void) divc_i32vector (int32 *S, long nl, long nh, int32 c, int32 *D); 107 IMAGE_EXPORT(void) divc_rgb32vector (rgb32 *S, long nl, long nh, int32 c, rgb32 *D); 108 109 IMAGE_EXPORT(void) mulfrac_i32vector (int32 *S, long nl, long nh, int32 a, int32 b, int32 *D); 110 IMAGE_EXPORT(void) mulfrac_rgb32vector(rgb32 *S, long nl, long nh, int32 a, int32 b, rgb32 *D); 111 112 #ifdef __cplusplus 113 } 114 #endif 112 #define add_type_vector(t) \ 113 void short_name(t,add_,vector)(t * S1, int32_t nl, int32_t nh, t * S2, t * D) 114 115 add_type_vector(int8_t); 116 add_type_vector(uint8_t); 117 add_type_vector(int16_t); 118 add_type_vector(uint16_t); 119 add_type_vector(int32_t); 120 add_type_vector(uint32_t); 121 add_type_vector(float); 122 add_type_vector(double); 123 124 #define sub_type_vector(t) \ 125 void short_name(t,sub_,vector)(t * S1, int32_t nl, int32_t nh, t * S2, t * D) 126 127 sub_type_vector(int8_t); 128 sub_type_vector(uint8_t); 129 sub_type_vector(int16_t); 130 sub_type_vector(uint16_t); 131 sub_type_vector(int32_t); 132 sub_type_vector(uint32_t); 133 sub_type_vector(float); 134 sub_type_vector(double); 135 136 #define mulc_type_vector(t) \ 137 void short_name(t,mulc_,vector)(t * S, int32_t nl, int32_t nh, int32_t c, t * D) 138 139 mulc_type_vector(int8_t); 140 mulc_type_vector(uint8_t); 141 mulc_type_vector(int16_t); 142 mulc_type_vector(uint16_t); 143 mulc_type_vector(int32_t); 144 mulc_type_vector(uint32_t); 145 mulc_type_vector(float); 146 mulc_type_vector(double); 147 148 #define divc_type_vector(t) \ 149 void short_name(t,divc_,vector)(t * S, int32_t nl, int32_t nh, int32_t c, t * D) 150 151 divc_type_vector(int8_t); 152 divc_type_vector(uint8_t); 153 divc_type_vector(int16_t); 154 divc_type_vector(uint16_t); 155 divc_type_vector(int32_t); 156 divc_type_vector(uint32_t); 157 divc_type_vector(float); 158 divc_type_vector(double); 159 160 161 #define cumulleft_type_vector(t) \ 162 void short_name(t,cumulleft_,vector)(t * S, int32_t nl, int32_t nh, int32_t * D) 163 164 cumulleft_type_vector(int8_t); 165 cumulleft_type_vector(uint8_t); 166 cumulleft_type_vector(int16_t); 167 cumulleft_type_vector(uint16_t); 168 cumulleft_type_vector(int32_t); 169 cumulleft_type_vector(uint32_t); 170 cumulleft_type_vector(float); 171 cumulleft_type_vector(double); 172 173 #define cumulright_type_vector(t) \ 174 void short_name(t,cumulright_,vector)(t * S, int32_t nl, int32_t nh, int32_t * D) 175 176 cumulright_type_vector(int8_t); 177 cumulright_type_vector(uint8_t); 178 cumulright_type_vector(int16_t); 179 cumulright_type_vector(uint16_t); 180 cumulright_type_vector(int32_t); 181 cumulright_type_vector(uint32_t); 182 cumulright_type_vector(float); 183 cumulright_type_vector(double); 184 185 186 #define mulfrac_type_vector(t) \ 187 void short_name(t,mulfrac_,vector)(t * S, int32_t nl, int32_t nh, int32_t a, int32_t b, t * D) 188 189 mulfrac_type_vector(int8_t); 190 mulfrac_type_vector(uint8_t); 191 mulfrac_type_vector(int16_t); 192 mulfrac_type_vector(uint16_t); 193 mulfrac_type_vector(int32_t); 194 mulfrac_type_vector(uint32_t); 195 mulfrac_type_vector(float); 196 mulfrac_type_vector(double); 197 198 199 200 void beta_sum_rgb32vector (rgb32 * S, int32_t nl, int32_t nh, rgb32 * D); 201 void beta_average_rgb32vector(rgb32 * S, int32_t nl, int32_t nh, rgb32 * D); 202 void cumulleft_rgb32vector (rgb32 * S, int32_t nl, int32_t nh, rgb32 * D); 203 void cumulright_rgb32vector (rgb32 * S, int32_t nl, int32_t nh, rgb32 * D); 204 void mulc_rgb32vector (rgb32 * S, int32_t nl, int32_t nh, int32 c, rgb32 * D); 205 void divc_rgb32vector (rgb32 * S, int32_t nl, int32_t nh, int32 c, rgb32 * D); 206 void mulfrac_rgb32vector (rgb32 * S, int32_t nl, int32_t nh, int32 a, int32 b, rgb32 * D); 207 115 208 116 209 #endif /* _NRARITH1_H_ */ 210 211 // Local Variables: 212 // tab-width: 4 213 // c-basic-offset: 4 214 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 215 // indent-tabs-mode: nil 216 // End: 217 218 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 219
Note: See TracChangeset
for help on using the changeset viewer.