00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <flgrCoreData.h>
00022 #include <flgrCoreIO.h>
00023 #include <flgrCoreCopy.h>
00024 #include <flgrCoreShift.h>
00025 #include <flgrCoreDispatch.h>
00026 #include <flgrCoreReplace.h>
00027 #include <flgrArith.h>
00028 #include "flgrMorphoSkizFast.h"
00029
00030
00031 #ifdef __SSE2__
00032 #include <emmintrin.h>
00033 #endif
00034
00035 #if defined(__SSE__) && defined(__MMX__)
00036 #include <xmmintrin.h>
00037 #include <mmintrin.h>
00038 #endif
00039
00040 #define rep_dil(pcenter,pdil,pnx) (((*pcenter != *pdil) && (*pnx != 0) && (*pnx != *pdil)) ? 0 : *pdil)
00041
00042 #define FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6 \
00043 int i; \
00044 \
00045 for(i=0 ; i<length ; i++) { \
00046 if(pcenter[i] != pdil[i] ) { \
00047 if((pn3[i] != 0) && (pn3[i] != pdil[i]) && (i!=0)) { \
00048 pdil[i] = 0; continue; \
00049 } \
00050 if((pn4[i] != 0) && (pn4[i] != pdil[i])) { \
00051 pdil[i] = 0; continue; \
00052 } \
00053 if((pn5[i] != 0) && (pn5[i] != pdil[i]) && (i!=length-1)) { \
00054 pdil[i] = 0; continue; \
00055 } \
00056 if((pn6[i] != 0) && (pn6[i] != pdil[i]) && (i!=0)) { \
00057 pdil[i] = 0; continue; \
00058 } \
00059 if((pn7[i] != 0) && (pn7[i] != pdil[i])) { \
00060 pdil[i] = 0; continue; \
00061 } \
00062 if((pn8[i] != 0) && (pn8[i] != pdil[i]) && (i!=length-1)) { \
00063 pdil[i] = 0; continue; \
00064 } \
00065 } \
00066 } \
00067 ;
00068
00069
00070
00071 #define FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9 \
00072 int i; \
00073 \
00074 for(i=0 ; i<length ; i++) { \
00075 if(pcenter[i] != pdil[i] ) { \
00076 if((pn0[i] != 0) && (pn0[i] != pdil[i]) && (i!=0)) { \
00077 pdil[i] = 0; continue; \
00078 } \
00079 if((pn1[i] != 0) && (pn1[i] != pdil[i])) { \
00080 pdil[i] = 0; continue; \
00081 } \
00082 if((pn2[i] != 0) && (pn2[i] != pdil[i]) && (i!=length-1)) { \
00083 pdil[i] = 0; continue; \
00084 } \
00085 if((pn3[i] != 0) && (pn3[i] != pdil[i]) && (i!=0)) { \
00086 pdil[i] = 0; continue; \
00087 } \
00088 if((pn4[i] != 0) && (pn4[i] != pdil[i])) { \
00089 pdil[i] = 0; continue; \
00090 } \
00091 if((pn5[i] != 0) && (pn5[i] != pdil[i]) && (i!=length-1)) { \
00092 pdil[i] = 0; continue; \
00093 } \
00094 if((pn6[i] != 0) && (pn6[i] != pdil[i]) && (i!=0)) { \
00095 pdil[i] = 0; continue; \
00096 } \
00097 if((pn7[i] != 0) && (pn7[i] != pdil[i])) { \
00098 pdil[i] = 0; continue; \
00099 } \
00100 if((pn8[i] != 0) && (pn8[i] != pdil[i]) && (i!=length-1)) { \
00101 pdil[i] = 0; continue; \
00102 } \
00103 } \
00104 } \
00105 ;
00106
00107
00108
00109 #define FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(vtype,vsize, \
00110 cmp_instr,set1_instr, \
00111 and_instr,or_instr) \
00112 int i; \
00113 vtype vec_pnx; \
00114 vtype vec_center; \
00115 vtype vec_dil; \
00116 vtype vec_cmp1; \
00117 vtype vec_cmp2; \
00118 vtype vec_zero = set1_instr(0); \
00119 \
00120 *pdil = rep_dil(pcenter,pdil,pn4); \
00121 *pdil = rep_dil(pcenter,pdil,pn5); \
00122 *pdil = rep_dil(pcenter,pdil,pn7); \
00123 *pdil = rep_dil(pcenter,pdil,pn8); \
00124 \
00125 pcenter++; \
00126 pdil++; \
00127 pn3++; \
00128 pn4++; \
00129 pn5++; \
00130 pn6++; \
00131 pn7++; \
00132 pn8++; \
00133 \
00134 for(i=1 ; i<vsize ; i++) { \
00135 *pdil = rep_dil(pcenter,pdil,pn3); \
00136 *pdil = rep_dil(pcenter,pdil,pn4); \
00137 *pdil = rep_dil(pcenter,pdil,pn5); \
00138 *pdil = rep_dil(pcenter,pdil,pn6); \
00139 *pdil = rep_dil(pcenter,pdil,pn7); \
00140 *pdil = rep_dil(pcenter,pdil,pn8); \
00141 pdil++; \
00142 pcenter++; \
00143 pn3++; \
00144 pn4++; \
00145 pn5++; \
00146 pn6++; \
00147 pn7++; \
00148 pn8++; \
00149 } \
00150 \
00151 for(i=vsize ; i<length-vsize ; i+=vsize) { \
00152 vec_center = *((vtype*) pcenter); \
00153 vec_dil = *((vtype*) pdil); \
00154 vec_cmp1 = cmp_instr(vec_center,vec_dil); \
00155 \
00156 vec_pnx = *((vtype*) pn3); \
00157 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00158 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00159 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00160 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00161 vec_dil = and_instr(vec_pnx,vec_dil); \
00162 \
00163 vec_pnx = *((vtype*) pn4); \
00164 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00165 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00166 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00167 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00168 vec_dil = and_instr(vec_pnx,vec_dil); \
00169 \
00170 vec_pnx = *((vtype*) pn5); \
00171 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00172 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00173 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00174 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00175 vec_dil = and_instr(vec_pnx,vec_dil); \
00176 \
00177 vec_pnx = *((vtype*) pn6); \
00178 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00179 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00180 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00181 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00182 vec_dil = and_instr(vec_pnx,vec_dil); \
00183 \
00184 vec_pnx = *((vtype*) pn7); \
00185 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00186 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00187 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00188 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00189 vec_dil = and_instr(vec_pnx,vec_dil); \
00190 \
00191 vec_pnx = *((vtype*) pn8); \
00192 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00193 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00194 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00195 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00196 vec_dil = and_instr(vec_pnx,vec_dil); \
00197 \
00198 *((vtype*) pdil)=vec_dil; \
00199 \
00200 pcenter += vsize; \
00201 pdil += vsize; \
00202 pn3 += vsize; \
00203 pn4 += vsize; \
00204 pn5 += vsize; \
00205 pn6 += vsize; \
00206 pn7 += vsize; \
00207 pn8 += vsize; \
00208 } \
00209 \
00210 for( ; i<length-1 ; i++) { \
00211 *pdil = rep_dil(pcenter,pdil,pn3); \
00212 *pdil = rep_dil(pcenter,pdil,pn4); \
00213 *pdil = rep_dil(pcenter,pdil,pn5); \
00214 *pdil = rep_dil(pcenter,pdil,pn6); \
00215 *pdil = rep_dil(pcenter,pdil,pn7); \
00216 *pdil = rep_dil(pcenter,pdil,pn8); \
00217 pdil++; \
00218 pcenter++; \
00219 pn3++; \
00220 pn4++; \
00221 pn5++; \
00222 pn6++; \
00223 pn7++; \
00224 pn8++; \
00225 } \
00226 \
00227 *pdil = rep_dil(pcenter,pdil,pn3); \
00228 *pdil = rep_dil(pcenter,pdil,pn4); \
00229 *pdil = rep_dil(pcenter,pdil,pn6); \
00230 *pdil = rep_dil(pcenter,pdil,pn7)
00231
00232
00233 #define FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(vtype,vsize, \
00234 cmp_instr,set1_instr, \
00235 and_instr,or_instr) \
00236 int i; \
00237 vtype vec_pnx; \
00238 vtype vec_center; \
00239 vtype vec_dil; \
00240 vtype vec_cmp1; \
00241 vtype vec_cmp2; \
00242 vtype vec_zero = set1_instr(0); \
00243 \
00244 *pdil = rep_dil(pcenter,pdil,pn1); \
00245 *pdil = rep_dil(pcenter,pdil,pn2); \
00246 *pdil = rep_dil(pcenter,pdil,pn4); \
00247 *pdil = rep_dil(pcenter,pdil,pn5); \
00248 *pdil = rep_dil(pcenter,pdil,pn7); \
00249 *pdil = rep_dil(pcenter,pdil,pn8); \
00250 \
00251 pcenter++; \
00252 pdil++; \
00253 pn0++; \
00254 pn1++; \
00255 pn2++; \
00256 pn3++; \
00257 pn4++; \
00258 pn5++; \
00259 pn6++; \
00260 pn7++; \
00261 pn8++; \
00262 \
00263 for(i=1 ; i<vsize ; i++) { \
00264 *pdil = rep_dil(pcenter,pdil,pn0); \
00265 *pdil = rep_dil(pcenter,pdil,pn1); \
00266 *pdil = rep_dil(pcenter,pdil,pn2); \
00267 *pdil = rep_dil(pcenter,pdil,pn3); \
00268 *pdil = rep_dil(pcenter,pdil,pn4); \
00269 *pdil = rep_dil(pcenter,pdil,pn5); \
00270 *pdil = rep_dil(pcenter,pdil,pn6); \
00271 *pdil = rep_dil(pcenter,pdil,pn7); \
00272 *pdil = rep_dil(pcenter,pdil,pn8); \
00273 pdil++; \
00274 pcenter++; \
00275 pn0++; \
00276 pn1++; \
00277 pn2++; \
00278 pn3++; \
00279 pn4++; \
00280 pn5++; \
00281 pn6++; \
00282 pn7++; \
00283 pn8++; \
00284 } \
00285 \
00286 for(i=vsize ; i<length-vsize ; i+=vsize) { \
00287 vec_center = *((vtype*) pcenter); \
00288 vec_dil = *((vtype*) pdil); \
00289 vec_cmp1 = cmp_instr(vec_center,vec_dil); \
00290 \
00291 vec_pnx = *((vtype*) pn0); \
00292 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00293 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00294 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00295 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00296 vec_dil = and_instr(vec_pnx,vec_dil); \
00297 \
00298 vec_pnx = *((vtype*) pn1); \
00299 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00300 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00301 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00302 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00303 vec_dil = and_instr(vec_pnx,vec_dil); \
00304 \
00305 vec_pnx = *((vtype*) pn2); \
00306 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00307 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00308 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00309 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00310 vec_dil = and_instr(vec_pnx,vec_dil); \
00311 \
00312 vec_pnx = *((vtype*) pn3); \
00313 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00314 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00315 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00316 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00317 vec_dil = and_instr(vec_pnx,vec_dil); \
00318 \
00319 vec_pnx = *((vtype*) pn4); \
00320 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00321 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00322 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00323 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00324 vec_dil = and_instr(vec_pnx,vec_dil); \
00325 \
00326 vec_pnx = *((vtype*) pn5); \
00327 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00328 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00329 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00330 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00331 vec_dil = and_instr(vec_pnx,vec_dil); \
00332 \
00333 vec_pnx = *((vtype*) pn6); \
00334 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00335 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00336 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00337 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00338 vec_dil = and_instr(vec_pnx,vec_dil); \
00339 \
00340 vec_pnx = *((vtype*) pn7); \
00341 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00342 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00343 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00344 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00345 vec_dil = and_instr(vec_pnx,vec_dil); \
00346 \
00347 vec_pnx = *((vtype*) pn8); \
00348 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00349 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00350 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00351 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00352 vec_dil = and_instr(vec_pnx,vec_dil); \
00353 \
00354 *((vtype*) pdil) = vec_dil; \
00355 \
00356 pcenter += vsize; \
00357 pdil += vsize; \
00358 pn0 += vsize; \
00359 pn1 += vsize; \
00360 pn2 += vsize; \
00361 pn3 += vsize; \
00362 pn4 += vsize; \
00363 pn5 += vsize; \
00364 pn6 += vsize; \
00365 pn7 += vsize; \
00366 pn8 += vsize; \
00367 } \
00368 \
00369 for( ; i<length-1 ; i++) { \
00370 *pdil = rep_dil(pcenter,pdil,pn0); \
00371 *pdil = rep_dil(pcenter,pdil,pn1); \
00372 *pdil = rep_dil(pcenter,pdil,pn2); \
00373 *pdil = rep_dil(pcenter,pdil,pn3); \
00374 *pdil = rep_dil(pcenter,pdil,pn4); \
00375 *pdil = rep_dil(pcenter,pdil,pn5); \
00376 *pdil = rep_dil(pcenter,pdil,pn6); \
00377 *pdil = rep_dil(pcenter,pdil,pn7); \
00378 *pdil = rep_dil(pcenter,pdil,pn8); \
00379 pdil++; \
00380 pcenter++; \
00381 pn0++; \
00382 pn1++; \
00383 pn2++; \
00384 pn3++; \
00385 pn4++; \
00386 pn5++; \
00387 pn6++; \
00388 pn7++; \
00389 pn8++; \
00390 } \
00391 \
00392 *pdil = rep_dil(pcenter,pdil,pn0); \
00393 *pdil = rep_dil(pcenter,pdil,pn1); \
00394 *pdil = rep_dil(pcenter,pdil,pn3); \
00395 *pdil = rep_dil(pcenter,pdil,pn4); \
00396 *pdil = rep_dil(pcenter,pdil,pn6); \
00397 *pdil = rep_dil(pcenter,pdil,pn7)
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411 inline void flgr_stop_label_collision_8_connex_6_fgUINT8(fgUINT8 *pn3, fgUINT8 *pn4, fgUINT8 *pn5,
00412 fgUINT8 *pn6, fgUINT8 *pn7, fgUINT8 *pn8,
00413 fgUINT8 *pdil, fgUINT8 *pcenter, int length) {
00414 #ifdef __SSE2__
00415 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m128i,16,
00416 _mm_cmpeq_epi8,_mm_set1_epi8,
00417 _mm_and_si128,_mm_or_si128);
00418 #else
00419 #if defined(__MMX__) && defined(__SSE__)
00420 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m64,8,
00421 _mm_cmpeq_pi8,_mm_set1_pi8,
00422 _mm_and_si64,_mm_or_si64);
00423 _mm_empty();
00424 #else
00425 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6;
00426 #endif
00427 #endif
00428 }
00429
00430
00431 inline void flgr_stop_label_collision_8_connex_9_fgUINT8(fgUINT8 *pn0, fgUINT8 *pn1, fgUINT8 *pn2,
00432 fgUINT8 *pn3, fgUINT8 *pn4, fgUINT8 *pn5,
00433 fgUINT8 *pn6, fgUINT8 *pn7, fgUINT8 *pn8,
00434 fgUINT8 *pdil, fgUINT8 *pcenter, int length) {
00435 #ifdef __SSE2__
00436 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m128i,16,
00437 _mm_cmpeq_epi8,_mm_set1_epi8,
00438 _mm_and_si128,_mm_or_si128);
00439
00440 #else
00441 #if defined(__MMX__) && defined(__SSE__)
00442 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m64,8,
00443 _mm_cmpeq_pi8,_mm_set1_pi8,
00444 _mm_and_si64,_mm_or_si64);
00445 _mm_empty();
00446 #else
00447 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9;
00448 #endif
00449 #endif
00450 }
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461 inline void flgr_stop_label_collision_8_connex_6_fgUINT16(fgUINT16 *pn3, fgUINT16 *pn4, fgUINT16 *pn5,
00462 fgUINT16 *pn6, fgUINT16 *pn7, fgUINT16 *pn8,
00463 fgUINT16 *pdil, fgUINT16 *pcenter, int length) {
00464 #ifdef __SSE2__
00465 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m128i,8,
00466 _mm_cmpeq_epi16,_mm_set1_epi16,
00467 _mm_and_si128,_mm_or_si128);
00468 #else
00469 #if defined(__MMX__) && defined(__SSE__)
00470 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m64,4,
00471 _mm_cmpeq_pi16,_mm_set1_pi16,
00472 _mm_and_si64,_mm_or_si64);
00473 _mm_empty();
00474
00475 #else
00476 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6;
00477 #endif
00478 #endif
00479 }
00480
00481
00482 inline void flgr_stop_label_collision_8_connex_9_fgUINT16(fgUINT16 *pn0, fgUINT16 *pn1, fgUINT16 *pn2,
00483 fgUINT16 *pn3, fgUINT16 *pn4, fgUINT16 *pn5,
00484 fgUINT16 *pn6, fgUINT16 *pn7, fgUINT16 *pn8,
00485 fgUINT16 *pdil, fgUINT16 *pcenter, int length) {
00486 #ifdef __SSE2__
00487 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m128i,8,
00488 _mm_cmpeq_epi16,_mm_set1_epi16,
00489 _mm_and_si128,_mm_or_si128);
00490 #else
00491 #if defined(__MMX__) && defined(__SSE__)
00492 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m64,4,
00493 _mm_cmpeq_pi16,_mm_set1_pi16,
00494 _mm_and_si64,_mm_or_si64);
00495 _mm_empty();
00496
00497 #else
00498 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9;
00499 #endif
00500 #endif
00501 }
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511 inline void flgr_stop_label_collision_8_connex_6_fgUINT32(fgUINT32 *pn3, fgUINT32 *pn4, fgUINT32 *pn5,
00512 fgUINT32 *pn6, fgUINT32 *pn7, fgUINT32 *pn8,
00513 fgUINT32 *pdil, fgUINT32 *pcenter, int length) {
00514 #ifdef __SSE2__
00515 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m128i,4,
00516 _mm_cmpeq_epi32,_mm_set1_epi32,
00517 _mm_and_si128,_mm_or_si128);
00518 #else
00519 #if defined(__MMX__) && defined(__SSE__)
00520 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m64,2,
00521 _mm_cmpeq_pi32,_mm_set1_pi32,
00522 _mm_and_si64,_mm_or_si64);
00523 _mm_empty();
00524
00525 #else
00526 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6;
00527 #endif
00528 #endif
00529 }
00530
00531
00532 inline void flgr_stop_label_collision_8_connex_9_fgUINT32(fgUINT32 *pn0, fgUINT32 *pn1, fgUINT32 *pn2,
00533 fgUINT32 *pn3, fgUINT32 *pn4, fgUINT32 *pn5,
00534 fgUINT32 *pn6, fgUINT32 *pn7, fgUINT32 *pn8,
00535 fgUINT32 *pdil, fgUINT32 *pcenter, int length) {
00536 #ifdef __SSE2__
00537 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m128i,4,
00538 _mm_cmpeq_epi32,_mm_set1_epi32,
00539 _mm_and_si128,_mm_or_si128);
00540 #else
00541 #if defined(__MMX__) && defined(__SSE__)
00542 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m64,2,
00543 _mm_cmpeq_pi32,_mm_set1_pi32,
00544 _mm_and_si64,_mm_or_si64);
00545 _mm_empty();
00546
00547 #else
00548 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9;
00549 #endif
00550 #endif
00551 }
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572 inline void flgr_stop_label_collision_8_connex_6_fgINT8(fgINT8 *pn3, fgINT8 *pn4, fgINT8 *pn5,
00573 fgINT8 *pn6, fgINT8 *pn7, fgINT8 *pn8,
00574 fgINT8 *pdil, fgINT8 *pcenter, int length) {
00575 #ifdef __SSE2__
00576 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m128i,16,
00577 _mm_cmpeq_epi8,_mm_set1_epi8,
00578 _mm_and_si128,_mm_or_si128);
00579 #else
00580 #if defined(__MMX__) && defined(__SSE__)
00581 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m64,8,
00582 _mm_cmpeq_pi8,_mm_set1_pi8,
00583 _mm_and_si64,_mm_or_si64);
00584 _mm_empty();
00585 #else
00586 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6;
00587 #endif
00588 #endif
00589 }
00590
00591
00592 inline void flgr_stop_label_collision_8_connex_9_fgINT8(fgINT8 *pn0, fgINT8 *pn1, fgINT8 *pn2,
00593 fgINT8 *pn3, fgINT8 *pn4, fgINT8 *pn5,
00594 fgINT8 *pn6, fgINT8 *pn7, fgINT8 *pn8,
00595 fgINT8 *pdil, fgINT8 *pcenter, int length) {
00596 #ifdef __SSE2__
00597 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m128i,16,
00598 _mm_cmpeq_epi8,_mm_set1_epi8,
00599 _mm_and_si128,_mm_or_si128);
00600
00601 #else
00602 #if defined(__MMX__) && defined(__SSE__)
00603 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m64,8,
00604 _mm_cmpeq_pi8,_mm_set1_pi8,
00605 _mm_and_si64,_mm_or_si64);
00606 _mm_empty();
00607 #else
00608 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9;
00609 #endif
00610 #endif
00611 }
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622 inline void flgr_stop_label_collision_8_connex_6_fgINT16(fgINT16 *pn3, fgINT16 *pn4, fgINT16 *pn5,
00623 fgINT16 *pn6, fgINT16 *pn7, fgINT16 *pn8,
00624 fgINT16 *pdil, fgINT16 *pcenter, int length) {
00625 #ifdef __SSE2__
00626 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m128i,8,
00627 _mm_cmpeq_epi16,_mm_set1_epi16,
00628 _mm_and_si128,_mm_or_si128);
00629 #else
00630 #if defined(__MMX__) && defined(__SSE__)
00631 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m64,4,
00632 _mm_cmpeq_pi16,_mm_set1_pi16,
00633 _mm_and_si64,_mm_or_si64);
00634 _mm_empty();
00635
00636 #else
00637 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6;
00638 #endif
00639 #endif
00640 }
00641
00642
00643 inline void flgr_stop_label_collision_8_connex_9_fgINT16(fgINT16 *pn0, fgINT16 *pn1, fgINT16 *pn2,
00644 fgINT16 *pn3, fgINT16 *pn4, fgINT16 *pn5,
00645 fgINT16 *pn6, fgINT16 *pn7, fgINT16 *pn8,
00646 fgINT16 *pdil, fgINT16 *pcenter, int length) {
00647 #ifdef __SSE2__
00648 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m128i,8,
00649 _mm_cmpeq_epi16,_mm_set1_epi16,
00650 _mm_and_si128,_mm_or_si128);
00651 #else
00652 #if defined(__MMX__) && defined(__SSE__)
00653 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m64,4,
00654 _mm_cmpeq_pi16,_mm_set1_pi16,
00655 _mm_and_si64,_mm_or_si64);
00656 _mm_empty();
00657
00658 #else
00659 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9;
00660 #endif
00661 #endif
00662 }
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672 inline void flgr_stop_label_collision_8_connex_6_fgINT32(fgINT32 *pn3, fgINT32 *pn4, fgINT32 *pn5,
00673 fgINT32 *pn6, fgINT32 *pn7, fgINT32 *pn8,
00674 fgINT32 *pdil, fgINT32 *pcenter, int length) {
00675 #ifdef __SSE2__
00676 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m128i,4,
00677 _mm_cmpeq_epi32,_mm_set1_epi32,
00678 _mm_and_si128,_mm_or_si128);
00679 #else
00680 #if defined(__MMX__) && defined(__SSE__)
00681 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6_SIMD(__m64,2,
00682 _mm_cmpeq_pi32,_mm_set1_pi32,
00683 _mm_and_si64,_mm_or_si64);
00684 _mm_empty();
00685
00686 #else
00687 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6;
00688 #endif
00689 #endif
00690 }
00691
00692
00693 inline void flgr_stop_label_collision_8_connex_9_fgINT32(fgINT32 *pn0, fgINT32 *pn1, fgINT32 *pn2,
00694 fgINT32 *pn3, fgINT32 *pn4, fgINT32 *pn5,
00695 fgINT32 *pn6, fgINT32 *pn7, fgINT32 *pn8,
00696 fgINT32 *pdil, fgINT32 *pcenter, int length) {
00697 #ifdef __SSE2__
00698 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m128i,4,
00699 _mm_cmpeq_epi32,_mm_set1_epi32,
00700 _mm_and_si128,_mm_or_si128);
00701 #else
00702 #if defined(__MMX__) && defined(__SSE__)
00703 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9_SIMD(__m64,2,
00704 _mm_cmpeq_pi32,_mm_set1_pi32,
00705 _mm_and_si64,_mm_or_si64);
00706 _mm_empty();
00707
00708 #else
00709 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9;
00710 #endif
00711 #endif
00712 }
00713
00714
00715
00716
00717
00718
00719
00720
00721 inline void flgr_stop_label_collision_8_connex_6_fgFLOAT32(fgFLOAT32 *pn3, fgFLOAT32 *pn4, fgFLOAT32 *pn5,
00722 fgFLOAT32 *pn6, fgFLOAT32 *pn7, fgFLOAT32 *pn8,
00723 fgFLOAT32 *pdil, fgFLOAT32 *pcenter, int length) {
00724 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6;
00725 }
00726
00727
00728 inline void flgr_stop_label_collision_8_connex_9_fgFLOAT32(fgFLOAT32 *pn0, fgFLOAT32 *pn1, fgFLOAT32 *pn2,
00729 fgFLOAT32 *pn3, fgFLOAT32 *pn4, fgFLOAT32 *pn5,
00730 fgFLOAT32 *pn6, fgFLOAT32 *pn7, fgFLOAT32 *pn8,
00731 fgFLOAT32 *pdil, fgFLOAT32 *pcenter, int length) {
00732 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9;
00733 }
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743 inline void flgr_stop_label_collision_8_connex_6_fgFLOAT64(fgFLOAT64 *pn3, fgFLOAT64 *pn4, fgFLOAT64 *pn5,
00744 fgFLOAT64 *pn6, fgFLOAT64 *pn7, fgFLOAT64 *pn8,
00745 fgFLOAT64 *pdil, fgFLOAT64 *pcenter, int length) {
00746 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_6;
00747 }
00748
00749
00750 inline void flgr_stop_label_collision_8_connex_9_fgFLOAT64(fgFLOAT64 *pn0, fgFLOAT64 *pn1, fgFLOAT64 *pn2,
00751 fgFLOAT64 *pn3, fgFLOAT64 *pn4, fgFLOAT64 *pn5,
00752 fgFLOAT64 *pn6, fgFLOAT64 *pn7, fgFLOAT64 *pn8,
00753 fgFLOAT64 *pdil, fgFLOAT64 *pcenter, int length) {
00754 FLGR_MACRO_STOP_LABEL_COLLISION_8_CONNEX_9;
00755 }
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792 #define FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6 \
00793 int i; \
00794 \
00795 for(i=0 ; i<length ; i++) { \
00796 if(pcenter[i] != pdil[i] ) { \
00797 if((pn3[i] != 0) && (pn3[i] != pdil[i]) && (i!=0)) { \
00798 pdil[i] = 0; continue; \
00799 } \
00800 if((pn4[i] != 0) && (pn4[i] != pdil[i])) { \
00801 pdil[i] = 0; continue; \
00802 } \
00803 if((pn5[i] != 0) && (pn5[i] != pdil[i]) && (i!=length-1)) { \
00804 pdil[i] = 0; continue; \
00805 } \
00806 if((pn7[i] != 0) && (pn7[i] != pdil[i])) { \
00807 pdil[i] = 0; continue; \
00808 } \
00809 if((pn8[i] != 0) && (pn8[i] != pdil[i]) && (i!=length-1)) { \
00810 pdil[i] = 0; continue; \
00811 } \
00812 } \
00813 } \
00814 ;
00815
00816
00817
00818 #define FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9 \
00819 int i; \
00820 \
00821 for(i=0 ; i<length ; i++) { \
00822 if(pcenter[i] != pdil[i] ) { \
00823 if((pn1[i] != 0) && (pn1[i] != pdil[i])) { \
00824 pdil[i] = 0; continue; \
00825 } \
00826 if((pn2[i] != 0) && (pn2[i] != pdil[i]) && (i!=length-1)) { \
00827 pdil[i] = 0; continue; \
00828 } \
00829 if((pn3[i] != 0) && (pn3[i] != pdil[i]) && (i!=0)) { \
00830 pdil[i] = 0; continue; \
00831 } \
00832 if((pn4[i] != 0) && (pn4[i] != pdil[i])) { \
00833 pdil[i] = 0; continue; \
00834 } \
00835 if((pn5[i] != 0) && (pn5[i] != pdil[i]) && (i!=length-1)) { \
00836 pdil[i] = 0; continue; \
00837 } \
00838 if((pn7[i] != 0) && (pn7[i] != pdil[i])) { \
00839 pdil[i] = 0; continue; \
00840 } \
00841 if((pn8[i] != 0) && (pn8[i] != pdil[i]) && (i!=length-1)) { \
00842 pdil[i] = 0; continue; \
00843 } \
00844 } \
00845 } \
00846 ;
00847
00848
00849
00850
00851 #define FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(vtype,vsize, \
00852 cmp_instr,set1_instr, \
00853 and_instr,or_instr) \
00854 int i; \
00855 vtype vec_pnx; \
00856 vtype vec_center; \
00857 vtype vec_dil; \
00858 vtype vec_cmp1; \
00859 vtype vec_cmp2; \
00860 vtype vec_zero = set1_instr(0); \
00861 \
00862 *pdil = rep_dil(pcenter,pdil,pn4); \
00863 *pdil = rep_dil(pcenter,pdil,pn5); \
00864 *pdil = rep_dil(pcenter,pdil,pn7); \
00865 *pdil = rep_dil(pcenter,pdil,pn8); \
00866 \
00867 pcenter++; \
00868 pdil++; \
00869 pn3++; \
00870 pn4++; \
00871 pn5++; \
00872 pn7++; \
00873 pn8++; \
00874 \
00875 for(i=1 ; i<vsize ; i++) { \
00876 *pdil = rep_dil(pcenter,pdil,pn3); \
00877 *pdil = rep_dil(pcenter,pdil,pn4); \
00878 *pdil = rep_dil(pcenter,pdil,pn5); \
00879 *pdil = rep_dil(pcenter,pdil,pn7); \
00880 *pdil = rep_dil(pcenter,pdil,pn8); \
00881 pdil++; \
00882 pcenter++; \
00883 pn3++; \
00884 pn4++; \
00885 pn5++; \
00886 pn7++; \
00887 pn8++; \
00888 } \
00889 \
00890 for(i=vsize ; i<length-vsize ; i+=vsize) { \
00891 vec_center = *((vtype*) pcenter); \
00892 vec_dil = *((vtype*) pdil); \
00893 vec_cmp1 = cmp_instr(vec_center,vec_dil); \
00894 \
00895 vec_pnx = *((vtype*) pn3); \
00896 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00897 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00898 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00899 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00900 vec_dil = and_instr(vec_pnx,vec_dil); \
00901 \
00902 vec_pnx = *((vtype*) pn4); \
00903 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00904 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00905 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00906 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00907 vec_dil = and_instr(vec_pnx,vec_dil); \
00908 \
00909 vec_pnx = *((vtype*) pn5); \
00910 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00911 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00912 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00913 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00914 vec_dil = and_instr(vec_pnx,vec_dil); \
00915 \
00916 vec_pnx = *((vtype*) pn7); \
00917 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00918 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00919 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00920 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00921 vec_dil = and_instr(vec_pnx,vec_dil); \
00922 \
00923 vec_pnx = *((vtype*) pn8); \
00924 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
00925 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
00926 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
00927 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
00928 vec_dil = and_instr(vec_pnx,vec_dil); \
00929 \
00930 *((vtype*) pdil)=vec_dil; \
00931 \
00932 pcenter += vsize; \
00933 pdil += vsize; \
00934 pn3 += vsize; \
00935 pn4 += vsize; \
00936 pn5 += vsize; \
00937 pn7 += vsize; \
00938 pn8 += vsize; \
00939 } \
00940 \
00941 for( ; i<length-1 ; i++) { \
00942 *pdil = rep_dil(pcenter,pdil,pn3); \
00943 *pdil = rep_dil(pcenter,pdil,pn4); \
00944 *pdil = rep_dil(pcenter,pdil,pn5); \
00945 *pdil = rep_dil(pcenter,pdil,pn7); \
00946 *pdil = rep_dil(pcenter,pdil,pn8); \
00947 pdil++; \
00948 pcenter++; \
00949 pn3++; \
00950 pn4++; \
00951 pn5++; \
00952 pn7++; \
00953 pn8++; \
00954 } \
00955 \
00956 *pdil = rep_dil(pcenter,pdil,pn3); \
00957 *pdil = rep_dil(pcenter,pdil,pn4); \
00958 *pdil = rep_dil(pcenter,pdil,pn7)
00959
00960
00961 #define FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(vtype,vsize, \
00962 cmp_instr,set1_instr, \
00963 and_instr,or_instr) \
00964 int i; \
00965 vtype vec_pnx; \
00966 vtype vec_center; \
00967 vtype vec_dil; \
00968 vtype vec_cmp1; \
00969 vtype vec_cmp2; \
00970 vtype vec_zero = set1_instr(0); \
00971 \
00972 *pdil = rep_dil(pcenter,pdil,pn1); \
00973 *pdil = rep_dil(pcenter,pdil,pn2); \
00974 *pdil = rep_dil(pcenter,pdil,pn4); \
00975 *pdil = rep_dil(pcenter,pdil,pn5); \
00976 *pdil = rep_dil(pcenter,pdil,pn7); \
00977 *pdil = rep_dil(pcenter,pdil,pn8); \
00978 \
00979 pcenter++; \
00980 pdil++; \
00981 pn1++; \
00982 pn2++; \
00983 pn3++; \
00984 pn4++; \
00985 pn5++; \
00986 pn7++; \
00987 pn8++; \
00988 \
00989 for(i=1 ; i<vsize ; i++) { \
00990 *pdil = rep_dil(pcenter,pdil,pn1); \
00991 *pdil = rep_dil(pcenter,pdil,pn2); \
00992 *pdil = rep_dil(pcenter,pdil,pn3); \
00993 *pdil = rep_dil(pcenter,pdil,pn4); \
00994 *pdil = rep_dil(pcenter,pdil,pn5); \
00995 *pdil = rep_dil(pcenter,pdil,pn7); \
00996 *pdil = rep_dil(pcenter,pdil,pn8); \
00997 pdil++; \
00998 pcenter++; \
00999 pn1++; \
01000 pn2++; \
01001 pn3++; \
01002 pn4++; \
01003 pn5++; \
01004 pn7++; \
01005 pn8++; \
01006 } \
01007 \
01008 for(i=vsize ; i<length-vsize ; i+=vsize) { \
01009 vec_center = *((vtype*) pcenter); \
01010 vec_dil = *((vtype*) pdil); \
01011 vec_cmp1 = cmp_instr(vec_center,vec_dil); \
01012 \
01013 vec_pnx = *((vtype*) pn1); \
01014 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01015 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01016 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01017 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01018 vec_dil = and_instr(vec_pnx,vec_dil); \
01019 \
01020 vec_pnx = *((vtype*) pn2); \
01021 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01022 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01023 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01024 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01025 vec_dil = and_instr(vec_pnx,vec_dil); \
01026 \
01027 vec_pnx = *((vtype*) pn3); \
01028 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01029 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01030 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01031 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01032 vec_dil = and_instr(vec_pnx,vec_dil); \
01033 \
01034 vec_pnx = *((vtype*) pn4); \
01035 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01036 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01037 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01038 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01039 vec_dil = and_instr(vec_pnx,vec_dil); \
01040 \
01041 vec_pnx = *((vtype*) pn5); \
01042 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01043 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01044 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01045 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01046 vec_dil = and_instr(vec_pnx,vec_dil); \
01047 \
01048 vec_pnx = *((vtype*) pn7); \
01049 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01050 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01051 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01052 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01053 vec_dil = and_instr(vec_pnx,vec_dil); \
01054 \
01055 vec_pnx = *((vtype*) pn8); \
01056 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01057 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01058 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01059 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01060 vec_dil = and_instr(vec_pnx,vec_dil); \
01061 \
01062 *((vtype*) pdil) = vec_dil; \
01063 \
01064 pcenter += vsize; \
01065 pdil += vsize; \
01066 pn1 += vsize; \
01067 pn2 += vsize; \
01068 pn3 += vsize; \
01069 pn4 += vsize; \
01070 pn5 += vsize; \
01071 pn7 += vsize; \
01072 pn8 += vsize; \
01073 } \
01074 \
01075 for( ; i<length-1 ; i++) { \
01076 *pdil = rep_dil(pcenter,pdil,pn1); \
01077 *pdil = rep_dil(pcenter,pdil,pn2); \
01078 *pdil = rep_dil(pcenter,pdil,pn3); \
01079 *pdil = rep_dil(pcenter,pdil,pn4); \
01080 *pdil = rep_dil(pcenter,pdil,pn5); \
01081 *pdil = rep_dil(pcenter,pdil,pn7); \
01082 *pdil = rep_dil(pcenter,pdil,pn8); \
01083 pdil++; \
01084 pcenter++; \
01085 pn1++; \
01086 pn2++; \
01087 pn3++; \
01088 pn4++; \
01089 pn5++; \
01090 pn7++; \
01091 pn8++; \
01092 } \
01093 \
01094 *pdil = rep_dil(pcenter,pdil,pn1); \
01095 *pdil = rep_dil(pcenter,pdil,pn3); \
01096 *pdil = rep_dil(pcenter,pdil,pn4); \
01097 *pdil = rep_dil(pcenter,pdil,pn7)
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108 inline void flgr_stop_label_collision_6_connex_p1_6_fgUINT8(fgUINT8 *pn3, fgUINT8 *pn4, fgUINT8 *pn5,
01109 fgUINT8 *pn7, fgUINT8 *pn8,
01110 fgUINT8 *pdil, fgUINT8 *pcenter, int length) {
01111 #ifdef __SSE2__
01112 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m128i,16,
01113 _mm_cmpeq_epi8,_mm_set1_epi8,
01114 _mm_and_si128,_mm_or_si128);
01115 #else
01116 #if defined(__MMX__) && defined(__SSE__)
01117 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m64,8,
01118 _mm_cmpeq_pi8,_mm_set1_pi8,
01119 _mm_and_si64,_mm_or_si64);
01120 _mm_empty();
01121 #else
01122 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6;
01123 #endif
01124 #endif
01125 }
01126
01127
01128 inline void flgr_stop_label_collision_6_connex_p1_9_fgUINT8(fgUINT8 *pn1, fgUINT8 *pn2,
01129 fgUINT8 *pn3, fgUINT8 *pn4, fgUINT8 *pn5,
01130 fgUINT8 *pn7, fgUINT8 *pn8,
01131 fgUINT8 *pdil, fgUINT8 *pcenter, int length) {
01132 #ifdef __SSE2__
01133 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m128i,16,
01134 _mm_cmpeq_epi8,_mm_set1_epi8,
01135 _mm_and_si128,_mm_or_si128);
01136
01137 #else
01138 #if defined(__MMX__) && defined(__SSE__)
01139 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m64,8,
01140 _mm_cmpeq_pi8,_mm_set1_pi8,
01141 _mm_and_si64,_mm_or_si64);
01142 _mm_empty();
01143 #else
01144 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9;
01145 #endif
01146 #endif
01147 }
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158 inline void flgr_stop_label_collision_6_connex_p1_6_fgUINT16(fgUINT16 *pn3, fgUINT16 *pn4, fgUINT16 *pn5,
01159 fgUINT16 *pn7, fgUINT16 *pn8,
01160 fgUINT16 *pdil, fgUINT16 *pcenter, int length) {
01161 #ifdef __SSE2__
01162 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m128i,8,
01163 _mm_cmpeq_epi16,_mm_set1_epi16,
01164 _mm_and_si128,_mm_or_si128);
01165 #else
01166 #if defined(__MMX__) && defined(__SSE__)
01167 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m64,4,
01168 _mm_cmpeq_pi16,_mm_set1_pi16,
01169 _mm_and_si64,_mm_or_si64);
01170 _mm_empty();
01171
01172 #else
01173 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6;
01174 #endif
01175 #endif
01176 }
01177
01178
01179 inline void flgr_stop_label_collision_6_connex_p1_9_fgUINT16(fgUINT16 *pn1, fgUINT16 *pn2,
01180 fgUINT16 *pn3, fgUINT16 *pn4, fgUINT16 *pn5,
01181 fgUINT16 *pn7, fgUINT16 *pn8,
01182 fgUINT16 *pdil, fgUINT16 *pcenter, int length) {
01183 #ifdef __SSE2__
01184 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m128i,8,
01185 _mm_cmpeq_epi16,_mm_set1_epi16,
01186 _mm_and_si128,_mm_or_si128);
01187 #else
01188 #if defined(__MMX__) && defined(__SSE__)
01189 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m64,4,
01190 _mm_cmpeq_pi16,_mm_set1_pi16,
01191 _mm_and_si64,_mm_or_si64);
01192 _mm_empty();
01193
01194 #else
01195 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9;
01196 #endif
01197 #endif
01198 }
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208 inline void flgr_stop_label_collision_6_connex_p1_6_fgUINT32(fgUINT32 *pn3, fgUINT32 *pn4, fgUINT32 *pn5,
01209 fgUINT32 *pn7, fgUINT32 *pn8,
01210 fgUINT32 *pdil, fgUINT32 *pcenter, int length) {
01211 #ifdef __SSE2__
01212 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m128i,4,
01213 _mm_cmpeq_epi32,_mm_set1_epi32,
01214 _mm_and_si128,_mm_or_si128);
01215 #else
01216 #if defined(__MMX__) && defined(__SSE__)
01217 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m64,2,
01218 _mm_cmpeq_pi32,_mm_set1_pi32,
01219 _mm_and_si64,_mm_or_si64);
01220 _mm_empty();
01221
01222 #else
01223 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6;
01224 #endif
01225 #endif
01226 }
01227
01228
01229 inline void flgr_stop_label_collision_6_connex_p1_9_fgUINT32(fgUINT32 *pn1, fgUINT32 *pn2,
01230 fgUINT32 *pn3, fgUINT32 *pn4, fgUINT32 *pn5,
01231 fgUINT32 *pn7, fgUINT32 *pn8,
01232 fgUINT32 *pdil, fgUINT32 *pcenter, int length) {
01233 #ifdef __SSE2__
01234 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m128i,4,
01235 _mm_cmpeq_epi32,_mm_set1_epi32,
01236 _mm_and_si128,_mm_or_si128);
01237 #else
01238 #if defined(__MMX__) && defined(__SSE__)
01239 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m64,2,
01240 _mm_cmpeq_pi32,_mm_set1_pi32,
01241 _mm_and_si64,_mm_or_si64);
01242 _mm_empty();
01243
01244 #else
01245 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9;
01246 #endif
01247 #endif
01248 }
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269 inline void flgr_stop_label_collision_6_connex_p1_6_fgINT8(fgINT8 *pn3, fgINT8 *pn4, fgINT8 *pn5,
01270 fgINT8 *pn7, fgINT8 *pn8,
01271 fgINT8 *pdil, fgINT8 *pcenter, int length) {
01272 #ifdef __SSE2__
01273 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m128i,16,
01274 _mm_cmpeq_epi8,_mm_set1_epi8,
01275 _mm_and_si128,_mm_or_si128);
01276 #else
01277 #if defined(__MMX__) && defined(__SSE__)
01278 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m64,8,
01279 _mm_cmpeq_pi8,_mm_set1_pi8,
01280 _mm_and_si64,_mm_or_si64);
01281 _mm_empty();
01282 #else
01283 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6;
01284 #endif
01285 #endif
01286 }
01287
01288
01289 inline void flgr_stop_label_collision_6_connex_p1_9_fgINT8(fgINT8 *pn1, fgINT8 *pn2,
01290 fgINT8 *pn3, fgINT8 *pn4, fgINT8 *pn5,
01291 fgINT8 *pn7, fgINT8 *pn8,
01292 fgINT8 *pdil, fgINT8 *pcenter, int length) {
01293 #ifdef __SSE2__
01294 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m128i,16,
01295 _mm_cmpeq_epi8,_mm_set1_epi8,
01296 _mm_and_si128,_mm_or_si128);
01297
01298 #else
01299 #if defined(__MMX__) && defined(__SSE__)
01300 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m64,8,
01301 _mm_cmpeq_pi8,_mm_set1_pi8,
01302 _mm_and_si64,_mm_or_si64);
01303 _mm_empty();
01304 #else
01305 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9;
01306 #endif
01307 #endif
01308 }
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319 inline void flgr_stop_label_collision_6_connex_p1_6_fgINT16(fgINT16 *pn3, fgINT16 *pn4, fgINT16 *pn5,
01320 fgINT16 *pn7, fgINT16 *pn8,
01321 fgINT16 *pdil, fgINT16 *pcenter, int length) {
01322 #ifdef __SSE2__
01323 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m128i,8,
01324 _mm_cmpeq_epi16,_mm_set1_epi16,
01325 _mm_and_si128,_mm_or_si128);
01326 #else
01327 #if defined(__MMX__) && defined(__SSE__)
01328 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m64,4,
01329 _mm_cmpeq_pi16,_mm_set1_pi16,
01330 _mm_and_si64,_mm_or_si64);
01331 _mm_empty();
01332
01333 #else
01334 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6;
01335 #endif
01336 #endif
01337 }
01338
01339
01340 inline void flgr_stop_label_collision_6_connex_p1_9_fgINT16(fgINT16 *pn1, fgINT16 *pn2,
01341 fgINT16 *pn3, fgINT16 *pn4, fgINT16 *pn5,
01342 fgINT16 *pn7, fgINT16 *pn8,
01343 fgINT16 *pdil, fgINT16 *pcenter, int length) {
01344 #ifdef __SSE2__
01345 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m128i,8,
01346 _mm_cmpeq_epi16,_mm_set1_epi16,
01347 _mm_and_si128,_mm_or_si128);
01348 #else
01349 #if defined(__MMX__) && defined(__SSE__)
01350 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m64,4,
01351 _mm_cmpeq_pi16,_mm_set1_pi16,
01352 _mm_and_si64,_mm_or_si64);
01353 _mm_empty();
01354
01355 #else
01356 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9;
01357 #endif
01358 #endif
01359 }
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369 inline void flgr_stop_label_collision_6_connex_p1_6_fgINT32(fgINT32 *pn3, fgINT32 *pn4, fgINT32 *pn5,
01370 fgINT32 *pn7, fgINT32 *pn8,
01371 fgINT32 *pdil, fgINT32 *pcenter, int length) {
01372 #ifdef __SSE2__
01373 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m128i,4,
01374 _mm_cmpeq_epi32,_mm_set1_epi32,
01375 _mm_and_si128,_mm_or_si128);
01376 #else
01377 #if defined(__MMX__) && defined(__SSE__)
01378 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6_SIMD(__m64,2,
01379 _mm_cmpeq_pi32,_mm_set1_pi32,
01380 _mm_and_si64,_mm_or_si64);
01381 _mm_empty();
01382
01383 #else
01384 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6;
01385 #endif
01386 #endif
01387 }
01388
01389
01390 inline void flgr_stop_label_collision_6_connex_p1_9_fgINT32(fgINT32 *pn1, fgINT32 *pn2,
01391 fgINT32 *pn3, fgINT32 *pn4, fgINT32 *pn5,
01392 fgINT32 *pn7, fgINT32 *pn8,
01393 fgINT32 *pdil, fgINT32 *pcenter, int length) {
01394 #ifdef __SSE2__
01395 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m128i,4,
01396 _mm_cmpeq_epi32,_mm_set1_epi32,
01397 _mm_and_si128,_mm_or_si128);
01398 #else
01399 #if defined(__MMX__) && defined(__SSE__)
01400 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9_SIMD(__m64,2,
01401 _mm_cmpeq_pi32,_mm_set1_pi32,
01402 _mm_and_si64,_mm_or_si64);
01403 _mm_empty();
01404
01405 #else
01406 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9;
01407 #endif
01408 #endif
01409 }
01410
01411
01412
01413
01414
01415
01416
01417
01418 inline void flgr_stop_label_collision_6_connex_p1_6_fgFLOAT32(fgFLOAT32 *pn3, fgFLOAT32 *pn4, fgFLOAT32 *pn5,
01419 fgFLOAT32 *pn7, fgFLOAT32 *pn8,
01420 fgFLOAT32 *pdil, fgFLOAT32 *pcenter, int length) {
01421 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6;
01422 }
01423
01424
01425 inline void flgr_stop_label_collision_6_connex_p1_9_fgFLOAT32(fgFLOAT32 *pn1, fgFLOAT32 *pn2,
01426 fgFLOAT32 *pn3, fgFLOAT32 *pn4, fgFLOAT32 *pn5,
01427 fgFLOAT32 *pn7, fgFLOAT32 *pn8,
01428 fgFLOAT32 *pdil, fgFLOAT32 *pcenter, int length) {
01429 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9;
01430 }
01431
01432
01433
01434
01435
01436
01437
01438
01439
01440 inline void flgr_stop_label_collision_6_connex_p1_6_fgFLOAT64(fgFLOAT64 *pn3, fgFLOAT64 *pn4, fgFLOAT64 *pn5,
01441 fgFLOAT64 *pn7, fgFLOAT64 *pn8,
01442 fgFLOAT64 *pdil, fgFLOAT64 *pcenter, int length) {
01443 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_6;
01444 }
01445
01446
01447 inline void flgr_stop_label_collision_6_connex_p1_9_fgFLOAT64(fgFLOAT64 *pn1, fgFLOAT64 *pn2,
01448 fgFLOAT64 *pn3, fgFLOAT64 *pn4, fgFLOAT64 *pn5,
01449 fgFLOAT64 *pn7, fgFLOAT64 *pn8,
01450 fgFLOAT64 *pdil, fgFLOAT64 *pcenter, int length) {
01451 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P1_9;
01452 }
01453
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478
01479
01480 #define FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6 \
01481 int i; \
01482 \
01483 for(i=0 ; i<length ; i++) { \
01484 if(pcenter[i] != pdil[i] ) { \
01485 if((pn3[i] != 0) && (pn3[i] != pdil[i]) && (i!=0)) { \
01486 pdil[i] = 0; continue; \
01487 } \
01488 if((pn4[i] != 0) && (pn4[i] != pdil[i])) { \
01489 pdil[i] = 0; continue; \
01490 } \
01491 if((pn5[i] != 0) && (pn5[i] != pdil[i]) && (i!=length-1)) { \
01492 pdil[i] = 0; continue; \
01493 } \
01494 if((pn6[i] != 0) && (pn6[i] != pdil[i]) && (i!=0)) { \
01495 pdil[i] = 0; continue; \
01496 } \
01497 if((pn7[i] != 0) && (pn7[i] != pdil[i])) { \
01498 pdil[i] = 0; continue; \
01499 } \
01500 } \
01501 } \
01502 ;
01503
01504
01505
01506 #define FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9 \
01507 int i; \
01508 \
01509 for(i=0 ; i<length ; i++) { \
01510 if(pcenter[i] != pdil[i] ) { \
01511 if((pn0[i] != 0) && (pn0[i] != pdil[i]) && (i!=0)) { \
01512 pdil[i] = 0; continue; \
01513 } \
01514 if((pn1[i] != 0) && (pn1[i] != pdil[i])) { \
01515 pdil[i] = 0; continue; \
01516 } \
01517 if((pn3[i] != 0) && (pn3[i] != pdil[i]) && (i!=0)) { \
01518 pdil[i] = 0; continue; \
01519 } \
01520 if((pn4[i] != 0) && (pn4[i] != pdil[i])) { \
01521 pdil[i] = 0; continue; \
01522 } \
01523 if((pn5[i] != 0) && (pn5[i] != pdil[i]) && (i!=length-1)) { \
01524 pdil[i] = 0; continue; \
01525 } \
01526 if((pn6[i] != 0) && (pn6[i] != pdil[i]) && (i!=0)) { \
01527 pdil[i] = 0; continue; \
01528 } \
01529 if((pn7[i] != 0) && (pn7[i] != pdil[i])) { \
01530 pdil[i] = 0; continue; \
01531 } \
01532 } \
01533 } \
01534 ;
01535
01536
01537
01538
01539 #define FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(vtype,vsize, \
01540 cmp_instr,set1_instr, \
01541 and_instr,or_instr) \
01542 int i; \
01543 vtype vec_pnx; \
01544 vtype vec_center; \
01545 vtype vec_dil; \
01546 vtype vec_cmp1; \
01547 vtype vec_cmp2; \
01548 vtype vec_zero = set1_instr(0); \
01549 \
01550 *pdil = rep_dil(pcenter,pdil,pn4); \
01551 *pdil = rep_dil(pcenter,pdil,pn5); \
01552 *pdil = rep_dil(pcenter,pdil,pn7); \
01553 \
01554 pcenter++; \
01555 pdil++; \
01556 pn3++; \
01557 pn4++; \
01558 pn5++; \
01559 pn6++; \
01560 pn7++; \
01561 \
01562 for(i=1 ; i<vsize ; i++) { \
01563 *pdil = rep_dil(pcenter,pdil,pn3); \
01564 *pdil = rep_dil(pcenter,pdil,pn4); \
01565 *pdil = rep_dil(pcenter,pdil,pn5); \
01566 *pdil = rep_dil(pcenter,pdil,pn6); \
01567 *pdil = rep_dil(pcenter,pdil,pn7); \
01568 pdil++; \
01569 pcenter++; \
01570 pn3++; \
01571 pn4++; \
01572 pn5++; \
01573 pn6++; \
01574 pn7++; \
01575 } \
01576 \
01577 for(i=vsize ; i<length-vsize ; i+=vsize) { \
01578 vec_center = *((vtype*) pcenter); \
01579 vec_dil = *((vtype*) pdil); \
01580 vec_cmp1 = cmp_instr(vec_center,vec_dil); \
01581 \
01582 vec_pnx = *((vtype*) pn3); \
01583 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01584 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01585 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01586 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01587 vec_dil = and_instr(vec_pnx,vec_dil); \
01588 \
01589 vec_pnx = *((vtype*) pn4); \
01590 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01591 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01592 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01593 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01594 vec_dil = and_instr(vec_pnx,vec_dil); \
01595 \
01596 vec_pnx = *((vtype*) pn5); \
01597 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01598 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01599 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01600 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01601 vec_dil = and_instr(vec_pnx,vec_dil); \
01602 \
01603 vec_pnx = *((vtype*) pn6); \
01604 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01605 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01606 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01607 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01608 vec_dil = and_instr(vec_pnx,vec_dil); \
01609 \
01610 vec_pnx = *((vtype*) pn7); \
01611 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01612 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01613 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01614 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01615 vec_dil = and_instr(vec_pnx,vec_dil); \
01616 \
01617 *((vtype*) pdil)=vec_dil; \
01618 \
01619 pcenter += vsize; \
01620 pdil += vsize; \
01621 pn3 += vsize; \
01622 pn4 += vsize; \
01623 pn5 += vsize; \
01624 pn6 += vsize; \
01625 pn7 += vsize; \
01626 } \
01627 \
01628 for( ; i<length-1 ; i++) { \
01629 *pdil = rep_dil(pcenter,pdil,pn3); \
01630 *pdil = rep_dil(pcenter,pdil,pn4); \
01631 *pdil = rep_dil(pcenter,pdil,pn5); \
01632 *pdil = rep_dil(pcenter,pdil,pn6); \
01633 *pdil = rep_dil(pcenter,pdil,pn7); \
01634 pdil++; \
01635 pcenter++; \
01636 pn3++; \
01637 pn4++; \
01638 pn5++; \
01639 pn6++; \
01640 pn7++; \
01641 } \
01642 \
01643 *pdil = rep_dil(pcenter,pdil,pn3); \
01644 *pdil = rep_dil(pcenter,pdil,pn4); \
01645 *pdil = rep_dil(pcenter,pdil,pn6); \
01646 *pdil = rep_dil(pcenter,pdil,pn7)
01647
01648
01649 #define FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(vtype,vsize, \
01650 cmp_instr,set1_instr, \
01651 and_instr,or_instr) \
01652 int i; \
01653 vtype vec_pnx; \
01654 vtype vec_center; \
01655 vtype vec_dil; \
01656 vtype vec_cmp1; \
01657 vtype vec_cmp2; \
01658 vtype vec_zero = set1_instr(0); \
01659 \
01660 *pdil = rep_dil(pcenter,pdil,pn1); \
01661 *pdil = rep_dil(pcenter,pdil,pn4); \
01662 *pdil = rep_dil(pcenter,pdil,pn5); \
01663 *pdil = rep_dil(pcenter,pdil,pn7); \
01664 \
01665 pcenter++; \
01666 pdil++; \
01667 pn0++; \
01668 pn1++; \
01669 pn3++; \
01670 pn4++; \
01671 pn5++; \
01672 pn6++; \
01673 pn7++; \
01674 \
01675 for(i=1 ; i<vsize ; i++) { \
01676 *pdil = rep_dil(pcenter,pdil,pn0); \
01677 *pdil = rep_dil(pcenter,pdil,pn1); \
01678 *pdil = rep_dil(pcenter,pdil,pn3); \
01679 *pdil = rep_dil(pcenter,pdil,pn4); \
01680 *pdil = rep_dil(pcenter,pdil,pn5); \
01681 *pdil = rep_dil(pcenter,pdil,pn6); \
01682 *pdil = rep_dil(pcenter,pdil,pn7); \
01683 pdil++; \
01684 pcenter++; \
01685 pn0++; \
01686 pn1++; \
01687 pn3++; \
01688 pn4++; \
01689 pn5++; \
01690 pn6++; \
01691 pn7++; \
01692 } \
01693 \
01694 for(i=vsize ; i<length-vsize ; i+=vsize) { \
01695 vec_center = *((vtype*) pcenter); \
01696 vec_dil = *((vtype*) pdil); \
01697 vec_cmp1 = cmp_instr(vec_center,vec_dil); \
01698 \
01699 vec_pnx = *((vtype*) pn0); \
01700 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01701 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01702 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01703 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01704 vec_dil = and_instr(vec_pnx,vec_dil); \
01705 \
01706 vec_pnx = *((vtype*) pn1); \
01707 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01708 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01709 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01710 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01711 vec_dil = and_instr(vec_pnx,vec_dil); \
01712 \
01713 vec_pnx = *((vtype*) pn3); \
01714 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01715 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01716 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01717 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01718 vec_dil = and_instr(vec_pnx,vec_dil); \
01719 \
01720 vec_pnx = *((vtype*) pn4); \
01721 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01722 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01723 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01724 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01725 vec_dil = and_instr(vec_pnx,vec_dil); \
01726 \
01727 vec_pnx = *((vtype*) pn5); \
01728 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01729 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01730 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01731 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01732 vec_dil = and_instr(vec_pnx,vec_dil); \
01733 \
01734 vec_pnx = *((vtype*) pn6); \
01735 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01736 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01737 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01738 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01739 vec_dil = and_instr(vec_pnx,vec_dil); \
01740 \
01741 vec_pnx = *((vtype*) pn7); \
01742 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
01743 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
01744 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
01745 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
01746 vec_dil = and_instr(vec_pnx,vec_dil); \
01747 \
01748 *((vtype*) pdil) = vec_dil; \
01749 \
01750 pcenter += vsize; \
01751 pdil += vsize; \
01752 pn0 += vsize; \
01753 pn1 += vsize; \
01754 pn3 += vsize; \
01755 pn4 += vsize; \
01756 pn5 += vsize; \
01757 pn6 += vsize; \
01758 pn7 += vsize; \
01759 } \
01760 \
01761 for( ; i<length-1 ; i++) { \
01762 *pdil = rep_dil(pcenter,pdil,pn0); \
01763 *pdil = rep_dil(pcenter,pdil,pn1); \
01764 *pdil = rep_dil(pcenter,pdil,pn3); \
01765 *pdil = rep_dil(pcenter,pdil,pn4); \
01766 *pdil = rep_dil(pcenter,pdil,pn5); \
01767 *pdil = rep_dil(pcenter,pdil,pn6); \
01768 *pdil = rep_dil(pcenter,pdil,pn7); \
01769 pdil++; \
01770 pcenter++; \
01771 pn0++; \
01772 pn1++; \
01773 pn3++; \
01774 pn4++; \
01775 pn5++; \
01776 pn6++; \
01777 pn7++; \
01778 } \
01779 \
01780 *pdil = rep_dil(pcenter,pdil,pn0); \
01781 *pdil = rep_dil(pcenter,pdil,pn1); \
01782 *pdil = rep_dil(pcenter,pdil,pn3); \
01783 *pdil = rep_dil(pcenter,pdil,pn4); \
01784 *pdil = rep_dil(pcenter,pdil,pn6); \
01785 *pdil = rep_dil(pcenter,pdil,pn7)
01786
01787
01788
01789
01790
01791
01792
01793
01794
01795
01796 inline void flgr_stop_label_collision_6_connex_p2_6_fgUINT8(fgUINT8 *pn3, fgUINT8 *pn4, fgUINT8 *pn5,
01797 fgUINT8 *pn6, fgUINT8 *pn7,
01798 fgUINT8 *pdil, fgUINT8 *pcenter, int length) {
01799 #ifdef __SSE2__
01800 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m128i,16,_mm_cmpeq_epi8,_mm_set1_epi8,
01801 _mm_and_si128,_mm_or_si128);
01802 #else
01803 #if defined(__MMX__) && defined(__SSE__)
01804 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m64,8,
01805 _mm_cmpeq_pi8,_mm_set1_pi8,
01806 _mm_and_si64,_mm_or_si64);
01807 _mm_empty();
01808 #else
01809 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6;
01810 #endif
01811 #endif
01812 }
01813
01814
01815 inline void flgr_stop_label_collision_6_connex_p2_9_fgUINT8(fgUINT8 *pn0, fgUINT8 *pn1,
01816 fgUINT8 *pn3, fgUINT8 *pn4, fgUINT8 *pn5,
01817 fgUINT8 *pn6, fgUINT8 *pn7,
01818 fgUINT8 *pdil, fgUINT8 *pcenter, int length) {
01819 #ifdef __SSE2__
01820 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m128i,16,_mm_cmpeq_epi8,_mm_set1_epi8,
01821 _mm_and_si128,_mm_or_si128);
01822
01823 #else
01824 #if defined(__MMX__) && defined(__SSE__)
01825 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m64,8,
01826 _mm_cmpeq_pi8,_mm_set1_pi8,
01827 _mm_and_si64,_mm_or_si64);
01828 _mm_empty();
01829 #else
01830 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9;
01831 #endif
01832 #endif
01833 }
01834
01835
01836
01837
01838
01839
01840
01841
01842
01843
01844 inline void flgr_stop_label_collision_6_connex_p2_6_fgUINT16(fgUINT16 *pn3, fgUINT16 *pn4, fgUINT16 *pn5,
01845 fgUINT16 *pn6, fgUINT16 *pn7,
01846 fgUINT16 *pdil, fgUINT16 *pcenter, int length) {
01847 #ifdef __SSE2__
01848 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m128i,8,_mm_cmpeq_epi16,_mm_set1_epi16,
01849 _mm_and_si128,_mm_or_si128);
01850 #else
01851 #if defined(__MMX__) && defined(__SSE__)
01852 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m64,4,
01853 _mm_cmpeq_pi16,_mm_set1_pi16,
01854 _mm_and_si64,_mm_or_si64);
01855 _mm_empty();
01856
01857 #else
01858 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6;
01859 #endif
01860 #endif
01861 }
01862
01863
01864 inline void flgr_stop_label_collision_6_connex_p2_9_fgUINT16(fgUINT16 *pn0, fgUINT16 *pn1,
01865 fgUINT16 *pn3, fgUINT16 *pn4, fgUINT16 *pn5,
01866 fgUINT16 *pn6, fgUINT16 *pn7,
01867 fgUINT16 *pdil, fgUINT16 *pcenter, int length) {
01868 #ifdef __SSE2__
01869 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m128i,8,_mm_cmpeq_epi16,_mm_set1_epi16,
01870 _mm_and_si128,_mm_or_si128);
01871 #else
01872 #if defined(__MMX__) && defined(__SSE__)
01873 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m64,4,
01874 _mm_cmpeq_pi16,_mm_set1_pi16,
01875 _mm_and_si64,_mm_or_si64);
01876 _mm_empty();
01877
01878 #else
01879 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9;
01880 #endif
01881 #endif
01882 }
01883
01884
01885
01886
01887
01888
01889
01890
01891
01892 inline void flgr_stop_label_collision_6_connex_p2_6_fgUINT32(fgUINT32 *pn3, fgUINT32 *pn4, fgUINT32 *pn5,
01893 fgUINT32 *pn6, fgUINT32 *pn7,
01894 fgUINT32 *pdil, fgUINT32 *pcenter, int length) {
01895 #ifdef __SSE2__
01896 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m128i,4,_mm_cmpeq_epi32,_mm_set1_epi32,
01897 _mm_and_si128,_mm_or_si128);
01898 #else
01899 #if defined(__MMX__) && defined(__SSE__)
01900 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m64,2,
01901 _mm_cmpeq_pi32,_mm_set1_pi32,
01902 _mm_and_si64,_mm_or_si64);
01903 _mm_empty();
01904
01905 #else
01906 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6;
01907 #endif
01908 #endif
01909 }
01910
01911
01912 inline void flgr_stop_label_collision_6_connex_p2_9_fgUINT32(fgUINT32 *pn0, fgUINT32 *pn1,
01913 fgUINT32 *pn3, fgUINT32 *pn4, fgUINT32 *pn5,
01914 fgUINT32 *pn6, fgUINT32 *pn7,
01915 fgUINT32 *pdil, fgUINT32 *pcenter, int length) {
01916 #ifdef __SSE2__
01917 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m128i,4,_mm_cmpeq_epi32,_mm_set1_epi32,
01918 _mm_and_si128,_mm_or_si128);
01919 #else
01920 #if defined(__MMX__) && defined(__SSE__)
01921 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m64,2,
01922 _mm_cmpeq_pi32,_mm_set1_pi32,
01923 _mm_and_si64,_mm_or_si64);
01924 _mm_empty();
01925
01926 #else
01927 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9;
01928 #endif
01929 #endif
01930 }
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951 inline void flgr_stop_label_collision_6_connex_p2_6_fgINT8(fgINT8 *pn3, fgINT8 *pn4, fgINT8 *pn5,
01952 fgINT8 *pn6, fgINT8 *pn7,
01953 fgINT8 *pdil, fgINT8 *pcenter, int length) {
01954 #ifdef __SSE2__
01955 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m128i,16,_mm_cmpeq_epi8,_mm_set1_epi8,
01956 _mm_and_si128,_mm_or_si128);
01957 #else
01958 #if defined(__MMX__) && defined(__SSE__)
01959 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m64,8,
01960 _mm_cmpeq_pi8,_mm_set1_pi8,
01961 _mm_and_si64,_mm_or_si64);
01962 _mm_empty();
01963 #else
01964 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6;
01965 #endif
01966 #endif
01967 }
01968
01969
01970 inline void flgr_stop_label_collision_6_connex_p2_9_fgINT8(fgINT8 *pn0, fgINT8 *pn1,
01971 fgINT8 *pn3, fgINT8 *pn4, fgINT8 *pn5,
01972 fgINT8 *pn6, fgINT8 *pn7,
01973 fgINT8 *pdil, fgINT8 *pcenter, int length) {
01974 #ifdef __SSE2__
01975 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m128i,16,_mm_cmpeq_epi8,_mm_set1_epi8,
01976 _mm_and_si128,_mm_or_si128);
01977
01978 #else
01979 #if defined(__MMX__) && defined(__SSE__)
01980 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m64,8,
01981 _mm_cmpeq_pi8,_mm_set1_pi8,
01982 _mm_and_si64,_mm_or_si64);
01983 _mm_empty();
01984 #else
01985 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9;
01986 #endif
01987 #endif
01988 }
01989
01990
01991
01992
01993
01994
01995
01996
01997
01998
01999 inline void flgr_stop_label_collision_6_connex_p2_6_fgINT16(fgINT16 *pn3, fgINT16 *pn4, fgINT16 *pn5,
02000 fgINT16 *pn6, fgINT16 *pn7,
02001 fgINT16 *pdil, fgINT16 *pcenter, int length) {
02002 #ifdef __SSE2__
02003 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m128i,8,_mm_cmpeq_epi16,_mm_set1_epi16,
02004 _mm_and_si128,_mm_or_si128);
02005 #else
02006 #if defined(__MMX__) && defined(__SSE__)
02007 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m64,4,
02008 _mm_cmpeq_pi16,_mm_set1_pi16,
02009 _mm_and_si64,_mm_or_si64);
02010 _mm_empty();
02011
02012 #else
02013 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6;
02014 #endif
02015 #endif
02016 }
02017
02018
02019 inline void flgr_stop_label_collision_6_connex_p2_9_fgINT16(fgINT16 *pn0, fgINT16 *pn1,
02020 fgINT16 *pn3, fgINT16 *pn4, fgINT16 *pn5,
02021 fgINT16 *pn6, fgINT16 *pn7,
02022 fgINT16 *pdil, fgINT16 *pcenter, int length) {
02023 #ifdef __SSE2__
02024 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m128i,8,_mm_cmpeq_epi16,_mm_set1_epi16,
02025 _mm_and_si128,_mm_or_si128);
02026 #else
02027 #if defined(__MMX__) && defined(__SSE__)
02028 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m64,4,
02029 _mm_cmpeq_pi16,_mm_set1_pi16,
02030 _mm_and_si64,_mm_or_si64);
02031 _mm_empty();
02032
02033 #else
02034 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9;
02035 #endif
02036 #endif
02037 }
02038
02039
02040
02041
02042
02043
02044
02045
02046
02047 inline void flgr_stop_label_collision_6_connex_p2_6_fgINT32(fgINT32 *pn3, fgINT32 *pn4, fgINT32 *pn5,
02048 fgINT32 *pn6, fgINT32 *pn7,
02049 fgINT32 *pdil, fgINT32 *pcenter, int length) {
02050 #ifdef __SSE2__
02051 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m128i,4,_mm_cmpeq_epi32,_mm_set1_epi32,
02052 _mm_and_si128,_mm_or_si128);
02053 #else
02054 #if defined(__MMX__) && defined(__SSE__)
02055 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6_SIMD(__m64,2,
02056 _mm_cmpeq_pi32,_mm_set1_pi32,
02057 _mm_and_si64,_mm_or_si64);
02058 _mm_empty();
02059
02060 #else
02061 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6;
02062 #endif
02063 #endif
02064 }
02065
02066
02067 inline void flgr_stop_label_collision_6_connex_p2_9_fgINT32(fgINT32 *pn0, fgINT32 *pn1,
02068 fgINT32 *pn3, fgINT32 *pn4, fgINT32 *pn5,
02069 fgINT32 *pn6, fgINT32 *pn7,
02070 fgINT32 *pdil, fgINT32 *pcenter, int length) {
02071 #ifdef __SSE2__
02072 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m128i,4,_mm_cmpeq_epi32,_mm_set1_epi32,
02073 _mm_and_si128,_mm_or_si128);
02074 #else
02075 #if defined(__MMX__) && defined(__SSE__)
02076 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9_SIMD(__m64,2,
02077 _mm_cmpeq_pi32,_mm_set1_pi32,
02078 _mm_and_si64,_mm_or_si64);
02079 _mm_empty();
02080
02081 #else
02082 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9;
02083 #endif
02084 #endif
02085 }
02086
02087
02088
02089
02090
02091
02092
02093
02094 inline void flgr_stop_label_collision_6_connex_p2_6_fgFLOAT32(fgFLOAT32 *pn3, fgFLOAT32 *pn4, fgFLOAT32 *pn5,
02095 fgFLOAT32 *pn6, fgFLOAT32 *pn7,
02096 fgFLOAT32 *pdil, fgFLOAT32 *pcenter, int length) {
02097 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6;
02098 }
02099
02100
02101 inline void flgr_stop_label_collision_6_connex_p2_9_fgFLOAT32(fgFLOAT32 *pn0, fgFLOAT32 *pn1,
02102 fgFLOAT32 *pn3, fgFLOAT32 *pn4, fgFLOAT32 *pn5,
02103 fgFLOAT32 *pn6, fgFLOAT32 *pn7,
02104 fgFLOAT32 *pdil, fgFLOAT32 *pcenter, int length) {
02105 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9;
02106 }
02107
02108
02109
02110
02111
02112
02113
02114
02115
02116 inline void flgr_stop_label_collision_6_connex_p2_6_fgFLOAT64(fgFLOAT64 *pn3, fgFLOAT64 *pn4, fgFLOAT64 *pn5,
02117 fgFLOAT64 *pn6, fgFLOAT64 *pn7,
02118 fgFLOAT64 *pdil, fgFLOAT64 *pcenter, int length) {
02119 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_6;
02120 }
02121
02122
02123 inline void flgr_stop_label_collision_6_connex_p2_9_fgFLOAT64(fgFLOAT64 *pn0, fgFLOAT64 *pn1,
02124 fgFLOAT64 *pn3, fgFLOAT64 *pn4, fgFLOAT64 *pn5,
02125 fgFLOAT64 *pn6, fgFLOAT64 *pn7,
02126 fgFLOAT64 *pdil, fgFLOAT64 *pcenter, int length) {
02127 FLGR_MACRO_STOP_LABEL_COLLISION_6_CONNEX_P2_9;
02128 }
02129
02130
02131
02132
02133
02134
02135
02136
02137
02138
02139
02140
02141
02142
02143
02144
02145
02146
02147
02148
02149
02150
02151
02152 #define FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6 \
02153 int i; \
02154 \
02155 for(i=0 ; i<length ; i++) { \
02156 if(pcenter[i] != pdil[i] ) { \
02157 if((pn1[i] != 0) && (pn1[i] != pdil[i]) && (i!=0)) { \
02158 pdil[i] = 0; continue; \
02159 } \
02160 if((pn2[i] != 0) && (pn2[i] != pdil[i])) { \
02161 pdil[i] = 0; continue; \
02162 } \
02163 if((pn3[i] != 0) && (pn3[i] != pdil[i]) && (i!=length-1)) { \
02164 pdil[i] = 0; continue; \
02165 } \
02166 if((pn4[i] != 0) && (pn4[i] != pdil[i])) { \
02167 pdil[i] = 0; continue; \
02168 } \
02169 } \
02170 } \
02171 ;
02172
02173
02174
02175 #define FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9 \
02176 int i; \
02177 \
02178 for(i=0 ; i<length ; i++) { \
02179 if(pcenter[i] != pdil[i] ) { \
02180 if((pn0[i] != 0) && (pn0[i] != pdil[i])) { \
02181 pdil[i] = 0; continue; \
02182 } \
02183 if((pn1[i] != 0) && (pn1[i] != pdil[i]) && (i!=0)) { \
02184 pdil[i] = 0; continue; \
02185 } \
02186 if((pn2[i] != 0) && (pn2[i] != pdil[i])) { \
02187 pdil[i] = 0; continue; \
02188 } \
02189 if((pn3[i] != 0) && (pn3[i] != pdil[i]) && (i!=length-1)) { \
02190 pdil[i] = 0; continue; \
02191 } \
02192 if((pn4[i] != 0) && (pn4[i] != pdil[i])) { \
02193 pdil[i] = 0; continue; \
02194 } \
02195 } \
02196 } \
02197 ;
02198
02199
02200
02201
02202
02203
02204
02205
02206
02207
02208
02209
02210
02211
02212
02213 #define FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(vtype,vsize, \
02214 cmp_instr,set1_instr, \
02215 and_instr,or_instr) \
02216 int i; \
02217 vtype vec_pnx; \
02218 vtype vec_center; \
02219 vtype vec_dil; \
02220 vtype vec_cmp1; \
02221 vtype vec_cmp2; \
02222 vtype vec_zero = set1_instr(0); \
02223 \
02224 *pdil = rep_dil(pcenter,pdil,pn2); \
02225 *pdil = rep_dil(pcenter,pdil,pn3); \
02226 *pdil = rep_dil(pcenter,pdil,pn4); \
02227 \
02228 pcenter++; \
02229 pdil++; \
02230 pn1++; \
02231 pn2++; \
02232 pn3++; \
02233 pn4++; \
02234 \
02235 for(i=1 ; i<vsize ; i++) { \
02236 *pdil = rep_dil(pcenter,pdil,pn1); \
02237 *pdil = rep_dil(pcenter,pdil,pn2); \
02238 *pdil = rep_dil(pcenter,pdil,pn3); \
02239 *pdil = rep_dil(pcenter,pdil,pn4); \
02240 pdil++; \
02241 pcenter++; \
02242 pn1++; \
02243 pn2++; \
02244 pn3++; \
02245 pn4++; \
02246 } \
02247 \
02248 for(i=vsize ; i<length-vsize ; i+=vsize) { \
02249 vec_center = *((vtype*) pcenter); \
02250 vec_dil = *((vtype*) pdil); \
02251 vec_cmp1 = cmp_instr(vec_center,vec_dil); \
02252 \
02253 vec_pnx = *((vtype*) pn1); \
02254 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02255 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02256 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02257 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02258 vec_dil = and_instr(vec_pnx,vec_dil); \
02259 \
02260 vec_pnx = *((vtype*) pn2); \
02261 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02262 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02263 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02264 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02265 vec_dil = and_instr(vec_pnx,vec_dil); \
02266 \
02267 vec_pnx = *((vtype*) pn3); \
02268 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02269 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02270 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02271 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02272 vec_dil = and_instr(vec_pnx,vec_dil); \
02273 \
02274 vec_pnx = *((vtype*) pn4); \
02275 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02276 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02277 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02278 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02279 vec_dil = and_instr(vec_pnx,vec_dil); \
02280 \
02281 *((vtype*) pdil)=vec_dil; \
02282 \
02283 pcenter += vsize; \
02284 pdil += vsize; \
02285 pn1 += vsize; \
02286 pn2 += vsize; \
02287 pn3 += vsize; \
02288 pn4 += vsize; \
02289 } \
02290 \
02291 for(i=1 ; i<vsize ; i++) { \
02292 *pdil = rep_dil(pcenter,pdil,pn1); \
02293 *pdil = rep_dil(pcenter,pdil,pn2); \
02294 *pdil = rep_dil(pcenter,pdil,pn3); \
02295 *pdil = rep_dil(pcenter,pdil,pn4); \
02296 pdil++; \
02297 pcenter++; \
02298 pn1++; \
02299 pn2++; \
02300 pn3++; \
02301 pn4++; \
02302 } \
02303 \
02304 *pdil = rep_dil(pcenter,pdil,pn1); \
02305 *pdil = rep_dil(pcenter,pdil,pn2); \
02306 *pdil = rep_dil(pcenter,pdil,pn4)
02307
02308
02309
02310 #define FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(vtype,vsize, \
02311 cmp_instr,set1_instr, \
02312 and_instr,or_instr) \
02313 int i; \
02314 vtype vec_pnx; \
02315 vtype vec_center; \
02316 vtype vec_dil; \
02317 vtype vec_cmp1; \
02318 vtype vec_cmp2; \
02319 vtype vec_zero = set1_instr(0); \
02320 \
02321 *pdil = rep_dil(pcenter,pdil,pn0); \
02322 *pdil = rep_dil(pcenter,pdil,pn2); \
02323 *pdil = rep_dil(pcenter,pdil,pn3); \
02324 *pdil = rep_dil(pcenter,pdil,pn4); \
02325 \
02326 pcenter++; \
02327 pdil++; \
02328 pn0++; \
02329 pn1++; \
02330 pn2++; \
02331 pn3++; \
02332 pn4++; \
02333 \
02334 for(i=1 ; i<vsize ; i++) { \
02335 *pdil = rep_dil(pcenter,pdil,pn0); \
02336 *pdil = rep_dil(pcenter,pdil,pn1); \
02337 *pdil = rep_dil(pcenter,pdil,pn2); \
02338 *pdil = rep_dil(pcenter,pdil,pn3); \
02339 *pdil = rep_dil(pcenter,pdil,pn4); \
02340 pdil++; \
02341 pcenter++; \
02342 pn0++; \
02343 pn1++; \
02344 pn2++; \
02345 pn3++; \
02346 pn4++; \
02347 } \
02348 \
02349 \
02350 for(i=vsize ; i<length-vsize ; i+=vsize) { \
02351 vec_center = *((vtype*) pcenter); \
02352 vec_dil = *((vtype*) pdil); \
02353 vec_cmp1 = cmp_instr(vec_center,vec_dil); \
02354 \
02355 vec_pnx = *((vtype*) pn0); \
02356 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02357 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02358 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02359 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02360 vec_dil = and_instr(vec_pnx,vec_dil); \
02361 \
02362 vec_pnx = *((vtype*) pn1); \
02363 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02364 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02365 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02366 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02367 vec_dil = and_instr(vec_pnx,vec_dil); \
02368 \
02369 vec_pnx = *((vtype*) pn2); \
02370 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02371 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02372 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02373 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02374 vec_dil = and_instr(vec_pnx,vec_dil); \
02375 \
02376 vec_pnx = *((vtype*) pn3); \
02377 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02378 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02379 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02380 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02381 vec_dil = and_instr(vec_pnx,vec_dil); \
02382 \
02383 vec_pnx = *((vtype*) pn4); \
02384 vec_cmp2 = cmp_instr(vec_pnx,vec_zero); \
02385 vec_pnx = cmp_instr(vec_pnx,vec_dil); \
02386 vec_pnx = or_instr(vec_pnx,vec_cmp2); \
02387 vec_pnx = or_instr(vec_pnx,vec_cmp1); \
02388 vec_dil = and_instr(vec_pnx,vec_dil); \
02389 \
02390 *((vtype*) pdil) = vec_dil; \
02391 \
02392 pcenter += vsize; \
02393 pdil += vsize; \
02394 pn0 += vsize; \
02395 pn1 += vsize; \
02396 pn2 += vsize; \
02397 pn3 += vsize; \
02398 pn4 += vsize; \
02399 } \
02400 \
02401 for(i=1 ; i<vsize ; i++) { \
02402 *pdil = rep_dil(pcenter,pdil,pn0); \
02403 *pdil = rep_dil(pcenter,pdil,pn1); \
02404 *pdil = rep_dil(pcenter,pdil,pn2); \
02405 *pdil = rep_dil(pcenter,pdil,pn3); \
02406 *pdil = rep_dil(pcenter,pdil,pn4); \
02407 pdil++; \
02408 pcenter++; \
02409 pn0++; \
02410 pn1++; \
02411 pn2++; \
02412 pn3++; \
02413 pn4++; \
02414 } \
02415 \
02416 *pdil = rep_dil(pcenter,pdil,pn0); \
02417 *pdil = rep_dil(pcenter,pdil,pn1); \
02418 *pdil = rep_dil(pcenter,pdil,pn2); \
02419 *pdil = rep_dil(pcenter,pdil,pn4)
02420
02421
02422
02423
02424
02425
02426
02427
02428
02429
02430
02431
02432
02433
02434 inline void flgr_stop_label_collision_4_connex_6_fgUINT8(fgUINT8 *pn1,fgUINT8 *pn2, fgUINT8 *pn3,
02435 fgUINT8 *pn4,
02436 fgUINT8 *pdil, fgUINT8 *pcenter, int length) {
02437 #ifdef __SSE2__
02438 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m128i,16,
02439 _mm_cmpeq_epi8,_mm_set1_epi8,
02440 _mm_and_si128,_mm_or_si128);
02441 #else
02442 #if defined(__MMX__) && defined(__SSE__)
02443 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m64,8,
02444 _mm_cmpeq_pi8,_mm_set1_pi8,
02445 _mm_and_si64,_mm_or_si64);
02446 _mm_empty();
02447 #else
02448 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6;
02449 #endif
02450 #endif
02451 }
02452
02453
02454 inline void flgr_stop_label_collision_4_connex_9_fgUINT8(fgUINT8 *pn0,
02455 fgUINT8 *pn1, fgUINT8 *pn2, fgUINT8 *pn3,
02456 fgUINT8 *pn4,
02457 fgUINT8 *pdil, fgUINT8 *pcenter, int length) {
02458 #ifdef __SSE2__
02459 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m128i,16,
02460 _mm_cmpeq_epi8,_mm_set1_epi8,
02461 _mm_and_si128,_mm_or_si128);
02462
02463 #else
02464 #if defined(__MMX__) && defined(__SSE__)
02465 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m64,8,
02466 _mm_cmpeq_pi8,_mm_set1_pi8,
02467 _mm_and_si64,_mm_or_si64);
02468 _mm_empty();
02469 #else
02470 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9;
02471 #endif
02472 #endif
02473 }
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483
02484 inline void flgr_stop_label_collision_4_connex_6_fgUINT16(fgUINT16 *pn1,fgUINT16 *pn2, fgUINT16 *pn3,
02485 fgUINT16 *pn4,
02486 fgUINT16 *pdil, fgUINT16 *pcenter, int length) {
02487 #ifdef __SSE2__
02488 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m128i,8,
02489 _mm_cmpeq_epi16,_mm_set1_epi16,
02490 _mm_and_si128,_mm_or_si128);
02491 #else
02492 #if defined(__MMX__) && defined(__SSE__)
02493 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m64,4,
02494 _mm_cmpeq_pi16,_mm_set1_pi16,
02495 _mm_and_si64,_mm_or_si64);
02496 _mm_empty();
02497
02498 #else
02499 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6;
02500 #endif
02501 #endif
02502 }
02503
02504
02505 inline void flgr_stop_label_collision_4_connex_9_fgUINT16(fgUINT16 *pn0,
02506 fgUINT16 *pn1, fgUINT16 *pn2, fgUINT16 *pn3,
02507 fgUINT16 *pn4,
02508 fgUINT16 *pdil, fgUINT16 *pcenter, int length) {
02509 #ifdef __SSE2__
02510 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m128i,8,
02511 _mm_cmpeq_epi16,_mm_set1_epi16,
02512 _mm_and_si128,_mm_or_si128);
02513 #else
02514 #if defined(__MMX__) && defined(__SSE__)
02515 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m64,4,
02516 _mm_cmpeq_pi16,_mm_set1_pi16,
02517 _mm_and_si64,_mm_or_si64);
02518 _mm_empty();
02519
02520 #else
02521 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9;
02522 #endif
02523 #endif
02524 }
02525
02526
02527
02528
02529
02530
02531
02532
02533
02534 inline void flgr_stop_label_collision_4_connex_6_fgUINT32(fgUINT32 *pn1,fgUINT32 *pn2, fgUINT32 *pn3,
02535 fgUINT32 *pn4,
02536 fgUINT32 *pdil, fgUINT32 *pcenter, int length) {
02537 #ifdef __SSE2__
02538 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m128i,4,
02539 _mm_cmpeq_epi32,_mm_set1_epi32,
02540 _mm_and_si128,_mm_or_si128);
02541 #else
02542 #if defined(__MMX__) && defined(__SSE__)
02543 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m64,2,
02544 _mm_cmpeq_pi32,_mm_set1_pi32,
02545 _mm_and_si64,_mm_or_si64);
02546 _mm_empty();
02547
02548 #else
02549 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6;
02550 #endif
02551 #endif
02552 }
02553
02554
02555 inline void flgr_stop_label_collision_4_connex_9_fgUINT32(fgUINT32 *pn0,
02556 fgUINT32 *pn1, fgUINT32 *pn2, fgUINT32 *pn3,
02557 fgUINT32 *pn4,
02558 fgUINT32 *pdil, fgUINT32 *pcenter, int length) {
02559 #ifdef __SSE2__
02560 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m128i,4,
02561 _mm_cmpeq_epi32,_mm_set1_epi32,
02562 _mm_and_si128,_mm_or_si128);
02563 #else
02564 #if defined(__MMX__) && defined(__SSE__)
02565 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m64,2,
02566 _mm_cmpeq_pi32,_mm_set1_pi32,
02567 _mm_and_si64,_mm_or_si64);
02568 _mm_empty();
02569
02570 #else
02571 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9;
02572 #endif
02573 #endif
02574 }
02575
02576
02577
02578
02579
02580
02581
02582
02583
02584
02585
02586
02587
02588
02589
02590
02591
02592
02593
02594
02595 inline void flgr_stop_label_collision_4_connex_6_fgINT8(fgINT8 *pn1,fgINT8 *pn2, fgINT8 *pn3,
02596 fgINT8 *pn4,
02597 fgINT8 *pdil, fgINT8 *pcenter, int length) {
02598 #ifdef __SSE2__
02599 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m128i,16,
02600 _mm_cmpeq_epi8,_mm_set1_epi8,
02601 _mm_and_si128,_mm_or_si128);
02602 #else
02603 #if defined(__MMX__) && defined(__SSE__)
02604 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m64,8,
02605 _mm_cmpeq_pi8,_mm_set1_pi8,
02606 _mm_and_si64,_mm_or_si64);
02607 _mm_empty();
02608 #else
02609 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6;
02610 #endif
02611 #endif
02612 }
02613
02614
02615 inline void flgr_stop_label_collision_4_connex_9_fgINT8(fgINT8 *pn0,
02616 fgINT8 *pn1, fgINT8 *pn2, fgINT8 *pn3,
02617 fgINT8 *pn4,
02618 fgINT8 *pdil, fgINT8 *pcenter, int length) {
02619 #ifdef __SSE2__
02620 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m128i,16,
02621 _mm_cmpeq_epi8,_mm_set1_epi8,
02622 _mm_and_si128,_mm_or_si128);
02623
02624 #else
02625 #if defined(__MMX__) && defined(__SSE__)
02626 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m64,8,
02627 _mm_cmpeq_pi8,_mm_set1_pi8,
02628 _mm_and_si64,_mm_or_si64);
02629 _mm_empty();
02630 #else
02631 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9;
02632 #endif
02633 #endif
02634 }
02635
02636
02637
02638
02639
02640
02641
02642
02643
02644
02645 inline void flgr_stop_label_collision_4_connex_6_fgINT16(fgINT16 *pn1,fgINT16 *pn2, fgINT16 *pn3,
02646 fgINT16 *pn4,
02647 fgINT16 *pdil, fgINT16 *pcenter, int length) {
02648 #ifdef __SSE2__
02649 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m128i,8,
02650 _mm_cmpeq_epi16,_mm_set1_epi16,
02651 _mm_and_si128,_mm_or_si128);
02652 #else
02653 #if defined(__MMX__) && defined(__SSE__)
02654 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m64,4,
02655 _mm_cmpeq_pi16,_mm_set1_pi16,
02656 _mm_and_si64,_mm_or_si64);
02657 _mm_empty();
02658
02659 #else
02660 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6;
02661 #endif
02662 #endif
02663 }
02664
02665
02666 inline void flgr_stop_label_collision_4_connex_9_fgINT16(fgINT16 *pn0,
02667 fgINT16 *pn1, fgINT16 *pn2, fgINT16 *pn3,
02668 fgINT16 *pn4,
02669 fgINT16 *pdil, fgINT16 *pcenter, int length) {
02670 #ifdef __SSE2__
02671 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m128i,8,
02672 _mm_cmpeq_epi16,_mm_set1_epi16,
02673 _mm_and_si128,_mm_or_si128);
02674 #else
02675 #if defined(__MMX__) && defined(__SSE__)
02676 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m64,4,
02677 _mm_cmpeq_pi16,_mm_set1_pi16,
02678 _mm_and_si64,_mm_or_si64);
02679 _mm_empty();
02680
02681 #else
02682 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9;
02683 #endif
02684 #endif
02685 }
02686
02687
02688
02689
02690
02691
02692
02693
02694
02695 inline void flgr_stop_label_collision_4_connex_6_fgINT32(fgINT32 *pn1,fgINT32 *pn2, fgINT32 *pn3,
02696 fgINT32 *pn4,
02697 fgINT32 *pdil, fgINT32 *pcenter, int length) {
02698 #ifdef __SSE2__
02699 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m128i,4,
02700 _mm_cmpeq_epi32,_mm_set1_epi32,
02701 _mm_and_si128,_mm_or_si128);
02702 #else
02703 #if defined(__MMX__) && defined(__SSE__)
02704 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6_SIMD(__m64,2,
02705 _mm_cmpeq_pi32,_mm_set1_pi32,
02706 _mm_and_si64,_mm_or_si64);
02707 _mm_empty();
02708
02709 #else
02710 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6;
02711 #endif
02712 #endif
02713 }
02714
02715
02716 inline void flgr_stop_label_collision_4_connex_9_fgINT32(fgINT32 *pn0,
02717 fgINT32 *pn1, fgINT32 *pn2, fgINT32 *pn3,
02718 fgINT32 *pn4,
02719 fgINT32 *pdil, fgINT32 *pcenter, int length) {
02720 #ifdef __SSE2__
02721 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m128i,4,
02722 _mm_cmpeq_epi32,_mm_set1_epi32,
02723 _mm_and_si128,_mm_or_si128);
02724 #else
02725 #if defined(__MMX__) && defined(__SSE__)
02726 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9_SIMD(__m64,2,
02727 _mm_cmpeq_pi32,_mm_set1_pi32,
02728 _mm_and_si64,_mm_or_si64);
02729 _mm_empty();
02730
02731 #else
02732 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9;
02733 #endif
02734 #endif
02735 }
02736
02737
02738
02739
02740
02741
02742
02743
02744 inline void flgr_stop_label_collision_4_connex_6_fgFLOAT32(fgFLOAT32 *pn1,fgFLOAT32 *pn2, fgFLOAT32 *pn3,
02745 fgFLOAT32 *pn4,
02746 fgFLOAT32 *pdil, fgFLOAT32 *pcenter, int length) {
02747 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6;
02748 }
02749
02750
02751 inline void flgr_stop_label_collision_4_connex_9_fgFLOAT32(fgFLOAT32 *pn0,
02752 fgFLOAT32 *pn1, fgFLOAT32 *pn2, fgFLOAT32 *pn3,
02753 fgFLOAT32 *pn4,
02754 fgFLOAT32 *pdil, fgFLOAT32 *pcenter, int length) {
02755 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9;
02756 }
02757
02758
02759
02760
02761
02762
02763
02764
02765
02766 inline void flgr_stop_label_collision_4_connex_6_fgFLOAT64(fgFLOAT64 *pn1,fgFLOAT64 *pn2, fgFLOAT64 *pn3,
02767 fgFLOAT64 *pn4,
02768 fgFLOAT64 *pdil, fgFLOAT64 *pcenter, int length) {
02769 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_6;
02770 }
02771
02772
02773 inline void flgr_stop_label_collision_4_connex_9_fgFLOAT64(fgFLOAT64 *pn0,
02774 fgFLOAT64 *pn1, fgFLOAT64 *pn2, fgFLOAT64 *pn3,
02775 fgFLOAT64 *pn4,
02776 fgFLOAT64 *pdil, fgFLOAT64 *pcenter, int length) {
02777 FLGR_MACRO_STOP_LABEL_COLLISION_4_CONNEX_9;
02778 }
02779
02780
02781
02782
02783
02784
02785
02786
02787
02788
02789
02790
02791
02792
02793
02794
02795
02796
02797
02798
02799
02800
02801
02802
02803
02804
02805
02806
02807
02808
02809
02810
02811
02812
02813
02814
02815
02816
02817
02818
02819
02820
02821 #define FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(dtype) \
02822 FLGR_Data1D *neighbor[9]; \
02823 FLGR_Data1D *dil3 = flgr1d_create_signal_from(datsrc->row[0]); \
02824 FLGR_Data1D *dil2 = flgr1d_create_signal_from(datsrc->row[0]); \
02825 FLGR_Data1D *dil1 = flgr1d_create_signal_from(datsrc->row[0]); \
02826 FLGR_Data1D *dil = flgr1d_create_signal_from(datsrc->row[0]); \
02827 FLGR_Data1D *tmp; \
02828 FLGR_Data1D **pout = datdest->row; \
02829 FLGR_Data1D **pin = datsrc->row; \
02830 dtype *pdil; \
02831 dtype *ptmp; \
02832 dtype *pn[9]; \
02833 FLGR_Vector *vecmin = flgr_vector_create(datsrc->spp,datsrc->type); \
02834 dtype min = MIN_##dtype; \
02835 int j,k; \
02836 \
02837 flgr_vector_populate_from_scalar_##dtype(vecmin,min); \
02838 \
02839 neighbor[0] = flgr1d_create_signal_from(datsrc->row[0]); \
02840 neighbor[1] = flgr1d_create_signal_from(datsrc->row[0]); \
02841 neighbor[2] = flgr1d_create_signal_from(datsrc->row[0]); \
02842 neighbor[3] = flgr1d_create_signal_from(datsrc->row[0]); \
02843 neighbor[4] = flgr1d_create_signal_from(datsrc->row[0]); \
02844 neighbor[5] = flgr1d_create_signal_from(datsrc->row[0]); \
02845 neighbor[6] = flgr1d_create_signal_from(datsrc->row[0]); \
02846 neighbor[7] = flgr1d_create_signal_from(datsrc->row[0]); \
02847 neighbor[8] = flgr1d_create_signal_from(datsrc->row[0]); \
02848 \
02849 pn[0] = (dtype *) neighbor[0]->array; \
02850 pn[1] = (dtype *) neighbor[1]->array; \
02851 pn[2] = (dtype *) neighbor[2]->array; \
02852 pn[3] = (dtype *) neighbor[3]->array; \
02853 pn[4] = (dtype *) neighbor[4]->array; \
02854 pn[5] = (dtype *) neighbor[5]->array; \
02855 pn[6] = (dtype *) neighbor[6]->array; \
02856 pn[7] = (dtype *) neighbor[7]->array; \
02857 pn[8] = (dtype *) neighbor[8]->array; \
02858 \
02859 flgr1d_copy_##dtype##_##dtype(neighbor[4],pin[0]); \
02860 flgr1d_copy_##dtype##_##dtype(neighbor[7],pin[1]); \
02861 flgr1d_shift_right_##dtype(neighbor[3],neighbor[4],1,vecmin); \
02862 flgr1d_shift_right_##dtype(neighbor[6],neighbor[7],1,vecmin); \
02863 flgr1d_shift_left_##dtype(neighbor[5],neighbor[4],1,vecmin); \
02864 flgr1d_shift_left_##dtype(neighbor[8],neighbor[7],1,vecmin); \
02865 \
02866 flgr1d_arith_sup_##dtype(dil2,neighbor[4],neighbor[3]); \
02867 flgr1d_arith_sup_##dtype(dil2,dil2,neighbor[5]); \
02868 \
02869 flgr1d_arith_sup_##dtype(dil3,neighbor[6],neighbor[7]); \
02870 flgr1d_arith_sup_##dtype(dil3,dil3,neighbor[8]); \
02871 \
02872 flgr1d_arith_sup_##dtype(pout[0],dil2,dil3); \
02873 \
02874 pdil = pout[0]->array; \
02875 \
02876 flgr_stop_label_collision_8_connex_6_##dtype(pn[3],pn[4],pn[5], \
02877 pn[6],pn[7],pn[8], \
02878 pdil,pn[4], \
02879 dil->length); \
02880 \
02881 for(k=1,j=2 ; j<datsrc->size_y ; k++,j++) { \
02882 \
02883 tmp = neighbor[0]; ptmp=pn[0]; \
02884 neighbor[0]=neighbor[3]; pn[0]=pn[3]; \
02885 neighbor[3]=neighbor[6]; pn[3]=pn[6]; \
02886 neighbor[6]=tmp; pn[6]=ptmp; \
02887 \
02888 tmp = neighbor[1]; ptmp=pn[1]; \
02889 neighbor[1]=neighbor[4]; pn[1]=pn[4]; \
02890 neighbor[4]=neighbor[7]; pn[4]=pn[7]; \
02891 neighbor[7]=tmp; pn[7]=ptmp; \
02892 \
02893 tmp = neighbor[2]; ptmp=pn[2]; \
02894 neighbor[2]=neighbor[5]; pn[2]=pn[5]; \
02895 neighbor[5]=neighbor[8]; pn[5]=pn[8]; \
02896 neighbor[8]=tmp; pn[8]=ptmp; \
02897 \
02898 tmp = dil1; \
02899 dil1 = dil2; \
02900 dil2 = dil3; \
02901 dil3 = tmp; \
02902 \
02903 flgr1d_copy_##dtype##_##dtype(neighbor[7],pin[j]); \
02904 flgr1d_shift_right_##dtype(neighbor[6],neighbor[7],1,vecmin); \
02905 flgr1d_shift_left_##dtype(neighbor[8],neighbor[7],1,vecmin); \
02906 \
02907 flgr1d_arith_sup_##dtype(dil3,neighbor[6],neighbor[7]); \
02908 flgr1d_arith_sup_##dtype(dil3,dil3,neighbor[8]); \
02909 \
02910 flgr1d_arith_sup_##dtype(pout[k],dil2,dil3); \
02911 flgr1d_arith_sup_##dtype(pout[k],pout[k],dil1); \
02912 \
02913 pdil = pout[k]->array; \
02914 \
02915 flgr_stop_label_collision_8_connex_9_##dtype(pn[0],pn[1],pn[2], \
02916 pn[3],pn[4],pn[5], \
02917 pn[6],pn[7],pn[8], \
02918 pdil,pn[4], \
02919 dil->length); \
02920 \
02921 } \
02922 \
02923 tmp = neighbor[0]; ptmp=pn[0]; \
02924 neighbor[0]=neighbor[3]; pn[0]=pn[3]; \
02925 neighbor[3]=neighbor[6]; pn[3]=pn[6]; \
02926 neighbor[6]=tmp; pn[6]=ptmp; \
02927 \
02928 tmp = neighbor[1]; ptmp=pn[1]; \
02929 neighbor[1]=neighbor[4]; pn[1]=pn[4]; \
02930 neighbor[4]=neighbor[7]; pn[4]=pn[7]; \
02931 neighbor[7]=tmp; pn[7]=ptmp; \
02932 \
02933 tmp = neighbor[2]; ptmp=pn[2]; \
02934 neighbor[2]=neighbor[5]; pn[2]=pn[5]; \
02935 neighbor[5]=neighbor[8]; pn[5]=pn[8]; \
02936 neighbor[8]=tmp; pn[8]=ptmp; \
02937 \
02938 tmp = dil1; \
02939 dil1 = dil2; \
02940 dil2 = dil3; \
02941 dil3 = tmp; \
02942 \
02943 flgr1d_arith_sup_##dtype(pout[k],dil1,dil2); \
02944 pdil = pout[k]->array; \
02945 \
02946 flgr_stop_label_collision_8_connex_6_##dtype(pn[0],pn[1],pn[2], \
02947 pn[3],pn[4],pn[5], \
02948 pdil,pn[4], \
02949 dil->length); \
02950 \
02951 \
02952 flgr1d_destroy(neighbor[0]); \
02953 flgr1d_destroy(neighbor[1]); \
02954 flgr1d_destroy(neighbor[2]); \
02955 flgr1d_destroy(neighbor[3]); \
02956 flgr1d_destroy(neighbor[4]); \
02957 flgr1d_destroy(neighbor[5]); \
02958 flgr1d_destroy(neighbor[6]); \
02959 flgr1d_destroy(neighbor[7]); \
02960 flgr1d_destroy(neighbor[8]); \
02961 \
02962 flgr1d_destroy(dil1); \
02963 flgr1d_destroy(dil2); \
02964 flgr1d_destroy(dil3); \
02965 flgr1d_destroy(dil); \
02966 flgr_vector_destroy(vecmin)
02967
02968
02969
02970
02971
02972 void flgr2d_dilate_preserving_skiz_fast_8_connex_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
02973
02974 FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(fgUINT8);
02975 }
02976
02977 void flgr2d_dilate_preserving_skiz_fast_8_connex_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
02978
02979 FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(fgUINT16);
02980 }
02981
02982 void flgr2d_dilate_preserving_skiz_fast_8_connex_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
02983
02984 FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(fgUINT32);
02985 }
02986
02987 void flgr2d_dilate_preserving_skiz_fast_8_connex_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
02988
02989 FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(fgINT8);
02990 }
02991
02992 void flgr2d_dilate_preserving_skiz_fast_8_connex_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
02993
02994 FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(fgINT16);
02995 }
02996
02997 void flgr2d_dilate_preserving_skiz_fast_8_connex_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
02998
02999 FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(fgINT32);
03000 }
03001
03002 void flgr2d_dilate_preserving_skiz_fast_8_connex_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03003
03004 FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(fgFLOAT32);
03005 }
03006
03007 void flgr2d_dilate_preserving_skiz_fast_8_connex_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03008
03009 FLGR_MACRO_DILATE_8_CONNEXITY_SKIZ(fgFLOAT64);
03010 }
03011
03012
03013
03014
03015
03016
03017
03018
03019
03020
03021
03022
03023
03024
03025
03026
03027
03028 #define FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(dtype) \
03029 FLGR_Data1D *neighbor[5]; \
03030 FLGR_Data1D *dil1 = flgr1d_create_signal_from(datsrc->row[0]); \
03031 FLGR_Data1D *dil2 = flgr1d_create_signal_from(datsrc->row[0]); \
03032 FLGR_Data1D *tmp; \
03033 FLGR_Data1D **pout = datdest->row; \
03034 FLGR_Data1D **pin = datsrc->row; \
03035 dtype *pdil; \
03036 dtype *ptmp; \
03037 dtype *pn[5]; \
03038 FLGR_Vector *vecmin = flgr_vector_create(datsrc->spp,datsrc->type); \
03039 dtype min = MIN_##dtype; \
03040 int j,k,length = dil1->length; \
03041 \
03042 flgr_vector_populate_from_scalar_##dtype(vecmin,min); \
03043 \
03044 neighbor[0] = flgr1d_create_signal_from(datsrc->row[0]); \
03045 neighbor[1] = flgr1d_create_signal_from(datsrc->row[0]); \
03046 neighbor[2] = flgr1d_create_signal_from(datsrc->row[0]); \
03047 neighbor[3] = flgr1d_create_signal_from(datsrc->row[0]); \
03048 neighbor[4] = flgr1d_create_signal_from(datsrc->row[0]); \
03049 \
03050 pn[0] = (dtype *) neighbor[0]->array; \
03051 pn[1] = (dtype *) neighbor[1]->array; \
03052 pn[2] = (dtype *) neighbor[2]->array; \
03053 pn[3] = (dtype *) neighbor[3]->array; \
03054 pn[4] = (dtype *) neighbor[4]->array; \
03055 \
03056 flgr1d_copy_##dtype##_##dtype(neighbor[2],pin[0]); \
03057 flgr1d_copy_##dtype##_##dtype(neighbor[4],pin[1]); \
03058 flgr1d_shift_right_##dtype(neighbor[1],neighbor[2],1,vecmin); \
03059 flgr1d_shift_left_##dtype(neighbor[3],neighbor[2],1,vecmin); \
03060 \
03061 flgr1d_arith_sup_##dtype(dil1,neighbor[1],neighbor[2]); \
03062 flgr1d_arith_sup_##dtype(dil2,neighbor[3],neighbor[4]); \
03063 flgr1d_arith_sup_##dtype(pout[0],dil1,dil2); \
03064 \
03065 pdil = pout[0]->array; \
03066 \
03067 flgr_stop_label_collision_4_connex_6_##dtype(pn[1],pn[2], \
03068 pn[3],pn[4], \
03069 pdil,pn[2], \
03070 length); \
03071 \
03072 for(k=1,j=2 ; j<datsrc->size_y ; k++,j++) { \
03073 \
03074 tmp = neighbor[0]; ptmp=pn[0]; \
03075 neighbor[0]=neighbor[2]; pn[0]=pn[2]; \
03076 neighbor[2]=neighbor[4]; pn[2]=pn[4]; \
03077 neighbor[4]=tmp; pn[4]=ptmp; \
03078 \
03079 flgr1d_copy_##dtype##_##dtype(neighbor[4],pin[j]); \
03080 flgr1d_shift_right_##dtype(neighbor[1],neighbor[2],1,vecmin); \
03081 flgr1d_shift_left_##dtype(neighbor[3],neighbor[2],1,vecmin); \
03082 \
03083 flgr1d_arith_sup_##dtype(dil1,neighbor[0],neighbor[1]); \
03084 flgr1d_arith_sup_##dtype(dil2,neighbor[2],neighbor[3]); \
03085 flgr1d_arith_sup_##dtype(pout[k],dil1,dil2); \
03086 flgr1d_arith_sup_##dtype(pout[k],pout[k],neighbor[4]); \
03087 \
03088 pdil = pout[k]->array; \
03089 \
03090 flgr_stop_label_collision_4_connex_9_##dtype(pn[0], \
03091 pn[1], \
03092 pn[2], \
03093 pn[3], \
03094 pn[4], \
03095 pdil,pn[2], \
03096 length); \
03097 \
03098 } \
03099 \
03100 tmp = neighbor[0]; ptmp=pn[0]; \
03101 neighbor[0]=neighbor[2]; pn[0]=pn[2]; \
03102 neighbor[2]=neighbor[4]; pn[2]=pn[4]; \
03103 neighbor[4]=tmp; pn[4]=ptmp; \
03104 \
03105 flgr1d_shift_right_##dtype(neighbor[1],neighbor[2],1,vecmin); \
03106 flgr1d_shift_left_##dtype(neighbor[3],neighbor[2],1,vecmin); \
03107 \
03108 flgr1d_arith_sup_##dtype(dil1,neighbor[0],neighbor[1]); \
03109 flgr1d_arith_sup_##dtype(dil2,neighbor[2],neighbor[3]); \
03110 flgr1d_arith_sup_##dtype(pout[k],dil1,dil2); \
03111 pdil = pout[k]->array; \
03112 \
03113 flgr_stop_label_collision_4_connex_6_##dtype(pn[0],pn[1], \
03114 pn[2],pn[3], \
03115 pdil,pn[2], \
03116 length); \
03117 \
03118 \
03119 flgr1d_destroy(neighbor[0]); \
03120 flgr1d_destroy(neighbor[1]); \
03121 flgr1d_destroy(neighbor[2]); \
03122 flgr1d_destroy(neighbor[3]); \
03123 flgr1d_destroy(neighbor[4]); \
03124 \
03125 flgr1d_destroy(dil1); \
03126 flgr1d_destroy(dil2); \
03127 flgr_vector_destroy(vecmin)
03128
03129
03130
03131
03132
03133 void flgr2d_dilate_preserving_skiz_fast_4_connex_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03134
03135 FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(fgUINT8);
03136 }
03137
03138 void flgr2d_dilate_preserving_skiz_fast_4_connex_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03139
03140 FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(fgUINT16);
03141 }
03142
03143 void flgr2d_dilate_preserving_skiz_fast_4_connex_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03144
03145 FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(fgUINT32);
03146 }
03147
03148 void flgr2d_dilate_preserving_skiz_fast_4_connex_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03149
03150 FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(fgINT8);
03151 }
03152
03153 void flgr2d_dilate_preserving_skiz_fast_4_connex_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03154
03155 FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(fgINT16);
03156 }
03157
03158 void flgr2d_dilate_preserving_skiz_fast_4_connex_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03159
03160 FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(fgINT32);
03161 }
03162
03163 void flgr2d_dilate_preserving_skiz_fast_4_connex_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03164
03165 FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(fgFLOAT32);
03166 }
03167
03168 void flgr2d_dilate_preserving_skiz_fast_4_connex_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03169
03170 FLGR_MACRO_DILATE_4_CONNEXITY_SKIZ(fgFLOAT64);
03171 }
03172
03173
03174
03175
03176
03177
03178
03179
03180
03181
03182
03183
03184
03185
03186
03187
03188
03189
03190 #define FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(dtype) \
03191 FLGR_Data1D *neighbor[9]; \
03192 FLGR_Data1D *dil1 = flgr1d_create_signal_from(datsrc->row[0]); \
03193 FLGR_Data1D *dil2 = flgr1d_create_signal_from(datsrc->row[0]); \
03194 FLGR_Data1D *dil3 = flgr1d_create_signal_from(datsrc->row[0]); \
03195 FLGR_Data1D *tmp; \
03196 FLGR_Data1D **pout = datdest->row; \
03197 FLGR_Data1D **pin = datsrc->row; \
03198 dtype *pdil; \
03199 dtype *ptmp; \
03200 dtype *pn[9]; \
03201 FLGR_Vector *vecmin = flgr_vector_create(datsrc->spp,datsrc->type); \
03202 dtype min = MIN_##dtype; \
03203 int j,k; \
03204 int length = dil1->length; \
03205 \
03206 flgr_vector_populate_from_scalar_##dtype(vecmin,min); \
03207 \
03208 neighbor[0] = flgr1d_create_signal_from(datsrc->row[0]); \
03209 neighbor[1] = flgr1d_create_signal_from(datsrc->row[0]); \
03210 neighbor[2] = flgr1d_create_signal_from(datsrc->row[0]); \
03211 neighbor[3] = flgr1d_create_signal_from(datsrc->row[0]); \
03212 neighbor[4] = flgr1d_create_signal_from(datsrc->row[0]); \
03213 neighbor[5] = flgr1d_create_signal_from(datsrc->row[0]); \
03214 neighbor[6] = flgr1d_create_signal_from(datsrc->row[0]); \
03215 neighbor[7] = flgr1d_create_signal_from(datsrc->row[0]); \
03216 neighbor[8] = flgr1d_create_signal_from(datsrc->row[0]); \
03217 \
03218 pn[0] = (dtype *) neighbor[0]->array; \
03219 pn[1] = (dtype *) neighbor[1]->array; \
03220 pn[2] = (dtype *) neighbor[2]->array; \
03221 pn[3] = (dtype *) neighbor[3]->array; \
03222 pn[4] = (dtype *) neighbor[4]->array; \
03223 pn[5] = (dtype *) neighbor[5]->array; \
03224 pn[6] = (dtype *) neighbor[6]->array; \
03225 pn[7] = (dtype *) neighbor[7]->array; \
03226 pn[8] = (dtype *) neighbor[8]->array; \
03227 \
03228 flgr1d_copy_##dtype##_##dtype(neighbor[4],pin[0]); \
03229 flgr1d_copy_##dtype##_##dtype(neighbor[7],pin[1]); \
03230 flgr1d_shift_right_##dtype(neighbor[3],neighbor[4],1,vecmin); \
03231 flgr1d_shift_left_##dtype(neighbor[5],neighbor[4],1,vecmin); \
03232 flgr1d_shift_right_##dtype(neighbor[6],neighbor[7],1,vecmin); \
03233 flgr1d_shift_left_##dtype(neighbor[8],neighbor[7],1,vecmin); \
03234 \
03235 flgr1d_arith_sup_##dtype(dil2,neighbor[3],neighbor[4]); \
03236 flgr1d_arith_sup_##dtype(dil3,neighbor[5],neighbor[7]); \
03237 flgr1d_arith_sup_##dtype(pout[0],dil2,dil3); \
03238 flgr1d_arith_sup_##dtype(pout[0],pout[0],neighbor[8]); \
03239 \
03240 pdil = pout[0]->array; \
03241 \
03242 flgr_stop_label_collision_6_connex_p1_6_##dtype(pn[3],pn[4],pn[5], \
03243 pn[7],pn[8], \
03244 pdil,pn[4], \
03245 length); \
03246 \
03247 for(k=1,j=2 ; j<datsrc->size_y ; k++,j++) { \
03248 \
03249 tmp = neighbor[0]; ptmp=pn[0]; \
03250 neighbor[0]=neighbor[3]; pn[0]=pn[3]; \
03251 neighbor[3]=neighbor[6]; pn[3]=pn[6]; \
03252 neighbor[6]=tmp; pn[6]=ptmp; \
03253 \
03254 tmp = neighbor[1]; ptmp=pn[1]; \
03255 neighbor[1]=neighbor[4]; pn[1]=pn[4]; \
03256 neighbor[4]=neighbor[7]; pn[4]=pn[7]; \
03257 neighbor[7]=tmp; pn[7]=ptmp; \
03258 \
03259 tmp = neighbor[2]; ptmp=pn[2]; \
03260 neighbor[2]=neighbor[5]; pn[2]=pn[5]; \
03261 neighbor[5]=neighbor[8]; pn[5]=pn[8]; \
03262 neighbor[8]=tmp; pn[8]=ptmp; \
03263 \
03264 flgr1d_copy_##dtype##_##dtype(neighbor[7],pin[j]); \
03265 flgr1d_shift_right_##dtype(neighbor[6],neighbor[7],1,vecmin); \
03266 flgr1d_shift_left_##dtype(neighbor[8],neighbor[7],1,vecmin); \
03267 \
03268 pdil = pout[k]->array; \
03269 \
03270 if(k%2==0) { \
03271 flgr1d_arith_sup_##dtype(dil1,neighbor[1],neighbor[2]); \
03272 flgr1d_arith_sup_##dtype(dil2,neighbor[3],neighbor[4]); \
03273 flgr1d_arith_sup_##dtype(dil3,neighbor[5],neighbor[7]); \
03274 flgr1d_arith_sup_##dtype(pout[k],dil1,dil2); \
03275 flgr1d_arith_sup_##dtype(pout[k],pout[k],dil3); \
03276 flgr1d_arith_sup_##dtype(pout[k],pout[k],neighbor[8]); \
03277 \
03278 flgr_stop_label_collision_6_connex_p1_9_##dtype( pn[1],pn[2], \
03279 pn[3],pn[4],pn[5], \
03280 pn[7],pn[8], \
03281 pdil,pn[4], \
03282 length); \
03283 \
03284 }else { \
03285 flgr1d_arith_sup_##dtype(dil1,neighbor[0],neighbor[1]); \
03286 flgr1d_arith_sup_##dtype(dil2,neighbor[3],neighbor[4]); \
03287 flgr1d_arith_sup_##dtype(dil3,neighbor[5],neighbor[7]); \
03288 flgr1d_arith_sup_##dtype(pout[k],dil1,dil2); \
03289 flgr1d_arith_sup_##dtype(pout[k],pout[k],dil3); \
03290 flgr1d_arith_sup_##dtype(pout[k],pout[k],neighbor[6]); \
03291 \
03292 flgr_stop_label_collision_6_connex_p2_9_##dtype( pn[0],pn[1], \
03293 pn[3],pn[4],pn[5], \
03294 pn[6],pn[7], \
03295 pdil,pn[4], \
03296 length); \
03297 \
03298 } \
03299 \
03300 } \
03301 \
03302 \
03303 tmp = neighbor[0]; ptmp=pn[0]; \
03304 neighbor[0]=neighbor[3]; pn[0]=pn[3]; \
03305 neighbor[3]=neighbor[6]; pn[3]=pn[6]; \
03306 neighbor[6]=tmp; pn[6]=ptmp; \
03307 \
03308 tmp = neighbor[1]; ptmp=pn[1]; \
03309 neighbor[1]=neighbor[4]; pn[1]=pn[4]; \
03310 neighbor[4]=neighbor[7]; pn[4]=pn[7]; \
03311 neighbor[7]=tmp; pn[7]=ptmp; \
03312 \
03313 tmp = neighbor[2]; ptmp=pn[2]; \
03314 neighbor[2]=neighbor[5]; pn[2]=pn[5]; \
03315 neighbor[5]=neighbor[8]; pn[5]=pn[8]; \
03316 neighbor[8]=tmp; pn[8]=ptmp; \
03317 \
03318 pdil = pout[k]->array; \
03319 if(k%2==0) { \
03320 flgr1d_arith_sup_##dtype(dil1,neighbor[1],neighbor[2]); \
03321 flgr1d_arith_sup_##dtype(dil2,neighbor[3],neighbor[4]); \
03322 flgr1d_arith_sup_##dtype(pout[k],dil1,dil2); \
03323 flgr1d_arith_sup_##dtype(pout[k],pout[k],neighbor[5]); \
03324 \
03325 flgr_stop_label_collision_6_connex_p1_6_##dtype(pn[3],pn[4],pn[5], \
03326 pn[1],pn[2], \
03327 pdil,pn[4], \
03328 length); \
03329 \
03330 }else { \
03331 flgr1d_arith_sup_##dtype(dil1,neighbor[0],neighbor[1]); \
03332 flgr1d_arith_sup_##dtype(dil2,neighbor[3],neighbor[4]); \
03333 flgr1d_arith_sup_##dtype(pout[k],dil1,dil2); \
03334 flgr1d_arith_sup_##dtype(pout[k],pout[k],neighbor[5]); \
03335 \
03336 flgr_stop_label_collision_6_connex_p2_6_##dtype(pn[3],pn[4],pn[5], \
03337 pn[0],pn[1], \
03338 pdil,pn[4], \
03339 length); \
03340 \
03341 } \
03342 \
03343 \
03344 flgr1d_destroy(neighbor[0]); \
03345 flgr1d_destroy(neighbor[1]); \
03346 flgr1d_destroy(neighbor[2]); \
03347 flgr1d_destroy(neighbor[3]); \
03348 flgr1d_destroy(neighbor[4]); \
03349 flgr1d_destroy(neighbor[5]); \
03350 flgr1d_destroy(neighbor[6]); \
03351 flgr1d_destroy(neighbor[7]); \
03352 flgr1d_destroy(neighbor[8]); \
03353 \
03354 flgr1d_destroy(dil1); \
03355 flgr1d_destroy(dil2); \
03356 flgr1d_destroy(dil3); \
03357 flgr_vector_destroy(vecmin)
03358
03359
03360
03361
03362
03363 void flgr2d_dilate_preserving_skiz_fast_6_connex_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03364
03365 FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(fgUINT8);
03366 }
03367
03368 void flgr2d_dilate_preserving_skiz_fast_6_connex_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03369
03370 FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(fgUINT16);
03371 }
03372
03373 void flgr2d_dilate_preserving_skiz_fast_6_connex_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03374
03375 FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(fgUINT32);
03376 }
03377
03378 void flgr2d_dilate_preserving_skiz_fast_6_connex_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03379
03380 FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(fgINT8);
03381 }
03382
03383 void flgr2d_dilate_preserving_skiz_fast_6_connex_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03384
03385 FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(fgINT16);
03386 }
03387
03388 void flgr2d_dilate_preserving_skiz_fast_6_connex_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03389
03390 FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(fgINT32);
03391 }
03392
03393 void flgr2d_dilate_preserving_skiz_fast_6_connex_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03394
03395 FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(fgFLOAT32);
03396 }
03397
03398 void flgr2d_dilate_preserving_skiz_fast_6_connex_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *datsrc) {
03399
03400 FLGR_MACRO_DILATE_6_CONNEXITY_SKIZ(fgFLOAT64);
03401 }
03402
03403