]> Creatis software - gdcm.git/blob - src/gdcmjpeg/jlossls.h
Fix mistypings
[gdcm.git] / src / gdcmjpeg / jlossls.h
1 /*
2  * jlossls.h
3  *
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.
7  *
8  * This include file contains common declarations for the lossless JPEG
9  * codec modules.
10  */
11
12 #ifndef JLOSSLS_H
13 #define JLOSSLS_H
14
15
16 /*
17  * Table H.1: Predictors for lossless coding.
18  */
19
20 #define PREDICTOR1  Ra
21 #define PREDICTOR2  Rb
22 #define PREDICTOR3  Rc
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)
28
29
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));
34
35 typedef JMETHOD(void, scaler_method_ptr,
36     (j_compress_ptr cinfo, int ci,
37      JSAMPROW input_buf, JSAMPROW output_buf,
38      JDIMENSION width));
39
40 /* Lossless-specific compression codec (compressor proper) */
41 typedef struct {
42   struct jpeg_c_codec pub; /* public fields */
43
44
45   /* Difference buffer control */
46   JMETHOD(void, diff_start_pass, (j_compress_ptr cinfo,
47           J_BUF_MODE pass_mode));
48
49   /* Pointer to data which is private to diff controller */
50   void *diff_private;
51
52
53   /* Entropy encoding */
54   JMETHOD(JDIMENSION, entropy_encode_mcus, (j_compress_ptr cinfo,
55               JDIFFIMAGE diff_buf,
56               JDIMENSION MCU_row_num,
57               JDIMENSION MCU_col_num,
58               JDIMENSION nMCU));
59
60   /* Pointer to data which is private to entropy module */
61   void *entropy_private;
62
63
64   /* Prediction, differencing */
65   JMETHOD(void, predict_start_pass, (j_compress_ptr cinfo));
66
67   /* It is useful to allow each component to have a separate diff method. */
68   predict_difference_method_ptr predict_difference[MAX_COMPONENTS];
69
70   /* Pointer to data which is private to predictor module */
71   void *pred_private;
72
73   /* Sample scaling */
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,
77              JDIMENSION width));
78
79   /* Pointer to data which is private to scaler module */
80   void *scaler_private;
81
82 } jpeg_lossless_c_codec;
83
84 typedef jpeg_lossless_c_codec * j_lossless_c_ptr;
85
86
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));
91
92 /* Lossless-specific decompression codec (decompressor proper) */
93 typedef struct {
94   struct jpeg_d_codec pub; /* public fields */
95
96
97   /* Difference buffer control */
98   JMETHOD(void, diff_start_input_pass, (j_decompress_ptr cinfo));
99
100   /* Pointer to data which is private to diff controller */
101   void *diff_private;
102
103
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,
108               JDIFFIMAGE diff_buf,
109               JDIMENSION MCU_row_num,
110               JDIMENSION MCU_col_num,
111               JDIMENSION nMCU));
112
113   /* Pointer to data which is private to entropy module */
114   void *entropy_private;
115
116
117   /* Prediction, undifferencing */
118   JMETHOD(void, predict_start_pass, (j_decompress_ptr cinfo));
119   JMETHOD(void, predict_process_restart, (j_decompress_ptr cinfo));
120
121   /* It is useful to allow each component to have a separate undiff method. */
122   predict_undifference_method_ptr predict_undifference[MAX_COMPONENTS];
123
124   /* Pointer to data which is private to predictor module */
125   void *pred_private;
126
127   /* Sample scaling */
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,
131              JDIMENSION width));
132
133   /* Pointer to data which is private to scaler module */
134   void *scaler_private;
135
136 } jpeg_lossless_d_codec;
137
138 typedef jpeg_lossless_d_codec * j_lossless_d_ptr;
139
140
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));
151
152 #endif /* JLOSSLS_H */