From: DRC Date: Fri, 15 Jan 2016 19:15:54 +0000 (-0600) Subject: Add JSIMD_NOHUFFENC environment variable for ARM X-Git-Tag: 1.4.90~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8aa5fa9349016c2eb5e05d01e16a8c47f7b68c8;p=libjpeg-turbo Add JSIMD_NOHUFFENC environment variable for ARM Useful in regression/performance testing --- diff --git a/ChangeLog.txt b/ChangeLog.txt index 379cfbd..6f1660a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -69,7 +69,9 @@ setting the JSIMD_NOHUFFENC environment variable to 1. [13] Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit platforms. This speeds up the compression of full-color JPEGs by about 30% on -average. +average. For the purposes of benchmarking or regression testing, +SIMD-accelerated Huffman encoding can be disabled by setting the +JSIMD_NOHUFFENC environment variable to 1. [14] Completed the ARM 64-bit (ARMv8) NEON SIMD implementation. 64-bit ARM now has SIMD coverage for all of the algorithms that are covered in the 32-bit diff --git a/simd/jsimd_arm.c b/simd/jsimd_arm.c index 635cbd7..0cf5ae5 100644 --- a/simd/jsimd_arm.c +++ b/simd/jsimd_arm.c @@ -27,6 +27,7 @@ #include static unsigned int simd_support = ~0; +static unsigned int simd_huffman = 1; #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) @@ -128,6 +129,9 @@ init_simd (void) env = getenv("JSIMD_FORCENONE"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_support = 0; + env = getenv("JSIMD_NOHUFFENC"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_huffman = 0; } GLOBAL(int) @@ -707,7 +711,7 @@ jsimd_can_huff_encode_one_block (void) if (sizeof(JCOEF) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_ARM_NEON && simd_huffman) return 1; return 0;