encode.h 1.89 KB
Newer Older
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
1
2
#ifndef ENCODE_H
#define ENCODE_H
3

4
5
6
7
8
9
#include <config.h>

#if HAVE_STDINT_H
# include <stdint.h>
#endif

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
10
#include "libaec.h"
11
12
13
14

#define M_CONTINUE 1
#define M_EXIT 0

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
15
16
17
struct internal_state {
    int (*mode)(struct aec_stream *);
    uint32_t (*get_sample)(struct aec_stream *);
18
    void (*get_rsi)(struct aec_stream *);
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
19
    void (*preprocess)(struct aec_stream *);
20
21
22
23

    int id_len;             /* bit length of code option identification key */
    int64_t xmin;           /* minimum integer for preprocessing */
    int64_t xmax;           /* maximum integer for preprocessing */
24
    int i;                  /* counter */
25
26
    uint32_t *data_pp;      /* RSI blocks of preprocessed input */
    uint32_t *data_raw;     /* RSI blocks of input */
27
    int blocks_avail;       /* remaining blocks in buffer */
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
28
    uint32_t *block_p;      /* pointer to current block */
29
30
31
32
33
    int block_len;          /* input block length in byte */
    uint8_t *cds_buf;       /* Buffer for one Coded Data Set */
    int cds_len;            /* max cds length in byte */
    uint8_t *cds_p;         /* pointer to current output */
    int direct_out;         /* output to strm->next_out (1)
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
34
35
36
37
38
39
40
                             * or cds_buf (0) */
    int bit_p;              /* bit pointer to the next unused bit in
                             * accumulator */
    int ref;                /* length of reference sample in current
                             * block i.e. 0 or 1 depending on whether
                             * the block has a reference sample or
                             * not */
41
42
43
44
    int zero_ref;           /* current zero block has a reference sample */
    int64_t zero_ref_sample;/* reference sample of zero block */
    int zero_blocks;        /* number of contiguous zero blocks */
    int k;                  /* splitting position */
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
45
    int kmax;
46
    int flush;              /* flush option copied from argument */
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
47
};
48

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
49
#endif /* ENCODE_H */