OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 University of Szeged | 2 * Copyright (C) 2011 University of Szeged |
3 * Copyright (C) 2011 Felician Marton | 3 * Copyright (C) 2011 Felician Marton |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 result = vaddq_f32(result, k4x4); | 65 result = vaddq_f32(result, k4x4); |
66 | 66 |
67 // Convert result to uint so negative values are converted to zero. | 67 // Convert result to uint so negative values are converted to zero. |
68 uint16x4_t temporary3 = vmovn_u32(vminq_u32(vcvtq_u32_f32(result), max25
5)); | 68 uint16x4_t temporary3 = vmovn_u32(vminq_u32(vcvtq_u32_f32(result), max25
5)); |
69 uint8x8_t temporary4 = vmovn_u16(vcombine_u16(temporary3, temporary3)); | 69 uint8x8_t temporary4 = vmovn_u16(vcombine_u16(temporary3, temporary3)); |
70 *destinationPixel++ = vget_lane_u32(vreinterpret_u32_u8(temporary4), 0); | 70 *destinationPixel++ = vget_lane_u32(vreinterpret_u32_u8(temporary4), 0); |
71 ++sourcePixel; | 71 ++sourcePixel; |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 inline void FEComposite::platformArithmeticNeon(unsigned char* source, unsigned
char* destination, | 75 inline void FEComposite::arithmeticSoftwareNEON(unsigned char* source, unsigned
char* destination, |
76 unsigned pixelArrayLength, float k1, float k2, float k3, float k4) | 76 int pixelArrayLength, float k1, float k2, float k3, float k4) |
77 { | 77 { |
| 78 ASSERT(!(pixelArrayLength & 0x3)); |
| 79 |
78 if (!k4) { | 80 if (!k4) { |
79 if (!k1) { | 81 if (!k1) { |
80 computeArithmeticPixelsNeon<0, 0>(source, destination, pixelArrayLen
gth, k1, k2, k3, k4); | 82 computeArithmeticPixelsNeon<0, 0>(source, destination, static_cast<u
nsigned>(pixelArrayLength), k1, k2, k3, k4); |
81 return; | 83 return; |
82 } | 84 } |
83 | 85 |
84 computeArithmeticPixelsNeon<1, 0>(source, destination, pixelArrayLength,
k1, k2, k3, k4); | 86 computeArithmeticPixelsNeon<1, 0>(source, destination, static_cast<unsig
ned>(pixelArrayLength), k1, k2, k3, k4); |
85 return; | 87 return; |
86 } | 88 } |
87 | 89 |
88 if (!k1) { | 90 if (!k1) { |
89 computeArithmeticPixelsNeon<0, 1>(source, destination, pixelArrayLength,
k1, k2, k3, k4); | 91 computeArithmeticPixelsNeon<0, 1>(source, destination, static_cast<unsig
ned>(pixelArrayLength), k1, k2, k3, k4); |
90 return; | 92 return; |
91 } | 93 } |
92 computeArithmeticPixelsNeon<1, 1>(source, destination, pixelArrayLength, k1,
k2, k3, k4); | 94 computeArithmeticPixelsNeon<1, 1>(source, destination, static_cast<unsigned>
(pixelArrayLength), k1, k2, k3, k4); |
93 } | 95 } |
94 | 96 |
95 } // namespace blink | 97 } // namespace blink |
96 | 98 |
97 #endif // HAVE(ARM_NEON_INTRINSICS) | 99 #endif // HAVE(ARM_NEON_INTRINSICS) |
98 | 100 |
99 #endif // FECompositeArithmeticNEON_h | 101 #endif // FECompositeArithmeticNEON_h |
OLD | NEW |