OLD | NEW |
1 /* | 1 /* |
2 * jcinit.c | 2 * jcinit.c |
3 * | 3 * |
4 * Copyright (C) 1991-1997, Thomas G. Lane. | 4 * Copyright (C) 1991-1997, Thomas G. Lane. |
5 * This file is part of the Independent JPEG Group's software. | 5 * This file is part of the Independent JPEG Group's software. |
6 * For conditions of distribution and use, see the accompanying README file. | 6 * For conditions of distribution and use, see the accompanying README file. |
7 * | 7 * |
8 * This file contains initialization logic for the JPEG compressor. | 8 * This file contains initialization logic for the JPEG compressor. |
9 * This routine is in charge of selecting the modules to be executed and | 9 * This routine is in charge of selecting the modules to be executed and |
10 * making an initialization call to each one. | 10 * making an initialization call to each one. |
(...skipping 24 matching lines...) Expand all Loading... |
35 /* Preprocessing */ | 35 /* Preprocessing */ |
36 if (! cinfo->raw_data_in) { | 36 if (! cinfo->raw_data_in) { |
37 jinit_color_converter(cinfo); | 37 jinit_color_converter(cinfo); |
38 jinit_downsampler(cinfo); | 38 jinit_downsampler(cinfo); |
39 jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); | 39 jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); |
40 } | 40 } |
41 /* Forward DCT */ | 41 /* Forward DCT */ |
42 jinit_forward_dct(cinfo); | 42 jinit_forward_dct(cinfo); |
43 /* Entropy encoding: either Huffman or arithmetic coding. */ | 43 /* Entropy encoding: either Huffman or arithmetic coding. */ |
44 if (cinfo->arith_code) { | 44 if (cinfo->arith_code) { |
| 45 #ifdef C_ARITH_CODING_SUPPORTED |
| 46 jinit_arith_encoder(cinfo); |
| 47 #else |
45 ERREXIT(cinfo, JERR_ARITH_NOTIMPL); | 48 ERREXIT(cinfo, JERR_ARITH_NOTIMPL); |
| 49 #endif |
46 } else { | 50 } else { |
47 if (cinfo->progressive_mode) { | 51 if (cinfo->progressive_mode) { |
48 #ifdef C_PROGRESSIVE_SUPPORTED | 52 #ifdef C_PROGRESSIVE_SUPPORTED |
49 jinit_phuff_encoder(cinfo); | 53 jinit_phuff_encoder(cinfo); |
50 #else | 54 #else |
51 ERREXIT(cinfo, JERR_NOT_COMPILED); | 55 ERREXIT(cinfo, JERR_NOT_COMPILED); |
52 #endif | 56 #endif |
53 } else | 57 } else |
54 jinit_huff_encoder(cinfo); | 58 jinit_huff_encoder(cinfo); |
55 } | 59 } |
56 | 60 |
57 /* Need a full-image coefficient buffer in any multi-pass mode. */ | 61 /* Need a full-image coefficient buffer in any multi-pass mode. */ |
58 jinit_c_coef_controller(cinfo, | 62 jinit_c_coef_controller(cinfo, |
59 (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); | 63 (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); |
60 jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); | 64 jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); |
61 | 65 |
62 jinit_marker_writer(cinfo); | 66 jinit_marker_writer(cinfo); |
63 | 67 |
64 /* We can now tell the memory manager to allocate virtual arrays. */ | 68 /* We can now tell the memory manager to allocate virtual arrays. */ |
65 (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); | 69 (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); |
66 | 70 |
67 /* Write the datastream header (SOI) immediately. | 71 /* Write the datastream header (SOI) immediately. |
68 * Frame and scan headers are postponed till later. | 72 * Frame and scan headers are postponed till later. |
69 * This lets application insert special markers after the SOI. | 73 * This lets application insert special markers after the SOI. |
70 */ | 74 */ |
71 (*cinfo->marker->write_file_header) (cinfo); | 75 (*cinfo->marker->write_file_header) (cinfo); |
72 } | 76 } |
OLD | NEW |