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;
91 if (state->
N[Q] == state->
reset) {
102 if(
FFABS(err) > 0xFFFF)
104 state->
A[Q] +=
FFABS(err);
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.
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.
main external API structure.
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)