Update contrib.
2 * LIBOIL - Library of Optimized Inner Loops
3 * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
27 //Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
33 #include <liboilfunction.h>
43 * Calculates the difference of each value in @s1_8x8 and @s2_8x8
44 * and places the result in @d_8x8. Note that the destination type
45 * is larger than the source type.
47 OIL_DEFINE_CLASS (diff8x8_s16_u8,
48 "int16_t *d_8x8, uint8_t *s1_8x8, int ss1, uint8_t *s2_8x8, int ss2");
50 * oil_diff8x8_const128_s16_u8:
55 * Subtracts 128 from each value in @s1_8x8
56 * and places the result in @d_8x8. Note that the destination type
57 * is larger than the source type.
59 OIL_DEFINE_CLASS (diff8x8_const128_s16_u8,
60 "int16_t *d_8x8, uint8_t *s1_8x8, int ss1");
62 * oil_diff8x8_average_s16_u8:
71 * Calculates the difference of each value in @s1_8x8 and the
72 * average of @s2_8x8 and @s3_8x8,
73 * and places the result in @d_8x8. Note that the destination type
74 * is larger than the source type.
76 OIL_DEFINE_CLASS (diff8x8_average_s16_u8,
77 "int16_t *d_8x8, uint8_t *s1_8x8, int ss1, uint8_t *s2_8x8, int ss2, uint8_t *s3_8x8, int ss3");
80 diff8x8_s16_u8_ref (int16_t *dest, uint8_t *src1, int ss1, uint8_t *src2, int ss2)
84 /* For each block row */
86 dest[0] = ((int16_t)src1[0]) - ((int16_t)src2[0]);
87 dest[1] = ((int16_t)src1[1]) - ((int16_t)src2[1]);
88 dest[2] = ((int16_t)src1[2]) - ((int16_t)src2[2]);
89 dest[3] = ((int16_t)src1[3]) - ((int16_t)src2[3]);
90 dest[4] = ((int16_t)src1[4]) - ((int16_t)src2[4]);
91 dest[5] = ((int16_t)src1[5]) - ((int16_t)src2[5]);
92 dest[6] = ((int16_t)src1[6]) - ((int16_t)src2[6]);
93 dest[7] = ((int16_t)src1[7]) - ((int16_t)src2[7]);
101 OIL_DEFINE_IMPL_REF (diff8x8_s16_u8_ref, diff8x8_s16_u8);
104 diff8x8_const128_s16_u8_ref (int16_t *dest, uint8_t *src1, int ss1)
108 /* For each block row */
110 dest[0] = ((int16_t)src1[0]) - 128;
111 dest[1] = ((int16_t)src1[1]) - 128;
112 dest[2] = ((int16_t)src1[2]) - 128;
113 dest[3] = ((int16_t)src1[3]) - 128;
114 dest[4] = ((int16_t)src1[4]) - 128;
115 dest[5] = ((int16_t)src1[5]) - 128;
116 dest[6] = ((int16_t)src1[6]) - 128;
117 dest[7] = ((int16_t)src1[7]) - 128;
124 OIL_DEFINE_IMPL_REF (diff8x8_const128_s16_u8_ref, diff8x8_const128_s16_u8);
127 diff8x8_average_s16_u8_ref (int16_t *dest, uint8_t *src1, int ss1, uint8_t *src2, int ss2, uint8_t *src3, int ss3)
131 /* For each block row */
133 dest[0] = ((int16_t)src1[0]) - ((((int16_t)src2[0]) + ((int16_t)src3[0])) / 2);
134 dest[1] = ((int16_t)src1[1]) - ((((int16_t)src2[1]) + ((int16_t)src3[1])) / 2);
135 dest[2] = ((int16_t)src1[2]) - ((((int16_t)src2[2]) + ((int16_t)src3[2])) / 2);
136 dest[3] = ((int16_t)src1[3]) - ((((int16_t)src2[3]) + ((int16_t)src3[3])) / 2);
137 dest[4] = ((int16_t)src1[4]) - ((((int16_t)src2[4]) + ((int16_t)src3[4])) / 2);
138 dest[5] = ((int16_t)src1[5]) - ((((int16_t)src2[5]) + ((int16_t)src3[5])) / 2);
139 dest[6] = ((int16_t)src1[6]) - ((((int16_t)src2[6]) + ((int16_t)src3[6])) / 2);
140 dest[7] = ((int16_t)src1[7]) - ((((int16_t)src2[7]) + ((int16_t)src3[7])) / 2);
149 OIL_DEFINE_IMPL_REF (diff8x8_average_s16_u8_ref, diff8x8_average_s16_u8);
160 OilFunctionClass* __oil_function_class_diff8x8_s16_u8() {
161 return &_oil_function_class_diff8x8_s16_u8;
167 OilFunctionClass* __oil_function_class_diff8x8_const128_s16_u8() {
168 return &_oil_function_class_diff8x8_const128_s16_u8;
174 OilFunctionClass* __oil_function_class_diff8x8_average_s16_u8() {
175 return &_oil_function_class_diff8x8_average_s16_u8;
183 OilFunctionImpl* __oil_function_impl_diff8x8_s16_u8_ref() {
184 return &_oil_function_impl_diff8x8_s16_u8_ref;
190 OilFunctionImpl* __oil_function_impl_diff8x8_const128_s16_u8_ref() {
191 return &_oil_function_impl_diff8x8_const128_s16_u8_ref;
197 OilFunctionImpl* __oil_function_impl_diff8x8_average_s16_u8_ref() {
198 return &_oil_function_impl_diff8x8_average_s16_u8_ref;
206 EXPORT_C void** _oil_function_class_ptr_diff8x8_s16_u8 () {
207 oil_function_class_ptr_diff8x8_s16_u8 = __oil_function_class_diff8x8_s16_u8();
208 return &oil_function_class_ptr_diff8x8_s16_u8->func;
214 EXPORT_C void** _oil_function_class_ptr_diff8x8_const128_s16_u8 () {
215 oil_function_class_ptr_diff8x8_const128_s16_u8 = __oil_function_class_diff8x8_const128_s16_u8();
216 return &oil_function_class_ptr_diff8x8_const128_s16_u8->func;
222 EXPORT_C void** _oil_function_class_ptr_diff8x8_average_s16_u8 () {
223 oil_function_class_ptr_diff8x8_average_s16_u8 = __oil_function_class_diff8x8_average_s16_u8();
224 return &oil_function_class_ptr_diff8x8_average_s16_u8->func;