Temp fix for #138
Disable scan optimization and trellis quantization when arithmetic coding is used
This commit is contained in:
9
cjpeg.c
9
cjpeg.c
@@ -289,6 +289,15 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
|||||||
/* Use arithmetic coding. */
|
/* Use arithmetic coding. */
|
||||||
#ifdef C_ARITH_CODING_SUPPORTED
|
#ifdef C_ARITH_CODING_SUPPORTED
|
||||||
cinfo->arith_code = TRUE;
|
cinfo->arith_code = TRUE;
|
||||||
|
|
||||||
|
/* No table optimization required for AC */
|
||||||
|
cinfo->optimize_coding = FALSE;
|
||||||
|
|
||||||
|
/* Scan optimization currently incompatible with AC */
|
||||||
|
jpeg_c_set_bool_param(cinfo, JBOOLEAN_OPTIMIZE_SCANS, FALSE);
|
||||||
|
|
||||||
|
/* Trellis quantization currently incompatible with AC */
|
||||||
|
jpeg_c_set_bool_param(cinfo, JBOOLEAN_TRELLIS_QUANT, FALSE);
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
|
fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
|
||||||
progname);
|
progname);
|
||||||
|
|||||||
@@ -175,6 +175,12 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
|||||||
/* Use arithmetic coding. */
|
/* Use arithmetic coding. */
|
||||||
#ifdef C_ARITH_CODING_SUPPORTED
|
#ifdef C_ARITH_CODING_SUPPORTED
|
||||||
cinfo->arith_code = TRUE;
|
cinfo->arith_code = TRUE;
|
||||||
|
|
||||||
|
/* No table optimization required for AC */
|
||||||
|
cinfo->optimize_coding = FALSE;
|
||||||
|
|
||||||
|
/* Scan optimization currently incompatible with AC */
|
||||||
|
jpeg_c_set_bool_param(cinfo, JBOOLEAN_OPTIMIZE_SCANS, FALSE);
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
|
fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
|
||||||
progname);
|
progname);
|
||||||
|
|||||||
Reference in New Issue
Block a user