summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst/idct
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/idct')
-rw-r--r--gst-libs/gst/idct/Makefile.am26
-rw-r--r--gst-libs/gst/idct/README48
-rw-r--r--gst-libs/gst/idct/dct.h26
-rwxr-xr-xgst-libs/gst/idct/doieee15
-rw-r--r--gst-libs/gst/idct/fastintidct.c215
-rw-r--r--gst-libs/gst/idct/floatidct.c106
-rw-r--r--gst-libs/gst/idct/idct.c136
-rw-r--r--gst-libs/gst/idct/idct.h55
-rw-r--r--gst-libs/gst/idct/idtc.vcproj156
-rw-r--r--gst-libs/gst/idct/ieeetest.c366
-rw-r--r--gst-libs/gst/idct/intidct.c380
11 files changed, 0 insertions, 1529 deletions
diff --git a/gst-libs/gst/idct/Makefile.am b/gst-libs/gst/idct/Makefile.am
deleted file mode 100644
index d8ddf8dd..00000000
--- a/gst-libs/gst/idct/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-
-librarydir = $(libdir)/gstreamer-@GST_MAJORMINOR@
-
-library_LTLIBRARIES = libgstidct.la
-
-libgstidct_la_SOURCES = \
- fastintidct.c \
- floatidct.c \
- idct.c \
- intidct.c
-
-libgstidctincludedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/idct
-libgstidctinclude_HEADERS = idct.h
-noinst_HEADERS = dct.h
-
-## check_PROGRAMS = ieeetest
-
-## ieeetest_SOURCES = ieeetest.c
-## ieeetest_LDADD = libgstidct.la
-## ieeetest_CFLAGS = $(GST_CFLAGS)
-## ieeetest_LDFLAGS = $(GST_LIBS)
-
-
-libgstidct_la_LIBADD =
-libgstidct_la_CFLAGS = $(GST_CFLAGS)
-libgstidct_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
diff --git a/gst-libs/gst/idct/README b/gst-libs/gst/idct/README
deleted file mode 100644
index 600f3da9..00000000
--- a/gst-libs/gst/idct/README
+++ /dev/null
@@ -1,48 +0,0 @@
-This archive contains a quick & dirty implementation of the IEEE Standard
-1180-1990 accuracy test for inverse DCT. It is not guaranteed to be
-correct ... but if you find any bugs, please let me know (by email to
-tgl@cs.cmu.edu).
-
-The test harness consists of the C program ieeetest.c and shell script
-doieee. For comparison purposes I have also supplied a copy of jrevdct.c,
-the inverse DCT routine from release 4 of the Independent JPEG Group's
-free JPEG software. (jrevdct.c is slightly modified from the IJG release
-so that it will compile without the IJG include files.) jrevdct.c passes
-the 1180 test --- or at least, this program thinks so. jrevdct.out is
-the output from a test run.
-
-Note that numerical results may vary somewhat across machines. This appears
-to be mostly due to differing results from the cosine function.
-
-
-INSTALLATION:
- Check the Makefile, change CC and CFLAGS if needed. Then say "make".
-If your C compiler is non-ANSI, you may need to change includes and/or
-function headers.
-
- To test a different IDCT routine, link with that routine instead of
-jrevdct.o. You will need to modify dct.h and/or ieeetest.c if your
-routine's calling convention is not in-place modification of an array
-of 64 "short"s.
-
-
-USAGE:
- The standard test procedure is
- doieee ieeetest >outputfile
-Expect it to take a while (almost 80 minutes on my old 68030 box).
-Each of the six passes will emit a row of 100 dots as it runs.
-
-You can grep the output for the word FAILS if you just want to know
-yea or nay.
-
-
-LEGAL MUMBO-JUMBO:
- I hereby release the test harness to the public domain.
- Thomas G. Lane, 22 Nov 1993
-
-IMPORTANT: jrevdct.c is NOT public domain, but is copyrighted free software
-(not the same thing at all). It is subject to IJG's distribution terms, which
-primarily state that if you incorporate it into a program you must acknowledge
-IJG's contribution in your program documentation. For more details and the
-complete IJG software, see the IJG FTP archive at ftp.uu.net, in directory
-/graphics/jpeg.
diff --git a/gst-libs/gst/idct/dct.h b/gst-libs/gst/idct/dct.h
deleted file mode 100644
index ea453cdb..00000000
--- a/gst-libs/gst/idct/dct.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* define DCT types */
-
-/*
- * DCTSIZE underlying (1d) transform size
- * DCTSIZE2 DCTSIZE squared
- */
-
-#define DCTSIZE (8)
-#define DCTSIZE2 (DCTSIZE*DCTSIZE)
-
-#define EIGHT_BIT_SAMPLES /* needed in jrevdct.c */
-
-typedef short DCTELEM; /* must be at least 16 bits */
-
-typedef DCTELEM DCTBLOCK[DCTSIZE2];
-
-typedef long INT32; /* must be at least 32 bits */
-
-extern void gst_idct_int_idct();
-
-extern void gst_idct_init_fast_int_idct (void);
-extern void gst_idct_fast_int_idct (short *block);
-
-extern void gst_idct_init_float_idct(void);
-extern void gst_idct_float_idct (short *block);
-
diff --git a/gst-libs/gst/idct/doieee b/gst-libs/gst/idct/doieee
deleted file mode 100755
index 1d5ff877..00000000
--- a/gst-libs/gst/idct/doieee
+++ /dev/null
@@ -1,15 +0,0 @@
-# perform IEEE 1180 test series
-# Typical usage:
-# doieee >outfile
-# where progname is ieeetest or a variant
-
-for i in 1 2 3 4 5;
-do
-time ./ieeetest $i -256 255 1 10000
-time ./ieeetest $i -5 5 1 10000
-time ./ieeetest $i -300 300 1 10000
-
-time ./ieeetest $i -256 255 -1 10000
-time ./ieeetest $i -5 5 -1 10000
-time ./ieeetest $i -300 300 -1 10000
-done
diff --git a/gst-libs/gst/idct/fastintidct.c b/gst-libs/gst/idct/fastintidct.c
deleted file mode 100644
index d4caaf38..00000000
--- a/gst-libs/gst/idct/fastintidct.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* idct.c, inverse fast discrete cosine transform */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/**********************************************************/
-/* inverse two dimensional DCT, Chen-Wang algorithm */
-/* (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984) */
-/* 32-bit integer arithmetic (8 bit coefficients) */
-/* 11 mults, 29 adds per DCT */
-/* sE, 18.8.91 */
-/**********************************************************/
-/* coefficients extended to 12 bit for IEEE1180-1990 */
-/* compliance sE, 2.1.94 */
-/**********************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-/* this code assumes >> to be a two's-complement arithmetic */
-/* right shift: (-2)>>1 == -1 , (-3)>>1 == -2 */
-
-#define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */
-#define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */
-#define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */
-#define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */
-#define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */
-#define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */
-
-#include "dct.h"
-
-/* private data */
-static short iclip[1024]; /* clipping table */
-static short *iclp;
-
-/* private prototypes */
-static void idctrow (short *blk);
-static void idctcol (short *blk);
-
-/* row (horizontal) IDCT
- *
- * 7 pi 1
- * dst[k] = sum c[l] * src[l] * cos( -- * ( k + - ) * l )
- * l=0 8 2
- *
- * where: c[0] = 128
- * c[1..7] = 128*sqrt(2)
- */
-
-static void
-idctrow (blk)
- short *blk;
-{
- int x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
- /* shortcut */
- if (!((x1 = blk[4] << 11) | (x2 = blk[6]) | (x3 = blk[2]) |
- (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) {
- blk[0] = blk[1] = blk[2] = blk[3] = blk[4] = blk[5] = blk[6] = blk[7] =
- blk[0] << 3;
- return;
- }
-
- x0 = (blk[0] << 11) + 128; /* for proper rounding in the fourth stage */
-
- /* first stage */
- x8 = W7 * (x4 + x5);
- x4 = x8 + (W1 - W7) * x4;
- x5 = x8 - (W1 + W7) * x5;
- x8 = W3 * (x6 + x7);
- x6 = x8 - (W3 - W5) * x6;
- x7 = x8 - (W3 + W5) * x7;
-
- /* second stage */
- x8 = x0 + x1;
- x0 -= x1;
- x1 = W6 * (x3 + x2);
- x2 = x1 - (W2 + W6) * x2;
- x3 = x1 + (W2 - W6) * x3;
- x1 = x4 + x6;
- x4 -= x6;
- x6 = x5 + x7;
- x5 -= x7;
-
- /* third stage */
- x7 = x8 + x3;
- x8 -= x3;
- x3 = x0 + x2;
- x0 -= x2;
- x2 = (181 * (x4 + x5) + 128) >> 8;
- x4 = (181 * (x4 - x5) + 128) >> 8;
-
- /* fourth stage */
- blk[0] = (x7 + x1) >> 8;
- blk[1] = (x3 + x2) >> 8;
- blk[2] = (x0 + x4) >> 8;
- blk[3] = (x8 + x6) >> 8;
- blk[4] = (x8 - x6) >> 8;
- blk[5] = (x0 - x4) >> 8;
- blk[6] = (x3 - x2) >> 8;
- blk[7] = (x7 - x1) >> 8;
-}
-
-/* column (vertical) IDCT
- *
- * 7 pi 1
- * dst[8*k] = sum c[l] * src[8*l] * cos( -- * ( k + - ) * l )
- * l=0 8 2
- *
- * where: c[0] = 1/1024
- * c[1..7] = (1/1024)*sqrt(2)
- */
-static void
-idctcol (blk)
- short *blk;
-{
- int x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
- /* shortcut */
- if (!((x1 = (blk[8 * 4] << 8)) | (x2 = blk[8 * 6]) | (x3 = blk[8 * 2]) |
- (x4 = blk[8 * 1]) | (x5 = blk[8 * 7]) | (x6 = blk[8 * 5]) | (x7 =
- blk[8 * 3]))) {
- blk[8 * 0] = blk[8 * 1] = blk[8 * 2] = blk[8 * 3] = blk[8 * 4] =
- blk[8 * 5] = blk[8 * 6] = blk[8 * 7] = iclp[(blk[8 * 0] + 32) >> 6];
- return;
- }
-
- x0 = (blk[8 * 0] << 8) + 8192;
-
- /* first stage */
- x8 = W7 * (x4 + x5) + 4;
- x4 = (x8 + (W1 - W7) * x4) >> 3;
- x5 = (x8 - (W1 + W7) * x5) >> 3;
- x8 = W3 * (x6 + x7) + 4;
- x6 = (x8 - (W3 - W5) * x6) >> 3;
- x7 = (x8 - (W3 + W5) * x7) >> 3;
-
- /* second stage */
- x8 = x0 + x1;
- x0 -= x1;
- x1 = W6 * (x3 + x2) + 4;
- x2 = (x1 - (W2 + W6) * x2) >> 3;
- x3 = (x1 + (W2 - W6) * x3) >> 3;
- x1 = x4 + x6;
- x4 -= x6;
- x6 = x5 + x7;
- x5 -= x7;
-
- /* third stage */
- x7 = x8 + x3;
- x8 -= x3;
- x3 = x0 + x2;
- x0 -= x2;
- x2 = (181 * (x4 + x5) + 128) >> 8;
- x4 = (181 * (x4 - x5) + 128) >> 8;
-
- /* fourth stage */
- blk[8 * 0] = iclp[(x7 + x1) >> 14];
- blk[8 * 1] = iclp[(x3 + x2) >> 14];
- blk[8 * 2] = iclp[(x0 + x4) >> 14];
- blk[8 * 3] = iclp[(x8 + x6) >> 14];
- blk[8 * 4] = iclp[(x8 - x6) >> 14];
- blk[8 * 5] = iclp[(x0 - x4) >> 14];
- blk[8 * 6] = iclp[(x3 - x2) >> 14];
- blk[8 * 7] = iclp[(x7 - x1) >> 14];
-}
-
-/* two dimensional inverse discrete cosine transform */
-void
-gst_idct_fast_int_idct (block)
- short *block;
-{
- int i;
-
- for (i = 0; i < 8; i++)
- idctrow (block + 8 * i);
-
- for (i = 0; i < 8; i++)
- idctcol (block + i);
-}
-
-void
-gst_idct_init_fast_int_idct ()
-{
- int i;
-
- iclp = iclip + 512;
- for (i = -512; i < 512; i++)
- iclp[i] = (i < -256) ? -256 : ((i > 255) ? 255 : i);
-}
diff --git a/gst-libs/gst/idct/floatidct.c b/gst-libs/gst/idct/floatidct.c
deleted file mode 100644
index 65e01d40..00000000
--- a/gst-libs/gst/idct/floatidct.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Reference_IDCT.c, Inverse Discrete Fourier Transform, double precision */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/* Perform IEEE 1180 reference (64-bit floating point, separable 8x1
- * direct matrix multiply) Inverse Discrete Cosine Transform
-*/
-
-
-/* Here we use math.h to generate constants. Compiler results may
- vary a little */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-
-#ifndef PI
-# ifdef M_PI
-# define PI M_PI
-# else
-# define PI 3.14159265358979323846
-# endif
-#endif
-
-/* private data */
-
-/* cosine transform matrix for 8x1 IDCT */
-static double gst_idct_float_c[8][8];
-
-/* initialize DCT coefficient matrix */
-
-void
-gst_idct_init_float_idct ()
-{
- int freq, time;
- double scale;
-
- for (freq = 0; freq < 8; freq++) {
- scale = (freq == 0) ? sqrt (0.125) : 0.5;
- for (time = 0; time < 8; time++)
- gst_idct_float_c[freq][time] =
- scale * cos ((PI / 8.0) * freq * (time + 0.5));
- }
-}
-
-/* perform IDCT matrix multiply for 8x8 coefficient block */
-
-void
-gst_idct_float_idct (block)
- short *block;
-{
- int i, j, k, v;
- double partial_product;
- double tmp[64];
-
- for (i = 0; i < 8; i++)
- for (j = 0; j < 8; j++) {
- partial_product = 0.0;
-
- for (k = 0; k < 8; k++)
- partial_product += gst_idct_float_c[k][j] * block[8 * i + k];
-
- tmp[8 * i + j] = partial_product;
- }
-
- /* Transpose operation is integrated into address mapping by switching
- loop order of i and j */
-
- for (j = 0; j < 8; j++)
- for (i = 0; i < 8; i++) {
- partial_product = 0.0;
-
- for (k = 0; k < 8; k++)
- partial_product += gst_idct_float_c[k][i] * tmp[8 * k + j];
-
- v = (int) floor (partial_product + 0.5);
- block[8 * i + j] = (v < -256) ? -256 : ((v > 255) ? 255 : v);
- }
-}
diff --git a/gst-libs/gst/idct/idct.c b/gst-libs/gst/idct/idct.c
deleted file mode 100644
index ea24d44e..00000000
--- a/gst-libs/gst/idct/idct.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* GStreamer
- * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
- *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <gst/gst.h>
-#include <gst/idct/idct.h>
-#include "dct.h"
-
-static void gst_idct_int_sparse_idct (short *data);
-
-GstIDCT *
-gst_idct_new (GstIDCTMethod method)
-{
- GstIDCT *new = g_malloc (sizeof (GstIDCT));
-
- new->need_transpose = FALSE;
-
- if (method == GST_IDCT_DEFAULT) {
- method = GST_IDCT_FAST_INT;
- }
-
- new->convert_sparse = gst_idct_int_sparse_idct;
-
- switch (method) {
- case GST_IDCT_FAST_INT:
- GST_INFO ("using fast_int_idct");
- gst_idct_init_fast_int_idct ();
- new->convert = gst_idct_fast_int_idct;
- break;
- case GST_IDCT_INT:
- GST_INFO ("using int_idct");
- new->convert = gst_idct_int_idct;
- break;
- case GST_IDCT_FLOAT:
- GST_INFO ("using float_idct");
- gst_idct_init_float_idct ();
- new->convert = gst_idct_float_idct;
- break;
- default:
- GST_INFO ("method not supported");
- g_free (new);
- return NULL;
- }
- return new;
-}
-
-static void
-gst_idct_int_sparse_idct (short *data)
-{
- short val;
- gint32 v, *dp = (guint32 *) data;
-
- v = *data;
-
- if (v < 0) {
- val = -v;
- val += (8 >> 1);
- val /= 8;
- val = -val;
- } else {
- val = (v + (8 >> 1)) / 8;
- }
- v = ((val & 0xffff) | (val << 16));
-
- dp[0] = v;
- dp[1] = v;
- dp[2] = v;
- dp[3] = v;
- dp[4] = v;
- dp[5] = v;
- dp[6] = v;
- dp[7] = v;
- dp[8] = v;
- dp[9] = v;
- dp[10] = v;
- dp[11] = v;
- dp[12] = v;
- dp[13] = v;
- dp[14] = v;
- dp[15] = v;
- dp[16] = v;
- dp[17] = v;
- dp[18] = v;
- dp[19] = v;
- dp[20] = v;
- dp[21] = v;
- dp[22] = v;
- dp[23] = v;
- dp[24] = v;
- dp[25] = v;
- dp[26] = v;
- dp[27] = v;
- dp[28] = v;
- dp[29] = v;
- dp[30] = v;
- dp[31] = v;
-}
-
-void
-gst_idct_destroy (GstIDCT * idct)
-{
- g_return_if_fail (idct != NULL);
-
- g_free (idct);
-}
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
- return TRUE;
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "gstidct",
- "Accelerated IDCT routines",
- plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
diff --git a/gst-libs/gst/idct/idct.h b/gst-libs/gst/idct/idct.h
deleted file mode 100644
index 290ca9d9..00000000
--- a/gst-libs/gst/idct/idct.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* GStreamer
- * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
- *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef __GST_IDCT_H__
-#define __GST_IDCT_H__
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-typedef enum {
- GST_IDCT_DEFAULT,
- GST_IDCT_INT,
- GST_IDCT_FAST_INT,
- GST_IDCT_FLOAT,
-} GstIDCTMethod;
-
-typedef struct _GstIDCT GstIDCT;
-typedef void (*GstIDCTFunction) (gshort *block);
-
-#define GST_IDCT_TRANSPOSE(idct) ((idct)->need_transpose)
-
-struct _GstIDCT {
- /* private */
- GstIDCTFunction convert;
- GstIDCTFunction convert_sparse;
- gboolean need_transpose;
-};
-
-
-GstIDCT *gst_idct_new(GstIDCTMethod method);
-#define gst_idct_convert(idct, blocks) (idct)->convert((blocks))
-#define gst_idct_convert_sparse(idct, blocks) (idct)->convert_sparse((blocks))
-void gst_idct_destroy(GstIDCT *idct);
-
-G_END_DECLS
-
-#endif /* __GST_IDCT_H__ */
diff --git a/gst-libs/gst/idct/idtc.vcproj b/gst-libs/gst/idct/idtc.vcproj
deleted file mode 100644
index 0ce4e2af..00000000
--- a/gst-libs/gst/idct/idtc.vcproj
+++ /dev/null
@@ -1,156 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="idtc"
- ProjectGUID="{979C216F-0ACF-4956-AE00-055A42D67895}"
- RootNamespace="idtc"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="../../../win32/Debug"
- IntermediateDirectory="../../../win32/Debug"
- ConfigurationType="2"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../../gstreamer/win32;../../../../gstreamer;../../../../gstreamer/libs;../../../../glib;../../../../glib/glib;../../../../glib/gmodule;&quot;../../../gst-libs&quot;;../../../../popt/include;../../../../libxml2/include/libxml2"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;_USE_MATH_DEFINES"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="glib-2.0.lib gmodule-2.0.lib gthread-2.0.lib gobject-2.0.lib libgstreamer.lib gstbytestream.lib iconv.lib intl.lib"
- OutputFile="$(OutDir)/gstidtc.dll"
- LinkIncremental="2"
- AdditionalLibraryDirectories="../../../../gstreamer/win32/Debug;../../../../glib/glib;../../../../glib/gmodule;../../../../glib/gthread;../../../../glib/gobject;../../../../gettext/lib;../../../../libiconv/lib"
- ModuleDefinitionFile=""
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/idtc.pdb"
- SubSystem="2"
- OptimizeReferences="2"
- ImportLibrary="$(OutDir)/gstidtc.lib"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy /Y $(TargetPath) c:\gstreamer\plugins"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="../../../win32/Release"
- IntermediateDirectory="../../../win32/Release"
- ConfigurationType="2"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../../gstreamer/win32;../../../../gstreamer;../../../../gstreamer/libs;../../../../glib;../../../../glib/glib;../../../../glib/gmodule;&quot;../../../gst-libs&quot;;../../../../popt/include;../../../../libxml2/include/libxml2"
- PreprocessorDefinitions="WIN32;NDEBUG;GST_DISABLE_GST_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;_USE_MATH_DEFINES"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="glib-2.0.lib gmodule-2.0.lib gthread-2.0.lib gobject-2.0.lib libgstreamer.lib gstbytestream.lib iconv.lib intl.lib"
- OutputFile="$(OutDir)/gstidtc.dll"
- LinkIncremental="1"
- AdditionalLibraryDirectories="../../../../gstreamer/win32/Release;../../../../glib/glib;../../../../glib/gmodule;../../../../glib/gthread;../../../../glib/gobject;../../../../gettext/lib;../../../../libiconv/lib"
- ModuleDefinitionFile=""
- GenerateDebugInformation="TRUE"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- ImportLibrary="$(OutDir)/gstidtc.lib"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy /Y $(TargetPath) c:\gstreamer\plugins"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath=".\fastintidct.c">
- </File>
- <File
- RelativePath=".\floatidct.c">
- </File>
- <File
- RelativePath=".\idct.c">
- </File>
- <File
- RelativePath=".\intidct.c">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath=".\dct.h">
- </File>
- <File
- RelativePath=".\idtc.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/gst-libs/gst/idct/ieeetest.c b/gst-libs/gst/idct/ieeetest.c
deleted file mode 100644
index 7af101e6..00000000
--- a/gst-libs/gst/idct/ieeetest.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * ieeetest.c --- test IDCT code against the IEEE Std 1180-1990 spec
- *
- * Note that this does only one pass of the test.
- * Six invocations of ieeetest are needed to complete the entire spec.
- * The shell script "doieee" performs the complete test.
- *
- * Written by Tom Lane (tgl@cs.cmu.edu).
- * Released to public domain 11/22/93.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include <gst/gst.h>
-#include <gst/idct/idct.h>
-#include "dct.h"
-
-
-/* prototypes */
-
-void usage (char *msg);
-long ieeerand (long L, long H);
-void dct_init (void);
-void ref_fdct (DCTELEM block[8][8]);
-void ref_idct (DCTELEM block[8][8]);
-
-/* error stat accumulators -- assume initialized to 0 */
-
-long sumerrs[DCTSIZE2];
-long sumsqerrs[DCTSIZE2];
-int maxerr[DCTSIZE2];
-
-
-char *
-meets (double val, double limit)
-{
- return ((fabs (val) <= limit) ? "meets" : "FAILS");
-}
-
-int
-main (int argc, char **argv)
-{
- long minpix, maxpix, sign;
- long curiter, niters;
- int i, j;
- double max, total;
- int method;
- DCTELEM block[DCTSIZE2]; /* random source data */
- DCTELEM refcoefs[DCTSIZE2]; /* coefs from reference FDCT */
- DCTELEM refout[DCTSIZE2]; /* output from reference IDCT */
- DCTELEM testout[DCTSIZE2]; /* output from test IDCT */
- GstIDCT *idct;
- guint64 tscstart, tscmin = ~0, tscmax = 0;
- guint64 tscstop;
-
- /* Argument parsing --- not very bulletproof at all */
-
- if (argc != 6)
- usage (NULL);
-
- method = atoi (argv[1]);
- minpix = atoi (argv[2]);
- maxpix = atoi (argv[3]);
- sign = atoi (argv[4]);
- niters = atol (argv[5]);
-
- gst_library_load ("gstidct");
-
- idct = gst_idct_new (method);
- if (idct == 0) {
- printf ("method not available\n\n\n");
-
- return 0;
- }
-
- dct_init ();
-
- /* Loop once per generated random-data block */
-
- for (curiter = 0; curiter < niters; curiter++) {
-
- /* generate a pseudo-random block of data */
- for (i = 0; i < DCTSIZE2; i++)
- block[i] = (DCTELEM) (ieeerand (-minpix, maxpix) * sign);
-
- /* perform reference FDCT */
- memcpy (refcoefs, block, sizeof (DCTELEM) * DCTSIZE2);
- ref_fdct ((DCTELEM **) & refcoefs);
- /* clip */
- for (i = 0; i < DCTSIZE2; i++) {
- if (refcoefs[i] < -2048)
- refcoefs[i] = -2048;
- else if (refcoefs[i] > 2047)
- refcoefs[i] = 2047;
- }
-
- /* perform reference IDCT */
- memcpy (refout, refcoefs, sizeof (DCTELEM) * DCTSIZE2);
- ref_idct (refout);
- /* clip */
- for (i = 0; i < DCTSIZE2; i++) {
- if (refout[i] < -256)
- refout[i] = -256;
- else if (refout[i] > 255)
- refout[i] = 255;
- }
-
- /* perform test IDCT */
- if (GST_IDCT_TRANSPOSE (idct)) {
- for (j = 0; j < DCTSIZE; j++) {
- for (i = 0; i < DCTSIZE; i++) {
- testout[i * DCTSIZE + j] = refcoefs[j * DCTSIZE + i];
- }
- }
- } else {
- memcpy (testout, refcoefs, sizeof (DCTELEM) * DCTSIZE2);
- }
-
- gst_trace_read_tsc (&tscstart);
- gst_idct_convert (idct, testout);
- gst_trace_read_tsc (&tscstop);
- /*printf("time %llu, %llu %lld\n", tscstart, tscstop, tscstop-tscstart); */
- if (tscstop - tscstart < tscmin)
- tscmin = tscstop - tscstart;
- if (tscstop - tscstart > tscmax)
- tscmax = tscstop - tscstart;
-
- /* clip */
- for (i = 0; i < DCTSIZE2; i++) {
- if (testout[i] < -256)
- testout[i] = -256;
- else if (testout[i] > 255)
- testout[i] = 255;
- }
-
- /* accumulate error stats */
- for (i = 0; i < DCTSIZE2; i++) {
- register int err = testout[i] - refout[i];
-
- sumerrs[i] += err;
- sumsqerrs[i] += err * err;
- if (err < 0)
- err = -err;
- if (maxerr[i] < err)
- maxerr[i] = err;
- }
-
- if (curiter % 100 == 99) {
- fprintf (stderr, ".");
- fflush (stderr);
- }
- }
- fprintf (stderr, "\n");
-
- /* print results */
-
- printf
- ("IEEE test conditions: -L = %ld, +H = %ld, sign = %ld, #iters = %ld\n",
- minpix, maxpix, sign, niters);
-
- printf ("Speed, min time %lld, max %lld\n", tscmin, tscmax);
-
- printf ("Peak absolute values of errors:\n");
- for (i = 0, j = 0; i < DCTSIZE2; i++) {
- if (j < maxerr[i])
- j = maxerr[i];
- printf ("%4d", maxerr[i]);
- if ((i % DCTSIZE) == DCTSIZE - 1)
- printf ("\n");
- }
- printf ("Worst peak error = %d (%s spec limit 1)\n\n", j,
- meets ((double) j, 1.0));
-
- printf ("Mean square errors:\n");
- max = total = 0.0;
- for (i = 0; i < DCTSIZE2; i++) {
- double err = (double) sumsqerrs[i] / ((double) niters);
-
- total += (double) sumsqerrs[i];
- if (max < err)
- max = err;
- printf (" %8.4f", err);
- if ((i % DCTSIZE) == DCTSIZE - 1)
- printf ("\n");
- }
- printf ("Worst pmse = %.6f (%s spec limit 0.06)\n", max, meets (max, 0.06));
- total /= (double) (64 * niters);
- printf ("Overall mse = %.6f (%s spec limit 0.02)\n\n", total,
- meets (total, 0.02));
-
- printf ("Mean errors:\n");
- max = total = 0.0;
- for (i = 0; i < DCTSIZE2; i++) {
- double err = (double) sumerrs[i] / ((double) niters);
-
- total += (double) sumerrs[i];
- printf (" %8.4f", err);
- if (err < 0.0)
- err = -err;
- if (max < err)
- max = err;
- if ((i % DCTSIZE) == DCTSIZE - 1)
- printf ("\n");
- }
- printf ("Worst mean error = %.6f (%s spec limit 0.015)\n", max,
- meets (max, 0.015));
- total /= (double) (64 * niters);
- printf ("Overall mean error = %.6f (%s spec limit 0.0015)\n\n", total,
- meets (total, 0.0015));
-
- /* test for 0 input giving 0 output */
- memset (testout, 0, sizeof (DCTELEM) * DCTSIZE2);
- gst_idct_convert (idct, testout);
- for (i = 0, j = 0; i < DCTSIZE2; i++) {
- if (testout[i]) {
- printf ("Position %d of IDCT(0) = %d (FAILS)\n", i, testout[i]);
- j++;
- }
- }
- printf ("%d elements of IDCT(0) were not zero\n\n\n", j);
-
- exit (0);
- return 0;
-}
-
-
-void
-usage (char *msg)
-{
- if (msg != NULL)
- fprintf (stderr, "\nerror: %s\n", msg);
-
- fprintf (stderr, "\n");
- fprintf (stderr, "usage: ieeetest minpix maxpix sign niters\n");
- fprintf (stderr, "\n");
- fprintf (stderr, " test = 1 - 5\n");
- fprintf (stderr, " minpix = -L value per IEEE spec\n");
- fprintf (stderr, " maxpix = H value per IEEE spec\n");
- fprintf (stderr, " sign = +1 for normal, -1 to run negated test\n");
- fprintf (stderr, " niters = # iterations (10000 for full test)\n");
- fprintf (stderr, "\n");
-
- exit (1);
-}
-
-
-/* Pseudo-random generator specified by IEEE 1180 */
-
-long
-ieeerand (long L, long H)
-{
- static long randx = 1;
- static double z = (double) 0x7fffffff;
-
- long i, j;
- double x;
-
- randx = (randx * 1103515245) + 12345;
- i = randx & 0x7ffffffe;
- x = ((double) i) / z;
- x *= (L + H + 1);
- j = x;
- return j - L;
-}
-
-
-/* Reference double-precision FDCT and IDCT */
-
-
-/* The cosine lookup table */
-/* coslu[a][b] = C(b)/2 * cos[(2a+1)b*pi/16] */
-double coslu[8][8];
-
-
-/* Routine to initialise the cosine lookup table */
-void
-dct_init (void)
-{
- int a, b;
- double tmp;
-
- for (a = 0; a < 8; a++)
- for (b = 0; b < 8; b++) {
- tmp = cos ((double) ((a + a + 1) * b) * (3.14159265358979323846 / 16.0));
- if (b == 0)
- tmp /= sqrt (2.0);
- coslu[a][b] = tmp * 0.5;
- }
-}
-
-
-void
-ref_fdct (DCTELEM block[8][8])
-{
- int x, y, u, v;
- double tmp, tmp2;
- double res[8][8];
-
- for (v = 0; v < 8; v++) {
- for (u = 0; u < 8; u++) {
- tmp = 0.0;
- for (y = 0; y < 8; y++) {
- tmp2 = 0.0;
- for (x = 0; x < 8; x++) {
- tmp2 += (double) block[y][x] * coslu[x][u];
- }
- tmp += coslu[y][v] * tmp2;
- }
- res[v][u] = tmp;
- }
- }
-
- for (v = 0; v < 8; v++) {
- for (u = 0; u < 8; u++) {
- tmp = res[v][u];
- if (tmp < 0.0) {
- x = -((int) (0.5 - tmp));
- } else {
- x = (int) (tmp + 0.5);
- }
- block[v][u] = (DCTELEM) x;
- }
- }
-}
-
-
-void
-ref_idct (DCTELEM block[8][8])
-{
- int x, y, u, v;
- double tmp, tmp2;
- double res[8][8];
-
- for (y = 0; y < 8; y++) {
- for (x = 0; x < 8; x++) {
- tmp = 0.0;
- for (v = 0; v < 8; v++) {
- tmp2 = 0.0;
- for (u = 0; u < 8; u++) {
- tmp2 += (double) block[v][u] * coslu[x][u];
- }
- tmp += coslu[y][v] * tmp2;
- }
- res[y][x] = tmp;
- }
- }
-
- for (v = 0; v < 8; v++) {
- for (u = 0; u < 8; u++) {
- tmp = res[v][u];
- if (tmp < 0.0) {
- x = -((int) (0.5 - tmp));
- } else {
- x = (int) (tmp + 0.5);
- }
- block[v][u] = (DCTELEM) x;
- }
- }
-}
diff --git a/gst-libs/gst/idct/intidct.c b/gst-libs/gst/idct/intidct.c
deleted file mode 100644
index d2945348..00000000
--- a/gst-libs/gst/idct/intidct.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * jrevdct.c
- *
- * Copyright (C) 1991, 1992, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the basic inverse-DCT transformation subroutine.
- *
- * This implementation is based on an algorithm described in
- * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
- * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
- * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
- * The primary algorithm described there uses 11 multiplies and 29 adds.
- * We use their alternate method with 12 multiplies and 32 adds.
- * The advantage of this method is that no data path contains more than one
- * multiplication; this allows a very simple and accurate implementation in
- * scaled fixed-point arithmetic, with a minimal number of shifts.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "dct.h"
-
-/* We assume that right shift corresponds to signed division by 2 with
- * rounding towards minus infinity. This is correct for typical "arithmetic
- * shift" instructions that shift in copies of the sign bit. But some
- * C compilers implement >> with an unsigned shift. For these machines you
- * must define RIGHT_SHIFT_IS_UNSIGNED.
- * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
- * It is only applied with constant shift counts. SHIFT_TEMPS must be
- * included in the variables of any routine using RIGHT_SHIFT.
- */
-
-#ifdef RIGHT_SHIFT_IS_UNSIGNED
-#define SHIFT_TEMPS INT32 shift_temp;
-#define RIGHT_SHIFT(x,shft) \
- ((shift_temp = (x)) < 0 ? \
- (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
- (shift_temp >> (shft)))
-#else
-#define SHIFT_TEMPS
-#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
-#endif
-
-
-/*
- * This routine is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
-Sorry, this code only copes with 8 x8 DCTs. /* deliberate syntax err */
-#endif
-/*
- * A 2-D IDCT can be done by 1-D IDCT on each row followed by 1-D IDCT
- * on each column. Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * The poop on this scaling stuff is as follows:
- *
- * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
- * larger than the true IDCT outputs. The final outputs are therefore
- * a factor of N larger than desired; since N=8 this can be cured by
- * a simple right shift at the end of the algorithm. The advantage of
- * this arrangement is that we save two multiplications per 1-D IDCT,
- * because the y0 and y4 inputs need not be divided by sqrt(N).
- *
- * We have to do addition and subtraction of the integer inputs, which
- * is no problem, and multiplication by fractional constants, which is
- * a problem to do in integer arithmetic. We multiply all the constants
- * by CONST_SCALE and convert them to integer constants (thus retaining
- * CONST_BITS bits of precision in the constants). After doing a
- * multiplication we have to divide the product by CONST_SCALE, with proper
- * rounding, to produce the correct output. This division can be done
- * cheaply as a right shift of CONST_BITS bits. We postpone shifting
- * as long as possible so that partial sums can be added together with
- * full fractional precision.
- *
- * The outputs of the first pass are scaled up by PASS1_BITS bits so that
- * they are represented to better-than-integral precision. These outputs
- * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
- * with the recommended scaling. (To scale up 12-bit sample data further, an
- * intermediate INT32 array would be needed.)
- *
- * To avoid overflow of the 32-bit intermediate results in pass 2, we must
- * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
- * shows that the values given below are the most effective.
- */
-#ifdef EIGHT_BIT_SAMPLES
-#define CONST_BITS 13
-#define PASS1_BITS 2
-#else
-#define CONST_BITS 13
-#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
-#endif
-#define ONE ((INT32) 1)
-#define CONST_SCALE (ONE << CONST_BITS)
-/* Convert a positive real constant to an integer scaled by CONST_SCALE. */
-#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-#if CONST_BITS == 13
-#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
-#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
-#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
-#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
-#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
-#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
-#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
-#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
-#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
-#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
-#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
-#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
-#else
-#define FIX_0_298631336 FIX(0.298631336)
-#define FIX_0_390180644 FIX(0.390180644)
-#define FIX_0_541196100 FIX(0.541196100)
-#define FIX_0_765366865 FIX(0.765366865)
-#define FIX_0_899976223 FIX(0.899976223)
-#define FIX_1_175875602 FIX(1.175875602)
-#define FIX_1_501321110 FIX(1.501321110)
-#define FIX_1_847759065 FIX(1.847759065)
-#define FIX_1_961570560 FIX(1.961570560)
-#define FIX_2_053119869 FIX(2.053119869)
-#define FIX_2_562915447 FIX(2.562915447)
-#define FIX_3_072711026 FIX(3.072711026)
-#endif
-/* Descale and correctly round an INT32 value that's scaled by N bits.
- * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
- * the fudge factor is correct for either sign of X.
- */
-#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
- * For 8-bit samples with the recommended scaling, all the variable
- * and constant values involved are no more than 16 bits wide, so a
- * 16x16->32 bit multiply can be used instead of a full 32x32 multiply;
- * this provides a useful speedup on many machines.
- * There is no way to specify a 16x16->32 multiply in portable C, but
- * some C compilers will do the right thing if you provide the correct
- * combination of casts.
- * NB: for 12-bit samples, a full 32-bit multiplication will be needed.
- */
-#ifdef EIGHT_BIT_SAMPLES
-#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
-#define MULTIPLY(var,const) (((INT16) (var)) * ((INT16) (const)))
-#endif
-#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
-#define MULTIPLY(var,const) (((INT16) (var)) * ((INT32) (const)))
-#endif
-#endif
-#ifndef MULTIPLY /* default definition */
-#define MULTIPLY(var,const) ((var) * (const))
-#endif
-/*
- * Perform the inverse DCT on one block of coefficients.
- */
- void
-gst_idct_int_idct (DCTBLOCK data)
-{
- INT32 tmp0, tmp1, tmp2, tmp3;
- INT32 tmp10, tmp11, tmp12, tmp13;
- INT32 z1, z2, z3, z4, z5;
- register DCTELEM *dataptr;
- int rowctr;
-
- SHIFT_TEMPS
- /* Pass 1: process rows. */
- /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
- /* furthermore, we scale the results by 2**PASS1_BITS. */
- dataptr = data;
- for (rowctr = DCTSIZE - 1; rowctr >= 0; rowctr--) {
- /* Due to quantization, we will usually find that many of the input
- * coefficients are zero, especially the AC terms. We can exploit this
- * by short-circuiting the IDCT calculation for any row in which all
- * the AC terms are zero. In that case each output is equal to the
- * DC coefficient (with scale factor as needed).
- * With typical images and quantization tables, half or more of the
- * row DCT calculations can be simplified this way.
- */
-
- if ((dataptr[1] | dataptr[2] | dataptr[3] | dataptr[4] |
- dataptr[5] | dataptr[6] | dataptr[7]) == 0) {
- /* AC terms all zero */
- DCTELEM dcval = (DCTELEM) (dataptr[0] << PASS1_BITS);
-
- dataptr[0] = dcval;
- dataptr[1] = dcval;
- dataptr[2] = dcval;
- dataptr[3] = dcval;
- dataptr[4] = dcval;
- dataptr[5] = dcval;
- dataptr[6] = dcval;
- dataptr[7] = dcval;
-
- dataptr += DCTSIZE; /* advance pointer to next row */
- continue;
- }
-
- /* Even part: reverse the even part of the forward DCT. */
- /* The rotator is sqrt(2)*c(-6). */
-
- z2 = (INT32) dataptr[2];
- z3 = (INT32) dataptr[6];
-
- z1 = MULTIPLY (z2 + z3, FIX_0_541196100);
- tmp2 = z1 + MULTIPLY (z3, -FIX_1_847759065);
- tmp3 = z1 + MULTIPLY (z2, FIX_0_765366865);
-
- tmp0 = ((INT32) dataptr[0] + (INT32) dataptr[4]) << CONST_BITS;
- tmp1 = ((INT32) dataptr[0] - (INT32) dataptr[4]) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- /* Odd part per figure 8; the matrix is unitary and hence its
- * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
- */
-
- tmp0 = (INT32) dataptr[7];
- tmp1 = (INT32) dataptr[5];
- tmp2 = (INT32) dataptr[3];
- tmp3 = (INT32) dataptr[1];
-
- z1 = tmp0 + tmp3;
- z2 = tmp1 + tmp2;
- z3 = tmp0 + tmp2;
- z4 = tmp1 + tmp3;
- z5 = MULTIPLY (z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
- tmp0 = MULTIPLY (tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- tmp1 = MULTIPLY (tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- tmp2 = MULTIPLY (tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- tmp3 = MULTIPLY (tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- z1 = MULTIPLY (z1, -FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- z2 = MULTIPLY (z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- z3 = MULTIPLY (z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z4 = MULTIPLY (z4, -FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
-
- /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
- dataptr[0] = (DCTELEM) DESCALE (tmp10 + tmp3, CONST_BITS - PASS1_BITS);
- dataptr[7] = (DCTELEM) DESCALE (tmp10 - tmp3, CONST_BITS - PASS1_BITS);
- dataptr[1] = (DCTELEM) DESCALE (tmp11 + tmp2, CONST_BITS - PASS1_BITS);
- dataptr[6] = (DCTELEM) DESCALE (tmp11 - tmp2, CONST_BITS - PASS1_BITS);
- dataptr[2] = (DCTELEM) DESCALE (tmp12 + tmp1, CONST_BITS - PASS1_BITS);
- dataptr[5] = (DCTELEM) DESCALE (tmp12 - tmp1, CONST_BITS - PASS1_BITS);
- dataptr[3] = (DCTELEM) DESCALE (tmp13 + tmp0, CONST_BITS - PASS1_BITS);
- dataptr[4] = (DCTELEM) DESCALE (tmp13 - tmp0, CONST_BITS - PASS1_BITS);
-
- dataptr += DCTSIZE; /* advance pointer to next row */
- }
-
- /* Pass 2: process columns. */
- /* Note that we must descale the results by a factor of 8 == 2**3, */
- /* and also undo the PASS1_BITS scaling. */
-
- dataptr = data;
- for (rowctr = DCTSIZE - 1; rowctr >= 0; rowctr--) {
- /* Columns of zeroes can be exploited in the same way as we did with rows.
- * However, the row calculation has created many nonzero AC terms, so the
- * simplification applies less often (typically 5% to 10% of the time).
- * On machines with very fast multiplication, it's possible that the
- * test takes more time than it's worth. In that case this section
- * may be commented out.
- */
-
-#ifndef NO_ZERO_COLUMN_TEST
- if ((dataptr[DCTSIZE * 1] | dataptr[DCTSIZE * 2] | dataptr[DCTSIZE * 3] |
- dataptr[DCTSIZE * 4] | dataptr[DCTSIZE * 5] | dataptr[DCTSIZE * 6] |
- dataptr[DCTSIZE * 7]) == 0) {
- /* AC terms all zero */
- DCTELEM dcval = (DCTELEM) DESCALE ((INT32) dataptr[0], PASS1_BITS + 3);
-
- dataptr[DCTSIZE * 0] = dcval;
- dataptr[DCTSIZE * 1] = dcval;
- dataptr[DCTSIZE * 2] = dcval;
- dataptr[DCTSIZE * 3] = dcval;
- dataptr[DCTSIZE * 4] = dcval;
- dataptr[DCTSIZE * 5] = dcval;
- dataptr[DCTSIZE * 6] = dcval;
- dataptr[DCTSIZE * 7] = dcval;
-
- dataptr++; /* advance pointer to next column */
- continue;
- }
-#endif
-
- /* Even part: reverse the even part of the forward DCT. */
- /* The rotator is sqrt(2)*c(-6). */
-
- z2 = (INT32) dataptr[DCTSIZE * 2];
- z3 = (INT32) dataptr[DCTSIZE * 6];
-
- z1 = MULTIPLY (z2 + z3, FIX_0_541196100);
- tmp2 = z1 + MULTIPLY (z3, -FIX_1_847759065);
- tmp3 = z1 + MULTIPLY (z2, FIX_0_765366865);
-
- tmp0 =
- ((INT32) dataptr[DCTSIZE * 0] +
- (INT32) dataptr[DCTSIZE * 4]) << CONST_BITS;
- tmp1 =
- ((INT32) dataptr[DCTSIZE * 0] -
- (INT32) dataptr[DCTSIZE * 4]) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- /* Odd part per figure 8; the matrix is unitary and hence its
- * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
- */
-
- tmp0 = (INT32) dataptr[DCTSIZE * 7];
- tmp1 = (INT32) dataptr[DCTSIZE * 5];
- tmp2 = (INT32) dataptr[DCTSIZE * 3];
- tmp3 = (INT32) dataptr[DCTSIZE * 1];
-
- z1 = tmp0 + tmp3;
- z2 = tmp1 + tmp2;
- z3 = tmp0 + tmp2;
- z4 = tmp1 + tmp3;
- z5 = MULTIPLY (z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
- tmp0 = MULTIPLY (tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- tmp1 = MULTIPLY (tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- tmp2 = MULTIPLY (tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- tmp3 = MULTIPLY (tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- z1 = MULTIPLY (z1, -FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- z2 = MULTIPLY (z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- z3 = MULTIPLY (z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z4 = MULTIPLY (z4, -FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
-
- /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
- dataptr[DCTSIZE * 0] = (DCTELEM) DESCALE (tmp10 + tmp3,
- CONST_BITS + PASS1_BITS + 3);
- dataptr[DCTSIZE * 7] = (DCTELEM) DESCALE (tmp10 - tmp3,
- CONST_BITS + PASS1_BITS + 3);
- dataptr[DCTSIZE * 1] = (DCTELEM) DESCALE (tmp11 + tmp2,
- CONST_BITS + PASS1_BITS + 3);
- dataptr[DCTSIZE * 6] = (DCTELEM) DESCALE (tmp11 - tmp2,
- CONST_BITS + PASS1_BITS + 3);
- dataptr[DCTSIZE * 2] = (DCTELEM) DESCALE (tmp12 + tmp1,
- CONST_BITS + PASS1_BITS + 3);
- dataptr[DCTSIZE * 5] = (DCTELEM) DESCALE (tmp12 - tmp1,
- CONST_BITS + PASS1_BITS + 3);
- dataptr[DCTSIZE * 3] = (DCTELEM) DESCALE (tmp13 + tmp0,
- CONST_BITS + PASS1_BITS + 3);
- dataptr[DCTSIZE * 4] = (DCTELEM) DESCALE (tmp13 - tmp0,
- CONST_BITS + PASS1_BITS + 3);
-
- dataptr++; /* advance pointer to next column */
- }
-}