| 20 |
|
ncp->finp = stdin; |
| 21 |
|
ncp->inpname = "<stdin>"; |
| 22 |
|
ncp->format = 'a'; |
| 23 |
– |
ncp->swapped = 0; |
| 23 |
|
ncp->res.rt = PIXSTANDARD; |
| 24 |
|
if (!progname) progname = "norm_codec"; |
| 25 |
|
} |
| 124 |
|
int |
| 125 |
|
decode_normal_next(FVECT nrm, NORMCODEC *ncp) |
| 126 |
|
{ |
| 127 |
< |
int32 c = getint(4, ncp->finp); |
| 127 |
> |
static int32 lastc; |
| 128 |
> |
static FVECT lastv; |
| 129 |
> |
int32 c = getint(4, ncp->finp); |
| 130 |
|
|
| 131 |
|
if (c == EOF && feof(ncp->finp)) |
| 132 |
|
return -1; |
| 133 |
|
|
| 134 |
|
ncp->curpos += 4; |
| 135 |
|
|
| 136 |
< |
decodedir(nrm, c); |
| 137 |
< |
|
| 136 |
> |
if (c == lastc) { /* optimization */ |
| 137 |
> |
VCOPY(nrm, lastv); |
| 138 |
> |
} else { |
| 139 |
> |
decodedir(nrm, c); |
| 140 |
> |
if (c) { |
| 141 |
> |
lastc = c; |
| 142 |
> |
VCOPY(lastv, nrm); |
| 143 |
> |
} |
| 144 |
> |
} |
| 145 |
|
return (c != 0); |
| 146 |
|
} |
| 147 |
|
|