return sum;
}
-static int cmp(const uint64_t *a, const uint64_t *b)
+static int cmp(const void *x, const void *y)
{
+ const uint64_t *a = x, *b = y;
return *a < *b ? -1 : ( *a > *b ? 1 : 0 );
}
}
/* get threshold */
- qsort(sortsignature, elemcat->elem_count, sizeof(uint64_t), (void*) cmp);
+ qsort(sortsignature, elemcat->elem_count, sizeof(uint64_t), cmp);
th = sortsignature[(int) (elemcat->elem_count*0.333)];
/* ternarize */
}
/* confidence */
- qsort(conflist, DIFFELEM_SIZE, sizeof(uint64_t), (void*) cmp);
+ qsort(conflist, DIFFELEM_SIZE, sizeof(uint64_t), cmp);
fs->confidence = FFMIN(conflist[DIFFELEM_SIZE/2], 255);
/* coarsesignature */
}
flush_put_bits(&buf);
- fwrite(buffer, 1, put_bits_count(&buf)/8, f);
+ fwrite(buffer, 1, put_bytes_output(&buf), f);
fclose(f);
av_freep(&buffer);
return 0;
if (!pad.name)
return AVERROR(ENOMEM);
+ if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
+ av_freep(&pad.name);
+ return ret;
+ }
sc = &(sic->streamcontexts[i]);
sc->coarseend = sc->coarsesiglist;
sc->coarsecount = 0;
sc->midcoarse = 0;
-
- if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
- av_freep(&pad.name);
- return ret;
- }
}
/* check filename */
{ NULL }
};
-AVFilter ff_vf_signature = {
+const AVFilter ff_vf_signature = {
.name = "signature",
.description = NULL_IF_CONFIG_SMALL("Calculate the MPEG-7 video signature"),
.priv_size = sizeof(SignatureContext),