#include "jinclude.h"
#include "jpeglib.h"
Go to the source code of this file.
Defines | |
#define | JPEG_INTERNALS |
Functions | |
jinit_compress_master (j_compress_ptr cinfo) |
jinit_compress_master | ( | j_compress_ptr | cinfo | ) |
Definition at line 30 of file jcinit.c.
References ERREXIT, FALSE, jinit_c_coef_controller(), jinit_c_main_controller(), jinit_c_master_control(), jinit_c_prep_controller(), jinit_color_converter(), jinit_downsampler(), jinit_forward_dct(), jinit_huff_encoder(), and jinit_marker_writer().
Referenced by jpeg_start_compress().
00031 { 00032 /* Initialize master control (includes parameter checking/processing) */ 00033 jinit_c_master_control(cinfo, FALSE /* full compression */); 00034 00035 /* Preprocessing */ 00036 if (! cinfo->raw_data_in) { 00037 jinit_color_converter(cinfo); 00038 jinit_downsampler(cinfo); 00039 jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); 00040 } 00041 /* Forward DCT */ 00042 jinit_forward_dct(cinfo); 00043 /* Entropy encoding: either Huffman or arithmetic coding. */ 00044 if (cinfo->arith_code) { 00045 ERREXIT(cinfo, JERR_ARITH_NOTIMPL); 00046 } else { 00047 if (cinfo->progressive_mode) { 00048 #ifdef C_PROGRESSIVE_SUPPORTED 00049 jinit_phuff_encoder(cinfo); 00050 #else 00051 ERREXIT(cinfo, JERR_NOT_COMPILED); 00052 #endif 00053 } else 00054 jinit_huff_encoder(cinfo); 00055 } 00056 00057 /* Need a full-image coefficient buffer in any multi-pass mode. */ 00058 jinit_c_coef_controller(cinfo, 00059 (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); 00060 jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); 00061 00062 jinit_marker_writer(cinfo); 00063 00064 /* We can now tell the memory manager to allocate virtual arrays. */ 00065 (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); 00066 00067 /* Write the datastream header (SOI) immediately. 00068 * Frame and scan headers are postponed till later. 00069 * This lets application insert special markers after the SOI. 00070 */ 00071 (*cinfo->marker->write_file_header) (cinfo); 00072 }