diff options
author | David Schleef <ds@schleef.org> | 2004-12-22 03:18:51 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2004-12-22 03:18:51 +0000 |
commit | b9ff4284ee1d22ef5699b417a31a9d7c7d9d0847 (patch) | |
tree | d27d14ea531e0416f810a80594bac15dad041dfd | |
parent | c7b48c5a84de78190fbbe18415431db7d7e8211a (diff) | |
download | liboil-b9ff4284ee1d22ef5699b417a31a9d7c7d9d0847.tar.gz |
* testsuite/trans.c: (test), (main): Add test code.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | testsuite/trans.c | 65 |
2 files changed, 69 insertions, 0 deletions
@@ -1,5 +1,9 @@ 2004-12-21 David Schleef <ds@schleef.org> + * testsuite/trans.c: (test), (main): Add test code. + +2004-12-21 David Schleef <ds@schleef.org> + * autogen.sh: who needs static libraries * examples/jpeg/jpeg.c: (jpeg_decoder_decode_entropy_segment), (sprintbits): clean up diff --git a/testsuite/trans.c b/testsuite/trans.c new file mode 100644 index 0000000..2397500 --- /dev/null +++ b/testsuite/trans.c @@ -0,0 +1,65 @@ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <liboil/liboil.h> +#include <liboil/liboilfuncs.h> +#include <glib.h> +#include <string.h> +#include <math.h> + +void test(void) +{ + int16_t src2[80]; + int16_t src1[80]; + int16_t dest[80]; + int i; + int j; + + for(i=0;i<8;i++){ + for(j=0;j<8;j++){ + dest[i*10+j] = 0; + //src1[i*10+j] = i*8+j; + //src1[i*10+j] = rint(100*cos((j+0.5)*i*M_PI/8)); + src1[i*10+j] = 100*(i+j); + src2[i*10+j] = 2; + } + } + + oil_fdct8x8s_s16 (dest, 20, src1, 20); + + for(i=0;i<8;i++){ + for(j=0;j<8;j++){ + g_print("%4d ",src1[i*10+j]); + } + g_print("\n"); + } + g_print("\n"); + for(i=0;i<8;i++){ + for(j=0;j<8;j++){ + g_print("%4d ",dest[i*10+j]); + } + g_print("\n"); + } +} + +int main (int argc, char *argv[]) +{ + OilFunctionClass *klass; + OilFunctionImpl *impl; + + oil_init (); + + klass = oil_class_get ("fdct8x8s_s16"); + + oil_class_choose_by_name (klass, "fdct8x8s_s16_mmx"); + impl = klass->chosen_impl; + g_print("chosen=%p\n", impl); + impl = klass->reference_impl; + g_print("ref=%p\n", impl); + test(); + + return 0; +} + |