4 * @author Mathis Rosenhauer, Deutsches Klimarechenzentrum
5 * @author Moritz Hanke, Deutsches Klimarechenzentrum
6 * @author Joerg Behrens, Deutsches Klimarechenzentrum
7 * @author Luis Kornblueh, Max-Planck-Institut fuer Meteorologie
12 * Mathis Rosenhauer, Luis Kornblueh
16 * Deutsches Klimarechenzentrum GmbH Max-Planck-Institut fuer Meteorologie
17 * Bundesstr. 45a Bundesstr. 53
18 * 20146 Hamburg 20146 Hamburg
21 * All rights reserved.
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
27 * 1. Redistributions of source code must retain the above copyright
28 * notice, this list of conditions and the following disclaimer.
29 * 2. Redistributions in binary form must reproduce the above
30 * copyright notice, this list of conditions and the following
31 * disclaimer in the documentation and/or other materials provided
32 * with the distribution.
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
37 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
38 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
39 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
40 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
41 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
42 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
43 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
44 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
45 * OF THE POSSIBILITY OF SUCH DAMAGE.
47 * @section DESCRIPTION
49 * Adaptive Entropy Encoder
50 * Based on CCSDS documents 121.0-B-2 and 120.0-G-2
68 struct internal_state {
69 int (*mode)(struct aec_stream *);
70 uint32_t (*get_sample)(struct aec_stream *);
71 void (*get_rsi)(struct aec_stream *);
72 void (*preprocess)(struct aec_stream *);
74 int id_len; /* bit length of code option identification key */
75 int64_t xmin; /* minimum integer for preprocessing */
76 int64_t xmax; /* maximum integer for preprocessing */
78 uint32_t *data_pp; /* RSI blocks of preprocessed input */
79 uint32_t *data_raw; /* RSI blocks of input */
80 int blocks_avail; /* remaining blocks in buffer */
81 uint32_t *block; /* current (preprocessed) input block */
82 int rsi_len; /* reference sample interval in byte */
83 uint8_t *cds; /* current Coded Data Set output */
84 uint8_t *cds_buf; /* buffer for one CDS (only used if
85 * strm->next_out cannot hold full CDS) */
86 int cds_len; /* max cds length in byte */
87 int direct_out; /* cds points to strm->next_out (1)
89 int bits; /* Free bits (LSB) in output buffer or
91 int ref; /* length of reference sample in current
92 * block i.e. 0 or 1 depending on whether
93 * the block has a reference sample or
95 int zero_ref; /* current zero block has a reference sample */
96 int64_t zero_ref_sample;/* reference sample of zero block */
97 int zero_blocks; /* number of contiguous zero blocks */
98 int k; /* splitting position */
99 int kmax; /* maximum number for k depending on id_len */
100 int flush; /* flush option copied from argument */
103 #endif /* ENCODE_H */