47 for (k = 0; (state->
N[Q] << k) < state->
A[Q]; k++)
50 map = !state->
near && !k && (2 * state->
B[Q] <= -state->
N[Q]);
54 if (err >= (state->
range + 1 >> 1)) {
56 val = 2 *
FFABS(err) - 1 - map;
69 int RItype,
int err,
int limit_add)
78 temp += state->
N[Q] >> 1;
79 for (k = 0; (state->
N[Q] << k) < temp; k++)
82 if (!k && err && (2 * state->
B[Q] < state->
N[Q]))
86 val = -(2 * err) - 1 - RItype + map;
88 val = 2 * err - RItype - map;
93 state->
A[Q] += (val + 1 - RItype) >> 1;
124 void *last,
void *cur,
int last2,
int w,
135 Ra = x ?
R(cur, x - stride) :
R(last, x);
137 Rc = x ?
R(last, x - stride) : last2;
138 Rd = (x >= w - stride) ?
R(last, x) :
R(last, x + stride);
147 int RUNval, RItype,
run;
151 while (x < w && (
FFABS(
R(cur, x) - RUNval) <= state->
near)) {
161 pred = RItype ? Ra : Rb;
162 err =
R(cur, x) -
pred;
164 if (!RItype && Ra > Rb)
173 if (RItype || (Rb >= Ra))
181 if (err >= state->
range + 1 >> 1)
195 pred =
mid_pred(Ra, Ra + Rb - Rc, Rb);
200 pred = av_clip(pred - state->
C[context], 0, state->
maxval);
201 err = pred -
R(cur, x);
204 pred = av_clip(pred + state->
C[context], 0, state->
maxval);
205 err =
R(cur, x) -
pred;
233 if (state->
T1 == state2.
T1 &&
234 state->
T2 == state2.
T2 &&
235 state->
T3 == state2.
T3 &&
250 const AVFrame *pict,
int *got_packet)
284 for (i = 1; i <= comps; i++) {
293 for (i = 1; i <= comps; i++) {
298 put_bits(&pb, 8, (comps > 1) ? 1 : 0);
320 for (i = 0; i < avctx->
height; i++) {
329 for (i = 0; i < avctx->
height; i++) {
331 t = *((uint16_t *)last);
337 int Rc[3] = { 0, 0, 0 };
339 width = avctx->
width * 3;
340 for (i = 0; i < avctx->
height; i++) {
341 for (j = 0; j < 3; j++) {
351 int Rc[3] = { 0, 0, 0 };
353 width = avctx->
width * 3;
354 for (i = 0; i < avctx->
height; i++) {
355 for (j = 2; j >= 0; j--) {
421 "Only grayscale and RGB24/BGR24 images are supported\n");