#ifndef _IMAGES_SIGNATURE_H
#define _IMAGES_SIGNATURE_H
-#include "lib/fastbuf.h"
-
/* Configuration */
extern uns image_sig_min_width, image_sig_min_height;
extern uns *image_sig_prequant_thresholds;
union {
struct {
s32 dot; /* Dot product of the splitting plane */
- byte vec[IMAGE_VEC_F]; /* Normal vector of the splitting plane */
- };
+ s8 vec[IMAGE_VEC_F]; /* Normal vector of the splitting plane */
+ } PACKED;
struct {
u64 pos; /* Cluster size in bytes */
- };
- };
-};
+ } PACKED;
+ } PACKED;
+} PACKED;
static inline uns
image_signature_size(uns len)
u32 f[IMAGE_VEC_F];
};
-/* sig-fb.c */
-
-#define IMAGE_VECTOR_SIZE (sizeof(struct image_vector))
-
-static inline uns
-image_vector_read(struct fastbuf *fb, struct image_vector *vec)
-{
- breadb(fb, vec, sizeof(*vec));
- return IMAGE_VECTOR_SIZE;
-}
-
-static inline uns
-image_vector_write(struct fastbuf *fb, struct image_vector *vec)
-{
- bwrite(fb, vec, sizeof(*vec));
- return IMAGE_VECTOR_SIZE;
-}
-
-static inline uns
-image_signature_peek_size(struct fastbuf *fb)
-{
- return image_signature_size(bpeekc(fb));
-}
-
-uns image_signature_read(struct fastbuf *fb, struct image_signature *sig);
-uns image_signature_write(struct fastbuf *fb, struct image_signature *sig);
-
/* sig-init.c */
int compute_image_signature(struct image_thread *thread, struct image_signature *sig, struct image *image);