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 PREDICTOR6_BUG (int) ((INT16) Rb + RIGHT_SHIFT((INT16) Ra - (INT16) Rc, 1))
27 #define PREDICTOR7 (int) RIGHT_SHIFT((INT32) Ra + (INT32) Rb, 1)
30 typedef JMETHOD(void, predict_difference_method_ptr,
31 (j_compress_ptr cinfo, int ci,
32 JSAMPROW input_buf, JSAMPROW prev_row,
33 JDIFFROW diff_buf, JDIMENSION width));
35 typedef JMETHOD(void, scaler_method_ptr,
36 (j_compress_ptr cinfo, int ci,
37 JSAMPROW input_buf, JSAMPROW output_buf,
40 /* Lossless-specific compression codec (compressor proper) */
42 struct jpeg_c_codec pub; /* public fields */
45 /* Difference buffer control */
46 JMETHOD(void, diff_start_pass, (j_compress_ptr cinfo,
47 J_BUF_MODE pass_mode));
49 /* Pointer to data which is private to diff controller */
53 /* Entropy encoding */
54 JMETHOD(JDIMENSION, entropy_encode_mcus, (j_compress_ptr cinfo,
56 JDIMENSION MCU_row_num,
57 JDIMENSION MCU_col_num,
60 /* Pointer to data which is private to entropy module */
61 void *entropy_private;
64 /* Prediction, differencing */
65 JMETHOD(void, predict_start_pass, (j_compress_ptr cinfo));
67 /* It is useful to allow each component to have a separate diff method. */
68 predict_difference_method_ptr predict_difference[MAX_COMPONENTS];
70 /* Pointer to data which is private to predictor module */
74 JMETHOD(void, scaler_start_pass, (j_compress_ptr cinfo));
75 JMETHOD(void, scaler_scale, (j_compress_ptr cinfo,
76 JSAMPROW input_buf, JSAMPROW output_buf,
79 /* Pointer to data which is private to scaler module */
82 } jpeg_lossless_c_codec;
84 typedef jpeg_lossless_c_codec * j_lossless_c_ptr;
87 typedef JMETHOD(void, predict_undifference_method_ptr,
88 (j_decompress_ptr cinfo, int comp_index,
89 JDIFFROW diff_buf, JDIFFROW prev_row,
90 JDIFFROW undiff_buf, JDIMENSION width));
92 /* Lossless-specific decompression codec (decompressor proper) */
94 struct jpeg_d_codec pub; /* public fields */
97 /* Difference buffer control */
98 JMETHOD(void, diff_start_input_pass, (j_decompress_ptr cinfo));
100 /* Pointer to data which is private to diff controller */
104 /* Entropy decoding */
105 JMETHOD(void, entropy_start_pass, (j_decompress_ptr cinfo));
106 JMETHOD(boolean, entropy_process_restart, (j_decompress_ptr cinfo));
107 JMETHOD(JDIMENSION, entropy_decode_mcus, (j_decompress_ptr cinfo,
109 JDIMENSION MCU_row_num,
110 JDIMENSION MCU_col_num,
113 /* Pointer to data which is private to entropy module */
114 void *entropy_private;
117 /* Prediction, undifferencing */
118 JMETHOD(void, predict_start_pass, (j_decompress_ptr cinfo));
119 JMETHOD(void, predict_process_restart, (j_decompress_ptr cinfo));
121 /* It is useful to allow each component to have a separate undiff method. */
122 predict_undifference_method_ptr predict_undifference[MAX_COMPONENTS];
124 /* Pointer to data which is private to predictor module */
128 JMETHOD(void, scaler_start_pass, (j_decompress_ptr cinfo));
129 JMETHOD(void, scaler_scale, (j_decompress_ptr cinfo,
130 JDIFFROW diff_buf, JSAMPROW output_buf,
133 /* Pointer to data which is private to scaler module */
134 void *scaler_private;
136 } jpeg_lossless_d_codec;
138 typedef jpeg_lossless_d_codec * j_lossless_d_ptr;
141 /* Compression module initialization routines */
142 EXTERN(void) jinit_lossless_c_codec JPP((j_compress_ptr cinfo));
143 EXTERN(void) jinit_lhuff_encoder JPP((j_compress_ptr cinfo));
144 EXTERN(void) jinit_differencer JPP((j_compress_ptr cinfo));
145 EXTERN(void) jinit_c_scaler JPP((j_compress_ptr cinfo));
146 /* Decompression module initialization routines */
147 EXTERN(void) jinit_lossless_d_codec JPP((j_decompress_ptr cinfo));
148 EXTERN(void) jinit_lhuff_decoder JPP((j_decompress_ptr cinfo));
149 EXTERN(void) jinit_undifferencer JPP((j_decompress_ptr cinfo));
150 EXTERN(void) jinit_d_scaler JPP((j_decompress_ptr cinfo));
152 #endif /* JLOSSLS_H */