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)
289 for (i = 1; i <= comps; i++) {
298 for (i = 1; i <= comps; i++) {
303 put_bits(&pb, 8, (comps > 1) ? 1 : 0);
325 for (i = 0; i < avctx->
height; i++) {
334 for (i = 0; i < avctx->
height; i++) {
336 t = *((uint16_t *)last);
342 int Rc[3] = { 0, 0, 0 };
344 width = avctx->
width * 3;
345 for (i = 0; i < avctx->
height; i++) {
346 for (j = 0; j < 3; j++) {
356 int Rc[3] = { 0, 0, 0 };
358 width = avctx->
width * 3;
359 for (i = 0; i < avctx->
height; i++) {
360 for (j = 2; j >= 0; j--) {
418 "Only grayscale and RGB24/BGR24 images are supported\n");