1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/liboil/src/deprecated/clip_ref_c_dep.c Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,374 @@
1.4 +/*
1.5 + * LIBOIL - Library of Optimized Inner Loops
1.6 + * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
1.7 + * All rights reserved.
1.8 + *
1.9 + * Redistribution and use in source and binary forms, with or without
1.10 + * modification, are permitted provided that the following conditions
1.11 + * are met:
1.12 + * 1. Redistributions of source code must retain the above copyright
1.13 + * notice, this list of conditions and the following disclaimer.
1.14 + * 2. Redistributions in binary form must reproduce the above copyright
1.15 + * notice, this list of conditions and the following disclaimer in the
1.16 + * documentation and/or other materials provided with the distribution.
1.17 + *
1.18 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1.19 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1.20 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.21 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
1.22 + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1.23 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1.24 + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.25 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1.26 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
1.27 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1.28 + * POSSIBILITY OF SUCH DAMAGE.
1.29 + */
1.30 +//Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.31 +
1.32 +#ifdef HAVE_CONFIG_H
1.33 +#include "config.h"
1.34 +#endif
1.35 +
1.36 +#include "liboil/liboilfunction.h"
1.37 +#include "liboil/liboiltest.h"
1.38 +
1.39 +/**
1.40 + * SECTION:liboilfuncs-doc:
1.41 + * @title: Miscellaneous
1.42 + * @short_description: Miscellaneous functions
1.43 + */
1.44 +#define CLIP_DEFINE_REF(type) \
1.45 +static void clip_ ## type ## _ref ( \
1.46 + oil_type_ ## type *dest, \
1.47 + int dstr, \
1.48 + oil_type_ ## type *src, \
1.49 + int sstr, int n, \
1.50 + oil_type_ ## type *min, oil_type_ ## type *max) \
1.51 +{ \
1.52 + int i; \
1.53 + oil_type_ ## type x; \
1.54 + for(i=0;i<n;i++){ \
1.55 + x = OIL_GET(src,i*sstr,oil_type_ ## type); \
1.56 + if (x<*min) x = *min; \
1.57 + if (x>*max) x = *max; \
1.58 + OIL_GET(dest,i*dstr,oil_type_ ## type) = x; \
1.59 + } \
1.60 +} \
1.61 +static void clip_ ## type ## _test (OilTest *test) \
1.62 +{ \
1.63 + oil_type_ ## type *lo = (oil_type_ ## type *) \
1.64 + oil_test_get_source_data (test, OIL_ARG_SRC2); \
1.65 + oil_type_ ## type *hi = (oil_type_ ## type *) \
1.66 + oil_test_get_source_data (test, OIL_ARG_SRC3); \
1.67 + if (*lo > *hi) { \
1.68 + oil_type_ ## type tmp; \
1.69 + tmp = *lo; \
1.70 + *lo = *hi; \
1.71 + *hi = tmp; \
1.72 + } \
1.73 +} \
1.74 +OIL_DEFINE_CLASS_FULL(clip_ ## type, \
1.75 + "oil_type_" #type " *dest, " \
1.76 + "int dstr, " \
1.77 + "oil_type_" #type " *src, " \
1.78 + "int sstr, int n, " \
1.79 + "oil_type_" #type " *s2_1, oil_type_" #type " *s3_1", \
1.80 + clip_ ## type ## _test); \
1.81 +OIL_DEFINE_IMPL_REF(clip_ ## type ## _ref, clip_ ## type)
1.82 +
1.83 +CLIP_DEFINE_REF (s8);
1.84 +CLIP_DEFINE_REF (u8);
1.85 +CLIP_DEFINE_REF (s16);
1.86 +CLIP_DEFINE_REF (u16);
1.87 +CLIP_DEFINE_REF (s32);
1.88 +CLIP_DEFINE_REF (u32);
1.89 +CLIP_DEFINE_REF (f32);
1.90 +CLIP_DEFINE_REF (f64);
1.91 +
1.92 +#ifdef __SYMBIAN32__
1.93 +
1.94 +OilFunctionClass* __oil_function_class_clip_u8() {
1.95 + return &_oil_function_class_clip_u8;
1.96 +}
1.97 +#endif
1.98 +
1.99 +#ifdef __SYMBIAN32__
1.100 +
1.101 +OilFunctionClass* __oil_function_class_clip_s8() {
1.102 + return &_oil_function_class_clip_s8;
1.103 +}
1.104 +#endif
1.105 +
1.106 +#ifdef __SYMBIAN32__
1.107 +
1.108 +OilFunctionClass* __oil_function_class_clip_s16() {
1.109 + return &_oil_function_class_clip_s16;
1.110 +}
1.111 +#endif
1.112 +#ifdef __SYMBIAN32__
1.113 +
1.114 +OilFunctionClass* __oil_function_class_clip_u16() {
1.115 + return &_oil_function_class_clip_u16;
1.116 +}
1.117 +#endif
1.118 +#ifdef __SYMBIAN32__
1.119 +
1.120 +OilFunctionClass* __oil_function_class_clip_s32() {
1.121 + return &_oil_function_class_clip_s32;
1.122 +}
1.123 +#endif
1.124 +#ifdef __SYMBIAN32__
1.125 +
1.126 +OilFunctionClass* __oil_function_class_clip_u32() {
1.127 + return &_oil_function_class_clip_u32;
1.128 +}
1.129 +#endif
1.130 +#ifdef __SYMBIAN32__
1.131 +
1.132 +OilFunctionClass* __oil_function_class_clip_f32() {
1.133 + return &_oil_function_class_clip_f32;
1.134 +}
1.135 +#endif
1.136 +#ifdef __SYMBIAN32__
1.137 +
1.138 +OilFunctionClass* __oil_function_class_clip_f64() {
1.139 + return &_oil_function_class_clip_f64;
1.140 +}
1.141 +#endif
1.142 +/**
1.143 + * oil_clip_s8:
1.144 + * @dest:
1.145 + * @dstr:
1.146 + * @src:
1.147 + * @sstr:
1.148 + * @n:
1.149 + * @s2_1:
1.150 + * @s3_1:
1.151 + *
1.152 + * Clips each value in @src to the range [@s2_1,@s3_1] and places
1.153 + * the result in @dest.
1.154 + */
1.155 +
1.156 +/**
1.157 + * oil_clip_u8:
1.158 + * @dest:
1.159 + * @dstr:
1.160 + * @src:
1.161 + * @sstr:
1.162 + * @n:
1.163 + * @s2_1:
1.164 + * @s3_1:
1.165 + *
1.166 + * Clips each value in @src to the range [@s2_1,@s3_1] and places
1.167 + * the result in @dest.
1.168 + */
1.169 +
1.170 +/**
1.171 + * oil_clip_s16:
1.172 + * @dest:
1.173 + * @dstr:
1.174 + * @src:
1.175 + * @sstr:
1.176 + * @n:
1.177 + * @s2_1:
1.178 + * @s3_1:
1.179 + *
1.180 + * Clips each value in @src to the range [@s2_1,@s3_1] and places
1.181 + * the result in @dest.
1.182 + */
1.183 +
1.184 +/**
1.185 + * oil_clip_u16:
1.186 + * @dest:
1.187 + * @dstr:
1.188 + * @src:
1.189 + * @sstr:
1.190 + * @n:
1.191 + * @s2_1:
1.192 + * @s3_1:
1.193 + *
1.194 + * Clips each value in @src to the range [@s2_1,@s3_1] and places
1.195 + * the result in @dest.
1.196 + */
1.197 +
1.198 +/**
1.199 + * oil_clip_s32:
1.200 + * @dest:
1.201 + * @dstr:
1.202 + * @src:
1.203 + * @sstr:
1.204 + * @n:
1.205 + * @s2_1:
1.206 + * @s3_1:
1.207 + *
1.208 + * Clips each value in @src to the range [@s2_1,@s3_1] and places
1.209 + * the result in @dest.
1.210 + */
1.211 +
1.212 +/**
1.213 + * oil_clip_u32:
1.214 + * @dest:
1.215 + * @dstr:
1.216 + * @src:
1.217 + * @sstr:
1.218 + * @n:
1.219 + * @s2_1:
1.220 + * @s3_1:
1.221 + *
1.222 + * Clips each value in @src to the range [@s2_1,@s3_1] and places
1.223 + * the result in @dest.
1.224 + */
1.225 +
1.226 +/**
1.227 + * oil_clip_f32:
1.228 + * @dest:
1.229 + * @dstr:
1.230 + * @src:
1.231 + * @sstr:
1.232 + * @n:
1.233 + * @s2_1:
1.234 + * @s3_1:
1.235 + *
1.236 + * Clips each value in @src to the range [@s2_1,@s3_1] and places
1.237 + * the result in @dest.
1.238 + */
1.239 +
1.240 +/**
1.241 + * oil_clip_f64:
1.242 + * @dest:
1.243 + * @dstr:
1.244 + * @src:
1.245 + * @sstr:
1.246 + * @n:
1.247 + * @s2_1:
1.248 + * @s3_1:
1.249 + *
1.250 + * Clips each value in @src to the range [@s2_1,@s3_1] and places
1.251 + * the result in @dest.
1.252 + */
1.253 +
1.254 +
1.255 +
1.256 +#ifdef __SYMBIAN32__
1.257 +
1.258 +OilFunctionImpl* __oil_function_impl_clip_s8_ref() {
1.259 + return &_oil_function_impl_clip_s8_ref;
1.260 +}
1.261 +#endif
1.262 +
1.263 +#ifdef __SYMBIAN32__
1.264 +
1.265 +OilFunctionImpl* __oil_function_impl_clip_u8_ref() {
1.266 + return &_oil_function_impl_clip_u8_ref;
1.267 +}
1.268 +#endif
1.269 +
1.270 +#ifdef __SYMBIAN32__
1.271 +
1.272 +OilFunctionImpl* __oil_function_impl_clip_s16_ref() {
1.273 + return &_oil_function_impl_clip_s16_ref;
1.274 +}
1.275 +#endif
1.276 +
1.277 +#ifdef __SYMBIAN32__
1.278 +
1.279 +OilFunctionImpl* __oil_function_impl_clip_u16_ref() {
1.280 + return &_oil_function_impl_clip_u16_ref;
1.281 +}
1.282 +#endif
1.283 +
1.284 +#ifdef __SYMBIAN32__
1.285 +
1.286 +OilFunctionImpl* __oil_function_impl_clip_s32_ref() {
1.287 + return &_oil_function_impl_clip_s32_ref;
1.288 +}
1.289 +#endif
1.290 +
1.291 +#ifdef __SYMBIAN32__
1.292 +
1.293 +OilFunctionImpl* __oil_function_impl_clip_u32_ref() {
1.294 + return &_oil_function_impl_clip_u32_ref;
1.295 +}
1.296 +#endif
1.297 +
1.298 +#ifdef __SYMBIAN32__
1.299 +
1.300 +OilFunctionImpl* __oil_function_impl_clip_f32_ref() {
1.301 + return &_oil_function_impl_clip_f32_ref;
1.302 +}
1.303 +#endif
1.304 +
1.305 +#ifdef __SYMBIAN32__
1.306 +
1.307 +OilFunctionImpl* __oil_function_impl_clip_f64_ref() {
1.308 + return &_oil_function_impl_clip_f64_ref;
1.309 +}
1.310 +#endif
1.311 +
1.312 +
1.313 +
1.314 +#ifdef __SYMBIAN32__
1.315 +
1.316 +EXPORT_C void** _oil_function_class_ptr_clip_u8 () {
1.317 + oil_function_class_ptr_clip_u8 = __oil_function_class_clip_u8();
1.318 + return &oil_function_class_ptr_clip_u8->func;
1.319 + }
1.320 +#endif
1.321 +
1.322 +#ifdef __SYMBIAN32__
1.323 +
1.324 +EXPORT_C void** _oil_function_class_ptr_clip_s8 () {
1.325 + oil_function_class_ptr_clip_s8 = __oil_function_class_clip_s8();
1.326 + return &oil_function_class_ptr_clip_s8->func;
1.327 + }
1.328 +#endif
1.329 +
1.330 +#ifdef __SYMBIAN32__
1.331 +
1.332 +EXPORT_C void** _oil_function_class_ptr_clip_s16 () {
1.333 + oil_function_class_ptr_clip_s16 = __oil_function_class_clip_s16();
1.334 + return &oil_function_class_ptr_clip_s16->func;
1.335 + }
1.336 +#endif
1.337 +
1.338 +#ifdef __SYMBIAN32__
1.339 +
1.340 +EXPORT_C void** _oil_function_class_ptr_clip_u16 () {
1.341 + oil_function_class_ptr_clip_u16 = __oil_function_class_clip_u16();
1.342 + return &oil_function_class_ptr_clip_u16->func;
1.343 + }
1.344 +#endif
1.345 +
1.346 +#ifdef __SYMBIAN32__
1.347 +
1.348 +EXPORT_C void** _oil_function_class_ptr_clip_s32 () {
1.349 + oil_function_class_ptr_clip_s32 = __oil_function_class_clip_s32();
1.350 + return &oil_function_class_ptr_clip_s32->func;
1.351 + }
1.352 +#endif
1.353 +
1.354 +#ifdef __SYMBIAN32__
1.355 +
1.356 +EXPORT_C void** _oil_function_class_ptr_clip_u32 () {
1.357 + oil_function_class_ptr_clip_u32 = __oil_function_class_clip_u32();
1.358 + return &oil_function_class_ptr_clip_u32->func;
1.359 + }
1.360 +#endif
1.361 +
1.362 +#ifdef __SYMBIAN32__
1.363 +
1.364 +EXPORT_C void** _oil_function_class_ptr_clip_f32 () {
1.365 + oil_function_class_ptr_clip_f32 = __oil_function_class_clip_f32();
1.366 + return &oil_function_class_ptr_clip_f32->func;
1.367 + }
1.368 +#endif
1.369 +
1.370 +#ifdef __SYMBIAN32__
1.371 +
1.372 +EXPORT_C void** _oil_function_class_ptr_clip_f64 () {
1.373 + oil_function_class_ptr_clip_f64 = __oil_function_class_clip_f64();
1.374 + return &oil_function_class_ptr_clip_f64->func;
1.375 + }
1.376 +#endif
1.377 +