Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / compiler / libjpeg / main / jlossls.h
blob150040937e0d623814ea81a8ccabdcdcbad2507e
1 /*
2 $Id$
3 */
5 /*
6 * jlossls.h
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 include file contains common declarations for the lossless JPEG
13 * codec modules.
16 #ifndef JLOSSLS_H
17 #define JLOSSLS_H
21 * Table H.1: Predictors for lossless coding.
24 #define PREDICTOR1 Ra
25 #define PREDICTOR2 Rb
26 #define PREDICTOR3 Rc
27 #define PREDICTOR4 (int) ((INT32) Ra + (INT32) Rb - (INT32) Rc)
28 #define PREDICTOR5 (int) ((INT32) Ra + RIGHT_SHIFT((INT32) Rb - (INT32) Rc, 1))
29 #define PREDICTOR6 (int) ((INT32) Rb + RIGHT_SHIFT((INT32) Ra - (INT32) Rc, 1))
30 #define PREDICTOR7 (int) RIGHT_SHIFT((INT32) Ra + (INT32) Rb, 1)
33 typedef JMETHOD(void, predict_difference_method_ptr,
34 (j_compress_ptr cinfo, int ci,
35 JSAMPROW input_buf, JSAMPROW prev_row,
36 JDIFFROW diff_buf, JDIMENSION width));
38 typedef JMETHOD(void, scaler_method_ptr,
39 (j_compress_ptr cinfo, int ci,
40 JSAMPROW input_buf, JSAMPROW output_buf,
41 JDIMENSION width));
43 /* Lossless-specific compression codec (compressor proper) */
44 typedef struct {
45 struct jpeg_c_codec pub; /* public fields */
48 /* Difference buffer control */
49 JMETHOD(void, diff_start_pass, (j_compress_ptr cinfo,
50 J_BUF_MODE pass_mode));
52 /* Pointer to data which is private to diff controller */
53 void *diff_private;
56 /* Entropy encoding */
57 JMETHOD(JDIMENSION, entropy_encode_mcus, (j_compress_ptr cinfo,
58 JDIFFIMAGE diff_buf,
59 JDIMENSION MCU_row_num,
60 JDIMENSION MCU_col_num,
61 JDIMENSION nMCU));
63 /* Pointer to data which is private to entropy module */
64 void *entropy_private;
67 /* Prediction, differencing */
68 JMETHOD(void, predict_start_pass, (j_compress_ptr cinfo));
70 /* It is useful to allow each component to have a separate diff method. */
71 predict_difference_method_ptr predict_difference[MAX_COMPONENTS];
73 /* Pointer to data which is private to predictor module */
74 void *pred_private;
76 /* Sample scaling */
77 JMETHOD(void, scaler_start_pass, (j_compress_ptr cinfo));
78 JMETHOD(void, scaler_scale, (j_compress_ptr cinfo,
79 JSAMPROW input_buf, JSAMPROW output_buf,
80 JDIMENSION width));
82 /* Pointer to data which is private to scaler module */
83 void *scaler_private;
85 } jpeg_lossless_c_codec;
87 typedef jpeg_lossless_c_codec * j_lossless_c_ptr;
90 typedef JMETHOD(void, predict_undifference_method_ptr,
91 (j_decompress_ptr cinfo, int comp_index,
92 JDIFFROW diff_buf, JDIFFROW prev_row,
93 JDIFFROW undiff_buf, JDIMENSION width));
95 /* Lossless-specific decompression codec (decompressor proper) */
96 typedef struct {
97 struct jpeg_d_codec pub; /* public fields */
100 /* Difference buffer control */
101 JMETHOD(void, diff_start_input_pass, (j_decompress_ptr cinfo));
103 /* Pointer to data which is private to diff controller */
104 void *diff_private;
107 /* Entropy decoding */
108 JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo));
109 JMETHOD(boolean, entropy_process_restart, (j_decompress_ptr cinfo));
110 JMETHOD(JDIMENSION, entropy_decode_mcus, (j_decompress_ptr cinfo,
111 JDIFFIMAGE diff_buf,
112 JDIMENSION MCU_row_num,
113 JDIMENSION MCU_col_num,
114 JDIMENSION nMCU));
116 /* Pointer to data which is private to entropy module */
117 void *entropy_private;
120 /* Prediction, undifferencing */
121 JMETHOD(void, predict_start_pass, (j_decompress_ptr cinfo));
122 JMETHOD(void, predict_process_restart, (j_decompress_ptr cinfo));
124 /* It is useful to allow each component to have a separate undiff method. */
125 predict_undifference_method_ptr predict_undifference[MAX_COMPONENTS];
127 /* Pointer to data which is private to predictor module */
128 void *pred_private;
130 /* Sample scaling */
131 JMETHOD(void, scaler_start_pass, (j_decompress_ptr cinfo));
132 JMETHOD(void, scaler_scale, (j_decompress_ptr cinfo,
133 JDIFFROW diff_buf, JSAMPROW output_buf,
134 JDIMENSION width));
136 /* Pointer to data which is private to scaler module */
137 void *scaler_private;
139 } jpeg_lossless_d_codec;
141 typedef jpeg_lossless_d_codec * j_lossless_d_ptr;
144 /* Compression module initialization routines */
145 JEXTERN(void) jinit_lhuff_encoder JPP((j_compress_ptr cinfo));
146 JEXTERN(void) jinit_differencer JPP((j_compress_ptr cinfo));
147 JEXTERN(void) jinit_c_scaler JPP((j_compress_ptr cinfo));
148 /* Decompression module initialization routines */
149 JEXTERN(void) jinit_lhuff_decoder JPP((j_decompress_ptr cinfo));
150 JEXTERN(void) jinit_undifferencer JPP((j_decompress_ptr cinfo));
151 JEXTERN(void) jinit_d_scaler JPP((j_decompress_ptr cinfo));
153 #endif /* JLOSSLS_H */