Merge tag '2.1.3' into master-moz
* tag '2.1.3': (56 commits) Neon/AArch64: Explicitly unroll quant loop w/Clang Neon/AArch64: Fix/suppress UBSan warnings Neon/AArch64: Accelerate Huffman encoding AppVeyor: Test strict MSVC compiler warnings Eliminate incompatible pointer type warnings MSVC: Eliminate int conversion warnings (C4244) MSVC: Eliminate C4996 warnings in API libs BUILDING.md: Clarify that Ninja works with Windows BUILDING.md: Remove NASM RPM rebuild instructions BUILDING.md: Document NASM/Yasm path variables "YASM" = "Yasm" Build: Fix Neon capability detection w/ MSVC Ensure that strncpy() dest strings are terminated Eliminate unnecessary JFREAD()/JFWRITE() macros Build: Embed version/API/(C) info in MSVC DLLs Fix segv w/ h2v2 merged upsamp, jpeg_crop_scanline TJBench: Remove innocuous always-true condition GitHub Actions: Specify Catalina for macOS build Fix -Wpedantic compiler warnings Eliminate non-ANSI C compatibility macros ...
This commit is contained in:
21
jcphuff.c
21
jcphuff.c
@@ -4,9 +4,10 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2011, 2015, 2018, 2021, D. R. Commander.
|
||||
* Copyright (C) 2011, 2015, 2018, 2021-2022, D. R. Commander.
|
||||
* Copyright (C) 2016, 2018, Matthieu Darbois.
|
||||
* Copyright (C) 2020, Arm Limited.
|
||||
* Copyright (C) 2021, Alex Richardson.
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@@ -53,8 +54,9 @@
|
||||
* flags (this defines __thumb__).
|
||||
*/
|
||||
|
||||
#if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || \
|
||||
defined(_M_ARM64)
|
||||
/* NOTE: Both GCC and Clang define __GNUC__ */
|
||||
#if (defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))) || \
|
||||
defined(_M_ARM) || defined(_M_ARM64)
|
||||
#if !defined(__thumb__) || defined(__thumb2__)
|
||||
#define USE_CLZ_INTRINSIC
|
||||
#endif
|
||||
@@ -274,7 +276,8 @@ start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
entropy->count_ptrs[tbl] = (long *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
257 * sizeof(long));
|
||||
MEMZERO(entropy->count_ptrs[tbl], 257 * sizeof(long));
|
||||
memset(entropy->count_ptrs[tbl], 0, 257 * sizeof(long));
|
||||
|
||||
if (cinfo->master->trellis_passes) {
|
||||
/* When generating tables for trellis passes, make sure that all */
|
||||
/* codewords have an assigned length */
|
||||
@@ -591,8 +594,8 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
continue; \
|
||||
/* For a negative coef, want temp2 = bitwise complement of abs(coef) */ \
|
||||
temp2 ^= temp; \
|
||||
values[k] = temp; \
|
||||
values[k + DCTSIZE2] = temp2; \
|
||||
values[k] = (JCOEF)temp; \
|
||||
values[k + DCTSIZE2] = (JCOEF)temp2; \
|
||||
zerobits |= ((size_t)1U) << k; \
|
||||
} \
|
||||
}
|
||||
@@ -688,7 +691,7 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
emit_restart(entropy, entropy->next_restart_num);
|
||||
|
||||
#ifdef WITH_SIMD
|
||||
cvalue = values = (JCOEF *)PAD((size_t)values_unaligned, 16);
|
||||
cvalue = values = (JCOEF *)PAD((JUINTPTR)values_unaligned, 16);
|
||||
#else
|
||||
/* Not using SIMD, so alignment is not needed */
|
||||
cvalue = values = values_unaligned;
|
||||
@@ -953,7 +956,7 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
emit_restart(entropy, entropy->next_restart_num);
|
||||
|
||||
#ifdef WITH_SIMD
|
||||
cabsvalue = absvalues = (JCOEF *)PAD((size_t)absvalues_unaligned, 16);
|
||||
cabsvalue = absvalues = (JCOEF *)PAD((JUINTPTR)absvalues_unaligned, 16);
|
||||
#else
|
||||
/* Not using SIMD, so alignment is not needed */
|
||||
cabsvalue = absvalues = absvalues_unaligned;
|
||||
@@ -1069,7 +1072,7 @@ finish_pass_gather_phuff (j_compress_ptr cinfo)
|
||||
/* It's important not to apply jpeg_gen_optimal_table more than once
|
||||
* per table, because it clobbers the input frequency counts!
|
||||
*/
|
||||
MEMZERO(did, sizeof(did));
|
||||
memset(did, 0, sizeof(did));
|
||||
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
|
||||
Reference in New Issue
Block a user