X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=images%2Fsig-seg.c;h=d3537840cf5a4aa295c7edd0cd52c8e96c6158f6;hb=0db6e10eac28f38bfc3b325b13ad95107c58ce1e;hp=082a1c8e5bcfc9dd02d832f677090431796a48ab;hpb=a4fe009d3366b0a3e119713b0ecc7fc0070efdfa;p=libucw.git diff --git a/images/sig-seg.c b/images/sig-seg.c index 082a1c8e..d3537840 100644 --- a/images/sig-seg.c +++ b/images/sig-seg.c @@ -9,12 +9,12 @@ #undef LOCAL_DEBUG -#include "ucw/lib.h" -#include "ucw/conf.h" -#include "ucw/heap.h" -#include "images/images.h" -#include "images/signature.h" -#include "images/math.h" +#include +#include +#include +#include +#include +#include #include @@ -93,7 +93,7 @@ prequant_heap_cmp(struct image_sig_region *a, struct image_sig_region *b) #define ASORT_PREFIX(x) prequant_##x #define ASORT_KEY_TYPE uns -#include "ucw/sorter/array-simple.h" +#include static uns prequant(struct image_sig_block *blocks, uns blocks_count, struct image_sig_region *regions) @@ -122,7 +122,7 @@ prequant(struct image_sig_block *blocks, uns blocks_count, struct image_sig_regi if (region->count < 2 || region->e < image_sig_prequant_thresholds[regions_count - 1] * blocks_count) { - HEAP_DELMIN(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP); + HEAP_DELETE_MIN(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP); continue; } @@ -218,9 +218,8 @@ prequant(struct image_sig_block *blocks, uns blocks_count, struct image_sig_regi } prequant_finish_region(region); prequant_finish_region(region2); - HEAP_INCREASE(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP, 1); - heap[++heap_count] = region2; - HEAP_INSERT(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP); + HEAP_INCREASE(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP, 1, region); + HEAP_INSERT(struct image_sig_region *, heap, heap_count, prequant_heap_cmp, HEAP_SWAP, region2); } DBG("Pre-quantized to %u regions", regions_count);