VirtualBox

source: vbox/trunk/src/libs/libpng-1.6.42/contrib/arm-neon/android-ndk.c@ 105132

最後變更 在這個檔案從105132是 103316,由 vboxsync 提交於 14 月 前

libpng-1.6.42: Applied and adjusted our libpng changes to 1.6.42. bugref:8515

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.3 KB
 
1/* contrib/arm-neon/android-ndk.c
2 *
3 * Copyright (c) 2014 Glenn Randers-Pehrson
4 * Written by John Bowler, 2014.
5 *
6 * This code is released under the libpng license.
7 * For conditions of distribution and use, see the disclaimer
8 * and license in png.h
9 *
10 * SEE contrib/arm-neon/README before reporting bugs
11 *
12 * STATUS: COMPILED, UNTESTED
13 * BUG REPORTS: [email protected]
14 *
15 * png_have_neon implemented for the Android NDK, see:
16 *
17 * Documentation:
18 * http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
19 * https://code.google.com/p/android/issues/detail?id=49065
20 *
21 * NOTE: this requires that libpng is built against the Android NDK and linked
22 * with an implementation of the Android ARM 'cpu-features' library. The code
23 * has been compiled only, not linked: no version of the library has been found,
24 * only the header files exist in the NDK.
25 */
26
27#include <cpu-features.h>
28
29static int
30png_have_neon(png_structp png_ptr)
31{
32 /* This is a whole lot easier than the linux code, however it is probably
33 * implemented as below, therefore it is better to cache the result (these
34 * function calls may be slow!)
35 */
36 PNG_UNUSED(png_ptr)
37 return android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM &&
38 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
39}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette