#if PNG_ARM_NEON_OPT > 0 #ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */ /* WARNING: it is strongly recommended that you do not build libpng with *run-timechecksforCPUfeaturesifatallpossible.InthecaseoftheARM *NEONinstructionsthereisnoprocessor-specificwayofdetectingthe *presenceoftherequiredsupport,thereforerun-timedetectionisextremely *OSspecific. * *YoumaysetthemacroPNG_ARM_NEON_FILEtothefilenameoffilecontaining *afragmentofCsourcecodewhichdefinesthepng_have_neonfunction.There *areanumberofimplementationsincontrib/arm-neon,buttheonlyonethat *haspartialsupportiscontrib/arm-neon/linux.c-agenericLinux *implementationwhichreads/proc/cpufino.
*/ #include <signal.h> /* for sig_atomic_t */
#ifndef PNG_ARM_NEON_FILE # ifdefined(__aarch64__) || defined(_M_ARM64) /* ARM Neon is expected to be unconditionally available on ARM64. */ # error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64 # elif defined(__ARM_NEON__) || defined(__ARM_NEON) /* ARM Neon is expected to be available on the target CPU architecture. */ # error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch # elif defined(__linux__) # define PNG_ARM_NEON_FILE "linux.c" # else # error No support for run-time ARM Neon checking; use compile-time options # endif #endif
void
png_init_filter_functions_neon(png_structp pp, unsignedint bpp)
{ /* The switch statement is compiled in for ARM_NEON_API, the call to *png_have_neoniscompiledinforARM_NEON_CHECK.Ifbotharedefined *thecheckisonlyperformediftheAPIhasnotsettheNEONoptionon *oroffexplicitly.Inthiscasethecheckcontrolswhathappens. * *IftheCHECKisnotcompiledinandtheoptionisUNSETthebehaviorprior *to1.6.7wastousetheNEONcode-thiswasabugcausedbyhavingthe *wrongorderofthe'ON'and'default'cases.UNSETnowdefaultstoOFF, *asdocumentedinpng.h
*/
png_debug(1, "in png_init_filter_functions_neon"); #ifdef PNG_ARM_NEON_API_SUPPORTED switch ((pp->options >> PNG_ARM_NEON) & 3)
{ case PNG_OPTION_UNSET: /* Allow the run-time check to execute if it has been enabled - *thusbothAPIandCHECKcanbeturnedon.Ifitisn'tsupported *thiscasewillfallthroughtothe'default'below,whichjust *returns.
*/ #endif/* PNG_ARM_NEON_API_SUPPORTED */ #ifdef PNG_ARM_NEON_CHECK_SUPPORTED
{ staticvolatile sig_atomic_t no_neon = -1; /* not checked */
#ifdef PNG_ARM_NEON_API_SUPPORTED default: /* OFF or INVALID */ return;
case PNG_OPTION_ON: /* Option turned on */ break;
} #endif
/* IMPORTANT: any new external functions used here must be declared using *PNG_INTERNAL_FUNCTIONin../pngpriv.h.Thisisrequiredsothatthe *'prefix'optiontoconfigureworks: * *./configure--with-libpng-prefix=foobar_ * *Verifyyouhavegotthisrightbyrunningtheabovecommand,doingabuild *andexaminingpngprefix.h;itmustcontaina#defineforeveryexternal *functionyouadd.(Noticethatthishappensautomaticallyforthe *initializationfunction.)
*/
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.