Commit 087d9bc3 authored by Mathieu Duponchelle's avatar Mathieu Duponchelle Committed by Thibault Saunier

Adds a new Image Quality Assessment plugin.

It only offers one metric for now, "dssim", available if
https://github.com/pornel/dssim was installed on the system
at the time the plugin was compiled.

The spearman correlation for dssim against the TID2008 dataset
is 0.81, against 0.70 for the old ssim implementation, and
it runs 15 times faster.

https://bugzilla.gnome.org/show_bug.cgi?id=751324
parent a7b0669c
......@@ -358,6 +358,23 @@ AC_SUBST(EXIF_LIBS)
AC_SUBST(EXIF_CFLAGS)
AM_CONDITIONAL(USE_EXIF, test "x$HAVE_EXIF" = "xyes")
AG_GST_CHECK_FEATURE(IQA, [iqa], iqa , [
PKG_CHECK_MODULES(DSSIM, dssim, [
HAVE_DSSIM="yes"
HAVE_IQA="yes"
], [
HAVE_DSSIM="no"
HAVE_IQA="no"
])
AM_CONDITIONAL(HAVE_DSSIM, test "x$HAVE_DSSIM" = "xyes")
if test "x$HAVE_DSSIM" = "xyes"; then
AC_DEFINE(HAVE_DSSIM, 1, [Define if you have dssim library])
fi
AC_SUBST(DSSIM_LIBS)
AC_SUBST(DSSIM_CFLAGS)
])
dnl Orc
ORC_CHECK([0.4.17])
......@@ -3525,6 +3542,7 @@ AM_CONDITIONAL(USE_GSM, false)
AM_CONDITIONAL(USE_GTK3, false)
AM_CONDITIONAL(USE_GTK3_GL, false)
AM_CONDITIONAL(USE_HLS, false)
AM_CONDITIONAL(USE_IQA, false)
AM_CONDITIONAL(USE_KATE, false)
AM_CONDITIONAL(USE_KMS, false)
AM_CONDITIONAL(USE_TIGER, false)
......@@ -3846,6 +3864,7 @@ ext/flite/Makefile
ext/fluidsynth/Makefile
ext/gsm/Makefile
ext/hls/Makefile
ext/iqa/Makefile
ext/kate/Makefile
ext/ladspa/Makefile
ext/lv2/Makefile
......
......@@ -75,6 +75,7 @@ EXTRA_HFILES = \
$(top_srcdir)/ext/dts/gstdtsdec.h \
$(top_srcdir)/ext/faac/gstfaac.h \
$(top_srcdir)/ext/faad/gstfaad.h \
$(top_srcdir)/ext/iqa/iqa.h \
$(top_srcdir)/ext/kate/gstkateenc.h \
$(top_srcdir)/ext/kate/gstkatedec.h \
$(top_srcdir)/ext/kate/gstkateparse.h \
......
......@@ -104,6 +104,7 @@
<xi:include href="xml/element-glvideomixerelement.xml" />
<xi:include href="xml/element-glvideomixer.xml" />
<xi:include href="xml/element-glviewconvert.xml" />
<xi:include href="xml/element-iqa.xml" />
<xi:include href="xml/element-jpegparse.xml" />
<xi:include href="xml/element-kaleidoscope.xml" />
<xi:include href="xml/element-liveadder.xml" />
......
......@@ -2281,6 +2281,18 @@ GST_TYPE_INTERLACE
gst_interlace_get_type
</SECTION>
<SECTION>
<FILE>element-iqa</FILE>
<TITLE>IQA</TITLE>
Iqa
<SUBSECTION Standard>
IqaClass
IQA
GST_TYPE_IQA
iqa_get_type
gst_iqa_plugin_init
</SECTION>
<SECTION>
<FILE>element-ivfparse</FILE>
<TITLE>ivfparse</TITLE>
......
......@@ -142,6 +142,12 @@ else
GSM_DIR=
endif
if USE_IQA
IQA_DIR = iqa
else
IQA_DIR =
endif
if USE_KATE
KATE_DIR=kate
else
......@@ -457,6 +463,7 @@ SUBDIRS=\
$(FLUIDSYNTH_DIR) \
$(GSM_DIR) \
$(G729_DIR) \
$(IQA_DIR) \
$(KATE_DIR) \
$(LADSPA_DIR) \
$(LV2_DIR) \
......
plugin_LTLIBRARIES = libgstiqa.la
libgstiqa_la_SOURCES = \
iqa.c
libgstiqa_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstiqa_la_CFLAGS += $(DSSIM_CFLAGS)
libgstiqa_la_LIBADD = \
$(top_builddir)/gst-libs/gst/base/libgstbadbase-$(GST_API_VERSION).la \
$(top_builddir)/gst-libs/gst/video/libgstbadvideo-$(GST_API_VERSION).la \
$(GST_PLUGINS_BASE_LIBS) \
$(GST_BASE_LIBS) $(GST_LIBS)
libgstiqa_la_LIBADD += $(DSSIM_LIBS)
libgstiqa_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstiqa_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = \
iqa.h
This diff is collapsed.
/* Image Quality Assessment plugin
* Copyright (C) 2015 Mathieu Duponchelle <mathieu.duponchelle@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_IQA_H__
#define __GST_IQA_H__
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideoaggregator.h>
G_BEGIN_DECLS
#define GST_TYPE_IQA (gst_iqa_get_type())
#define GST_IQA(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_IQA, GstIqa))
#define GST_IQA_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_IQA, GstIqaClass))
#define GST_IS_IQA(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_IQA))
#define GST_IS_IQA_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_IQA))
typedef struct _GstIqa GstIqa;
typedef struct _GstIqaClass GstIqaClass;
/**
* GstIqa:
*
* The opaque #GstIqa structure.
*/
struct _GstIqa
{
GstVideoAggregator videoaggregator;
gboolean do_dssim;
double max_dssim;
};
struct _GstIqaClass
{
GstVideoAggregatorClass parent_class;
};
GType gst_iqa_get_type (void);
G_END_DECLS
#endif /* __GST_IQA_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment