Ignore:
Timestamp:
May 6, 2016, 3:06:29 PM (8 years ago)
Author:
meunier
Message:
  • Added several versions of rosenfeld: { SLOW, FAST } x { FEATURES, NO_FEATURES }
  • Added native linux compilation support
  • Added a script to check results natively
  • Started to refactor nrc code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/rosenfeld/nrc2/include/nrarith2.h

    r772 r821  
    1111#define _NRARITH2_H_
    1212
    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"
    2314
    2415/* ------------------ */
     
    2617/* ------------------ */
    2718
    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) \
     20t short_name(t,min_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch)
     21
     22min_type_matrix(int8_t);
     23min_type_matrix(uint8_t);
     24min_type_matrix(int16_t);
     25min_type_matrix(uint16_t);
     26min_type_matrix(int32_t);
     27min_type_matrix(uint32_t);
     28min_type_matrix(int64_t);
     29min_type_matrix(uint64_t);
     30min_type_matrix(float);
     31min_type_matrix(double);
     32
    3833
    3934/* ------------------ */
     
    4136/* ------------------ */
    4237
    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) \
     39t short_name(t,max_,matrix)(t ** m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch)
     40
     41max_type_matrix(int8_t);
     42max_type_matrix(uint8_t);
     43max_type_matrix(int16_t);
     44max_type_matrix(uint16_t);
     45max_type_matrix(int32_t);
     46max_type_matrix(uint32_t);
     47max_type_matrix(int64_t);
     48max_type_matrix(uint64_t);
     49max_type_matrix(float);
     50max_type_matrix(double);
     51
    5352
    5453/* ------------------ */
     
    5655/* ------------------ */
    5756
    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) \
     58void short_name(t,add_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** Y, t ** Z)
     59
     60add_type_matrix(int8_t);
     61add_type_matrix(uint8_t);
     62add_type_matrix(int16_t);
     63add_type_matrix(uint16_t);
     64add_type_matrix(int32_t);
     65add_type_matrix(uint32_t);
     66add_type_matrix(int64_t);
     67add_type_matrix(uint64_t);
     68add_type_matrix(float);
     69add_type_matrix(double);
     70
     71void add_rgb8matrix (rgb8  ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8  ** Y, rgb8  ** Z);
     72void add_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 ** Y, rgbx8 ** Z);
     73
    7274
    7375/* -------------------- */
     
    7577/* -------------------- */
    7678
    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) \
     80void short_name(t,addc_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t y, t ** Z)
     81
     82addc_type_matrix(int8_t);
     83addc_type_matrix(uint8_t);
     84addc_type_matrix(int16_t);
     85addc_type_matrix(uint16_t);
     86addc_type_matrix(int32_t);
     87addc_type_matrix(uint32_t);
     88addc_type_matrix(int64_t);
     89addc_type_matrix(uint64_t);
     90addc_type_matrix(float);
     91addc_type_matrix(double);
     92
     93void addc_rgb8matrix (rgb8  ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8  y, rgb8  ** Z);
     94void addc_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 y, rgbx8 ** Z);
     95
    9196
    9297/* ----------- */
     
    9499/* ----------- */
    95100
    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) \
     102void short_name(t,sub_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t ** Y, t ** Z)
     103
     104sub_type_matrix(int8_t);
     105sub_type_matrix(uint8_t);
     106sub_type_matrix(int16_t);
     107sub_type_matrix(uint16_t);
     108sub_type_matrix(int32_t);
     109sub_type_matrix(uint32_t);
     110sub_type_matrix(int64_t);
     111sub_type_matrix(uint64_t);
     112sub_type_matrix(float);
     113sub_type_matrix(double);
     114
     115void sub_rgb8matrix (rgb8  ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8  ** Y, rgb8  ** Z);
     116void sub_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 ** Y, rgbx8 ** Z);
     117
    110118
    111119/* --------------------- */
     
    113121/* --------------------- */
    114122
    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) \
     124void short_name(t,subc_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t y, t ** Z)
     125
     126subc_type_matrix(int8_t);
     127subc_type_matrix(uint8_t);
     128subc_type_matrix(int16_t);
     129subc_type_matrix(uint16_t);
     130subc_type_matrix(int32_t);
     131subc_type_matrix(uint32_t);
     132subc_type_matrix(int64_t);
     133subc_type_matrix(uint64_t);
     134subc_type_matrix(float);
     135subc_type_matrix(double);
     136
     137void subc_rgb8matrix (rgb8  ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8  y, rgb8  ** Z);
     138void 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 --- */
    132142/* --------------------- */
    133143
    134144// 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) \
     147void short_name(t,mulc_,matrix)(t ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, t y, t ** Z)
     148
     149mulc_type_matrix(int8_t);
     150mulc_type_matrix(uint8_t);
     151mulc_type_matrix(int16_t);
     152mulc_type_matrix(uint16_t);
     153mulc_type_matrix(int32_t);
     154mulc_type_matrix(uint32_t);
     155mulc_type_matrix(int64_t);
     156mulc_type_matrix(uint64_t);
     157mulc_type_matrix(float);
     158mulc_type_matrix(double);
     159
     160void mulc_rgb8matrix (rgb8  ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb8  y, rgb8  ** Z);
     161void mulc_rgbx8matrix(rgbx8 ** X, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx8 y, rgbx8 ** Z);
     162
    149163
    150164/* --------------- */
    151165/* --- MulFrac --- */
    152166/* --------------- */
    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) \
     171void 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
     174mulfrac_type_matrix(int8_t);
     175mulfrac_type_matrix(uint8_t);
     176mulfrac_type_matrix(int16_t);
     177mulfrac_type_matrix(uint16_t);
     178mulfrac_type_matrix(int32_t);
     179mulfrac_type_matrix(uint32_t);
     180mulfrac_type_matrix(int64_t);
     181mulfrac_type_matrix(uint64_t);
     182mulfrac_type_matrix(float);
     183mulfrac_type_matrix(double);
     184
     185void mulfrack_rgb8matrix (rgb8  ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32 a, int32 b, rgb8  ** m2);
     186void mulfrack_rgbx8matrix(rgbx8 ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32 a, int32 b, rgbx8 ** m2);
     187
    164188
    165189/* ---------------- */
    166190/* --- MulShift --- */
    167191/* ---------------- */
    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) \
     195void 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
     198mulshift_type_matrix(int8_t);
     199mulshift_type_matrix(uint8_t);
     200mulshift_type_matrix(int16_t);
     201mulshift_type_matrix(uint16_t);
     202mulshift_type_matrix(int32_t);
     203mulshift_type_matrix(uint32_t);
     204mulshift_type_matrix(int64_t);
     205mulshift_type_matrix(uint64_t);
     206mulshift_type_matrix(float);
     207mulshift_type_matrix(double);
     208
     209void mulshift_rgb8matrix (rgb8  **m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgb32  a, rgb32  s, rgb8  ** m2);
     210void mulshift_rgbx8matrix(rgbx8 **m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, rgbx32 a, rgbx32 s, rgbx8 ** m2);
     211
     212void mulshiftk_rgb8matrix (rgb8  ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32 a, int32 s, rgb8  ** m2);
     213void mulshiftk_rgbx8matrix(rgbx8 ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32 a, int32 s, rgbx8 ** m2);
     214
     215void quadratic_error_si16matrix(sint16 ** m1, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, sint16 ** m2, sint16 ** m3);
     216
    186217
    187218#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
Note: See TracChangeset for help on using the changeset viewer.