[772] | 1 | /* ------------------ */ |
---|
| 2 | /* --- nrarith0.h --- */ |
---|
| 3 | /* ------------------ */ |
---|
| 4 | |
---|
| 5 | /* |
---|
| 6 | * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved |
---|
| 7 | * Univ Paris Sud XI, CNRS |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #ifndef __NRARITH0_H__ |
---|
| 11 | #define __NRARITH0_H__ |
---|
| 12 | |
---|
| 13 | #ifdef __cplusplus |
---|
| 14 | #pragma message ("C++") |
---|
| 15 | extern "C" { |
---|
| 16 | #endif |
---|
| 17 | |
---|
| 18 | #ifdef VERBOSE_PRAGMA |
---|
| 19 | //#pragma message(" -include nrarith0.h") |
---|
| 20 | #endif |
---|
| 21 | |
---|
| 22 | /* ---------- */ |
---|
| 23 | /* -- Swap -- */ |
---|
| 24 | /* ---------- */ |
---|
| 25 | |
---|
| 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); |
---|
| 34 | |
---|
| 35 | /* --------- */ |
---|
| 36 | /* -- Min -- */ |
---|
| 37 | /* --------- */ |
---|
| 38 | |
---|
| 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); |
---|
| 44 | |
---|
| 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); |
---|
| 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 | |
---|
| 75 | /* --------- */ |
---|
| 76 | /* -- Max -- */ |
---|
| 77 | /* --------- */ |
---|
| 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 | |
---|
| 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); |
---|
| 89 | |
---|
| 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); |
---|
| 95 | |
---|
| 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 | |
---|
| 114 | /* ----------- */ |
---|
| 115 | /* -- Other -- */ |
---|
| 116 | /* ----------- */ |
---|
| 117 | |
---|
| 118 | ROUTINE(byte) ibit(int32 x, int n); |
---|
| 119 | ROUTINE(int32) sym_int32(int32 x); |
---|
| 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); |
---|
| 124 | |
---|
| 125 | #ifdef __cplusplus |
---|
| 126 | } |
---|
| 127 | #endif |
---|
| 128 | |
---|
| 129 | #else |
---|
| 130 | //#pragma message(" Warning : attempt to re-include nrarith0.h") |
---|
| 131 | #endif |
---|
| 132 | |
---|