diff options
author | David Schleef <ds@schleef.org> | 2005-06-17 19:59:54 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2005-06-17 19:59:54 +0000 |
commit | f811d988ddc37ca0592dee4024629dded03aef9f (patch) | |
tree | 24321894d863f99fa4177949c35faf2f53d015bb | |
parent | 08c59da4da16fa3b512e1559f4f72add39bfbc6d (diff) | |
download | liboil-f811d988ddc37ca0592dee4024629dded03aef9f.tar.gz |
* liboil/colorspace/Makefile.am: new files
* liboil/colorspace/argb_paint.c: remove temporary classes
* liboil/colorspace/composite.c: new
* liboil/colorspace/resample.c: new
* liboil/liboilfuncs.h: update
* liboil/liboilmarshal.c: (_oil_test_marshal_function): update
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | liboil/colorspace/Makefile.am | 4 | ||||
-rw-r--r-- | liboil/colorspace/argb_paint.c | 60 | ||||
-rw-r--r-- | liboil/colorspace/composite.c | 253 | ||||
-rw-r--r-- | liboil/colorspace/resample.c | 134 | ||||
-rw-r--r-- | liboil/liboilfuncs.h | 45 | ||||
-rw-r--r-- | liboil/liboilmarshal.c | 12 |
7 files changed, 441 insertions, 76 deletions
@@ -1,3 +1,12 @@ +2005-06-17 David Schleef <ds@schleef.org> + + * liboil/colorspace/Makefile.am: new files + * liboil/colorspace/argb_paint.c: remove temporary classes + * liboil/colorspace/composite.c: new + * liboil/colorspace/resample.c: new + * liboil/liboilfuncs.h: update + * liboil/liboilmarshal.c: (_oil_test_marshal_function): update + 2005-06-16 David Schleef <ds@schleef.org> * liboil/conv/conv_sse.c: diff --git a/liboil/colorspace/Makefile.am b/liboil/colorspace/Makefile.am index 8aa5929..98a18ff 100644 --- a/liboil/colorspace/Makefile.am +++ b/liboil/colorspace/Makefile.am @@ -10,7 +10,9 @@ c_sources = \ rgb2bgr.c \ rgb2rgba.c \ ayuv2argb.c \ - argb_paint.c + argb_paint.c \ + composite.c \ + resample.c if HAVE_CPU_POWERPC powerpc_sources = \ diff --git a/liboil/colorspace/argb_paint.c b/liboil/colorspace/argb_paint.c index edbdcda..8a19f75 100644 --- a/liboil/colorspace/argb_paint.c +++ b/liboil/colorspace/argb_paint.c @@ -33,8 +33,6 @@ #include <liboil/liboilfunction.h> OIL_DEFINE_CLASS (argb_paint_u8, "uint8_t *i_4xn, uint8_t *s1_4, uint8_t *s2_n, int n"); -OIL_DEFINE_CLASS (argb_splat_u8, "uint8_t *i_4xn, uint8_t *s1_4, int n"); -OIL_DEFINE_CLASS (rgba_splat_u8, "uint8_t *i_4xn, uint8_t *s1_4, int n"); #define div255(x) (((x + 128) + ((x + 128)>>8))>>8) @@ -57,61 +55,3 @@ argb_paint_u8_ref (uint8_t *dest, uint8_t *color, uint8_t *alpha, int n) } OIL_DEFINE_IMPL_REF (argb_paint_u8_ref, argb_paint_u8); -static void -argb_splat_u8_ref (uint8_t *dest, uint8_t *color, int n) -{ - int i; - - for(i=0;i<n;i++){ - dest[0] = blend(color[0],dest[0],color[0]); - dest[1] = blend(color[1],dest[1],color[0]); - dest[2] = blend(color[2],dest[2],color[0]); - dest[3] = blend(color[3],dest[3],color[0]); - dest+=4; - } - -} -OIL_DEFINE_IMPL_REF (argb_splat_u8_ref, argb_splat_u8); - -static void -rgba_splat_u8_ref (uint8_t *dest, uint8_t *color, int n) -{ - int i; - - for(i=0;i<n;i++){ - dest[0] = blend(color[0],dest[0],color[3]); - dest[1] = blend(color[1],dest[1],color[3]); - dest[2] = blend(color[2],dest[2],color[3]); - dest[3] = blend(color[3],dest[3],color[3]); - dest+=4; - } - -} -OIL_DEFINE_IMPL_REF (rgba_splat_u8_ref, rgba_splat_u8); - - -static void -argb_paint_u8_fast (uint8_t *dest, uint8_t *color, uint8_t *alpha, int n) -{ - int i; - - for(i=0;i<n;i++){ - if (*alpha == 0) { - } else if (*alpha == 255) { - dest[0] = color[0]; - dest[1] = color[1]; - dest[2] = color[2]; - dest[3] = color[3]; - } else { - dest[0] = blend(color[0],dest[0],alpha[0]); - dest[1] = blend(color[1],dest[1],alpha[0]); - dest[2] = blend(color[2],dest[2],alpha[0]); - dest[3] = blend(color[3],dest[3],alpha[0]); - } - dest+=4; - alpha++; - } - -} -OIL_DEFINE_IMPL (argb_paint_u8_fast, argb_paint_u8); - diff --git a/liboil/colorspace/composite.c b/liboil/colorspace/composite.c new file mode 100644 index 0000000..c0d1dd4 --- /dev/null +++ b/liboil/colorspace/composite.c @@ -0,0 +1,253 @@ +/* + * LIBOIL - Library of Optimized Inner Loops + * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <liboil/liboil.h> +#include <liboil/liboilfunction.h> + + +#define ARGB(a,r,g,b) (((a)<<24) | ((r)<<16) | ((g)<<8) | (b)) +#define ARGB_A(color) (((color)>>24)&0xff) +#define ARGB_R(color) (((color)>>16)&0xff) +#define ARGB_G(color) (((color)>>8)&0xff) +#define ARGB_B(color) (((color)>>0)&0xff) + +#define div255(x) (((x + 128) + ((x + 128)>>8))>>8) + +#define COMPOSE_OVER(d,s,m) ((d) + (s) - div255((d)*(a))) +#define COMPOSE_ADD(d,s) ((d) + (s)) +#define COMPOSE_IN(s,m) (div255((s)*(m))) + +OIL_DEFINE_CLASS (composite_in_argb, + "uint32_t *d_n, uint32_t *s1_n, uint8_t *s2_n, int n"); +OIL_DEFINE_CLASS (composite_in_argb_const_src, + "uint32_t *d_n, uint32_t *s1_1, uint8_t *s2_n, int n"); +OIL_DEFINE_CLASS (composite_in_argb_const_mask, + "uint32_t *d_n, uint32_t *s1_n, uint8_t *s2_1, int n"); +OIL_DEFINE_CLASS (composite_over_argb, + "uint32_t *i_n, uint32_t *s1_n, int n"); +OIL_DEFINE_CLASS (composite_over_argb_const_src, + "uint32_t *i_n, uint32_t *s1_1, int n"); +OIL_DEFINE_CLASS (composite_add_argb, + "uint32_t *i_n, uint32_t *s1_n, int n"); +OIL_DEFINE_CLASS (composite_add_argb_const_src, + "uint32_t *i_n, uint32_t *s1_1, int n"); +OIL_DEFINE_CLASS (composite_in_over_argb, + "uint32_t *i_n, uint32_t *s1_n, uint8_t *s2_n, int n"); +OIL_DEFINE_CLASS (composite_in_over_argb_const_src, + "uint32_t *i_n, uint32_t *s1_1, uint8_t *s2_n, int n"); +OIL_DEFINE_CLASS (composite_in_over_argb_const_mask, + "uint32_t *i_n, uint32_t *s1_n, uint8_t *s2_1, int n"); + +static void +composite_in_argb_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n) +{ + int i; + + for(i=0;i<n;i++){ + dest[i] = ARGB( + COMPOSE_IN(ARGB_A(src[i]), mask[i]), + COMPOSE_IN(ARGB_R(src[i]), mask[i]), + COMPOSE_IN(ARGB_G(src[i]), mask[i]), + COMPOSE_IN(ARGB_B(src[i]), mask[i])); + } +} +OIL_DEFINE_IMPL_REF (composite_in_argb_ref, composite_in_argb); + +static void +composite_in_argb_const_src_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n) +{ + int i; + + for(i=0;i<n;i++){ + dest[i] = ARGB( + COMPOSE_IN(ARGB_A(src[0]), mask[i]), + COMPOSE_IN(ARGB_R(src[0]), mask[i]), + COMPOSE_IN(ARGB_G(src[0]), mask[i]), + COMPOSE_IN(ARGB_B(src[0]), mask[i])); + } +} +OIL_DEFINE_IMPL_REF (composite_in_argb_const_src_ref, composite_in_argb_const_src); + +static void +composite_in_argb_const_mask_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n) +{ + int i; + + for(i=0;i<n;i++){ + dest[i] = ARGB( + COMPOSE_IN(ARGB_A(src[i]), mask[0]), + COMPOSE_IN(ARGB_R(src[i]), mask[0]), + COMPOSE_IN(ARGB_G(src[i]), mask[0]), + COMPOSE_IN(ARGB_B(src[i]), mask[0])); + } +} +OIL_DEFINE_IMPL_REF (composite_in_argb_const_mask_ref, composite_in_argb_const_mask); + +static void +composite_over_argb_ref (uint32_t *dest, uint32_t *src, int n) +{ + int i; + uint8_t a; + + for(i=0;i<n;i++){ + a = ARGB_A(src[i]); + dest[i] = ARGB( + COMPOSE_OVER(ARGB_A(dest[i]),ARGB_A(src[i]),a), + COMPOSE_OVER(ARGB_R(dest[i]),ARGB_R(src[i]),a), + COMPOSE_OVER(ARGB_G(dest[i]),ARGB_G(src[i]),a), + COMPOSE_OVER(ARGB_B(dest[i]),ARGB_B(src[i]),a)); + } + +} +OIL_DEFINE_IMPL_REF (composite_over_argb_ref, composite_over_argb); + +static void +composite_over_argb_const_src_ref (uint32_t *dest, uint32_t *src, int n) +{ + int i; + uint8_t a; + + a = ARGB_A(src[0]); + for(i=0;i<n;i++){ + dest[i] = ARGB( + COMPOSE_OVER(ARGB_A(dest[i]),ARGB_A(src[0]),a), + COMPOSE_OVER(ARGB_R(dest[i]),ARGB_R(src[0]),a), + COMPOSE_OVER(ARGB_G(dest[i]),ARGB_G(src[0]),a), + COMPOSE_OVER(ARGB_B(dest[i]),ARGB_B(src[0]),a)); + } + +} +OIL_DEFINE_IMPL_REF (composite_over_argb_const_src_ref, composite_over_argb_const_src); + +static void +composite_add_argb_ref (uint32_t *dest, uint32_t *src, int n) +{ + int i; + + for(i=0;i<n;i++){ + dest[i] = ARGB( + COMPOSE_ADD(ARGB_A(dest[i]),ARGB_A(src[i])), + COMPOSE_ADD(ARGB_R(dest[i]),ARGB_R(src[i])), + COMPOSE_ADD(ARGB_G(dest[i]),ARGB_G(src[i])), + COMPOSE_ADD(ARGB_B(dest[i]),ARGB_B(src[i]))); + } + +} +OIL_DEFINE_IMPL_REF (composite_add_argb_ref, composite_add_argb); + +static void +composite_add_argb_const_src_ref (uint32_t *dest, uint32_t *src, int n) +{ + int i; + + for(i=0;i<n;i++){ + dest[i] = ARGB( + COMPOSE_ADD(ARGB_A(dest[i]),ARGB_A(src[0])), + COMPOSE_ADD(ARGB_R(dest[i]),ARGB_R(src[0])), + COMPOSE_ADD(ARGB_G(dest[i]),ARGB_G(src[0])), + COMPOSE_ADD(ARGB_B(dest[i]),ARGB_B(src[0]))); + } + +} +OIL_DEFINE_IMPL_REF (composite_add_argb_const_src_ref, composite_add_argb_const_src); + +static void +composite_in_over_argb_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n) +{ + int i; + uint8_t a; + uint32_t color; + + for(i=0;i<n;i++){ + color = ARGB( + COMPOSE_IN(ARGB_A(src[i]), mask[i]), + COMPOSE_IN(ARGB_R(src[i]), mask[i]), + COMPOSE_IN(ARGB_G(src[i]), mask[i]), + COMPOSE_IN(ARGB_B(src[i]), mask[i])); + a = ARGB_A(color); + dest[i] = ARGB( + COMPOSE_OVER(ARGB_A(dest[i]),ARGB_A(color),a), + COMPOSE_OVER(ARGB_R(dest[i]),ARGB_R(color),a), + COMPOSE_OVER(ARGB_G(dest[i]),ARGB_G(color),a), + COMPOSE_OVER(ARGB_B(dest[i]),ARGB_B(color),a)); + } + +} +OIL_DEFINE_IMPL_REF (composite_in_over_argb_ref, composite_in_over_argb); + +static void +composite_in_over_argb_const_src_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n) +{ + int i; + uint8_t a; + uint32_t color; + + for(i=0;i<n;i++){ + color = ARGB( + COMPOSE_IN(ARGB_A(src[0]), mask[i]), + COMPOSE_IN(ARGB_R(src[0]), mask[i]), + COMPOSE_IN(ARGB_G(src[0]), mask[i]), + COMPOSE_IN(ARGB_B(src[0]), mask[i])); + a = ARGB_A(color); + dest[i] = ARGB( + COMPOSE_OVER(ARGB_A(dest[i]),ARGB_A(color),a), + COMPOSE_OVER(ARGB_R(dest[i]),ARGB_R(color),a), + COMPOSE_OVER(ARGB_G(dest[i]),ARGB_G(color),a), + COMPOSE_OVER(ARGB_B(dest[i]),ARGB_B(color),a)); + } + +} +OIL_DEFINE_IMPL_REF (composite_in_over_argb_const_src_ref, composite_in_over_argb_const_src); + +static void +composite_in_over_argb_const_mask_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n) +{ + int i; + uint8_t a; + uint32_t color; + + for(i=0;i<n;i++){ + color = ARGB( + COMPOSE_IN(ARGB_A(src[i]), mask[0]), + COMPOSE_IN(ARGB_R(src[i]), mask[0]), + COMPOSE_IN(ARGB_G(src[i]), mask[0]), + COMPOSE_IN(ARGB_B(src[i]), mask[0])); + a = ARGB_A(color); + dest[i] = ARGB( + COMPOSE_OVER(ARGB_A(dest[i]),ARGB_A(color),a), + COMPOSE_OVER(ARGB_R(dest[i]),ARGB_R(color),a), + COMPOSE_OVER(ARGB_G(dest[i]),ARGB_G(color),a), + COMPOSE_OVER(ARGB_B(dest[i]),ARGB_B(color),a)); + } + +} +OIL_DEFINE_IMPL_REF (composite_in_over_argb_const_mask_ref, composite_in_over_argb_const_mask); + diff --git a/liboil/colorspace/resample.c b/liboil/colorspace/resample.c new file mode 100644 index 0000000..e07d6c5 --- /dev/null +++ b/liboil/colorspace/resample.c @@ -0,0 +1,134 @@ +/* + * LIBOIL - Library of Optimized Inner Loops + * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <liboil/liboil.h> +#include <liboil/liboilfunction.h> +#include <liboil/liboiltest.h> + + +static void +resample_linear_u8_test (OilTest *test) +{ + uint32_t *in = (uint32_t *)(test->params[OIL_ARG_INPLACE1].src_data + + OIL_TEST_HEADER); + + in[0] = 0; + in[1] = 65536; +} +OIL_DEFINE_CLASS_FULL (resample_linear_u8, + "uint8_t *d_n, uint8_t *s_2xn, int n, uint32_t *i_2", + resample_linear_u8_test); + +static void +resample_linear_argb_test (OilTest *test) +{ + uint32_t *in = (uint32_t *)(test->params[OIL_ARG_INPLACE1].src_data + + OIL_TEST_HEADER); + + in[0] = 0; + in[1] = 65536; +} +OIL_DEFINE_CLASS_FULL (resample_linear_argb, + "uint32_t *d_n, uint32_t *s_2xn, int n, uint32_t *i_2", + resample_linear_argb_test); + +static void +resample_linear_u8_ref (uint8_t *dest, uint8_t *src, int n, + uint32_t *in) +{ + int acc = in[0]; + int increment = in[1]; + int i; + int j; + int x; + + for(i=0;i<n;i++){ + j = acc>>16; + x = (acc&0xffff)>>8; + dest[i] = (src[j]*(256-x) + src[j+1]*x) >> 8; + + acc += increment; + } + + in[0] = acc; +} +OIL_DEFINE_IMPL_REF (resample_linear_u8_ref, resample_linear_u8); + +static void +resample_linear_argb_ref (uint32_t *d, uint32_t *s, int n, uint32_t *in) +{ + uint8_t *src = (uint8_t *)s; + uint8_t *dest = (uint8_t *)d; + int acc = in[0]; + int increment = in[1]; + int i; + int j; + int x; + + for(i=0;i<n;i++){ + j = acc>>16; + x = (acc&0xffff)>>8; + dest[4*i+0] = (src[4*j+0]*(256-x) + src[4*j+4]*x) >> 8; + dest[4*i+1] = (src[4*j+1]*(256-x) + src[4*j+5]*x) >> 8; + dest[4*i+2] = (src[4*j+2]*(256-x) + src[4*j+6]*x) >> 8; + dest[4*i+3] = (src[4*j+3]*(256-x) + src[4*j+7]*x) >> 8; + + acc += increment; + } + + in[0] = acc; +} +OIL_DEFINE_IMPL_REF (resample_linear_argb_ref, resample_linear_argb); + + +OIL_DEFINE_CLASS (merge_linear_argb, + "uint32_t *d_n, uint32_t *s_n, uint32_t *s2_n, uint32_t *s3_1, int n"); + +static void +merge_linear_argb_ref (uint32_t *d, uint32_t *s1, uint32_t *s2, + uint32_t *src3, int n) +{ + uint8_t *src1 = (uint8_t *)s1; + uint8_t *src2 = (uint8_t *)s2; + uint8_t *dest = (uint8_t *)d; + int i; + int x = src3[0]; + + for(i=0;i<n;i++){ + dest[4*i+0] = (src1[4*i+0]*(256-x) + src2[4*i+0]*x) >> 8; + dest[4*i+1] = (src1[4*i+1]*(256-x) + src2[4*i+1]*x) >> 8; + dest[4*i+2] = (src1[4*i+2]*(256-x) + src2[4*i+2]*x) >> 8; + dest[4*i+3] = (src1[4*i+3]*(256-x) + src2[4*i+3]*x) >> 8; + } +} +OIL_DEFINE_IMPL_REF (merge_linear_argb_ref, merge_linear_argb); + + diff --git a/liboil/liboilfuncs.h b/liboil/liboilfuncs.h index f855a73..07aaee6 100644 --- a/liboil/liboilfuncs.h +++ b/liboil/liboilfuncs.h @@ -54,9 +54,6 @@ typedef void (*_oil_type_abs_u8_s8)(uint8_t * dest, int dstr, const int8_t * src extern OilFunctionClass *oil_function_class_ptr_argb_paint_u8; typedef void (*_oil_type_argb_paint_u8)(uint8_t * i_4xn, const uint8_t * s1_4, const uint8_t * s2_n, int n); #define oil_argb_paint_u8 ((_oil_type_argb_paint_u8)(*(void **)oil_function_class_ptr_argb_paint_u8)) -extern OilFunctionClass *oil_function_class_ptr_argb_splat_u8; -typedef void (*_oil_type_argb_splat_u8)(uint8_t * i_4xn, const uint8_t * s1_4, int n); -#define oil_argb_splat_u8 ((_oil_type_argb_splat_u8)(*(void **)oil_function_class_ptr_argb_splat_u8)) extern OilFunctionClass *oil_function_class_ptr_average2_u8; typedef void (*_oil_type_average2_u8)(uint8_t * dest, int dstr, const uint8_t * src1, int sstr1, const uint8_t * src2, int sstr2, int n); #define oil_average2_u8 ((_oil_type_average2_u8)(*(void **)oil_function_class_ptr_average2_u8)) @@ -180,6 +177,36 @@ typedef void (*_oil_type_clipconv_u8_u16)(uint8_t * dest, int dstr, const uint16 extern OilFunctionClass *oil_function_class_ptr_clipconv_u8_u32; typedef void (*_oil_type_clipconv_u8_u32)(uint8_t * dest, int dstr, const uint32_t * src, int sstr, int n); #define oil_clipconv_u8_u32 ((_oil_type_clipconv_u8_u32)(*(void **)oil_function_class_ptr_clipconv_u8_u32)) +extern OilFunctionClass *oil_function_class_ptr_composite_add_argb; +typedef void (*_oil_type_composite_add_argb)(uint32_t * i_n, const uint32_t * s1_n, int n); +#define oil_composite_add_argb ((_oil_type_composite_add_argb)(*(void **)oil_function_class_ptr_composite_add_argb)) +extern OilFunctionClass *oil_function_class_ptr_composite_add_argb_const_src; +typedef void (*_oil_type_composite_add_argb_const_src)(uint32_t * i_n, const uint32_t * s1_1, int n); +#define oil_composite_add_argb_const_src ((_oil_type_composite_add_argb_const_src)(*(void **)oil_function_class_ptr_composite_add_argb_const_src)) +extern OilFunctionClass *oil_function_class_ptr_composite_in_argb; +typedef void (*_oil_type_composite_in_argb)(uint32_t * d_n, const uint32_t * s1_n, const uint8_t * s2_n, int n); +#define oil_composite_in_argb ((_oil_type_composite_in_argb)(*(void **)oil_function_class_ptr_composite_in_argb)) +extern OilFunctionClass *oil_function_class_ptr_composite_in_argb_const_mask; +typedef void (*_oil_type_composite_in_argb_const_mask)(uint32_t * d_n, const uint32_t * s1_n, const uint8_t * s2_1, int n); +#define oil_composite_in_argb_const_mask ((_oil_type_composite_in_argb_const_mask)(*(void **)oil_function_class_ptr_composite_in_argb_const_mask)) +extern OilFunctionClass *oil_function_class_ptr_composite_in_argb_const_src; +typedef void (*_oil_type_composite_in_argb_const_src)(uint32_t * d_n, const uint32_t * s1_1, const uint8_t * s2_n, int n); +#define oil_composite_in_argb_const_src ((_oil_type_composite_in_argb_const_src)(*(void **)oil_function_class_ptr_composite_in_argb_const_src)) +extern OilFunctionClass *oil_function_class_ptr_composite_in_over_argb; +typedef void (*_oil_type_composite_in_over_argb)(uint32_t * i_n, const uint32_t * s1_n, const uint8_t * s2_n, int n); +#define oil_composite_in_over_argb ((_oil_type_composite_in_over_argb)(*(void **)oil_function_class_ptr_composite_in_over_argb)) +extern OilFunctionClass *oil_function_class_ptr_composite_in_over_argb_const_mask; +typedef void (*_oil_type_composite_in_over_argb_const_mask)(uint32_t * i_n, const uint32_t * s1_n, const uint8_t * s2_1, int n); +#define oil_composite_in_over_argb_const_mask ((_oil_type_composite_in_over_argb_const_mask)(*(void **)oil_function_class_ptr_composite_in_over_argb_const_mask)) +extern OilFunctionClass *oil_function_class_ptr_composite_in_over_argb_const_src; +typedef void (*_oil_type_composite_in_over_argb_const_src)(uint32_t * i_n, const uint32_t * s1_1, const uint8_t * s2_n, int n); +#define oil_composite_in_over_argb_const_src ((_oil_type_composite_in_over_argb_const_src)(*(void **)oil_function_class_ptr_composite_in_over_argb_const_src)) +extern OilFunctionClass *oil_function_class_ptr_composite_over_argb; +typedef void (*_oil_type_composite_over_argb)(uint32_t * i_n, const uint32_t * s1_n, int n); +#define oil_composite_over_argb ((_oil_type_composite_over_argb)(*(void **)oil_function_class_ptr_composite_over_argb)) +extern OilFunctionClass *oil_function_class_ptr_composite_over_argb_const_src; +typedef void (*_oil_type_composite_over_argb_const_src)(uint32_t * i_n, const uint32_t * s1_1, int n); +#define oil_composite_over_argb_const_src ((_oil_type_composite_over_argb_const_src)(*(void **)oil_function_class_ptr_composite_over_argb_const_src)) extern OilFunctionClass *oil_function_class_ptr_conv8x8_f64_s16; typedef void (*_oil_type_conv8x8_f64_s16)(double * d_8x8, int dstr, const int16_t * s_8x8, int sstr); #define oil_conv8x8_f64_s16 ((_oil_type_conv8x8_f64_s16)(*(void **)oil_function_class_ptr_conv8x8_f64_s16)) @@ -414,6 +441,9 @@ typedef void (*_oil_type_mdct12_f64)(double * d_6, const double * s_12); extern OilFunctionClass *oil_function_class_ptr_mdct36_f64; typedef void (*_oil_type_mdct36_f64)(double * d_18, const double * s_36); #define oil_mdct36_f64 ((_oil_type_mdct36_f64)(*(void **)oil_function_class_ptr_mdct36_f64)) +extern OilFunctionClass *oil_function_class_ptr_merge_linear_argb; +typedef void (*_oil_type_merge_linear_argb)(uint32_t * d_n, const uint32_t * s_n, const uint32_t * s2_n, const uint32_t * s3_1, int n); +#define oil_merge_linear_argb ((_oil_type_merge_linear_argb)(*(void **)oil_function_class_ptr_merge_linear_argb)) extern OilFunctionClass *oil_function_class_ptr_mix_u8; typedef void (*_oil_type_mix_u8)(uint8_t * dest, const uint8_t * src1, const uint8_t * src2, const uint8_t * src3, int n); #define oil_mix_u8 ((_oil_type_mix_u8)(*(void **)oil_function_class_ptr_mix_u8)) @@ -453,9 +483,9 @@ typedef void (*_oil_type_permute_u32)(uint32_t * dest, int dstr, const uint32_t extern OilFunctionClass *oil_function_class_ptr_permute_u8; typedef void (*_oil_type_permute_u8)(uint8_t * dest, int dstr, const uint8_t * src1, int sstr1, const int32_t * src2, int sstr2, int n); #define oil_permute_u8 ((_oil_type_permute_u8)(*(void **)oil_function_class_ptr_permute_u8)) -extern OilFunctionClass *oil_function_class_ptr_resample_linear_argb_u8; -typedef void (*_oil_type_resample_linear_argb_u8)(uint8_t * d_4xn, const uint8_t * s_8xn, int n, uint32_t * i_2); -#define oil_resample_linear_argb_u8 ((_oil_type_resample_linear_argb_u8)(*(void **)oil_function_class_ptr_resample_linear_argb_u8)) +extern OilFunctionClass *oil_function_class_ptr_resample_linear_argb; +typedef void (*_oil_type_resample_linear_argb)(uint32_t * d_n, const uint32_t * s_2xn, int n, uint32_t * i_2); +#define oil_resample_linear_argb ((_oil_type_resample_linear_argb)(*(void **)oil_function_class_ptr_resample_linear_argb)) extern OilFunctionClass *oil_function_class_ptr_resample_linear_u8; typedef void (*_oil_type_resample_linear_u8)(uint8_t * d_n, const uint8_t * s_2xn, int n, uint32_t * i_2); #define oil_resample_linear_u8 ((_oil_type_resample_linear_u8)(*(void **)oil_function_class_ptr_resample_linear_u8)) @@ -465,9 +495,6 @@ typedef void (*_oil_type_rgb2bgr)(uint8_t * d_3xn, const uint8_t * s_3xn, int n) extern OilFunctionClass *oil_function_class_ptr_rgb2rgba; typedef void (*_oil_type_rgb2rgba)(uint8_t * d_4xn, const uint8_t * s_3xn, int n); #define oil_rgb2rgba ((_oil_type_rgb2rgba)(*(void **)oil_function_class_ptr_rgb2rgba)) -extern OilFunctionClass *oil_function_class_ptr_rgba_splat_u8; -typedef void (*_oil_type_rgba_splat_u8)(uint8_t * i_4xn, const uint8_t * s1_4, int n); -#define oil_rgba_splat_u8 ((_oil_type_rgba_splat_u8)(*(void **)oil_function_class_ptr_rgba_splat_u8)) extern OilFunctionClass *oil_function_class_ptr_sad8x8_f64; typedef void (*_oil_type_sad8x8_f64)(double * d_8x8, int ds, const double * s1_8x8, int ss1, const double * s2_8x8, int ss2); #define oil_sad8x8_f64 ((_oil_type_sad8x8_f64)(*(void **)oil_function_class_ptr_sad8x8_f64)) diff --git a/liboil/liboilmarshal.c b/liboil/liboilmarshal.c index 4ee633a..5e1ec4b 100644 --- a/liboil/liboilmarshal.c +++ b/liboil/liboilmarshal.c @@ -52,18 +52,18 @@ _oil_test_marshal_function (void *func, unsigned long *args, int n_args, ((void *)args[0],(void *)args[1],(void *)args[2],(int)args[3]); oil_profile_stop (prof); break; - case 0x000e: - oil_profile_start (prof); - ((void (*)(void *,void *,int))func) - ((void *)args[0],(void *)args[1],(int)args[2]); - oil_profile_stop (prof); - break; case 0x00d4: oil_profile_start (prof); ((void (*)(void *,int,void *,int,void *,int,int))func) ((void *)args[0],(int)args[1],(void *)args[2],(int)args[3],(void *)args[4],(int)args[5],(int)args[6]); oil_profile_stop (prof); break; + case 0x000e: + oil_profile_start (prof); + ((void (*)(void *,void *,int))func) + ((void *)args[0],(void *)args[1],(int)args[2]); + oil_profile_stop (prof); + break; case 0x00d3: oil_profile_start (prof); ((void (*)(void *,int,void *,int,int,void *,void *))func) |