Add JSIMD_NOHUFFENC environment variable for ARM

Useful in regression/performance testing
This commit is contained in:
DRC
2016-01-15 13:15:54 -06:00
parent ec6941f7bc
commit e8aa5fa934
2 changed files with 8 additions and 2 deletions

View File

@@ -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

View File

@@ -27,6 +27,7 @@
#include <ctype.h>
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;