From: Pavel Charvat Date: Mon, 2 Oct 2006 14:34:57 +0000 (+0200) Subject: more MJ's corrections... to be continue X-Git-Tag: holmes-import~514 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;ds=sidebyside;h=26b9fc31aa816c2c5eaa2f5b10d8a988e4d11cf0;p=libucw.git more MJ's corrections... to be continue --- diff --git a/images/io-libjpeg.c b/images/io-libjpeg.c index 52edd03b..1d3d37c5 100644 --- a/images/io-libjpeg.c +++ b/images/io-libjpeg.c @@ -221,7 +221,8 @@ libjpeg_app1_preprocessor(j_decompress_ptr cinfo) { struct libjpeg_read_internals *i = (struct libjpeg_read_internals *)cinfo; struct image_io *io = i->err.io; - uns len = (libjpeg_read_byte(i) << 8) + libjpeg_read_byte(i); + uns len = libjpeg_read_byte(i) << 8; + len += libjpeg_read_byte(i); DBG("Found APP1 marker, len=%u", len); if (len < 2) return TRUE; diff --git a/images/io-main.c b/images/io-main.c index 230a7cfd..7b176b70 100644 --- a/images/io-main.c +++ b/images/io-main.c @@ -344,7 +344,7 @@ image_io_read_data_finish(struct image_io_read_data_internals *rdi, struct image /* Merge with background */ if ((io->flags ^ rdi->image->flags) & IMAGE_ALPHA) { - DBG("Aplying background"); + DBG("Applying background"); uns flags = rdi->image->flags & ~IMAGE_ALPHA; if (!(rdi->need_transformations = (flags ^ io->flags) & (IMAGE_NEW_FLAGS & ~IMAGE_PIXELS_ALIGNED))) flags = io->flags; diff --git a/images/object.c b/images/object.c index d817e1c9..0375fdd9 100644 --- a/images/object.c +++ b/images/object.c @@ -87,7 +87,7 @@ error: void put_image_obj_signature(struct odes *o, struct image_signature *sig) { - /* signatures should be short enough to fit one attribute */ + /* signatures should be short enough to in a single attribute */ byte buf[MAX_ATTR_SIZE]; uns size = image_signature_size(sig->len); ASSERT(MAX_ATTR_SIZE > BASE224_ENC_LENGTH(size)); diff --git a/images/sig-cmp.c b/images/sig-cmp.c index 0e9454e3..b420f067 100644 --- a/images/sig-cmp.c +++ b/images/sig-cmp.c @@ -1,5 +1,5 @@ /* - * Image Library -- Comparitions of image signatures + * Image Library -- Comparisions of image signatures * * (c) 2006 Pavel Charvat * diff --git a/images/signature.h b/images/signature.h index de6edaaa..20417476 100644 --- a/images/signature.h +++ b/images/signature.h @@ -22,7 +22,7 @@ struct image_vector { byte f[IMAGE_VEC_F]; /* texture features */ } PACKED; -/* Fetures for image regions (16 bytes) */ +/* Features for image regions (16 bytes) */ struct image_region { byte f[IMAGE_VEC_F]; /* texture features - L, u, v, LH, HL, HH */ byte h[IMAGE_REG_H]; /* shape/pos features - I1, I2, I3, X, Y */ @@ -34,24 +34,24 @@ struct image_region { /* Image signature (usually 16 + len * 16 bytes) */ struct image_signature { - byte len; /* Number of regions */ + byte len; /* number of regions */ byte flags; /* IMAGE_SIG_xxx */ - u16 cols; /* Image width */ - u16 rows; /* Image height */ - u16 df; /* Average weighted f dist */ - u16 dh; /* Average weighted h dist */ - struct image_vector vec; /* Average features of all regions... simple signature */ - struct image_region reg[IMAGE_REG_MAX];/* Feature vector for every region */ + u16 cols; /* image width */ + u16 rows; /* image height */ + u16 df; /* average weighted f dist */ + u16 dh; /* average weighted h dist */ + struct image_vector vec; /* average features of all regions... simple signature */ + struct image_region reg[IMAGE_REG_MAX];/* feature vector for every region */ }; struct image_cluster { union { struct { - s32 dot; /* Dot product of the splitting plane */ - s8 vec[IMAGE_VEC_F]; /* Normal vector of the splitting plane */ + s32 dot; /* dot product of the splitting plane */ + s8 vec[IMAGE_VEC_F]; /* normal vector of the splitting plane */ }; struct { - u64 pos; /* Cluster size in bytes */ + u64 pos; /* cluster size in bytes */ }; }; };