• R/O
  • SSH

GM: Commit

Main GraphicsMagick source repository


Commit MetaInfo

Révisionf8516a12cf469b1bdc89a8dc38f253f46f9df1df (tree)
l'heure2022-04-30 15:19:29
AuteurJaroslav Fojtik
CommiterJaroslav Fojtik

Message de Log

coders/jpeg.c: Optionally enable arithmetic coder in JPG images.

Change Summary

Modification

diff -r e0f6acd5c623 -r f8516a12cf46 ChangeLog
--- a/ChangeLog Wed Apr 27 18:51:37 2022 -0500
+++ b/ChangeLog Sat Apr 30 08:19:29 2022 +0200
@@ -1,6 +1,11 @@
1+2022-04-30 Fojtik Jaroslav <JaFojtik@yandex.com>
2+
3+ * coders/jpeg.c: Optionally enable arithmetic coder in JPG images.
4+ gm convert -define jpeg:arithmetic=true testimg.jpg arith.jpg
5+
16 2022-04-27 Fojtik Jaroslav <JaFojtik@yandex.com>
27
3- * jpeg/: Update aged JPG library.
8+ * jpeg/: Update aged JPG library to version 9d.
49
510 2022-04-23 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
611
diff -r e0f6acd5c623 -r f8516a12cf46 coders/jpeg.c
--- a/coders/jpeg.c Wed Apr 27 18:51:37 2022 -0500
+++ b/coders/jpeg.c Sat Apr 30 08:19:29 2022 +0200
@@ -2792,33 +2792,49 @@
27922792 const char
27932793 *value;
27942794
2795- huffman_memory=0;
2796- if ((value=AccessDefinition(image_info,"jpeg","optimize-coding")))
2795+ huffman_memory = 0;
2796+
2797+#ifdef C_ARITH_CODING_SUPPORTED
2798+ /*
2799+ Allow the user to turn on/off arithmetic coder.
2800+ */
2801+ if ((value=AccessDefinition(image_info,"jpeg","arithmetic")))
27972802 {
27982803 if (LocaleCompare(value,"FALSE") == 0)
2799- jpeg_info.optimize_coding=MagickFalse;
2804+ jpeg_info.arith_code = False;
28002805 else
2801- jpeg_info.optimize_coding=MagickTrue;
2806+ jpeg_info.arith_code = True;
28022807 }
2803- else
2804- {
2808+ if(!jpeg_info.arith_code) /* jpeg_info.optimize_coding must not be set to enable arithmetic. */
2809+#endif
2810+ {
2811+ if ((value=AccessDefinition(image_info,"jpeg","optimize-coding")))
2812+ {
2813+ if (LocaleCompare(value,"FALSE") == 0)
2814+ jpeg_info.optimize_coding=MagickFalse;
2815+ else
2816+ jpeg_info.optimize_coding=MagickTrue;
2817+ }
2818+ else
2819+ {
28052820 /*
28062821 Huffman optimization requires that the whole image be buffered in
28072822 memory. Since this is such a large consumer, obtain a memory
28082823 resource for the memory to be consumed. If the memory resource
28092824 fails to be acquired, then don't enable huffman optimization.
28102825 */
2811- huffman_memory=(magick_int64_t) jpeg_info.input_components*
2812- image->columns*image->rows*sizeof(JSAMPLE);
2813- jpeg_info.optimize_coding=AcquireMagickResource(MemoryResource,
2826+ huffman_memory=(magick_int64_t) jpeg_info.input_components*
2827+ image->columns*image->rows*sizeof(JSAMPLE);
2828+ jpeg_info.optimize_coding=AcquireMagickResource(MemoryResource,
28142829 huffman_memory);
2815- }
2816- if (!jpeg_info.optimize_coding)
2817- huffman_memory=0;
2818- if (image->logging)
2819- (void) LogMagickEvent(CoderEvent,GetMagickModule(),
2830+ }
2831+ if (!jpeg_info.optimize_coding)
2832+ huffman_memory=0;
2833+ if (image->logging)
2834+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),
28202835 "Huffman optimization is %s",
28212836 (jpeg_info.optimize_coding ? "enabled" : "disabled"));
2837+ }
28222838 }
28232839
28242840 #if (JPEG_LIB_VERSION >= 61) && defined(C_PROGRESSIVE_SUPPORTED)
Afficher sur ancien navigateur de dépôt.