Changeset 821 for soft/giet_vm/applications/rosenfeld/nrc2/include
- Timestamp:
- May 6, 2016, 3:06:29 PM (9 years ago)
- Location:
- soft/giet_vm/applications/rosenfeld/nrc2/include
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc.h
r772 r821 11 11 #define __NRALLOC_H__ 12 12 13 #ifdef __cplusplus14 #pragma message ("C++")15 extern "C" {16 #endif17 18 #ifdef VERBOSE_PRAGMA19 //#pragma message ("- *** include nralloc.h ***")20 #endif21 13 22 14 #include "nralloc1.h" … … 24 16 #include "nralloc3.h" 25 17 26 #ifdef __cplusplus 27 } 28 #endif 18 #endif /* __NRALLOC_H__ */ 29 19 30 #endif /* __NRALLOC_H__ */ -
soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc1.h
r772 r821 11 11 #define __NRALLOC1_H__ 12 12 13 #ifdef __cplusplus 14 #pragma message ("C++") 15 extern "C" { 16 #endif 17 18 #ifdef VERBOSE_PRAGMA 19 //#pragma message ("- *** include nralloc1.h ***") 20 #endif 13 #include <stdint.h> 21 14 22 23 //NR_END est maintenant defini dans nrutil.h 24 25 #define NR_END 0 26 #define FREE_ARG char* 27 28 //long nr_end = NR_END; 29 30 //void nrerror(char error_text[]); 31 //void nrerror(char *format, ...); 32 //void Error (char *format, ...); 33 //void Warning(char *format, ...); 15 #include "nrc_os_config.h" 16 #include "nrtype.h" 34 17 35 18 /* … … 39 22 */ 40 23 41 // do: allocate a float vector with subscript range v[nl..nh] 24 #define type_vector(t) \ 25 t * short_name(t,,vector)(int32_t nl, int32_t nh) 42 26 43 //IMAGE_EXPORT(byte*) bvector(long nl, long nh); 44 IMAGE_EXPORT(sint8*) si8vector(long nl, long nh); 45 IMAGE_EXPORT(uint8*) ui8vector(long nl, long nh); 46 IMAGE_EXPORT(sint16*) si16vector(long nl, long nh); 47 IMAGE_EXPORT(uint16*) ui16vector(long nl, long nh); 48 IMAGE_EXPORT(sint32*) si32vector(long nl, long nh); 49 IMAGE_EXPORT(uint32*) ui32vector(long nl, long nh); 50 IMAGE_EXPORT(sint64*) si64vector(long nl, long nh); 51 IMAGE_EXPORT(uint64*) ui64vector(long nl, long nh); 27 type_vector(int8_t); 28 type_vector(uint8_t); 29 type_vector(int16_t); 30 type_vector(uint16_t); 31 type_vector(int32_t); 32 type_vector(uint32_t); 33 type_vector(int64_t); 34 type_vector(uint64_t); 35 type_vector(float); 36 type_vector(double); 37 type_vector(rgb8); 38 type_vector(rgbx8); 39 type_vector(rgb32); 40 type_vector(void_p); 52 41 53 IMAGE_EXPORT(float32*) f32vector(long nl, long nh);54 IMAGE_EXPORT(float64*) f64vector(long nl, long nh);55 42 56 IMAGE_EXPORT(rgb8*) rgb8vector(long nl, long nh);57 IMAGE_EXPORT(rgbx8*) rgbx8vector(long nl, long nh);58 IMAGE_EXPORT(rgb32*) rgb32vector(long nl, long nh);59 43 60 IMAGE_EXPORT(void**) vvector(long nl, long nh); 44 #if TARGET_OS == GIETVM 45 #define remote_type_vector(t) \ 46 t * short_name(t,remote_,vector)(int32_t nl, int32_t nh, int32_t x, int32_t y) 47 48 remote_type_vector(int8_t); 49 remote_type_vector(uint8_t); 50 remote_type_vector(int16_t); 51 remote_type_vector(uint16_t); 52 remote_type_vector(int32_t); 53 remote_type_vector(uint32_t); 54 remote_type_vector(int64_t); 55 remote_type_vector(uint64_t); 56 remote_type_vector(float); 57 remote_type_vector(double); 58 remote_type_vector(rgb8); 59 remote_type_vector(rgbx8); 60 remote_type_vector(rgb32); 61 remote_type_vector(void_p); 62 63 //void ** remote_vvector(long nl, long nh, int x, int y); 64 #endif 65 66 #define type_vector0(t) \ 67 t * short_name(t,,vector0)(int32_t nl, int32_t nh) 68 69 type_vector0(int8_t); 70 type_vector0(uint8_t); 71 type_vector0(int16_t); 72 type_vector0(uint16_t); 73 type_vector0(int32_t); 74 type_vector0(uint32_t); 75 type_vector0(int64_t); 76 type_vector0(uint64_t); 77 type_vector0(float); 78 type_vector0(double); 79 type_vector0(rgb8); 80 type_vector0(rgbx8); 81 type_vector0(rgb32); 82 type_vector0(void_p); 83 84 #define realloc_type_vector(t) \ 85 t * short_name(t,realloc_,vector)(t * v, int32_t nl, int32_t nh) 86 87 realloc_type_vector(int8_t); 88 realloc_type_vector(uint8_t); 89 realloc_type_vector(int16_t); 90 realloc_type_vector(uint16_t); 91 realloc_type_vector(int32_t); 92 realloc_type_vector(uint32_t); 93 realloc_type_vector(int64_t); 94 realloc_type_vector(uint64_t); 95 realloc_type_vector(float); 96 realloc_type_vector(double); 97 realloc_type_vector(rgb8); 98 realloc_type_vector(rgbx8); 99 realloc_type_vector(rgb32); 100 realloc_type_vector(void_p); 101 102 103 #define free_type_vector(t) \ 104 void short_name(t,free_,vector)(t * v, long nl, long nh) 105 106 free_type_vector(int8_t); 107 free_type_vector(uint8_t); 108 free_type_vector(int16_t); 109 free_type_vector(uint16_t); 110 free_type_vector(int32_t); 111 free_type_vector(uint32_t); 112 free_type_vector(int64_t); 113 free_type_vector(uint64_t); 114 free_type_vector(float); 115 free_type_vector(double); 116 free_type_vector(rgb8); 117 free_type_vector(rgbx8); 118 free_type_vector(rgb32); 119 free_type_vector(void_p); 120 121 61 122 62 123 /* 63 * --------------- 64 * --- vector0 --- 65 * --------------- 66 */ 67 68 // do: allocate a vector and set it to 0 69 70 //IMAGE_EXPORT(byte*) bvector0(long nl, long nh); 71 IMAGE_EXPORT(sint8*) si8vector0(long nl, long nh); 72 IMAGE_EXPORT(uint8*) ui8vector0(long nl, long nh); 73 IMAGE_EXPORT(sint16*) si16vector0(long nl, long nh); 74 IMAGE_EXPORT(uint16*) ui16vector0(long nl, long nh); 75 IMAGE_EXPORT(sint32*) si32vector0(long nl, long nh); 76 IMAGE_EXPORT(uint32*) ui32vector0(long nl, long nh); 77 78 IMAGE_EXPORT(float32*) f32vector0(long nl, long nh); 79 IMAGE_EXPORT(float64*) f64vector0(long nl, long nh); 80 81 IMAGE_EXPORT(rgb8*) rgb8vector0(long nl, long nh); 82 IMAGE_EXPORT(rgbx8*) rgbx8vector0(long nl, long nh); 83 IMAGE_EXPORT(rgb32*) rgb32vector0(long nl, long nh); 84 85 IMAGE_EXPORT(void**) vvector0(long nl, long nh); 86 /* 87 * ---------------------- 88 * --- realloc_vector --- 89 * ---------------------- 90 */ 91 92 // realloc a vector to [nl..nh] 93 IMAGE_EXPORT(void**) realloc_vvector(void **v, long nl, long nh); 94 95 /* 96 * ------------------- 97 * --- free_vector --- 98 * ------------------- 99 */ 100 101 //IMAGE_EXPORT(void) free_bvector (byte *v, long nl, long nh); 102 IMAGE_EXPORT(void) free_si8vector (sint8 *v, long nl, long nh); 103 IMAGE_EXPORT(void) free_ui8vector (uint8 *v, long nl, long nh); 104 IMAGE_EXPORT(void) free_si16vector (sint16 *v, long nl, long nh); 105 IMAGE_EXPORT(void) free_ui16vector (uint16 *v, long nl, long nh); 106 IMAGE_EXPORT(void) free_si32vector (sint32 *v, long nl, long nh); 107 IMAGE_EXPORT(void) free_ui32vector (uint32 *v, long nl, long nh); 108 IMAGE_EXPORT(void) free_si64vector (sint64 *v, long nl, long nh); 109 IMAGE_EXPORT(void) free_ui64vector (uint64 *v, long nl, long nh); 110 111 IMAGE_EXPORT(void) free_f32vector (float32 *v, long nl, long nh); 112 IMAGE_EXPORT(void) free_f64vector (float64 *v, long nl, long nh); 113 114 IMAGE_EXPORT(void) free_rgb8vector (rgb8 *v, long nl, long nh); 115 IMAGE_EXPORT(void) free_rgbx8vector(rgbx8 *v, long nl, long nh); 116 IMAGE_EXPORT(void) free_rgb32vector(rgb32 *v, long nl, long nh); 117 118 IMAGE_EXPORT(void) free_vvector (void **v, long nl, long nh); 119 120 #ifdef __cplusplus 121 } 122 #endif 124 void ** vvector(long nl, long nh); 125 void ** vvector0(long nl, long nh); 126 void ** realloc_vvector(void ** v, long nl, long nh); 127 void free_vvector(void ** v, long nl, long nh); 128 */ 123 129 124 130 #endif /* __NRALLOC1_H__ */ 131 -
soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc2.h
r772 r821 16 16 #define __NRALLOC2_H__ 17 17 18 #ifdef __cplusplus 19 #pragma message ("C++") 20 extern "C" { 21 #endif 22 23 #ifdef VERBOSE_PRAGMA 24 //#pragma message ("- *** include nralloc2.h ***") 25 #endif 18 #include "nrc_os_config.h" 26 19 27 20 /* … … 31 24 */ 32 25 33 IMAGE_EXPORT(sint8**) si8matrix(long nrl, long nrh, long ncl, long nch);34 IMAGE_EXPORT(uint8**) ui8matrix(long nrl, long nrh, long ncl, long nch);35 IMAGE_EXPORT(sint16**) si16matrix(long nrl, long nrh, long ncl, long nch);36 IMAGE_EXPORT(uint16**) ui16matrix(long nrl, long nrh, long ncl, long nch);37 IMAGE_EXPORT(sint32**) si32matrix(long nrl, long nrh, long ncl, long nch);38 IMAGE_EXPORT(uint32**) ui32matrix(long nrl, long nrh, long ncl, long nch);39 IMAGE_EXPORT(sint64**) si64matrix(long nrl, long nrh, long ncl, long nch);40 IMAGE_EXPORT(uint64**) ui64matrix(long nrl, long nrh, long ncl, long nch);41 26 42 IMAGE_EXPORT(float32**) f32matrix(long nrl, long nrh, long ncl, long nch); 43 IMAGE_EXPORT(float64**) f64matrix(long nrl, long nrh, long ncl, long nch); 27 #undef type_matrix 28 #define type_matrix(t) \ 29 t ** short_name(t,,matrix)(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) 44 30 45 IMAGE_EXPORT(complex32**) c32matrix(long nrl, long nrh, long ncl, long nch);46 IMAGE_EXPORT(complex64**) c64matrix(long nrl, long nrh, long ncl, long nch);47 31 48 IMAGE_EXPORT(rgb8**) rgb8matrix(long nrl, long nrh, long ncl, long nch); 49 IMAGE_EXPORT(rgbx8**) rgbx8matrix(long nrl, long nrh, long ncl, long nch); 50 //IMAGE_EXPORT(rgb32**) rgb32matrix(long nrl, long nrh, long ncl, long nch); 51 //IMAGE_EXPORT(rgbx32**) rgbx32matrix(long nrl, long nrh, long ncl, long nch); 32 type_matrix(int8_t); 33 type_matrix(uint8_t); 34 type_matrix(int16_t); 35 type_matrix(uint16_t); 36 type_matrix(int32_t); 37 type_matrix(uint32_t); 38 type_matrix(int64_t); 39 type_matrix(uint64_t); 40 type_matrix(float); 41 type_matrix(double); 42 type_matrix(void_p); 43 type_matrix(rgb8); 44 type_matrix(rgbx8); 45 type_matrix(rgb32); 46 type_matrix(rgbx32); 47 type_matrix(complex32); 48 type_matrix(complex64); 52 49 53 /*54 * ---------------55 * --- matrix0 ---56 * ---------------57 */58 50 59 IMAGE_EXPORT(sint8**) si8matrix0(long nrl, long nrh, long ncl, long nch); 60 IMAGE_EXPORT(uint8**) ui8matrix0(long nrl, long nrh, long ncl, long nch); 61 IMAGE_EXPORT(sint16**) si16matrix0(long nrl, long nrh, long ncl, long nch); 62 IMAGE_EXPORT(uint16**) ui16matrix0(long nrl, long nrh, long ncl, long nch); 63 IMAGE_EXPORT(sint32**) i32matrix0(long nrl, long nrh, long ncl, long nch); 64 IMAGE_EXPORT(uint32**) ui32matrix0(long nrl, long nrh, long ncl, long nch); 65 IMAGE_EXPORT(sint64**) si64matrix0(long nrl, long nrh, long ncl, long nch); 66 IMAGE_EXPORT(uint64**) ui64matrix0(long nrl, long nrh, long ncl, long nch); 67 IMAGE_EXPORT(rgb8**) rgb8matrix0(long nrl, long nrh, long ncl, long nch); 68 IMAGE_EXPORT(rgbx8**) rgbx8matrix0(long nrl, long nrh, long ncl, long nch); 69 IMAGE_EXPORT(rgb32**) rgb32matrix0(long nrl, long nrh, long ncl, long nch); 70 IMAGE_EXPORT(rgbx32**) rgbx32matrix0(long nrl, long nrh, long ncl, long nch); 51 #undef type_matrix0 52 #define type_matrix0(t) \ 53 t ** short_name(t,,matrix0)(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) 71 54 72 IMAGE_EXPORT(float32**) f32matrix0(long nrl, long nrh, long ncl, long nch);73 IMAGE_EXPORT(float64**) f64matrix0(long nrl, long nrh, long ncl, long nch);74 55 75 /* 76 * ------------------- 77 * --- free_matrix --- 78 * ------------------- 79 */ 56 type_matrix0(int8_t); 57 type_matrix0(uint8_t); 58 type_matrix0(int16_t); 59 type_matrix0(uint16_t); 60 type_matrix0(int32_t); 61 type_matrix0(uint32_t); 62 type_matrix0(int64_t); 63 type_matrix0(uint64_t); 64 type_matrix0(float); 65 type_matrix0(double); 66 type_matrix0(void_p); 67 type_matrix0(rgb8); 68 type_matrix0(rgbx8); 69 type_matrix0(rgb32); 70 type_matrix0(rgbx32); 71 type_matrix0(complex32); 72 type_matrix0(complex64); 80 73 81 IMAGE_EXPORT(void) free_si8matrix (sint8 **m, long nrl, long nrh, long ncl, long nch);82 IMAGE_EXPORT(void) free_ui8matrix (uint8 **m, long nrl, long nrh, long ncl, long nch);83 IMAGE_EXPORT(void) free_si16matrix (sint16 **m, long nrl, long nrh, long ncl, long nch);84 IMAGE_EXPORT(void) free_ui16matrix (uint16 **m, long nrl, long nrh, long ncl, long nch);85 IMAGE_EXPORT(void) free_si32matrix (sint32 **m, long nrl, long nrh, long ncl, long nch);86 IMAGE_EXPORT(void) free_ui32matrix (uint32 **m, long nrl, long nrh, long ncl, long nch);87 IMAGE_EXPORT(void) free_si64matrix (sint64 **m, long nrl, long nrh, long ncl, long nch);88 IMAGE_EXPORT(void) free_ui64matrix (uint64 **m, long nrl, long nrh, long ncl, long nch);89 74 90 IMAGE_EXPORT(void) free_f32matrix (float32 **m, long nrl, long nrh, long ncl, long nch); 91 IMAGE_EXPORT(void) free_f64matrix (float64 **m, long nrl, long nrh, long ncl, long nch); 92 IMAGE_EXPORT(void) free_c32matrix (complex32 **m, long nrl, long nrh, long ncl, long nch); 93 IMAGE_EXPORT(void) free_c64matrix (complex64 **m, long nrl, long nrh, long ncl, long nch); 75 #if TARGET_OS == GIETVM 94 76 95 IMAGE_EXPORT(void) free_rgb8matrix (rgb8 **m, long nrl, long nrh, long ncl, long nch); 96 IMAGE_EXPORT(void) free_rgbx8matrix (rgbx8 **m, long nrl, long nrh, long ncl, long nch); 97 IMAGE_EXPORT(void) free_rgb32matrix (rgb32 **m, long nrl, long nrh, long ncl, long nch); 98 IMAGE_EXPORT(void) free_rgbx32matrix(rgbx32 **m, long nrl, long nrh, long ncl, long nch); 77 #undef remote_type_matrix 78 #define remote_type_matrix(t) \ 79 t ** short_name(t,remote_,matrix)(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) 99 80 100 #ifdef __cplusplus 101 } 81 remote_type_matrix(int8_t); 82 remote_type_matrix(uint8_t); 83 remote_type_matrix(int16_t); 84 remote_type_matrix(uint16_t); 85 remote_type_matrix(int32_t); 86 remote_type_matrix(uint32_t); 87 remote_type_matrix(int64_t); 88 remote_type_matrix(uint64_t); 89 remote_type_matrix(float); 90 remote_type_matrix(double); 91 remote_type_matrix(void_p); 92 remote_type_matrix(rgb8); 93 remote_type_matrix(rgbx8); 94 remote_type_matrix(rgb32); 95 remote_type_matrix(rgbx32); 96 remote_type_matrix(complex32); 97 remote_type_matrix(complex64); 98 102 99 #endif 103 100 101 102 #undef free_type_matrix 103 #define free_type_matrix(t) \ 104 void short_name(t,free_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) 105 106 free_type_matrix(int8_t); 107 free_type_matrix(uint8_t); 108 free_type_matrix(int16_t); 109 free_type_matrix(uint16_t); 110 free_type_matrix(int32_t); 111 free_type_matrix(uint32_t); 112 free_type_matrix(int64_t); 113 free_type_matrix(uint64_t); 114 free_type_matrix(float); 115 free_type_matrix(double); 116 free_type_matrix(void_p); 117 free_type_matrix(rgb8); 118 free_type_matrix(rgbx8); 119 free_type_matrix(rgb32); 120 free_type_matrix(rgbx32); 121 free_type_matrix(complex32); 122 free_type_matrix(complex64); 123 124 104 125 #endif /* __NRALLOC2_H__ */ 126 127 // Local Variables: 128 // tab-width: 4 129 // c-basic-offset: 4 130 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 131 // indent-tabs-mode: nil 132 // End: 133 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 134 -
soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc2x.h
r772 r821 16 16 #define __NRALLOC2X_H__ 17 17 18 #ifdef __cplusplus19 #pragma message ("C++")20 extern "C" {21 #endif22 23 #ifdef VERBOSE_PRAGMA24 //#pragma message ("- *** include nralloc2x.h ***")25 #endif26 18 19 #include "nrc_os_config.h" 27 20 #include "nrtype.h" 28 21 #include "nrtypex.h" 29 22 30 /* ---------------------------------- */31 /* --- composite user type matrix --- */32 /* ---------------------------------- */33 34 IMAGE_EXPORT(si16Point**) si16Pmatrix(long nrl, long nrh, long ncl, long nch);35 IMAGE_EXPORT(ui16Point**) ui16Pmatrix(long nrl, long nrh, long ncl, long nch);36 IMAGE_EXPORT(si32Point**) si32Pmatrix(long nrl, long nrh, long ncl, long nch);37 IMAGE_EXPORT(ui32Point**) ui32Pmatrix(long nrl, long nrh, long ncl, long nch);38 IMAGE_EXPORT(f32Point**) f32Pmatrix(long nrl, long nrh, long ncl, long nch);39 40 IMAGE_EXPORT(si16Triplet**) si16Tmatrix(long nrl, long nrh, long ncl, long nch);41 IMAGE_EXPORT(ui16Triplet**) ui16Tmatrix(long nrl, long nrh, long ncl, long nch);42 IMAGE_EXPORT(si32Triplet**) si32Tmatrix(long nrl, long nrh, long ncl, long nch);43 IMAGE_EXPORT(ui32Triplet**) ui32Tmatrix(long nrl, long nrh, long ncl, long nch);44 IMAGE_EXPORT(f32Triplet**) f32Tmatrix(long nrl, long nrh, long ncl, long nch);45 46 IMAGE_EXPORT(void) free_si16Pmatrix(si16Point **m, long nrl, long nrh, long ncl, long nch);47 IMAGE_EXPORT(void) free_ui16Pmatrix(ui16Point **m, long nrl, long nrh, long ncl, long nch);48 IMAGE_EXPORT(void) free_si32Pmatrix(si32Point **m, long nrl, long nrh, long ncl, long nch);49 IMAGE_EXPORT(void) free_ui32Pmatrix(ui32Point **m, long nrl, long nrh, long ncl, long nch);50 IMAGE_EXPORT(void) free_f32Pmatrix(f32Point **m, long nrl, long nrh, long ncl, long nch);51 52 IMAGE_EXPORT(void) free_si16Tmatrix(si16Triplet **m, long nrl, long nrh, long ncl, long nch);53 IMAGE_EXPORT(void) free_ui16Tmatrix(ui16Triplet **m, long nrl, long nrh, long ncl, long nch);54 IMAGE_EXPORT(void) free_si32Tmatrix(si32Triplet **m, long nrl, long nrh, long ncl, long nch);55 IMAGE_EXPORT(void) free_ui32Tmatrix(ui32Triplet **m, long nrl, long nrh, long ncl, long nch);56 IMAGE_EXPORT(void) free_f32Tmatrix ( f32Triplet **m, long nrl, long nrh, long ncl, long nch);57 23 58 24 /* ----------------- */ … … 60 26 /* ----------------- */ 61 27 62 IMAGE_EXPORT(byte**) btrimatrix(long nrl, long nrh, long ncl, long nch, long step); 63 IMAGE_EXPORT(sint16**) si16trimatrix(long nrl, long nrh, long ncl, long nch, long step); 64 IMAGE_EXPORT(uint16**) ui16trimatrix(long nrl, long nrh, long ncl, long nch, long step); 65 IMAGE_EXPORT(sint32**) si32trimatrix(long nrl, long nrh, long ncl, long nch, long step); 66 IMAGE_EXPORT(uint32**) ui32trimatrix(long nrl, long nrh, long ncl, long nch, long step); 67 IMAGE_EXPORT(float32**) f32trimatrix(long nrl, long nrh, long ncl, long nch, long step); 68 IMAGE_EXPORT(float64**) f64trimatrix(long nrl, long nrh, long ncl, long nch, long step); 28 #define type_trimatrix(t) \ 29 t ** short_name(t,,trimatrix)(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t step) 69 30 70 #ifdef __cplusplus 71 } 72 #endif 31 type_trimatrix(int8_t); 32 type_trimatrix(uint8_t); 33 type_trimatrix(int16_t); 34 type_trimatrix(uint16_t); 35 type_trimatrix(int32_t); 36 type_trimatrix(uint32_t); 37 type_trimatrix(float); 38 type_trimatrix(double); 39 73 40 74 41 #endif /* __NRALLOC2X_H__ */ 42 43 // Local Variables: 44 // tab-width: 4 45 // c-basic-offset: 4 46 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 47 // indent-tabs-mode: nil 48 // End: 49 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 50 -
soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc3.h
r772 r821 13 13 #define __NRALLOC3_H__ 14 14 15 #ifdef __cplusplus 16 #pragma message ("C++") 17 extern "C" { 18 #endif 19 20 #ifdef VERBOSE_PRAGMA 21 //#pragma message ("- *** include nralloc3.h ***") 22 #endif 15 #include "nrc_os_config.h" 23 16 24 double*** d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh); 25 void free_d3tensor(double ***t,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 17 //double*** d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh); 18 //void free_d3tensor(double ***t,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 19 20 #define type_cube(t) \ 21 t *** short_name(t,,cube)(int32_t ndl, int32_t ndh, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) \ 26 22 27 23 24 type_cube(int8_t); 25 type_cube(uint8_t); 26 type_cube(int16_t); 27 type_cube(uint16_t); 28 type_cube(int32_t); 29 type_cube(uint32_t); 30 type_cube(int64_t); 31 type_cube(uint64_t); 32 type_cube(float); 33 type_cube(double); 34 type_cube(rgb8); 35 type_cube(rgbx8); 28 36 29 IMAGE_EXPORT(sint8***) si8cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 30 IMAGE_EXPORT(uint8***) ui8cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 31 IMAGE_EXPORT(sint16***) si16cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 32 IMAGE_EXPORT(uint16***) ui16cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 33 IMAGE_EXPORT(sint32***) si32cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 34 IMAGE_EXPORT(uint32***) ui32cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 35 IMAGE_EXPORT(float32***) f32cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 36 IMAGE_EXPORT(float64***) f64cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 37 IMAGE_EXPORT(rgb8***) rgb8cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 38 IMAGE_EXPORT(rgbx8***) rgbx8cube(long ndl, long ndh, long nrl, long nrh, long ncl, long nch); 37 #define free_type_cube(t) \ 38 void short_name(t,free_,cube)(t *** c, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl, int32_t ndh) \ 39 39 40 IMAGE_EXPORT(void) free_si8cube (sint8 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 41 IMAGE_EXPORT(void) free_ui8cube (uint8 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 42 IMAGE_EXPORT(void) free_si16cube (sint16 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 43 IMAGE_EXPORT(void) free_ui16cube (uint16 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 44 IMAGE_EXPORT(void) free_si32cube (sint32 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 45 IMAGE_EXPORT(void) free_ui32cube (uint32 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 46 IMAGE_EXPORT(void) free_f32cube (float32 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 47 IMAGE_EXPORT(void) free_f64cube (float64 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 48 IMAGE_EXPORT(void) free_rgb8cube (rgb8 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 49 IMAGE_EXPORT(void) free_rgbx8cube(rgbx8 ***c,long nrl,long nrh,long ncl,long nch,long ndl,long ndh); 40 free_type_cube(int8_t); 41 free_type_cube(uint8_t); 42 free_type_cube(int16_t); 43 free_type_cube(uint16_t); 44 free_type_cube(int32_t); 45 free_type_cube(uint32_t); 46 free_type_cube(int64_t); 47 free_type_cube(uint64_t); 48 free_type_cube(float); 49 free_type_cube(double); 50 free_type_cube(rgb8); 51 free_type_cube(rgbx8); 50 52 51 #ifdef __cplusplus52 }53 #endif54 53 55 54 #endif /* __NRALLOC3_H__ */ 55 56 // Local Variables: 57 // tab-width: 4 58 // c-basic-offset: 4 59 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 60 // indent-tabs-mode: nil 61 // End: 62 63 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 64 -
soft/giet_vm/applications/rosenfeld/nrc2/include/nrarith0.h
r772 r821 11 11 #define __NRARITH0_H__ 12 12 13 #ifdef __cplusplus14 #pragma message ("C++")15 extern "C" {16 #endif17 18 #ifdef VERBOSE_PRAGMA19 //#pragma message(" -include nrarith0.h")20 #endif21 22 13 /* ---------- */ 23 14 /* -- Swap -- */ 24 15 /* ---------- */ 25 16 26 ROUTINE(void) i8swap(int8 *a, int8 *b); 27 ROUTINE(void) i16swap(int16 *a, int16 *b); 28 ROUTINE(void) i32swap(int32 *a, int32 *b); 29 ROUTINE(void) i64swap(int64 *a, int64 *b); 30 ROUTINE(void) f32swap(float32 *a, float32 *b); 31 ROUTINE(void) f64swap(float64 *a, float64 *b); 32 ROUTINE(void) rgb8swap(rgb8 *a, rgb8 *b); 33 ROUTINE(void) rgbx8swap(rgbx8 *a, rgbx8 *b); 17 #define type_swap(t) \ 18 void short_name(t,,swap)(t * a, t * b) 19 20 type_swap(int8_t); 21 type_swap(int16_t); 22 type_swap(int32_t); 23 type_swap(int64_t); 24 type_swap(float); 25 type_swap(double); 26 type_swap(rgb8); 27 type_swap(rgbx8); 28 34 29 35 30 /* --------- */ … … 37 32 /* --------- */ 38 33 39 ROUTINE(float32) f32min (float32 x1, float32 x2); 40 ROUTINE(float32) f32min2(float32 x1, float32 x2); 41 ROUTINE(float32) f32min3(float32 x1, float32 x2, float32 x3); 42 ROUTINE(float32) f32min4(float32 x1, float32 x2, float32 x3, float32 x4); 43 ROUTINE(float32) f32min5(float32 x1, float32 x2, float32 x3, float32 x4, float32 x5); 34 #define type_min(t) \ 35 t short_name(t,,min)(t x1, t x2); \ 36 t short_name(t,,min2)(t x1, t x2); \ 37 t short_name(t,,min3)(t x1, t x2, t x3); \ 38 t short_name(t,,min4)(t x1, t x2, t x3, t x4); \ 39 t short_name(t,,min5)(t x1, t x2, t x3, t x4, t x5) \ 44 40 45 ROUTINE(float64) f64min (float64 x1, float64 x2); 46 ROUTINE(float64) f64min2(float64 x1, float64 x2); 47 ROUTINE(float64) f64min3(float64 x1, float64 x2, float64 x3); 48 ROUTINE(float64) f64min4(float64 x1, float64 x2, float64 x3, float64 x4); 49 ROUTINE(float64) f64min5(float64 x1, float64 x2, float64 x3, float64 x4, float64 x5); 41 type_min(float); 42 type_min(double); 43 type_min(int8_t); 44 type_min(uint8_t); 45 type_min(int16_t); 46 type_min(uint16_t); 47 type_min(int32_t); 48 type_min(uint32_t); 49 type_min(rgb8); 50 50 51 ROUTINE(byte) bmin (byte x1, byte x2);52 ROUTINE(byte) bmin2(byte x1, byte x2);53 ROUTINE(byte) bmin3(byte x1, byte x2, byte x3);54 ROUTINE(byte) bmin4(byte x1, byte x2, byte x3, byte x4);55 ROUTINE(byte) bmin5(byte x1, byte x2, byte x3, byte x4, byte x5);56 57 ROUTINE(uint16) ui16min (uint16 x1, uint16 x2);58 ROUTINE(uint16) ui16min2(uint16 x1, uint16 x2);59 ROUTINE(uint16) ui16min3(uint16 x1, uint16 x2, uint16 x3);60 ROUTINE(uint16) ui16min4(uint16 x1, uint16 x2, uint16 x3, uint16 x4);61 ROUTINE(uint16) ui16min5(uint16 x1, uint16 x2, uint16 x3, uint16 x4, uint16 x5);62 63 ROUTINE(int32) i32min (int32 x1, int32 x2);64 ROUTINE(int32) i32min2(int32 x1, int32 x2);65 ROUTINE(int32) i32min3(int32 x1, int32 x2, int32 x3);66 ROUTINE(int32) i32min4(int32 x1, int32 x2, int32 x3, int32 x4);67 ROUTINE(int32) i32min5(int32 x1, int32 x2, int32 x3, int32 x4, int32 x5);68 69 ROUTINE(rgb8) rgb8min (rgb8 x1, rgb8 x2);70 ROUTINE(rgb8) rgb8min2(rgb8 x1, rgb8 x2);71 ROUTINE(rgb8) rgb8min3(rgb8 x1, rgb8 x2, rgb8 x3);72 ROUTINE(rgb8) rgb8min4(rgb8 x1, rgb8 x2, rgb8 x3, rgb8 x4);73 ROUTINE(rgb8) rgb8min5(rgb8 x1, rgb8 x2, rgb8 x3, rgb8 x4, rgb8 x5);74 51 75 52 /* --------- */ 76 53 /* -- Max -- */ 77 54 /* --------- */ 78 ROUTINE(float32) f32max (float32 x1, float32 x2);79 ROUTINE(float32) f32max2(float32 x1, float32 x2);80 ROUTINE(float32) f32max3(float32 x1, float32 x2, float32 x3);81 ROUTINE(float32) f32max4(float32 x1, float32 x2, float32 x3, float32 x4);82 ROUTINE(float32) f32max5(float32 x1, float32 x2, float32 x3, float32 x4, float32 x5);83 55 84 ROUTINE(float64) f64max (float64 x1, float64 x2); 85 ROUTINE(float64) f64max2(float64 x1, float64 x2); 86 ROUTINE(float64) f64max3(float64 x1, float64 x2, float64 x3); 87 ROUTINE(float64) f64max4(float64 x1, float64 x2, float64 x3, float64 x4); 88 ROUTINE(float64) f64max5(float64 x1, float64 x2, float64 x3, float64 x4, float64 x5); 56 #define type_max(t) \ 57 t short_name(t,,max)(t x1, t x2); \ 58 t short_name(t,,max2)(t x1, t x2); \ 59 t short_name(t,,max3)(t x1, t x2, t x3); \ 60 t short_name(t,,max4)(t x1, t x2, t x3, t x4); \ 61 t short_name(t,,max5)(t x1, t x2, t x3, t x4, t x5) \ 89 62 90 ROUTINE(byte) bmax (byte x1, byte x2); 91 ROUTINE(byte) bmax2(byte x1, byte x2); 92 ROUTINE(byte) bmax3(byte x1, byte x2, byte x3); 93 ROUTINE(byte) bmax4(byte x1, byte x2, byte x3, byte x4); 94 ROUTINE(byte) bmax5(byte x1, byte x2, byte x3, byte x4, byte x5); 63 type_max(float); 64 type_max(double); 65 type_max(int8_t); 66 type_max(uint8_t); 67 type_max(int16_t); 68 type_max(uint16_t); 69 type_max(int32_t); 70 type_max(uint32_t); 71 type_max(rgb8); 95 72 96 ROUTINE(uint16) ui16max (uint16 x1, uint16 x2);97 ROUTINE(uint16) ui16max2(uint16 x1, uint16 x2);98 ROUTINE(uint16) ui16max3(uint16 x1, uint16 x2, uint16 x3);99 ROUTINE(uint16) ui16max4(uint16 x1, uint16 x2, uint16 x3, uint16 x4);100 ROUTINE(uint16) ui16max5(uint16 x1, uint16 x2, uint16 x3, uint16 x4, uint16 x5);101 102 ROUTINE(int32) i32max (int32 x1, int32 x2);103 ROUTINE(int32) i32max2(int32 x1, int32 x2);104 ROUTINE(int32) i32max3(int32 x1, int32 x2, int32 x3);105 ROUTINE(int32) i32max4(int32 x1, int32 x2, int32 x3, int32 x4);106 ROUTINE(int32) i32max5(int32 x1, int32 x2, int32 x3, int32 x4, int32 x5);107 108 ROUTINE(rgb8) rgb8max (rgb8 x1, rgb8 x2);109 ROUTINE(rgb8) rgb8max2(rgb8 x1, rgb8 x2);110 ROUTINE(rgb8) rgb8max3(rgb8 x1, rgb8 x2, rgb8 x3);111 ROUTINE(rgb8) rgb8max4(rgb8 x1, rgb8 x2, rgb8 x3, rgb8 x4);112 ROUTINE(rgb8) rgb8max5(rgb8 x1, rgb8 x2, rgb8 x3, rgb8 x4, rgb8 x5);113 73 114 74 /* ----------- */ … … 116 76 /* ----------- */ 117 77 118 ROUTINE(byte) ibit(int32 x, int n);119 ROUTINE(int32) sym_int32(int32x);120 ROUTINE(int) myLog2(int x);121 ROUTINE(int) next_power2(int x);122 ROUTINE(int) myGCD(int u, int v);123 ROUTINE(int) myLCM(int u, int v);78 int32_t i32bit(int32_t x, int32_t n); 79 int32_t sym_int32(int32_t x); 80 int32_t myLog2(int32_t x); 81 int32_t next_power2(int32_t x); 82 int32_t myGCD(int32_t u, int32_t v); 83 int32_t myLCM(int32_t u, int32_t v); 124 84 125 #ifdef __cplusplus126 }127 85 #endif 128 86 129 #else 130 //#pragma message(" Warning : attempt to re-include nrarith0.h") 131 #endif 87 // Local Variables: 88 // tab-width: 4 89 // c-basic-offset: 4 90 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 91 // indent-tabs-mode: nil 92 // End: 132 93 94 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 95 -
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 -
soft/giet_vm/applications/rosenfeld/nrc2/include/nrarith2.h
r772 r821 11 11 #define _NRARITH2_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 nrarith.h") 22 #endif 13 #include "nrc_os_config.h" 23 14 24 15 /* ------------------ */ … … 26 17 /* ------------------ */ 27 18 28 IMAGE_EXPORT(sint8) min_si8matrix (sint8 **m, long nrl,long nrh,long ncl, long nch); 29 IMAGE_EXPORT(uint8) min_ui8matrix (uint8 **m, long nrl,long nrh,long ncl, long nch); 30 IMAGE_EXPORT(sint16) min_si16matrix (sint16 **m, long nrl,long nrh,long ncl, long nch); 31 IMAGE_EXPORT(uint16) min_ui16matrix (uint16 **m, long nrl,long nrh,long ncl, long nch); 32 IMAGE_EXPORT(sint32) min_si32matrix (sint32 **m, long nrl,long nrh,long ncl, long nch); 33 IMAGE_EXPORT(uint32) min_ui32matrix (uint32 **m, long nrl,long nrh,long ncl, long nch); 34 IMAGE_EXPORT(sint64) min_si64matrix (sint64 **m, long nrl,long nrh,long ncl, long nch); 35 IMAGE_EXPORT(uint64) min_ui64matrix (uint64 **m, long nrl,long nrh,long ncl, long nch); 36 IMAGE_EXPORT(float32) min_f32matrix (float32 **m, long nrl,long nrh,long ncl, long nch); 37 IMAGE_EXPORT(float64) min_f64matrix (float64 **m, long nrl,long nrh,long ncl, long nch); 19 #define min_type_matrix(t) \ 20 t short_name(t,min_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) 21 22 min_type_matrix(int8_t); 23 min_type_matrix(uint8_t); 24 min_type_matrix(int16_t); 25 min_type_matrix(uint16_t); 26 min_type_matrix(int32_t); 27 min_type_matrix(uint32_t); 28 min_type_matrix(int64_t); 29 min_type_matrix(uint64_t); 30 min_type_matrix(float); 31 min_type_matrix(double); 32 38 33 39 34 /* ------------------ */ … … 41 36 /* ------------------ */ 42 37 43 IMAGE_EXPORT(sint8) max_si8matrix (sint8 **m, long nrl,long nrh,long ncl, long nch); 44 IMAGE_EXPORT(uint8) max_ui8matrix (uint8 **m, long nrl,long nrh,long ncl, long nch); 45 IMAGE_EXPORT(sint16) max_si16matrix (sint16 **m, long nrl,long nrh,long ncl, long nch); 46 IMAGE_EXPORT(uint16) max_ui16matrix (uint16 **m, long nrl,long nrh,long ncl, long nch); 47 IMAGE_EXPORT(sint32) max_si32matrix (sint32 **m, long nrl,long nrh,long ncl, long nch); 48 IMAGE_EXPORT(uint32) max_ui32matrix (uint32 **m, long nrl,long nrh,long ncl, long nch); 49 IMAGE_EXPORT(sint64) max_si64matrix (sint64 **m, long nrl,long nrh,long ncl, long nch); 50 IMAGE_EXPORT(uint64) max_ui64matrix (uint64 **m, long nrl,long nrh,long ncl, long nch); 51 IMAGE_EXPORT(float32) max_f32matrix (float32 **m, long nrl,long nrh,long ncl, long nch); 52 IMAGE_EXPORT(float64) max_f64matrix (float64 **m, long nrl,long nrh,long ncl, long nch); 38 #define max_type_matrix(t) \ 39 t short_name(t,max_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch) 40 41 max_type_matrix(int8_t); 42 max_type_matrix(uint8_t); 43 max_type_matrix(int16_t); 44 max_type_matrix(uint16_t); 45 max_type_matrix(int32_t); 46 max_type_matrix(uint32_t); 47 max_type_matrix(int64_t); 48 max_type_matrix(uint64_t); 49 max_type_matrix(float); 50 max_type_matrix(double); 51 53 52 54 53 /* ------------------ */ … … 56 55 /* ------------------ */ 57 56 58 IMAGE_EXPORT(void) add_si8matrix (sint8 **X, long nrl,long nrh,long ncl, long nch, sint8 **Y, sint8 **Z); 59 IMAGE_EXPORT(void) add_ui8matrix (uint8 **X, long nrl,long nrh,long ncl, long nch, uint8 **Y, uint8 **Z); 60 IMAGE_EXPORT(void) add_si16matrix (sint16 **X, long nrl,long nrh,long ncl, long nch, sint16 **Y, sint16 **Z); 61 IMAGE_EXPORT(void) add_ui16matrix (uint16 **X, long nrl,long nrh,long ncl, long nch, uint16 **Y, uint16 **Z); 62 IMAGE_EXPORT(void) add_si32matrix (sint32 **X, long nrl,long nrh,long ncl, long nch, sint32 **Y, sint32 **Z); 63 IMAGE_EXPORT(void) add_ui32matrix (uint32 **X, long nrl,long nrh,long ncl, long nch, uint32 **Y, uint32 **Z); 64 IMAGE_EXPORT(void) add_si64matrix (sint64 **X, long nrl,long nrh,long ncl, long nch, sint64 **Y, sint64 **Z); 65 IMAGE_EXPORT(void) add_ui64matrix (uint64 **X, long nrl,long nrh,long ncl, long nch, uint64 **Y, uint64 **Z); 66 67 IMAGE_EXPORT(void) add_f32matrix (float32 **X, long nrl,long nrh,long ncl, long nch, float32 **Y, float32 **Z); 68 IMAGE_EXPORT(void) add_f64matrix (float64 **X, long nrl,long nrh,long ncl, long nch, float64 **Y, float64 **Z); 69 70 IMAGE_EXPORT(void) add_rgb8matrix (rgb8 **X, long nrl,long nrh,long ncl, long nch, rgb8 **Y, rgb8 **Z); 71 IMAGE_EXPORT(void) add_rgbx8matrix(rgbx8 **X, long nrl,long nrh,long ncl, long nch, rgbx8 **Y, rgbx8 **Z); 57 #define add_type_matrix(t) \ 58 void short_name(t,add_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** Y, t ** Z) 59 60 add_type_matrix(int8_t); 61 add_type_matrix(uint8_t); 62 add_type_matrix(int16_t); 63 add_type_matrix(uint16_t); 64 add_type_matrix(int32_t); 65 add_type_matrix(uint32_t); 66 add_type_matrix(int64_t); 67 add_type_matrix(uint64_t); 68 add_type_matrix(float); 69 add_type_matrix(double); 70 71 void add_rgb8matrix (rgb8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8 ** Y, rgb8 ** Z); 72 void add_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 ** Y, rgbx8 ** Z); 73 72 74 73 75 /* -------------------- */ … … 75 77 /* -------------------- */ 76 78 77 IMAGE_EXPORT(void) addc_si8matrix (sint8 **X, long nrl,long nrh,long ncl, long nch, sint8 y, sint8 **Z); 78 IMAGE_EXPORT(void) addc_ui8matrix (uint8 **X, long nrl,long nrh,long ncl, long nch, uint8 y, uint8 **Z); 79 IMAGE_EXPORT(void) addc_si16matrix (sint16 **X, long nrl,long nrh,long ncl, long nch, sint16 y, sint16 **Z); 80 IMAGE_EXPORT(void) addc_ui16matrix (uint16 **X, long nrl,long nrh,long ncl, long nch, uint16 y, uint16 **Z); 81 IMAGE_EXPORT(void) addc_si32matrix (sint32 **X, long nrl,long nrh,long ncl, long nch, sint32 y, sint32 **Z); 82 IMAGE_EXPORT(void) addc_ui32matrix (uint32 **X, long nrl,long nrh,long ncl, long nch, uint32 y, uint32 **Z); 83 IMAGE_EXPORT(void) addc_si64matrix (sint64 **X, long nrl,long nrh,long ncl, long nch, sint64 y, sint64 **Z); 84 IMAGE_EXPORT(void) addc_ui64matrix (uint64 **X, long nrl,long nrh,long ncl, long nch, uint64 y, uint64 **Z); 85 86 IMAGE_EXPORT(void) addc_f32matrix (float32 **X, long nrl,long nrh,long ncl, long nch, float32 y, float32 **Z); 87 IMAGE_EXPORT(void) addc_f64matrix (float64 **X, long nrl,long nrh,long ncl, long nch, float64 y, float64 **Z); 88 89 IMAGE_EXPORT(void) addc_rgb8matrix (rgb8 **X, long nrl,long nrh,long ncl, long nch, rgb8 y, rgb8 **Z); 90 IMAGE_EXPORT(void) addc_rgbx8matrix(rgbx8 **X, long nrl,long nrh,long ncl, long nch, rgbx8 y, rgbx8 **Z); 79 #define addc_type_matrix(t) \ 80 void short_name(t,addc_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t y, t ** Z) 81 82 addc_type_matrix(int8_t); 83 addc_type_matrix(uint8_t); 84 addc_type_matrix(int16_t); 85 addc_type_matrix(uint16_t); 86 addc_type_matrix(int32_t); 87 addc_type_matrix(uint32_t); 88 addc_type_matrix(int64_t); 89 addc_type_matrix(uint64_t); 90 addc_type_matrix(float); 91 addc_type_matrix(double); 92 93 void addc_rgb8matrix (rgb8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8 y, rgb8 ** Z); 94 void addc_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 y, rgbx8 ** Z); 95 91 96 92 97 /* ----------- */ … … 94 99 /* ----------- */ 95 100 96 IMAGE_EXPORT(void) sub_si8matrix (sint8 **X, long nrl,long nrh,long ncl, long nch, sint8 **Y, sint8 **Z); 97 IMAGE_EXPORT(void) sub_ui8matrix (uint8 **X, long nrl,long nrh,long ncl, long nch, uint8 **Y, uint8 **Z); 98 IMAGE_EXPORT(void) sub_si16matrix (sint16 **X, long nrl,long nrh,long ncl, long nch, sint16 **Y, sint16 **Z); 99 IMAGE_EXPORT(void) sub_ui16matrix (uint16 **X, long nrl,long nrh,long ncl, long nch, uint16 **Y, uint16 **Z); 100 IMAGE_EXPORT(void) sub_si32matrix (sint32 **X, long nrl,long nrh,long ncl, long nch, sint32 **Y, sint32 **Z); 101 IMAGE_EXPORT(void) sub_ui32matrix (uint32 **X, long nrl,long nrh,long ncl, long nch, uint32 **Y, uint32 **Z); 102 IMAGE_EXPORT(void) sub_si64matrix (sint64 **X, long nrl,long nrh,long ncl, long nch, sint64 **Y, sint64 **Z); 103 IMAGE_EXPORT(void) sub_ui64matrix (uint64 **X, long nrl,long nrh,long ncl, long nch, uint64 **Y, uint64 **Z); 104 105 IMAGE_EXPORT(void) sub_f32matrix (float32 **X, long nrl,long nrh,long ncl, long nch, float32 **Y, float32 **Z); 106 IMAGE_EXPORT(void) sub_f64matrix (float64 **X, long nrl,long nrh,long ncl, long nch, float64 **Y, float64 **Z); 107 108 IMAGE_EXPORT(void) sub_rgb8matrix (rgb8 **X, long nrl,long nrh,long ncl, long nch, rgb8 **Y, rgb8 **Z); 109 IMAGE_EXPORT(void) sub_rgbx8matrix(rgbx8 **X, long nrl,long nrh,long ncl, long nch, rgbx8 **Y, rgbx8 **Z); 101 #define sub_type_matrix(t) \ 102 void short_name(t,sub_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** Y, t ** Z) 103 104 sub_type_matrix(int8_t); 105 sub_type_matrix(uint8_t); 106 sub_type_matrix(int16_t); 107 sub_type_matrix(uint16_t); 108 sub_type_matrix(int32_t); 109 sub_type_matrix(uint32_t); 110 sub_type_matrix(int64_t); 111 sub_type_matrix(uint64_t); 112 sub_type_matrix(float); 113 sub_type_matrix(double); 114 115 void sub_rgb8matrix (rgb8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8 ** Y, rgb8 ** Z); 116 void sub_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 ** Y, rgbx8 ** Z); 117 110 118 111 119 /* --------------------- */ … … 113 121 /* --------------------- */ 114 122 115 IMAGE_EXPORT(void) subc_si8matrix (sint8 **X, long nrl,long nrh,long ncl, long nch, sint8 y, sint8 **Z); 116 IMAGE_EXPORT(void) subc_ui8matrix (uint8 **X, long nrl,long nrh,long ncl, long nch, uint8 y, uint8 **Z); 117 IMAGE_EXPORT(void) subc_si16matrix (sint16 **X, long nrl,long nrh,long ncl, long nch, sint16 y, sint16 **Z); 118 IMAGE_EXPORT(void) subc_ui16matrix (uint16 **X, long nrl,long nrh,long ncl, long nch, uint16 y, uint16 **Z); 119 IMAGE_EXPORT(void) subc_si32matrix (sint32 **X, long nrl,long nrh,long ncl, long nch, sint32 y, sint32 **Z); 120 IMAGE_EXPORT(void) subc_ui32matrix (uint32 **X, long nrl,long nrh,long ncl, long nch, uint32 y, uint32 **Z); 121 IMAGE_EXPORT(void) subc_si64matrix (sint64 **X, long nrl,long nrh,long ncl, long nch, sint64 y, sint64 **Z); 122 IMAGE_EXPORT(void) subc_ui64matrix (uint64 **X, long nrl,long nrh,long ncl, long nch, uint64 y, uint64 **Z); 123 124 IMAGE_EXPORT(void) subc_f32matrix (float32 **X, long nrl,long nrh,long ncl, long nch, float32 y, float32 **Z); 125 IMAGE_EXPORT(void) subc_f64matrix (float64 **X, long nrl,long nrh,long ncl, long nch, float64 y, float64 **Z); 126 127 IMAGE_EXPORT(void) subc_rgb8matrix (rgb8 **X, long nrl,long nrh,long ncl, long nch, rgb8 y, rgb8 **Z); 128 IMAGE_EXPORT(void) subc_rgbx8matrix(rgbx8 **X, long nrl,long nrh,long ncl, long nch, rgbx8 y, rgbx8 **Z); 129 130 /* --------------------- */ 131 /* --- Sub constante --- */ 123 #define subc_type_matrix(t) \ 124 void short_name(t,subc_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t y, t ** Z) 125 126 subc_type_matrix(int8_t); 127 subc_type_matrix(uint8_t); 128 subc_type_matrix(int16_t); 129 subc_type_matrix(uint16_t); 130 subc_type_matrix(int32_t); 131 subc_type_matrix(uint32_t); 132 subc_type_matrix(int64_t); 133 subc_type_matrix(uint64_t); 134 subc_type_matrix(float); 135 subc_type_matrix(double); 136 137 void subc_rgb8matrix (rgb8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8 y, rgb8 ** Z); 138 void subc_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 y, rgbx8 ** Z); 139 140 /* --------------------- */ 141 /* --- Mul constante --- */ 132 142 /* --------------------- */ 133 143 134 144 // Z = X * y 135 IMAGE_EXPORT(void) mulc_si8matrix (sint8 **X, long nrl,long nrh,long ncl, long nch, sint8 y, sint8 **Z); 136 IMAGE_EXPORT(void) mulc_ui8matrix (uint8 **X, long nrl,long nrh,long ncl, long nch, uint8 y, uint8 **Z); 137 IMAGE_EXPORT(void) mulc_si16matrix (sint16 **X, long nrl,long nrh,long ncl, long nch, sint16 y, sint16 **Z); 138 IMAGE_EXPORT(void) mulc_ui16matrix (uint16 **X, long nrl,long nrh,long ncl, long nch, uint16 y, uint16 **Z); 139 IMAGE_EXPORT(void) mulc_si32matrix (sint32 **X, long nrl,long nrh,long ncl, long nch, sint32 y, sint32 **Z); 140 IMAGE_EXPORT(void) mulc_ui32matrix (uint32 **X, long nrl,long nrh,long ncl, long nch, uint32 y, uint32 **Z); 141 IMAGE_EXPORT(void) mulc_si64matrix (sint64 **X, long nrl,long nrh,long ncl, long nch, sint64 y, sint64 **Z); 142 IMAGE_EXPORT(void) mulc_ui64matrix (uint64 **X, long nrl,long nrh,long ncl, long nch, uint64 y, uint64 **Z); 143 144 IMAGE_EXPORT(void) mulc_f32matrix (float32 **X, long nrl,long nrh,long ncl, long nch, float32 y, float32 **Z); 145 IMAGE_EXPORT(void) mulc_f64matrix (float64 **X, long nrl,long nrh,long ncl, long nch, float64 y, float64 **Z); 146 147 IMAGE_EXPORT(void) mulc_rgb8matrix (rgb8 **X, long nrl,long nrh,long ncl, long nch, rgb8 y, rgb8 **Z); 148 IMAGE_EXPORT(void) mulc_rgbx8matrix(rgbx8 **X, long nrl,long nrh,long ncl, long nch, rgbx8 y, rgbx8 **Z); 145 146 #define mulc_type_matrix(t) \ 147 void short_name(t,mulc_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t y, t ** Z) 148 149 mulc_type_matrix(int8_t); 150 mulc_type_matrix(uint8_t); 151 mulc_type_matrix(int16_t); 152 mulc_type_matrix(uint16_t); 153 mulc_type_matrix(int32_t); 154 mulc_type_matrix(uint32_t); 155 mulc_type_matrix(int64_t); 156 mulc_type_matrix(uint64_t); 157 mulc_type_matrix(float); 158 mulc_type_matrix(double); 159 160 void mulc_rgb8matrix (rgb8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8 y, rgb8 ** Z); 161 void mulc_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 y, rgbx8 ** Z); 162 149 163 150 164 /* --------------- */ 151 165 /* --- MulFrac --- */ 152 166 /* --------------- */ 153 // m2 = (a*m1)/b 154 IMAGE_EXPORT(void) mulfrac_bmatrix (byte **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 b, byte **m2); 155 IMAGE_EXPORT(void) mulfrac_si16matrix (sint16 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 b, sint16 **m2); 156 IMAGE_EXPORT(void) mulfrac_ui16matrix (uint16 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 b, uint16 **m2); 157 IMAGE_EXPORT(void) mulfrac_si32matrix (sint32 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 b, sint32 **m2); 158 IMAGE_EXPORT(void) mulfrac_ui32matrix (uint32 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 b, uint32 **m2); 159 IMAGE_EXPORT(void) mulfrac_rgb8matrix (rgb8 **m1, long nrl,long nrh,long ncl, long nch, rgb32 a, rgb32 b, rgb8 **m2); 160 IMAGE_EXPORT(void) mulfrac_rgbx8matrix(rgbx8 **m1, long nrl,long nrh,long ncl, long nch, rgbx32 a, rgbx32 b, rgbx8 **m2); 161 162 IMAGE_EXPORT(void) mulfrack_rgb8matrix (rgb8 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 b, rgb8 **m2); 163 IMAGE_EXPORT(void) mulfrack_rgbx8matrix(rgbx8 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 b, rgbx8 **m2); 167 168 // m2 = (a * m1) / b 169 170 #define mulfrac_type_matrix(t) \ 171 void short_name(t,mulfrac_,matrix)(t ** X, int32_t nrl, int32_t nrh, \ 172 int32_t ncl, int32_t nch, int32_t a, int32_t b, t ** Y) 173 174 mulfrac_type_matrix(int8_t); 175 mulfrac_type_matrix(uint8_t); 176 mulfrac_type_matrix(int16_t); 177 mulfrac_type_matrix(uint16_t); 178 mulfrac_type_matrix(int32_t); 179 mulfrac_type_matrix(uint32_t); 180 mulfrac_type_matrix(int64_t); 181 mulfrac_type_matrix(uint64_t); 182 mulfrac_type_matrix(float); 183 mulfrac_type_matrix(double); 184 185 void mulfrack_rgb8matrix (rgb8 ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32 a, int32 b, rgb8 ** m2); 186 void mulfrack_rgbx8matrix(rgbx8 ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32 a, int32 b, rgbx8 ** m2); 187 164 188 165 189 /* ---------------- */ 166 190 /* --- MulShift --- */ 167 191 /* ---------------- */ 168 // m3 = (a*m1)>>s 169 IMAGE_EXPORT(void) mulshift_bmatrix (byte **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 s, byte **m2); 170 IMAGE_EXPORT(void) mulshift_i16matrix (int16 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 s, int16 **m2); 171 IMAGE_EXPORT(void) mulshift_ui16matrix (uint16 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 s, uint16 **m2); 172 IMAGE_EXPORT(void) mulshift_i32matrix (int32 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 s, int32 **m2); 173 IMAGE_EXPORT(void) mulshift_ui32matrix (uint32 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 s, uint32 **m2); 174 IMAGE_EXPORT(void) mulshift_rgb8matrix (rgb8 **m1, long nrl,long nrh,long ncl, long nch, rgb32 a, rgb32 s, rgb8 **m2); 175 IMAGE_EXPORT(void) mulshift_rgbx8matrix(rgbx8 **m1, long nrl,long nrh,long ncl, long nch, rgbx32 a, rgbx32 s, rgbx8 **m2); 176 177 IMAGE_EXPORT(void) mulshiftk_rgb8matrix (rgb8 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 s, rgb8 **m2); 178 IMAGE_EXPORT(void) mulshiftk_rgbx8matrix(rgbx8 **m1, long nrl,long nrh,long ncl, long nch, int32 a, int32 s, rgbx8 **m2); 179 180 IMAGE_EXPORT(void) quadratic_error_si16matrix(sint16 **m1,long nrl,long nrh,long ncl, long nch, sint16 **m2, sint16 **m3); 181 182 183 #ifdef __cplusplus 184 } 185 #endif 192 // m3 = (a * m1) >> s 193 194 #define mulshift_type_matrix(t) \ 195 void short_name(t,mulshift_,matrix)(t ** X, int32_t nrl, int32_t nrh, \ 196 int32_t ncl, int32_t nch, int32_t a, int32_t s, t ** Y) 197 198 mulshift_type_matrix(int8_t); 199 mulshift_type_matrix(uint8_t); 200 mulshift_type_matrix(int16_t); 201 mulshift_type_matrix(uint16_t); 202 mulshift_type_matrix(int32_t); 203 mulshift_type_matrix(uint32_t); 204 mulshift_type_matrix(int64_t); 205 mulshift_type_matrix(uint64_t); 206 mulshift_type_matrix(float); 207 mulshift_type_matrix(double); 208 209 void mulshift_rgb8matrix (rgb8 **m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb32 a, rgb32 s, rgb8 ** m2); 210 void mulshift_rgbx8matrix(rgbx8 **m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx32 a, rgbx32 s, rgbx8 ** m2); 211 212 void mulshiftk_rgb8matrix (rgb8 ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32 a, int32 s, rgb8 ** m2); 213 void mulshiftk_rgbx8matrix(rgbx8 ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32 a, int32 s, rgbx8 ** m2); 214 215 void quadratic_error_si16matrix(sint16 ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, sint16 ** m2, sint16 ** m3); 216 186 217 187 218 #endif /* _NRARITH2_H_ */ 219 220 // Local Variables: 221 // tab-width: 4 222 // c-basic-offset: 4 223 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 224 // indent-tabs-mode: nil 225 // End: 226 227 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 228 -
soft/giet_vm/applications/rosenfeld/nrc2/include/nrarith2x.h
r772 r821 11 11 #define _NRARITH2X_H_ 12 12 13 #ifdef __cplusplus 14 #ifdef PRAGMA_VERBOSE 15 #pragma message ("C++") 16 #endif 17 extern "C" { 18 #endif 13 // Add conditionnel 19 14 20 #ifdef PRAGMA_VERBOSE 21 #pragma message("- include nrarith2x.h") 22 #endif 15 #define addcnz_type_matrix(t) \ 16 void short_name(t,addcnz_,matrix)(t ** src, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t cte, t ** dst) 17 18 addcnz_type_matrix(int8_t); 19 addcnz_type_matrix(uint8_t); 20 addcnz_type_matrix(int16_t); 21 addcnz_type_matrix(uint16_t); 22 addcnz_type_matrix(int32_t); 23 addcnz_type_matrix(uint32_t); 24 addcnz_type_matrix(int64_t); 25 addcnz_type_matrix(uint64_t); 26 addcnz_type_matrix(float); 27 addcnz_type_matrix(double); 23 28 24 29 25 // Add conditionnel 26 IMAGE_EXPORT(void) addc_bmatrix (byte **src,long nrl,long nrh,long ncl, long nch, byte cte, byte **dst); 27 IMAGE_EXPORT(void) addc_smatrix (sint16 **src,long nrl,long nrh,long ncl, long nch, short cte, sint16 **dst); 28 IMAGE_EXPORT(void) addc_usmatrix(uint16 **src,long nrl,long nrh,long ncl, long nch, short cte, uint16 **dst); 30 #define addandc_type_matrix(t) \ 31 void short_name(t,addandc_,matrix)(t ** src, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t cte, t ** dst) 29 32 30 IMAGE_EXPORT(void) addandc_bmatrix (byte **src,long nrl,long nrh,long ncl, long nch, byte cte, byte **dst); 31 IMAGE_EXPORT(void) addandc_si16matrix (sint16 **src,long nrl,long nrh,long ncl, long nch, short cte, sint16 **dst); 32 IMAGE_EXPORT(void) addandc_ui16matrix (uint16 **src,long nrl,long nrh,long ncl, long nch, short cte, uint16 **dst); 33 addandc_type_matrix(int8_t); 34 addandc_type_matrix(uint8_t); 35 addandc_type_matrix(int16_t); 36 addandc_type_matrix(uint16_t); 37 addandc_type_matrix(int32_t); 38 addandc_type_matrix(uint32_t); 39 addandc_type_matrix(int64_t); 40 addandc_type_matrix(uint64_t); 41 addandc_type_matrix(float); 42 addandc_type_matrix(double); 33 43 34 IMAGE_EXPORT(void) addcnz_bmatrix(byte **src,long nrl,long nrh,long ncl, long nch, byte cte, byte **dst);35 44 36 IMAGE_EXPORT(int) count_bmatrix(byte **m, long nrl,long nrh,long ncl, long nch); 37 /* 38 * renvoie la somme des points de la matrice 39 */ 45 /* renvoie la somme des points de la matrice */ 40 46 41 #ifdef __cplusplus 42 } 43 #endif 47 #define sum_type_matrix(t,rt) \ 48 rt short_name(t,sum_,matrix)(t ** m, int32_t nrl, int32_t nrh,int32_t ncl, int32_t nch) 49 50 sum_type_matrix(int8_t, int32_t); 51 sum_type_matrix(uint8_t, uint32_t); 52 sum_type_matrix(int16_t, int32_t); 53 sum_type_matrix(uint16_t, uint32_t); 54 sum_type_matrix(int32_t, int64_t); 55 sum_type_matrix(uint32_t, uint64_t); 56 sum_type_matrix(int64_t, int64_t); 57 sum_type_matrix(uint64_t, uint64_t); 58 sum_type_matrix(float, float); 59 sum_type_matrix(double, double); 60 61 44 62 45 63 #endif /* _NRUTIL_H_ */ 64 65 // Local Variables: 66 // tab-width: 4 67 // c-basic-offset: 4 68 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 69 // indent-tabs-mode: nil 70 // End: 71 72 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 73 -
soft/giet_vm/applications/rosenfeld/nrc2/include/nrc_os_config.h
r798 r821 7 7 #define printf(...) giet_tty_printf(__VA_ARGS__) 8 8 9 #define open(x, y) giet_fat_open(x, y) 10 #define close(x) giet_fat_close(x) 11 #define read(x, y, z) giet_fat_read(x, y, z) 12 #define write(x, y, z) giet_fat_write(x, y, z) 13 #define fprintf(x, ...) giet_fat_fprintf(x, __VA_ARGS__) 14 #define fscanf(x, ...) ; 15 #define exit(x) giet_pthread_exit(NULL) 16 #else 9 #define open(x, y) giet_fat_open(x, y) 10 #define close(x) giet_fat_close(x) 11 #define read(x, y, z) giet_fat_read(x, y, z) 12 #define write(x, y, z) giet_fat_write(x, y, z) 13 #define fprintf(x, ...) giet_fat_fprintf(x, __VA_ARGS__) 14 //#define fscanf(x, ...) ; 15 #define exit(x) giet_pthread_exit(NULL) 16 17 #define pthread_barrier_t giet_barrier_t 18 #define pthread_spinlock_t user_lock_t 19 #define pthread_spin_lock(x) lock_acquire(x) 20 #define pthread_spin_unlock(x) lock_release(x) 21 #define pthread_spin_init(x, y) lock_init(x) 22 #define pthread_mutexlock_t user_lock_t 23 #define pthread_mutex_lock(x) lock_acquire(x) 24 #define pthread_mutex_unlock(x) lock_release(x) 25 #define pthread_mutex_init(x, y) lock_init(x) 26 #define pthread_barrier_init(x,y,z) barrier_init(x, z) 27 #define pthread_barrier_wait(x) barrier_wait(x) 28 #define pthread_barrier_destroy(x) 29 #define pthread_create(x,y,z,t) giet_pthread_create(x,y,z,t) 30 #define pthread_join(x,y) giet_pthread_join(x,y) 17 31 #endif 18 32 -
soft/giet_vm/applications/rosenfeld/nrc2/include/nrkernel.h
r772 r821 11 11 #define __NRKERNEL_H__ 12 12 13 #ifdef __cplusplus 14 #pragma message ("C++") 15 extern "C" { 16 #endif 17 18 #ifdef VERBOSE_PRAGMA 19 //#pragma message ("- *** include nrkernel.h ***") 13 14 #if TARGET_OS == GIETVM 15 #define nrerror(...) ({ \ 16 printf("*** NRC Runtime Error:\n "); \ 17 printf(__VA_ARGS__); \ 18 exit(1); \ 19 }) 20 #else 21 #define nrerror(...) ({ \ 22 fprintf(stderr, "*** NRC Runtime Error:\n "); \ 23 fprintf(stderr, __VA_ARGS__); \ 24 exit(1); \ 25 }) 20 26 #endif 21 27 22 void nrerror(char error_text[]);23 void nrerror0(char error_text[]);24 void nrerror1(char *format, ...);25 26 void Error (char *format, ...);27 void Warning(char *format, ...);28 28 29 29 30 #ifdef __cplusplus31 }32 #endif33 30 34 31 #endif // __NRKERNEL_H__ -
soft/giet_vm/applications/rosenfeld/nrc2/include/nrtype.h
r772 r821 16 16 #define _NRTYPE_H_ 17 17 18 #ifdef __cplusplus 19 #pragma message ("C++") 20 extern "C" { 21 #endif 22 23 #define VERBOSE_PRAGMA 24 25 #ifdef VERBOSE_PRAGMA 26 //#pragma message ("- include nrtype.h") 27 #endif 18 #include <stdint.h> 28 19 29 20 // ---------------------------------- // … … 31 22 // ---------------------------------- // 32 23 24 33 25 #include "mypredef.h" 34 26 35 typedef unsigned char BOOLEAN;36 typedef unsigned char boolean;37 typedef int BOOL;38 #ifdef VERBOSE_PRAGMA39 //#pragma message("boolean")40 #endif41 27 42 #ifndef TRUE 43 #define TRUE 1 44 #else 45 #pragma message(" ATTENTION : TRUE already defined") 46 #endif 28 // Short names 47 29 48 #ifndef FALSE 49 #define FALSE 0 50 #else 51 #pragma message(" ATTENTION : FALSE already defined") 52 #endif 30 #define sn_int8_t(p,s) p##i8##s 31 #define sn_int16_t(p,s) p##i16##s 32 #define sn_int32_t(p,s) p##i32##s 33 #define sn_int64_t(p,s) p##i64##s 34 #define sn_uint8_t(p,s) p##ui8##s 35 #define sn_uint16_t(p,s) p##ui16##s 36 #define sn_uint32_t(p,s) p##ui32##s 37 #define sn_uint64_t(p,s) p##ui64##s 38 #define sn_float(p,s) p##f32##s 39 #define sn_double(p,s) p##f64##s 40 #define sn_void_p(p,s) p##v##s 41 #define sn_rgb8(p,s) p##rgb8##s 42 #define sn_rgbx8(p,s) p##rgbx8##s 43 #define sn_rgb32(p,s) p##rgb32##s 44 #define sn_rgbx32(p,s) p##rgbx32##s 45 #define sn_complex32(p,s) p##c32##s 46 #define sn_complex64(p,s) p##c64##s 47 #define sn_si16Point(p,s) p##si16P##s 48 #define sn_ui16Point(p,s) p##ui16P##s 49 #define sn_si32Point(p,s) p##si32P##s 50 #define sn_ui32Point(p,s) p##ui32P##s 51 #define sn_f32Point(p,s) p##f32P##s 52 #define sn_si16Triplet(p,s) p##si16T##s 53 #define sn_ui16Triplet(p,s) p##ui16T##s 54 #define sn_si32Triplet(p,s) p##si32T##s 55 #define sn_ui32Triplet(p,s) p##ui32T##s 56 #define sn_f32Triplet(p,s) p##f32T##s 57 58 #define short_name(t,p,s) sn_##t(p,s) 59 60 #define NR_END 0 61 #define FREE_ARG char* 62 63 64 53 65 54 66 /* ------------------------------- */ 55 67 /* --- 8, 16, 32, 64 bit types --- */ 56 68 /* ------------------------------- */ 57 // old types to be removed58 //typedef sint16 usint16 ;59 //typedef int uint;60 69 61 // half-typed types 70 typedef void * void_p; 71 typedef char byte; 62 72 63 typedef char byte; 64 //typedef char usint16 ; 65 //typedef char uint; 66 67 typedef char int8; 68 typedef short int16; 69 typedef int int32; 70 typedef long long int64; 73 typedef int8_t int8; 74 typedef int16_t int16; 75 typedef int32_t int32; 76 typedef int64_t int64; 71 77 72 #ifdef LIBCOMP73 #if defined(myCompiler_ICC) || defined (myCompiler_MSC)74 typedef __int64 int64;75 #else76 typedef long long int64;77 #endif78 #endif79 78 80 79 // full-typed types 81 typedef signed charsint8;82 typedef u nsigned charuint8;80 typedef int8_t sint8; 81 typedef uint8_t uint8; 83 82 84 typedef signed short sint16;85 typedef u nsigned shortuint16;83 typedef int16_t sint16; 84 typedef uint16_t uint16; 86 85 87 typedef signed intsint32;88 typedef u nsigned int uint32;86 typedef int32_t sint32; 87 typedef uint32_t uint32; 89 88 90 #if defined(myCompiler_ICC) || defined (myCompiler_MSC) 91 typedef __int64 int64; 92 typedef signed __int64 sint64; 93 typedef unsigned __int64 uint64; 94 #else 95 typedef signed long long sint64; 96 typedef unsigned long long uint64; 97 #endif 89 typedef int64_t sint64; 90 typedef uint64_t uint64; 98 91 99 typedef float float32; 100 typedef double float64; 92 typedef float float32; 93 typedef double float64; 94 101 95 102 96 /* -------------------- */ 103 97 /* --- complex type --- */ 104 98 /* -------------------- */ 99 105 100 typedef struct { float32 x; float32 y;} complex32; 106 101 typedef struct { float64 x; float64 y;} complex64; … … 199 194 } bitfield8; 200 195 201 #ifdef __cplusplus202 }203 #endif204 196 205 197 #endif // _NR_TYPE_H_ 198
Note: See TracChangeset
for help on using the changeset viewer.