os/ossrv/genericopenlibs/liboil/src/addc.c
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/liboil/src/addc.c	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,120 @@
     1.4 +/*
     1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +//Portions Copyright (c)  2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
    1.21 +
    1.22 +#include "liboil/liboilfunction.h"
    1.23 +#include "liboil/liboiltest.h"
    1.24 +#include "liboil/liboilrandom.h"
    1.25 +
    1.26 +static void
    1.27 +shift_test (OilTest *test)
    1.28 +{
    1.29 +  int16_t *data;
    1.30 +  int i;
    1.31 +  int n;
    1.32 +
    1.33 +if (0) {
    1.34 +  data = (int16_t *)oil_test_get_source_data (test, OIL_ARG_SRC1);
    1.35 +  n = oil_test_get_arg_post_n (test, OIL_ARG_SRC1);
    1.36 +  for(i=0;i<n;i++){
    1.37 +    data[i] = CLAMP(data[i], -4096, 4095);
    1.38 +  }
    1.39 +}
    1.40 +
    1.41 +  data = (int16_t *)oil_test_get_source_data (test, OIL_ARG_SRC2);
    1.42 +  //data[0] = 10000;
    1.43 +  data[1] = 8;
    1.44 +}
    1.45 +
    1.46 +OIL_DEFINE_CLASS (addc_s16,
    1.47 +    "int16_t *d1, int16_t *s1, int16_t *s2_1, int n");
    1.48 +OIL_DEFINE_CLASS_FULL (addc_rshift_s16,
    1.49 +    "int16_t *d1, int16_t *s1, int16_t *s2_2, int n", shift_test);
    1.50 +
    1.51 +void
    1.52 +addc_rshift_s16_ref (int16_t *d1, int16_t *s1, int16_t *s2_2, int n)
    1.53 +{
    1.54 +  int i;
    1.55 +  int16_t x;
    1.56 +
    1.57 +  for(i=0;i<n;i++){
    1.58 +    x = s1[i] + s2_2[0];
    1.59 +    d1[i] = x>>s2_2[1];
    1.60 +  }
    1.61 +}
    1.62 +OIL_DEFINE_IMPL_REF (addc_rshift_s16_ref, addc_rshift_s16);
    1.63 +
    1.64 +void
    1.65 +addc_s16_ref (int16_t *d1, uint16_t *s1, int16_t *s2_1, int n)
    1.66 +{
    1.67 +  int i;
    1.68 +  for(i=0;i<n;i++){
    1.69 +    d1[i] = s1[i] + s2_1[0];
    1.70 +  }
    1.71 +}
    1.72 +OIL_DEFINE_IMPL_REF (addc_s16_ref, addc_s16);
    1.73 +
    1.74 +
    1.75 +
    1.76 +#ifdef	__SYMBIAN32__
    1.77 + 
    1.78 +OilFunctionClass* __oil_function_class_addc_s16() {
    1.79 +		return &_oil_function_class_addc_s16;
    1.80 +}
    1.81 +#endif
    1.82 +
    1.83 +#ifdef	__SYMBIAN32__
    1.84 + 
    1.85 +OilFunctionClass* __oil_function_class_addc_rshift_s16() {
    1.86 +		return &_oil_function_class_addc_rshift_s16;
    1.87 +}
    1.88 +#endif
    1.89 +
    1.90 +
    1.91 +
    1.92 +#ifdef	__SYMBIAN32__
    1.93 + 
    1.94 +OilFunctionImpl* __oil_function_impl_addc_rshift_s16_ref() {
    1.95 +		return &_oil_function_impl_addc_rshift_s16_ref;
    1.96 +}
    1.97 +#endif
    1.98 +
    1.99 +#ifdef	__SYMBIAN32__
   1.100 + 
   1.101 +OilFunctionImpl* __oil_function_impl_addc_s16_ref() {
   1.102 +		return &_oil_function_impl_addc_s16_ref;
   1.103 +}
   1.104 +#endif
   1.105 +
   1.106 +
   1.107 +
   1.108 +#ifdef	__SYMBIAN32__
   1.109 + 
   1.110 +EXPORT_C void** _oil_function_class_ptr_addc_s16 ()	{
   1.111 +	oil_function_class_ptr_addc_s16 = __oil_function_class_addc_s16();
   1.112 +	return &oil_function_class_ptr_addc_s16->func;
   1.113 +	}
   1.114 +#endif
   1.115 +
   1.116 +#ifdef	__SYMBIAN32__
   1.117 + 
   1.118 +EXPORT_C void** _oil_function_class_ptr_addc_rshift_s16 ()	{
   1.119 +	oil_function_class_ptr_addc_rshift_s16 = __oil_function_class_addc_rshift_s16();
   1.120 +	return &oil_function_class_ptr_addc_rshift_s16->func;
   1.121 +	}
   1.122 +#endif
   1.123 +