Main MRPT website > C++ reference for MRPT 1.9.9
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  * Master selection of compression modules.
16  * This is done once at the start of processing an image. We determine
17  * which modules will be used and give them appropriate initialization calls.
18  */
19 
20 GLOBAL(void)
22 {
23  /* Initialize master control (includes parameter checking/processing) */
24  jinit_c_master_control(cinfo, FALSE /* full compression */);
25 
26  /* Preprocessing */
27  if (!cinfo->raw_data_in)
28  {
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  {
38  ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
39  }
40  else
41  {
42  if (cinfo->progressive_mode)
43  {
44 #ifdef C_PROGRESSIVE_SUPPORTED
45  jinit_phuff_encoder(cinfo);
46 #else
47  ERREXIT(cinfo, JERR_NOT_COMPILED);
48 #endif
49  }
50  else
51  jinit_huff_encoder(cinfo);
52  }
53 
54  /* Need a full-image coefficient buffer in any multi-pass mode. */
56  cinfo, (boolean)(cinfo->num_scans > 1 || cinfo->optimize_coding));
57  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
58 
59  jinit_marker_writer(cinfo);
60 
61  /* We can now tell the memory manager to allocate virtual arrays. */
62  (*cinfo->mem->realize_virt_arrays)((j_common_ptr)cinfo);
63 
64  /* Write the datastream header (SOI) immediately.
65  * Frame and scan headers are postponed till later.
66  * This lets application insert special markers after the SOI.
67  */
68  (*cinfo->marker->write_file_header)(cinfo);
69 }
jinit_downsampler(j_compress_ptr cinfo)
Definition: jcsample.cpp:452
#define ERREXIT(cinfo, code)
Definition: jerror.h:451
jinit_phuff_encoder(j_compress_ptr cinfo)
Definition: jcphuff.cpp:844
jinit_compress_master(j_compress_ptr cinfo)
Definition: jcinit.cpp:21
jinit_huff_encoder(j_compress_ptr cinfo)
Definition: jchuff.cpp:914
#define FALSE
Definition: jmorecfg.h:216
jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer)
Definition: jcprepct.cpp:318
jinit_c_main_controller(j_compress_ptr cinfo, boolean need_full_buffer)
Definition: jcmainct.cpp:259
#define GLOBAL(type)
Definition: jmorecfg.h:177
jinit_forward_dct(j_compress_ptr cinfo)
Definition: jcdctmgr.cpp:386
jinit_color_converter(j_compress_ptr cinfo)
Definition: jccolor.cpp:354
jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
Definition: jccoefct.cpp:445
jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only)
Definition: jcmaster.cpp:574
jinit_marker_writer(j_compress_ptr cinfo)
Definition: jcmarker.cpp:659



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019