Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / compiler / libjpeg / main / jcodec.c
blob170c3603ae3b37cb409378238bcc6ef5b136b032
1 /*
2 $Id$
3 */
5 /*
6 * jcodec.c
8 * Copyright (C) 1998, Thomas G. Lane.
9 * This file is part of the Independent JPEG Group's software.
10 * For conditions of distribution and use, see the accompanying README file.
12 * This file contains utility functions for the JPEG codec(s).
15 #define JPEG_INTERNALS
16 #include "jinclude.h"
17 #include "jpeglib.h"
18 #include "jlossy.h"
19 #include "jlossls.h"
23 * Initialize the compression codec.
24 * This is called only once, during master selection.
27 JGLOBAL(void)
28 jinit_c_codec (j_compress_ptr cinfo)
30 if (cinfo->process == JPROC_LOSSLESS) {
31 #ifdef C_LOSSLESS_SUPPORTED
32 jinit_lossless_c_codec(cinfo);
33 #else
34 ERREXIT(cinfo, JERR_NOT_COMPILED);
35 #endif
36 } else
37 jinit_lossy_c_codec(cinfo);
42 * Initialize the decompression codec.
43 * This is called only once, during master selection.
46 JGLOBAL(void)
47 jinit_d_codec (j_decompress_ptr cinfo)
49 if (cinfo->process == JPROC_LOSSLESS) {
50 #ifdef D_LOSSLESS_SUPPORTED
51 jinit_lossless_d_codec(cinfo);
52 #else
53 ERREXIT(cinfo, JERR_NOT_COMPILED);
54 #endif
55 } else
56 jinit_lossy_d_codec(cinfo);