3 { Original: jcinit.c ; Copyright (C) 1991-1997, Thomas G. Lane. }
5 { This file contains initialization logic for the JPEG compressor.
6 This routine is in charge of selecting the modules to be executed and
7 making an initialization call to each one.
9 Logically, this code belongs in jcmaster.c. It's split out because
10 linking this routine implies linking the entire compression library.
11 For a transcoding-only application, we want to be able to use jcmaster.c
12 without linking in the whole library. }
14 interface
16 {$I imjconfig.inc}
18 uses
19 imjinclude,
20 imjdeferr,
21 imjerror,
22 imjpeglib,
23 {$ifdef C_PROGRESSIVE_SUPPORTED}
24 imjcphuff,
25 {$endif}
29 { Master selection of compression modules.
30 This is done once at the start of processing an image. We determine
31 which modules will be used and give them appropriate initialization calls. }
33 {GLOBAL}
36 implementation
40 { Master selection of compression modules.
41 This is done once at the start of processing an image. We determine
42 which modules will be used and give them appropriate initialization calls. }
44 {GLOBAL}
46 begin
47 { Initialize master control (includes parameter checking/processing) }
50 { Preprocessing }
52 begin
57 { Forward DCT }
59 { Entropy encoding: either Huffman or arithmetic coding. }
61 begin
63 end
64 else
65 begin
67 begin
68 {$ifdef C_PROGRESSIVE_SUPPORTED}
70 {$else}
72 {$endif}
73 end
74 else
78 { Need a full-image coefficient buffer in any multi-pass mode. }
85 { We can now tell the memory manager to allocate virtual arrays. }
88 { Write the datastream header (SOI) immediately.
89 Frame and scan headers are postponed till later.
90 This lets application insert special markers after the SOI. }