2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
25 #include <gst/idct/idct.h>
28 static void gst_idct_int_sparse_idct (short *data);
31 gst_idct_new (GstIDCTMethod method)
33 GstIDCT *new = g_malloc (sizeof (GstIDCT));
35 new->need_transpose = FALSE;
37 if (method == GST_IDCT_DEFAULT) {
38 method = GST_IDCT_FAST_INT;
41 new->convert_sparse = gst_idct_int_sparse_idct;
44 case GST_IDCT_FAST_INT:
45 GST_INFO ("using fast_int_idct");
46 gst_idct_init_fast_int_idct ();
47 new->convert = gst_idct_fast_int_idct;
50 GST_INFO ("using int_idct");
51 new->convert = gst_idct_int_idct;
54 GST_INFO ("using float_idct");
55 gst_idct_init_float_idct ();
56 new->convert = gst_idct_float_idct;
59 GST_INFO ("method not supported");
67 gst_idct_int_sparse_idct (short *data)
70 gint32 v, *dp = (guint32 *) data;
80 val = (v + (8 >> 1)) / 8;
82 v = ((val & 0xffff) | (val << 16));
119 gst_idct_destroy (GstIDCT * idct)
121 g_return_if_fail (idct != NULL);
127 plugin_init (GstPlugin * plugin)
132 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
135 "Accelerated IDCT routines",
136 plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)