summaryrefslogtreecommitdiff
path: root/liboil/dct
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2005-12-21 07:19:11 +0000
committerDavid Schleef <ds@schleef.org>2005-12-21 07:19:11 +0000
commit599af4cec2edfcf27dbd976c4d011f773b207691 (patch)
treee74b9cb2977cd7066a1627c52d95fbfb2b135a73 /liboil/dct
parent1e853452d1c28919d2984b5eb5a148fba1a67a04 (diff)
downloadliboil-599af4cec2edfcf27dbd976c4d011f773b207691.tar.gz
* liboil/dct/idct8x8_c.c: Add a test function.
* liboil/i386/fdct8x8theora_i386.c: Compile fix on gcc-4.1. * liboil/liboilfunction.h: wrap a macro arg in () * liboil/liboiltest.c: Doh! Maybe we should compare values in the actual data region rather than the header. This shows lots of additional breakage.
Diffstat (limited to 'liboil/dct')
-rw-r--r--liboil/dct/idct8x8_c.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/liboil/dct/idct8x8_c.c b/liboil/dct/idct8x8_c.c
index 6606516..078d78d 100644
--- a/liboil/dct/idct8x8_c.c
+++ b/liboil/dct/idct8x8_c.c
@@ -32,6 +32,9 @@
#include <liboil/liboil.h>
#include <liboil/dct/dct.h>
#include <math.h>
+#include <liboil/liboiltest.h>
+#include <liboil/liboilparameter.h>
+#include <liboil/liboilrandom.h>
/**
* SECTION:liboilfuncs-dct:
@@ -48,6 +51,20 @@
#define BLOCK8x8_S16(ptr, stride, row, column) \
(*((int16_t *)((void *)ptr + stride*row) + column))
+static void
+idct8x8_test (OilTest *test)
+{
+ int16_t *data = oil_test_get_source_data (test, OIL_ARG_SRC1);
+ int stride = oil_test_get_value (test, OIL_ARG_SSTR1);
+ int i, j;
+
+ for(j=0;j<8;j++){
+ for(i=0;i<8;i++){
+ OIL_GET(data, i*2 + j*stride, int16_t) = (oil_rand_s16() & 0xfff) - 2048;
+ }
+ }
+}
+
/**
* oil_idct8x8_f64:
* @d_8x8:
@@ -78,10 +95,9 @@ OIL_DEFINE_CLASS (idct8x8lim10_f64, "double *d_8x8, int dstr, double *s_8x8, int
* @sstr:
*
* Performs a limited 2-D Inverse Discrete Cosine Transform on @s_8x8
- * and places the result in @d_8x8. The source 8x8 block must be non-zero
- * only in the 10 lowest-order components.
+ * and places the result in @d_8x8.
*/
-OIL_DEFINE_CLASS (idct8x8_s16, "int16_t *d_8x8, int dstr, int16_t *s_8x8, int sstr");
+OIL_DEFINE_CLASS_FULL (idct8x8_s16, "int16_t *d_8x8, int dstr, int16_t *s_8x8, int sstr", idct8x8_test);
/**
* oil_idct8x8lim10_s16:
* @d_8x8: