diff --git a/jccoefct.c b/jccoefct.c index 7c3d58f9..8d9b50d7 100644 --- a/jccoefct.c +++ b/jccoefct.c @@ -367,18 +367,23 @@ compress_trellis_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) c_derived_tbl actbl_data; c_derived_tbl *actbl = &actbl_data; +#ifdef C_ARITH_CODING_SUPPORTED arith_rates arith_r_data; arith_rates *arith_r = &arith_r_data; +#endif compptr = cinfo->cur_comp_info[ci]; +#ifdef C_ARITH_CODING_SUPPORTED if (cinfo->arith_code) jget_arith_rates(cinfo, compptr->dc_tbl_no, compptr->ac_tbl_no, arith_r); - else { + else +#endif + { jpeg_make_c_derived_tbl(cinfo, TRUE, compptr->dc_tbl_no, &dctbl); jpeg_make_c_derived_tbl(cinfo, FALSE, compptr->ac_tbl_no, &actbl); } - + /* Align the virtual buffer for this component. */ buffer = (*cinfo->mem->access_virt_barray) ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], @@ -413,6 +418,7 @@ compress_trellis_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) for (block_row = 0; block_row < block_rows; block_row++) { thisblockrow = buffer[block_row]; lastblockrow = (block_row > 0) ? buffer[block_row-1] : NULL; +#ifdef C_ARITH_CODING_SUPPORTED if (cinfo->arith_code) quantize_trellis_arith(cinfo, arith_r, thisblockrow, buffer_dst[block_row], blocks_across, @@ -421,6 +427,7 @@ compress_trellis_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) cinfo->master->norm_coef[compptr->quant_tbl_no], &lastDC, lastblockrow, buffer_dst[block_row-1]); else +#endif quantize_trellis(cinfo, dctbl, actbl, thisblockrow, buffer_dst[block_row], blocks_across, cinfo->quant_tbl_ptrs[compptr->quant_tbl_no], diff --git a/jcdctmgr.c b/jcdctmgr.c index 3380b05c..d2465de7 100644 --- a/jcdctmgr.c +++ b/jcdctmgr.c @@ -1261,6 +1261,7 @@ quantize_trellis(j_compress_ptr cinfo, c_derived_tbl *dctbl, c_derived_tbl *actb } +#ifdef C_ARITH_CODING_SUPPORTED GLOBAL(void) quantize_trellis_arith(j_compress_ptr cinfo, arith_rates *r, JBLOCKROW coef_blocks, JBLOCKROW src, JDIMENSION num_blocks, JQUANT_TBL * qtbl, double *norm_src, double *norm_coef, JCOEF *last_dc_val, @@ -1604,6 +1605,7 @@ quantize_trellis_arith(j_compress_ptr cinfo, arith_rates *r, JBLOCKROW coef_bloc } } } +#endif /* * Initialize FDCT manager. diff --git a/jpegint.h b/jpegint.h index 194bb9ee..995f188f 100644 --- a/jpegint.h +++ b/jpegint.h @@ -91,6 +91,7 @@ struct jpeg_comp_master { float trellis_delta_dc_weight; }; +#ifdef C_ARITH_CODING_SUPPORTED /* The following two definitions specify the allocation chunk size * for the statistics area. * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least @@ -114,6 +115,7 @@ typedef struct { int arith_dc_U; int arith_ac_K; } arith_rates; +#endif /* Main buffer control (downsampled-data buffer) */ struct jpeg_c_main_controller { @@ -389,12 +391,14 @@ EXTERN(void) jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks); EXTERN(void) jzero_far (void * target, size_t bytestozero); +#ifdef C_ARITH_CODING_SUPPORTED EXTERN(void) jget_arith_rates (j_compress_ptr cinfo, int dc_tbl_no, int ac_tbl_no, arith_rates *r); EXTERN(void) quantize_trellis_arith (j_compress_ptr cinfo, arith_rates *r, JBLOCKROW coef_blocks, JBLOCKROW src, JDIMENSION num_blocks, JQUANT_TBL * qtbl, double *norm_src, double *norm_coef, JCOEF *last_dc_val, JBLOCKROW coef_blocks_above, JBLOCKROW src_above); +#endif /* Constant tables in jutils.c */ #if 0 /* This table is not actually needed in v6a */