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

#include <inttypes.h>
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
5
#include "libaec.h"
6 7 8 9

#define M_CONTINUE 1
#define M_EXIT 0

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
10 11 12 13 14
struct internal_state {
    int (*mode)(struct aec_stream *);
    void (*get_block)(struct aec_stream *);
    uint32_t (*get_sample)(struct aec_stream *);
    void (*preprocess)(struct aec_stream *);
15 16 17 18

    int id_len;             /* bit length of code option identification key */
    int64_t xmin;           /* minimum integer for preprocessing */
    int64_t xmax;           /* maximum integer for preprocessing */
19
    int i;                  /* counter */
20
    uint32_t *block_buf;     /* RSI blocks of input */
21
    int blocks_avail;       /* remaining blocks in buffer */
22
    uint32_t *block_p;       /* pointer to current block */
23 24 25 26 27 28 29
    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)
                               or cds_buf (0) */
    int bit_p;              /* bit pointer to the next unused bit in accumulator */
30 31 32 33 34 35 36
    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 */
    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 */
37
    int flush;              /* flush option copied from argument */
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
38
};
39

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