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.
8 * This include file contains common declarations for the lossless JPEG
17 * Table H.1: Predictors for lossless coding.
23 #define PREDICTOR4 (int) ((INT32) Ra + (INT32) Rb - (INT32) Rc)
24 #define PREDICTOR5 (int) ((INT32) Ra + RIGHT_SHIFT((INT32) Rb - (INT32) Rc, 1))
25 #define PREDICTOR6 (int) ((INT32) Rb + RIGHT_SHIFT((INT32) Ra - (INT32) Rc, 1))
26 #define PREDICTOR7 (int) RIGHT_SHIFT((INT32) Ra + (INT32) Rb, 1)
29 typedef JMETHOD(void, predict_difference_method_ptr,
30 (j_compress_ptr cinfo, int ci,
31 JSAMPROW input_buf, JSAMPROW prev_row,
32 JDIFFROW diff_buf, JDIMENSION width));
34 typedef JMETHOD(void, scaler_method_ptr,
35 (j_compress_ptr cinfo, int ci,
36 JSAMPROW input_buf, JSAMPROW output_buf,
39 /* Lossless-specific compression codec (compressor proper) */
41 struct jpeg_c_codec pub; /* public fields */
44 /* Difference buffer control */
45 JMETHOD(void, diff_start_pass, (j_compress_ptr cinfo,
46 J_BUF_MODE pass_mode));
48 /* Pointer to data which is private to diff controller */
52 /* Entropy encoding */
53 JMETHOD(JDIMENSION, entropy_encode_mcus, (j_compress_ptr cinfo,
55 JDIMENSION MCU_row_num,
56 JDIMENSION MCU_col_num,
59 /* Pointer to data which is private to entropy module */
60 void *entropy_private;
63 /* Prediction, differencing */
64 JMETHOD(void, predict_start_pass, (j_compress_ptr cinfo));
66 /* It is useful to allow each component to have a separate diff method. */
67 predict_difference_method_ptr predict_difference[MAX_COMPONENTS];
69 /* Pointer to data which is private to predictor module */
73 JMETHOD(void, scaler_start_pass, (j_compress_ptr cinfo));
74 JMETHOD(void, scaler_scale, (j_compress_ptr cinfo,
75 JSAMPROW input_buf, JSAMPROW output_buf,
78 /* Pointer to data which is private to scaler module */
81 } jpeg_lossless_c_codec;
83 typedef jpeg_lossless_c_codec * j_lossless_c_ptr;
86 typedef JMETHOD(void, predict_undifference_method_ptr,
87 (j_decompress_ptr cinfo, int comp_index,
88 JDIFFROW diff_buf, JDIFFROW prev_row,
89 JDIFFROW undiff_buf, JDIMENSION width));
91 /* Lossless-specific decompression codec (decompressor proper) */
93 struct jpeg_d_codec pub; /* public fields */
96 /* Difference buffer control */
97 JMETHOD(void, diff_start_input_pass, (j_decompress_ptr cinfo));
99 /* Pointer to data which is private to diff controller */
103 /* Entropy decoding */
104 JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo));
105 JMETHOD(boolean, entropy_process_restart, (j_decompress_ptr cinfo));
106 JMETHOD(JDIMENSION, entropy_decode_mcus, (j_decompress_ptr cinfo,
108 JDIMENSION MCU_row_num,
109 JDIMENSION MCU_col_num,
112 /* Pointer to data which is private to entropy module */
113 void *entropy_private;
116 /* Prediction, undifferencing */
117 JMETHOD(void, predict_start_pass, (j_decompress_ptr cinfo));
118 JMETHOD(void, predict_process_restart, (j_decompress_ptr cinfo));
120 /* It is useful to allow each component to have a separate undiff method. */
121 predict_undifference_method_ptr predict_undifference[MAX_COMPONENTS];
123 /* Pointer to data which is private to predictor module */
127 JMETHOD(void, scaler_start_pass, (j_decompress_ptr cinfo));
128 JMETHOD(void, scaler_scale, (j_decompress_ptr cinfo,
129 JDIFFROW diff_buf, JSAMPROW output_buf,
132 /* Pointer to data which is private to scaler module */
133 void *scaler_private;
135 } jpeg_lossless_d_codec;
137 typedef jpeg_lossless_d_codec * j_lossless_d_ptr;
140 /* Compression module initialization routines */
141 EXTERN(void) jinit_lossless_c_codec JPP((j_compress_ptr cinfo));
142 EXTERN(void) jinit_lhuff_encoder JPP((j_compress_ptr cinfo));
143 EXTERN(void) jinit_differencer JPP((j_compress_ptr cinfo));
144 EXTERN(void) jinit_c_scaler JPP((j_compress_ptr cinfo));
145 /* Decompression module initialization routines */
146 EXTERN(void) jinit_lossless_d_codec JPP((j_decompress_ptr cinfo));
147 EXTERN(void) jinit_lhuff_decoder JPP((j_decompress_ptr cinfo));
148 EXTERN(void) jinit_undifferencer JPP((j_decompress_ptr cinfo));
149 EXTERN(void) jinit_d_scaler JPP((j_decompress_ptr cinfo));
151 #endif /* JLOSSLS_H */