]> mj.ucw.cz Git - libucw.git/commitdiff
Images: Heap use fixup
authorMartin Mares <mj@ucw.cz>
Tue, 30 Oct 2012 20:20:21 +0000 (21:20 +0100)
committerMartin Mares <mj@ucw.cz>
Tue, 30 Oct 2012 20:20:21 +0000 (21:20 +0100)
images/sig-seg.c

index fae309ff11fece9c06429d20beac430b0a9343b3..d3537840cf5a4aa295c7edd0cd52c8e96c6158f6 100644 (file)
@@ -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);