[FFmpeg-devel] [PATCH] add signature filter for MPEG7 video signature

Clément Bœsch u at pkh.me
Sun Mar 20 16:52:36 CET 2016


On Sun, Mar 20, 2016 at 12:00:13PM +0100, Gerion Entrup wrote:
> Good day,
> 
> I attached the patch. The MPEG7 video signature is a method to calculate a 
> fingerprint of a video and to compare two or more of this fingerprints. Most of 
> the standard is implemented. I've done this work as part of my bachelor 
> thesis.
> 
> The method is designed mainly for fast caculation of the fingerprint, so it is 
> blockbased and not very robust to some geometric modification.
> 

> Further details can be found at
> http://epubs.surrey.ac.uk/531590/1/MPEG-7%20Video%20Signature%20Author%27s
> %20Copy.pdf

use a @see in the code (typically in the @file section)

> 
> kind regards,
> Gerion

> From 6eeb0a8b4fce06d98265ce2cf1936ff092de137b Mon Sep 17 00:00:00 2001
> From: Gerion Entrup <gerion.entrup at flump.de>
> Date: Sun, 20 Mar 2016 11:10:31 +0100
> Subject: [PATCH] add signature filter for MPEG7 video signature
> 
> This filter does not implement all features of MPEG7. Missing features:
> - binary output
> - compression of signature files
> - work only on (cropped) parts of the video
> ---
>  Changelog                      |   1 +
>  doc/filters.texi               |  50 ++++
>  libavfilter/Makefile           |   1 +
>  libavfilter/allfilters.c       |   1 +
>  libavfilter/signature.h        | 569 ++++++++++++++++++++++++++++++++++++
>  libavfilter/signature_lookup.c | 518 +++++++++++++++++++++++++++++++++
>  libavfilter/version.h          |   4 +-
>  libavfilter/vf_signature.c     | 636 +++++++++++++++++++++++++++++++++++++++++
>  8 files changed, 1778 insertions(+), 2 deletions(-)
>  create mode 100644 libavfilter/signature.h
>  create mode 100644 libavfilter/signature_lookup.c
>  create mode 100644 libavfilter/vf_signature.c
> 
> diff --git a/Changelog b/Changelog
> index 1f57f5e..7c1316a 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest within each release,
>  releases are sorted from youngest to oldest.
>  
>  version <next>:
> +- MPEG-7 Video Signature filter

belongs at the end of the list

>  - DXVA2-accelerated HEVC Main10 decoding
>  - fieldhint filter
>  - loop video filter and aloop audio filter
> diff --git a/doc/filters.texi b/doc/filters.texi
> index c093927..22d6326 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -11444,6 +11444,56 @@ saturation maximum: %@{metadata:lavfi.signalstats.SATMAX@}
>  @end example
>  @end itemize
>  
> + at anchor{signature}
> + at section signature
> +
> +Calculates the MPEG-7 Video Signature. The filter could handle more than one input. In this case the matching between the inputs could be calculated. The filter passthrough the first input. The output is written in XML.
> +

please wrap the text, same below

[...]
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 956a077..f48eeaf 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -245,6 +245,7 @@ OBJS-$(CONFIG_SHOWPALETTE_FILTER)            += vf_showpalette.o
>  OBJS-$(CONFIG_SHUFFLEFRAMES_FILTER)          += vf_shuffleframes.o
>  OBJS-$(CONFIG_SHUFFLEPLANES_FILTER)          += vf_shuffleplanes.o
>  OBJS-$(CONFIG_SIGNALSTATS_FILTER)            += vf_signalstats.o
> +OBJS-$(CONFIG_SIGNATURE_FILTER)              += vf_signature.o
>  OBJS-$(CONFIG_SMARTBLUR_FILTER)              += vf_smartblur.o
>  OBJS-$(CONFIG_SPLIT_FILTER)                  += split.o
>  OBJS-$(CONFIG_SPP_FILTER)                    += vf_spp.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index e5080b5..c8ded07 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -265,6 +265,7 @@ void avfilter_register_all(void)
>      REGISTER_FILTER(SHUFFLEFRAMES,  shuffleframes,  vf);
>      REGISTER_FILTER(SHUFFLEPLANES,  shuffleplanes,  vf);
>      REGISTER_FILTER(SIGNALSTATS,    signalstats,    vf);
> +    REGISTER_FILTER(SIGNATURE,      signature,      vf);
>      REGISTER_FILTER(SMARTBLUR,      smartblur,      vf);
>      REGISTER_FILTER(SPLIT,          split,          vf);
>      REGISTER_FILTER(SPP,            spp,            vf);
> diff --git a/libavfilter/signature.h b/libavfilter/signature.h
> new file mode 100644
> index 0000000..6f0584b
> --- /dev/null
> +++ b/libavfilter/signature.h
> @@ -0,0 +1,569 @@
> +/*
> + * Copyright (c) 2016 Gerion Entrup
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */
> +

GPL?

> +/**
> + * @file
> + * MPEG-7 video signature calculation and lookup filter
> + */
> +
> +#include <float.h>
> +#include "libavutil/opt.h"
> +#include "libavutil/timestamp.h"
> +#include "avfilter.h"
> +#include "internal.h"

> +#include <stdbool.h>

please no, use ints.

[...]

I'll eventually make a more complete review at the next iteration.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160320/eb88feab/attachment.sig>


More information about the ffmpeg-devel mailing list