/src/dcmtk/dcmjpeg/libijg12/jcodec.c
Line | Count | Source |
1 | | /* |
2 | | * jcodec.c |
3 | | * |
4 | | * Copyright (C) 1998, Thomas G. Lane. |
5 | | * This file is part of the Independent JPEG Group's software. |
6 | | * For conditions of distribution and use, see the accompanying README file. |
7 | | * |
8 | | * This file contains utility functions for the JPEG codec(s). |
9 | | */ |
10 | | |
11 | | #define JPEG_INTERNALS |
12 | | #include "jinclude12.h" |
13 | | #include "jpeglib12.h" |
14 | | #include "jlossy12.h" |
15 | | #include "jlossls12.h" |
16 | | |
17 | | |
18 | | /* |
19 | | * Initialize the compression codec. |
20 | | * This is called only once, during master selection. |
21 | | */ |
22 | | |
23 | | GLOBAL(void) |
24 | | jinit_c_codec (j_compress_ptr cinfo) |
25 | 0 | { |
26 | 0 | if (cinfo->process == JPROC_LOSSLESS) { |
27 | 0 | #ifdef C_LOSSLESS_SUPPORTED |
28 | 0 | jinit_lossless_c_codec(cinfo); |
29 | | #else |
30 | | ERREXIT(cinfo, JERR_NOT_COMPILED); |
31 | | #endif |
32 | 0 | } else |
33 | 0 | jinit_lossy_c_codec(cinfo); |
34 | 0 | } |
35 | | |
36 | | |
37 | | /* |
38 | | * Initialize the decompression codec. |
39 | | * This is called only once, during master selection. |
40 | | */ |
41 | | |
42 | | GLOBAL(void) |
43 | | jinit_d_codec (j_decompress_ptr cinfo) |
44 | 0 | { |
45 | 0 | if (cinfo->process == JPROC_LOSSLESS) { |
46 | 0 | #ifdef D_LOSSLESS_SUPPORTED |
47 | 0 | jinit_lossless_d_codec(cinfo); |
48 | | #else |
49 | | ERREXIT(cinfo, JERR_NOT_COMPILED); |
50 | | #endif |
51 | 0 | } else |
52 | 0 | jinit_lossy_d_codec(cinfo); |
53 | 0 | } |