28 #ifndef AVCODEC_JPEGLS_H 29 #define AVCODEC_JPEGLS_H 43 int A[367], B[367], C[365], N[367];
44 int limit, reset, bpp, qbpp, maxval, range;
57 static inline int ff_jpegls_quantize(
JLSState *s,
int v)
89 static inline void ff_jpegls_downscale_state(
JLSState *state,
int Q)
91 if (state->N[Q] == state->reset) {
99 static inline int ff_jpegls_update_state_regular(
JLSState *state,
102 if(
FFABS(err) > 0xFFFF)
104 state->A[Q] +=
FFABS(err);
105 err *= state->twonear;
108 ff_jpegls_downscale_state(state, Q);
110 if (state->B[Q] <= -state->N[Q]) {
111 state->B[Q] = FFMAX(state->B[Q] + state->N[Q], 1 - state->N[Q]);
112 if (state->C[Q] > -128)
114 }
else if (state->B[Q] > 0) {
115 state->B[Q] = FFMIN(state->B[Q] - state->N[Q], 0);
116 if (state->C[Q] < 127)
123 #define R(a, i) (bits == 8 ? ((uint8_t *)(a))[i] : ((uint16_t *)(a))[i]) 124 #define W(a, i, v) (bits == 8 ? (((uint8_t *)(a))[i] = v) : (((uint16_t *)(a))[i] = v))
void ff_jpegls_init_state(JLSState *state)
Calculate initial JPEG-LS parameters.
Definition: jpegls.c:31
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:72
Libavcodec external API header.
void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all)
Calculate JPEG-LS codec values.
Definition: jpegls.c:62
main external API structure.
Definition: avcodec.h:1518
common internal api header.
common internal and external API header