diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-02-21 02:45:19 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-02-21 02:45:19 +0000 |
commit | 3fa9616c8b9028b5411e9b4a68705597650920e5 (patch) | |
tree | 92565bf9b3951b466cc9e9aee8ef7a09c0882733 | |
parent | a51b2e875b20fd539768e631358b9fa50d17ffd5 (diff) | |
download | netpbm-mirror-3fa9616c8b9028b5411e9b4a68705597650920e5.tar.gz netpbm-mirror-3fa9616c8b9028b5411e9b4a68705597650920e5.tar.xz netpbm-mirror-3fa9616c8b9028b5411e9b4a68705597650920e5.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2131 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | converter/other/cameratopam/camera.c | 15 | ||||
-rw-r--r-- | converter/other/cameratopam/foveon.c | 20 |
2 files changed, 25 insertions, 10 deletions
diff --git a/converter/other/cameratopam/camera.c b/converter/other/cameratopam/camera.c index 254b6710..4008dbb2 100644 --- a/converter/other/cameratopam/camera.c +++ b/converter/other/cameratopam/camera.c @@ -687,15 +687,22 @@ static int radc_token (int tree) void kodak_radc_load_raw() { - int row, col, tree, nreps, rep, step, i, c, s, r, x, y, val; + int row, col, tree, nreps, rep, step, c, s, r, x, y, val; + unsigned int i; short last[3] = { 16,16,16 }, mul[3], buf[3][3][386]; init_decoder(); getbits(ifp, -1); - for (i=0; i < sizeof(buf)/sizeof(short); i++) - buf[0][0][i] = 2048; + for (i = 0; i < 3; ++i) { + unsigned int j; + for (j = 0; j < 3; ++j) { + unsigned int k; + buf[i][j][k] = 2048; + } + } for (row=0; row < height; row+=4) { - for (i=0; i < 3; i++) + unsigned int i; + for (i = 0; i < 3; ++i) mul[i] = getbits(ifp, 6); FORC3 { val = ((0x1000000/last[c] + 0x7ff) >> 12) * mul[c]; diff --git a/converter/other/cameratopam/foveon.c b/converter/other/cameratopam/foveon.c index 78e40baf..aa42da36 100644 --- a/converter/other/cameratopam/foveon.c +++ b/converter/other/cameratopam/foveon.c @@ -474,9 +474,13 @@ foveon_interpolate(float coeff[3][4]) { black = calloc (height, sizeof *black); for (row=0; row < height; row++) { - for (i=0; i < 6; i++) - ddft[0][0][i] = ddft[1][0][i] + - row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]); + unsigned int i; + for (i=0; i < 3; ++i) { + unsigned int j; + for (j = 0; j < 2; ++j) + ddft[0][i][j] = ddft[1][i][j] + + row / (height-1.0) * (ddft[2][i][j] - ddft[1][i][j]); + } FORC3 black[row][c] = ( foveon_avg (image[row*width]+c, dscr[0], cfilt) + foveon_avg (image[row*width]+c, dscr[1], cfilt) * 3 @@ -522,9 +526,13 @@ foveon_interpolate(float coeff[3][4]) { FORC3 black[row][c] += fsum[c]/2 + total[c]/(total[3]*100.0); for (row=0; row < height; row++) { - for (i=0; i < 6; i++) - ddft[0][0][i] = ddft[1][0][i] + - row / (height-1.0) * (ddft[2][0][i] - ddft[1][0][i]); + unsigned int i; + for (i = 0; i < 3; ++i) { + unsigned int j; + for (j = 0; j < 2; ++j) + ddft[0][i][j] = ddft[1][i][j] + + row / (height-1.0) * (ddft[2][i][j] - ddft[1][i][j]); + } pix = (short*)image[row*width]; memcpy (prev, pix, sizeof prev); frow = row / (height-1.0) * (dim[2]-1); |