~ubuntu-branches/ubuntu/natty/gst-entrans/natty

« back to all changes in this revision

Viewing changes to gst/avidemux/plugin-ad.c

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2010-09-13 19:49:29 UTC
  • Revision ID: james.westby@ubuntu.com-20100913194929-qz90a14xyxln9yfz
Tags: upstream-0.10.2
ImportĀ upstreamĀ versionĀ 0.10.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GStreamer Plugin
 
2
 * Copyright (C) 2008 Mark Nauwelaerts <mnauw@users.sourceforge.net>
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software Foundation, Inc., 
 
16
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1307, USA.
 
17
 */
 
18
 
 
19
#ifdef HAVE_CONFIG_H
 
20
#include "config.h"
 
21
#endif
 
22
 
 
23
#include "plugin-ad.h"
 
24
 
 
25
guint8 distMatrix[256][256];
 
26
guint32 fixMul[16];
 
27
 
 
28
static void
 
29
build_tables ()
 
30
{
 
31
  gint x, y;
 
32
 
 
33
  for (x = 0; x < 256; x++)
 
34
    for (y = 0; y < 256; y++)
 
35
      distMatrix[x][y] = ABS (x - y);
 
36
 
 
37
  for (x = 1; x < 16; x++) {
 
38
    fixMul[x] = (1 << 16) / x;
 
39
  }
 
40
}
 
41
 
 
42
struct _elements_entry
 
43
{
 
44
  gchar *name;
 
45
  GType (*type) (void);
 
46
};
 
47
 
 
48
static struct _elements_entry _elements[] = {
 
49
  {"soften", gst_soften_get_type},
 
50
  {"stabilize", gst_stabilize_get_type},
 
51
  {NULL, 0}
 
52
};
 
53
 
 
54
static gboolean
 
55
plugin_init (GstPlugin * plugin)
 
56
{
 
57
  gint i = 0;
 
58
 
 
59
  build_tables ();
 
60
  oil_init ();
 
61
 
 
62
  while (_elements[i].name) {
 
63
    if (!gst_element_register (plugin, _elements[i].name,
 
64
         GST_RANK_NONE, (_elements[i].type) ()))
 
65
      return FALSE;
 
66
    i++;
 
67
  }
 
68
 
 
69
  return TRUE;
 
70
}
 
71
 
 
72
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
 
73
                   GST_VERSION_MINOR,
 
74
                   "avidemux",
 
75
                   "filters from avidemux",
 
76
                   plugin_init, VERSION, "GPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);