]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_signature.c
hwcontext_vulkan: reorder structure fields and add spaces in between
[ffmpeg] / libavfilter / vf_signature.c
index 80957d0047116b4e81027b32719e91c93f1e76dc..a345ad6ebdfb1578d181a5df09d5f5641d5d0b30 100644 (file)
@@ -132,8 +132,9 @@ static uint64_t get_block_sum(StreamContext *sc, uint64_t intpic[32][32], const
     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 );
 }
 
@@ -291,7 +292,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
         }
 
         /* 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 */
@@ -317,7 +318,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
     }
 
     /* 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 */
@@ -560,7 +561,7 @@ static int binary_export(AVFilterContext *ctx, StreamContext *sc, const char* fi
     }
 
     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;
@@ -757,7 +758,7 @@ static const AVFilterPad signature_outputs[] = {
     { 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),