image_pack 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +13 -3
  4. data/ext/image_pack/image_pack.c +742 -263
  5. data/ext/image_pack/mozjpeg_sources.rb +5 -0
  6. data/ext/image_pack/vendor/mozjpeg/simd/arm/neon-compat.h +26 -0
  7. data/ext/image_pack/vendor/mozjpeg/transupp.c +2373 -0
  8. data/lib/image_pack/version.rb +1 -1
  9. data/lib/image_pack.rb +119 -5
  10. metadata +4 -73
  11. data/ext/image_pack/vendor/mozjpeg/croptest.in +0 -95
  12. data/ext/image_pack/vendor/mozjpeg/libjpeg.map.in +0 -11
  13. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jsimd_neon.S +0 -1200
  14. data/ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jsimd_neon.S +0 -2254
  15. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-avx2.asm +0 -578
  16. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-mmx.asm +0 -476
  17. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-sse2.asm +0 -503
  18. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-avx2.asm +0 -121
  19. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-mmx.asm +0 -121
  20. data/ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-sse2.asm +0 -120
  21. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-avx2.asm +0 -113
  22. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-mmx.asm +0 -113
  23. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-sse2.asm +0 -112
  24. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-avx2.asm +0 -457
  25. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-mmx.asm +0 -355
  26. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-sse2.asm +0 -382
  27. data/ext/image_pack/vendor/mozjpeg/simd/i386/jchuff-sse2.asm +0 -761
  28. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcphuff-sse2.asm +0 -662
  29. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-avx2.asm +0 -388
  30. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-mmx.asm +0 -324
  31. data/ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-sse2.asm +0 -351
  32. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-avx2.asm +0 -515
  33. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-mmx.asm +0 -404
  34. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-sse2.asm +0 -458
  35. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-avx2.asm +0 -118
  36. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-mmx.asm +0 -117
  37. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-sse2.asm +0 -117
  38. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-avx2.asm +0 -136
  39. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-mmx.asm +0 -123
  40. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-sse2.asm +0 -135
  41. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-avx2.asm +0 -575
  42. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-mmx.asm +0 -460
  43. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-sse2.asm +0 -517
  44. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-avx2.asm +0 -760
  45. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-mmx.asm +0 -731
  46. data/ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-sse2.asm +0 -724
  47. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctflt-3dn.asm +0 -318
  48. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctflt-sse.asm +0 -369
  49. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctfst-mmx.asm +0 -395
  50. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctfst-sse2.asm +0 -403
  51. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-avx2.asm +0 -331
  52. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-mmx.asm +0 -620
  53. data/ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-sse2.asm +0 -633
  54. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-3dn.asm +0 -451
  55. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-sse.asm +0 -571
  56. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-sse2.asm +0 -497
  57. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctfst-mmx.asm +0 -499
  58. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctfst-sse2.asm +0 -501
  59. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-avx2.asm +0 -453
  60. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-mmx.asm +0 -851
  61. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-sse2.asm +0 -858
  62. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctred-mmx.asm +0 -704
  63. data/ext/image_pack/vendor/mozjpeg/simd/i386/jidctred-sse2.asm +0 -592
  64. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquant-3dn.asm +0 -230
  65. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquant-mmx.asm +0 -276
  66. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquant-sse.asm +0 -208
  67. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquantf-sse2.asm +0 -168
  68. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquanti-avx2.asm +0 -188
  69. data/ext/image_pack/vendor/mozjpeg/simd/i386/jquanti-sse2.asm +0 -201
  70. data/ext/image_pack/vendor/mozjpeg/simd/i386/jsimdcpu.asm +0 -135
  71. data/ext/image_pack/vendor/mozjpeg/simd/mips/jsimd_dspr2.S +0 -4543
  72. data/ext/image_pack/vendor/mozjpeg/simd/mips/jsimd_dspr2_asm.h +0 -292
  73. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jcsample.h +0 -28
  74. data/ext/image_pack/vendor/mozjpeg/simd/mips64/jsimd_mmi.h +0 -69
  75. data/ext/image_pack/vendor/mozjpeg/simd/mips64/loongson-mmintrin.h +0 -1334
  76. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jcsample.h +0 -28
  77. data/ext/image_pack/vendor/mozjpeg/simd/powerpc/jsimd_altivec.h +0 -98
  78. data/ext/image_pack/vendor/mozjpeg/tjbenchtest.in +0 -256
  79. data/ext/image_pack/vendor/mozjpeg/tjbenchtest.java.in +0 -215
  80. data/ext/image_pack/vendor/mozjpeg/tjexampletest.in +0 -149
  81. data/ext/image_pack/vendor/mozjpeg/tjexampletest.java.in +0 -151
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ImagePack
4
- VERSION = "0.2.6"
4
+ VERSION = "0.2.7"
5
5
  end
data/lib/image_pack.rb CHANGED
@@ -31,8 +31,15 @@ module ImagePack
31
31
  ALGOS = %i[jpeg_turbo mozjpeg fast size].freeze
32
32
  ALGO_TO_NATIVE = { jpeg_turbo: :jpeg_turbo, mozjpeg: :mozjpeg, fast: :jpeg_turbo, size: :mozjpeg }.freeze
33
33
  EXECUTION_MODES = %i[direct nogvl offload auto].freeze
34
+ SUBSAMPLING_MODES = %i[auto 420 422 444].freeze
35
+ TUNE_MODES = %i[hvs ssim ms_ssim psnr].freeze
36
+ EFFORT_MODES = %i[default fast max].freeze
37
+ SUBSAMPLING_TO_NATIVE = { auto: 0, "420": 1, "422": 2, "444": 3 }.freeze
38
+ TUNE_TO_NATIVE = { hvs: 0, ssim: 1, ms_ssim: 2, psnr: 3 }.freeze
39
+ EFFORT_TO_NATIVE = { default: 0, fast: 1, max: 2 }.freeze
34
40
  DEFAULT_QUALITY = 82
35
41
  DEFAULT_ALGO = :mozjpeg
42
+ AUTO_444_QUALITY = 90
36
43
 
37
44
  class << self
38
45
  def configuration
@@ -59,6 +66,15 @@ module ImagePack
59
66
  defined?(NATIVE_OFFLOAD_SAFE) && NATIVE_OFFLOAD_SAFE == true
60
67
  end
61
68
 
69
+ def warn_if_scalar!
70
+ return if !defined?(NATIVE_SIMD) || NATIVE_SIMD
71
+ return if @scalar_warned
72
+
73
+ @scalar_warned = true
74
+ warn "ImagePack: this native build is scalar (no SIMD). On x86_64 install nasm " \
75
+ "and reinstall the gem for ~3-4x faster JPEG encode/decode."
76
+ end
77
+
62
78
  def compress_bytes(bytes, **options)
63
79
  raise InvalidArgumentError, "bytes must be a String" unless bytes.is_a?(String)
64
80
 
@@ -89,11 +105,16 @@ module ImagePack
89
105
  output: nil,
90
106
  progressive: true,
91
107
  strip_metadata: false,
108
+ strip_icc: false,
109
+ trim: false,
92
110
  execution: nil,
93
111
  cancellable: false,
94
112
  strict: false)
113
+ warn_if_scalar!
95
114
  validate_boolean!(:progressive, progressive)
96
115
  validate_boolean!(:strip_metadata, strip_metadata)
116
+ validate_boolean!(:strip_icc, strip_icc)
117
+ validate_boolean!(:trim, trim)
97
118
  validate_boolean!(:cancellable, cancellable)
98
119
  validate_boolean!(:strict, strict)
99
120
  execution ||= configuration.execution
@@ -112,7 +133,9 @@ module ImagePack
112
133
  execution,
113
134
  cancellable ? 1 : 0,
114
135
  has_scheduler ? 1 : 0,
115
- strict ? 1 : 0)
136
+ strict ? 1 : 0,
137
+ strip_icc ? 1 : 0,
138
+ trim ? 1 : 0)
116
139
  end
117
140
 
118
141
  def compress(input,
@@ -121,23 +144,37 @@ module ImagePack
121
144
  quality: nil,
122
145
  min_ssim: nil,
123
146
  mozjpeg_trellis: true,
124
- mozjpeg_scan_opt: true,
147
+ mozjpeg_scan_opt: nil,
125
148
  progressive: nil,
126
149
  strip_metadata: true,
150
+ strip_icc: false,
151
+ subsampling: :auto,
152
+ tune: :hvs,
153
+ effort: :default,
154
+ scale: 1,
127
155
  execution: nil,
128
156
  cancellable: false,
129
157
  report: false,
130
158
  strict: false)
159
+ warn_if_scalar!
131
160
  validate_algo!(algo)
132
161
  validate_min_ssim!(min_ssim)
133
162
  validate_boolean!(:mozjpeg_trellis, mozjpeg_trellis)
163
+ scan_opt_given = !mozjpeg_scan_opt.nil?
164
+ mozjpeg_scan_opt = true unless scan_opt_given
134
165
  validate_boolean!(:mozjpeg_scan_opt, mozjpeg_scan_opt)
135
166
  progressive = default_progressive_for(algo, progressive)
136
167
  validate_boolean!(:progressive, progressive)
137
168
  validate_boolean!(:strip_metadata, strip_metadata)
169
+ validate_boolean!(:strip_icc, strip_icc)
138
170
  validate_boolean!(:cancellable, cancellable)
139
171
  validate_boolean!(:report, report)
140
172
  validate_boolean!(:strict, strict)
173
+ subsampling = validate_subsampling!(subsampling)
174
+ tune = validate_tune!(tune)
175
+ effort = validate_effort!(effort)
176
+ scale_num, scale_denom = validate_scale!(scale)
177
+ mozjpeg_scan_opt = false if effort == :fast && !scan_opt_given
141
178
  quality_was_given = !quality.nil?
142
179
  effective_quality = quality_was_given ? quality : DEFAULT_QUALITY
143
180
  effective_quality = 1 if min_ssim && !quality_was_given
@@ -163,7 +200,12 @@ module ImagePack
163
200
  has_scheduler ? 1 : 0,
164
201
  report ? 1 : 0,
165
202
  strict ? 1 : 0,
166
- mozjpeg_scan_opt ? 1 : 0)
203
+ mozjpeg_scan_opt ? 1 : 0,
204
+ strip_icc ? 1 : 0,
205
+ SUBSAMPLING_TO_NATIVE.fetch(subsampling),
206
+ TUNE_TO_NATIVE.fetch(tune),
207
+ EFFORT_TO_NATIVE.fetch(effort),
208
+ scale_num, scale_denom)
167
209
  end
168
210
 
169
211
  def compress_pixels(buffer,
@@ -175,18 +217,24 @@ module ImagePack
175
217
  quality: nil,
176
218
  min_ssim: nil,
177
219
  mozjpeg_trellis: true,
178
- mozjpeg_scan_opt: true,
220
+ mozjpeg_scan_opt: nil,
179
221
  progressive: nil,
180
222
  drop_alpha: nil,
181
223
  exact_size: false,
224
+ subsampling: :auto,
225
+ tune: :hvs,
226
+ effort: :default,
182
227
  execution: nil,
183
228
  cancellable: false,
184
229
  report: false,
185
230
  strict: false)
231
+ warn_if_scalar!
186
232
  validate_pixel_buffer!(buffer)
187
233
  validate_algo!(algo)
188
234
  validate_min_ssim!(min_ssim)
189
235
  validate_boolean!(:mozjpeg_trellis, mozjpeg_trellis)
236
+ scan_opt_given = !mozjpeg_scan_opt.nil?
237
+ mozjpeg_scan_opt = true unless scan_opt_given
190
238
  validate_boolean!(:mozjpeg_scan_opt, mozjpeg_scan_opt)
191
239
  progressive = default_progressive_for(algo, progressive)
192
240
  validate_boolean!(:progressive, progressive)
@@ -195,6 +243,10 @@ module ImagePack
195
243
  validate_boolean!(:cancellable, cancellable)
196
244
  validate_boolean!(:report, report)
197
245
  validate_boolean!(:strict, strict)
246
+ subsampling = validate_subsampling!(subsampling)
247
+ tune = validate_tune!(tune)
248
+ effort = validate_effort!(effort)
249
+ mozjpeg_scan_opt = false if effort == :fast && !scan_opt_given
198
250
  quality_was_given = !quality.nil?
199
251
  effective_quality = quality_was_given ? quality : DEFAULT_QUALITY
200
252
  effective_quality = 1 if min_ssim && !quality_was_given
@@ -237,10 +289,14 @@ module ImagePack
237
289
  has_scheduler ? 1 : 0,
238
290
  report ? 1 : 0,
239
291
  strict ? 1 : 0,
240
- mozjpeg_scan_opt ? 1 : 0)
292
+ mozjpeg_scan_opt ? 1 : 0,
293
+ SUBSAMPLING_TO_NATIVE.fetch(subsampling),
294
+ TUNE_TO_NATIVE.fetch(tune),
295
+ EFFORT_TO_NATIVE.fetch(effort))
241
296
  end
242
297
 
243
298
  def inspect_image(input)
299
+ warn_if_scalar!
244
300
  __inspect_image(input, input_kind!(input))
245
301
  end
246
302
 
@@ -296,6 +352,64 @@ module ImagePack
296
352
  raise InvalidArgumentError, "min_ssim must be Numeric > 0.0 and <= 1.0, got: #{min_ssim.inspect}"
297
353
  end
298
354
 
355
+ def validate_subsampling!(value)
356
+ value = value.to_s.to_sym if value.is_a?(Integer) || value.is_a?(String)
357
+ return value if SUBSAMPLING_MODES.include?(value)
358
+
359
+ raise InvalidArgumentError,
360
+ "subsampling must be one of #{SUBSAMPLING_MODES}, got: #{value.inspect}"
361
+ end
362
+
363
+ def validate_tune!(value)
364
+ return value if TUNE_MODES.include?(value)
365
+
366
+ raise InvalidArgumentError, "tune must be one of #{TUNE_MODES}, got: #{value.inspect}"
367
+ end
368
+
369
+ def validate_effort!(value)
370
+ return value if EFFORT_MODES.include?(value)
371
+
372
+ raise InvalidArgumentError, "effort must be one of #{EFFORT_MODES}, got: #{value.inspect}"
373
+ end
374
+
375
+ def validate_scale!(value)
376
+ num, denom =
377
+ case value
378
+ when Integer
379
+ raise InvalidArgumentError, "scale must be a positive fraction, got: #{value.inspect}" unless value.positive?
380
+
381
+ [value, 1]
382
+ when Float
383
+ if value == 1.0
384
+ [1, 1]
385
+ elsif value == 0.5
386
+ [1, 2]
387
+ elsif value == 0.25
388
+ [1, 4]
389
+ elsif value == 0.125
390
+ [1, 8]
391
+ else
392
+ raise InvalidArgumentError,
393
+ "scale float must be 1.0, 0.5, 0.25, or 0.125, got: #{value.inspect}"
394
+ end
395
+ when Rational
396
+ [value.numerator, value.denominator]
397
+ when Array
398
+ raise InvalidArgumentError, "scale array must be [num, denom], got: #{value.inspect}" unless value.length == 2
399
+
400
+ value
401
+ else
402
+ raise InvalidArgumentError,
403
+ "scale must be 1, 0.5, 0.25, 0.125, Rational, or [num, denom], got: #{value.inspect}"
404
+ end
405
+
406
+ unless num.is_a?(Integer) && denom.is_a?(Integer) && num.positive? && denom.positive?
407
+ raise InvalidArgumentError, "scale numerator/denominator must be Integers > 0, got: #{value.inspect}"
408
+ end
409
+
410
+ [num, denom]
411
+ end
412
+
299
413
  def validate_boolean!(name, value)
300
414
  return if value == true || value == false
301
415
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Haydarov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-01 00:00:00.000000000 Z
11
+ date: 2026-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -83,7 +83,6 @@ files:
83
83
  - ext/image_pack/vendor/mozjpeg/cdjpeg.h
84
84
  - ext/image_pack/vendor/mozjpeg/cmyk.h
85
85
  - ext/image_pack/vendor/mozjpeg/coderules.txt
86
- - ext/image_pack/vendor/mozjpeg/croptest.in
87
86
  - ext/image_pack/vendor/mozjpeg/example.txt
88
87
  - ext/image_pack/vendor/mozjpeg/jcapimin.c
89
88
  - ext/image_pack/vendor/mozjpeg/jcapistd.c
@@ -164,13 +163,10 @@ files:
164
163
  - ext/image_pack/vendor/mozjpeg/jstdhuff.c
165
164
  - ext/image_pack/vendor/mozjpeg/jutils.c
166
165
  - ext/image_pack/vendor/mozjpeg/jversion.h.in
167
- - ext/image_pack/vendor/mozjpeg/libjpeg.map.in
168
166
  - ext/image_pack/vendor/mozjpeg/libjpeg.txt
169
- - ext/image_pack/vendor/mozjpeg/simd/arm/aarch32/jsimd_neon.S
170
167
  - ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jccolext-neon.c
171
168
  - ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jchuff-neon.c
172
169
  - ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jsimd.c
173
- - ext/image_pack/vendor/mozjpeg/simd/arm/aarch64/jsimd_neon.S
174
170
  - ext/image_pack/vendor/mozjpeg/simd/arm/align.h
175
171
  - ext/image_pack/vendor/mozjpeg/simd/arm/jccolor-neon.c
176
172
  - ext/image_pack/vendor/mozjpeg/simd/arm/jcgray-neon.c
@@ -189,76 +185,14 @@ files:
189
185
  - ext/image_pack/vendor/mozjpeg/simd/arm/jidctint-neon.c
190
186
  - ext/image_pack/vendor/mozjpeg/simd/arm/jidctred-neon.c
191
187
  - ext/image_pack/vendor/mozjpeg/simd/arm/jquanti-neon.c
188
+ - ext/image_pack/vendor/mozjpeg/simd/arm/neon-compat.h
192
189
  - ext/image_pack/vendor/mozjpeg/simd/arm/neon-compat.h.in
193
- - ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-avx2.asm
194
- - ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-mmx.asm
195
- - ext/image_pack/vendor/mozjpeg/simd/i386/jccolext-sse2.asm
196
- - ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-avx2.asm
197
- - ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-mmx.asm
198
- - ext/image_pack/vendor/mozjpeg/simd/i386/jccolor-sse2.asm
199
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-avx2.asm
200
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-mmx.asm
201
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcgray-sse2.asm
202
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-avx2.asm
203
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-mmx.asm
204
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcgryext-sse2.asm
205
- - ext/image_pack/vendor/mozjpeg/simd/i386/jchuff-sse2.asm
206
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcphuff-sse2.asm
207
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-avx2.asm
208
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-mmx.asm
209
- - ext/image_pack/vendor/mozjpeg/simd/i386/jcsample-sse2.asm
210
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-avx2.asm
211
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-mmx.asm
212
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdcolext-sse2.asm
213
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-avx2.asm
214
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-mmx.asm
215
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdcolor-sse2.asm
216
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-avx2.asm
217
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-mmx.asm
218
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdmerge-sse2.asm
219
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-avx2.asm
220
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-mmx.asm
221
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdmrgext-sse2.asm
222
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-avx2.asm
223
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-mmx.asm
224
- - ext/image_pack/vendor/mozjpeg/simd/i386/jdsample-sse2.asm
225
- - ext/image_pack/vendor/mozjpeg/simd/i386/jfdctflt-3dn.asm
226
- - ext/image_pack/vendor/mozjpeg/simd/i386/jfdctflt-sse.asm
227
- - ext/image_pack/vendor/mozjpeg/simd/i386/jfdctfst-mmx.asm
228
- - ext/image_pack/vendor/mozjpeg/simd/i386/jfdctfst-sse2.asm
229
- - ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-avx2.asm
230
- - ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-mmx.asm
231
- - ext/image_pack/vendor/mozjpeg/simd/i386/jfdctint-sse2.asm
232
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-3dn.asm
233
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-sse.asm
234
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctflt-sse2.asm
235
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctfst-mmx.asm
236
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctfst-sse2.asm
237
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-avx2.asm
238
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-mmx.asm
239
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctint-sse2.asm
240
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctred-mmx.asm
241
- - ext/image_pack/vendor/mozjpeg/simd/i386/jidctred-sse2.asm
242
- - ext/image_pack/vendor/mozjpeg/simd/i386/jquant-3dn.asm
243
- - ext/image_pack/vendor/mozjpeg/simd/i386/jquant-mmx.asm
244
- - ext/image_pack/vendor/mozjpeg/simd/i386/jquant-sse.asm
245
- - ext/image_pack/vendor/mozjpeg/simd/i386/jquantf-sse2.asm
246
- - ext/image_pack/vendor/mozjpeg/simd/i386/jquanti-avx2.asm
247
- - ext/image_pack/vendor/mozjpeg/simd/i386/jquanti-sse2.asm
248
- - ext/image_pack/vendor/mozjpeg/simd/i386/jsimdcpu.asm
249
190
  - ext/image_pack/vendor/mozjpeg/simd/jsimd.h
250
- - ext/image_pack/vendor/mozjpeg/simd/mips/jsimd_dspr2.S
251
- - ext/image_pack/vendor/mozjpeg/simd/mips/jsimd_dspr2_asm.h
252
- - ext/image_pack/vendor/mozjpeg/simd/mips64/jcsample.h
253
- - ext/image_pack/vendor/mozjpeg/simd/mips64/jsimd_mmi.h
254
- - ext/image_pack/vendor/mozjpeg/simd/mips64/loongson-mmintrin.h
255
191
  - ext/image_pack/vendor/mozjpeg/simd/nasm/jcolsamp.inc
256
192
  - ext/image_pack/vendor/mozjpeg/simd/nasm/jdct.inc
257
193
  - ext/image_pack/vendor/mozjpeg/simd/nasm/jsimdcfg.inc
258
194
  - ext/image_pack/vendor/mozjpeg/simd/nasm/jsimdcfg.inc.h
259
195
  - ext/image_pack/vendor/mozjpeg/simd/nasm/jsimdext.inc
260
- - ext/image_pack/vendor/mozjpeg/simd/powerpc/jcsample.h
261
- - ext/image_pack/vendor/mozjpeg/simd/powerpc/jsimd_altivec.h
262
196
  - ext/image_pack/vendor/mozjpeg/simd/x86_64/jccolext-avx2.asm
263
197
  - ext/image_pack/vendor/mozjpeg/simd/x86_64/jccolext-sse2.asm
264
198
  - ext/image_pack/vendor/mozjpeg/simd/x86_64/jccolor-avx2.asm
@@ -296,11 +230,8 @@ files:
296
230
  - ext/image_pack/vendor/mozjpeg/simd/x86_64/jsimd.c
297
231
  - ext/image_pack/vendor/mozjpeg/simd/x86_64/jsimdcpu.asm
298
232
  - ext/image_pack/vendor/mozjpeg/structure.txt
299
- - ext/image_pack/vendor/mozjpeg/tjbenchtest.in
300
- - ext/image_pack/vendor/mozjpeg/tjbenchtest.java.in
301
- - ext/image_pack/vendor/mozjpeg/tjexampletest.in
302
- - ext/image_pack/vendor/mozjpeg/tjexampletest.java.in
303
233
  - ext/image_pack/vendor/mozjpeg/tjutil.h
234
+ - ext/image_pack/vendor/mozjpeg/transupp.c
304
235
  - ext/image_pack/vendor/mozjpeg/transupp.h
305
236
  - ext/image_pack/vendor/mozjpeg/turbojpeg.h
306
237
  - ext/image_pack/vendor/mozjpeg/usage.txt
@@ -1,95 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -u
4
- set -e
5
- trap onexit INT
6
- trap onexit TERM
7
- trap onexit EXIT
8
-
9
- onexit()
10
- {
11
- if [ -d $OUTDIR ]; then
12
- rm -rf $OUTDIR
13
- fi
14
- }
15
-
16
- runme()
17
- {
18
- echo \*\*\* $*
19
- $*
20
- }
21
-
22
- IMAGE=vgl_6548_0026a.bmp
23
- WIDTH=128
24
- HEIGHT=95
25
- IMGDIR=@CMAKE_CURRENT_SOURCE_DIR@/testimages
26
- OUTDIR=`mktemp -d /tmp/__croptest_output.XXXXXX`
27
- EXEDIR=@CMAKE_CURRENT_BINARY_DIR@
28
-
29
- if [ -d $OUTDIR ]; then
30
- rm -rf $OUTDIR
31
- fi
32
- mkdir -p $OUTDIR
33
-
34
- exec >$EXEDIR/croptest.log
35
-
36
- echo "============================================================"
37
- echo "$IMAGE ($WIDTH x $HEIGHT)"
38
- echo "============================================================"
39
- echo
40
-
41
- for PROGARG in "" -progressive; do
42
-
43
- cp $IMGDIR/$IMAGE $OUTDIR
44
- basename=`basename $IMAGE .bmp`
45
- echo "------------------------------------------------------------"
46
- echo "Generating test images"
47
- echo "------------------------------------------------------------"
48
- echo
49
- runme $EXEDIR/cjpeg $PROGARG -grayscale -outfile $OUTDIR/${basename}_GRAY.jpg $IMGDIR/${basename}.bmp
50
- runme $EXEDIR/cjpeg $PROGARG -sample 2x2 -outfile $OUTDIR/${basename}_420.jpg $IMGDIR/${basename}.bmp
51
- runme $EXEDIR/cjpeg $PROGARG -sample 2x1 -outfile $OUTDIR/${basename}_422.jpg $IMGDIR/${basename}.bmp
52
- runme $EXEDIR/cjpeg $PROGARG -sample 1x2 -outfile $OUTDIR/${basename}_440.jpg $IMGDIR/${basename}.bmp
53
- runme $EXEDIR/cjpeg $PROGARG -sample 1x1 -outfile $OUTDIR/${basename}_444.jpg $IMGDIR/${basename}.bmp
54
- echo
55
-
56
- for NSARG in "" -nosmooth; do
57
-
58
- for COLORSARG in "" "-colors 256 -dither none -onepass"; do
59
-
60
- for Y in {0..16}; do
61
-
62
- for H in {1..16}; do
63
-
64
- X=$(( (Y*16)%128 ))
65
- W=$(( WIDTH-X-7 ))
66
- if [ $Y -le 15 ]; then
67
- CROPSPEC="${W}x${H}+${X}+${Y}"
68
- else
69
- Y2=$(( HEIGHT-H ));
70
- CROPSPEC="${W}x${H}+${X}+${Y2}"
71
- fi
72
-
73
- echo "------------------------------------------------------------"
74
- echo $PROGARG $NSARG $COLORSARG -crop $CROPSPEC
75
- echo "------------------------------------------------------------"
76
- echo
77
- for samp in GRAY 420 422 440 444; do
78
- $EXEDIR/djpeg $NSARG $COLORSARG -rgb -outfile $OUTDIR/${basename}_${samp}_full.ppm $OUTDIR/${basename}_${samp}.jpg
79
- convert -crop $CROPSPEC $OUTDIR/${basename}_${samp}_full.ppm $OUTDIR/${basename}_${samp}_ref.ppm
80
- runme $EXEDIR/djpeg $NSARG $COLORSARG -crop $CROPSPEC -rgb -outfile $OUTDIR/${basename}_${samp}.ppm $OUTDIR/${basename}_${samp}.jpg
81
- runme cmp $OUTDIR/${basename}_${samp}.ppm $OUTDIR/${basename}_${samp}_ref.ppm
82
- done
83
- echo
84
-
85
- done
86
-
87
- done
88
-
89
- done
90
-
91
- done
92
-
93
- done
94
-
95
- echo SUCCESS!
@@ -1,11 +0,0 @@
1
- LIBJPEGTURBO_@JPEG_LIB_VERSION_DECIMAL@ {
2
- @MEM_SRCDST_FUNCTIONS@
3
- local:
4
- jsimd_*;
5
- jconst_*;
6
- };
7
-
8
- LIBJPEG_@JPEG_LIB_VERSION_DECIMAL@ {
9
- global:
10
- *;
11
- };