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
21 * Table H.1: Predictors for lossless coding.
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
,
43 /* Lossless-specific compression codec (compressor proper) */
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 */
56 /* Entropy encoding */
57 JMETHOD(JDIMENSION
, entropy_encode_mcus
, (j_compress_ptr cinfo
,
59 JDIMENSION MCU_row_num
,
60 JDIMENSION MCU_col_num
,
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 */
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
,
82 /* Pointer to data which is private to scaler module */
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) */
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 */
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
,
112 JDIMENSION MCU_row_num
,
113 JDIMENSION MCU_col_num
,
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 */
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
,
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 */