28 #ifndef AVCODEC_JPEGLS_H 29 #define AVCODEC_JPEGLS_H 39 int A[367],
B[367],
C[365],
N[367];
87 if (state->
N[Q] == state->
reset) {
98 if(
FFABS(err) > 0xFFFF)
100 state->
A[Q] +=
FFABS(err);
106 if (state->
B[Q] <= -state->
N[Q]) {
107 state->
B[Q] =
FFMAX(state->
B[Q] + state->
N[Q], 1 - state->
N[Q]);
108 if (state->
C[Q] > -128)
110 }
else if (state->
B[Q] > 0) {
111 state->
B[Q] =
FFMIN(state->
B[Q] - state->
N[Q], 0);
112 if (state->
C[Q] < 127)
119 #define R(a, i) (bits == 8 ? ((uint8_t *)(a))[i] : ((uint16_t *)(a))[i]) 120 #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.
static int ff_jpegls_update_state_regular(JLSState *state, int Q, int err)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Libavcodec external API header.
void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all)
Calculate JPEG-LS codec values.
common internal api header.
common internal and external API header
static int ff_jpegls_quantize(JLSState *s, int v)
Calculate quantized gradient value, used for context determination.
static void ff_jpegls_downscale_state(JLSState *state, int Q)