Main MRPT website > C++ reference for MRPT 1.5.7
jcinit.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 #define JPEG_INTERNALS
11 #include "jinclude.h"
12 #include "mrpt_jpeglib.h"
13 
14 
15 /*
16  * Master selection of compression modules.
17  * This is done once at the start of processing an image. We determine
18  * which modules will be used and give them appropriate initialization calls.
19  */
20 
21 GLOBAL(void)
23 {
24  /* Initialize master control (includes parameter checking/processing) */
25  jinit_c_master_control(cinfo, FALSE /* full compression */);
26 
27  /* Preprocessing */
28  if (! cinfo->raw_data_in) {
29  jinit_color_converter(cinfo);
30  jinit_downsampler(cinfo);
31  jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
32  }
33  /* Forward DCT */
34  jinit_forward_dct(cinfo);
35  /* Entropy encoding: either Huffman or arithmetic coding. */
36  if (cinfo->arith_code) {
37  ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
38  } else {
39  if (cinfo->progressive_mode) {
40 #ifdef C_PROGRESSIVE_SUPPORTED
41  jinit_phuff_encoder(cinfo);
42 #else
43  ERREXIT(cinfo, JERR_NOT_COMPILED);
44 #endif
45  } else
46  jinit_huff_encoder(cinfo);
47  }
48 
49  /* Need a full-image coefficient buffer in any multi-pass mode. */
51  (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
52  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
53 
54  jinit_marker_writer(cinfo);
55 
56  /* We can now tell the memory manager to allocate virtual arrays. */
57  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
58 
59  /* Write the datastream header (SOI) immediately.
60  * Frame and scan headers are postponed till later.
61  * This lets application insert special markers after the SOI.
62  */
63  (*cinfo->marker->write_file_header) (cinfo);
64 }
jinit_downsampler(j_compress_ptr cinfo)
Definition: jcsample.cpp:426
#define ERREXIT(cinfo, code)
Definition: jerror.h:199
jinit_phuff_encoder(j_compress_ptr cinfo)
Definition: jcphuff.cpp:809
jinit_compress_master(j_compress_ptr cinfo)
Definition: jcinit.cpp:22
jinit_huff_encoder(j_compress_ptr cinfo)
Definition: jchuff.cpp:884
#define FALSE
Definition: jmorecfg.h:227
jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer)
Definition: jcprepct.cpp:308
jinit_c_main_controller(j_compress_ptr cinfo, boolean need_full_buffer)
Definition: jcmainct.cpp:242
#define GLOBAL(type)
Definition: jmorecfg.h:185
jinit_forward_dct(j_compress_ptr cinfo)
Definition: jcdctmgr.cpp:341
jinit_color_converter(j_compress_ptr cinfo)
Definition: jccolor.cpp:351
jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
Definition: jccoefct.cpp:402
jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only)
Definition: jcmaster.cpp:539
jinit_marker_writer(j_compress_ptr cinfo)
Definition: jcmarker.cpp:644



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019