Last change
on this file since 824 was
821,
checked in by meunier, 8 years ago
|
- Added several versions of rosenfeld: { SLOW, FAST } x { FEATURES, NO_FEATURES }
- Added native linux compilation support
- Added a script to check results natively
- Started to refactor nrc code
|
File size:
1.3 KB
|
Rev | Line | |
---|
[821] | 1 | /* ------------------ */ |
---|
| 2 | /* --- mca_warp.c --- */ |
---|
| 3 | /* ------------------ */ |
---|
| 4 | |
---|
| 5 | /* |
---|
| 6 | * Copyright (c) 2016 Lionel Lacassagne, LIP6, UPMC, CNRS |
---|
| 7 | * Init : 2016/03/03 |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include <stdio.h> |
---|
| 11 | #include <stdlib.h> |
---|
| 12 | #include <stddef.h> |
---|
| 13 | #include <string.h> |
---|
| 14 | #include <math.h> |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | #include "nrc_os_config.h" |
---|
| 18 | #include "nrc.h" |
---|
| 19 | |
---|
| 20 | #if TARET_OS == GIETVM |
---|
| 21 | #include <user_barrier.h> |
---|
| 22 | #endif |
---|
| 23 | |
---|
| 24 | #include "util.h" |
---|
| 25 | #include "ecc_common.h" |
---|
| 26 | #include "palette.h" |
---|
| 27 | #include "bmpNR.h" |
---|
| 28 | #include "mca.h" |
---|
| 29 | #include "str_ext.h" |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | // --------------------------------------------------------------- |
---|
| 33 | void line0Labeling_Warp(uint8 ** X, int i, int width, uint32 ** E) |
---|
| 34 | // --------------------------------------------------------------- |
---|
| 35 | { |
---|
| 36 | int j; |
---|
| 37 | uint8 x; |
---|
| 38 | uint32 e4; |
---|
| 39 | uint32 r4; |
---|
| 40 | |
---|
| 41 | // prologue |
---|
| 42 | x = X[i][0]; |
---|
| 43 | if (x) { |
---|
| 44 | E[i][0] = i * width + 1; |
---|
| 45 | } |
---|
| 46 | else { |
---|
| 47 | E[i][0] = 0; |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | // boucle et epilogue |
---|
| 51 | for (j = 1; j <= width - 1; j++) { |
---|
| 52 | x = X[i][j]; |
---|
| 53 | if (x) { |
---|
| 54 | e4 = E[i][j-1]; |
---|
| 55 | |
---|
| 56 | if (e4 == 0) { |
---|
| 57 | E[i][j] = i * width + 1; |
---|
| 58 | } |
---|
| 59 | else { |
---|
| 60 | E[i][j] = e4; |
---|
| 61 | } |
---|
| 62 | } |
---|
| 63 | else { |
---|
| 64 | E[i][j] = 0; |
---|
| 65 | } |
---|
| 66 | } |
---|
| 67 | } |
---|
| 68 | |
---|
Note: See
TracBrowser
for help on using the repository browser.